Skip to content
Clone

feat(web): regenerate the API client for the full public surface

The client previously covered only the auth tag, so the workspace had no typed
access to spaces, chat, issues, pulls or repositories. Regenerate every public
operation (39 tags) so callers get typed envelopes and path/query parameters.
ZhenYi committed
parent 8393324 commit 8f26a37 Browse files

300 files changed

+19508 −401

This change is very large, so some diffs are not shown. Clone the repository to see the full change.

File tree 300
Added packages/apiclient/account/accept-agreement.schemas.ts View packages/apiclient/account/accept-agreement.schemas.ts
@@ -0,0 +1,122 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export interface AcceptAgreementCmd {
95 version: string;
96}
97
98export type EnvelopeAcceptAgreementRespData = {
99 recorded: boolean;
100};
101
102export interface EnvelopeAcceptAgreementResp {
103 code: number;
104 data?: EnvelopeAcceptAgreementRespData;
105 /** @nullable */
106 error?: string | null;
107 /** @nullable */
108 error_code?: string | null;
109 message: string;
110 request_id?: string;
111}
112
113export interface EnvelopeNoData {
114 code: number;
115 data?: unknown;
116 /** @nullable */
117 error?: string | null;
118 /** @nullable */
119 error_code?: string | null;
120 message: string;
121 request_id?: string;
122}
Added packages/apiclient/account/accept-agreement.ts View packages/apiclient/account/accept-agreement.ts
@@ -0,0 +1,178 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 AcceptAgreementCmd,
96 EnvelopeAcceptAgreementResp,
97 EnvelopeNoData,
98} from "./accept-agreement.schemas";
99
100export type acceptAgreementResponse200 = {
101 data: EnvelopeAcceptAgreementResp;
102 status: 200;
103};
104
105export type acceptAgreementResponse400 = {
106 data: EnvelopeNoData;
107 status: 400;
108};
109
110export type acceptAgreementResponse401 = {
111 data: EnvelopeNoData;
112 status: 401;
113};
114
115export type acceptAgreementResponseSuccess = acceptAgreementResponse200 & {
116 headers: Headers;
117};
118export type acceptAgreementResponseError = (
119 acceptAgreementResponse400 | acceptAgreementResponse401
120) & {
121 headers: Headers;
122};
123
124export type acceptAgreementResponse =
125 acceptAgreementResponseSuccess | acceptAgreementResponseError;
126
127export const getAcceptAgreementUrl = (key: string) => {
128 return `/api/v1/me/agreements/${key}`;
129};
130
131/**
132 * 记录当前用户已同意指定版本的协议文本。
133 */
134export const acceptAgreement = async (
135 key: string,
136 acceptAgreementCmd: AcceptAgreementCmd,
137 options?: RequestInit,
138): Promise<acceptAgreementResponse> => {
139 const getHeaders = (
140 h?: NonNullable<RequestInit["headers"]>,
141 ): Record<string, string | readonly string[]> => {
142 if (!h) return {};
143 if (h instanceof Headers) return Object.fromEntries(h.entries());
144 if (Symbol.iterator in h) {
145 return Object.fromEntries(
146 Array.from(
147 h as Iterable<Iterable<string>>,
148 (entry) => Array.from(entry) as [string, string],
149 ),
150 );
151 }
152 const headers: Record<string, string | readonly string[]> = {};
153 for (const [name, value] of Object.entries<
154 string | readonly string[] | undefined
155 >(h)) {
156 if (value !== undefined) headers[name] = value;
157 }
158 return headers;
159 };
160 const res = await fetch(getAcceptAgreementUrl(key), {
161 ...options,
162 method: "PUT",
163 headers: {
164 "Content-Type": "application/json",
165 ...getHeaders(options?.headers),
166 },
167 body: JSON.stringify(acceptAgreementCmd),
168 });
169
170 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
171
172 const data: acceptAgreementResponse["data"] = body ? JSON.parse(body) : {};
173 return {
174 data,
175 status: res.status,
176 headers: res.headers,
177 } as acceptAgreementResponse;
178};
Added packages/apiclient/account/account-deletion-status.schemas.ts View packages/apiclient/account/account-deletion-status.schemas.ts
@@ -0,0 +1,122 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeAccountDeletionDtoData = {
95 /** @nullable */
96 last_error?: string | null;
97 purge_after: string;
98 requested_at: string;
99 status: string;
100};
101
102export interface EnvelopeAccountDeletionDto {
103 code: number;
104 data?: EnvelopeAccountDeletionDtoData;
105 /** @nullable */
106 error?: string | null;
107 /** @nullable */
108 error_code?: string | null;
109 message: string;
110 request_id?: string;
111}
112
113export interface EnvelopeNoData {
114 code: number;
115 data?: unknown;
116 /** @nullable */
117 error?: string | null;
118 /** @nullable */
119 error_code?: string | null;
120 message: string;
121 request_id?: string;
122}
Added packages/apiclient/account/account-deletion-status.ts View packages/apiclient/account/account-deletion-status.ts
@@ -0,0 +1,146 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopeAccountDeletionDto,
96 EnvelopeNoData,
97} from "./account-deletion-status.schemas";
98
99export type accountDeletionStatusResponse200 = {
100 data: EnvelopeAccountDeletionDto;
101 status: 200;
102};
103
104export type accountDeletionStatusResponse401 = {
105 data: EnvelopeNoData;
106 status: 401;
107};
108
109export type accountDeletionStatusResponseSuccess =
110 accountDeletionStatusResponse200 & {
111 headers: Headers;
112 };
113export type accountDeletionStatusResponseError =
114 accountDeletionStatusResponse401 & {
115 headers: Headers;
116 };
117
118export type accountDeletionStatusResponse =
119 accountDeletionStatusResponseSuccess | accountDeletionStatusResponseError;
120
121export const getAccountDeletionStatusUrl = () => {
122 return `/api/v1/me/deletion`;
123};
124
125/**
126 * 读取当前账号的删除计划;没有计划时 data 为 null。
127 */
128export const accountDeletionStatus = async (
129 options?: RequestInit,
130): Promise<accountDeletionStatusResponse> => {
131 const res = await fetch(getAccountDeletionStatusUrl(), {
132 ...options,
133 method: "GET",
134 });
135
136 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
137
138 const data: accountDeletionStatusResponse["data"] = body
139 ? JSON.parse(body)
140 : {};
141 return {
142 data,
143 status: res.status,
144 headers: res.headers,
145 } as accountDeletionStatusResponse;
146};
Added packages/apiclient/account/cancel-account-deletion.schemas.ts View packages/apiclient/account/cancel-account-deletion.schemas.ts
@@ -0,0 +1,103 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export interface EnvelopeNoData {
95 code: number;
96 data?: unknown;
97 /** @nullable */
98 error?: string | null;
99 /** @nullable */
100 error_code?: string | null;
101 message: string;
102 request_id?: string;
103}
Added packages/apiclient/account/cancel-account-deletion.ts View packages/apiclient/account/cancel-account-deletion.ts
@@ -0,0 +1,156 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { EnvelopeNoData } from "./cancel-account-deletion.schemas";
95
96export type cancelAccountDeletionResponse200 = {
97 data: EnvelopeNoData;
98 status: 200;
99};
100
101export type cancelAccountDeletionResponse401 = {
102 data: EnvelopeNoData;
103 status: 401;
104};
105
106export type cancelAccountDeletionResponse404 = {
107 data: EnvelopeNoData;
108 status: 404;
109};
110
111export type cancelAccountDeletionResponse409 = {
112 data: EnvelopeNoData;
113 status: 409;
114};
115
116export type cancelAccountDeletionResponseSuccess =
117 cancelAccountDeletionResponse200 & {
118 headers: Headers;
119 };
120export type cancelAccountDeletionResponseError = (
121 | cancelAccountDeletionResponse401
122 | cancelAccountDeletionResponse404
123 | cancelAccountDeletionResponse409
124) & {
125 headers: Headers;
126};
127
128export type cancelAccountDeletionResponse =
129 cancelAccountDeletionResponseSuccess | cancelAccountDeletionResponseError;
130
131export const getCancelAccountDeletionUrl = () => {
132 return `/api/v1/me/deletion`;
133};
134
135/**
136 * 撤销尚未执行的账号删除计划;已撤销的会话与令牌不会恢复,需重新登录。
137 */
138export const cancelAccountDeletion = async (
139 options?: RequestInit,
140): Promise<cancelAccountDeletionResponse> => {
141 const res = await fetch(getCancelAccountDeletionUrl(), {
142 ...options,
143 method: "DELETE",
144 });
145
146 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
147
148 const data: cancelAccountDeletionResponse["data"] = body
149 ? JSON.parse(body)
150 : {};
151 return {
152 data,
153 status: res.status,
154 headers: res.headers,
155 } as cancelAccountDeletionResponse;
156};
Added packages/apiclient/account/get-preferences.schemas.ts View packages/apiclient/account/get-preferences.schemas.ts
@@ -0,0 +1,132 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type Audience = "Everyone" | "FollowingOnly" | "Nobody";
95export interface EnvelopeNoData {
96 code: number;
97 data?: unknown;
98 /** @nullable */
99 error?: string | null;
100 /** @nullable */
101 error_code?: string | null;
102 message: string;
103 request_id?: string;
104}
105
106export type EnvelopeUserPreferencesDtoData = {
107 allow_dms_from: Audience;
108 allow_mentions_from: Audience;
109 /** Default view for the 问题集 page: `board` or `list`. */
110 board_view_mode: string;
111 /** @nullable */
112 diff_view_style?: string | null;
113 email_digest: boolean;
114 email_flags: number;
115 in_app_flags: number;
116 /** @nullable */
117 mute_until?: string | null;
118 push_flags: number;
119 show_online_status: boolean;
120 theme_mode: string;
121};
122
123export interface EnvelopeUserPreferencesDto {
124 code: number;
125 data?: EnvelopeUserPreferencesDtoData;
126 /** @nullable */
127 error?: string | null;
128 /** @nullable */
129 error_code?: string | null;
130 message: string;
131 request_id?: string;
132}
Added packages/apiclient/account/get-preferences.ts View packages/apiclient/account/get-preferences.ts
@@ -0,0 +1,149 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopeNoData,
96 EnvelopeUserPreferencesDto,
97} from "./get-preferences.schemas";
98
99export type getPreferencesResponse200 = {
100 data: EnvelopeUserPreferencesDto;
101 status: 200;
102};
103
104export type getPreferencesResponse401 = {
105 data: EnvelopeNoData;
106 status: 401;
107};
108
109export type getPreferencesResponse404 = {
110 data: EnvelopeNoData;
111 status: 404;
112};
113
114export type getPreferencesResponseSuccess = getPreferencesResponse200 & {
115 headers: Headers;
116};
117export type getPreferencesResponseError = (
118 getPreferencesResponse401 | getPreferencesResponse404
119) & {
120 headers: Headers;
121};
122
123export type getPreferencesResponse =
124 getPreferencesResponseSuccess | getPreferencesResponseError;
125
126export const getGetPreferencesUrl = () => {
127 return `/api/v1/me/preferences`;
128};
129
130/**
131 * 读取当前用户的通知与界面偏好,未配置时返回默认值。
132 */
133export const getPreferences = async (
134 options?: RequestInit,
135): Promise<getPreferencesResponse> => {
136 const res = await fetch(getGetPreferencesUrl(), {
137 ...options,
138 method: "GET",
139 });
140
141 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
142
143 const data: getPreferencesResponse["data"] = body ? JSON.parse(body) : {};
144 return {
145 data,
146 status: res.status,
147 headers: res.headers,
148 } as getPreferencesResponse;
149};
Added packages/apiclient/account/index.ts View packages/apiclient/account/index.ts
@@ -0,0 +1,12 @@
1export * from "./list-agreements";
2export * from "./me";
3export * from "./update-profile";
4export * from "./accept-agreement";
5export * from "./account-deletion-status";
6export * from "./request-account-deletion";
7export * from "./cancel-account-deletion";
8export * from "./list-devices";
9export * from "./mark-notifications-read";
10export * from "./get-preferences";
11export * from "./update-preferences";
12export * from "./update-username";
Added packages/apiclient/account/list-agreements.schemas.ts View packages/apiclient/account/list-agreements.schemas.ts
@@ -0,0 +1,121 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export interface EnvelopeNoData {
95 code: number;
96 data?: unknown;
97 /** @nullable */
98 error?: string | null;
99 /** @nullable */
100 error_code?: string | null;
101 message: string;
102 request_id?: string;
103}
104
105export type EnvelopeVecAgreementDocDataItem = {
106 content_md: string;
107 key: string;
108 title: string;
109 version: string;
110};
111
112export interface EnvelopeVecAgreementDoc {
113 code: number;
114 data?: EnvelopeVecAgreementDocDataItem[];
115 /** @nullable */
116 error?: string | null;
117 /** @nullable */
118 error_code?: string | null;
119 message: string;
120 request_id?: string;
121}
Added packages/apiclient/account/list-agreements.ts View packages/apiclient/account/list-agreements.ts
@@ -0,0 +1,142 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopeNoData,
96 EnvelopeVecAgreementDoc,
97} from "./list-agreements.schemas";
98
99export type listAgreementsResponse200 = {
100 data: EnvelopeVecAgreementDoc;
101 status: 200;
102};
103
104export type listAgreementsResponse404 = {
105 data: EnvelopeNoData;
106 status: 404;
107};
108
109export type listAgreementsResponseSuccess = listAgreementsResponse200 & {
110 headers: Headers;
111};
112export type listAgreementsResponseError = listAgreementsResponse404 & {
113 headers: Headers;
114};
115
116export type listAgreementsResponse =
117 listAgreementsResponseSuccess | listAgreementsResponseError;
118
119export const getListAgreementsUrl = () => {
120 return `/api/v1/auth/agreements`;
121};
122
123/**
124 * 返回服务端配置中的协议列表及其当前版本与正文。
125 */
126export const listAgreements = async (
127 options?: RequestInit,
128): Promise<listAgreementsResponse> => {
129 const res = await fetch(getListAgreementsUrl(), {
130 ...options,
131 method: "GET",
132 });
133
134 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
135
136 const data: listAgreementsResponse["data"] = body ? JSON.parse(body) : {};
137 return {
138 data,
139 status: res.status,
140 headers: res.headers,
141 } as listAgreementsResponse;
142};
Added packages/apiclient/account/list-devices.schemas.ts View packages/apiclient/account/list-devices.schemas.ts
@@ -0,0 +1,139 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopePageDeviceDtoDataItemsItem = {
95 /** @nullable */
96 device_name?: string | null;
97 /** @nullable */
98 device_type?: string | null;
99 first_seen_at: string;
100 id: string;
101 is_trusted: boolean;
102 last_seen_at: string;
103 /** @nullable */
104 os?: string | null;
105};
106
107export type EnvelopePageDeviceDtoData = {
108 items: EnvelopePageDeviceDtoDataItemsItem[];
109 /** @minimum 0 */
110 limit: number;
111 /** @minimum 0 */
112 offset: number;
113 /** @minimum 0 */
114 total: number;
115};
116
117export interface EnvelopePageDeviceDto {
118 code: number;
119 data?: EnvelopePageDeviceDtoData;
120 /** @nullable */
121 error?: string | null;
122 /** @nullable */
123 error_code?: string | null;
124 message: string;
125 request_id?: string;
126}
127
128export type ListDevicesParams = {
129 /**
130 * @minimum 0
131 * @nullable
132 */
133 limit?: number | null;
134 /**
135 * @minimum 0
136 * @nullable
137 */
138 offset?: number | null;
139};
Added packages/apiclient/account/list-devices.ts View packages/apiclient/account/list-devices.ts
@@ -0,0 +1,155 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopePageDeviceDto,
96 ListDevicesParams,
97} from "./list-devices.schemas";
98
99export type listDevicesResponse200 = {
100 data: EnvelopePageDeviceDto;
101 status: 200;
102};
103
104export type listDevicesResponse401 = {
105 data: EnvelopePageDeviceDto;
106 status: 401;
107};
108
109export type listDevicesResponseSuccess = listDevicesResponse200 & {
110 headers: Headers;
111};
112export type listDevicesResponseError = listDevicesResponse401 & {
113 headers: Headers;
114};
115
116export type listDevicesResponse =
117 listDevicesResponseSuccess | listDevicesResponseError;
118
119export const getListDevicesUrl = (params?: ListDevicesParams) => {
120 const normalizedParams = new URLSearchParams();
121
122 Object.entries(params || {}).forEach(([key, value]) => {
123 if (value !== undefined) {
124 normalizedParams.append(key, value === null ? "null" : String(value));
125 }
126 });
127
128 const stringifiedParams = normalizedParams.toString();
129
130 return stringifiedParams.length > 0
131 ? `/api/v1/me/devices?${stringifiedParams}`
132 : `/api/v1/me/devices`;
133};
134
135/**
136 * 按会话的用户代理归并出当前账号出现过的设备及其最近活跃时间。
137 */
138export const listDevices = async (
139 params?: ListDevicesParams,
140 options?: RequestInit,
141): Promise<listDevicesResponse> => {
142 const res = await fetch(getListDevicesUrl(params), {
143 ...options,
144 method: "GET",
145 });
146
147 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
148
149 const data: listDevicesResponse["data"] = body ? JSON.parse(body) : {};
150 return {
151 data,
152 status: res.status,
153 headers: res.headers,
154 } as listDevicesResponse;
155};
Added packages/apiclient/account/mark-notifications-read.schemas.ts View packages/apiclient/account/mark-notifications-read.schemas.ts
@@ -0,0 +1,125 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeMarkedCountRespData = {
95 /** @minimum 0 */
96 marked: number;
97};
98
99export interface EnvelopeMarkedCountResp {
100 code: number;
101 data?: EnvelopeMarkedCountRespData;
102 /** @nullable */
103 error?: string | null;
104 /** @nullable */
105 error_code?: string | null;
106 message: string;
107 request_id?: string;
108}
109
110export interface EnvelopeNoData {
111 code: number;
112 data?: unknown;
113 /** @nullable */
114 error?: string | null;
115 /** @nullable */
116 error_code?: string | null;
117 message: string;
118 request_id?: string;
119}
120
121export interface MarkNotificationsReadCmd {
122 all?: boolean;
123 /** @nullable */
124 ids?: string[] | null;
125}
Added packages/apiclient/account/mark-notifications-read.ts View packages/apiclient/account/mark-notifications-read.ts
@@ -0,0 +1,180 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopeMarkedCountResp,
96 EnvelopeNoData,
97 MarkNotificationsReadCmd,
98} from "./mark-notifications-read.schemas";
99
100export type markNotificationsReadResponse200 = {
101 data: EnvelopeMarkedCountResp;
102 status: 200;
103};
104
105export type markNotificationsReadResponse400 = {
106 data: EnvelopeNoData;
107 status: 400;
108};
109
110export type markNotificationsReadResponse401 = {
111 data: EnvelopeNoData;
112 status: 401;
113};
114
115export type markNotificationsReadResponseSuccess =
116 markNotificationsReadResponse200 & {
117 headers: Headers;
118 };
119export type markNotificationsReadResponseError = (
120 markNotificationsReadResponse400 | markNotificationsReadResponse401
121) & {
122 headers: Headers;
123};
124
125export type markNotificationsReadResponse =
126 markNotificationsReadResponseSuccess | markNotificationsReadResponseError;
127
128export const getMarkNotificationsReadUrl = () => {
129 return `/api/v1/me/notifications/read`;
130};
131
132/**
133 * 按通知 ID 集合或 all=true 将当前用户的通知标记为已读。
134 */
135export const markNotificationsRead = async (
136 markNotificationsReadCmd: MarkNotificationsReadCmd,
137 options?: RequestInit,
138): Promise<markNotificationsReadResponse> => {
139 const getHeaders = (
140 h?: NonNullable<RequestInit["headers"]>,
141 ): Record<string, string | readonly string[]> => {
142 if (!h) return {};
143 if (h instanceof Headers) return Object.fromEntries(h.entries());
144 if (Symbol.iterator in h) {
145 return Object.fromEntries(
146 Array.from(
147 h as Iterable<Iterable<string>>,
148 (entry) => Array.from(entry) as [string, string],
149 ),
150 );
151 }
152 const headers: Record<string, string | readonly string[]> = {};
153 for (const [name, value] of Object.entries<
154 string | readonly string[] | undefined
155 >(h)) {
156 if (value !== undefined) headers[name] = value;
157 }
158 return headers;
159 };
160 const res = await fetch(getMarkNotificationsReadUrl(), {
161 ...options,
162 method: "PUT",
163 headers: {
164 "Content-Type": "application/json",
165 ...getHeaders(options?.headers),
166 },
167 body: JSON.stringify(markNotificationsReadCmd),
168 });
169
170 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
171
172 const data: markNotificationsReadResponse["data"] = body
173 ? JSON.parse(body)
174 : {};
175 return {
176 data,
177 status: res.status,
178 headers: res.headers,
179 } as markNotificationsReadResponse;
180};
Added packages/apiclient/account/me.schemas.ts View packages/apiclient/account/me.schemas.ts
@@ -0,0 +1,164 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export interface ProfileDto {
95 /** @nullable */
96 bio?: string | null;
97 /** @nullable */
98 company?: string | null;
99 /** @nullable */
100 date_of_birth?: string | null;
101 /** @nullable */
102 location?: string | null;
103 /** @nullable */
104 privacy_agreed_at?: string | null;
105 /** @nullable */
106 pronouns?: string | null;
107 /** @nullable */
108 real_name?: string | null;
109 show_activity: boolean;
110 show_email: boolean;
111 show_location: boolean;
112 show_real_name: boolean;
113 /** @nullable */
114 website?: string | null;
115}
116
117export type ProfileVisibility =
118 "Public" | "RegisteredOnly" | "MembersOnly" | "Private";
119export interface UserMeDto {
120 avatar_url: string;
121 bot: boolean;
122 created_at: string;
123 display_name: string;
124 is_active: boolean;
125 is_restricted: boolean;
126 /** @nullable */
127 language?: string | null;
128 /** @nullable */
129 locale?: string | null;
130 prohibit_login: boolean;
131 system: boolean;
132 /** @nullable */
133 timezone?: string | null;
134 user_id: number;
135 username: string;
136 visibility: ProfileVisibility;
137}
138
139export type EnvelopeMeRespData = {
140 profile?: null | ProfileDto;
141 user: UserMeDto;
142};
143
144export interface EnvelopeMeResp {
145 code: number;
146 data?: EnvelopeMeRespData;
147 /** @nullable */
148 error?: string | null;
149 /** @nullable */
150 error_code?: string | null;
151 message: string;
152 request_id?: string;
153}
154
155export interface EnvelopeNoData {
156 code: number;
157 data?: unknown;
158 /** @nullable */
159 error?: string | null;
160 /** @nullable */
161 error_code?: string | null;
162 message: string;
163 request_id?: string;
164}
Added packages/apiclient/account/me.ts View packages/apiclient/account/me.ts
@@ -0,0 +1,137 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { EnvelopeMeResp, EnvelopeNoData } from "./me.schemas";
95
96export type meResponse200 = {
97 data: EnvelopeMeResp;
98 status: 200;
99};
100
101export type meResponse401 = {
102 data: EnvelopeNoData;
103 status: 401;
104};
105
106export type meResponse404 = {
107 data: EnvelopeNoData;
108 status: 404;
109};
110
111export type meResponseSuccess = meResponse200 & {
112 headers: Headers;
113};
114export type meResponseError = (meResponse401 | meResponse404) & {
115 headers: Headers;
116};
117
118export type meResponse = meResponseSuccess | meResponseError;
119
120export const getMeUrl = () => {
121 return `/api/v1/me`;
122};
123
124/**
125 * 返回当前登录用户的身份、账号状态与资料。
126 */
127export const me = async (options?: RequestInit): Promise<meResponse> => {
128 const res = await fetch(getMeUrl(), {
129 ...options,
130 method: "GET",
131 });
132
133 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
134
135 const data: meResponse["data"] = body ? JSON.parse(body) : {};
136 return { data, status: res.status, headers: res.headers } as meResponse;
137};
Added packages/apiclient/account/request-account-deletion.schemas.ts View packages/apiclient/account/request-account-deletion.schemas.ts
@@ -0,0 +1,122 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeAccountDeletionDtoData = {
95 /** @nullable */
96 last_error?: string | null;
97 purge_after: string;
98 requested_at: string;
99 status: string;
100};
101
102export interface EnvelopeAccountDeletionDto {
103 code: number;
104 data?: EnvelopeAccountDeletionDtoData;
105 /** @nullable */
106 error?: string | null;
107 /** @nullable */
108 error_code?: string | null;
109 message: string;
110 request_id?: string;
111}
112
113export interface EnvelopeNoData {
114 code: number;
115 data?: unknown;
116 /** @nullable */
117 error?: string | null;
118 /** @nullable */
119 error_code?: string | null;
120 message: string;
121 request_id?: string;
122}
Added packages/apiclient/account/request-account-deletion.ts View packages/apiclient/account/request-account-deletion.ts
@@ -0,0 +1,152 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopeAccountDeletionDto,
96 EnvelopeNoData,
97} from "./request-account-deletion.schemas";
98
99export type requestAccountDeletionResponse200 = {
100 data: EnvelopeAccountDeletionDto;
101 status: 200;
102};
103
104export type requestAccountDeletionResponse401 = {
105 data: EnvelopeNoData;
106 status: 401;
107};
108
109export type requestAccountDeletionResponse409 = {
110 data: EnvelopeNoData;
111 status: 409;
112};
113
114export type requestAccountDeletionResponseSuccess =
115 requestAccountDeletionResponse200 & {
116 headers: Headers;
117 };
118export type requestAccountDeletionResponseError = (
119 requestAccountDeletionResponse401 | requestAccountDeletionResponse409
120) & {
121 headers: Headers;
122};
123
124export type requestAccountDeletionResponse =
125 requestAccountDeletionResponseSuccess | requestAccountDeletionResponseError;
126
127export const getRequestAccountDeletionUrl = () => {
128 return `/api/v1/me/deletion`;
129};
130
131/**
132 * 申请删除当前账号:立即软删并撤销全部会话/令牌/SSH 公钥,宽限期后匿名化。仍有活跃组织 OWNER 身份时返回 409。
133 */
134export const requestAccountDeletion = async (
135 options?: RequestInit,
136): Promise<requestAccountDeletionResponse> => {
137 const res = await fetch(getRequestAccountDeletionUrl(), {
138 ...options,
139 method: "POST",
140 });
141
142 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
143
144 const data: requestAccountDeletionResponse["data"] = body
145 ? JSON.parse(body)
146 : {};
147 return {
148 data,
149 status: res.status,
150 headers: res.headers,
151 } as requestAccountDeletionResponse;
152};
Added packages/apiclient/account/update-preferences.schemas.ts View packages/apiclient/account/update-preferences.schemas.ts
@@ -0,0 +1,159 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type Audience = "Everyone" | "FollowingOnly" | "Nobody";
95export interface EnvelopeNoData {
96 code: number;
97 data?: unknown;
98 /** @nullable */
99 error?: string | null;
100 /** @nullable */
101 error_code?: string | null;
102 message: string;
103 request_id?: string;
104}
105
106export type EnvelopeUserPreferencesDtoData = {
107 allow_dms_from: Audience;
108 allow_mentions_from: Audience;
109 /** Default view for the 问题集 page: `board` or `list`. */
110 board_view_mode: string;
111 /** @nullable */
112 diff_view_style?: string | null;
113 email_digest: boolean;
114 email_flags: number;
115 in_app_flags: number;
116 /** @nullable */
117 mute_until?: string | null;
118 push_flags: number;
119 show_online_status: boolean;
120 theme_mode: string;
121};
122
123export interface EnvelopeUserPreferencesDto {
124 code: number;
125 data?: EnvelopeUserPreferencesDtoData;
126 /** @nullable */
127 error?: string | null;
128 /** @nullable */
129 error_code?: string | null;
130 message: string;
131 request_id?: string;
132}
133
134export interface UpdatePreferencesCmd {
135 allow_dms_from?: null | Audience;
136 allow_mentions_from?: null | Audience;
137 /** @nullable */
138 board_view_mode?: string | null;
139 /** @nullable */
140 diff_view_style?: string | null;
141 /** @nullable */
142 email_digest?: boolean | null;
143 /** @nullable */
144 email_flags?: number | null;
145 /** @nullable */
146 in_app_flags?: number | null;
147 /**
148 * 三态:缺省不动、`null` 清除、给值设置(与 `lib/webapi/src/openapi.rs`
149 * 声明的 PATCH 语义一致)。
150 * @nullable
151 */
152 mute_until?: string | null;
153 /** @nullable */
154 push_flags?: number | null;
155 /** @nullable */
156 show_online_status?: boolean | null;
157 /** @nullable */
158 theme_mode?: string | null;
159}
Added packages/apiclient/account/update-preferences.ts View packages/apiclient/account/update-preferences.ts
@@ -0,0 +1,177 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopeNoData,
96 EnvelopeUserPreferencesDto,
97 UpdatePreferencesCmd,
98} from "./update-preferences.schemas";
99
100export type updatePreferencesResponse200 = {
101 data: EnvelopeUserPreferencesDto;
102 status: 200;
103};
104
105export type updatePreferencesResponse400 = {
106 data: EnvelopeNoData;
107 status: 400;
108};
109
110export type updatePreferencesResponse401 = {
111 data: EnvelopeNoData;
112 status: 401;
113};
114
115export type updatePreferencesResponseSuccess = updatePreferencesResponse200 & {
116 headers: Headers;
117};
118export type updatePreferencesResponseError = (
119 updatePreferencesResponse400 | updatePreferencesResponse401
120) & {
121 headers: Headers;
122};
123
124export type updatePreferencesResponse =
125 updatePreferencesResponseSuccess | updatePreferencesResponseError;
126
127export const getUpdatePreferencesUrl = () => {
128 return `/api/v1/me/preferences`;
129};
130
131/**
132 * 增量更新当前用户的通知、界面和静音等偏好设置。
133 */
134export const updatePreferences = async (
135 updatePreferencesCmd: UpdatePreferencesCmd,
136 options?: RequestInit,
137): Promise<updatePreferencesResponse> => {
138 const getHeaders = (
139 h?: NonNullable<RequestInit["headers"]>,
140 ): Record<string, string | readonly string[]> => {
141 if (!h) return {};
142 if (h instanceof Headers) return Object.fromEntries(h.entries());
143 if (Symbol.iterator in h) {
144 return Object.fromEntries(
145 Array.from(
146 h as Iterable<Iterable<string>>,
147 (entry) => Array.from(entry) as [string, string],
148 ),
149 );
150 }
151 const headers: Record<string, string | readonly string[]> = {};
152 for (const [name, value] of Object.entries<
153 string | readonly string[] | undefined
154 >(h)) {
155 if (value !== undefined) headers[name] = value;
156 }
157 return headers;
158 };
159 const res = await fetch(getUpdatePreferencesUrl(), {
160 ...options,
161 method: "PATCH",
162 headers: {
163 "Content-Type": "application/json",
164 ...getHeaders(options?.headers),
165 },
166 body: JSON.stringify(updatePreferencesCmd),
167 });
168
169 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
170
171 const data: updatePreferencesResponse["data"] = body ? JSON.parse(body) : {};
172 return {
173 data,
174 status: res.status,
175 headers: res.headers,
176 } as updatePreferencesResponse;
177};
Added packages/apiclient/account/update-profile.schemas.ts View packages/apiclient/account/update-profile.schemas.ts
@@ -0,0 +1,139 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type ProfileVisibility =
95 "Public" | "RegisteredOnly" | "MembersOnly" | "Private";
96export interface EnvelopeNoData {
97 code: number;
98 data?: unknown;
99 /** @nullable */
100 error?: string | null;
101 /** @nullable */
102 error_code?: string | null;
103 message: string;
104 request_id?: string;
105}
106
107export interface UpdateProfileCmd {
108 /** @nullable */
109 bio?: string | null;
110 /** @nullable */
111 company?: string | null;
112 /** @nullable */
113 date_of_birth?: string | null;
114 /** @nullable */
115 display_name?: string | null;
116 /** @nullable */
117 language?: string | null;
118 /** @nullable */
119 locale?: string | null;
120 /** @nullable */
121 location?: string | null;
122 /** @nullable */
123 pronouns?: string | null;
124 /** @nullable */
125 real_name?: string | null;
126 /** @nullable */
127 show_activity?: boolean | null;
128 /** @nullable */
129 show_email?: boolean | null;
130 /** @nullable */
131 show_location?: boolean | null;
132 /** @nullable */
133 show_real_name?: boolean | null;
134 /** @nullable */
135 timezone?: string | null;
136 visibility?: null | ProfileVisibility;
137 /** @nullable */
138 website?: string | null;
139}
Added packages/apiclient/account/update-profile.ts View packages/apiclient/account/update-profile.ts
@@ -0,0 +1,176 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopeNoData,
96 UpdateProfileCmd,
97} from "./update-profile.schemas";
98
99export type updateProfileResponse200 = {
100 data: EnvelopeNoData;
101 status: 200;
102};
103
104export type updateProfileResponse400 = {
105 data: EnvelopeNoData;
106 status: 400;
107};
108
109export type updateProfileResponse401 = {
110 data: EnvelopeNoData;
111 status: 401;
112};
113
114export type updateProfileResponseSuccess = updateProfileResponse200 & {
115 headers: Headers;
116};
117export type updateProfileResponseError = (
118 updateProfileResponse400 | updateProfileResponse401
119) & {
120 headers: Headers;
121};
122
123export type updateProfileResponse =
124 updateProfileResponseSuccess | updateProfileResponseError;
125
126export const getUpdateProfileUrl = () => {
127 return `/api/v1/me`;
128};
129
130/**
131 * 增量更新当前用户的显示资料、时区语言、可见性和资料开关。
132 */
133export const updateProfile = async (
134 updateProfileCmd: UpdateProfileCmd,
135 options?: RequestInit,
136): Promise<updateProfileResponse> => {
137 const getHeaders = (
138 h?: NonNullable<RequestInit["headers"]>,
139 ): Record<string, string | readonly string[]> => {
140 if (!h) return {};
141 if (h instanceof Headers) return Object.fromEntries(h.entries());
142 if (Symbol.iterator in h) {
143 return Object.fromEntries(
144 Array.from(
145 h as Iterable<Iterable<string>>,
146 (entry) => Array.from(entry) as [string, string],
147 ),
148 );
149 }
150 const headers: Record<string, string | readonly string[]> = {};
151 for (const [name, value] of Object.entries<
152 string | readonly string[] | undefined
153 >(h)) {
154 if (value !== undefined) headers[name] = value;
155 }
156 return headers;
157 };
158 const res = await fetch(getUpdateProfileUrl(), {
159 ...options,
160 method: "PATCH",
161 headers: {
162 "Content-Type": "application/json",
163 ...getHeaders(options?.headers),
164 },
165 body: JSON.stringify(updateProfileCmd),
166 });
167
168 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
169
170 const data: updateProfileResponse["data"] = body ? JSON.parse(body) : {};
171 return {
172 data,
173 status: res.status,
174 headers: res.headers,
175 } as updateProfileResponse;
176};
Added packages/apiclient/account/update-username.schemas.ts View packages/apiclient/account/update-username.schemas.ts
@@ -0,0 +1,125 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export interface EnvelopeNoData {
95 code: number;
96 data?: unknown;
97 /** @nullable */
98 error?: string | null;
99 /** @nullable */
100 error_code?: string | null;
101 message: string;
102 request_id?: string;
103}
104
105export type EnvelopeUserPublicData = {
106 avatar_url: string;
107 display_name: string;
108 user_id: number;
109 username: string;
110};
111
112export interface EnvelopeUserPublic {
113 code: number;
114 data?: EnvelopeUserPublicData;
115 /** @nullable */
116 error?: string | null;
117 /** @nullable */
118 error_code?: string | null;
119 message: string;
120 request_id?: string;
121}
122
123export interface UpdateUsernameCmd {
124 username: string;
125}
Added packages/apiclient/account/update-username.ts View packages/apiclient/account/update-username.ts
@@ -0,0 +1,177 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopeNoData,
96 EnvelopeUserPublic,
97 UpdateUsernameCmd,
98} from "./update-username.schemas";
99
100export type updateUsernameResponse200 = {
101 data: EnvelopeUserPublic;
102 status: 200;
103};
104
105export type updateUsernameResponse400 = {
106 data: EnvelopeNoData;
107 status: 400;
108};
109
110export type updateUsernameResponse401 = {
111 data: EnvelopeNoData;
112 status: 401;
113};
114
115export type updateUsernameResponseSuccess = updateUsernameResponse200 & {
116 headers: Headers;
117};
118export type updateUsernameResponseError = (
119 updateUsernameResponse400 | updateUsernameResponse401
120) & {
121 headers: Headers;
122};
123
124export type updateUsernameResponse =
125 updateUsernameResponseSuccess | updateUsernameResponseError;
126
127export const getUpdateUsernameUrl = () => {
128 return `/api/v1/me/username`;
129};
130
131/**
132 * 校验格式和全局唯一性后修改当前用户用户名。
133 */
134export const updateUsername = async (
135 updateUsernameCmd: UpdateUsernameCmd,
136 options?: RequestInit,
137): Promise<updateUsernameResponse> => {
138 const getHeaders = (
139 h?: NonNullable<RequestInit["headers"]>,
140 ): Record<string, string | readonly string[]> => {
141 if (!h) return {};
142 if (h instanceof Headers) return Object.fromEntries(h.entries());
143 if (Symbol.iterator in h) {
144 return Object.fromEntries(
145 Array.from(
146 h as Iterable<Iterable<string>>,
147 (entry) => Array.from(entry) as [string, string],
148 ),
149 );
150 }
151 const headers: Record<string, string | readonly string[]> = {};
152 for (const [name, value] of Object.entries<
153 string | readonly string[] | undefined
154 >(h)) {
155 if (value !== undefined) headers[name] = value;
156 }
157 return headers;
158 };
159 const res = await fetch(getUpdateUsernameUrl(), {
160 ...options,
161 method: "PUT",
162 headers: {
163 "Content-Type": "application/json",
164 ...getHeaders(options?.headers),
165 },
166 body: JSON.stringify(updateUsernameCmd),
167 });
168
169 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
170
171 const data: updateUsernameResponse["data"] = body ? JSON.parse(body) : {};
172 return {
173 data,
174 status: res.status,
175 headers: res.headers,
176 } as updateUsernameResponse;
177};
Added packages/apiclient/analysis/code-activity.schemas.ts View packages/apiclient/analysis/code-activity.schemas.ts
@@ -0,0 +1,125 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export interface CodeActivityAuthorDto {
95 additions: number;
96 commits: number;
97 deletions: number;
98 email: string;
99 name: string;
100}
101
102export type EnvelopeCodeActivityDtoData = {
103 authors: CodeActivityAuthorDto[];
104 total_additions: number;
105 total_commits: number;
106 total_deletions: number;
107};
108
109export interface EnvelopeCodeActivityDto {
110 code: number;
111 data?: EnvelopeCodeActivityDtoData;
112 /** @nullable */
113 error?: string | null;
114 /** @nullable */
115 error_code?: string | null;
116 message: string;
117 request_id?: string;
118}
119
120export type CodeActivityParams = {
121 /**
122 * @nullable
123 */
124 branch?: string | null;
125};
Added packages/apiclient/analysis/code-activity.ts View packages/apiclient/analysis/code-activity.ts
@@ -0,0 +1,151 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 CodeActivityParams,
96 EnvelopeCodeActivityDto,
97} from "./code-activity.schemas";
98
99export type codeActivityResponse200 = {
100 data: EnvelopeCodeActivityDto;
101 status: 200;
102};
103
104export type codeActivityResponseSuccess = codeActivityResponse200 & {
105 headers: Headers;
106};
107export type codeActivityResponse = codeActivityResponseSuccess;
108
109export const getCodeActivityUrl = (
110 spaceName: string,
111 repoName: string,
112 params?: CodeActivityParams,
113) => {
114 const normalizedParams = new URLSearchParams();
115
116 Object.entries(params || {}).forEach(([key, value]) => {
117 if (value !== undefined) {
118 normalizedParams.append(key, value === null ? "null" : String(value));
119 }
120 });
121
122 const stringifiedParams = normalizedParams.toString();
123
124 return stringifiedParams.length > 0
125 ? `/api/v1/repos/${spaceName}/${repoName}/analysis/code-activity?${stringifiedParams}`
126 : `/api/v1/repos/${spaceName}/${repoName}/analysis/code-activity`;
127};
128
129/**
130 * 按作者汇总指定分支的提交、新增和删除活动。
131 */
132export const codeActivity = async (
133 spaceName: string,
134 repoName: string,
135 params?: CodeActivityParams,
136 options?: RequestInit,
137): Promise<codeActivityResponse> => {
138 const res = await fetch(getCodeActivityUrl(spaceName, repoName, params), {
139 ...options,
140 method: "GET",
141 });
142
143 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
144
145 const data: codeActivityResponse["data"] = body ? JSON.parse(body) : {};
146 return {
147 data,
148 status: res.status,
149 headers: res.headers,
150 } as codeActivityResponse;
151};
Added packages/apiclient/analysis/contributors.schemas.ts View packages/apiclient/analysis/contributors.schemas.ts
@@ -0,0 +1,111 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeVecContributorStatDtoDataItem = {
95 additions: number;
96 commits: number;
97 deletions: number;
98 email: string;
99 name: string;
100};
101
102export interface EnvelopeVecContributorStatDto {
103 code: number;
104 data?: EnvelopeVecContributorStatDtoDataItem[];
105 /** @nullable */
106 error?: string | null;
107 /** @nullable */
108 error_code?: string | null;
109 message: string;
110 request_id?: string;
111}
Added packages/apiclient/analysis/contributors.ts View packages/apiclient/analysis/contributors.ts
@@ -0,0 +1,131 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { EnvelopeVecContributorStatDto } from "./contributors.schemas";
95
96export type contributorsResponse200 = {
97 data: EnvelopeVecContributorStatDto;
98 status: 200;
99};
100
101export type contributorsResponseSuccess = contributorsResponse200 & {
102 headers: Headers;
103};
104export type contributorsResponse = contributorsResponseSuccess;
105
106export const getContributorsUrl = (spaceName: string, repoName: string) => {
107 return `/api/v1/repos/${spaceName}/${repoName}/analysis/contributors`;
108};
109
110/**
111 * 按提交数返回指定修订历史的贡献者及代码量统计。
112 */
113export const contributors = async (
114 spaceName: string,
115 repoName: string,
116 options?: RequestInit,
117): Promise<contributorsResponse> => {
118 const res = await fetch(getContributorsUrl(spaceName, repoName), {
119 ...options,
120 method: "GET",
121 });
122
123 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
124
125 const data: contributorsResponse["data"] = body ? JSON.parse(body) : {};
126 return {
127 data,
128 status: res.status,
129 headers: res.headers,
130 } as contributorsResponse;
131};
Added packages/apiclient/analysis/index.ts View packages/apiclient/analysis/index.ts
@@ -0,0 +1,4 @@
1export * from "./code-activity";
2export * from "./contributors";
3export * from "./languages-read";
4export * from "./languages";
Added packages/apiclient/analysis/languages-read.schemas.ts View packages/apiclient/analysis/languages-read.schemas.ts
@@ -0,0 +1,110 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeVecLanguageStatDtoDataItem = {
95 is_primary: boolean;
96 language: string;
97 percentage_bp: number;
98 size: number;
99};
100
101export interface EnvelopeVecLanguageStatDto {
102 code: number;
103 data?: EnvelopeVecLanguageStatDtoDataItem[];
104 /** @nullable */
105 error?: string | null;
106 /** @nullable */
107 error_code?: string | null;
108 message: string;
109 request_id?: string;
110}
Added packages/apiclient/analysis/languages-read.ts View packages/apiclient/analysis/languages-read.ts
@@ -0,0 +1,131 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { EnvelopeVecLanguageStatDto } from "./languages-read.schemas";
95
96export type languagesReadResponse200 = {
97 data: EnvelopeVecLanguageStatDto;
98 status: 200;
99};
100
101export type languagesReadResponseSuccess = languagesReadResponse200 & {
102 headers: Headers;
103};
104export type languagesReadResponse = languagesReadResponseSuccess;
105
106export const getLanguagesReadUrl = (spaceName: string, repoName: string) => {
107 return `/api/v1/repos/${spaceName}/${repoName}/analysis/languages`;
108};
109
110/**
111 * 读取最近一次已计算的仓库语言统计。
112 */
113export const languagesRead = async (
114 spaceName: string,
115 repoName: string,
116 options?: RequestInit,
117): Promise<languagesReadResponse> => {
118 const res = await fetch(getLanguagesReadUrl(spaceName, repoName), {
119 ...options,
120 method: "GET",
121 });
122
123 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
124
125 const data: languagesReadResponse["data"] = body ? JSON.parse(body) : {};
126 return {
127 data,
128 status: res.status,
129 headers: res.headers,
130 } as languagesReadResponse;
131};
Added packages/apiclient/analysis/languages.schemas.ts View packages/apiclient/analysis/languages.schemas.ts
@@ -0,0 +1,110 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeVecLanguageStatDtoDataItem = {
95 is_primary: boolean;
96 language: string;
97 percentage_bp: number;
98 size: number;
99};
100
101export interface EnvelopeVecLanguageStatDto {
102 code: number;
103 data?: EnvelopeVecLanguageStatDtoDataItem[];
104 /** @nullable */
105 error?: string | null;
106 /** @nullable */
107 error_code?: string | null;
108 message: string;
109 request_id?: string;
110}
Added packages/apiclient/analysis/languages.ts View packages/apiclient/analysis/languages.ts
@@ -0,0 +1,131 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { EnvelopeVecLanguageStatDto } from "./languages.schemas";
95
96export type languagesResponse200 = {
97 data: EnvelopeVecLanguageStatDto;
98 status: 200;
99};
100
101export type languagesResponseSuccess = languagesResponse200 & {
102 headers: Headers;
103};
104export type languagesResponse = languagesResponseSuccess;
105
106export const getLanguagesUrl = (spaceName: string, repoName: string) => {
107 return `/api/v1/repos/${spaceName}/${repoName}/analysis/languages`;
108};
109
110/**
111 * 重新扫描仓库树并持久化语言构成与主语言统计。
112 */
113export const languages = async (
114 spaceName: string,
115 repoName: string,
116 options?: RequestInit,
117): Promise<languagesResponse> => {
118 const res = await fetch(getLanguagesUrl(spaceName, repoName), {
119 ...options,
120 method: "POST",
121 });
122
123 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
124
125 const data: languagesResponse["data"] = body ? JSON.parse(body) : {};
126 return {
127 data,
128 status: res.status,
129 headers: res.headers,
130 } as languagesResponse;
131};
Added packages/apiclient/archives/create-archive.schemas.ts View packages/apiclient/archives/create-archive.schemas.ts
@@ -0,0 +1,119 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type ArchiveFormatDto = "tar" | "tar_gz" | "tar_bz2" | "zip";
95export interface ArchiveCreateCmd {
96 format: ArchiveFormatDto;
97 /** @nullable */
98 path_filter?: string | null;
99 revision: string;
100}
101
102export type EnvelopeArchiveResultDtoData = {
103 cache_key: string;
104 /** @nullable */
105 download_url?: string | null;
106 format: string;
107 size: number;
108};
109
110export interface EnvelopeArchiveResultDto {
111 code: number;
112 data?: EnvelopeArchiveResultDtoData;
113 /** @nullable */
114 error?: string | null;
115 /** @nullable */
116 error_code?: string | null;
117 message: string;
118 request_id?: string;
119}
Added packages/apiclient/archives/create-archive.ts View packages/apiclient/archives/create-archive.ts
@@ -0,0 +1,161 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 ArchiveCreateCmd,
96 EnvelopeArchiveResultDto,
97} from "./create-archive.schemas";
98
99export type createArchiveResponse200 = {
100 data: EnvelopeArchiveResultDto;
101 status: 200;
102};
103
104export type createArchiveResponseSuccess = createArchiveResponse200 & {
105 headers: Headers;
106};
107export type createArchiveResponse = createArchiveResponseSuccess;
108
109export const getCreateArchiveUrl = (spaceName: string, repoName: string) => {
110 return `/api/v1/repos/${spaceName}/${repoName}/archives`;
111};
112
113/**
114 * 为指定修订生成归档并上传存储,返回下载地址。
115 */
116export const createArchive = async (
117 spaceName: string,
118 repoName: string,
119 archiveCreateCmd: ArchiveCreateCmd,
120 options?: RequestInit,
121): Promise<createArchiveResponse> => {
122 const getHeaders = (
123 h?: NonNullable<RequestInit["headers"]>,
124 ): Record<string, string | readonly string[]> => {
125 if (!h) return {};
126 if (h instanceof Headers) return Object.fromEntries(h.entries());
127 if (Symbol.iterator in h) {
128 return Object.fromEntries(
129 Array.from(
130 h as Iterable<Iterable<string>>,
131 (entry) => Array.from(entry) as [string, string],
132 ),
133 );
134 }
135 const headers: Record<string, string | readonly string[]> = {};
136 for (const [name, value] of Object.entries<
137 string | readonly string[] | undefined
138 >(h)) {
139 if (value !== undefined) headers[name] = value;
140 }
141 return headers;
142 };
143 const res = await fetch(getCreateArchiveUrl(spaceName, repoName), {
144 ...options,
145 method: "POST",
146 headers: {
147 "Content-Type": "application/json",
148 ...getHeaders(options?.headers),
149 },
150 body: JSON.stringify(archiveCreateCmd),
151 });
152
153 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
154
155 const data: createArchiveResponse["data"] = body ? JSON.parse(body) : {};
156 return {
157 data,
158 status: res.status,
159 headers: res.headers,
160 } as createArchiveResponse;
161};
Added packages/apiclient/archives/create-bundle.schemas.ts View packages/apiclient/archives/create-bundle.schemas.ts
@@ -0,0 +1,111 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeArchiveResultDtoData = {
95 cache_key: string;
96 /** @nullable */
97 download_url?: string | null;
98 format: string;
99 size: number;
100};
101
102export interface EnvelopeArchiveResultDto {
103 code: number;
104 data?: EnvelopeArchiveResultDtoData;
105 /** @nullable */
106 error?: string | null;
107 /** @nullable */
108 error_code?: string | null;
109 message: string;
110 request_id?: string;
111}
Added packages/apiclient/archives/create-bundle.ts View packages/apiclient/archives/create-bundle.ts
@@ -0,0 +1,131 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { EnvelopeArchiveResultDto } from "./create-bundle.schemas";
95
96export type createBundleResponse200 = {
97 data: EnvelopeArchiveResultDto;
98 status: 200;
99};
100
101export type createBundleResponseSuccess = createBundleResponse200 & {
102 headers: Headers;
103};
104export type createBundleResponse = createBundleResponseSuccess;
105
106export const getCreateBundleUrl = (spaceName: string, repoName: string) => {
107 return `/api/v1/repos/${spaceName}/${repoName}/archives/bundle`;
108};
109
110/**
111 * 将仓库全部引用打包为 Git bundle 并上传存储。
112 */
113export const createBundle = async (
114 spaceName: string,
115 repoName: string,
116 options?: RequestInit,
117): Promise<createBundleResponse> => {
118 const res = await fetch(getCreateBundleUrl(spaceName, repoName), {
119 ...options,
120 method: "POST",
121 });
122
123 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
124
125 const data: createBundleResponse["data"] = body ? JSON.parse(body) : {};
126 return {
127 data,
128 status: res.status,
129 headers: res.headers,
130 } as createBundleResponse;
131};
Added packages/apiclient/archives/get-archive.schemas.ts View packages/apiclient/archives/get-archive.schemas.ts
@@ -0,0 +1,122 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeArchiveResultDtoData = {
95 cache_key: string;
96 /** @nullable */
97 download_url?: string | null;
98 format: string;
99 size: number;
100};
101
102export interface EnvelopeArchiveResultDto {
103 code: number;
104 data?: EnvelopeArchiveResultDtoData;
105 /** @nullable */
106 error?: string | null;
107 /** @nullable */
108 error_code?: string | null;
109 message: string;
110 request_id?: string;
111}
112
113export type GetArchiveParams = {
114 /**
115 * archive format
116 */
117 format: string;
118 /**
119 * path filter
120 */
121 path_filter?: string;
122};
Added packages/apiclient/archives/get-archive.ts View packages/apiclient/archives/get-archive.ts
@@ -0,0 +1,156 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopeArchiveResultDto,
96 GetArchiveParams,
97} from "./get-archive.schemas";
98
99export type getArchiveResponse200 = {
100 data: EnvelopeArchiveResultDto;
101 status: 200;
102};
103
104export type getArchiveResponseSuccess = getArchiveResponse200 & {
105 headers: Headers;
106};
107export type getArchiveResponse = getArchiveResponseSuccess;
108
109export const getGetArchiveUrl = (
110 spaceName: string,
111 repoName: string,
112 revision: string,
113 params: GetArchiveParams,
114) => {
115 const normalizedParams = new URLSearchParams();
116
117 Object.entries(params || {}).forEach(([key, value]) => {
118 if (value !== undefined) {
119 normalizedParams.append(key, value === null ? "null" : String(value));
120 }
121 });
122
123 const stringifiedParams = normalizedParams.toString();
124
125 return stringifiedParams.length > 0
126 ? `/api/v1/repos/${spaceName}/${repoName}/archives/${revision}?${stringifiedParams}`
127 : `/api/v1/repos/${spaceName}/${repoName}/archives/${revision}`;
128};
129
130/**
131 * 查询已生成归档的元数据并换取短期下载地址。
132 */
133export const getArchive = async (
134 spaceName: string,
135 repoName: string,
136 revision: string,
137 params: GetArchiveParams,
138 options?: RequestInit,
139): Promise<getArchiveResponse> => {
140 const res = await fetch(
141 getGetArchiveUrl(spaceName, repoName, revision, params),
142 {
143 ...options,
144 method: "GET",
145 },
146 );
147
148 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
149
150 const data: getArchiveResponse["data"] = body ? JSON.parse(body) : {};
151 return {
152 data,
153 status: res.status,
154 headers: res.headers,
155 } as getArchiveResponse;
156};
Added packages/apiclient/archives/index.ts View packages/apiclient/archives/index.ts
@@ -0,0 +1,3 @@
1export * from "./create-archive";
2export * from "./create-bundle";
3export * from "./get-archive";
Modified packages/apiclient/auth/auth-challenge.schemas.ts View packages/apiclient/auth/auth-challenge.schemas.ts
@@ -91,17 +91,6 @@
9191 *
9292 * OpenAPI spec version: 1.0
9393 */
94export interface EnvelopeNoData {
95 code: number;
96 data?: unknown;
97 /** @nullable */
98 error?: string | null;
99 /** @nullable */
100 error_code?: string | null;
101 message: string;
102 request_id?: string;
103}
104
10594export type EnvelopeChallengeResponseData = {
10695 context: string;
10796 /** @minimum 0 */
@@ -122,3 +111,14 @@
122111 message: string;
123112 request_id?: string;
124113}
114
115export interface EnvelopeNoData {
116 code: number;
117 data?: unknown;
118 /** @nullable */
119 error?: string | null;
120 /** @nullable */
121 error_code?: string | null;
122 message: string;
123 request_id?: string;
124}
Modified packages/apiclient/auth/auth-login-code-verify.schemas.ts View packages/apiclient/auth/auth-login-code-verify.schemas.ts
@@ -102,13 +102,6 @@
102102 request_id?: string;
103103}
104104
105export interface PowProofRequest {
106 /** @minimum 0 */
107 nonce: number;
108 /** @items.minimum 0 */
109 payload: number[];
110}
111
112105export type EnvelopeUserLoginResponseData = {
113106 /** @nullable */
114107 challenge?: string | null;
@@ -130,6 +123,13 @@
130123 request_id?: string;
131124}
132125
126export interface PowProofRequest {
127 /** @minimum 0 */
128 nonce: number;
129 /** @items.minimum 0 */
130 payload: number[];
131}
132
133133export interface LoginCodeVerifyRequest {
134134 email: string;
135135 email_code: string;
Modified packages/apiclient/auth/auth-login-code.schemas.ts View packages/apiclient/auth/auth-login-code.schemas.ts
@@ -91,6 +91,22 @@
9191 *
9292 * OpenAPI spec version: 1.0
9393 */
94export type EnvelopeLoginCodeResponseData = {
95 /** @minimum 0 */
96 expires_in_secs: number;
97};
98
99export interface EnvelopeLoginCodeResponse {
100 code: number;
101 data?: EnvelopeLoginCodeResponseData;
102 /** @nullable */
103 error?: string | null;
104 /** @nullable */
105 error_code?: string | null;
106 message: string;
107 request_id?: string;
108}
109
94110export interface EnvelopeNoData {
95111 code: number;
96112 data?: unknown;
@@ -112,20 +128,4 @@
112128export interface LoginCodeRequest {
113129 email: string;
114130 pow_payload: PowProofRequest;
115}
116
117export type EnvelopeLoginCodeResponseData = {
118 /** @minimum 0 */
119 expires_in_secs: number;
120};
121
122export interface EnvelopeLoginCodeResponse {
123 code: number;
124 data?: EnvelopeLoginCodeResponseData;
125 /** @nullable */
126 error?: string | null;
127 /** @nullable */
128 error_code?: string | null;
129 message: string;
130 request_id?: string;
131131}
Modified packages/apiclient/auth/auth-login.schemas.ts View packages/apiclient/auth/auth-login.schemas.ts
@@ -102,19 +102,6 @@
102102 request_id?: string;
103103}
104104
105export interface PowProofRequest {
106 /** @minimum 0 */
107 nonce: number;
108 /** @items.minimum 0 */
109 payload: number[];
110}
111
112export interface UserLoginRequest {
113 identity: string;
114 password_hash: string;
115 pow_payload: PowProofRequest;
116}
117
118105export type EnvelopeUserLoginResponseData = {
119106 /** @nullable */
120107 challenge?: string | null;
@@ -135,3 +122,16 @@
135122 message: string;
136123 request_id?: string;
137124}
125
126export interface PowProofRequest {
127 /** @minimum 0 */
128 nonce: number;
129 /** @items.minimum 0 */
130 payload: number[];
131}
132
133export interface UserLoginRequest {
134 identity: string;
135 password_hash: string;
136 pow_payload: PowProofRequest;
137}
Modified packages/apiclient/auth/auth-logout.schemas.ts View packages/apiclient/auth/auth-logout.schemas.ts
@@ -91,9 +91,14 @@
9191 *
9292 * OpenAPI spec version: 1.0
9393 */
94export interface EnvelopeNoData {
94export type EnvelopeLogoutResponseData = {
95 /** @nullable */
96 user_id?: number | null;
97};
98
99export interface EnvelopeLogoutResponse {
95100 code: number;
96 data?: unknown;
101 data?: EnvelopeLogoutResponseData;
97102 /** @nullable */
98103 error?: string | null;
99104 /** @nullable */
@@ -101,15 +106,10 @@
101106 message: string;
102107 request_id?: string;
103108}
104
105export type EnvelopeLogoutResponseData = {
106 /** @nullable */
107 user_id?: number | null;
108};
109109
110export interface EnvelopeLogoutResponse {
110export interface EnvelopeNoData {
111111 code: number;
112 data?: EnvelopeLogoutResponseData;
112 data?: unknown;
113113 /** @nullable */
114114 error?: string | null;
115115 /** @nullable */
Modified packages/apiclient/auth/auth-me.schemas.ts View packages/apiclient/auth/auth-me.schemas.ts
@@ -91,17 +91,6 @@
9191 *
9292 * OpenAPI spec version: 1.0
9393 */
94export interface EnvelopeNoData {
95 code: number;
96 data?: unknown;
97 /** @nullable */
98 error?: string | null;
99 /** @nullable */
100 error_code?: string | null;
101 message: string;
102 request_id?: string;
103}
104
10594export type EnvelopeMeResponseData = {
10695 /** @nullable */
10796 avatar_url?: string | null;
@@ -127,3 +116,14 @@
127116 message: string;
128117 request_id?: string;
129118}
119
120export interface EnvelopeNoData {
121 code: number;
122 data?: unknown;
123 /** @nullable */
124 error?: string | null;
125 /** @nullable */
126 error_code?: string | null;
127 message: string;
128 request_id?: string;
129}
Modified packages/apiclient/auth/auth-password-reset-request.schemas.ts View packages/apiclient/auth/auth-password-reset-request.schemas.ts
@@ -102,18 +102,6 @@
102102 request_id?: string;
103103}
104104
105export interface PowProofRequest {
106 /** @minimum 0 */
107 nonce: number;
108 /** @items.minimum 0 */
109 payload: number[];
110}
111
112export interface PasswordResetRequest {
113 email: string;
114 pow_payload: PowProofRequest;
115}
116
117105export type EnvelopePasswordResetResponseData = {
118106 /** @minimum 0 */
119107 expires_in_secs: number;
@@ -129,3 +117,15 @@
129117 message: string;
130118 request_id?: string;
131119}
120
121export interface PowProofRequest {
122 /** @minimum 0 */
123 nonce: number;
124 /** @items.minimum 0 */
125 payload: number[];
126}
127
128export interface PasswordResetRequest {
129 email: string;
130 pow_payload: PowProofRequest;
131}
Modified packages/apiclient/auth/auth-password-reset.schemas.ts View packages/apiclient/auth/auth-password-reset.schemas.ts
@@ -102,19 +102,6 @@
102102 request_id?: string;
103103}
104104
105export interface PowProofRequest {
106 /** @minimum 0 */
107 nonce: number;
108 /** @items.minimum 0 */
109 payload: number[];
110}
111
112export interface PasswordResetConfirmRequest {
113 password_hash: string;
114 pow_payload: PowProofRequest;
115 token: string;
116}
117
118105export type EnvelopePasswordResetConfirmResponseData = {
119106 user_id: number;
120107};
@@ -129,3 +116,16 @@
129116 message: string;
130117 request_id?: string;
131118}
119
120export interface PowProofRequest {
121 /** @minimum 0 */
122 nonce: number;
123 /** @items.minimum 0 */
124 payload: number[];
125}
126
127export interface PasswordResetConfirmRequest {
128 password_hash: string;
129 pow_payload: PowProofRequest;
130 token: string;
131}
Modified packages/apiclient/auth/auth-register-code.schemas.ts View packages/apiclient/auth/auth-register-code.schemas.ts
@@ -102,18 +102,6 @@
102102 request_id?: string;
103103}
104104
105export interface PowProofRequest {
106 /** @minimum 0 */
107 nonce: number;
108 /** @items.minimum 0 */
109 payload: number[];
110}
111
112export interface RegisterCodeRequest {
113 email: string;
114 pow_payload: PowProofRequest;
115}
116
117105export type EnvelopeRegisterCodeResponseData = {
118106 /** @minimum 0 */
119107 expires_in_secs: number;
@@ -129,3 +117,15 @@
129117 message: string;
130118 request_id?: string;
131119}
120
121export interface PowProofRequest {
122 /** @minimum 0 */
123 nonce: number;
124 /** @items.minimum 0 */
125 payload: number[];
126}
127
128export interface RegisterCodeRequest {
129 email: string;
130 pow_payload: PowProofRequest;
131}
Modified packages/apiclient/auth/auth-register.schemas.ts View packages/apiclient/auth/auth-register.schemas.ts
@@ -102,6 +102,24 @@
102102 request_id?: string;
103103}
104104
105export type EnvelopeUserRegisterResponseData = {
106 /** @nullable */
107 displayname?: string | null;
108 user_id: number;
109 username: string;
110};
111
112export interface EnvelopeUserRegisterResponse {
113 code: number;
114 data?: EnvelopeUserRegisterResponseData;
115 /** @nullable */
116 error?: string | null;
117 /** @nullable */
118 error_code?: string | null;
119 message: string;
120 request_id?: string;
121}
122
105123export interface PowProofRequest {
106124 /** @minimum 0 */
107125 nonce: number;
@@ -118,22 +136,4 @@
118136 password_hash: string;
119137 pow_payload: PowProofRequest;
120138 username: string;
121}
122
123export type EnvelopeUserRegisterResponseData = {
124 /** @nullable */
125 displayname?: string | null;
126 user_id: number;
127 username: string;
128};
129
130export interface EnvelopeUserRegisterResponse {
131 code: number;
132 data?: EnvelopeUserRegisterResponseData;
133 /** @nullable */
134 error?: string | null;
135 /** @nullable */
136 error_code?: string | null;
137 message: string;
138 request_id?: string;
139139}
Modified packages/apiclient/auth/auth-ssh-key-add.schemas.ts View packages/apiclient/auth/auth-ssh-key-add.schemas.ts
@@ -103,15 +103,6 @@
103103}
104104
105105export type SshKeyAlgorithm = "rsa" | "ed25519" | "ecdsa";
106export interface SshKeyAddRequest {
107 /** @nullable */
108 description?: string | null;
109 /** @nullable */
110 expires_at?: string | null;
111 name: string;
112 public_key: string;
113}
114
115106export type EnvelopeSshKeySummaryData = {
116107 algorithm: SshKeyAlgorithm;
117108 created_at: string;
@@ -139,3 +130,12 @@
139130 message: string;
140131 request_id?: string;
141132}
133
134export interface SshKeyAddRequest {
135 /** @nullable */
136 description?: string | null;
137 /** @nullable */
138 expires_at?: string | null;
139 name: string;
140 public_key: string;
141}
Modified packages/apiclient/auth/change-password.schemas.ts View packages/apiclient/auth/change-password.schemas.ts
@@ -91,6 +91,11 @@
9191 *
9292 * OpenAPI spec version: 1.0
9393 */
94export interface ChangePasswordCmd {
95 new_password: string;
96 old_password: string;
97}
98
9499export interface EnvelopeNoData {
95100 code: number;
96101 data?: unknown;
@@ -100,9 +105,4 @@
100105 error_code?: string | null;
101106 message: string;
102107 request_id?: string;
103}
104
105export interface ChangePasswordCmd {
106 new_password: string;
107 old_password: string;
108108}
Modified packages/apiclient/auth/totp-disable.schemas.ts View packages/apiclient/auth/totp-disable.schemas.ts
@@ -91,10 +91,6 @@
9191 *
9292 * OpenAPI spec version: 1.0
9393 */
94export interface TotpCodeCmd {
95 code: string;
96}
97
9894export interface EnvelopeNoData {
9995 code: number;
10096 data?: unknown;
@@ -105,3 +101,7 @@
105101 message: string;
106102 request_id?: string;
107103}
104
105export interface TotpCodeCmd {
106 code: string;
107}
Modified packages/apiclient/auth/totp-enable.schemas.ts View packages/apiclient/auth/totp-enable.schemas.ts
@@ -102,11 +102,6 @@
102102 request_id?: string;
103103}
104104
105export interface TotpEnableCmd {
106 code: string;
107 password: string;
108}
109
110105export type EnvelopeRecoveryCodesRespData = {
111106 codes: string[];
112107 /** @minimum 0 */
@@ -125,3 +120,8 @@
125120 message: string;
126121 request_id?: string;
127122}
123
124export interface TotpEnableCmd {
125 code: string;
126 password: string;
127}
Added packages/apiclient/blame/blame.schemas.ts View packages/apiclient/blame/blame.schemas.ts
@@ -0,0 +1,127 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeVecBlameRangeDtoDataItem = {
95 abbreviated_oid: string;
96 commit_sha: string;
97 ending_line: number;
98 /** @nullable */
99 path?: string | null;
100 starting_line: number;
101};
102
103export interface EnvelopeVecBlameRangeDto {
104 code: number;
105 data?: EnvelopeVecBlameRangeDtoDataItem[];
106 /** @nullable */
107 error?: string | null;
108 /** @nullable */
109 error_code?: string | null;
110 message: string;
111 request_id?: string;
112}
113
114export type BlameParams = {
115 revision: string;
116 path: string;
117 /**
118 * @minimum 0
119 * @nullable
120 */
121 range_start?: number | null;
122 /**
123 * @minimum 0
124 * @nullable
125 */
126 range_end?: number | null;
127};
Added packages/apiclient/blame/blame.ts View packages/apiclient/blame/blame.ts
@@ -0,0 +1,144 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { BlameParams, EnvelopeVecBlameRangeDto } from "./blame.schemas";
95
96export type blameResponse200 = {
97 data: EnvelopeVecBlameRangeDto;
98 status: 200;
99};
100
101export type blameResponseSuccess = blameResponse200 & {
102 headers: Headers;
103};
104export type blameResponse = blameResponseSuccess;
105
106export const getBlameUrl = (
107 spaceName: string,
108 repoName: string,
109 params: BlameParams,
110) => {
111 const normalizedParams = new URLSearchParams();
112
113 Object.entries(params || {}).forEach(([key, value]) => {
114 if (value !== undefined) {
115 normalizedParams.append(key, value === null ? "null" : String(value));
116 }
117 });
118
119 const stringifiedParams = normalizedParams.toString();
120
121 return stringifiedParams.length > 0
122 ? `/api/v1/repos/${spaceName}/${repoName}/blame?${stringifiedParams}`
123 : `/api/v1/repos/${spaceName}/${repoName}/blame`;
124};
125
126/**
127 * 返回文件逐行 blame 区间,可限定连续行范围。
128 */
129export const blame = async (
130 spaceName: string,
131 repoName: string,
132 params: BlameParams,
133 options?: RequestInit,
134): Promise<blameResponse> => {
135 const res = await fetch(getBlameUrl(spaceName, repoName, params), {
136 ...options,
137 method: "GET",
138 });
139
140 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
141
142 const data: blameResponse["data"] = body ? JSON.parse(body) : {};
143 return { data, status: res.status, headers: res.headers } as blameResponse;
144};
Added packages/apiclient/blame/index.ts View packages/apiclient/blame/index.ts
@@ -0,0 +1 @@
1export * from "./blame";
Added packages/apiclient/blobs/blob-content.schemas.ts View packages/apiclient/blobs/blob-content.schemas.ts
@@ -0,0 +1,112 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeBlobContentDtoData = {
95 /** @items.minimum 0 */
96 data: number[];
97 is_binary: boolean;
98 oid: string;
99 size: number;
100 truncated: boolean;
101};
102
103export interface EnvelopeBlobContentDto {
104 code: number;
105 data?: EnvelopeBlobContentDtoData;
106 /** @nullable */
107 error?: string | null;
108 /** @nullable */
109 error_code?: string | null;
110 message: string;
111 request_id?: string;
112}
Added packages/apiclient/blobs/blob-content.ts View packages/apiclient/blobs/blob-content.ts
@@ -0,0 +1,136 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { EnvelopeBlobContentDto } from "./blob-content.schemas";
95
96export type blobContentResponse200 = {
97 data: EnvelopeBlobContentDto;
98 status: 200;
99};
100
101export type blobContentResponseSuccess = blobContentResponse200 & {
102 headers: Headers;
103};
104export type blobContentResponse = blobContentResponseSuccess;
105
106export const getBlobContentUrl = (
107 spaceName: string,
108 repoName: string,
109 oid: string,
110) => {
111 return `/api/v1/repos/${spaceName}/${repoName}/blobs/${oid}/content`;
112};
113
114/**
115 * 读取 Blob 原始内容,超过配置上限时截断并标记。
116 */
117export const blobContent = async (
118 spaceName: string,
119 repoName: string,
120 oid: string,
121 options?: RequestInit,
122): Promise<blobContentResponse> => {
123 const res = await fetch(getBlobContentUrl(spaceName, repoName, oid), {
124 ...options,
125 method: "GET",
126 });
127
128 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
129
130 const data: blobContentResponse["data"] = body ? JSON.parse(body) : {};
131 return {
132 data,
133 status: res.status,
134 headers: res.headers,
135 } as blobContentResponse;
136};
Added packages/apiclient/blobs/blob-metadata.schemas.ts View packages/apiclient/blobs/blob-metadata.schemas.ts
@@ -0,0 +1,119 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export interface LfsPointerDto {
95 /** @nullable */
96 oid?: string | null;
97 /** @nullable */
98 size?: number | null;
99 version: string;
100}
101
102export type EnvelopeBlobMetaDtoData = {
103 is_binary: boolean;
104 is_lfs_pointer: boolean;
105 lfs?: null | LfsPointerDto;
106 oid: string;
107 size: number;
108};
109
110export interface EnvelopeBlobMetaDto {
111 code: number;
112 data?: EnvelopeBlobMetaDtoData;
113 /** @nullable */
114 error?: string | null;
115 /** @nullable */
116 error_code?: string | null;
117 message: string;
118 request_id?: string;
119}
Added packages/apiclient/blobs/blob-metadata.ts View packages/apiclient/blobs/blob-metadata.ts
@@ -0,0 +1,136 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { EnvelopeBlobMetaDto } from "./blob-metadata.schemas";
95
96export type blobMetadataResponse200 = {
97 data: EnvelopeBlobMetaDto;
98 status: 200;
99};
100
101export type blobMetadataResponseSuccess = blobMetadataResponse200 & {
102 headers: Headers;
103};
104export type blobMetadataResponse = blobMetadataResponseSuccess;
105
106export const getBlobMetadataUrl = (
107 spaceName: string,
108 repoName: string,
109 oid: string,
110) => {
111 return `/api/v1/repos/${spaceName}/${repoName}/blobs/${oid}/metadata`;
112};
113
114/**
115 * 返回 Blob 对象大小、二进制判断及 LFS 指针信息。
116 */
117export const blobMetadata = async (
118 spaceName: string,
119 repoName: string,
120 oid: string,
121 options?: RequestInit,
122): Promise<blobMetadataResponse> => {
123 const res = await fetch(getBlobMetadataUrl(spaceName, repoName, oid), {
124 ...options,
125 method: "GET",
126 });
127
128 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
129
130 const data: blobMetadataResponse["data"] = body ? JSON.parse(body) : {};
131 return {
132 data,
133 status: res.status,
134 headers: res.headers,
135 } as blobMetadataResponse;
136};
Added packages/apiclient/blobs/index.ts View packages/apiclient/blobs/index.ts
@@ -0,0 +1,3 @@
1export * from "./blob-content";
2export * from "./blob-metadata";
3export * from "./list-lfs-pointers";
Added packages/apiclient/blobs/list-lfs-pointers.schemas.ts View packages/apiclient/blobs/list-lfs-pointers.schemas.ts
@@ -0,0 +1,120 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type EnvelopeVecLfsPointerDtoDataItem = {
95 /** @nullable */
96 oid?: string | null;
97 /** @nullable */
98 size?: number | null;
99 version: string;
100};
101
102export interface EnvelopeVecLfsPointerDto {
103 code: number;
104 data?: EnvelopeVecLfsPointerDtoDataItem[];
105 /** @nullable */
106 error?: string | null;
107 /** @nullable */
108 error_code?: string | null;
109 message: string;
110 request_id?: string;
111}
112
113export type ListLfsPointersParams = {
114 revision: string;
115 /**
116 * @minimum 0
117 * @nullable
118 */
119 limit?: number | null;
120};
Added packages/apiclient/blobs/list-lfs-pointers.ts View packages/apiclient/blobs/list-lfs-pointers.ts
@@ -0,0 +1,151 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 EnvelopeVecLfsPointerDto,
96 ListLfsPointersParams,
97} from "./list-lfs-pointers.schemas";
98
99export type listLfsPointersResponse200 = {
100 data: EnvelopeVecLfsPointerDto;
101 status: 200;
102};
103
104export type listLfsPointersResponseSuccess = listLfsPointersResponse200 & {
105 headers: Headers;
106};
107export type listLfsPointersResponse = listLfsPointersResponseSuccess;
108
109export const getListLfsPointersUrl = (
110 spaceName: string,
111 repoName: string,
112 params: ListLfsPointersParams,
113) => {
114 const normalizedParams = new URLSearchParams();
115
116 Object.entries(params || {}).forEach(([key, value]) => {
117 if (value !== undefined) {
118 normalizedParams.append(key, value === null ? "null" : String(value));
119 }
120 });
121
122 const stringifiedParams = normalizedParams.toString();
123
124 return stringifiedParams.length > 0
125 ? `/api/v1/repos/${spaceName}/${repoName}/lfs-pointers?${stringifiedParams}`
126 : `/api/v1/repos/${spaceName}/${repoName}/lfs-pointers`;
127};
128
129/**
130 * 列出指定修订历史中可达的 LFS 指针对象。
131 */
132export const listLfsPointers = async (
133 spaceName: string,
134 repoName: string,
135 params: ListLfsPointersParams,
136 options?: RequestInit,
137): Promise<listLfsPointersResponse> => {
138 const res = await fetch(getListLfsPointersUrl(spaceName, repoName, params), {
139 ...options,
140 method: "GET",
141 });
142
143 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
144
145 const data: listLfsPointersResponse["data"] = body ? JSON.parse(body) : {};
146 return {
147 data,
148 status: res.status,
149 headers: res.headers,
150 } as listLfsPointersResponse;
151};
Added packages/apiclient/branch-protection/add-branch-whitelist.schemas.ts View packages/apiclient/branch-protection/add-branch-whitelist.schemas.ts
@@ -0,0 +1,131 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type WhitelistKind = "Push" | "Merge" | "Approval";
95export interface AddBranchWhitelistCmd {
96 /** @nullable */
97 group_id?: string | null;
98 kind: WhitelistKind;
99 /** @nullable */
100 user_id?: number | null;
101}
102
103export interface UserDto {
104 avatar_url: string;
105 display_name: string;
106 user_id: number;
107 username: string;
108}
109
110export type EnvelopeBranchWhitelistDtoData = {
111 created_at: string;
112 /** @nullable */
113 group_id?: string | null;
114 id: string;
115 kind: WhitelistKind;
116 policy_id: string;
117 user?: null | UserDto;
118 /** @nullable */
119 user_id?: number | null;
120};
121
122export interface EnvelopeBranchWhitelistDto {
123 code: number;
124 data?: EnvelopeBranchWhitelistDtoData;
125 /** @nullable */
126 error?: string | null;
127 /** @nullable */
128 error_code?: string | null;
129 message: string;
130 request_id?: string;
131}
Added packages/apiclient/branch-protection/add-branch-whitelist.ts View packages/apiclient/branch-protection/add-branch-whitelist.ts
@@ -0,0 +1,170 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type {
95 AddBranchWhitelistCmd,
96 EnvelopeBranchWhitelistDto,
97} from "./add-branch-whitelist.schemas";
98
99export type addBranchWhitelistResponse200 = {
100 data: EnvelopeBranchWhitelistDto;
101 status: 200;
102};
103
104export type addBranchWhitelistResponseSuccess =
105 addBranchWhitelistResponse200 & {
106 headers: Headers;
107 };
108export type addBranchWhitelistResponse = addBranchWhitelistResponseSuccess;
109
110export const getAddBranchWhitelistUrl = (
111 spaceName: string,
112 repoName: string,
113 policyId: string,
114) => {
115 return `/api/v1/repos/${spaceName}/${repoName}/branch-protection/${policyId}/whitelists`;
116};
117
118/**
119 * 为分支保护策略添加用户或群组白名单。
120 */
121export const addBranchWhitelist = async (
122 spaceName: string,
123 repoName: string,
124 policyId: string,
125 addBranchWhitelistCmd: AddBranchWhitelistCmd,
126 options?: RequestInit,
127): Promise<addBranchWhitelistResponse> => {
128 const getHeaders = (
129 h?: NonNullable<RequestInit["headers"]>,
130 ): Record<string, string | readonly string[]> => {
131 if (!h) return {};
132 if (h instanceof Headers) return Object.fromEntries(h.entries());
133 if (Symbol.iterator in h) {
134 return Object.fromEntries(
135 Array.from(
136 h as Iterable<Iterable<string>>,
137 (entry) => Array.from(entry) as [string, string],
138 ),
139 );
140 }
141 const headers: Record<string, string | readonly string[]> = {};
142 for (const [name, value] of Object.entries<
143 string | readonly string[] | undefined
144 >(h)) {
145 if (value !== undefined) headers[name] = value;
146 }
147 return headers;
148 };
149 const res = await fetch(
150 getAddBranchWhitelistUrl(spaceName, repoName, policyId),
151 {
152 ...options,
153 method: "POST",
154 headers: {
155 "Content-Type": "application/json",
156 ...getHeaders(options?.headers),
157 },
158 body: JSON.stringify(addBranchWhitelistCmd),
159 },
160 );
161
162 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
163
164 const data: addBranchWhitelistResponse["data"] = body ? JSON.parse(body) : {};
165 return {
166 data,
167 status: res.status,
168 headers: res.headers,
169 } as addBranchWhitelistResponse;
170};
Added packages/apiclient/branch-protection/index.ts View packages/apiclient/branch-protection/index.ts
@@ -0,0 +1,3 @@
1export * from "./list-branch-whitelists";
2export * from "./add-branch-whitelist";
3export * from "./remove-branch-whitelist";
Added packages/apiclient/branch-protection/list-branch-whitelists.schemas.ts View packages/apiclient/branch-protection/list-branch-whitelists.schemas.ts
@@ -0,0 +1,123 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export type WhitelistKind = "Push" | "Merge" | "Approval";
95export interface UserDto {
96 avatar_url: string;
97 display_name: string;
98 user_id: number;
99 username: string;
100}
101
102export type EnvelopeVecBranchWhitelistDtoDataItem = {
103 created_at: string;
104 /** @nullable */
105 group_id?: string | null;
106 id: string;
107 kind: WhitelistKind;
108 policy_id: string;
109 user?: null | UserDto;
110 /** @nullable */
111 user_id?: number | null;
112};
113
114export interface EnvelopeVecBranchWhitelistDto {
115 code: number;
116 data?: EnvelopeVecBranchWhitelistDtoDataItem[];
117 /** @nullable */
118 error?: string | null;
119 /** @nullable */
120 error_code?: string | null;
121 message: string;
122 request_id?: string;
123}
Added packages/apiclient/branch-protection/list-branch-whitelists.ts View packages/apiclient/branch-protection/list-branch-whitelists.ts
@@ -0,0 +1,142 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { EnvelopeVecBranchWhitelistDto } from "./list-branch-whitelists.schemas";
95
96export type listBranchWhitelistsResponse200 = {
97 data: EnvelopeVecBranchWhitelistDto;
98 status: 200;
99};
100
101export type listBranchWhitelistsResponseSuccess =
102 listBranchWhitelistsResponse200 & {
103 headers: Headers;
104 };
105export type listBranchWhitelistsResponse = listBranchWhitelistsResponseSuccess;
106
107export const getListBranchWhitelistsUrl = (
108 spaceName: string,
109 repoName: string,
110 policyId: string,
111) => {
112 return `/api/v1/repos/${spaceName}/${repoName}/branch-protection/${policyId}/whitelists`;
113};
114
115/**
116 * 列出分支保护策略关联的用户与群组白名单。
117 */
118export const listBranchWhitelists = async (
119 spaceName: string,
120 repoName: string,
121 policyId: string,
122 options?: RequestInit,
123): Promise<listBranchWhitelistsResponse> => {
124 const res = await fetch(
125 getListBranchWhitelistsUrl(spaceName, repoName, policyId),
126 {
127 ...options,
128 method: "GET",
129 },
130 );
131
132 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
133
134 const data: listBranchWhitelistsResponse["data"] = body
135 ? JSON.parse(body)
136 : {};
137 return {
138 data,
139 status: res.status,
140 headers: res.headers,
141 } as listBranchWhitelistsResponse;
142};
Added packages/apiclient/branch-protection/remove-branch-whitelist.schemas.ts View packages/apiclient/branch-protection/remove-branch-whitelist.schemas.ts
@@ -0,0 +1,103 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export interface EnvelopeNoData {
95 code: number;
96 data?: unknown;
97 /** @nullable */
98 error?: string | null;
99 /** @nullable */
100 error_code?: string | null;
101 message: string;
102 request_id?: string;
103}
Added packages/apiclient/branch-protection/remove-branch-whitelist.ts View packages/apiclient/branch-protection/remove-branch-whitelist.ts
@@ -0,0 +1,145 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94import type { EnvelopeNoData } from "./remove-branch-whitelist.schemas";
95
96export type removeBranchWhitelistResponse200 = {
97 data: EnvelopeNoData;
98 status: 200;
99};
100
101export type removeBranchWhitelistResponseSuccess =
102 removeBranchWhitelistResponse200 & {
103 headers: Headers;
104 };
105export type removeBranchWhitelistResponse =
106 removeBranchWhitelistResponseSuccess;
107
108export const getRemoveBranchWhitelistUrl = (
109 spaceName: string,
110 repoName: string,
111 policyId: string,
112 whitelistId: string,
113) => {
114 return `/api/v1/repos/${spaceName}/${repoName}/branch-protection/${policyId}/whitelists/${whitelistId}`;
115};
116
117/**
118 * 删除指定分支保护策略下的白名单条目。
119 */
120export const removeBranchWhitelist = async (
121 spaceName: string,
122 repoName: string,
123 policyId: string,
124 whitelistId: string,
125 options?: RequestInit,
126): Promise<removeBranchWhitelistResponse> => {
127 const res = await fetch(
128 getRemoveBranchWhitelistUrl(spaceName, repoName, policyId, whitelistId),
129 {
130 ...options,
131 method: "DELETE",
132 },
133 );
134
135 const body = [204, 205, 304].includes(res.status) ? null : await res.text();
136
137 const data: removeBranchWhitelistResponse["data"] = body
138 ? JSON.parse(body)
139 : {};
140 return {
141 data,
142 status: res.status,
143 headers: res.headers,
144 } as removeBranchWhitelistResponse;
145};
Added packages/apiclient/branches/create-branch.schemas.ts View packages/apiclient/branches/create-branch.schemas.ts
@@ -0,0 +1,120 @@
1/**
2 * Generated by orval 🍺
3 * Do not edit manually.
4 * gitdata api
5 *
6 * ## Conventions
7 *
8 * ### Response envelope
9 * Every JSON response uses the same envelope:
10 *
11 * | field | meaning |
12 * |---|---|
13 * | `code` | always equal to the HTTP status code |
14 * | `message` | human-readable result / error summary |
15 * | `data` | payload, `null` for errors and empty results |
16 * | `error` | field-level / technical detail (e.g. validation errors), may be `null` |
17 * | `error_code` | stable machine-readable code on 4xx (e.g. `conflict`, `rate_limited`), may be `null` |
18 * | `request_id` | correlation id, also returned as the `X-Request-Id` header |
19 *
20 * Successful `POST` creation returns `200` (not `201`); empty results use `200` with `data: null`.
21 * - `POST /auth/logout` is idempotent: repeating it always succeeds with `200`.
22 *
23 * ### Authentication
24 * - `session_cookie`: opaque session carried in the `session` cookie and stored in
25 * Redis. `GET /auth/login` redirects to the same-origin login page;
26 * `POST /auth/logout` revokes the session and clears the cookie.
27 *
28 * ### URL & parameter style
29 * - Paths are `kebab-case`, plural nouns, nesting expresses ownership.
30 * - Query/path/JSON field names are `snake_case`; enum values are `snake_case`.
31 * - All endpoints are versioned under `/api/v1`. `/api/v1/internal/*` is guarded
32 * by the `x-gitdata-service-key` header and is NOT documented here.
33 * - State-transition actions use `POST {resource}/{id}/{verb}` (close/reopen);
34 * idempotent whole-resource state uses `PUT` (default branch, pin, read-state);
35 * partial updates use `PATCH`.
36 *
37 * ### Pagination
38 * - 唯一 offset 风格:`?limit=&offset=`(`limit` 默认 50;`offset` 上限 5000),
39 * 分页响应的 `data` 恒为 `{ items, total, limit, offset }`,字段均为无符号整数。
40 * - `limit` 为 0、超过端点上限或 `offset` 超过 5000 时返回 400
41 * (`error_code: bad_request`),不会静默截断。
42 * - 排序参数为 `?sort=<field>&order=asc|desc`;`sort` 的取值按端点枚举校验,
43 * 未知值返回 400,未知参数同样返回 400。
44 * - chat 消息额外接受 `before_seq` / `after_seq` 作为筛选条件,响应仍是同一 `Page` 形状。
45 * - Git LFS 锁定列表的 `next_cursor` 是 LFS 协议字段,不适用本约定。
46 *
47 * ### PATCH semantics (three-state fields)
48 * Update commands use `Option<Option<T>>` for clearable fields:
49 * - field **absent** → unchanged
50 * - field `null` → cleared
51 * - field value → set
52 *
53 * Example: `{"milestone_id": null}` unassigns the milestone; omitting
54 * `milestone_id` leaves it untouched.
55 *
56 * ### 2FA
57 * TOTP enrollment, recovery codes and sensitive-operation verification are
58 * handled by identity; GitData only proxies the account-management endpoints.
59 *
60 * ### Operations
61 * - `GET /healthz` — liveness probe (no auth, outside `/api/v1`).
62 * - `GET /readyz` — readiness probe: database (primary) + redis live checks,
63 * rocketmq + s3 sampled every 10s, `503` when any is down.
64 * - Runtime metrics are pushed to the configured OTLP collector (30s interval);
65 * there is no scrape endpoint.
66 * - Cross-origin browser access is disabled by default; the API expects a
67 * same-origin reverse proxy. Enable `web.cors_allow_origins` to allowlist
68 * other origins.
69 *
70 * ### Abuse controls
71 * - Creation endpoints are subject to per-user rolling 24h quotas
72 * (`[quota]` config; 0 disables). Exceeding a quota returns `429`
73 * with `error_code: "rate_limited"`.
74 *
75 * ### Idempotency
76 * - `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
77 * retrying with the same nonce returns the original message instead of a duplicate.
78 *
79 * ### Resource references
80 * - User references in responses embed a `user` object (`UserDto`) wherever a
81 * single person is shown; raw uuid fields are named `*_id` consistently.
82 * - Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 * carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 * watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85 *
86 * ### Identifiers
87 * - Issues are addressable by UUID **or** board-scoped number
88 * (e.g. `/issues/{space}/boards/{board}/issues/123`).
89 * - Binary uploads use raw request bodies with a content-type header
90 * (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
91 *
92 * OpenAPI spec version: 1.0
93 */
94export interface CreateBranchCmd {
95 name: string;
96 /** @nullable */
97 start_point?: string | null;
98}
99
100export type EnvelopeBranchDtoData = {
101 commit_sha: string;
102 created_at: string;
103 /** @nullable */
104 deleted_at?: string | null;
105 is_deleted: boolean;
106 is_protected: boolean;
107 name: string;
108 updated_at: string;
109};
110
111export interface EnvelopeBranchDto {
112 code: number;
113 data?: EnvelopeBranchDtoData;
114 /** @nullable */
115 error?: string | null;
116 /** @nullable */
117 error_code?: string | null;
118 message: string;
119 request_id?: string;
120}
Added packages/apiclient/branches/create-branch.ts View packages/apiclient/branches/create-branch.ts

Diff too large to display.

Added packages/apiclient/branches/delete-branch.schemas.ts View packages/apiclient/branches/delete-branch.schemas.ts

Diff too large to display.

Added packages/apiclient/branches/delete-branch.ts View packages/apiclient/branches/delete-branch.ts

Diff too large to display.

Added packages/apiclient/branches/get-branch.schemas.ts View packages/apiclient/branches/get-branch.schemas.ts

Diff too large to display.

Added packages/apiclient/branches/get-branch.ts View packages/apiclient/branches/get-branch.ts

Diff too large to display.

Added packages/apiclient/branches/index.ts View packages/apiclient/branches/index.ts

Diff too large to display.

Added packages/apiclient/branches/list-branches.schemas.ts View packages/apiclient/branches/list-branches.schemas.ts

Diff too large to display.

Added packages/apiclient/branches/list-branches.ts View packages/apiclient/branches/list-branches.ts

Diff too large to display.

Added packages/apiclient/branches/rename-branch.schemas.ts View packages/apiclient/branches/rename-branch.schemas.ts

Diff too large to display.

Added packages/apiclient/branches/rename-branch.ts View packages/apiclient/branches/rename-branch.ts

Diff too large to display.

Added packages/apiclient/branches/set-default-branch.schemas.ts View packages/apiclient/branches/set-default-branch.schemas.ts

Diff too large to display.

Added packages/apiclient/branches/set-default-branch.ts View packages/apiclient/branches/set-default-branch.ts

Diff too large to display.

Added packages/apiclient/chat/add-reaction.schemas.ts View packages/apiclient/chat/add-reaction.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/add-reaction.ts View packages/apiclient/chat/add-reaction.ts

Diff too large to display.

Added packages/apiclient/chat/approve-hand.schemas.ts View packages/apiclient/chat/approve-hand.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/approve-hand.ts View packages/apiclient/chat/approve-hand.ts

Diff too large to display.

Added packages/apiclient/chat/bulk-delete-messages.schemas.ts View packages/apiclient/chat/bulk-delete-messages.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/bulk-delete-messages.ts View packages/apiclient/chat/bulk-delete-messages.ts

Diff too large to display.

Added packages/apiclient/chat/cancel-hand.schemas.ts View packages/apiclient/chat/cancel-hand.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/cancel-hand.ts View packages/apiclient/chat/cancel-hand.ts

Diff too large to display.

Added packages/apiclient/chat/cancel-reminder.schemas.ts View packages/apiclient/chat/cancel-reminder.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/cancel-reminder.ts View packages/apiclient/chat/cancel-reminder.ts

Diff too large to display.

Added packages/apiclient/chat/close-dm.schemas.ts View packages/apiclient/chat/close-dm.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/close-dm.ts View packages/apiclient/chat/close-dm.ts

Diff too large to display.

Added packages/apiclient/chat/create-attachment.schemas.ts View packages/apiclient/chat/create-attachment.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/create-attachment.ts View packages/apiclient/chat/create-attachment.ts

Diff too large to display.

Added packages/apiclient/chat/create-bookmark.schemas.ts View packages/apiclient/chat/create-bookmark.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/create-bookmark.ts View packages/apiclient/chat/create-bookmark.ts

Diff too large to display.

Added packages/apiclient/chat/create-outbound-webhook.schemas.ts View packages/apiclient/chat/create-outbound-webhook.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/create-outbound-webhook.ts View packages/apiclient/chat/create-outbound-webhook.ts

Diff too large to display.

Added packages/apiclient/chat/create-reminder.schemas.ts View packages/apiclient/chat/create-reminder.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/create-reminder.ts View packages/apiclient/chat/create-reminder.ts

Diff too large to display.

Added packages/apiclient/chat/create-room.schemas.ts View packages/apiclient/chat/create-room.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/create-room.ts View packages/apiclient/chat/create-room.ts

Diff too large to display.

Added packages/apiclient/chat/create-thread.schemas.ts View packages/apiclient/chat/create-thread.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/create-thread.ts View packages/apiclient/chat/create-thread.ts

Diff too large to display.

Added packages/apiclient/chat/create-webhook.schemas.ts View packages/apiclient/chat/create-webhook.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/create-webhook.ts View packages/apiclient/chat/create-webhook.ts

Diff too large to display.

Added packages/apiclient/chat/delete-bookmark.schemas.ts View packages/apiclient/chat/delete-bookmark.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/delete-bookmark.ts View packages/apiclient/chat/delete-bookmark.ts

Diff too large to display.

Added packages/apiclient/chat/delete-draft.schemas.ts View packages/apiclient/chat/delete-draft.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/delete-draft.ts View packages/apiclient/chat/delete-draft.ts

Diff too large to display.

Added packages/apiclient/chat/delete-emoji.schemas.ts View packages/apiclient/chat/delete-emoji.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/delete-emoji.ts View packages/apiclient/chat/delete-emoji.ts

Diff too large to display.

Added packages/apiclient/chat/delete-message.schemas.ts View packages/apiclient/chat/delete-message.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/delete-message.ts View packages/apiclient/chat/delete-message.ts

Diff too large to display.

Added packages/apiclient/chat/delete-outbound-webhook.schemas.ts View packages/apiclient/chat/delete-outbound-webhook.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/delete-outbound-webhook.ts View packages/apiclient/chat/delete-outbound-webhook.ts

Diff too large to display.

Added packages/apiclient/chat/delete-room.schemas.ts View packages/apiclient/chat/delete-room.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/delete-room.ts View packages/apiclient/chat/delete-room.ts

Diff too large to display.

Added packages/apiclient/chat/delete-webhook.schemas.ts View packages/apiclient/chat/delete-webhook.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/delete-webhook.ts View packages/apiclient/chat/delete-webhook.ts

Diff too large to display.

Added packages/apiclient/chat/deny-hand.schemas.ts View packages/apiclient/chat/deny-hand.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/deny-hand.ts View packages/apiclient/chat/deny-hand.ts

Diff too large to display.

Added packages/apiclient/chat/download-attachment.schemas.ts View packages/apiclient/chat/download-attachment.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/download-attachment.ts View packages/apiclient/chat/download-attachment.ts

Diff too large to display.

Added packages/apiclient/chat/emoji-image.schemas.ts View packages/apiclient/chat/emoji-image.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/emoji-image.ts View packages/apiclient/chat/emoji-image.ts

Diff too large to display.

Added packages/apiclient/chat/finalize-attachment.schemas.ts View packages/apiclient/chat/finalize-attachment.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/finalize-attachment.ts View packages/apiclient/chat/finalize-attachment.ts

Diff too large to display.

Added packages/apiclient/chat/follow-thread.schemas.ts View packages/apiclient/chat/follow-thread.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/follow-thread.ts View packages/apiclient/chat/follow-thread.ts

Diff too large to display.

Added packages/apiclient/chat/forward-message.schemas.ts View packages/apiclient/chat/forward-message.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/forward-message.ts View packages/apiclient/chat/forward-message.ts

Diff too large to display.

Added packages/apiclient/chat/get-attachment.schemas.ts View packages/apiclient/chat/get-attachment.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/get-attachment.ts View packages/apiclient/chat/get-attachment.ts

Diff too large to display.

Added packages/apiclient/chat/get-draft.schemas.ts View packages/apiclient/chat/get-draft.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/get-draft.ts View packages/apiclient/chat/get-draft.ts

Diff too large to display.

Added packages/apiclient/chat/get-emoji.schemas.ts View packages/apiclient/chat/get-emoji.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/get-emoji.ts View packages/apiclient/chat/get-emoji.ts

Diff too large to display.

Added packages/apiclient/chat/get-message.schemas.ts View packages/apiclient/chat/get-message.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/get-message.ts View packages/apiclient/chat/get-message.ts

Diff too large to display.

Added packages/apiclient/chat/get-presence.schemas.ts View packages/apiclient/chat/get-presence.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/get-presence.ts View packages/apiclient/chat/get-presence.ts

Diff too large to display.

Added packages/apiclient/chat/get-read-state.schemas.ts View packages/apiclient/chat/get-read-state.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/get-read-state.ts View packages/apiclient/chat/get-read-state.ts

Diff too large to display.

Added packages/apiclient/chat/get-room-setting.schemas.ts View packages/apiclient/chat/get-room-setting.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/get-room-setting.ts View packages/apiclient/chat/get-room-setting.ts

Diff too large to display.

Added packages/apiclient/chat/get-room.schemas.ts View packages/apiclient/chat/get-room.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/get-room.ts View packages/apiclient/chat/get-room.ts

Diff too large to display.

Added packages/apiclient/chat/get-thread.schemas.ts View packages/apiclient/chat/get-thread.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/get-thread.ts View packages/apiclient/chat/get-thread.ts

Diff too large to display.

Added packages/apiclient/chat/get-voice-layout.schemas.ts View packages/apiclient/chat/get-voice-layout.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/get-voice-layout.ts View packages/apiclient/chat/get-voice-layout.ts

Diff too large to display.

Added packages/apiclient/chat/index.ts View packages/apiclient/chat/index.ts

Diff too large to display.

Added packages/apiclient/chat/kick-participant.schemas.ts View packages/apiclient/chat/kick-participant.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/kick-participant.ts View packages/apiclient/chat/kick-participant.ts

Diff too large to display.

Added packages/apiclient/chat/list-bookmarks.schemas.ts View packages/apiclient/chat/list-bookmarks.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-bookmarks.ts View packages/apiclient/chat/list-bookmarks.ts

Diff too large to display.

Added packages/apiclient/chat/list-dms.schemas.ts View packages/apiclient/chat/list-dms.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-dms.ts View packages/apiclient/chat/list-dms.ts

Diff too large to display.

Added packages/apiclient/chat/list-emojis.schemas.ts View packages/apiclient/chat/list-emojis.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-emojis.ts View packages/apiclient/chat/list-emojis.ts

Diff too large to display.

Added packages/apiclient/chat/list-hands.schemas.ts View packages/apiclient/chat/list-hands.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-hands.ts View packages/apiclient/chat/list-hands.ts

Diff too large to display.

Added packages/apiclient/chat/list-message-history.schemas.ts View packages/apiclient/chat/list-message-history.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-message-history.ts View packages/apiclient/chat/list-message-history.ts

Diff too large to display.

Added packages/apiclient/chat/list-messages.schemas.ts View packages/apiclient/chat/list-messages.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-messages.ts View packages/apiclient/chat/list-messages.ts

Diff too large to display.

Added packages/apiclient/chat/list-my-drafts.schemas.ts View packages/apiclient/chat/list-my-drafts.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-my-drafts.ts View packages/apiclient/chat/list-my-drafts.ts

Diff too large to display.

Added packages/apiclient/chat/list-my-threads.schemas.ts View packages/apiclient/chat/list-my-threads.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-my-threads.ts View packages/apiclient/chat/list-my-threads.ts

Diff too large to display.

Added packages/apiclient/chat/list-outbound-webhooks.schemas.ts View packages/apiclient/chat/list-outbound-webhooks.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-outbound-webhooks.ts View packages/apiclient/chat/list-outbound-webhooks.ts

Diff too large to display.

Added packages/apiclient/chat/list-pins.schemas.ts View packages/apiclient/chat/list-pins.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-pins.ts View packages/apiclient/chat/list-pins.ts

Diff too large to display.

Added packages/apiclient/chat/list-reactions.schemas.ts View packages/apiclient/chat/list-reactions.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-reactions.ts View packages/apiclient/chat/list-reactions.ts

Diff too large to display.

Added packages/apiclient/chat/list-reminders.schemas.ts View packages/apiclient/chat/list-reminders.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-reminders.ts View packages/apiclient/chat/list-reminders.ts

Diff too large to display.

Added packages/apiclient/chat/list-space-presences.schemas.ts View packages/apiclient/chat/list-space-presences.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-space-presences.ts View packages/apiclient/chat/list-space-presences.ts

Diff too large to display.

Added packages/apiclient/chat/list-space-read-states.schemas.ts View packages/apiclient/chat/list-space-read-states.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-space-read-states.ts View packages/apiclient/chat/list-space-read-states.ts

Diff too large to display.

Added packages/apiclient/chat/list-space-rooms.schemas.ts View packages/apiclient/chat/list-space-rooms.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-space-rooms.ts View packages/apiclient/chat/list-space-rooms.ts

Diff too large to display.

Added packages/apiclient/chat/list-threads.schemas.ts View packages/apiclient/chat/list-threads.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-threads.ts View packages/apiclient/chat/list-threads.ts

Diff too large to display.

Added packages/apiclient/chat/list-webhooks.schemas.ts View packages/apiclient/chat/list-webhooks.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/list-webhooks.ts View packages/apiclient/chat/list-webhooks.ts

Diff too large to display.

Added packages/apiclient/chat/livekit-webhook.schemas.ts View packages/apiclient/chat/livekit-webhook.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/livekit-webhook.ts View packages/apiclient/chat/livekit-webhook.ts

Diff too large to display.

Added packages/apiclient/chat/mark-read.schemas.ts View packages/apiclient/chat/mark-read.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/mark-read.ts View packages/apiclient/chat/mark-read.ts

Diff too large to display.

Added packages/apiclient/chat/mark-thread-read.schemas.ts View packages/apiclient/chat/mark-thread-read.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/mark-thread-read.ts View packages/apiclient/chat/mark-thread-read.ts

Diff too large to display.

Added packages/apiclient/chat/moderate-mute.schemas.ts View packages/apiclient/chat/moderate-mute.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/moderate-mute.ts View packages/apiclient/chat/moderate-mute.ts

Diff too large to display.

Added packages/apiclient/chat/open-dm.schemas.ts View packages/apiclient/chat/open-dm.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/open-dm.ts View packages/apiclient/chat/open-dm.ts

Diff too large to display.

Added packages/apiclient/chat/post-via-webhook.schemas.ts View packages/apiclient/chat/post-via-webhook.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/post-via-webhook.ts View packages/apiclient/chat/post-via-webhook.ts

Diff too large to display.

Added packages/apiclient/chat/raise-hand.schemas.ts View packages/apiclient/chat/raise-hand.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/raise-hand.ts View packages/apiclient/chat/raise-hand.ts

Diff too large to display.

Added packages/apiclient/chat/remove-reaction.schemas.ts View packages/apiclient/chat/remove-reaction.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/remove-reaction.ts View packages/apiclient/chat/remove-reaction.ts

Diff too large to display.

Added packages/apiclient/chat/revoke-hand.schemas.ts View packages/apiclient/chat/revoke-hand.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/revoke-hand.ts View packages/apiclient/chat/revoke-hand.ts

Diff too large to display.

Added packages/apiclient/chat/save-voice-layout.schemas.ts View packages/apiclient/chat/save-voice-layout.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/save-voice-layout.ts View packages/apiclient/chat/save-voice-layout.ts

Diff too large to display.

Added packages/apiclient/chat/send-message.schemas.ts View packages/apiclient/chat/send-message.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/send-message.ts View packages/apiclient/chat/send-message.ts

Diff too large to display.

Added packages/apiclient/chat/set-message-pin.schemas.ts View packages/apiclient/chat/set-message-pin.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/set-message-pin.ts View packages/apiclient/chat/set-message-pin.ts

Diff too large to display.

Added packages/apiclient/chat/set-presence.schemas.ts View packages/apiclient/chat/set-presence.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/set-presence.ts View packages/apiclient/chat/set-presence.ts

Diff too large to display.

Added packages/apiclient/chat/start-recording.schemas.ts View packages/apiclient/chat/start-recording.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/start-recording.ts View packages/apiclient/chat/start-recording.ts

Diff too large to display.

Added packages/apiclient/chat/stop-recording.schemas.ts View packages/apiclient/chat/stop-recording.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/stop-recording.ts View packages/apiclient/chat/stop-recording.ts

Diff too large to display.

Added packages/apiclient/chat/unfollow-thread.schemas.ts View packages/apiclient/chat/unfollow-thread.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/unfollow-thread.ts View packages/apiclient/chat/unfollow-thread.ts

Diff too large to display.

Added packages/apiclient/chat/update-bookmark.schemas.ts View packages/apiclient/chat/update-bookmark.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/update-bookmark.ts View packages/apiclient/chat/update-bookmark.ts

Diff too large to display.

Added packages/apiclient/chat/update-message.schemas.ts View packages/apiclient/chat/update-message.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/update-message.ts View packages/apiclient/chat/update-message.ts

Diff too large to display.

Added packages/apiclient/chat/update-outbound-webhook.schemas.ts View packages/apiclient/chat/update-outbound-webhook.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/update-outbound-webhook.ts View packages/apiclient/chat/update-outbound-webhook.ts

Diff too large to display.

Added packages/apiclient/chat/update-reminder.schemas.ts View packages/apiclient/chat/update-reminder.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/update-reminder.ts View packages/apiclient/chat/update-reminder.ts

Diff too large to display.

Added packages/apiclient/chat/update-room-setting.schemas.ts View packages/apiclient/chat/update-room-setting.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/update-room-setting.ts View packages/apiclient/chat/update-room-setting.ts

Diff too large to display.

Added packages/apiclient/chat/update-room.schemas.ts View packages/apiclient/chat/update-room.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/update-room.ts View packages/apiclient/chat/update-room.ts

Diff too large to display.

Added packages/apiclient/chat/update-thread.schemas.ts View packages/apiclient/chat/update-thread.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/update-thread.ts View packages/apiclient/chat/update-thread.ts

Diff too large to display.

Added packages/apiclient/chat/update-webhook.schemas.ts View packages/apiclient/chat/update-webhook.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/update-webhook.ts View packages/apiclient/chat/update-webhook.ts

Diff too large to display.

Added packages/apiclient/chat/upload-emoji.schemas.ts View packages/apiclient/chat/upload-emoji.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/upload-emoji.ts View packages/apiclient/chat/upload-emoji.ts

Diff too large to display.

Added packages/apiclient/chat/upsert-draft.schemas.ts View packages/apiclient/chat/upsert-draft.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/upsert-draft.ts View packages/apiclient/chat/upsert-draft.ts

Diff too large to display.

Added packages/apiclient/chat/voice-config.schemas.ts View packages/apiclient/chat/voice-config.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/voice-config.ts View packages/apiclient/chat/voice-config.ts

Diff too large to display.

Added packages/apiclient/chat/voice-participants.schemas.ts View packages/apiclient/chat/voice-participants.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/voice-participants.ts View packages/apiclient/chat/voice-participants.ts

Diff too large to display.

Added packages/apiclient/chat/voice-space-states.schemas.ts View packages/apiclient/chat/voice-space-states.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/voice-space-states.ts View packages/apiclient/chat/voice-space-states.ts

Diff too large to display.

Added packages/apiclient/chat/voice-token.schemas.ts View packages/apiclient/chat/voice-token.schemas.ts

Diff too large to display.

Added packages/apiclient/chat/voice-token.ts View packages/apiclient/chat/voice-token.ts

Diff too large to display.

Added packages/apiclient/cleanup/clear-cleanup-overwrites.schemas.ts View packages/apiclient/cleanup/clear-cleanup-overwrites.schemas.ts

Diff too large to display.

Added packages/apiclient/cleanup/clear-cleanup-overwrites.ts View packages/apiclient/cleanup/clear-cleanup-overwrites.ts

Diff too large to display.

Added packages/apiclient/cleanup/delete-cleanup-object.schemas.ts View packages/apiclient/cleanup/delete-cleanup-object.schemas.ts

Diff too large to display.

Added packages/apiclient/cleanup/delete-cleanup-object.ts View packages/apiclient/cleanup/delete-cleanup-object.ts

Diff too large to display.

Added packages/apiclient/cleanup/index.ts View packages/apiclient/cleanup/index.ts

Diff too large to display.

Added packages/apiclient/cleanup/list-cleanup-objects.schemas.ts View packages/apiclient/cleanup/list-cleanup-objects.schemas.ts

Diff too large to display.

Added packages/apiclient/cleanup/list-cleanup-objects.ts View packages/apiclient/cleanup/list-cleanup-objects.ts

Diff too large to display.

Added packages/apiclient/cleanup/set-cleanup-archive.schemas.ts View packages/apiclient/cleanup/set-cleanup-archive.schemas.ts

Diff too large to display.

Added packages/apiclient/cleanup/set-cleanup-archive.ts View packages/apiclient/cleanup/set-cleanup-archive.ts

Diff too large to display.

Added packages/apiclient/cleanup/set-cleanup-visibility.schemas.ts View packages/apiclient/cleanup/set-cleanup-visibility.schemas.ts

Diff too large to display.

Added packages/apiclient/cleanup/set-cleanup-visibility.ts View packages/apiclient/cleanup/set-cleanup-visibility.ts

Diff too large to display.

Added packages/apiclient/code-comments/create-code-comment.schemas.ts View packages/apiclient/code-comments/create-code-comment.schemas.ts

Diff too large to display.

Added packages/apiclient/code-comments/create-code-comment.ts View packages/apiclient/code-comments/create-code-comment.ts

Diff too large to display.

Added packages/apiclient/code-comments/delete-code-comment.schemas.ts View packages/apiclient/code-comments/delete-code-comment.schemas.ts

Diff too large to display.

Added packages/apiclient/code-comments/delete-code-comment.ts View packages/apiclient/code-comments/delete-code-comment.ts

Diff too large to display.

Added packages/apiclient/code-comments/index.ts View packages/apiclient/code-comments/index.ts

Diff too large to display.

Added packages/apiclient/code-comments/list-code-comments.schemas.ts View packages/apiclient/code-comments/list-code-comments.schemas.ts

Diff too large to display.

Added packages/apiclient/code-comments/list-code-comments.ts View packages/apiclient/code-comments/list-code-comments.ts

Diff too large to display.

Added packages/apiclient/code-comments/resolve-code-comment.schemas.ts View packages/apiclient/code-comments/resolve-code-comment.schemas.ts

Diff too large to display.

Added packages/apiclient/code-comments/resolve-code-comment.ts View packages/apiclient/code-comments/resolve-code-comment.ts

Diff too large to display.

Added packages/apiclient/code-comments/unresolve-code-comment.schemas.ts View packages/apiclient/code-comments/unresolve-code-comment.schemas.ts

Diff too large to display.

Added packages/apiclient/code-comments/unresolve-code-comment.ts View packages/apiclient/code-comments/unresolve-code-comment.ts

Diff too large to display.

Added packages/apiclient/code-comments/update-code-comment.schemas.ts View packages/apiclient/code-comments/update-code-comment.schemas.ts

Diff too large to display.

Added packages/apiclient/code-comments/update-code-comment.ts View packages/apiclient/code-comments/update-code-comment.ts

Diff too large to display.

Added packages/apiclient/commits/commit-stats.schemas.ts View packages/apiclient/commits/commit-stats.schemas.ts

Diff too large to display.

Added packages/apiclient/commits/commit-stats.ts View packages/apiclient/commits/commit-stats.ts

Diff too large to display.

Added packages/apiclient/commits/get-commit.ts View packages/apiclient/commits/get-commit.ts

Diff too large to display.

Added packages/apiclient/commits/index.ts View packages/apiclient/commits/index.ts

Diff too large to display.

Added packages/apiclient/commits/is-ancestor.schemas.ts View packages/apiclient/commits/is-ancestor.schemas.ts

Diff too large to display.

Added packages/apiclient/commits/is-ancestor.ts View packages/apiclient/commits/is-ancestor.ts

Diff too large to display.

Added packages/apiclient/commits/list-commit-statuses.schemas.ts View packages/apiclient/commits/list-commit-statuses.schemas.ts

Diff too large to display.

Added packages/apiclient/commits/list-commit-statuses.ts View packages/apiclient/commits/list-commit-statuses.ts

Diff too large to display.

Added packages/apiclient/commits/list-commits.schemas.ts View packages/apiclient/commits/list-commits.schemas.ts

Diff too large to display.

Added packages/apiclient/commits/list-commits.ts View packages/apiclient/commits/list-commits.ts

Diff too large to display.

Added packages/apiclient/commits/rev-parse.schemas.ts View packages/apiclient/commits/rev-parse.schemas.ts

Diff too large to display.

Added packages/apiclient/commits/rev-parse.ts View packages/apiclient/commits/rev-parse.ts

Diff too large to display.

Added packages/apiclient/commits/set-commit-status.schemas.ts View packages/apiclient/commits/set-commit-status.schemas.ts

Diff too large to display.

Added packages/apiclient/commits/set-commit-status.ts View packages/apiclient/commits/set-commit-status.ts

Diff too large to display.

Added packages/apiclient/conflicts/conflict-detail.schemas.ts View packages/apiclient/conflicts/conflict-detail.schemas.ts

Diff too large to display.

Added packages/apiclient/conflicts/conflict-detail.ts View packages/apiclient/conflicts/conflict-detail.ts

Diff too large to display.

Added packages/apiclient/conflicts/get-conflicts.schemas.ts View packages/apiclient/conflicts/get-conflicts.schemas.ts

Diff too large to display.

Added packages/apiclient/conflicts/get-conflicts.ts View packages/apiclient/conflicts/get-conflicts.ts

Diff too large to display.

Added packages/apiclient/conflicts/index.ts View packages/apiclient/conflicts/index.ts

Diff too large to display.

Added packages/apiclient/content/caller-signature.schemas.ts View packages/apiclient/content/caller-signature.schemas.ts

Diff too large to display.

Modified packages/apiclient/index.schemas.ts View packages/apiclient/index.schemas.ts
@@ -91,352 +91,5701 @@
9191 *
9292 * OpenAPI spec version: 1.0
9393 */
94export interface TotpCodeCmd {
95 code: string;
94export interface AcceptAgreementCmd {
95 version: string;
9696}
9797
98export interface EnvelopeNoData {
99 code: number;
100 data?: unknown;
101 /** @nullable */
102 error?: string | null;
103 /** @nullable */
104 error_code?: string | null;
105 message: string;
106 request_id?: string;
98export interface AcceptAgreementResp {
99 recorded: boolean;
107100}
108101
109export interface TotpEnableCmd {
110 code: string;
111 password: string;
102export interface AccountDeletionDto {
103 /** @nullable */
104 last_error?: string | null;
105 purge_after: string;
106 requested_at: string;
107 status: string;
112108}
113109
114export type EnvelopeRecoveryCodesRespData = {
115 codes: string[];
116 /** @minimum 0 */
117 total: number;
118 /** @minimum 0 */
119 used: number;
120};
121
122export interface EnvelopeRecoveryCodesResp {
123 code: number;
124 data?: EnvelopeRecoveryCodesRespData;
110export type WhitelistKind = "Push" | "Merge" | "Approval";
111export interface AddBranchWhitelistCmd {
125112 /** @nullable */
126 error?: string | null;
113 group_id?: string | null;
114 kind: WhitelistKind;
127115 /** @nullable */
128 error_code?: string | null;
129 message: string;
130 request_id?: string;
116 user_id?: number | null;
131117}
132118
133export interface RegenerateRecoveryCodesCmd {
134 password: string;
119export type SpaceMemberRole = "member" | "admin" | "owner";
120export interface AddMemberBody {
121 role?: null | SpaceMemberRole;
122 role_keys?: string[];
123 user_id: number;
135124}
136125
137export type EnvelopeTotpSetupRespData = {
138 otpauth_uri: string;
139 secret: string;
140};
126export interface AddTagWhitelistCmd {
127 user_id: number;
128}
141129
142export interface EnvelopeTotpSetupResp {
143 code: number;
144 data?: EnvelopeTotpSetupRespData;
145 /** @nullable */
146 error?: string | null;
147 /** @nullable */
148 error_code?: string | null;
149 message: string;
150 request_id?: string;
130export interface AgreementDoc {
131 content_md: string;
132 key: string;
133 title: string;
134 version: string;
151135}
152136
153export type EnvelopeTotpStatusRespData = {
154 enabled: boolean;
155};
137/**
138 * 允许加入的历史开关,映射 `spaces.allow_join_level`。
139 */
140export type AllowJoinLevel =
141 | "None"
142 | "NeedMailActive"
143 | "NeedMailActiveAndLastOneMid"
144 | "NeedMailActiveAndLastOneHours"
145 | "NeedMailActiveAndPhoneActive";
146export interface AppliedPatchDto {
147 applied: boolean;
148 conflicts: string[];
149}
156150
157export interface EnvelopeTotpStatusResp {
158 code: number;
159 data?: EnvelopeTotpStatusRespData;
151export type ArchiveFormatDto = "tar" | "tar_gz" | "tar_bz2" | "zip";
152export interface ArchiveCreateCmd {
153 format: ArchiveFormatDto;
160154 /** @nullable */
161 error?: string | null;
155 path_filter?: string | null;
156 revision: string;
157}
158
159export interface ArchiveResultDto {
160 cache_key: string;
162161 /** @nullable */
163 error_code?: string | null;
164 message: string;
165 request_id?: string;
162 download_url?: string | null;
163 format: string;
164 size: number;
166165}
167166
168export type EnvelopeChallengeResponseData = {
169 context: string;
170 /** @minimum 0 */
171 difficulty: number;
172 /** @minimum 0 */
173 expires_at: number;
174 /** @minimum 0 */
175 issued_at: number;
176};
167export interface AssignCmd {
168 /** 用户名或 UUID。 */
169 user: string;
170}
177171
178export interface EnvelopeChallengeResponse {
179 code: number;
180 data?: EnvelopeChallengeResponseData;
181 /** @nullable */
182 error?: string | null;
183 /** @nullable */
184 error_code?: string | null;
185 message: string;
186 request_id?: string;
172export interface AssignGroupCmd {
173 group_id: string;
187174}
188175
189export interface PowProofRequest {
190 /** @minimum 0 */
191 nonce: number;
192 /** @items.minimum 0 */
193 payload: number[];
176export interface AssignRoleBody {
177 member_id: string;
178 role_key: string;
194179}
195180
196export interface UserLoginRequest {
197 identity: string;
198 password_hash: string;
199 pow_payload: PowProofRequest;
181export interface AttachLabelCmd {
182 /** 标签 UUID 或名称(同一仓库目录内的标签)。 */
183 label: string;
200184}
201185
202export type EnvelopeUserLoginResponseData = {
186export type AttachmentStatus = "Pending" | "Uploaded";
187export interface AttachmentDto {
188 content_type: string;
189 created_at: string;
190 /** @nullable */
191 description?: string | null;
192 /** @nullable */
193 duration_secs?: number | null;
194 filename: string;
195 /** @nullable */
196 height?: number | null;
197 id: string;
203198 /** @nullable */
204 challenge?: string | null;
199 message_id?: string | null;
205200 /** @nullable */
206 displayname?: string | null;
207 mfa_required: boolean;
201 room_id?: string | null;
202 size: number;
203 status: AttachmentStatus;
208204 user_id: number;
209 username: string;
210};
211
212export interface EnvelopeUserLoginResponse {
213 code: number;
214 data?: EnvelopeUserLoginResponseData;
215205 /** @nullable */
216 error?: string | null;
217 /** @nullable */
218 error_code?: string | null;
219 message: string;
220 request_id?: string;
206 width?: number | null;
221207}
222208
223export interface LoginCodeRequest {
224 email: string;
225 pow_payload: PowProofRequest;
209export type Audience = "Everyone" | "FollowingOnly" | "Nobody";
210export type AuthorType = "User" | "Bot" | "Webhook";
211export type AvatarFormat = "jpg" | "png" | "webp" | "gif";
212export interface AvatarDto {
213 /**
214 * Size of the uploaded original in bytes.
215 * @minimum 0
216 */
217 bytes: number;
218 /** Format of the uploaded original. */
219 format: AvatarFormat;
220 updated_at: string;
221 /**
222 * Browser-facing URL. Points at the compressed derivative when one exists,
223 * and at the uploaded bytes otherwise.
224 */
225 url: string;
226 user_id: number;
226227}
227228
228export type EnvelopeLoginCodeResponseData = {
229 /** @minimum 0 */
230 expires_in_secs: number;
231};
232
233export interface EnvelopeLoginCodeResponse {
234 code: number;
235 data?: EnvelopeLoginCodeResponseData;
229export interface BanMemberBody {
236230 /** @nullable */
237 error?: string | null;
238 /** @nullable */
239 error_code?: string | null;
240 message: string;
241 request_id?: string;
231 reason?: string | null;
242232}
243233
244export interface LoginCodeVerifyRequest {
245 email: string;
246 email_code: string;
247 pow_payload: PowProofRequest;
234export interface BlameRangeDto {
235 abbreviated_oid: string;
236 commit_sha: string;
237 ending_line: number;
238 /** @nullable */
239 path?: string | null;
240 starting_line: number;
248241}
249242
250export interface LoginVerifyRequest {
251 challenge: string;
252 code: string;
243export interface BlobContentDto {
244 /** @items.minimum 0 */
245 data: number[];
246 is_binary: boolean;
247 oid: string;
248 size: number;
249 truncated: boolean;
253250}
254251
255export type EnvelopeLogoutResponseData = {
252export interface LfsPointerDto {
256253 /** @nullable */
257 user_id?: number | null;
258};
259
260export interface EnvelopeLogoutResponse {
261 code: number;
262 data?: EnvelopeLogoutResponseData;
263 /** @nullable */
264 error?: string | null;
254 oid?: string | null;
265255 /** @nullable */
266 error_code?: string | null;
267 message: string;
268 request_id?: string;
256 size?: number | null;
257 version: string;
258}
259
260export interface BlobMetaDto {
261 is_binary: boolean;
262 is_lfs_pointer: boolean;
263 lfs?: null | LfsPointerDto;
264 oid: string;
265 size: number;
269266}
270267
271export type EnvelopeMeResponseData = {
272 /** @nullable */
273 avatar_url?: string | null;
274 created_at: string;
275 /** @nullable */
276 displayname?: string | null;
277 email: string;
268export interface BoardDto {
269 closed_issues_count: number;
270 created_at: string;
278271 /** @nullable */
279 email_verified_at?: string | null;
280 is_admin: boolean;
281 user_id: number;
282 username: string;
283 version: number;
284};
285
286export interface EnvelopeMeResponse {
287 code: number;
288 data?: EnvelopeMeResponseData;
272 description?: string | null;
273 dir_id: string;
289274 /** @nullable */
290 error?: string | null;
275 icon?: string | null;
276 id: string;
277 name: string;
278 open_issues_count: number;
279 /**
280 * Number prefix for the board's issues (`CAD` renders as `CAD-12`).
281 * @nullable
282 */
283 prefix?: string | null;
291284 /** @nullable */
292 error_code?: string | null;
293 message: string;
294 request_id?: string;
285 updated_at?: string | null;
295286}
296287
297export interface ChangePasswordCmd {
298 new_password: string;
299 old_password: string;
288export interface BoardPath {
289 board_id: string;
290 space_name: string;
300291}
301292
302export interface PasswordResetRequest {
303 email: string;
304 pow_payload: PowProofRequest;
293export interface BookmarkDto {
294 created_at: string;
295 created_by_id: number;
296 /** @nullable */
297 emoji?: string | null;
298 id: string;
299 position: number;
300 room_id: string;
301 title: string;
302 /** @nullable */
303 url?: string | null;
305304}
306305
307export type EnvelopePasswordResetResponseData = {
308 /** @minimum 0 */
309 expires_in_secs: number;
310};
306export interface BranchDto {
307 commit_sha: string;
308 created_at: string;
309 /** @nullable */
310 deleted_at?: string | null;
311 is_deleted: boolean;
312 is_protected: boolean;
313 name: string;
314 updated_at: string;
315}
311316
312export interface EnvelopePasswordResetResponse {
313 code: number;
314 data?: EnvelopePasswordResetResponseData;
317export interface BranchInfoDto {
315318 /** @nullable */
316 error?: string | null;
317 /** @nullable */
318 error_code?: string | null;
319 message: string;
320 request_id?: string;
319 commit_message?: string | null;
320 commit_sha: string;
321 is_protected: boolean;
322 name: string;
321323}
322324
323export interface PasswordResetConfirmRequest {
324 password_hash: string;
325 pow_payload: PowProofRequest;
326 token: string;
325export interface BranchPolicyDto {
326 block_on_change_requested_reviews: boolean;
327 block_on_outdated_branch: boolean;
328 block_on_rejected_reviews: boolean;
329 branch_pattern: string;
330 created_at: string;
331 dismiss_stale_approvals: boolean;
332 enable_approvals_whitelist: boolean;
333 enable_force_push: boolean;
334 enable_merge_whitelist: boolean;
335 enable_push: boolean;
336 enable_push_whitelist: boolean;
337 id: string;
338 protected_file_patterns: string;
339 push_whitelist_deploy_keys: boolean;
340 repo_id: string;
341 require_signed_commits: boolean;
342 required_approvals: number;
343 required_status_contexts: string;
344 unprotected_file_patterns: string;
345 updated_at: string;
327346}
328347
329export type EnvelopePasswordResetConfirmResponseData = {
330 user_id: number;
331};
332
333export interface EnvelopePasswordResetConfirmResponse {
334 code: number;
335 data?: EnvelopePasswordResetConfirmResponseData;
348export interface BranchPolicyFlags {
349 /** @nullable */
350 block_on_change_requested_reviews?: boolean | null;
351 /** @nullable */
352 block_on_outdated_branch?: boolean | null;
353 /** @nullable */
354 block_on_rejected_reviews?: boolean | null;
355 /** @nullable */
356 dismiss_stale_approvals?: boolean | null;
357 /** @nullable */
358 enable_approvals_whitelist?: boolean | null;
359 /** @nullable */
360 enable_force_push?: boolean | null;
361 /** @nullable */
362 enable_merge_whitelist?: boolean | null;
363 /** @nullable */
364 enable_push?: boolean | null;
365 /** @nullable */
366 enable_push_whitelist?: boolean | null;
367 /** @nullable */
368 protected_file_patterns?: string | null;
369 /** @nullable */
370 require_signed_commits?: boolean | null;
336371 /** @nullable */
337 error?: string | null;
372 required_approvals?: number | null;
338373 /** @nullable */
339 error_code?: string | null;
340 message: string;
341 request_id?: string;
342}
343
344export interface UserRegisterRequest {
345 birth_date: string;
374 required_status_contexts?: string | null;
346375 /** @nullable */
347 displayname?: string | null;
348 email: string;
349 email_code: string;
350 password_hash: string;
351 pow_payload: PowProofRequest;
352 username: string;
376 unprotected_file_patterns?: string | null;
353377}
354378
355export type EnvelopeUserRegisterResponseData = {
356 /** @nullable */
357 displayname?: string | null;
379export interface UserDto {
380 avatar_url: string;
381 display_name: string;
358382 user_id: number;
359383 username: string;
360};
384}
361385
362export interface EnvelopeUserRegisterResponse {
363 code: number;
364 data?: EnvelopeUserRegisterResponseData;
386export interface BranchWhitelistDto {
387 created_at: string;
365388 /** @nullable */
366 error?: string | null;
389 group_id?: string | null;
390 id: string;
391 kind: WhitelistKind;
392 policy_id: string;
393 user?: null | UserDto;
367394 /** @nullable */
368 error_code?: string | null;
369 message: string;
370 request_id?: string;
395 user_id?: number | null;
396}
397
398export type BulkAction = "close" | "reopen";
399export interface BulkDeleteCmd {
400 message_ids: string[];
371401}
372402
373export interface RegisterCodeRequest {
374 email: string;
375 pow_payload: PowProofRequest;
403export interface BulkIssuesCmd {
404 action: BulkAction;
405 issue_refs: string[];
376406}
377407
378export type EnvelopeRegisterCodeResponseData = {
408export interface BulkResultDto {
379409 /** @minimum 0 */
380 expires_in_secs: number;
381};
410 updated: number;
411}
382412
383export interface EnvelopeRegisterCodeResponse {
384 code: number;
385 data?: EnvelopeRegisterCodeResponseData;
413export interface CallerSignatureBody {
386414 /** @nullable */
387 error?: string | null;
388 /** @nullable */
389 error_code?: string | null;
390 message: string;
391 request_id?: string;
415 when?: string | null;
392416}
393417
394export type SshKeyAlgorithm = "rsa" | "ed25519" | "ecdsa";
395export type EnvelopePageSshKeySummaryDataItemsItem = {
396 algorithm: SshKeyAlgorithm;
397 created_at: string;
398 /** @nullable */
399 description?: string | null;
400 /** @nullable */
401 expires_at?: string | null;
402 fingerprint: string;
403 id: string;
404 /** @nullable */
405 last_used_at?: string | null;
406 name: string;
407 public_key: string;
408 /** @nullable */
409 revoked_at?: string | null;
410};
411
412export type EnvelopePageSshKeySummaryData = {
413 items: EnvelopePageSshKeySummaryDataItemsItem[];
418export interface ChallengeResponse {
419 context: string;
414420 /** @minimum 0 */
415 limit: number;
421 difficulty: number;
416422 /** @minimum 0 */
417 offset: number;
423 expires_at: number;
418424 /** @minimum 0 */
419 total: number;
420};
425 issued_at: number;
426}
421427
422export interface EnvelopePageSshKeySummary {
423 code: number;
424 data?: EnvelopePageSshKeySummaryData;
425 /** @nullable */
426 error?: string | null;
427 /** @nullable */
428 error_code?: string | null;
429 message: string;
430 request_id?: string;
428export interface ChangePasswordCmd {
429 new_password: string;
430 old_password: string;
431431}
432432
433export interface SshKeyAddRequest {
434 /** @nullable */
435 description?: string | null;
433export interface ChangedPathDto {
434 /** @minimum 0 */
435 new_mode: number;
436 /** @nullable */
437 new_oid?: string | null;
438 new_path: string;
439 /** @minimum 0 */
440 old_mode: number;
441 /** @nullable */
442 old_oid?: string | null;
443 /** @nullable */
444 old_path?: string | null;
445 status: string;
446}
447
448export interface ChangedPathDiffDto {
449 binary: boolean;
450 /** @minimum 0 */
451 lines_added: number;
452 /** @minimum 0 */
453 lines_removed: number;
454 /** @nullable */
455 patch?: string | null;
456 path: ChangedPathDto;
457}
458
459export type ChatMessageType =
460 | "Default"
461 | "Reply"
462 | "ThreadCreated"
463 | "ChannelJoin"
464 | "ChannelLeave"
465 | "ChannelTopic"
466 | "ChannelPinnedItem"
467 | "Reminder"
468 | "System";
469export interface CheckPermissionBody {
470 permission: string;
471 /** @nullable */
472 user_id?: number | null;
473}
474
475export interface CleanupObjectDto {
476 /** 目录的子节点数 / 频道的子频道数。 */
477 child_count: number;
478 /** `dirs.id`(目录/仓库/问题集/智能体集)或 `rooms.id`(频道)。 */
479 id: string;
480 is_archived: boolean;
481 /**
482 * 仅仓库与频道有可见性开关。
483 * @nullable
484 */
485 is_private?: boolean | null;
486 /** `dir | object | repo | board | text | voice | stage | category | news | guild_room` */
487 kind: string;
488 name: string;
489 /** 目录上的权限覆盖条数(group + user)。 */
490 overwrite_count: number;
491 /** 父链拼出的可读路径,例如 `bots / 研究研究`。 */
492 path: string;
493}
494
495export interface CodeActivityAuthorDto {
496 additions: number;
497 commits: number;
498 deletions: number;
499 email: string;
500 name: string;
501}
502
503export interface CodeActivityDto {
504 authors: CodeActivityAuthorDto[];
505 total_additions: number;
506 total_commits: number;
507 total_deletions: number;
508}
509
510export interface CodeCommentDto {
511 author?: null | UserDto;
512 body: string;
513 commit_sha: string;
514 created_at: string;
515 id: string;
516 line: number;
517 /** 该评论锚定的提交是否仍是当前分支提示(否则视为 outdated)。 */
518 outdated: boolean;
519 /** @nullable */
520 parent_id?: string | null;
521 path: string;
522 repo_id: string;
523 resolved: boolean;
524 /** @nullable */
525 resolved_by?: number | null;
526 /** @nullable */
527 updated_at?: string | null;
528}
529
530export interface CommentDto {
531 content: string;
532 created_at: string;
533 id: string;
534 /** @nullable */
535 issue_id?: string | null;
536 /** @nullable */
537 parent_id?: string | null;
538 poster?: null | UserDto;
539 /** @nullable */
540 updated_at?: string | null;
541}
542
543export interface CommentPath {
544 board_id: string;
545 comment_id: string;
546 issue_id: string;
547 space_name: string;
548}
549
550export interface CommentReactionPath {
551 board_id: string;
552 comment_id: string;
553 issue_id: string;
554 space_name: string;
555}
556
557export type CommentSort = "created_at" | "updated_at";
558export interface CommentTreeNode {
559 comment: CommentDto;
560 replies: CommentTreeNode[];
561}
562
563export interface CommitDto {
564 author_email: string;
565 author_name: string;
566 author_time: number;
567 committer_email: string;
568 committer_name: string;
569 committer_time: number;
570 id: string;
571 message: string;
572 parents: string[];
573 tree_id: string;
574}
575
576export interface SignatureDto {
577 email: string;
578 name: string;
579 when: string;
580}
581
582export type ObjectKind = "merge" | "squash";
583export interface CommitObjectBody {
584 author: SignatureDto;
585 committer: SignatureDto;
586 kind: ObjectKind;
587 message: string;
588 parents: string[];
589 tree: string;
590}
591
592export type CommitStatusDtoState = "pending" | "success" | "failure" | "error";
593export interface CommitStatusDto {
594 context: string;
595 created_at: string;
596 creator?: null | UserDto;
597 creator_id: number;
598 /** @nullable */
599 description?: string | null;
600 state: CommitStatusDtoState;
601 /** @nullable */
602 target_url?: string | null;
603 /** @nullable */
604 updated_at?: string | null;
605}
606
607export type CommitStatusState = "Pending" | "Success" | "Failure" | "Error";
608export interface CommitSyncResponse {
609 repo_id: string;
610 sha: string;
611}
612
613/**
614 * 提交历史页:统一分页字段 + 该端点特有的 `has_more` / `diff_view_style`。
615 */
616export interface CommitsPage {
617 diff_view_style: string;
618 has_more: boolean;
619 items: CommitDto[];
620 /** @minimum 0 */
621 limit: number;
622 /** @minimum 0 */
623 offset: number;
624 /** @minimum 0 */
625 total: number;
626}
627
628export interface ConflictDetailDto {
629 /** @nullable */
630 content?: string | null;
631 path: string;
632}
633
634export interface ContentHistoryDto {
635 /** @nullable */
636 comment_id?: string | null;
637 /** @nullable */
638 content_after?: string | null;
639 /** @nullable */
640 content_before?: string | null;
641 created_at: string;
642 edited_at: string;
643 id: string;
644 issue_id: string;
645 poster?: null | UserDto;
646}
647
648export interface ContentHistoryPath {
649 board_id: string;
650 issue_id: string;
651 space_name: string;
652}
653
654export interface ContributorStatDto {
655 additions: number;
656 commits: number;
657 deletions: number;
658 email: string;
659 name: string;
660}
661
662export interface CountResp {
663 count: number;
664}
665
666export interface CreateAttachmentCmd {
667 content_type: string;
668 /** @nullable */
669 description?: string | null;
670 filename: string;
671 size: number;
672}
673
674export interface CreateBoardCmd {
675 /** @nullable */
676 description?: string | null;
677 /** @nullable */
678 icon?: string | null;
679 name: string;
680 /** @nullable */
681 parent_dir_id?: string | null;
682 /** @nullable */
683 prefix?: string | null;
684}
685
686export interface CreateBookmarkCmd {
687 /** @nullable */
688 emoji?: string | null;
689 title: string;
690 /** @nullable */
691 url?: string | null;
692}
693
694export interface CreateBranchCmd {
695 name: string;
696 /** @nullable */
697 start_point?: string | null;
698}
699
700/**
701 * 分支保护策略的创建请求。
702 *
703 * 字段与 [`BranchPolicyFlags`] 一一对应,但刻意不使用 `#[serde(flatten)]`:
704 * 扁平化会让 utoipa 生成 `allOf` 组合,而 web 端 API 生成器无法处理该形状。
705 */
706export interface CreateBranchPolicyCmd {
707 /** @nullable */
708 block_on_change_requested_reviews?: boolean | null;
709 /** @nullable */
710 block_on_outdated_branch?: boolean | null;
711 /** @nullable */
712 block_on_rejected_reviews?: boolean | null;
713 branch_pattern: string;
714 /** @nullable */
715 dismiss_stale_approvals?: boolean | null;
716 /** @nullable */
717 enable_approvals_whitelist?: boolean | null;
718 /** @nullable */
719 enable_force_push?: boolean | null;
720 /** @nullable */
721 enable_merge_whitelist?: boolean | null;
722 /** @nullable */
723 enable_push?: boolean | null;
724 /** @nullable */
725 enable_push_whitelist?: boolean | null;
726 /** @nullable */
727 protected_file_patterns?: string | null;
728 /** @nullable */
729 require_signed_commits?: boolean | null;
730 /** @nullable */
731 required_approvals?: number | null;
732 /** @nullable */
733 required_status_contexts?: string | null;
734 /** @nullable */
735 unprotected_file_patterns?: string | null;
736}
737
738export interface CreateCodeCommentCmd {
739 body: string;
740 /**
741 * 锚定的提交;缺省使用该 revision 解析出的提交。
742 * @nullable
743 */
744 commit_sha?: string | null;
745 line: number;
746 /** @nullable */
747 parent_id?: string | null;
748 path: string;
749 /** @nullable */
750 revision?: string | null;
751}
752
753export interface CreateCommentCmd {
754 content: string;
755 /** @nullable */
756 parent_id?: string | null;
757}
758
759export interface CreateDependencyCmd {
760 dependency_id: string;
761}
762
763export interface CreateDirCmd {
764 name: string;
765 /** @nullable */
766 parent_dir_id?: string | null;
767 /** @nullable */
768 position?: number | null;
769}
770
771export interface CreateGroupCmd {
772 /** @nullable */
773 color?: string | null;
774 /** @nullable */
775 icon_hash?: string | null;
776 name: string;
777 permissions?: string[];
778 /** @nullable */
779 position?: number | null;
780 /** @nullable */
781 unicode_emoji?: string | null;
782}
783
784export interface CreateInviteBody {
785 max_uses?: number;
786 /** @nullable */
787 role_id?: string | null;
788 /** @nullable */
789 target_user_id?: number | null;
790 /**
791 * @minimum 0
792 * @nullable
793 */
794 ttl_secs?: number | null;
795}
796
797export type SpaceJoinMethod =
798 "direct" | "invite_link" | "invite_targeted" | "invite_email";
799export interface InviteSummary {
800 created_at: string;
801 created_by: number;
802 /** @nullable */
803 email?: string | null;
436804 /** @nullable */
437805 expires_at?: string | null;
806 id: string;
807 max_uses: number;
808 method: SpaceJoinMethod;
809 organization_id: string;
810 /** @nullable */
811 revoked_at?: string | null;
812 /** @nullable */
813 role_id?: string | null;
814 /** @nullable */
815 target_user_id?: number | null;
816 uses: number;
817}
818
819export interface CreateInviteResponse {
820 invite: InviteSummary;
821 token: string;
822}
823
824export interface CreateIssueAttachmentCmd {
825 content_type: string;
826 filename: string;
827 size: number;
828 /** Checked for membership so unbound uploads are still space-scoped. */
829 space_name: string;
830}
831
832export type IssuePriority = "none" | "low" | "medium" | "high" | "urgent";
833export interface CreateIssueCmd {
834 assignee_ids?: number[];
835 /** Draft uploads (`POST /issues/attachments`) to link to the new issue. */
836 attachment_ids?: string[];
837 content?: string;
838 /** @nullable */
839 description?: string | null;
840 /** @nullable */
841 due_at?: string | null;
842 label_ids?: string[];
843 /** @nullable */
844 milestone_id?: string | null;
845 priority?: IssuePriority;
846 title: string;
847}
848
849export type IssueMemberKind = "assignee" | "mentioned" | "participant";
850export interface CreateIssueMemberCmd {
851 kind: IssueMemberKind;
852 user_id: number;
853}
854
855export interface CreateJoinRequestCmd {
856 /** @nullable */
857 note?: string | null;
858}
859
860export type SpaceJoinTrigger = "issue_reaction" | "issue_comment_reaction";
861export interface CreateJoinRuleCmd {
862 matcher?: string;
863 role_id: string;
864 trigger?: SpaceJoinTrigger;
865}
866
867export interface CreateLabelCmd {
868 color: string;
869 /** @nullable */
870 description?: string | null;
871 /** @nullable */
872 exclusive?: boolean | null;
873 /** @nullable */
874 exclusive_order?: number | null;
875 name: string;
876}
877
878export interface CreateMilestoneCmd {
879 /** @nullable */
880 description?: string | null;
881 /** @nullable */
882 due_at?: string | null;
883 name: string;
884}
885
886export type SpaceJoinPolicy = "open" | "approval" | "invite_only" | "private";
887export interface CreateOrganizationBody {
888 /** @nullable */
889 allow_invite?: boolean | null;
890 /** @nullable */
891 allow_join?: boolean | null;
892 /** @nullable */
893 allow_join_level?: number | null;
894 /** @nullable */
895 avatar_url?: string | null;
896 /** @nullable */
897 description?: string | null;
898 join_policy?: null | SpaceJoinPolicy;
899 /** @nullable */
900 member_must_enable_2fa?: boolean | null;
901 name: string;
902 /** @nullable */
903 require_email_verified?: boolean | null;
904 /** @nullable */
905 require_mfa?: boolean | null;
906 slug: string;
907 /** @nullable */
908 welcome_message?: string | null;
909}
910
911export interface CreateOutboundWebhookCmd {
912 name: string;
913 url: string;
914}
915
916export interface CreatePinCmd {
917 issue_id: string;
918 pin_order: number;
919}
920
921export interface CreatePullCmd {
922 /** @nullable */
923 base_branch?: string | null;
924 /** @nullable */
925 body?: string | null;
926 /** @nullable */
927 draft?: boolean | null;
928 head_branch: string;
929 /** @nullable */
930 issue_id?: string | null;
931 title: string;
932}
933
934export interface CreatePullCommentCmd {
935 body: string;
936 /** @nullable */
937 commit_sha?: string | null;
938 /** @nullable */
939 line?: number | null;
940 /** @nullable */
941 parent_comment_id?: string | null;
942 /**
943 * 行内评论需要 path;缺省则为普通讨论评论。
944 * @nullable
945 */
946 path?: string | null;
947 /** @nullable */
948 review_id?: string | null;
949 /**
950 * left | right
951 * @nullable
952 */
953 side?: string | null;
954}
955
956export interface CreateReactionCmd {
957 emoji: string;
958}
959
960export interface CreateReleaseCmd {
961 /** @nullable */
962 content?: string | null;
963 /** @nullable */
964 is_draft?: boolean | null;
965 /** @nullable */
966 is_prerelease?: boolean | null;
967 tag_name: string;
968 /** @nullable */
969 target?: string | null;
970 /** @nullable */
971 title?: string | null;
972}
973
974export interface CreateReminderCmd {
975 /** @nullable */
976 note?: string | null;
977 remind_at: string;
978}
979
980export interface CreateRepoCmd {
981 /** @nullable */
982 default_branch?: string | null;
983 /** @nullable */
984 description?: string | null;
985 enable_lfs?: boolean;
986 /** @nullable */
987 init_message?: string | null;
988 is_private?: boolean;
989 /** @nullable */
990 license_name?: string | null;
991 name: string;
992 /** @nullable */
993 parent_dir_id?: string | null;
994}
995
996export interface CreateRepoRelCmd {
997 repo_id: string;
998}
999
1000export interface CreateReportCmd {
1001 /** @nullable */
1002 evidence?: string | null;
1003 reason: string;
1004 reported_id: number;
1005}
1006
1007export type PermissionEffect = "allow" | "deny";
1008export interface PermissionGrant {
1009 effect: PermissionEffect;
1010 permission: string;
1011}
1012
1013export interface CreateRoleBody {
1014 default_role?: boolean;
1015 /** @nullable */
1016 description?: string | null;
1017 key: string;
1018 name: string;
1019 permissions?: PermissionGrant[];
1020 rank?: number;
1021 self_assignable?: boolean;
1022}
1023
1024export type RoomKind =
1025 | "GuildRoom"
1026 | "GroupDm"
1027 | "Dm"
1028 | "Category"
1029 | "Text"
1030 | "Voice"
1031 | "Stage"
1032 | "News"
1033 | "Thread"
1034 | "DirectMessage";
1035export interface CreateRoomCmd {
1036 is_private?: boolean;
1037 kind?: RoomKind;
1038 name: string;
1039 nsfw?: boolean;
1040 /** @nullable */
1041 parent_id?: string | null;
1042 /** @nullable */
1043 rate_limit_per_user?: number | null;
1044 /** @nullable */
1045 topic?: string | null;
1046 /** @nullable */
1047 user_limit?: number | null;
1048}
1049
1050export interface CreateTagCmd {
1051 annotated?: boolean;
1052 /** @nullable */
1053 message?: string | null;
1054 name: string;
1055 target: string;
1056}
1057
1058export interface CreateTagPolicyCmd {
1059 name_pattern: string;
1060}
1061
1062export interface CreateThreadCmd {
1063 /** @nullable */
1064 name?: string | null;
1065}
1066
1067export interface CreateTopicCmd {
1068 name: string;
1069}
1070
1071export interface CreateTrackedTimeCmd {
1072 seconds: number;
1073}
1074
1075export interface CreateWebhookCmd {
1076 name: string;
1077}
1078
1079export interface DeleteOrgQuery {
1080 force?: boolean;
1081 /** @nullable */
1082 reason?: string | null;
1083}
1084
1085export interface DependencyDto {
1086 created_at: string;
1087 dependency_id: string;
1088 id: string;
1089 issue_id: string;
1090}
1091
1092export interface DependencyPath {
1093 board_id: string;
1094 dep_id: string;
1095 issue_id: string;
1096 space_name: string;
1097}
1098
1099export interface DeviceDto {
1100 /** @nullable */
1101 device_name?: string | null;
1102 /** @nullable */
1103 device_type?: string | null;
1104 first_seen_at: string;
1105 id: string;
1106 is_trusted: boolean;
1107 last_seen_at: string;
1108 /** @nullable */
1109 os?: string | null;
1110}
1111
1112export interface DiffTreeRecordDto {
1113 /** @nullable */
1114 base_blob_id?: string | null;
1115 /**
1116 * @minimum 0
1117 * @nullable
1118 */
1119 base_mode?: number | null;
1120 /** @nullable */
1121 base_path?: string | null;
1122 /** @nullable */
1123 head_blob_id?: string | null;
1124 /**
1125 * @minimum 0
1126 * @nullable
1127 */
1128 head_mode?: number | null;
1129 /** @nullable */
1130 head_path?: string | null;
1131 /** @minimum 0 */
1132 score: number;
1133 status: string;
1134}
1135
1136export type DiffView = "shortstat" | "numstat" | "files" | "tree";
1137export type DirKind =
1138 "Dir" | "Object" | "IssueBoard" | "GitRepo" | "ChatChannel" | "VoiceChannel";
1139export interface DirNodeDto {
1140 /** @nullable */
1141 archived_at?: string | null;
1142 children: DirNodeDto[];
1143 /** @nullable */
1144 color?: string | null;
1145 created_at: string;
1146 created_by_id: number;
1147 /** @nullable */
1148 icon?: string | null;
1149 id: string;
1150 is_archived: boolean;
1151 kind: DirKind;
1152 name: string;
1153 /** @nullable */
1154 parent_dir_id?: string | null;
1155 position: number;
1156 /** @nullable */
1157 purpose?: string | null;
1158 /** @nullable */
1159 topic?: string | null;
1160 updated_at: string;
1161}
1162
1163export interface DmDto {
1164 created_at: string;
1165 id: string;
1166 kind: RoomKind;
1167 /** @nullable */
1168 last_message_id?: string | null;
1169 last_read_seq: number;
1170 members?: UserDto[];
1171 name: string;
1172 peer?: null | UserDto;
1173 tip_seq: number;
1174 unread_count: number;
1175}
1176
1177export interface DraftDto {
1178 content: string;
1179 room_id: string;
1180 /** @nullable */
1181 thread_id?: string | null;
1182 updated_at: string;
1183}
1184
1185export interface DraftQuery {
1186 /** @nullable */
1187 thread_id?: string | null;
1188}
1189
1190export interface EmbedAuthor {
1191 /** @nullable */
1192 icon_url?: string | null;
1193 name?: string;
1194 /** @nullable */
1195 proxy_icon_url?: string | null;
1196 /** @nullable */
1197 url?: string | null;
1198}
1199
1200export interface EmbedField {
1201 inline?: boolean;
1202 name?: string;
1203 value?: string;
1204}
1205
1206export interface EmbedFooter {
1207 /** @nullable */
1208 icon_url?: string | null;
1209 /** @nullable */
1210 proxy_icon_url?: string | null;
1211 text?: string;
1212}
1213
1214export interface EmbedMedia {
1215 /** @nullable */
1216 content_hash?: string | null;
1217 /** @nullable */
1218 content_type?: string | null;
1219 /** @nullable */
1220 description?: string | null;
1221 /**
1222 * @minimum 0
1223 * @nullable
1224 */
1225 duration?: number | null;
1226 /** @minimum 0 */
1227 flags?: number;
1228 /**
1229 * @minimum 0
1230 * @nullable
1231 */
1232 height?: number | null;
1233 /** @nullable */
1234 placeholder?: string | null;
1235 /** @nullable */
1236 proxy_url?: string | null;
1237 /** @nullable */
1238 url?: string | null;
1239 /**
1240 * @minimum 0
1241 * @nullable
1242 */
1243 width?: number | null;
1244}
1245
1246export interface EmbedProvider {
1247 name?: string;
1248 /** @nullable */
1249 url?: string | null;
1250}
1251
1252export interface EmojiDto {
1253 animated: boolean;
1254 created_at: string;
1255 disabled: boolean;
1256 id: string;
1257 name: string;
1258 space_id: string;
1259}
1260
1261export type EnvelopeAcceptAgreementRespData = {
1262 recorded: boolean;
1263};
1264
1265export interface EnvelopeAcceptAgreementResp {
1266 code: number;
1267 data?: EnvelopeAcceptAgreementRespData;
1268 /** @nullable */
1269 error?: string | null;
1270 /** @nullable */
1271 error_code?: string | null;
1272 message: string;
1273 request_id?: string;
1274}
1275
1276export type EnvelopeAccountDeletionDtoData = {
1277 /** @nullable */
1278 last_error?: string | null;
1279 purge_after: string;
1280 requested_at: string;
1281 status: string;
1282};
1283
1284export interface EnvelopeAccountDeletionDto {
1285 code: number;
1286 data?: EnvelopeAccountDeletionDtoData;
1287 /** @nullable */
1288 error?: string | null;
1289 /** @nullable */
1290 error_code?: string | null;
1291 message: string;
1292 request_id?: string;
1293}
1294
1295export type EnvelopeArchiveResultDtoData = {
1296 cache_key: string;
1297 /** @nullable */
1298 download_url?: string | null;
1299 format: string;
1300 size: number;
1301};
1302
1303export interface EnvelopeArchiveResultDto {
1304 code: number;
1305 data?: EnvelopeArchiveResultDtoData;
1306 /** @nullable */
1307 error?: string | null;
1308 /** @nullable */
1309 error_code?: string | null;
1310 message: string;
1311 request_id?: string;
1312}
1313
1314export type EnvelopeAttachmentDtoData = {
1315 content_type: string;
1316 created_at: string;
1317 /** @nullable */
1318 description?: string | null;
1319 /** @nullable */
1320 duration_secs?: number | null;
1321 filename: string;
1322 /** @nullable */
1323 height?: number | null;
1324 id: string;
1325 /** @nullable */
1326 message_id?: string | null;
1327 /** @nullable */
1328 room_id?: string | null;
1329 size: number;
1330 status: AttachmentStatus;
1331 user_id: number;
1332 /** @nullable */
1333 width?: number | null;
1334};
1335
1336export interface EnvelopeAttachmentDto {
1337 code: number;
1338 data?: EnvelopeAttachmentDtoData;
1339 /** @nullable */
1340 error?: string | null;
1341 /** @nullable */
1342 error_code?: string | null;
1343 message: string;
1344 request_id?: string;
1345}
1346
1347export type EnvelopeAvatarDtoData = {
1348 /**
1349 * Size of the uploaded original in bytes.
1350 * @minimum 0
1351 */
1352 bytes: number;
1353 /** Format of the uploaded original. */
1354 format: AvatarFormat;
1355 updated_at: string;
1356 /**
1357 * Browser-facing URL. Points at the compressed derivative when one exists,
1358 * and at the uploaded bytes otherwise.
1359 */
1360 url: string;
1361 user_id: number;
1362};
1363
1364export interface EnvelopeAvatarDto {
1365 code: number;
1366 data?: EnvelopeAvatarDtoData;
1367 /** @nullable */
1368 error?: string | null;
1369 /** @nullable */
1370 error_code?: string | null;
1371 message: string;
1372 request_id?: string;
1373}
1374
1375export type EnvelopeBlobContentDtoData = {
1376 /** @items.minimum 0 */
1377 data: number[];
1378 is_binary: boolean;
1379 oid: string;
1380 size: number;
1381 truncated: boolean;
1382};
1383
1384export interface EnvelopeBlobContentDto {
1385 code: number;
1386 data?: EnvelopeBlobContentDtoData;
1387 /** @nullable */
1388 error?: string | null;
1389 /** @nullable */
1390 error_code?: string | null;
1391 message: string;
1392 request_id?: string;
1393}
1394
1395export type EnvelopeBlobMetaDtoData = {
1396 is_binary: boolean;
1397 is_lfs_pointer: boolean;
1398 lfs?: null | LfsPointerDto;
1399 oid: string;
1400 size: number;
1401};
1402
1403export interface EnvelopeBlobMetaDto {
1404 code: number;
1405 data?: EnvelopeBlobMetaDtoData;
1406 /** @nullable */
1407 error?: string | null;
1408 /** @nullable */
1409 error_code?: string | null;
1410 message: string;
1411 request_id?: string;
1412}
1413
1414export type EnvelopeBoardDtoData = {
1415 closed_issues_count: number;
1416 created_at: string;
1417 /** @nullable */
1418 description?: string | null;
1419 dir_id: string;
1420 /** @nullable */
1421 icon?: string | null;
1422 id: string;
1423 name: string;
1424 open_issues_count: number;
1425 /**
1426 * Number prefix for the board's issues (`CAD` renders as `CAD-12`).
1427 * @nullable
1428 */
1429 prefix?: string | null;
1430 /** @nullable */
1431 updated_at?: string | null;
1432};
1433
1434export interface EnvelopeBoardDto {
1435 code: number;
1436 data?: EnvelopeBoardDtoData;
1437 /** @nullable */
1438 error?: string | null;
1439 /** @nullable */
1440 error_code?: string | null;
1441 message: string;
1442 request_id?: string;
1443}
1444
1445export type EnvelopeBookmarkDtoData = {
1446 created_at: string;
1447 created_by_id: number;
1448 /** @nullable */
1449 emoji?: string | null;
1450 id: string;
1451 position: number;
1452 room_id: string;
1453 title: string;
1454 /** @nullable */
1455 url?: string | null;
1456};
1457
1458export interface EnvelopeBookmarkDto {
1459 code: number;
1460 data?: EnvelopeBookmarkDtoData;
1461 /** @nullable */
1462 error?: string | null;
1463 /** @nullable */
1464 error_code?: string | null;
1465 message: string;
1466 request_id?: string;
1467}
1468
1469export type EnvelopeBranchDtoData = {
1470 commit_sha: string;
1471 created_at: string;
1472 /** @nullable */
1473 deleted_at?: string | null;
1474 is_deleted: boolean;
1475 is_protected: boolean;
1476 name: string;
1477 updated_at: string;
1478};
1479
1480export interface EnvelopeBranchDto {
1481 code: number;
1482 data?: EnvelopeBranchDtoData;
1483 /** @nullable */
1484 error?: string | null;
1485 /** @nullable */
1486 error_code?: string | null;
1487 message: string;
1488 request_id?: string;
1489}
1490
1491export type EnvelopeBranchPolicyDtoData = {
1492 block_on_change_requested_reviews: boolean;
1493 block_on_outdated_branch: boolean;
1494 block_on_rejected_reviews: boolean;
1495 branch_pattern: string;
1496 created_at: string;
1497 dismiss_stale_approvals: boolean;
1498 enable_approvals_whitelist: boolean;
1499 enable_force_push: boolean;
1500 enable_merge_whitelist: boolean;
1501 enable_push: boolean;
1502 enable_push_whitelist: boolean;
1503 id: string;
1504 protected_file_patterns: string;
1505 push_whitelist_deploy_keys: boolean;
1506 repo_id: string;
1507 require_signed_commits: boolean;
1508 required_approvals: number;
1509 required_status_contexts: string;
1510 unprotected_file_patterns: string;
1511 updated_at: string;
1512};
1513
1514export interface EnvelopeBranchPolicyDto {
1515 code: number;
1516 data?: EnvelopeBranchPolicyDtoData;
1517 /** @nullable */
1518 error?: string | null;
1519 /** @nullable */
1520 error_code?: string | null;
1521 message: string;
1522 request_id?: string;
1523}
1524
1525export type EnvelopeBranchWhitelistDtoData = {
1526 created_at: string;
1527 /** @nullable */
1528 group_id?: string | null;
1529 id: string;
1530 kind: WhitelistKind;
1531 policy_id: string;
1532 user?: null | UserDto;
1533 /** @nullable */
1534 user_id?: number | null;
1535};
1536
1537export interface EnvelopeBranchWhitelistDto {
1538 code: number;
1539 data?: EnvelopeBranchWhitelistDtoData;
1540 /** @nullable */
1541 error?: string | null;
1542 /** @nullable */
1543 error_code?: string | null;
1544 message: string;
1545 request_id?: string;
1546}
1547
1548export type EnvelopeBulkResultDtoData = {
1549 /** @minimum 0 */
1550 updated: number;
1551};
1552
1553export interface EnvelopeBulkResultDto {
1554 code: number;
1555 data?: EnvelopeBulkResultDtoData;
1556 /** @nullable */
1557 error?: string | null;
1558 /** @nullable */
1559 error_code?: string | null;
1560 message: string;
1561 request_id?: string;
1562}
1563
1564export type EnvelopeChallengeResponseData = {
1565 context: string;
1566 /** @minimum 0 */
1567 difficulty: number;
1568 /** @minimum 0 */
1569 expires_at: number;
1570 /** @minimum 0 */
1571 issued_at: number;
1572};
1573
1574export interface EnvelopeChallengeResponse {
1575 code: number;
1576 data?: EnvelopeChallengeResponseData;
1577 /** @nullable */
1578 error?: string | null;
1579 /** @nullable */
1580 error_code?: string | null;
1581 message: string;
1582 request_id?: string;
1583}
1584
1585export type EnvelopeCodeActivityDtoData = {
1586 authors: CodeActivityAuthorDto[];
1587 total_additions: number;
1588 total_commits: number;
1589 total_deletions: number;
1590};
1591
1592export interface EnvelopeCodeActivityDto {
1593 code: number;
1594 data?: EnvelopeCodeActivityDtoData;
1595 /** @nullable */
1596 error?: string | null;
1597 /** @nullable */
1598 error_code?: string | null;
1599 message: string;
1600 request_id?: string;
1601}
1602
1603export type EnvelopeCodeCommentDtoData = {
1604 author?: null | UserDto;
1605 body: string;
1606 commit_sha: string;
1607 created_at: string;
1608 id: string;
1609 line: number;
1610 /** 该评论锚定的提交是否仍是当前分支提示(否则视为 outdated)。 */
1611 outdated: boolean;
1612 /** @nullable */
1613 parent_id?: string | null;
1614 path: string;
1615 repo_id: string;
1616 resolved: boolean;
1617 /** @nullable */
1618 resolved_by?: number | null;
1619 /** @nullable */
1620 updated_at?: string | null;
1621};
1622
1623export interface EnvelopeCodeCommentDto {
1624 code: number;
1625 data?: EnvelopeCodeCommentDtoData;
1626 /** @nullable */
1627 error?: string | null;
1628 /** @nullable */
1629 error_code?: string | null;
1630 message: string;
1631 request_id?: string;
1632}
1633
1634export type EnvelopeCommentDtoData = {
1635 content: string;
1636 created_at: string;
1637 id: string;
1638 /** @nullable */
1639 issue_id?: string | null;
1640 /** @nullable */
1641 parent_id?: string | null;
1642 poster?: null | UserDto;
1643 /** @nullable */
1644 updated_at?: string | null;
1645};
1646
1647export interface EnvelopeCommentDto {
1648 code: number;
1649 data?: EnvelopeCommentDtoData;
1650 /** @nullable */
1651 error?: string | null;
1652 /** @nullable */
1653 error_code?: string | null;
1654 message: string;
1655 request_id?: string;
1656}
1657
1658export type EnvelopeCommitStatusDtoData = {
1659 context: string;
1660 created_at: string;
1661 creator?: null | UserDto;
1662 creator_id: number;
1663 /** @nullable */
1664 description?: string | null;
1665 state: CommitStatusDtoState;
1666 /** @nullable */
1667 target_url?: string | null;
1668 /** @nullable */
1669 updated_at?: string | null;
1670};
1671
1672export interface EnvelopeCommitStatusDto {
1673 code: number;
1674 data?: EnvelopeCommitStatusDtoData;
1675 /** @nullable */
1676 error?: string | null;
1677 /** @nullable */
1678 error_code?: string | null;
1679 message: string;
1680 request_id?: string;
1681}
1682
1683/**
1684 * 提交历史页:统一分页字段 + 该端点特有的 `has_more` / `diff_view_style`。
1685 */
1686export type EnvelopeCommitsPageData = {
1687 diff_view_style: string;
1688 has_more: boolean;
1689 items: CommitDto[];
1690 /** @minimum 0 */
1691 limit: number;
1692 /** @minimum 0 */
1693 offset: number;
1694 /** @minimum 0 */
1695 total: number;
1696};
1697
1698export interface EnvelopeCommitsPage {
1699 code: number;
1700 /** 提交历史页:统一分页字段 + 该端点特有的 `has_more` / `diff_view_style`。 */
1701 data?: EnvelopeCommitsPageData;
1702 /** @nullable */
1703 error?: string | null;
1704 /** @nullable */
1705 error_code?: string | null;
1706 message: string;
1707 request_id?: string;
1708}
1709
1710export type EnvelopeConflictDetailDtoData = {
1711 /** @nullable */
1712 content?: string | null;
1713 path: string;
1714};
1715
1716export interface EnvelopeConflictDetailDto {
1717 code: number;
1718 data?: EnvelopeConflictDetailDtoData;
1719 /** @nullable */
1720 error?: string | null;
1721 /** @nullable */
1722 error_code?: string | null;
1723 message: string;
1724 request_id?: string;
1725}
1726
1727export type EnvelopeCountRespData = {
1728 count: number;
1729};
1730
1731export interface EnvelopeCountResp {
1732 code: number;
1733 data?: EnvelopeCountRespData;
1734 /** @nullable */
1735 error?: string | null;
1736 /** @nullable */
1737 error_code?: string | null;
1738 message: string;
1739 request_id?: string;
1740}
1741
1742export type EnvelopeCreateInviteResponseData = {
1743 invite: InviteSummary;
1744 token: string;
1745};
1746
1747export interface EnvelopeCreateInviteResponse {
1748 code: number;
1749 data?: EnvelopeCreateInviteResponseData;
1750 /** @nullable */
1751 error?: string | null;
1752 /** @nullable */
1753 error_code?: string | null;
1754 message: string;
1755 request_id?: string;
1756}
1757
1758export type EnvelopeDependencyDtoData = {
1759 created_at: string;
1760 dependency_id: string;
1761 id: string;
1762 issue_id: string;
1763};
1764
1765export interface EnvelopeDependencyDto {
1766 code: number;
1767 data?: EnvelopeDependencyDtoData;
1768 /** @nullable */
1769 error?: string | null;
1770 /** @nullable */
1771 error_code?: string | null;
1772 message: string;
1773 request_id?: string;
1774}
1775
1776export type EnvelopeDirNodeDtoData = {
1777 /** @nullable */
1778 archived_at?: string | null;
1779 children: DirNodeDto[];
1780 /** @nullable */
1781 color?: string | null;
1782 created_at: string;
1783 created_by_id: number;
1784 /** @nullable */
1785 icon?: string | null;
1786 id: string;
1787 is_archived: boolean;
1788 kind: DirKind;
1789 name: string;
1790 /** @nullable */
1791 parent_dir_id?: string | null;
1792 position: number;
1793 /** @nullable */
1794 purpose?: string | null;
1795 /** @nullable */
1796 topic?: string | null;
1797 updated_at: string;
1798};
1799
1800export interface EnvelopeDirNodeDto {
1801 code: number;
1802 data?: EnvelopeDirNodeDtoData;
1803 /** @nullable */
1804 error?: string | null;
1805 /** @nullable */
1806 error_code?: string | null;
1807 message: string;
1808 request_id?: string;
1809}
1810
1811export type EnvelopeDmDtoData = {
1812 created_at: string;
1813 id: string;
1814 kind: RoomKind;
1815 /** @nullable */
1816 last_message_id?: string | null;
1817 last_read_seq: number;
1818 members?: UserDto[];
1819 name: string;
1820 peer?: null | UserDto;
1821 tip_seq: number;
1822 unread_count: number;
1823};
1824
1825export interface EnvelopeDmDto {
1826 code: number;
1827 data?: EnvelopeDmDtoData;
1828 /** @nullable */
1829 error?: string | null;
1830 /** @nullable */
1831 error_code?: string | null;
1832 message: string;
1833 request_id?: string;
1834}
1835
1836export type EnvelopeDraftDtoData = {
1837 content: string;
1838 room_id: string;
1839 /** @nullable */
1840 thread_id?: string | null;
1841 updated_at: string;
1842};
1843
1844export interface EnvelopeDraftDto {
1845 code: number;
1846 data?: EnvelopeDraftDtoData;
1847 /** @nullable */
1848 error?: string | null;
1849 /** @nullable */
1850 error_code?: string | null;
1851 message: string;
1852 request_id?: string;
1853}
1854
1855export type EnvelopeEmojiDtoData = {
1856 animated: boolean;
1857 created_at: string;
1858 disabled: boolean;
1859 id: string;
1860 name: string;
1861 space_id: string;
1862};
1863
1864export interface EnvelopeEmojiDto {
1865 code: number;
1866 data?: EnvelopeEmojiDtoData;
1867 /** @nullable */
1868 error?: string | null;
1869 /** @nullable */
1870 error_code?: string | null;
1871 message: string;
1872 request_id?: string;
1873}
1874
1875export type EnvelopeFetchResultDtoData = {
1876 new: string[];
1877 updated: string[];
1878};
1879
1880export interface EnvelopeFetchResultDto {
1881 code: number;
1882 data?: EnvelopeFetchResultDtoData;
1883 /** @nullable */
1884 error?: string | null;
1885 /** @nullable */
1886 error_code?: string | null;
1887 message: string;
1888 request_id?: string;
1889}
1890
1891export type EnvelopeGroupDtoData = {
1892 color: string;
1893 created_at: string;
1894 created_by?: null | UserDto;
1895 /** @nullable */
1896 icon_hash?: string | null;
1897 id: string;
1898 name: string;
1899 permissions: string[];
1900 position: number;
1901 space_id: string;
1902 /** @nullable */
1903 unicode_emoji?: string | null;
1904 /** @nullable */
1905 updated_at?: string | null;
1906 version: number;
1907};
1908
1909export interface EnvelopeGroupDto {
1910 code: number;
1911 data?: EnvelopeGroupDtoData;
1912 /** @nullable */
1913 error?: string | null;
1914 /** @nullable */
1915 error_code?: string | null;
1916 message: string;
1917 request_id?: string;
1918}
1919
1920export type EnvelopeGroupOverwriteDtoData = {
1921 allow_mask: number;
1922 deny_mask: number;
1923 dir_id: string;
1924 group_id: string;
1925};
1926
1927export interface EnvelopeGroupOverwriteDto {
1928 code: number;
1929 data?: EnvelopeGroupOverwriteDtoData;
1930 /** @nullable */
1931 error?: string | null;
1932 /** @nullable */
1933 error_code?: string | null;
1934 message: string;
1935 request_id?: string;
1936}
1937
1938/**
1939 * 举手状态。审批通过后 approved,被收回后 revoked(可再次举手)。
1940 */
1941export type HandState = "pending" | "approved" | "denied" | "revoked";
1942export type EnvelopeHandDtoData = {
1943 /** @nullable */
1944 avatar_url?: string | null;
1945 display_name: string;
1946 requested_at: number;
1947 state: HandState;
1948 user_id: number;
1949};
1950
1951export interface EnvelopeHandDto {
1952 code: number;
1953 data?: EnvelopeHandDtoData;
1954 /** @nullable */
1955 error?: string | null;
1956 /** @nullable */
1957 error_code?: string | null;
1958 message: string;
1959 request_id?: string;
1960}
1961
1962export type EnvelopeImportResultDtoData = {
1963 commit_count: number;
1964 default_branch: string;
1965};
1966
1967export interface EnvelopeImportResultDto {
1968 code: number;
1969 data?: EnvelopeImportResultDtoData;
1970 /** @nullable */
1971 error?: string | null;
1972 /** @nullable */
1973 error_code?: string | null;
1974 message: string;
1975 request_id?: string;
1976}
1977
1978export type EnvelopeIsAncestorResponseData = {
1979 is_ancestor: boolean;
1980};
1981
1982export interface EnvelopeIsAncestorResponse {
1983 code: number;
1984 data?: EnvelopeIsAncestorResponseData;
1985 /** @nullable */
1986 error?: string | null;
1987 /** @nullable */
1988 error_code?: string | null;
1989 message: string;
1990 request_id?: string;
1991}
1992
1993/**
1994 * Upload lifecycle: a row is created before the bytes exist (`Pending`) and
1995 * only an `Uploaded` row may be referenced by an issue.
1996 */
1997export type IssueAttachmentStatus = "pending" | "uploaded";
1998export type EnvelopeIssueAttachmentDtoData = {
1999 content_type: string;
2000 created_at: string;
2001 filename: string;
2002 id: string;
2003 /**
2004 * `None` until the draft is submitted with this attachment attached.
2005 * @nullable
2006 */
2007 issue_id?: string | null;
2008 size: number;
2009 status: IssueAttachmentStatus;
2010 uploader_id: number;
2011};
2012
2013export interface EnvelopeIssueAttachmentDto {
2014 code: number;
2015 data?: EnvelopeIssueAttachmentDtoData;
2016 /** @nullable */
2017 error?: string | null;
2018 /** @nullable */
2019 error_code?: string | null;
2020 message: string;
2021 request_id?: string;
2022}
2023
2024export type IssueState = "open" | "closed";
2025export type WatchMode = "unwatched" | "watching" | "ignore";
2026export type EnvelopeIssueDtoData = {
2027 assignees: UserDto[];
2028 author?: null | UserDto;
2029 board_id: string;
2030 /** @nullable */
2031 closed_at?: string | null;
2032 content: string;
2033 created_at: string;
2034 /** @nullable */
2035 description?: string | null;
2036 /** @nullable */
2037 due_at?: string | null;
2038 id: string;
2039 /** @nullable */
2040 milestone_id?: string | null;
2041 number: number;
2042 priority: IssuePriority;
2043 state: IssueState;
2044 title: string;
2045 /** @nullable */
2046 updated_at?: string | null;
2047 viewer_watch?: null | WatchMode;
2048};
2049
2050export interface EnvelopeIssueDto {
2051 code: number;
2052 data?: EnvelopeIssueDtoData;
2053 /** @nullable */
2054 error?: string | null;
2055 /** @nullable */
2056 error_code?: string | null;
2057 message: string;
2058 request_id?: string;
2059}
2060
2061export type EnvelopeIssueMemberDtoData = {
2062 created_at: string;
2063 id: string;
2064 issue_id: string;
2065 kind: IssueMemberKind;
2066 /** @nullable */
2067 updated_at?: string | null;
2068 user?: null | UserDto;
2069};
2070
2071export interface EnvelopeIssueMemberDto {
2072 code: number;
2073 data?: EnvelopeIssueMemberDtoData;
2074 /** @nullable */
2075 error?: string | null;
2076 /** @nullable */
2077 error_code?: string | null;
2078 message: string;
2079 request_id?: string;
2080}
2081
2082export type EnvelopeIssueUploadIntentDtoData = {
2083 /** @minimum 0 */
2084 expires_secs: number;
2085 id: string;
2086 upload_url: string;
2087};
2088
2089export interface EnvelopeIssueUploadIntentDto {
2090 code: number;
2091 data?: EnvelopeIssueUploadIntentDtoData;
2092 /** @nullable */
2093 error?: string | null;
2094 /** @nullable */
2095 error_code?: string | null;
2096 message: string;
2097 request_id?: string;
2098}
2099
2100export type EnvelopeIssueUserDtoData = {
2101 created_at: string;
2102 id: string;
2103 is_read: boolean;
2104 issue_id: string;
2105 user?: null | UserDto;
2106 user_id: number;
2107};
2108
2109export interface EnvelopeIssueUserDto {
2110 code: number;
2111 data?: EnvelopeIssueUserDtoData;
2112 /** @nullable */
2113 error?: string | null;
2114 /** @nullable */
2115 error_code?: string | null;
2116 message: string;
2117 request_id?: string;
2118}
2119
2120export type SpaceJoinRequestState =
2121 "pending" | "approved" | "rejected" | "withdrawn";
2122export type EnvelopeJoinRequestDtoData = {
2123 created_at: string;
2124 /** @nullable */
2125 decided_at?: string | null;
2126 decided_by?: null | UserDto;
2127 id: string;
2128 /** @nullable */
2129 note?: string | null;
2130 space_id: string;
2131 status: SpaceJoinRequestState;
2132 updated_at: string;
2133 user?: null | UserDto;
2134};
2135
2136export interface EnvelopeJoinRequestDto {
2137 code: number;
2138 data?: EnvelopeJoinRequestDtoData;
2139 /** @nullable */
2140 error?: string | null;
2141 /** @nullable */
2142 error_code?: string | null;
2143 message: string;
2144 request_id?: string;
2145}
2146
2147export type EnvelopeJoinRuleDtoData = {
2148 created_at: string;
2149 enabled: boolean;
2150 id: string;
2151 matcher: string;
2152 role_id: string;
2153 trigger: SpaceJoinTrigger;
2154 updated_at: string;
2155};
2156
2157export interface EnvelopeJoinRuleDto {
2158 code: number;
2159 data?: EnvelopeJoinRuleDtoData;
2160 /** @nullable */
2161 error?: string | null;
2162 /** @nullable */
2163 error_code?: string | null;
2164 message: string;
2165 request_id?: string;
2166}
2167
2168export type EnvelopeLabelDtoData = {
2169 color: string;
2170 created_at: string;
2171 /** @nullable */
2172 description?: string | null;
2173 dir_id: string;
2174 exclusive: boolean;
2175 exclusive_order: number;
2176 id: string;
2177 is_archived: boolean;
2178 name: string;
2179 /** @nullable */
2180 updated_at?: string | null;
2181};
2182
2183export interface EnvelopeLabelDto {
2184 code: number;
2185 data?: EnvelopeLabelDtoData;
2186 /** @nullable */
2187 error?: string | null;
2188 /** @nullable */
2189 error_code?: string | null;
2190 message: string;
2191 request_id?: string;
2192}
2193
2194export interface LfsLockOwner {
2195 name: string;
2196}
2197
2198export type EnvelopeLfsLockData = {
2199 id: string;
2200 locked_at: string;
2201 owner: LfsLockOwner;
2202 path: string;
2203};
2204
2205export interface EnvelopeLfsLock {
2206 code: number;
2207 data?: EnvelopeLfsLockData;
2208 /** @nullable */
2209 error?: string | null;
2210 /** @nullable */
2211 error_code?: string | null;
2212 message: string;
2213 request_id?: string;
2214}
2215
2216export interface LfsLock {
2217 id: string;
2218 locked_at: string;
2219 owner: LfsLockOwner;
2220 path: string;
2221}
2222
2223export type EnvelopeLfsLockListResponseData = {
2224 locks?: LfsLock[];
2225 /** @nullable */
2226 next_cursor?: string | null;
2227};
2228
2229export interface EnvelopeLfsLockListResponse {
2230 code: number;
2231 data?: EnvelopeLfsLockListResponseData;
2232 /** @nullable */
2233 error?: string | null;
2234 /** @nullable */
2235 error_code?: string | null;
2236 message: string;
2237 request_id?: string;
2238}
2239
2240export type EnvelopeLfsVerifyLocksResponseData = {
2241 /** @nullable */
2242 next_cursor?: string | null;
2243 ours?: LfsLock[];
2244 theirs?: LfsLock[];
2245};
2246
2247export interface EnvelopeLfsVerifyLocksResponse {
2248 code: number;
2249 data?: EnvelopeLfsVerifyLocksResponseData;
2250 /** @nullable */
2251 error?: string | null;
2252 /** @nullable */
2253 error_code?: string | null;
2254 message: string;
2255 request_id?: string;
2256}
2257
2258export type EnvelopeLicenseDtoData = {
2259 body: string;
2260 created_at: string;
2261 /** @nullable */
2262 description?: string | null;
2263 display_name: string;
2264 name: string;
2265 updated_at: string;
2266 /** @nullable */
2267 url?: string | null;
2268};
2269
2270export interface EnvelopeLicenseDto {
2271 code: number;
2272 data?: EnvelopeLicenseDtoData;
2273 /** @nullable */
2274 error?: string | null;
2275 /** @nullable */
2276 error_code?: string | null;
2277 message: string;
2278 request_id?: string;
2279}
2280
2281export type EnvelopeLoginCodeResponseData = {
2282 /** @minimum 0 */
2283 expires_in_secs: number;
2284};
2285
2286export interface EnvelopeLoginCodeResponse {
2287 code: number;
2288 data?: EnvelopeLoginCodeResponseData;
2289 /** @nullable */
2290 error?: string | null;
2291 /** @nullable */
2292 error_code?: string | null;
2293 message: string;
2294 request_id?: string;
2295}
2296
2297export type EnvelopeLogoutResponseData = {
2298 /** @nullable */
2299 user_id?: number | null;
2300};
2301
2302export interface EnvelopeLogoutResponse {
2303 code: number;
2304 data?: EnvelopeLogoutResponseData;
2305 /** @nullable */
2306 error?: string | null;
2307 /** @nullable */
2308 error_code?: string | null;
2309 message: string;
2310 request_id?: string;
2311}
2312
2313export type EnvelopeMarkedCountRespData = {
2314 /** @minimum 0 */
2315 marked: number;
2316};
2317
2318export interface EnvelopeMarkedCountResp {
2319 code: number;
2320 data?: EnvelopeMarkedCountRespData;
2321 /** @nullable */
2322 error?: string | null;
2323 /** @nullable */
2324 error_code?: string | null;
2325 message: string;
2326 request_id?: string;
2327}
2328
2329export interface ProfileDto {
2330 /** @nullable */
2331 bio?: string | null;
2332 /** @nullable */
2333 company?: string | null;
2334 /** @nullable */
2335 date_of_birth?: string | null;
2336 /** @nullable */
2337 location?: string | null;
2338 /** @nullable */
2339 privacy_agreed_at?: string | null;
2340 /** @nullable */
2341 pronouns?: string | null;
2342 /** @nullable */
2343 real_name?: string | null;
2344 show_activity: boolean;
2345 show_email: boolean;
2346 show_location: boolean;
2347 show_real_name: boolean;
2348 /** @nullable */
2349 website?: string | null;
2350}
2351
2352export type ProfileVisibility =
2353 "Public" | "RegisteredOnly" | "MembersOnly" | "Private";
2354export interface UserMeDto {
2355 avatar_url: string;
2356 bot: boolean;
2357 created_at: string;
2358 display_name: string;
2359 is_active: boolean;
2360 is_restricted: boolean;
2361 /** @nullable */
2362 language?: string | null;
2363 /** @nullable */
2364 locale?: string | null;
2365 prohibit_login: boolean;
2366 system: boolean;
2367 /** @nullable */
2368 timezone?: string | null;
2369 user_id: number;
2370 username: string;
2371 visibility: ProfileVisibility;
2372}
2373
2374export type EnvelopeMeRespData = {
2375 profile?: null | ProfileDto;
2376 user: UserMeDto;
2377};
2378
2379export interface EnvelopeMeResp {
2380 code: number;
2381 data?: EnvelopeMeRespData;
2382 /** @nullable */
2383 error?: string | null;
2384 /** @nullable */
2385 error_code?: string | null;
2386 message: string;
2387 request_id?: string;
2388}
2389
2390export type EnvelopeMeResponseData = {
2391 /** @nullable */
2392 avatar_url?: string | null;
2393 created_at: string;
2394 /** @nullable */
2395 displayname?: string | null;
2396 email: string;
2397 /** @nullable */
2398 email_verified_at?: string | null;
2399 is_admin: boolean;
2400 user_id: number;
2401 username: string;
2402 version: number;
2403};
2404
2405export interface EnvelopeMeResponse {
2406 code: number;
2407 data?: EnvelopeMeResponseData;
2408 /** @nullable */
2409 error?: string | null;
2410 /** @nullable */
2411 error_code?: string | null;
2412 message: string;
2413 request_id?: string;
2414}
2415
2416/**
2417 * 会籍的通知偏好,对应旧 `space_members.message_notifications`。
2418 * 旧表用 0/1/2 存,这里用字符串存,便于跨服务读写时直接透传。
2419 */
2420export type MessageNotifications = "all" | "mentions" | "nothing";
2421/**
2422 * 会籍状态,由 `joined_at` / `left_at` / `banned_at` 推导,供 API 层展示。
2423 */
2424export type MemberStatus =
2425 "Active" | "Inactive" | "Left" | "Removed" | "Banned";
2426export type EnvelopeMemberDtoData = {
2427 /** @nullable */
2428 alias_avatar_url?: string | null;
2429 /** @nullable */
2430 alias_name?: string | null;
2431 created_at: string;
2432 hide_muted_channels: boolean;
2433 /** @nullable */
2434 invited_at?: string | null;
2435 invited_by?: null | UserDto;
2436 joined_at: string;
2437 /** @nullable */
2438 last_active_at?: string | null;
2439 /** @nullable */
2440 left_at?: string | null;
2441 message_notifications: MessageNotifications;
2442 mobile_push: boolean;
2443 /** @nullable */
2444 mute_until?: string | null;
2445 muted: boolean;
2446 space_id: string;
2447 status: MemberStatus;
2448 suppress_everyone: boolean;
2449 suppress_roles: boolean;
2450 /** @nullable */
2451 updated_at?: string | null;
2452 user?: null | UserDto;
2453};
2454
2455export interface EnvelopeMemberDto {
2456 code: number;
2457 data?: EnvelopeMemberDtoData;
2458 /** @nullable */
2459 error?: string | null;
2460 /** @nullable */
2461 error_code?: string | null;
2462 message: string;
2463 request_id?: string;
2464}
2465
2466export type EnvelopeMemberSummaryData = {
2467 /** @nullable */
2468 alias_avatar_url?: string | null;
2469 /** @nullable */
2470 alias_name?: string | null;
2471 ban_allow_agent_join: boolean;
2472 ban_allow_comment_any: boolean;
2473 ban_allow_push_repo: boolean;
2474 ban_allow_speak: boolean;
2475 /** @nullable */
2476 ban_expires_at?: string | null;
2477 /** @nullable */
2478 ban_reason?: string | null;
2479 /** @nullable */
2480 banned_at?: string | null;
2481 /** @nullable */
2482 displayname?: string | null;
2483 hide_muted_channels: boolean;
2484 id: string;
2485 /** @nullable */
2486 invited_by?: number | null;
2487 join_method: SpaceJoinMethod;
2488 joined_at: string;
2489 /** @nullable */
2490 last_active_at?: string | null;
2491 /** @nullable */
2492 left_at?: string | null;
2493 message_notifications: MessageNotifications;
2494 mobile_push: boolean;
2495 /** @nullable */
2496 mute_until?: string | null;
2497 muted: boolean;
2498 organization_id: string;
2499 permissions: string[];
2500 role: SpaceMemberRole;
2501 role_keys: string[];
2502 suppress_everyone: boolean;
2503 suppress_roles: boolean;
2504 user_id: number;
2505 username: string;
2506 version: number;
2507};
2508
2509export interface EnvelopeMemberSummary {
2510 code: number;
2511 data?: EnvelopeMemberSummaryData;
2512 /** @nullable */
2513 error?: string | null;
2514 /** @nullable */
2515 error_code?: string | null;
2516 message: string;
2517 request_id?: string;
2518}
2519
2520export type EnvelopeMemeDtoData = {
2521 content_type: string;
2522 created_at: string;
2523 /** @nullable */
2524 height?: number | null;
2525 id: string;
2526 name: string;
2527 size: number;
2528 url: string;
2529 /** @nullable */
2530 width?: number | null;
2531};
2532
2533export interface EnvelopeMemeDto {
2534 code: number;
2535 data?: EnvelopeMemeDtoData;
2536 /** @nullable */
2537 error?: string | null;
2538 /** @nullable */
2539 error_code?: string | null;
2540 message: string;
2541 request_id?: string;
2542}
2543
2544export interface PullRefDto {
2545 branch: string;
2546 label: string;
2547 /** @nullable */
2548 repo_id?: string | null;
2549 sha: string;
2550}
2551
2552export type MergeMethod = "merge" | "squash" | "rebase";
2553export type PullState = "open" | "closed" | "merged";
2554export interface PullDto {
2555 additions: number;
2556 author?: null | UserDto;
2557 auto_merge: boolean;
2558 base: PullRefDto;
2559 body: string;
2560 /** @nullable */
2561 closed_at?: string | null;
2562 /** @nullable */
2563 commits_ahead?: number | null;
2564 /** @nullable */
2565 commits_behind?: number | null;
2566 /** @nullable */
2567 conflicts?: string[] | null;
2568 created_at: string;
2569 deletions: number;
2570 files_changed: number;
2571 head: PullRefDto;
2572 id: string;
2573 is_draft: boolean;
2574 /** @nullable */
2575 issue_id?: string | null;
2576 locked: boolean;
2577 merge_method: MergeMethod;
2578 /** @nullable */
2579 mergeable?: boolean | null;
2580 /** @nullable */
2581 mergeable_state?: string | null;
2582 /** @nullable */
2583 merged_at?: string | null;
2584 /** @nullable */
2585 merged_commit_sha?: string | null;
2586 merger?: null | UserDto;
2587 number: number;
2588 repo_id: string;
2589 /** @nullable */
2590 squash_commit_sha?: string | null;
2591 state: PullState;
2592 title: string;
2593 /** @nullable */
2594 updated_at?: string | null;
2595}
2596
2597export interface MergeResultDto {
2598 base_ref: string;
2599 head_sha: string;
2600 /** `fast_forward` | `merge_commit` | `squash` | `rebase` */
2601 method: string;
2602 new_sha: string;
2603 old_sha: string;
2604 /** rebase 时重写出来的提交(按时间正序)。 */
2605 rewritten: string[];
2606}
2607
2608export interface PullSummaryDto {
2609 additions: number;
2610 base_sha: string;
2611 commits_ahead: number;
2612 commits_behind: number;
2613 conflicts: string[];
2614 deletions: number;
2615 files_changed: number;
2616 head_sha: string;
2617 /** @nullable */
2618 merge_base?: string | null;
2619 mergeable: boolean;
2620 mergeable_state: string;
2621}
2622
2623export type EnvelopeMergePullDtoData = {
2624 pull: PullDto;
2625 result: MergeResultDto;
2626 summary: PullSummaryDto;
2627};
2628
2629export interface EnvelopeMergePullDto {
2630 code: number;
2631 data?: EnvelopeMergePullDtoData;
2632 /** @nullable */
2633 error?: string | null;
2634 /** @nullable */
2635 error_code?: string | null;
2636 message: string;
2637 request_id?: string;
2638}
2639
2640export type EnvelopeMergeStatusDtoData = {
2641 conflicts: string[];
2642 fast_forwardable: boolean;
2643 mergeable: boolean;
2644};
2645
2646export interface EnvelopeMergeStatusDto {
2647 code: number;
2648 data?: EnvelopeMergeStatusDtoData;
2649 /** @nullable */
2650 error?: string | null;
2651 /** @nullable */
2652 error_code?: string | null;
2653 message: string;
2654 request_id?: string;
2655}
2656
2657/**
2658 * Discord 风格的消息 embed。
2659 *
2660 * `platform` / `kind` / `src` / `image_url` 等字段是旧消息与旧缓存的兼容外壳:
2661 * 历史 `chat_message.embeds` 里存的还是老结构,反序列化时不能丢字段;新写入
2662 * 同时填富模型和这些兼容字段,前端可以逐步迁移。
2663 */
2664export interface MessageEmbed {
2665 /** @nullable */
2666 aspect?: string | null;
2667 audio?: null | EmbedMedia;
2668 author?: null | EmbedAuthor;
2669 /** @nullable */
2670 category?: string | null;
2671 /** @nullable */
2672 children?: MessageEmbed[] | null;
2673 /**
2674 * @minimum 0
2675 * @nullable
2676 */
2677 color?: number | null;
2678 /** @nullable */
2679 description?: string | null;
2680 /** @nullable */
2681 fields?: EmbedField[] | null;
2682 footer?: null | EmbedFooter;
2683 /**
2684 * @minimum 0
2685 * @nullable
2686 */
2687 height?: number | null;
2688 /** @nullable */
2689 html?: string | null;
2690 /**
2691 * @minimum 0
2692 * @nullable
2693 */
2694 html_height?: number | null;
2695 /**
2696 * @minimum 0
2697 * @nullable
2698 */
2699 html_width?: number | null;
2700 image?: null | EmbedMedia;
2701 /** @nullable */
2702 image_url?: string | null;
2703 /** @nullable */
2704 kind?: string | null;
2705 /** @nullable */
2706 nsfw?: boolean | null;
2707 /** @nullable */
2708 platform?: string | null;
2709 /** @nullable */
2710 platform_name?: string | null;
2711 provider?: null | EmbedProvider;
2712 /** @nullable */
2713 site_name?: string | null;
2714 /** @nullable */
2715 src?: string | null;
2716 thumbnail?: null | EmbedMedia;
2717 /** @nullable */
2718 timestamp?: string | null;
2719 /** @nullable */
2720 title?: string | null;
2721 type?: string;
2722 /** @nullable */
2723 url?: string | null;
2724 video?: null | EmbedMedia;
2725}
2726
2727export interface ReactionAggDto {
2728 count: number;
2729 emoji: string;
2730 me: boolean;
2731}
2732
2733export type EnvelopeMessageDtoData = {
2734 attachments: AttachmentDto[];
2735 author?: null | UserDto;
2736 author_id: number;
2737 author_type: AuthorType;
2738 content: string;
2739 created_at: string;
2740 /** @nullable */
2741 deleted_at?: string | null;
2742 /** @nullable */
2743 edited_at?: string | null;
2744 embeds?: MessageEmbed[];
2745 /** @nullable */
2746 forwarded_from_id?: string | null;
2747 has_thread: boolean;
2748 id: string;
2749 mention_everyone: boolean;
2750 mentions: number[];
2751 message_type: ChatMessageType;
2752 pinned: boolean;
2753 /** @nullable */
2754 pinned_at?: string | null;
2755 /** @nullable */
2756 pinned_by_id?: number | null;
2757 reactions?: ReactionAggDto[];
2758 /** @nullable */
2759 reply_to_id?: string | null;
2760 room_id: string;
2761 seq: number;
2762 thread_broadcast: boolean;
2763 /** @nullable */
2764 thread_id?: string | null;
2765 /** @nullable */
2766 webhook_id?: string | null;
2767};
2768
2769export interface EnvelopeMessageDto {
2770 code: number;
2771 data?: EnvelopeMessageDtoData;
2772 /** @nullable */
2773 error?: string | null;
2774 /** @nullable */
2775 error_code?: string | null;
2776 message: string;
2777 request_id?: string;
2778}
2779
2780export interface MessageDto {
2781 attachments: AttachmentDto[];
2782 author?: null | UserDto;
2783 author_id: number;
2784 author_type: AuthorType;
2785 content: string;
2786 created_at: string;
2787 /** @nullable */
2788 deleted_at?: string | null;
2789 /** @nullable */
2790 edited_at?: string | null;
2791 embeds?: MessageEmbed[];
2792 /** @nullable */
2793 forwarded_from_id?: string | null;
2794 has_thread: boolean;
2795 id: string;
2796 mention_everyone: boolean;
2797 mentions: number[];
2798 message_type: ChatMessageType;
2799 pinned: boolean;
2800 /** @nullable */
2801 pinned_at?: string | null;
2802 /** @nullable */
2803 pinned_by_id?: number | null;
2804 reactions?: ReactionAggDto[];
2805 /** @nullable */
2806 reply_to_id?: string | null;
2807 room_id: string;
2808 seq: number;
2809 thread_broadcast: boolean;
2810 /** @nullable */
2811 thread_id?: string | null;
2812 /** @nullable */
2813 webhook_id?: string | null;
2814}
2815
2816/**
2817 * 消息页:在统一分页字段之上补回游标翻页所需的派生字段。
2818 *
2819 * `has_more`/`oldest_seq`/`newest_seq` 由本页内容推导,客户端无需自己算;
2820 * `items` 恒按 `seq` 升序,因此 `oldest_seq` 取首条、`newest_seq` 取末条。
2821 */
2822export type EnvelopeMessagePageData = {
2823 has_more: boolean;
2824 items: MessageDto[];
2825 /** @minimum 0 */
2826 limit: number;
2827 /** @nullable */
2828 newest_seq?: number | null;
2829 /** @minimum 0 */
2830 offset: number;
2831 /** @nullable */
2832 oldest_seq?: number | null;
2833 /** @minimum 0 */
2834 total: number;
2835};
2836
2837export interface EnvelopeMessagePage {
2838 code: number;
2839 /**
2840 * 消息页:在统一分页字段之上补回游标翻页所需的派生字段。
2841 *
2842 * `has_more`/`oldest_seq`/`newest_seq` 由本页内容推导,客户端无需自己算;
2843 * `items` 恒按 `seq` 升序,因此 `oldest_seq` 取首条、`newest_seq` 取末条。
2844 */
2845 data?: EnvelopeMessagePageData;
2846 /** @nullable */
2847 error?: string | null;
2848 /** @nullable */
2849 error_code?: string | null;
2850 message: string;
2851 request_id?: string;
2852}
2853
2854export type EnvelopeMilestoneDtoData = {
2855 board_id: string;
2856 closed_issues_count: number;
2857 created_at: string;
2858 /** @nullable */
2859 description?: string | null;
2860 /** @nullable */
2861 due_at?: string | null;
2862 id: string;
2863 is_closed: boolean;
2864 issues_count: number;
2865 name: string;
2866 /** @nullable */
2867 updated_at?: string | null;
2868};
2869
2870export interface EnvelopeMilestoneDto {
2871 code: number;
2872 data?: EnvelopeMilestoneDtoData;
2873 /** @nullable */
2874 error?: string | null;
2875 /** @nullable */
2876 error_code?: string | null;
2877 message: string;
2878 request_id?: string;
2879}
2880
2881export interface EnvelopeNoData {
2882 code: number;
2883 data?: unknown;
2884 /** @nullable */
2885 error?: string | null;
2886 /** @nullable */
2887 error_code?: string | null;
2888 message: string;
2889 request_id?: string;
2890}
2891
2892export type EnvelopeOptionAvatarDtoData = {
2893 /**
2894 * Size of the uploaded original in bytes.
2895 * @minimum 0
2896 */
2897 bytes: number;
2898 /** Format of the uploaded original. */
2899 format: AvatarFormat;
2900 updated_at: string;
2901 /**
2902 * Browser-facing URL. Points at the compressed derivative when one exists,
2903 * and at the uploaded bytes otherwise.
2904 */
2905 url: string;
2906 user_id: number;
2907} | null;
2908
2909export interface EnvelopeOptionAvatarDto {
2910 code: number;
2911 data?: EnvelopeOptionAvatarDtoData;
2912 /** @nullable */
2913 error?: string | null;
2914 /** @nullable */
2915 error_code?: string | null;
2916 message: string;
2917 request_id?: string;
2918}
2919
2920export type EnvelopeOptionDraftDtoData = {
2921 content: string;
2922 room_id: string;
2923 /** @nullable */
2924 thread_id?: string | null;
2925 updated_at: string;
2926} | null;
2927
2928export interface EnvelopeOptionDraftDto {
2929 code: number;
2930 data?: EnvelopeOptionDraftDtoData;
2931 /** @nullable */
2932 error?: string | null;
2933 /** @nullable */
2934 error_code?: string | null;
2935 message: string;
2936 request_id?: string;
2937}
2938
2939export type SpaceImageKind =
2940 "avatar" | "banner" | "invite_banner" | "embed_splash";
2941export type EnvelopeOptionSpaceImageDtoData = {
2942 /** @minimum 0 */
2943 bytes: number;
2944 format: AvatarFormat;
2945 /** @nullable */
2946 height?: number | null;
2947 kind: SpaceImageKind;
2948 space_id: string;
2949 updated_at: string;
2950 url: string;
2951 /** @nullable */
2952 width?: number | null;
2953} | null;
2954
2955export interface EnvelopeOptionSpaceImageDto {
2956 code: number;
2957 data?: EnvelopeOptionSpaceImageDtoData;
2958 /** @nullable */
2959 error?: string | null;
2960 /** @nullable */
2961 error_code?: string | null;
2962 message: string;
2963 request_id?: string;
2964}
2965
2966export type EnvelopeOptionStopwatchDtoData = {
2967 /** @nullable */
2968 created_at?: string | null;
2969 /** @nullable */
2970 id?: string | null;
2971 issue_id: string;
2972 running: boolean;
2973 /** @nullable */
2974 started_at?: string | null;
2975 user?: null | UserDto;
2976} | null;
2977
2978export interface EnvelopeOptionStopwatchDto {
2979 code: number;
2980 data?: EnvelopeOptionStopwatchDtoData;
2981 /** @nullable */
2982 error?: string | null;
2983 /** @nullable */
2984 error_code?: string | null;
2985 message: string;
2986 request_id?: string;
2987}
2988
2989export type SpaceStatus = "active" | "suspended" | "archived";
2990export type EnvelopeOrganizationSummaryData = {
2991 allow_invite: boolean;
2992 allow_join: boolean;
2993 allow_join_level: number;
2994 /** @nullable */
2995 archived_at?: string | null;
2996 /** @nullable */
2997 avatar_url?: string | null;
2998 created_at: string;
2999 /** @nullable */
3000 description?: string | null;
3001 id: string;
3002 join_policy: SpaceJoinPolicy;
3003 member_count: number;
3004 member_must_enable_2fa: boolean;
3005 my_role?: null | SpaceMemberRole;
3006 name: string;
3007 owner_user_id: number;
3008 require_email_verified: boolean;
3009 require_mfa: boolean;
3010 slug: string;
3011 status: SpaceStatus;
3012 updated_at: string;
3013 version: number;
3014 /** @nullable */
3015 welcome_message?: string | null;
3016};
3017
3018export interface EnvelopeOrganizationSummary {
3019 code: number;
3020 data?: EnvelopeOrganizationSummaryData;
3021 /** @nullable */
3022 error?: string | null;
3023 /** @nullable */
3024 error_code?: string | null;
3025 message: string;
3026 request_id?: string;
3027}
3028
3029export type EnvelopeOutboundWebhookDtoData = {
3030 created_at: string;
3031 disabled: boolean;
3032 id: string;
3033 /** @nullable */
3034 last_status?: string | null;
3035 /** @nullable */
3036 last_used_at?: string | null;
3037 name: string;
3038 room_id: string;
3039 url: string;
3040};
3041
3042export interface EnvelopeOutboundWebhookDto {
3043 code: number;
3044 data?: EnvelopeOutboundWebhookDtoData;
3045 /** @nullable */
3046 error?: string | null;
3047 /** @nullable */
3048 error_code?: string | null;
3049 message: string;
3050 request_id?: string;
3051}
3052
3053export type EnvelopeOutboundWebhookSecretDtoData = {
3054 created_at: string;
3055 id: string;
3056 name: string;
3057 room_id: string;
3058 secret: string;
3059 url: string;
3060};
3061
3062export interface EnvelopeOutboundWebhookSecretDto {
3063 code: number;
3064 data?: EnvelopeOutboundWebhookSecretDtoData;
3065 /** @nullable */
3066 error?: string | null;
3067 /** @nullable */
3068 error_code?: string | null;
3069 message: string;
3070 request_id?: string;
3071}
3072
3073export type EnvelopePageBoardDtoDataItemsItem = {
3074 closed_issues_count: number;
3075 created_at: string;
3076 /** @nullable */
3077 description?: string | null;
3078 dir_id: string;
3079 /** @nullable */
3080 icon?: string | null;
3081 id: string;
3082 name: string;
3083 open_issues_count: number;
3084 /**
3085 * Number prefix for the board's issues (`CAD` renders as `CAD-12`).
3086 * @nullable
3087 */
3088 prefix?: string | null;
3089 /** @nullable */
3090 updated_at?: string | null;
3091};
3092
3093export type EnvelopePageBoardDtoData = {
3094 items: EnvelopePageBoardDtoDataItemsItem[];
3095 /** @minimum 0 */
3096 limit: number;
3097 /** @minimum 0 */
3098 offset: number;
3099 /** @minimum 0 */
3100 total: number;
3101};
3102
3103export interface EnvelopePageBoardDto {
3104 code: number;
3105 data?: EnvelopePageBoardDtoData;
3106 /** @nullable */
3107 error?: string | null;
3108 /** @nullable */
3109 error_code?: string | null;
3110 message: string;
3111 request_id?: string;
3112}
3113
3114export type EnvelopePageBookmarkDtoDataItemsItem = {
3115 created_at: string;
3116 created_by_id: number;
3117 /** @nullable */
3118 emoji?: string | null;
3119 id: string;
3120 position: number;
3121 room_id: string;
3122 title: string;
3123 /** @nullable */
3124 url?: string | null;
3125};
3126
3127export type EnvelopePageBookmarkDtoData = {
3128 items: EnvelopePageBookmarkDtoDataItemsItem[];
3129 /** @minimum 0 */
3130 limit: number;
3131 /** @minimum 0 */
3132 offset: number;
3133 /** @minimum 0 */
3134 total: number;
3135};
3136
3137export interface EnvelopePageBookmarkDto {
3138 code: number;
3139 data?: EnvelopePageBookmarkDtoData;
3140 /** @nullable */
3141 error?: string | null;
3142 /** @nullable */
3143 error_code?: string | null;
3144 message: string;
3145 request_id?: string;
3146}
3147
3148export type EnvelopePageBranchDtoDataItemsItem = {
3149 commit_sha: string;
3150 created_at: string;
3151 /** @nullable */
3152 deleted_at?: string | null;
3153 is_deleted: boolean;
3154 is_protected: boolean;
3155 name: string;
3156 updated_at: string;
3157};
3158
3159export type EnvelopePageBranchDtoData = {
3160 items: EnvelopePageBranchDtoDataItemsItem[];
3161 /** @minimum 0 */
3162 limit: number;
3163 /** @minimum 0 */
3164 offset: number;
3165 /** @minimum 0 */
3166 total: number;
3167};
3168
3169export interface EnvelopePageBranchDto {
3170 code: number;
3171 data?: EnvelopePageBranchDtoData;
3172 /** @nullable */
3173 error?: string | null;
3174 /** @nullable */
3175 error_code?: string | null;
3176 message: string;
3177 request_id?: string;
3178}
3179
3180export type EnvelopePageCodeCommentDtoDataItemsItem = {
3181 author?: null | UserDto;
3182 body: string;
3183 commit_sha: string;
3184 created_at: string;
3185 id: string;
3186 line: number;
3187 /** 该评论锚定的提交是否仍是当前分支提示(否则视为 outdated)。 */
3188 outdated: boolean;
3189 /** @nullable */
3190 parent_id?: string | null;
3191 path: string;
3192 repo_id: string;
3193 resolved: boolean;
3194 /** @nullable */
3195 resolved_by?: number | null;
3196 /** @nullable */
3197 updated_at?: string | null;
3198};
3199
3200export type EnvelopePageCodeCommentDtoData = {
3201 items: EnvelopePageCodeCommentDtoDataItemsItem[];
3202 /** @minimum 0 */
3203 limit: number;
3204 /** @minimum 0 */
3205 offset: number;
3206 /** @minimum 0 */
3207 total: number;
3208};
3209
3210export interface EnvelopePageCodeCommentDto {
3211 code: number;
3212 data?: EnvelopePageCodeCommentDtoData;
3213 /** @nullable */
3214 error?: string | null;
3215 /** @nullable */
3216 error_code?: string | null;
3217 message: string;
3218 request_id?: string;
3219}
3220
3221export type EnvelopePageCommentDtoDataItemsItem = {
3222 content: string;
3223 created_at: string;
3224 id: string;
3225 /** @nullable */
3226 issue_id?: string | null;
3227 /** @nullable */
3228 parent_id?: string | null;
3229 poster?: null | UserDto;
3230 /** @nullable */
3231 updated_at?: string | null;
3232};
3233
3234export type EnvelopePageCommentDtoData = {
3235 items: EnvelopePageCommentDtoDataItemsItem[];
3236 /** @minimum 0 */
3237 limit: number;
3238 /** @minimum 0 */
3239 offset: number;
3240 /** @minimum 0 */
3241 total: number;
3242};
3243
3244export interface EnvelopePageCommentDto {
3245 code: number;
3246 data?: EnvelopePageCommentDtoData;
3247 /** @nullable */
3248 error?: string | null;
3249 /** @nullable */
3250 error_code?: string | null;
3251 message: string;
3252 request_id?: string;
3253}
3254
3255export type EnvelopePageContentHistoryDtoDataItemsItem = {
3256 /** @nullable */
3257 comment_id?: string | null;
3258 /** @nullable */
3259 content_after?: string | null;
3260 /** @nullable */
3261 content_before?: string | null;
3262 created_at: string;
3263 edited_at: string;
3264 id: string;
3265 issue_id: string;
3266 poster?: null | UserDto;
3267};
3268
3269export type EnvelopePageContentHistoryDtoData = {
3270 items: EnvelopePageContentHistoryDtoDataItemsItem[];
3271 /** @minimum 0 */
3272 limit: number;
3273 /** @minimum 0 */
3274 offset: number;
3275 /** @minimum 0 */
3276 total: number;
3277};
3278
3279export interface EnvelopePageContentHistoryDto {
3280 code: number;
3281 data?: EnvelopePageContentHistoryDtoData;
3282 /** @nullable */
3283 error?: string | null;
3284 /** @nullable */
3285 error_code?: string | null;
3286 message: string;
3287 request_id?: string;
3288}
3289
3290export type EnvelopePageDeviceDtoDataItemsItem = {
3291 /** @nullable */
3292 device_name?: string | null;
3293 /** @nullable */
3294 device_type?: string | null;
3295 first_seen_at: string;
3296 id: string;
3297 is_trusted: boolean;
3298 last_seen_at: string;
3299 /** @nullable */
3300 os?: string | null;
3301};
3302
3303export type EnvelopePageDeviceDtoData = {
3304 items: EnvelopePageDeviceDtoDataItemsItem[];
3305 /** @minimum 0 */
3306 limit: number;
3307 /** @minimum 0 */
3308 offset: number;
3309 /** @minimum 0 */
3310 total: number;
3311};
3312
3313export interface EnvelopePageDeviceDto {
3314 code: number;
3315 data?: EnvelopePageDeviceDtoData;
3316 /** @nullable */
3317 error?: string | null;
3318 /** @nullable */
3319 error_code?: string | null;
3320 message: string;
3321 request_id?: string;
3322}
3323
3324export type EnvelopePageDmDtoDataItemsItem = {
3325 created_at: string;
3326 id: string;
3327 kind: RoomKind;
3328 /** @nullable */
3329 last_message_id?: string | null;
3330 last_read_seq: number;
3331 members?: UserDto[];
3332 name: string;
3333 peer?: null | UserDto;
3334 tip_seq: number;
3335 unread_count: number;
3336};
3337
3338export type EnvelopePageDmDtoData = {
3339 items: EnvelopePageDmDtoDataItemsItem[];
3340 /** @minimum 0 */
3341 limit: number;
3342 /** @minimum 0 */
3343 offset: number;
3344 /** @minimum 0 */
3345 total: number;
3346};
3347
3348export interface EnvelopePageDmDto {
3349 code: number;
3350 data?: EnvelopePageDmDtoData;
3351 /** @nullable */
3352 error?: string | null;
3353 /** @nullable */
3354 error_code?: string | null;
3355 message: string;
3356 request_id?: string;
3357}
3358
3359export type EnvelopePageDraftDtoDataItemsItem = {
3360 content: string;
3361 room_id: string;
3362 /** @nullable */
3363 thread_id?: string | null;
3364 updated_at: string;
3365};
3366
3367export type EnvelopePageDraftDtoData = {
3368 items: EnvelopePageDraftDtoDataItemsItem[];
3369 /** @minimum 0 */
3370 limit: number;
3371 /** @minimum 0 */
3372 offset: number;
3373 /** @minimum 0 */
3374 total: number;
3375};
3376
3377export interface EnvelopePageDraftDto {
3378 code: number;
3379 data?: EnvelopePageDraftDtoData;
3380 /** @nullable */
3381 error?: string | null;
3382 /** @nullable */
3383 error_code?: string | null;
3384 message: string;
3385 request_id?: string;
3386}
3387
3388export type EnvelopePageEmojiDtoDataItemsItem = {
3389 animated: boolean;
3390 created_at: string;
3391 disabled: boolean;
3392 id: string;
3393 name: string;
3394 space_id: string;
3395};
3396
3397export type EnvelopePageEmojiDtoData = {
3398 items: EnvelopePageEmojiDtoDataItemsItem[];
3399 /** @minimum 0 */
3400 limit: number;
3401 /** @minimum 0 */
3402 offset: number;
3403 /** @minimum 0 */
3404 total: number;
3405};
3406
3407export interface EnvelopePageEmojiDto {
3408 code: number;
3409 data?: EnvelopePageEmojiDtoData;
3410 /** @nullable */
3411 error?: string | null;
3412 /** @nullable */
3413 error_code?: string | null;
3414 message: string;
3415 request_id?: string;
3416}
3417
3418export type IssueEventType =
3419 | "created"
3420 | "title_updated"
3421 | "description_updated"
3422 | "content_updated"
3423 | "milestone_updated"
3424 | "priority_updated"
3425 | "due_updated"
3426 | "closed"
3427 | "reopened"
3428 | "comment_created"
3429 | "comment_updated"
3430 | "comment_deleted"
3431 | "member_added"
3432 | "member_removed"
3433 | "label_added"
3434 | "label_removed"
3435 | "dependency_added"
3436 | "dependency_removed"
3437 | "pinned"
3438 | "unpinned"
3439 | "repo_relation_added"
3440 | "repo_relation_removed"
3441 | "pull_linked"
3442 | "pull_unlinked";
3443export type EnvelopePageEventDtoDataItemsItem = {
3444 /** @nullable */
3445 comment_id?: string | null;
3446 /** @nullable */
3447 commit_sha?: string | null;
3448 /** @nullable */
3449 content?: string | null;
3450 created_at: string;
3451 event_type: IssueEventType;
3452 id: string;
3453 /** @nullable */
3454 issue_id?: string | null;
3455 /** @nullable */
3456 new_ref?: string | null;
3457 /** @nullable */
3458 new_title?: string | null;
3459 /** @nullable */
3460 old_ref?: string | null;
3461 /** @nullable */
3462 old_title?: string | null;
3463 user?: null | UserDto;
3464};
3465
3466export type EnvelopePageEventDtoData = {
3467 items: EnvelopePageEventDtoDataItemsItem[];
3468 /** @minimum 0 */
3469 limit: number;
3470 /** @minimum 0 */
3471 offset: number;
3472 /** @minimum 0 */
3473 total: number;
3474};
3475
3476export interface EnvelopePageEventDto {
3477 code: number;
3478 data?: EnvelopePageEventDtoData;
3479 /** @nullable */
3480 error?: string | null;
3481 /** @nullable */
3482 error_code?: string | null;
3483 message: string;
3484 request_id?: string;
3485}
3486
3487export interface ExploreViewerRequestDto {
3488 /** @nullable */
3489 cooldown_until?: string | null;
3490 created_at: string;
3491 /** @nullable */
3492 decided_at?: string | null;
3493 id: string;
3494 status: SpaceJoinRequestState;
3495}
3496
3497export interface ExploreViewerDto {
3498 is_member: boolean;
3499 request?: null | ExploreViewerRequestDto;
3500}
3501
3502export type EnvelopePageExploreSpaceDtoDataItemsItem = {
3503 allow_join: boolean;
3504 allow_join_level: AllowJoinLevel;
3505 /** @nullable */
3506 avatar_url?: string | null;
3507 /** @nullable */
3508 banner_url?: string | null;
3509 created_at: string;
3510 /** @nullable */
3511 description?: string | null;
3512 id: string;
3513 lower_name: string;
3514 members_count: number;
3515 name: string;
3516 viewer?: null | ExploreViewerDto;
3517};
3518
3519export type EnvelopePageExploreSpaceDtoData = {
3520 items: EnvelopePageExploreSpaceDtoDataItemsItem[];
3521 /** @minimum 0 */
3522 limit: number;
3523 /** @minimum 0 */
3524 offset: number;
3525 /** @minimum 0 */
3526 total: number;
3527};
3528
3529export interface EnvelopePageExploreSpaceDto {
3530 code: number;
3531 data?: EnvelopePageExploreSpaceDtoData;
3532 /** @nullable */
3533 error?: string | null;
3534 /** @nullable */
3535 error_code?: string | null;
3536 message: string;
3537 request_id?: string;
3538}
3539
3540export type EnvelopePageGroupDtoDataItemsItem = {
3541 color: string;
3542 created_at: string;
3543 created_by?: null | UserDto;
3544 /** @nullable */
3545 icon_hash?: string | null;
3546 id: string;
3547 name: string;
3548 permissions: string[];
3549 position: number;
3550 space_id: string;
3551 /** @nullable */
3552 unicode_emoji?: string | null;
3553 /** @nullable */
3554 updated_at?: string | null;
3555 version: number;
3556};
3557
3558export type EnvelopePageGroupDtoData = {
3559 items: EnvelopePageGroupDtoDataItemsItem[];
3560 /** @minimum 0 */
3561 limit: number;
3562 /** @minimum 0 */
3563 offset: number;
3564 /** @minimum 0 */
3565 total: number;
3566};
3567
3568export interface EnvelopePageGroupDto {
3569 code: number;
3570 data?: EnvelopePageGroupDtoData;
3571 /** @nullable */
3572 error?: string | null;
3573 /** @nullable */
3574 error_code?: string | null;
3575 message: string;
3576 request_id?: string;
3577}
3578
3579export type EnvelopePageInviteSummaryDataItemsItem = {
3580 created_at: string;
3581 created_by: number;
3582 /** @nullable */
3583 email?: string | null;
3584 /** @nullable */
3585 expires_at?: string | null;
3586 id: string;
3587 max_uses: number;
3588 method: SpaceJoinMethod;
3589 organization_id: string;
3590 /** @nullable */
3591 revoked_at?: string | null;
3592 /** @nullable */
3593 role_id?: string | null;
3594 /** @nullable */
3595 target_user_id?: number | null;
3596 uses: number;
3597};
3598
3599export type EnvelopePageInviteSummaryData = {
3600 items: EnvelopePageInviteSummaryDataItemsItem[];
3601 /** @minimum 0 */
3602 limit: number;
3603 /** @minimum 0 */
3604 offset: number;
3605 /** @minimum 0 */
3606 total: number;
3607};
3608
3609export interface EnvelopePageInviteSummary {
3610 code: number;
3611 data?: EnvelopePageInviteSummaryData;
3612 /** @nullable */
3613 error?: string | null;
3614 /** @nullable */
3615 error_code?: string | null;
3616 message: string;
3617 request_id?: string;
3618}
3619
3620export interface LabelDto {
3621 color: string;
3622 created_at: string;
3623 /** @nullable */
3624 description?: string | null;
3625 dir_id: string;
3626 exclusive: boolean;
3627 exclusive_order: number;
3628 id: string;
3629 is_archived: boolean;
3630 name: string;
3631 /** @nullable */
3632 updated_at?: string | null;
3633}
3634
3635export type EnvelopePageIssueListItemDtoDataItemsItem = {
3636 assignees: UserDto[];
3637 author?: null | UserDto;
3638 board_id: string;
3639 /** @nullable */
3640 closed_at?: string | null;
3641 created_at: string;
3642 /** @nullable */
3643 due_at?: string | null;
3644 id: string;
3645 /** Chips the list rows render; the detail view fetches these separately. */
3646 labels: LabelDto[];
3647 /** @nullable */
3648 milestone_id?: string | null;
3649 number: number;
3650 priority: IssuePriority;
3651 state: IssueState;
3652 title: string;
3653 /** @nullable */
3654 updated_at?: string | null;
3655};
3656
3657export type EnvelopePageIssueListItemDtoData = {
3658 items: EnvelopePageIssueListItemDtoDataItemsItem[];
3659 /** @minimum 0 */
3660 limit: number;
3661 /** @minimum 0 */
3662 offset: number;
3663 /** @minimum 0 */
3664 total: number;
3665};
3666
3667export interface EnvelopePageIssueListItemDto {
3668 code: number;
3669 data?: EnvelopePageIssueListItemDtoData;
3670 /** @nullable */
3671 error?: string | null;
3672 /** @nullable */
3673 error_code?: string | null;
3674 message: string;
3675 request_id?: string;
3676}
3677
3678export type EnvelopePageIssueMemberDtoDataItemsItem = {
3679 created_at: string;
3680 id: string;
3681 issue_id: string;
3682 kind: IssueMemberKind;
3683 /** @nullable */
3684 updated_at?: string | null;
3685 user?: null | UserDto;
3686};
3687
3688export type EnvelopePageIssueMemberDtoData = {
3689 items: EnvelopePageIssueMemberDtoDataItemsItem[];
3690 /** @minimum 0 */
3691 limit: number;
3692 /** @minimum 0 */
3693 offset: number;
3694 /** @minimum 0 */
3695 total: number;
3696};
3697
3698export interface EnvelopePageIssueMemberDto {
3699 code: number;
3700 data?: EnvelopePageIssueMemberDtoData;
3701 /** @nullable */
3702 error?: string | null;
3703 /** @nullable */
3704 error_code?: string | null;
3705 message: string;
3706 request_id?: string;
3707}
3708
3709export type EnvelopePageIssueUserDtoDataItemsItem = {
3710 created_at: string;
3711 id: string;
3712 is_read: boolean;
3713 issue_id: string;
3714 user?: null | UserDto;
3715 user_id: number;
3716};
3717
3718export type EnvelopePageIssueUserDtoData = {
3719 items: EnvelopePageIssueUserDtoDataItemsItem[];
3720 /** @minimum 0 */
3721 limit: number;
3722 /** @minimum 0 */
3723 offset: number;
3724 /** @minimum 0 */
3725 total: number;
3726};
3727
3728export interface EnvelopePageIssueUserDto {
3729 code: number;
3730 data?: EnvelopePageIssueUserDtoData;
3731 /** @nullable */
3732 error?: string | null;
3733 /** @nullable */
3734 error_code?: string | null;
3735 message: string;
3736 request_id?: string;
3737}
3738
3739export type EnvelopePageJoinRequestDtoDataItemsItem = {
3740 created_at: string;
3741 /** @nullable */
3742 decided_at?: string | null;
3743 decided_by?: null | UserDto;
3744 id: string;
3745 /** @nullable */
3746 note?: string | null;
3747 space_id: string;
3748 status: SpaceJoinRequestState;
3749 updated_at: string;
3750 user?: null | UserDto;
3751};
3752
3753export type EnvelopePageJoinRequestDtoData = {
3754 items: EnvelopePageJoinRequestDtoDataItemsItem[];
3755 /** @minimum 0 */
3756 limit: number;
3757 /** @minimum 0 */
3758 offset: number;
3759 /** @minimum 0 */
3760 total: number;
3761};
3762
3763export interface EnvelopePageJoinRequestDto {
3764 code: number;
3765 data?: EnvelopePageJoinRequestDtoData;
3766 /** @nullable */
3767 error?: string | null;
3768 /** @nullable */
3769 error_code?: string | null;
3770 message: string;
3771 request_id?: string;
3772}
3773
3774export type EnvelopePageLabelDtoDataItemsItem = {
3775 color: string;
3776 created_at: string;
3777 /** @nullable */
3778 description?: string | null;
3779 dir_id: string;
3780 exclusive: boolean;
3781 exclusive_order: number;
3782 id: string;
3783 is_archived: boolean;
3784 name: string;
3785 /** @nullable */
3786 updated_at?: string | null;
3787};
3788
3789export type EnvelopePageLabelDtoData = {
3790 items: EnvelopePageLabelDtoDataItemsItem[];
3791 /** @minimum 0 */
3792 limit: number;
3793 /** @minimum 0 */
3794 offset: number;
3795 /** @minimum 0 */
3796 total: number;
3797};
3798
3799export interface EnvelopePageLabelDto {
3800 code: number;
3801 data?: EnvelopePageLabelDtoData;
3802 /** @nullable */
3803 error?: string | null;
3804 /** @nullable */
3805 error_code?: string | null;
3806 message: string;
3807 request_id?: string;
3808}
3809
3810export type EnvelopePageLicenseDtoDataItemsItem = {
3811 body: string;
3812 created_at: string;
3813 /** @nullable */
3814 description?: string | null;
3815 display_name: string;
3816 name: string;
3817 updated_at: string;
3818 /** @nullable */
3819 url?: string | null;
3820};
3821
3822export type EnvelopePageLicenseDtoData = {
3823 items: EnvelopePageLicenseDtoDataItemsItem[];
3824 /** @minimum 0 */
3825 limit: number;
3826 /** @minimum 0 */
3827 offset: number;
3828 /** @minimum 0 */
3829 total: number;
3830};
3831
3832export interface EnvelopePageLicenseDto {
3833 code: number;
3834 data?: EnvelopePageLicenseDtoData;
3835 /** @nullable */
3836 error?: string | null;
3837 /** @nullable */
3838 error_code?: string | null;
3839 message: string;
3840 request_id?: string;
3841}
3842
3843export type EnvelopePageMemberSummaryDataItemsItem = {
3844 /** @nullable */
3845 alias_avatar_url?: string | null;
3846 /** @nullable */
3847 alias_name?: string | null;
3848 ban_allow_agent_join: boolean;
3849 ban_allow_comment_any: boolean;
3850 ban_allow_push_repo: boolean;
3851 ban_allow_speak: boolean;
3852 /** @nullable */
3853 ban_expires_at?: string | null;
3854 /** @nullable */
3855 ban_reason?: string | null;
3856 /** @nullable */
3857 banned_at?: string | null;
3858 /** @nullable */
3859 displayname?: string | null;
3860 hide_muted_channels: boolean;
3861 id: string;
3862 /** @nullable */
3863 invited_by?: number | null;
3864 join_method: SpaceJoinMethod;
3865 joined_at: string;
3866 /** @nullable */
3867 last_active_at?: string | null;
3868 /** @nullable */
3869 left_at?: string | null;
3870 message_notifications: MessageNotifications;
3871 mobile_push: boolean;
3872 /** @nullable */
3873 mute_until?: string | null;
3874 muted: boolean;
3875 organization_id: string;
3876 permissions: string[];
3877 role: SpaceMemberRole;
3878 role_keys: string[];
3879 suppress_everyone: boolean;
3880 suppress_roles: boolean;
3881 user_id: number;
3882 username: string;
3883 version: number;
3884};
3885
3886export type EnvelopePageMemberSummaryData = {
3887 items: EnvelopePageMemberSummaryDataItemsItem[];
3888 /** @minimum 0 */
3889 limit: number;
3890 /** @minimum 0 */
3891 offset: number;
3892 /** @minimum 0 */
3893 total: number;
3894};
3895
3896export interface EnvelopePageMemberSummary {
3897 code: number;
3898 data?: EnvelopePageMemberSummaryData;
3899 /** @nullable */
3900 error?: string | null;
3901 /** @nullable */
3902 error_code?: string | null;
3903 message: string;
3904 request_id?: string;
3905}
3906
3907export type EnvelopePageMessageDtoDataItemsItem = {
3908 attachments: AttachmentDto[];
3909 author?: null | UserDto;
3910 author_id: number;
3911 author_type: AuthorType;
3912 content: string;
3913 created_at: string;
3914 /** @nullable */
3915 deleted_at?: string | null;
3916 /** @nullable */
3917 edited_at?: string | null;
3918 embeds?: MessageEmbed[];
3919 /** @nullable */
3920 forwarded_from_id?: string | null;
3921 has_thread: boolean;
3922 id: string;
3923 mention_everyone: boolean;
3924 mentions: number[];
3925 message_type: ChatMessageType;
3926 pinned: boolean;
3927 /** @nullable */
3928 pinned_at?: string | null;
3929 /** @nullable */
3930 pinned_by_id?: number | null;
3931 reactions?: ReactionAggDto[];
3932 /** @nullable */
3933 reply_to_id?: string | null;
3934 room_id: string;
3935 seq: number;
3936 thread_broadcast: boolean;
3937 /** @nullable */
3938 thread_id?: string | null;
3939 /** @nullable */
3940 webhook_id?: string | null;
3941};
3942
3943export type EnvelopePageMessageDtoData = {
3944 items: EnvelopePageMessageDtoDataItemsItem[];
3945 /** @minimum 0 */
3946 limit: number;
3947 /** @minimum 0 */
3948 offset: number;
3949 /** @minimum 0 */
3950 total: number;
3951};
3952
3953export interface EnvelopePageMessageDto {
3954 code: number;
3955 data?: EnvelopePageMessageDtoData;
3956 /** @nullable */
3957 error?: string | null;
3958 /** @nullable */
3959 error_code?: string | null;
3960 message: string;
3961 request_id?: string;
3962}
3963
3964export type EnvelopePageMilestoneDtoDataItemsItem = {
3965 board_id: string;
3966 closed_issues_count: number;
3967 created_at: string;
3968 /** @nullable */
3969 description?: string | null;
3970 /** @nullable */
3971 due_at?: string | null;
3972 id: string;
3973 is_closed: boolean;
3974 issues_count: number;
3975 name: string;
3976 /** @nullable */
3977 updated_at?: string | null;
3978};
3979
3980export type EnvelopePageMilestoneDtoData = {
3981 items: EnvelopePageMilestoneDtoDataItemsItem[];
3982 /** @minimum 0 */
3983 limit: number;
3984 /** @minimum 0 */
3985 offset: number;
3986 /** @minimum 0 */
3987 total: number;
3988};
3989
3990export interface EnvelopePageMilestoneDto {
3991 code: number;
3992 data?: EnvelopePageMilestoneDtoData;
3993 /** @nullable */
3994 error?: string | null;
3995 /** @nullable */
3996 error_code?: string | null;
3997 message: string;
3998 request_id?: string;
3999}
4000
4001export interface SpaceDto {
4002 allow_invite: boolean;
4003 allow_join: boolean;
4004 allow_join_level: AllowJoinLevel;
4005 /** @nullable */
4006 avatar_url?: string | null;
4007 created_at: string;
4008 /** @nullable */
4009 description?: string | null;
4010 id: string;
4011 is_active: boolean;
4012 is_private: boolean;
4013 lower_name: string;
4014 member_must_enable_2fa: boolean;
4015 members_count: number;
4016 name: string;
4017 owner?: null | UserDto;
4018 updated_at: string;
4019 /** @nullable */
4020 welcome_message?: string | null;
4021 /** @nullable */
4022 welcome_object?: string | null;
4023}
4024
4025export type EnvelopePageMySpaceDtoDataItemsItem = {
4026 permissions: string[];
4027 space: SpaceDto;
4028};
4029
4030export type EnvelopePageMySpaceDtoData = {
4031 items: EnvelopePageMySpaceDtoDataItemsItem[];
4032 /** @minimum 0 */
4033 limit: number;
4034 /** @minimum 0 */
4035 offset: number;
4036 /** @minimum 0 */
4037 total: number;
4038};
4039
4040export interface EnvelopePageMySpaceDto {
4041 code: number;
4042 data?: EnvelopePageMySpaceDtoData;
4043 /** @nullable */
4044 error?: string | null;
4045 /** @nullable */
4046 error_code?: string | null;
4047 message: string;
4048 request_id?: string;
4049}
4050
4051export interface Value {}
4052
4053export type NotificationType =
4054 "mention" | "reply" | "follow" | "invite" | "assignment" | "system";
4055export type EnvelopePageNotificationDtoDataItemsItem = {
4056 /** @nullable */
4057 actor_id?: number | null;
4058 /** @nullable */
4059 body?: string | null;
4060 created_at: string;
4061 data?: null | Value;
4062 id: string;
4063 notification_type: NotificationType;
4064 /** @nullable */
4065 read_at?: string | null;
4066 title: string;
4067};
4068
4069export type EnvelopePageNotificationDtoData = {
4070 items: EnvelopePageNotificationDtoDataItemsItem[];
4071 /** @minimum 0 */
4072 limit: number;
4073 /** @minimum 0 */
4074 offset: number;
4075 /** @minimum 0 */
4076 total: number;
4077};
4078
4079export interface EnvelopePageNotificationDto {
4080 code: number;
4081 data?: EnvelopePageNotificationDtoData;
4082 /** @nullable */
4083 error?: string | null;
4084 /** @nullable */
4085 error_code?: string | null;
4086 message: string;
4087 request_id?: string;
4088}
4089
4090export type EnvelopePageOrganizationSummaryDataItemsItem = {
4091 allow_invite: boolean;
4092 allow_join: boolean;
4093 allow_join_level: number;
4094 /** @nullable */
4095 archived_at?: string | null;
4096 /** @nullable */
4097 avatar_url?: string | null;
4098 created_at: string;
4099 /** @nullable */
4100 description?: string | null;
4101 id: string;
4102 join_policy: SpaceJoinPolicy;
4103 member_count: number;
4104 member_must_enable_2fa: boolean;
4105 my_role?: null | SpaceMemberRole;
4106 name: string;
4107 owner_user_id: number;
4108 require_email_verified: boolean;
4109 require_mfa: boolean;
4110 slug: string;
4111 status: SpaceStatus;
4112 updated_at: string;
4113 version: number;
4114 /** @nullable */
4115 welcome_message?: string | null;
4116};
4117
4118export type EnvelopePageOrganizationSummaryData = {
4119 items: EnvelopePageOrganizationSummaryDataItemsItem[];
4120 /** @minimum 0 */
4121 limit: number;
4122 /** @minimum 0 */
4123 offset: number;
4124 /** @minimum 0 */
4125 total: number;
4126};
4127
4128export interface EnvelopePageOrganizationSummary {
4129 code: number;
4130 data?: EnvelopePageOrganizationSummaryData;
4131 /** @nullable */
4132 error?: string | null;
4133 /** @nullable */
4134 error_code?: string | null;
4135 message: string;
4136 request_id?: string;
4137}
4138
4139export type EnvelopePagePullCommentDtoDataItemsItem = {
4140 author?: null | UserDto;
4141 body: string;
4142 /** @nullable */
4143 commit_sha?: string | null;
4144 created_at: string;
4145 id: string;
4146 /** @nullable */
4147 line?: number | null;
4148 /** @nullable */
4149 parent_comment_id?: string | null;
4150 /** @nullable */
4151 path?: string | null;
4152 pull_request_id: string;
4153 resolved: boolean;
4154 /** @nullable */
4155 resolved_by?: number | null;
4156 /** @nullable */
4157 review_id?: string | null;
4158 /** @nullable */
4159 side?: string | null;
4160 /** @nullable */
4161 updated_at?: string | null;
4162};
4163
4164export type EnvelopePagePullCommentDtoData = {
4165 items: EnvelopePagePullCommentDtoDataItemsItem[];
4166 /** @minimum 0 */
4167 limit: number;
4168 /** @minimum 0 */
4169 offset: number;
4170 /** @minimum 0 */
4171 total: number;
4172};
4173
4174export interface EnvelopePagePullCommentDto {
4175 code: number;
4176 data?: EnvelopePagePullCommentDtoData;
4177 /** @nullable */
4178 error?: string | null;
4179 /** @nullable */
4180 error_code?: string | null;
4181 message: string;
4182 request_id?: string;
4183}
4184
4185export type EnvelopePagePullDtoDataItemsItem = {
4186 additions: number;
4187 author?: null | UserDto;
4188 auto_merge: boolean;
4189 base: PullRefDto;
4190 body: string;
4191 /** @nullable */
4192 closed_at?: string | null;
4193 /** @nullable */
4194 commits_ahead?: number | null;
4195 /** @nullable */
4196 commits_behind?: number | null;
4197 /** @nullable */
4198 conflicts?: string[] | null;
4199 created_at: string;
4200 deletions: number;
4201 files_changed: number;
4202 head: PullRefDto;
4203 id: string;
4204 is_draft: boolean;
4205 /** @nullable */
4206 issue_id?: string | null;
4207 locked: boolean;
4208 merge_method: MergeMethod;
4209 /** @nullable */
4210 mergeable?: boolean | null;
4211 /** @nullable */
4212 mergeable_state?: string | null;
4213 /** @nullable */
4214 merged_at?: string | null;
4215 /** @nullable */
4216 merged_commit_sha?: string | null;
4217 merger?: null | UserDto;
4218 number: number;
4219 repo_id: string;
4220 /** @nullable */
4221 squash_commit_sha?: string | null;
4222 state: PullState;
4223 title: string;
4224 /** @nullable */
4225 updated_at?: string | null;
4226};
4227
4228export type EnvelopePagePullDtoData = {
4229 items: EnvelopePagePullDtoDataItemsItem[];
4230 /** @minimum 0 */
4231 limit: number;
4232 /** @minimum 0 */
4233 offset: number;
4234 /** @minimum 0 */
4235 total: number;
4236};
4237
4238export interface EnvelopePagePullDto {
4239 code: number;
4240 data?: EnvelopePagePullDtoData;
4241 /** @nullable */
4242 error?: string | null;
4243 /** @nullable */
4244 error_code?: string | null;
4245 message: string;
4246 request_id?: string;
4247}
4248
4249export type EnvelopePagePullEventDtoDataItemsItem = {
4250 actor?: null | UserDto;
4251 /** @nullable */
4252 commit_sha?: string | null;
4253 /** @nullable */
4254 content?: string | null;
4255 created_at: string;
4256 event_type: string;
4257 id: string;
4258 pull_request_id: string;
4259};
4260
4261export type EnvelopePagePullEventDtoData = {
4262 items: EnvelopePagePullEventDtoDataItemsItem[];
4263 /** @minimum 0 */
4264 limit: number;
4265 /** @minimum 0 */
4266 offset: number;
4267 /** @minimum 0 */
4268 total: number;
4269};
4270
4271export interface EnvelopePagePullEventDto {
4272 code: number;
4273 data?: EnvelopePagePullEventDtoData;
4274 /** @nullable */
4275 error?: string | null;
4276 /** @nullable */
4277 error_code?: string | null;
4278 message: string;
4279 request_id?: string;
4280}
4281
4282export type PushSubscriptionPlatform = "WebPush" | "AndroidFcm" | "IosApns";
4283export type EnvelopePagePushSubscriptionDtoDataItemsItem = {
4284 created_at: string;
4285 endpoint: string;
4286 id: string;
4287 platform: PushSubscriptionPlatform;
4288 /** @nullable */
4289 updated_at?: string | null;
4290 /** @nullable */
4291 user_agent?: string | null;
4292};
4293
4294export type EnvelopePagePushSubscriptionDtoData = {
4295 items: EnvelopePagePushSubscriptionDtoDataItemsItem[];
4296 /** @minimum 0 */
4297 limit: number;
4298 /** @minimum 0 */
4299 offset: number;
4300 /** @minimum 0 */
4301 total: number;
4302};
4303
4304export interface EnvelopePagePushSubscriptionDto {
4305 code: number;
4306 data?: EnvelopePagePushSubscriptionDtoData;
4307 /** @nullable */
4308 error?: string | null;
4309 /** @nullable */
4310 error_code?: string | null;
4311 message: string;
4312 request_id?: string;
4313}
4314
4315export type EnvelopePageReleaseDtoDataItemsItem = {
4316 /** @nullable */
4317 content?: string | null;
4318 created_at: string;
4319 id: string;
4320 is_draft: boolean;
4321 is_prerelease: boolean;
4322 num_commits: number;
4323 publisher?: null | UserDto;
4324 publisher_name: string;
4325 repo_id: string;
4326 sha: string;
4327 tag_name: string;
4328 target: string;
4329 title: string;
4330 updated_at: string;
4331};
4332
4333export type EnvelopePageReleaseDtoData = {
4334 items: EnvelopePageReleaseDtoDataItemsItem[];
4335 /** @minimum 0 */
4336 limit: number;
4337 /** @minimum 0 */
4338 offset: number;
4339 /** @minimum 0 */
4340 total: number;
4341};
4342
4343export interface EnvelopePageReleaseDto {
4344 code: number;
4345 data?: EnvelopePageReleaseDtoData;
4346 /** @nullable */
4347 error?: string | null;
4348 /** @nullable */
4349 error_code?: string | null;
4350 message: string;
4351 request_id?: string;
4352}
4353
4354export type EnvelopePageRepoSummaryDtoDataItemsItem = {
4355 /** @nullable */
4356 avatar_url?: string | null;
4357 default_branch: string;
4358 /** @nullable */
4359 description?: string | null;
4360 id: string;
4361 is_archived: boolean;
4362 is_private: boolean;
4363 /** @nullable */
4364 license_name?: string | null;
4365 name: string;
4366 /** @nullable */
4367 primary_language?: string | null;
4368 size: number;
4369 stars_count: number;
4370 updated_at: string;
4371 watchers_count: number;
4372};
4373
4374export type EnvelopePageRepoSummaryDtoData = {
4375 items: EnvelopePageRepoSummaryDtoDataItemsItem[];
4376 /** @minimum 0 */
4377 limit: number;
4378 /** @minimum 0 */
4379 offset: number;
4380 /** @minimum 0 */
4381 total: number;
4382};
4383
4384export interface EnvelopePageRepoSummaryDto {
4385 code: number;
4386 data?: EnvelopePageRepoSummaryDtoData;
4387 /** @nullable */
4388 error?: string | null;
4389 /** @nullable */
4390 error_code?: string | null;
4391 message: string;
4392 request_id?: string;
4393}
4394
4395export type EnvelopePageSavedMessageDtoDataItemsItem = {
4396 channel_id: string;
4397 id: string;
4398 message_id: string;
4399 saved_at: string;
4400};
4401
4402export type EnvelopePageSavedMessageDtoData = {
4403 items: EnvelopePageSavedMessageDtoDataItemsItem[];
4404 /** @minimum 0 */
4405 limit: number;
4406 /** @minimum 0 */
4407 offset: number;
4408 /** @minimum 0 */
4409 total: number;
4410};
4411
4412export interface EnvelopePageSavedMessageDto {
4413 code: number;
4414 data?: EnvelopePageSavedMessageDtoData;
4415 /** @nullable */
4416 error?: string | null;
4417 /** @nullable */
4418 error_code?: string | null;
4419 message: string;
4420 request_id?: string;
4421}
4422
4423export type SessionKind = "WebLogin" | "BearerAccess";
4424export type EnvelopePageSessionDtoDataItemsItem = {
4425 /** @nullable */
4426 client_ip_hash?: string | null;
4427 created_at: string;
4428 /** @nullable */
4429 device_id?: string | null;
4430 expires_at: string;
4431 id: string;
4432 is_current: boolean;
4433 is_revoked: boolean;
4434 kind: SessionKind;
4435 last_seen_at: string;
4436 /** @nullable */
4437 revoked_at?: string | null;
4438 /** @nullable */
4439 user_agent_hash?: string | null;
4440};
4441
4442export type EnvelopePageSessionDtoData = {
4443 items: EnvelopePageSessionDtoDataItemsItem[];
4444 /** @minimum 0 */
4445 limit: number;
4446 /** @minimum 0 */
4447 offset: number;
4448 /** @minimum 0 */
4449 total: number;
4450};
4451
4452export interface EnvelopePageSessionDto {
4453 code: number;
4454 data?: EnvelopePageSessionDtoData;
4455 /** @nullable */
4456 error?: string | null;
4457 /** @nullable */
4458 error_code?: string | null;
4459 message: string;
4460 request_id?: string;
4461}
4462
4463export type SshKeyAlgorithm = "rsa" | "ed25519" | "ecdsa";
4464export type EnvelopePageSshKeySummaryDataItemsItem = {
4465 algorithm: SshKeyAlgorithm;
4466 created_at: string;
4467 /** @nullable */
4468 description?: string | null;
4469 /** @nullable */
4470 expires_at?: string | null;
4471 fingerprint: string;
4472 id: string;
4473 /** @nullable */
4474 last_used_at?: string | null;
4384475 name: string;
4394476 public_key: string;
4477 /** @nullable */
4478 revoked_at?: string | null;
4479};
4480
4481export type EnvelopePageSshKeySummaryData = {
4482 items: EnvelopePageSshKeySummaryDataItemsItem[];
4483 /** @minimum 0 */
4484 limit: number;
4485 /** @minimum 0 */
4486 offset: number;
4487 /** @minimum 0 */
4488 total: number;
4489};
4490
4491export interface EnvelopePageSshKeySummary {
4492 code: number;
4493 data?: EnvelopePageSshKeySummaryData;
4494 /** @nullable */
4495 error?: string | null;
4496 /** @nullable */
4497 error_code?: string | null;
4498 message: string;
4499 request_id?: string;
4500}
4501
4502export type EnvelopePageStargazerDtoDataItemsItem = {
4503 avatar_url: string;
4504 display_name: string;
4505 starred_at: string;
4506 user_id: number;
4507 username: string;
4508};
4509
4510export type EnvelopePageStargazerDtoData = {
4511 items: EnvelopePageStargazerDtoDataItemsItem[];
4512 /** @minimum 0 */
4513 limit: number;
4514 /** @minimum 0 */
4515 offset: number;
4516 /** @minimum 0 */
4517 total: number;
4518};
4519
4520export interface EnvelopePageStargazerDto {
4521 code: number;
4522 data?: EnvelopePageStargazerDtoData;
4523 /** @nullable */
4524 error?: string | null;
4525 /** @nullable */
4526 error_code?: string | null;
4527 message: string;
4528 request_id?: string;
4529}
4530
4531export type TagType = "Lightweight" | "Annotated";
4532export type EnvelopePageTagDtoDataItemsItem = {
4533 /** @nullable */
4534 created_at?: string | null;
4535 /** @nullable */
4536 message?: string | null;
4537 name: string;
4538 tag_type: TagType;
4539 /** @nullable */
4540 tagger_email?: string | null;
4541 /** @nullable */
4542 tagger_name?: string | null;
4543 target_sha: string;
4544};
4545
4546export type EnvelopePageTagDtoData = {
4547 items: EnvelopePageTagDtoDataItemsItem[];
4548 /** @minimum 0 */
4549 limit: number;
4550 /** @minimum 0 */
4551 offset: number;
4552 /** @minimum 0 */
4553 total: number;
4554};
4555
4556export interface EnvelopePageTagDto {
4557 code: number;
4558 data?: EnvelopePageTagDtoData;
4559 /** @nullable */
4560 error?: string | null;
4561 /** @nullable */
4562 error_code?: string | null;
4563 message: string;
4564 request_id?: string;
4565}
4566
4567export type EnvelopePageThreadDtoDataItemsItem = {
4568 archived: boolean;
4569 created_at: string;
4570 id: string;
4571 /** @nullable */
4572 last_reply_at?: string | null;
4573 /** @nullable */
4574 last_reply_id?: string | null;
4575 locked: boolean;
4576 /** @nullable */
4577 name?: string | null;
4578 owner?: null | UserDto;
4579 owner_id: number;
4580 participant_count: number;
4581 reply_count: number;
4582 room_id: string;
4583 root_message_id: string;
4584 updated_at: string;
4585};
4586
4587export type EnvelopePageThreadDtoData = {
4588 items: EnvelopePageThreadDtoDataItemsItem[];
4589 /** @minimum 0 */
4590 limit: number;
4591 /** @minimum 0 */
4592 offset: number;
4593 /** @minimum 0 */
4594 total: number;
4595};
4596
4597export interface EnvelopePageThreadDto {
4598 code: number;
4599 data?: EnvelopePageThreadDtoData;
4600 /** @nullable */
4601 error?: string | null;
4602 /** @nullable */
4603 error_code?: string | null;
4604 message: string;
4605 request_id?: string;
4606}
4607
4608export type EnvelopePageTopicDtoDataItemsItem = {
4609 created_at: string;
4610 id: string;
4611 name: string;
4612 updated_at: string;
4613};
4614
4615export type EnvelopePageTopicDtoData = {
4616 items: EnvelopePageTopicDtoDataItemsItem[];
4617 /** @minimum 0 */
4618 limit: number;
4619 /** @minimum 0 */
4620 offset: number;
4621 /** @minimum 0 */
4622 total: number;
4623};
4624
4625export interface EnvelopePageTopicDto {
4626 code: number;
4627 data?: EnvelopePageTopicDtoData;
4628 /** @nullable */
4629 error?: string | null;
4630 /** @nullable */
4631 error_code?: string | null;
4632 message: string;
4633 request_id?: string;
4634}
4635
4636export type EnvelopePageTopicRepoDtoDataItemsItem = {
4637 is_private: boolean;
4638 repo_id: string;
4639 repo_name: string;
4640 space_name: string;
4641};
4642
4643export type EnvelopePageTopicRepoDtoData = {
4644 items: EnvelopePageTopicRepoDtoDataItemsItem[];
4645 /** @minimum 0 */
4646 limit: number;
4647 /** @minimum 0 */
4648 offset: number;
4649 /** @minimum 0 */
4650 total: number;
4651};
4652
4653export interface EnvelopePageTopicRepoDto {
4654 code: number;
4655 data?: EnvelopePageTopicRepoDtoData;
4656 /** @nullable */
4657 error?: string | null;
4658 /** @nullable */
4659 error_code?: string | null;
4660 message: string;
4661 request_id?: string;
4662}
4663
4664export type EnvelopePageTrackedTimeDtoDataItemsItem = {
4665 created_at: string;
4666 id: string;
4667 issue_id: string;
4668 seconds: number;
4669 user?: null | UserDto;
4670};
4671
4672export type EnvelopePageTrackedTimeDtoData = {
4673 items: EnvelopePageTrackedTimeDtoDataItemsItem[];
4674 /** @minimum 0 */
4675 limit: number;
4676 /** @minimum 0 */
4677 offset: number;
4678 /** @minimum 0 */
4679 total: number;
4680};
4681
4682export interface EnvelopePageTrackedTimeDto {
4683 code: number;
4684 data?: EnvelopePageTrackedTimeDtoData;
4685 /** @nullable */
4686 error?: string | null;
4687 /** @nullable */
4688 error_code?: string | null;
4689 message: string;
4690 request_id?: string;
4691}
4692
4693export type ReportStatus = "open" | "under_review" | "resolved" | "dismissed";
4694export type EnvelopePageUserReportDtoDataItemsItem = {
4695 created_at: string;
4696 /** @nullable */
4697 evidence?: string | null;
4698 id: string;
4699 reason: string;
4700 reported_id: number;
4701 /** @nullable */
4702 resolution_note?: string | null;
4703 status: ReportStatus;
4704 updated_at: string;
4705};
4706
4707export type EnvelopePageUserReportDtoData = {
4708 items: EnvelopePageUserReportDtoDataItemsItem[];
4709 /** @minimum 0 */
4710 limit: number;
4711 /** @minimum 0 */
4712 offset: number;
4713 /** @minimum 0 */
4714 total: number;
4715};
4716
4717export interface EnvelopePageUserReportDto {
4718 code: number;
4719 data?: EnvelopePageUserReportDtoData;
4720 /** @nullable */
4721 error?: string | null;
4722 /** @nullable */
4723 error_code?: string | null;
4724 message: string;
4725 request_id?: string;
4726}
4727
4728export type EnvelopePageWatcherDtoDataItemsItem = {
4729 avatar_url: string;
4730 display_name: string;
4731 mode: WatchMode;
4732 user_id: number;
4733 username: string;
4734 watching_since: string;
4735};
4736
4737export type EnvelopePageWatcherDtoData = {
4738 items: EnvelopePageWatcherDtoDataItemsItem[];
4739 /** @minimum 0 */
4740 limit: number;
4741 /** @minimum 0 */
4742 offset: number;
4743 /** @minimum 0 */
4744 total: number;
4745};
4746
4747export interface EnvelopePageWatcherDto {
4748 code: number;
4749 data?: EnvelopePageWatcherDtoData;
4750 /** @nullable */
4751 error?: string | null;
4752 /** @nullable */
4753 error_code?: string | null;
4754 message: string;
4755 request_id?: string;
4756}
4757
4758export type EnvelopePageWebhookDtoDataItemsItem = {
4759 created_at: string;
4760 disabled: boolean;
4761 id: string;
4762 /** @nullable */
4763 last_used_at?: string | null;
4764 name: string;
4765 room_id: string;
4766};
4767
4768export type EnvelopePageWebhookDtoData = {
4769 items: EnvelopePageWebhookDtoDataItemsItem[];
4770 /** @minimum 0 */
4771 limit: number;
4772 /** @minimum 0 */
4773 offset: number;
4774 /** @minimum 0 */
4775 total: number;
4776};
4777
4778export interface EnvelopePageWebhookDto {
4779 code: number;
4780 data?: EnvelopePageWebhookDtoData;
4781 /** @nullable */
4782 error?: string | null;
4783 /** @nullable */
4784 error_code?: string | null;
4785 message: string;
4786 request_id?: string;
4787}
4788
4789export type EnvelopeParsedPatchDtoData = {
4790 additions: number;
4791 deletions: number;
4792 files: string[];
4793};
4794
4795export interface EnvelopeParsedPatchDto {
4796 code: number;
4797 data?: EnvelopeParsedPatchDtoData;
4798 /** @nullable */
4799 error?: string | null;
4800 /** @nullable */
4801 error_code?: string | null;
4802 message: string;
4803 request_id?: string;
4804}
4805
4806export type EnvelopePasswordResetConfirmResponseData = {
4807 user_id: number;
4808};
4809
4810export interface EnvelopePasswordResetConfirmResponse {
4811 code: number;
4812 data?: EnvelopePasswordResetConfirmResponseData;
4813 /** @nullable */
4814 error?: string | null;
4815 /** @nullable */
4816 error_code?: string | null;
4817 message: string;
4818 request_id?: string;
4819}
4820
4821export type EnvelopePasswordResetResponseData = {
4822 /** @minimum 0 */
4823 expires_in_secs: number;
4824};
4825
4826export interface EnvelopePasswordResetResponse {
4827 code: number;
4828 data?: EnvelopePasswordResetResponseData;
4829 /** @nullable */
4830 error?: string | null;
4831 /** @nullable */
4832 error_code?: string | null;
4833 message: string;
4834 request_id?: string;
4835}
4836
4837export type EnvelopePatchDtoData = {
4838 content: string;
4839 size: number;
4840};
4841
4842export interface EnvelopePatchDto {
4843 code: number;
4844 data?: EnvelopePatchDtoData;
4845 /** @nullable */
4846 error?: string | null;
4847 /** @nullable */
4848 error_code?: string | null;
4849 message: string;
4850 request_id?: string;
4851}
4852
4853export type EnvelopePermissionCheckData = {
4854 allowed: boolean;
4855 matched_by: string;
4856 organization_version: number;
4857 reason: string;
4858};
4859
4860export interface EnvelopePermissionCheck {
4861 code: number;
4862 data?: EnvelopePermissionCheckData;
4863 /** @nullable */
4864 error?: string | null;
4865 /** @nullable */
4866 error_code?: string | null;
4867 message: string;
4868 request_id?: string;
4869}
4870
4871export type EnvelopePinDtoData = {
4872 board_id: string;
4873 created_at: string;
4874 id: string;
4875 /** @nullable */
4876 issue_id?: string | null;
4877 pin_order: number;
4878};
4879
4880export interface EnvelopePinDto {
4881 code: number;
4882 data?: EnvelopePinDtoData;
4883 /** @nullable */
4884 error?: string | null;
4885 /** @nullable */
4886 error_code?: string | null;
4887 message: string;
4888 request_id?: string;
4889}
4890
4891export type PresenceStatus = "Active" | "Away" | "Dnd" | "Offline";
4892export type EnvelopePresenceDtoData = {
4893 activities: unknown;
4894 /** @nullable */
4895 last_seen_at?: string | null;
4896 online: boolean;
4897 status: PresenceStatus;
4898 user?: null | UserDto;
4899 user_id: number;
4900};
4901
4902export interface EnvelopePresenceDto {
4903 code: number;
4904 data?: EnvelopePresenceDtoData;
4905 /** @nullable */
4906 error?: string | null;
4907 /** @nullable */
4908 error_code?: string | null;
4909 message: string;
4910 request_id?: string;
4911}
4912
4913export type EnvelopeProfileDetailDtoData = {
4914 /** @nullable */
4915 accent_color?: string | null;
4916 avatar_url: string;
4917 /** @nullable */
4918 banner_url?: string | null;
4919 /** @nullable */
4920 bio?: string | null;
4921 /** @nullable */
4922 company?: string | null;
4923 display_name: string;
4924 /** @nullable */
4925 location?: string | null;
4926 /** @nullable */
4927 pronouns?: string | null;
4928 /** @nullable */
4929 real_name?: string | null;
4930 /** @nullable */
4931 show_activity?: boolean | null;
4932 /** @nullable */
4933 show_email?: boolean | null;
4934 /** @nullable */
4935 show_location?: boolean | null;
4936 /** @nullable */
4937 show_real_name?: boolean | null;
4938 updated_at: string;
4939 user_id: number;
4940 username: string;
4941 visibility?: null | ProfileVisibility;
4942 /** @nullable */
4943 website?: string | null;
4944};
4945
4946export interface EnvelopeProfileDetailDto {
4947 code: number;
4948 data?: EnvelopeProfileDetailDtoData;
4949 /** @nullable */
4950 error?: string | null;
4951 /** @nullable */
4952 error_code?: string | null;
4953 message: string;
4954 request_id?: string;
4955}
4956
4957export type EnvelopePullChecksDtoData = {
4958 head_sha: string;
4959 statuses: CommitStatusDto[];
4960};
4961
4962export interface EnvelopePullChecksDto {
4963 code: number;
4964 data?: EnvelopePullChecksDtoData;
4965 /** @nullable */
4966 error?: string | null;
4967 /** @nullable */
4968 error_code?: string | null;
4969 message: string;
4970 request_id?: string;
4971}
4972
4973export type EnvelopePullCommentDtoData = {
4974 author?: null | UserDto;
4975 body: string;
4976 /** @nullable */
4977 commit_sha?: string | null;
4978 created_at: string;
4979 id: string;
4980 /** @nullable */
4981 line?: number | null;
4982 /** @nullable */
4983 parent_comment_id?: string | null;
4984 /** @nullable */
4985 path?: string | null;
4986 pull_request_id: string;
4987 resolved: boolean;
4988 /** @nullable */
4989 resolved_by?: number | null;
4990 /** @nullable */
4991 review_id?: string | null;
4992 /** @nullable */
4993 side?: string | null;
4994 /** @nullable */
4995 updated_at?: string | null;
4996};
4997
4998export interface EnvelopePullCommentDto {
4999 code: number;
5000 data?: EnvelopePullCommentDtoData;
5001 /** @nullable */
5002 error?: string | null;
5003 /** @nullable */
5004 error_code?: string | null;
5005 message: string;
5006 request_id?: string;
5007}
5008
5009export type EnvelopePullDtoData = {
5010 additions: number;
5011 author?: null | UserDto;
5012 auto_merge: boolean;
5013 base: PullRefDto;
5014 body: string;
5015 /** @nullable */
5016 closed_at?: string | null;
5017 /** @nullable */
5018 commits_ahead?: number | null;
5019 /** @nullable */
5020 commits_behind?: number | null;
5021 /** @nullable */
5022 conflicts?: string[] | null;
5023 created_at: string;
5024 deletions: number;
5025 files_changed: number;
5026 head: PullRefDto;
5027 id: string;
5028 is_draft: boolean;
5029 /** @nullable */
5030 issue_id?: string | null;
5031 locked: boolean;
5032 merge_method: MergeMethod;
5033 /** @nullable */
5034 mergeable?: boolean | null;
5035 /** @nullable */
5036 mergeable_state?: string | null;
5037 /** @nullable */
5038 merged_at?: string | null;
5039 /** @nullable */
5040 merged_commit_sha?: string | null;
5041 merger?: null | UserDto;
5042 number: number;
5043 repo_id: string;
5044 /** @nullable */
5045 squash_commit_sha?: string | null;
5046 state: PullState;
5047 title: string;
5048 /** @nullable */
5049 updated_at?: string | null;
5050};
5051
5052export interface EnvelopePullDto {
5053 code: number;
5054 data?: EnvelopePullDtoData;
5055 /** @nullable */
5056 error?: string | null;
5057 /** @nullable */
5058 error_code?: string | null;
5059 message: string;
5060 request_id?: string;
5061}
5062
5063export interface MergeGateDto {
5064 allowed: boolean;
5065 approvals: number;
5066 bypassed: boolean;
5067 change_requests: number;
5068 outdated: boolean;
5069 protected: boolean;
5070 reasons: string[];
5071 required_approvals: number;
5072}
5073
5074export type EnvelopePullGateDtoData = {
5075 conflicts: string[];
5076 gate: MergeGateDto;
5077 head_sha: string;
5078 mergeable: boolean;
5079 pending_review_requests: number;
5080};
5081
5082export interface EnvelopePullGateDto {
5083 code: number;
5084 data?: EnvelopePullGateDtoData;
5085 /** @nullable */
5086 error?: string | null;
5087 /** @nullable */
5088 error_code?: string | null;
5089 message: string;
5090 request_id?: string;
5091}
5092
5093export type ReviewState =
5094 "approved" | "changes_requested" | "commented" | "pending" | "dismissed";
5095export type EnvelopePullReviewDtoData = {
5096 /** @minimum 0 */
5097 comment_count: number;
5098 commit_sha: string;
5099 /** @nullable */
5100 content?: string | null;
5101 created_at: string;
5102 id: string;
5103 official: boolean;
5104 pull_request_id: string;
5105 state: ReviewState;
5106 /** @nullable */
5107 updated_at?: string | null;
5108 user?: null | UserDto;
5109};
5110
5111export interface EnvelopePullReviewDto {
5112 code: number;
5113 data?: EnvelopePullReviewDtoData;
5114 /** @nullable */
5115 error?: string | null;
5116 /** @nullable */
5117 error_code?: string | null;
5118 message: string;
5119 request_id?: string;
5120}
5121
5122export type EnvelopePullSummaryDtoData = {
5123 additions: number;
5124 base_sha: string;
5125 commits_ahead: number;
5126 commits_behind: number;
5127 conflicts: string[];
5128 deletions: number;
5129 files_changed: number;
5130 head_sha: string;
5131 /** @nullable */
5132 merge_base?: string | null;
5133 mergeable: boolean;
5134 mergeable_state: string;
5135};
5136
5137export interface EnvelopePullSummaryDto {
5138 code: number;
5139 data?: EnvelopePullSummaryDtoData;
5140 /** @nullable */
5141 error?: string | null;
5142 /** @nullable */
5143 error_code?: string | null;
5144 message: string;
5145 request_id?: string;
5146}
5147
5148/**
5149 * 前端注册 Service Worker 所需的公开参数。
5150 *
5151 * 只有公钥是公开的(它就是浏览器 `applicationServerKey` 要的东西),私钥永远
5152 * 不出现在任何响应里。`enabled=false` 时前端把整个"系统通知"开关藏起来,
5153 * 而不是让用户点了才发现服务端没开。
5154 */
5155export type EnvelopePushConfigDtoData = {
5156 enabled: boolean;
5157 public_key: string;
5158};
5159
5160export interface EnvelopePushConfigDto {
5161 code: number;
5162 /**
5163 * 前端注册 Service Worker 所需的公开参数。
5164 *
5165 * 只有公钥是公开的(它就是浏览器 `applicationServerKey` 要的东西),私钥永远
5166 * 不出现在任何响应里。`enabled=false` 时前端把整个"系统通知"开关藏起来,
5167 * 而不是让用户点了才发现服务端没开。
5168 */
5169 data?: EnvelopePushConfigDtoData;
5170 /** @nullable */
5171 error?: string | null;
5172 /** @nullable */
5173 error_code?: string | null;
5174 message: string;
5175 request_id?: string;
5176}
5177
5178export type EnvelopePushResultDtoData = {
5179 pushed: string[];
5180 rejected: string[];
5181};
5182
5183export interface EnvelopePushResultDto {
5184 code: number;
5185 data?: EnvelopePushResultDtoData;
5186 /** @nullable */
5187 error?: string | null;
5188 /** @nullable */
5189 error_code?: string | null;
5190 message: string;
5191 request_id?: string;
5192}
5193
5194export type EnvelopePushSubscriptionDtoData = {
5195 created_at: string;
5196 endpoint: string;
5197 id: string;
5198 platform: PushSubscriptionPlatform;
5199 /** @nullable */
5200 updated_at?: string | null;
5201 /** @nullable */
5202 user_agent?: string | null;
5203};
5204
5205export interface EnvelopePushSubscriptionDto {
5206 code: number;
5207 data?: EnvelopePushSubscriptionDtoData;
5208 /** @nullable */
5209 error?: string | null;
5210 /** @nullable */
5211 error_code?: string | null;
5212 message: string;
5213 request_id?: string;
5214}
5215
5216export type ReactionScope = "issue" | "comment";
5217export type EnvelopeReactionDtoData = {
5218 created_at: string;
5219 emoji: string;
5220 id: string;
5221 scope: ReactionScope;
5222 target_id: string;
5223 user?: null | UserDto;
5224};
5225
5226export interface EnvelopeReactionDto {
5227 code: number;
5228 data?: EnvelopeReactionDtoData;
5229 /** @nullable */
5230 error?: string | null;
5231 /** @nullable */
5232 error_code?: string | null;
5233 message: string;
5234 request_id?: string;
5235}
5236
5237export type EnvelopeReadStateDtoData = {
5238 /** @nullable */
5239 last_read_message_id?: string | null;
5240 last_read_seq: number;
5241 /** @nullable */
5242 last_viewed_at?: string | null;
5243 room_id: string;
5244 tip_seq: number;
5245 unread_count: number;
5246 unread_mentions: number;
5247};
5248
5249export interface EnvelopeReadStateDto {
5250 code: number;
5251 data?: EnvelopeReadStateDtoData;
5252 /** @nullable */
5253 error?: string | null;
5254 /** @nullable */
5255 error_code?: string | null;
5256 message: string;
5257 request_id?: string;
5258}
5259
5260export type EnvelopeRecoveryCodesRespData = {
5261 codes: string[];
5262 /** @minimum 0 */
5263 total: number;
5264 /** @minimum 0 */
5265 used: number;
5266};
5267
5268export interface EnvelopeRecoveryCodesResp {
5269 code: number;
5270 data?: EnvelopeRecoveryCodesRespData;
5271 /** @nullable */
5272 error?: string | null;
5273 /** @nullable */
5274 error_code?: string | null;
5275 message: string;
5276 request_id?: string;
5277}
5278
5279export type EnvelopeRedeemInviteResponseData = {
5280 joined: boolean;
5281 member_id: string;
5282 organization_id: string;
5283};
5284
5285export interface EnvelopeRedeemInviteResponse {
5286 code: number;
5287 data?: EnvelopeRedeemInviteResponseData;
5288 /** @nullable */
5289 error?: string | null;
5290 /** @nullable */
5291 error_code?: string | null;
5292 message: string;
5293 request_id?: string;
5294}
5295
5296export type EnvelopeRegisterCodeResponseData = {
5297 /** @minimum 0 */
5298 expires_in_secs: number;
5299};
5300
5301export interface EnvelopeRegisterCodeResponse {
5302 code: number;
5303 data?: EnvelopeRegisterCodeResponseData;
5304 /** @nullable */
5305 error?: string | null;
5306 /** @nullable */
5307 error_code?: string | null;
5308 message: string;
5309 request_id?: string;
5310}
5311
5312export type EnvelopeReleaseDtoData = {
5313 /** @nullable */
5314 content?: string | null;
5315 created_at: string;
5316 id: string;
5317 is_draft: boolean;
5318 is_prerelease: boolean;
5319 num_commits: number;
5320 publisher?: null | UserDto;
5321 publisher_name: string;
5322 repo_id: string;
5323 sha: string;
5324 tag_name: string;
5325 target: string;
5326 title: string;
5327 updated_at: string;
5328};
5329
5330export interface EnvelopeReleaseDto {
5331 code: number;
5332 data?: EnvelopeReleaseDtoData;
5333 /** @nullable */
5334 error?: string | null;
5335 /** @nullable */
5336 error_code?: string | null;
5337 message: string;
5338 request_id?: string;
5339}
5340
5341export type ReminderStatus = "Pending" | "Done" | "Cancelled" | "Delivering";
5342export type EnvelopeReminderDtoData = {
5343 created_at: string;
5344 id: string;
5345 message_id: string;
5346 /** @nullable */
5347 message_preview?: string | null;
5348 /** @nullable */
5349 note?: string | null;
5350 remind_at: string;
5351 room_id: string;
5352 status: ReminderStatus;
5353};
5354
5355export interface EnvelopeReminderDto {
5356 code: number;
5357 data?: EnvelopeReminderDtoData;
5358 /** @nullable */
5359 error?: string | null;
5360 /** @nullable */
5361 error_code?: string | null;
5362 message: string;
5363 request_id?: string;
5364}
5365
5366export type EnvelopeRepairDirRespData = {
5367 fixed: number;
5368 scanned: number;
5369};
5370
5371export interface EnvelopeRepairDirResp {
5372 code: number;
5373 data?: EnvelopeRepairDirRespData;
5374 /** @nullable */
5375 error?: string | null;
5376 /** @nullable */
5377 error_code?: string | null;
5378 message: string;
5379 request_id?: string;
5380}
5381
5382export interface RepoMeDto {
5383 starred: boolean;
5384 watch_mode?: null | WatchMode;
5385}
5386
5387export type EnvelopeRepoDtoData = {
5388 /** 是否允许在本仓库创建合并请求(关闭后页签隐藏、接口拒绝)。 */
5389 allow_pull_requests: boolean;
5390 /** @nullable */
5391 archived_at?: string | null;
5392 /** @nullable */
5393 avatar_url?: string | null;
5394 branches_count: number;
5395 commits_count: number;
5396 created_at: string;
5397 default_branch: string;
5398 /** @nullable */
5399 description?: string | null;
5400 enable_lfs: boolean;
5401 git_size: number;
5402 /** @nullable */
5403 http_clone_url?: string | null;
5404 id: string;
5405 is_archived: boolean;
5406 is_private: boolean;
5407 /** @nullable */
5408 last_pushed_at?: string | null;
5409 lfs_size: number;
5410 /** @nullable */
5411 license_name?: string | null;
5412 me?: null | RepoMeDto;
5413 name: string;
5414 object_format: string;
5415 /** @nullable */
5416 primary_language?: string | null;
5417 pulls_count: number;
5418 size: number;
5419 /** @nullable */
5420 ssh_clone_url?: string | null;
5421 stars_count: number;
5422 /** @nullable */
5423 storage_limit_size?: number | null;
5424 /** 中间页签顺序;空数组 = 默认顺序。 */
5425 tab_order: string[];
5426 tags_count: number;
5427 updated_at: string;
5428 watchers_count: number;
5429 /** @nullable */
5430 website?: string | null;
5431};
5432
5433export interface EnvelopeRepoDto {
5434 code: number;
5435 data?: EnvelopeRepoDtoData;
5436 /** @nullable */
5437 error?: string | null;
5438 /** @nullable */
5439 error_code?: string | null;
5440 message: string;
5441 request_id?: string;
5442}
5443
5444export type EnvelopeRepoRelDtoData = {
5445 created_at: string;
5446 id: string;
5447 issue_id: string;
5448 repo_id: string;
5449};
5450
5451export interface EnvelopeRepoRelDto {
5452 code: number;
5453 data?: EnvelopeRepoRelDtoData;
5454 /** @nullable */
5455 error?: string | null;
5456 /** @nullable */
5457 error_code?: string | null;
5458 message: string;
5459 request_id?: string;
5460}
5461
5462export type EnvelopeRepoStarRespData = {
5463 stars: number;
5464};
5465
5466export interface EnvelopeRepoStarResp {
5467 code: number;
5468 data?: EnvelopeRepoStarRespData;
5469 /** @nullable */
5470 error?: string | null;
5471 /** @nullable */
5472 error_code?: string | null;
5473 message: string;
5474 request_id?: string;
5475}
5476
5477export type EnvelopeRepoWatchDtoData = {
5478 created_at: string;
5479 mode: WatchMode;
5480 repo_id: string;
5481 updated_at: string;
5482 user_id: number;
5483};
5484
5485export interface EnvelopeRepoWatchDto {
5486 code: number;
5487 data?: EnvelopeRepoWatchDtoData;
5488 /** @nullable */
5489 error?: string | null;
5490 /** @nullable */
5491 error_code?: string | null;
5492 message: string;
5493 request_id?: string;
5494}
5495
5496export type EnvelopeReportDtoData = {
5497 created_at: string;
5498 /** @nullable */
5499 evidence?: string | null;
5500 id: string;
5501 reason: string;
5502 reported_id: number;
5503 status: ReportStatus;
5504};
5505
5506export interface EnvelopeReportDto {
5507 code: number;
5508 data?: EnvelopeReportDtoData;
5509 /** @nullable */
5510 error?: string | null;
5511 /** @nullable */
5512 error_code?: string | null;
5513 message: string;
5514 request_id?: string;
5515}
5516
5517export type EnvelopeRoleSummaryData = {
5518 /** @nullable */
5519 color?: string | null;
5520 created_at: string;
5521 default_role: boolean;
5522 /** @nullable */
5523 description?: string | null;
5524 /** @nullable */
5525 emoji?: string | null;
5526 /** @nullable */
5527 icon_hash?: string | null;
5528 id: string;
5529 key: string;
5530 member_count: number;
5531 name: string;
5532 organization_id: string;
5533 permissions: PermissionGrant[];
5534 position: number;
5535 rank: number;
5536 self_assignable: boolean;
5537 system: boolean;
5538 updated_at: string;
5539 version: number;
5540};
5541
5542export interface EnvelopeRoleSummary {
5543 code: number;
5544 data?: EnvelopeRoleSummaryData;
5545 /** @nullable */
5546 error?: string | null;
5547 /** @nullable */
5548 error_code?: string | null;
5549 message: string;
5550 request_id?: string;
5551}
5552
5553export type EnvelopeRoomBriefDtoData = {
5554 created_at: string;
5555 /** @nullable */
5556 dir_id?: string | null;
5557 favorite: boolean;
5558 hidden: boolean;
5559 id: string;
5560 is_private: boolean;
5561 kind: RoomKind;
5562 /** @nullable */
5563 last_message_id?: string | null;
5564 member_count: number;
5565 muted: boolean;
5566 name: string;
5567 nsfw: boolean;
5568 owner?: null | UserDto;
5569 owner_id: number;
5570 /** @nullable */
5571 parent_id?: string | null;
5572 position: number;
5573 /** @nullable */
5574 rate_limit_per_user?: number | null;
5575 /** @nullable */
5576 space_id?: string | null;
5577 /** @nullable */
5578 topic?: string | null;
5579 unread_count: number;
5580 unread_mentions: number;
5581};
5582
5583export interface EnvelopeRoomBriefDto {
5584 code: number;
5585 data?: EnvelopeRoomBriefDtoData;
5586 /** @nullable */
5587 error?: string | null;
5588 /** @nullable */
5589 error_code?: string | null;
5590 message: string;
5591 request_id?: string;
5592}
5593
5594export type EnvelopeRoomDtoData = {
5595 created_at: string;
5596 /** @nullable */
5597 dir_id?: string | null;
5598 id: string;
5599 is_active: boolean;
5600 is_private: boolean;
5601 kind: RoomKind;
5602 name: string;
5603 nsfw: boolean;
5604 owner_id: number;
5605 /** @nullable */
5606 parent_id?: string | null;
5607 position: number;
5608 /** @nullable */
5609 rate_limit_per_user?: number | null;
5610 /** @nullable */
5611 space_id?: string | null;
5612 /** @nullable */
5613 topic?: string | null;
5614 updated_at: string;
5615 /** @nullable */
5616 user_limit?: number | null;
5617};
5618
5619export interface EnvelopeRoomDto {
5620 code: number;
5621 data?: EnvelopeRoomDtoData;
5622 /** @nullable */
5623 error?: string | null;
5624 /** @nullable */
5625 error_code?: string | null;
5626 message: string;
5627 request_id?: string;
5628}
5629
5630export type RoomNotificationLevel = "Default" | "All" | "Mentions" | "Nothing";
5631export type EnvelopeRoomSettingDtoData = {
5632 favorite: boolean;
5633 hidden: boolean;
5634 /** @nullable */
5635 mute_until?: string | null;
5636 muted: boolean;
5637 notification_level: RoomNotificationLevel;
5638 room_id: string;
5639};
5640
5641export interface EnvelopeRoomSettingDto {
5642 code: number;
5643 data?: EnvelopeRoomSettingDtoData;
5644 /** @nullable */
5645 error?: string | null;
5646 /** @nullable */
5647 error_code?: string | null;
5648 message: string;
5649 request_id?: string;
5650}
5651
5652export type EnvelopeSavedMessageDtoData = {
5653 channel_id: string;
5654 id: string;
5655 message_id: string;
5656 saved_at: string;
5657};
5658
5659export interface EnvelopeSavedMessageDto {
5660 code: number;
5661 data?: EnvelopeSavedMessageDtoData;
5662 /** @nullable */
5663 error?: string | null;
5664 /** @nullable */
5665 error_code?: string | null;
5666 message: string;
5667 request_id?: string;
5668}
5669
5670export type EnvelopeScriptOutputDtoData = {
5671 exit_code: number;
5672 stderr: string;
5673 stdout: string;
5674};
5675
5676export interface EnvelopeScriptOutputDto {
5677 code: number;
5678 data?: EnvelopeScriptOutputDtoData;
5679 /** @nullable */
5680 error?: string | null;
5681 /** @nullable */
5682 error_code?: string | null;
5683 message: string;
5684 request_id?: string;
5685}
5686
5687export type EnvelopeSignatureDtoData = {
5688 email: string;
5689 name: string;
5690 when: string;
5691};
5692
5693export interface EnvelopeSignatureDto {
5694 code: number;
5695 data?: EnvelopeSignatureDtoData;
5696 /** @nullable */
5697 error?: string | null;
5698 /** @nullable */
5699 error_code?: string | null;
5700 message: string;
5701 request_id?: string;
5702}
5703
5704export type EnvelopeSpaceDtoData = {
5705 allow_invite: boolean;
5706 allow_join: boolean;
5707 allow_join_level: AllowJoinLevel;
5708 /** @nullable */
5709 avatar_url?: string | null;
5710 created_at: string;
5711 /** @nullable */
5712 description?: string | null;
5713 id: string;
5714 is_active: boolean;
5715 is_private: boolean;
5716 lower_name: string;
5717 member_must_enable_2fa: boolean;
5718 members_count: number;
5719 name: string;
5720 owner?: null | UserDto;
5721 updated_at: string;
5722 /** @nullable */
5723 welcome_message?: string | null;
5724 /** @nullable */
5725 welcome_object?: string | null;
5726};
5727
5728export interface EnvelopeSpaceDto {
5729 code: number;
5730 data?: EnvelopeSpaceDtoData;
5731 /** @nullable */
5732 error?: string | null;
5733 /** @nullable */
5734 error_code?: string | null;
5735 message: string;
5736 request_id?: string;
5737}
5738
5739export type EnvelopeSpaceImageDtoData = {
5740 /** @minimum 0 */
5741 bytes: number;
5742 format: AvatarFormat;
5743 /** @nullable */
5744 height?: number | null;
5745 kind: SpaceImageKind;
5746 space_id: string;
5747 updated_at: string;
5748 url: string;
5749 /** @nullable */
5750 width?: number | null;
5751};
5752
5753export interface EnvelopeSpaceImageDto {
5754 code: number;
5755 data?: EnvelopeSpaceImageDtoData;
5756 /** @nullable */
5757 error?: string | null;
5758 /** @nullable */
5759 error_code?: string | null;
5760 message: string;
5761 request_id?: string;
5762}
5763
5764export interface ReadStateDto {
5765 /** @nullable */
5766 last_read_message_id?: string | null;
5767 last_read_seq: number;
5768 /** @nullable */
5769 last_viewed_at?: string | null;
5770 room_id: string;
5771 tip_seq: number;
5772 unread_count: number;
5773 unread_mentions: number;
5774}
5775
5776export type EnvelopeSpaceReadStatesData = {
5777 items: ReadStateDto[];
5778};
5779
5780export interface EnvelopeSpaceReadStates {
5781 code: number;
5782 data?: EnvelopeSpaceReadStatesData;
5783 /** @nullable */
5784 error?: string | null;
5785 /** @nullable */
5786 error_code?: string | null;
5787 message: string;
5788 request_id?: string;
4405789}
4415790
4425791export type EnvelopeSshKeySummaryData = {
@@ -467,6 +5816,5200 @@
4675816 request_id?: string;
4685817}
4695818
5819export type EnvelopeStopwatchDtoData = {
5820 /** @nullable */
5821 created_at?: string | null;
5822 /** @nullable */
5823 id?: string | null;
5824 issue_id: string;
5825 running: boolean;
5826 /** @nullable */
5827 started_at?: string | null;
5828 user?: null | UserDto;
5829};
5830
5831export interface EnvelopeStopwatchDto {
5832 code: number;
5833 data?: EnvelopeStopwatchDtoData;
5834 /** @nullable */
5835 error?: string | null;
5836 /** @nullable */
5837 error_code?: string | null;
5838 message: string;
5839 request_id?: string;
5840}
5841
5842export interface EnvelopeString {
5843 code: number;
5844 data?: string;
5845 /** @nullable */
5846 error?: string | null;
5847 /** @nullable */
5848 error_code?: string | null;
5849 message: string;
5850 request_id?: string;
5851}
5852
5853export type EnvelopeTagDtoData = {
5854 /** @nullable */
5855 created_at?: string | null;
5856 /** @nullable */
5857 message?: string | null;
5858 name: string;
5859 tag_type: TagType;
5860 /** @nullable */
5861 tagger_email?: string | null;
5862 /** @nullable */
5863 tagger_name?: string | null;
5864 target_sha: string;
5865};
5866
5867export interface EnvelopeTagDto {
5868 code: number;
5869 data?: EnvelopeTagDtoData;
5870 /** @nullable */
5871 error?: string | null;
5872 /** @nullable */
5873 error_code?: string | null;
5874 message: string;
5875 request_id?: string;
5876}
5877
5878export type EnvelopeTagPolicyDtoData = {
5879 created_at: string;
5880 id: string;
5881 name_pattern: string;
5882 repo_id: string;
5883 updated_at: string;
5884};
5885
5886export interface EnvelopeTagPolicyDto {
5887 code: number;
5888 data?: EnvelopeTagPolicyDtoData;
5889 /** @nullable */
5890 error?: string | null;
5891 /** @nullable */
5892 error_code?: string | null;
5893 message: string;
5894 request_id?: string;
5895}
5896
5897export type EnvelopeTagWhitelistDtoData = {
5898 policy_id: string;
5899 user?: null | UserDto;
5900 user_id: number;
5901};
5902
5903export interface EnvelopeTagWhitelistDto {
5904 code: number;
5905 data?: EnvelopeTagWhitelistDtoData;
5906 /** @nullable */
5907 error?: string | null;
5908 /** @nullable */
5909 error_code?: string | null;
5910 message: string;
5911 request_id?: string;
5912}
5913
5914export type EnvelopeThreadDtoData = {
5915 archived: boolean;
5916 created_at: string;
5917 id: string;
5918 /** @nullable */
5919 last_reply_at?: string | null;
5920 /** @nullable */
5921 last_reply_id?: string | null;
5922 locked: boolean;
5923 /** @nullable */
5924 name?: string | null;
5925 owner?: null | UserDto;
5926 owner_id: number;
5927 participant_count: number;
5928 reply_count: number;
5929 room_id: string;
5930 root_message_id: string;
5931 updated_at: string;
5932};
5933
5934export interface EnvelopeThreadDto {
5935 code: number;
5936 data?: EnvelopeThreadDtoData;
5937 /** @nullable */
5938 error?: string | null;
5939 /** @nullable */
5940 error_code?: string | null;
5941 message: string;
5942 request_id?: string;
5943}
5944
5945export type EnvelopeTopicDtoData = {
5946 created_at: string;
5947 id: string;
5948 name: string;
5949 updated_at: string;
5950};
5951
5952export interface EnvelopeTopicDto {
5953 code: number;
5954 data?: EnvelopeTopicDtoData;
5955 /** @nullable */
5956 error?: string | null;
5957 /** @nullable */
5958 error_code?: string | null;
5959 message: string;
5960 request_id?: string;
5961}
5962
5963export type EnvelopeTotpSetupRespData = {
5964 otpauth_uri: string;
5965 secret: string;
5966};
5967
5968export interface EnvelopeTotpSetupResp {
5969 code: number;
5970 data?: EnvelopeTotpSetupRespData;
5971 /** @nullable */
5972 error?: string | null;
5973 /** @nullable */
5974 error_code?: string | null;
5975 message: string;
5976 request_id?: string;
5977}
5978
5979export type EnvelopeTotpStatusRespData = {
5980 enabled: boolean;
5981};
5982
5983export interface EnvelopeTotpStatusResp {
5984 code: number;
5985 data?: EnvelopeTotpStatusRespData;
5986 /** @nullable */
5987 error?: string | null;
5988 /** @nullable */
5989 error_code?: string | null;
5990 message: string;
5991 request_id?: string;
5992}
5993
5994export type EnvelopeTrackedTimeDtoData = {
5995 created_at: string;
5996 id: string;
5997 issue_id: string;
5998 seconds: number;
5999 user?: null | UserDto;
6000};
6001
6002export interface EnvelopeTrackedTimeDto {
6003 code: number;
6004 data?: EnvelopeTrackedTimeDtoData;
6005 /** @nullable */
6006 error?: string | null;
6007 /** @nullable */
6008 error_code?: string | null;
6009 message: string;
6010 request_id?: string;
6011}
6012
6013export type EnvelopeUnreadCountRespData = {
6014 /** @minimum 0 */
6015 count: number;
6016};
6017
6018export interface EnvelopeUnreadCountResp {
6019 code: number;
6020 data?: EnvelopeUnreadCountRespData;
6021 /** @nullable */
6022 error?: string | null;
6023 /** @nullable */
6024 error_code?: string | null;
6025 message: string;
6026 request_id?: string;
6027}
6028
6029export type EnvelopeUpdateBranchDtoData = {
6030 pull: PullDto;
6031 result: MergeResultDto;
6032};
6033
6034export interface EnvelopeUpdateBranchDto {
6035 code: number;
6036 data?: EnvelopeUpdateBranchDtoData;
6037 /** @nullable */
6038 error?: string | null;
6039 /** @nullable */
6040 error_code?: string | null;
6041 message: string;
6042 request_id?: string;
6043}
6044
6045export type EnvelopeUploadIntentDtoData = {
6046 /** @minimum 0 */
6047 expires_secs: number;
6048 id: string;
6049 upload_url: string;
6050};
6051
6052export interface EnvelopeUploadIntentDto {
6053 code: number;
6054 data?: EnvelopeUploadIntentDtoData;
6055 /** @nullable */
6056 error?: string | null;
6057 /** @nullable */
6058 error_code?: string | null;
6059 message: string;
6060 request_id?: string;
6061}
6062
6063export type EnvelopeUserLoginResponseData = {
6064 /** @nullable */
6065 challenge?: string | null;
6066 /** @nullable */
6067 displayname?: string | null;
6068 mfa_required: boolean;
6069 user_id: number;
6070 username: string;
6071};
6072
6073export interface EnvelopeUserLoginResponse {
6074 code: number;
6075 data?: EnvelopeUserLoginResponseData;
6076 /** @nullable */
6077 error?: string | null;
6078 /** @nullable */
6079 error_code?: string | null;
6080 message: string;
6081 request_id?: string;
6082}
6083
6084export type EnvelopeUserOverwriteDtoData = {
6085 allow_mask: number;
6086 deny_mask: number;
6087 dir_id: string;
6088 user?: null | UserDto;
6089 user_id: number;
6090};
6091
6092export interface EnvelopeUserOverwriteDto {
6093 code: number;
6094 data?: EnvelopeUserOverwriteDtoData;
6095 /** @nullable */
6096 error?: string | null;
6097 /** @nullable */
6098 error_code?: string | null;
6099 message: string;
6100 request_id?: string;
6101}
6102
6103export type EnvelopeUserPreferencesDtoData = {
6104 allow_dms_from: Audience;
6105 allow_mentions_from: Audience;
6106 /** Default view for the 问题集 page: `board` or `list`. */
6107 board_view_mode: string;
6108 /** @nullable */
6109 diff_view_style?: string | null;
6110 email_digest: boolean;
6111 email_flags: number;
6112 in_app_flags: number;
6113 /** @nullable */
6114 mute_until?: string | null;
6115 push_flags: number;
6116 show_online_status: boolean;
6117 theme_mode: string;
6118};
6119
6120export interface EnvelopeUserPreferencesDto {
6121 code: number;
6122 data?: EnvelopeUserPreferencesDtoData;
6123 /** @nullable */
6124 error?: string | null;
6125 /** @nullable */
6126 error_code?: string | null;
6127 message: string;
6128 request_id?: string;
6129}
6130
6131export type EnvelopeUserPublicData = {
6132 avatar_url: string;
6133 display_name: string;
6134 user_id: number;
6135 username: string;
6136};
6137
6138export interface EnvelopeUserPublic {
6139 code: number;
6140 data?: EnvelopeUserPublicData;
6141 /** @nullable */
6142 error?: string | null;
6143 /** @nullable */
6144 error_code?: string | null;
6145 message: string;
6146 request_id?: string;
6147}
6148
6149export type EnvelopeUserRegisterResponseData = {
6150 /** @nullable */
6151 displayname?: string | null;
6152 user_id: number;
6153 username: string;
6154};
6155
6156export interface EnvelopeUserRegisterResponse {
6157 code: number;
6158 data?: EnvelopeUserRegisterResponseData;
6159 /** @nullable */
6160 error?: string | null;
6161 /** @nullable */
6162 error_code?: string | null;
6163 message: string;
6164 request_id?: string;
6165}
6166
6167export interface EnvelopeValue {
6168 code: number;
6169 data?: unknown;
6170 /** @nullable */
6171 error?: string | null;
6172 /** @nullable */
6173 error_code?: string | null;
6174 message: string;
6175 request_id?: string;
6176}
6177
6178export type EnvelopeVecAgreementDocDataItem = {
6179 content_md: string;
6180 key: string;
6181 title: string;
6182 version: string;
6183};
6184
6185export interface EnvelopeVecAgreementDoc {
6186 code: number;
6187 data?: EnvelopeVecAgreementDocDataItem[];
6188 /** @nullable */
6189 error?: string | null;
6190 /** @nullable */
6191 error_code?: string | null;
6192 message: string;
6193 request_id?: string;
6194}
6195
6196export type EnvelopeVecBlameRangeDtoDataItem = {
6197 abbreviated_oid: string;
6198 commit_sha: string;
6199 ending_line: number;
6200 /** @nullable */
6201 path?: string | null;
6202 starting_line: number;
6203};
6204
6205export interface EnvelopeVecBlameRangeDto {
6206 code: number;
6207 data?: EnvelopeVecBlameRangeDtoDataItem[];
6208 /** @nullable */
6209 error?: string | null;
6210 /** @nullable */
6211 error_code?: string | null;
6212 message: string;
6213 request_id?: string;
6214}
6215
6216export type EnvelopeVecBranchPolicyDtoDataItem = {
6217 block_on_change_requested_reviews: boolean;
6218 block_on_outdated_branch: boolean;
6219 block_on_rejected_reviews: boolean;
6220 branch_pattern: string;
6221 created_at: string;
6222 dismiss_stale_approvals: boolean;
6223 enable_approvals_whitelist: boolean;
6224 enable_force_push: boolean;
6225 enable_merge_whitelist: boolean;
6226 enable_push: boolean;
6227 enable_push_whitelist: boolean;
6228 id: string;
6229 protected_file_patterns: string;
6230 push_whitelist_deploy_keys: boolean;
6231 repo_id: string;
6232 require_signed_commits: boolean;
6233 required_approvals: number;
6234 required_status_contexts: string;
6235 unprotected_file_patterns: string;
6236 updated_at: string;
6237};
6238
6239export interface EnvelopeVecBranchPolicyDto {
6240 code: number;
6241 data?: EnvelopeVecBranchPolicyDtoDataItem[];
6242 /** @nullable */
6243 error?: string | null;
6244 /** @nullable */
6245 error_code?: string | null;
6246 message: string;
6247 request_id?: string;
6248}
6249
6250export type EnvelopeVecBranchWhitelistDtoDataItem = {
6251 created_at: string;
6252 /** @nullable */
6253 group_id?: string | null;
6254 id: string;
6255 kind: WhitelistKind;
6256 policy_id: string;
6257 user?: null | UserDto;
6258 /** @nullable */
6259 user_id?: number | null;
6260};
6261
6262export interface EnvelopeVecBranchWhitelistDto {
6263 code: number;
6264 data?: EnvelopeVecBranchWhitelistDtoDataItem[];
6265 /** @nullable */
6266 error?: string | null;
6267 /** @nullable */
6268 error_code?: string | null;
6269 message: string;
6270 request_id?: string;
6271}
6272
6273export type EnvelopeVecChangedPathDiffDtoDataItem = {
6274 binary: boolean;
6275 /** @minimum 0 */
6276 lines_added: number;
6277 /** @minimum 0 */
6278 lines_removed: number;
6279 /** @nullable */
6280 patch?: string | null;
6281 path: ChangedPathDto;
6282};
6283
6284export interface EnvelopeVecChangedPathDiffDto {
6285 code: number;
6286 data?: EnvelopeVecChangedPathDiffDtoDataItem[];
6287 /** @nullable */
6288 error?: string | null;
6289 /** @nullable */
6290 error_code?: string | null;
6291 message: string;
6292 request_id?: string;
6293}
6294
6295export type EnvelopeVecCleanupObjectDtoDataItem = {
6296 /** 目录的子节点数 / 频道的子频道数。 */
6297 child_count: number;
6298 /** `dirs.id`(目录/仓库/问题集/智能体集)或 `rooms.id`(频道)。 */
6299 id: string;
6300 is_archived: boolean;
6301 /**
6302 * 仅仓库与频道有可见性开关。
6303 * @nullable
6304 */
6305 is_private?: boolean | null;
6306 /** `dir | object | repo | board | text | voice | stage | category | news | guild_room` */
6307 kind: string;
6308 name: string;
6309 /** 目录上的权限覆盖条数(group + user)。 */
6310 overwrite_count: number;
6311 /** 父链拼出的可读路径,例如 `bots / 研究研究`。 */
6312 path: string;
6313};
6314
6315export interface EnvelopeVecCleanupObjectDto {
6316 code: number;
6317 data?: EnvelopeVecCleanupObjectDtoDataItem[];
6318 /** @nullable */
6319 error?: string | null;
6320 /** @nullable */
6321 error_code?: string | null;
6322 message: string;
6323 request_id?: string;
6324}
6325
6326export type EnvelopeVecCommentTreeNodeDataItem = {
6327 comment: CommentDto;
6328 replies: CommentTreeNode[];
6329};
6330
6331export interface EnvelopeVecCommentTreeNode {
6332 code: number;
6333 data?: EnvelopeVecCommentTreeNodeDataItem[];
6334 /** @nullable */
6335 error?: string | null;
6336 /** @nullable */
6337 error_code?: string | null;
6338 message: string;
6339 request_id?: string;
6340}
6341
6342export type EnvelopeVecCommitStatusDtoDataItem = {
6343 context: string;
6344 created_at: string;
6345 creator?: null | UserDto;
6346 creator_id: number;
6347 /** @nullable */
6348 description?: string | null;
6349 state: CommitStatusDtoState;
6350 /** @nullable */
6351 target_url?: string | null;
6352 /** @nullable */
6353 updated_at?: string | null;
6354};
6355
6356export interface EnvelopeVecCommitStatusDto {
6357 code: number;
6358 data?: EnvelopeVecCommitStatusDtoDataItem[];
6359 /** @nullable */
6360 error?: string | null;
6361 /** @nullable */
6362 error_code?: string | null;
6363 message: string;
6364 request_id?: string;
6365}
6366
6367export type EnvelopeVecContributorStatDtoDataItem = {
6368 additions: number;
6369 commits: number;
6370 deletions: number;
6371 email: string;
6372 name: string;
6373};
6374
6375export interface EnvelopeVecContributorStatDto {
6376 code: number;
6377 data?: EnvelopeVecContributorStatDtoDataItem[];
6378 /** @nullable */
6379 error?: string | null;
6380 /** @nullable */
6381 error_code?: string | null;
6382 message: string;
6383 request_id?: string;
6384}
6385
6386export type EnvelopeVecDependencyDtoDataItem = {
6387 created_at: string;
6388 dependency_id: string;
6389 id: string;
6390 issue_id: string;
6391};
6392
6393export interface EnvelopeVecDependencyDto {
6394 code: number;
6395 data?: EnvelopeVecDependencyDtoDataItem[];
6396 /** @nullable */
6397 error?: string | null;
6398 /** @nullable */
6399 error_code?: string | null;
6400 message: string;
6401 request_id?: string;
6402}
6403
6404export type EnvelopeVecDirNodeDtoDataItem = {
6405 /** @nullable */
6406 archived_at?: string | null;
6407 children: DirNodeDto[];
6408 /** @nullable */
6409 color?: string | null;
6410 created_at: string;
6411 created_by_id: number;
6412 /** @nullable */
6413 icon?: string | null;
6414 id: string;
6415 is_archived: boolean;
6416 kind: DirKind;
6417 name: string;
6418 /** @nullable */
6419 parent_dir_id?: string | null;
6420 position: number;
6421 /** @nullable */
6422 purpose?: string | null;
6423 /** @nullable */
6424 topic?: string | null;
6425 updated_at: string;
6426};
6427
6428export interface EnvelopeVecDirNodeDto {
6429 code: number;
6430 data?: EnvelopeVecDirNodeDtoDataItem[];
6431 /** @nullable */
6432 error?: string | null;
6433 /** @nullable */
6434 error_code?: string | null;
6435 message: string;
6436 request_id?: string;
6437}
6438
6439export type EnvelopeVecGroupOverwriteDtoDataItem = {
6440 allow_mask: number;
6441 deny_mask: number;
6442 dir_id: string;
6443 group_id: string;
6444};
6445
6446export interface EnvelopeVecGroupOverwriteDto {
6447 code: number;
6448 data?: EnvelopeVecGroupOverwriteDtoDataItem[];
6449 /** @nullable */
6450 error?: string | null;
6451 /** @nullable */
6452 error_code?: string | null;
6453 message: string;
6454 request_id?: string;
6455}
6456
6457export type EnvelopeVecIssueAttachmentDtoDataItem = {
6458 content_type: string;
6459 created_at: string;
6460 filename: string;
6461 id: string;
6462 /**
6463 * `None` until the draft is submitted with this attachment attached.
6464 * @nullable
6465 */
6466 issue_id?: string | null;
6467 size: number;
6468 status: IssueAttachmentStatus;
6469 uploader_id: number;
6470};
6471
6472export interface EnvelopeVecIssueAttachmentDto {
6473 code: number;
6474 data?: EnvelopeVecIssueAttachmentDtoDataItem[];
6475 /** @nullable */
6476 error?: string | null;
6477 /** @nullable */
6478 error_code?: string | null;
6479 message: string;
6480 request_id?: string;
6481}
6482
6483export type EnvelopeVecIssuePullLinkDtoDataItem = {
6484 /** 建立关联的时间。 */
6485 linked_at: string;
6486 pull: PullDto;
6487 /** 关联行主键(issue_relation_pull.id),解除关联时作为路径参数回传。 */
6488 relation_id: string;
6489};
6490
6491export interface EnvelopeVecIssuePullLinkDto {
6492 code: number;
6493 data?: EnvelopeVecIssuePullLinkDtoDataItem[];
6494 /** @nullable */
6495 error?: string | null;
6496 /** @nullable */
6497 error_code?: string | null;
6498 message: string;
6499 request_id?: string;
6500}
6501
6502export type EnvelopeVecJoinRuleDtoDataItem = {
6503 created_at: string;
6504 enabled: boolean;
6505 id: string;
6506 matcher: string;
6507 role_id: string;
6508 trigger: SpaceJoinTrigger;
6509 updated_at: string;
6510};
6511
6512export interface EnvelopeVecJoinRuleDto {
6513 code: number;
6514 data?: EnvelopeVecJoinRuleDtoDataItem[];
6515 /** @nullable */
6516 error?: string | null;
6517 /** @nullable */
6518 error_code?: string | null;
6519 message: string;
6520 request_id?: string;
6521}
6522
6523export type EnvelopeVecLabelDtoDataItem = {
6524 color: string;
6525 created_at: string;
6526 /** @nullable */
6527 description?: string | null;
6528 dir_id: string;
6529 exclusive: boolean;
6530 exclusive_order: number;
6531 id: string;
6532 is_archived: boolean;
6533 name: string;
6534 /** @nullable */
6535 updated_at?: string | null;
6536};
6537
6538export interface EnvelopeVecLabelDto {
6539 code: number;
6540 data?: EnvelopeVecLabelDtoDataItem[];
6541 /** @nullable */
6542 error?: string | null;
6543 /** @nullable */
6544 error_code?: string | null;
6545 message: string;
6546 request_id?: string;
6547}
6548
6549export type EnvelopeVecLanguageStatDtoDataItem = {
6550 is_primary: boolean;
6551 language: string;
6552 percentage_bp: number;
6553 size: number;
6554};
6555
6556export interface EnvelopeVecLanguageStatDto {
6557 code: number;
6558 data?: EnvelopeVecLanguageStatDtoDataItem[];
6559 /** @nullable */
6560 error?: string | null;
6561 /** @nullable */
6562 error_code?: string | null;
6563 message: string;
6564 request_id?: string;
6565}
6566
6567export type EnvelopeVecLfsPointerDtoDataItem = {
6568 /** @nullable */
6569 oid?: string | null;
6570 /** @nullable */
6571 size?: number | null;
6572 version: string;
6573};
6574
6575export interface EnvelopeVecLfsPointerDto {
6576 code: number;
6577 data?: EnvelopeVecLfsPointerDtoDataItem[];
6578 /** @nullable */
6579 error?: string | null;
6580 /** @nullable */
6581 error_code?: string | null;
6582 message: string;
6583 request_id?: string;
6584}
6585
6586export type EnvelopeVecMemeDtoDataItem = {
6587 content_type: string;
6588 created_at: string;
6589 /** @nullable */
6590 height?: number | null;
6591 id: string;
6592 name: string;
6593 size: number;
6594 url: string;
6595 /** @nullable */
6596 width?: number | null;
6597};
6598
6599export interface EnvelopeVecMemeDto {
6600 code: number;
6601 data?: EnvelopeVecMemeDtoDataItem[];
6602 /** @nullable */
6603 error?: string | null;
6604 /** @nullable */
6605 error_code?: string | null;
6606 message: string;
6607 request_id?: string;
6608}
6609
6610export type EnvelopeVecMergeCommitDtoDataItem = {
6611 author_at: string;
6612 author_email: string;
6613 author_name: string;
6614 message: string;
6615 parents: string[];
6616 sha: string;
6617 subject: string;
6618};
6619
6620export interface EnvelopeVecMergeCommitDto {
6621 code: number;
6622 data?: EnvelopeVecMergeCommitDtoDataItem[];
6623 /** @nullable */
6624 error?: string | null;
6625 /** @nullable */
6626 error_code?: string | null;
6627 message: string;
6628 request_id?: string;
6629}
6630
6631export type EnvelopeVecMessageEditDtoDataItem = {
6632 content: string;
6633 created_at: string;
6634 editor?: null | UserDto;
6635 id: string;
6636 message_id: string;
6637};
6638
6639export interface EnvelopeVecMessageEditDto {
6640 code: number;
6641 data?: EnvelopeVecMessageEditDtoDataItem[];
6642 /** @nullable */
6643 error?: string | null;
6644 /** @nullable */
6645 error_code?: string | null;
6646 message: string;
6647 request_id?: string;
6648}
6649
6650export type EnvelopeVecOutboundWebhookDtoDataItem = {
6651 created_at: string;
6652 disabled: boolean;
6653 id: string;
6654 /** @nullable */
6655 last_status?: string | null;
6656 /** @nullable */
6657 last_used_at?: string | null;
6658 name: string;
6659 room_id: string;
6660 url: string;
6661};
6662
6663export interface EnvelopeVecOutboundWebhookDto {
6664 code: number;
6665 data?: EnvelopeVecOutboundWebhookDtoDataItem[];
6666 /** @nullable */
6667 error?: string | null;
6668 /** @nullable */
6669 error_code?: string | null;
6670 message: string;
6671 request_id?: string;
6672}
6673
6674export type EnvelopeVecPathLogEntryDtoDataItem = {
6675 author: string;
6676 date: string;
6677 path: string;
6678 short_sha: string;
6679 subject: string;
6680};
6681
6682export interface EnvelopeVecPathLogEntryDto {
6683 code: number;
6684 data?: EnvelopeVecPathLogEntryDtoDataItem[];
6685 /** @nullable */
6686 error?: string | null;
6687 /** @nullable */
6688 error_code?: string | null;
6689 message: string;
6690 request_id?: string;
6691}
6692
6693export type EnvelopeVecPinDtoDataItem = {
6694 board_id: string;
6695 created_at: string;
6696 id: string;
6697 /** @nullable */
6698 issue_id?: string | null;
6699 pin_order: number;
6700};
6701
6702export interface EnvelopeVecPinDto {
6703 code: number;
6704 data?: EnvelopeVecPinDtoDataItem[];
6705 /** @nullable */
6706 error?: string | null;
6707 /** @nullable */
6708 error_code?: string | null;
6709 message: string;
6710 request_id?: string;
6711}
6712
6713export type EnvelopeVecPresenceDtoDataItem = {
6714 activities: unknown;
6715 /** @nullable */
6716 last_seen_at?: string | null;
6717 online: boolean;
6718 status: PresenceStatus;
6719 user?: null | UserDto;
6720 user_id: number;
6721};
6722
6723export interface EnvelopeVecPresenceDto {
6724 code: number;
6725 data?: EnvelopeVecPresenceDtoDataItem[];
6726 /** @nullable */
6727 error?: string | null;
6728 /** @nullable */
6729 error_code?: string | null;
6730 message: string;
6731 request_id?: string;
6732}
6733
6734export type EnvelopeVecPullAssigneeDtoDataItem = {
6735 created_at: string;
6736 id: string;
6737 user?: null | UserDto;
6738};
6739
6740export interface EnvelopeVecPullAssigneeDto {
6741 code: number;
6742 data?: EnvelopeVecPullAssigneeDtoDataItem[];
6743 /** @nullable */
6744 error?: string | null;
6745 /** @nullable */
6746 error_code?: string | null;
6747 message: string;
6748 request_id?: string;
6749}
6750
6751export interface PullCommentDto {
6752 author?: null | UserDto;
6753 body: string;
6754 /** @nullable */
6755 commit_sha?: string | null;
6756 created_at: string;
6757 id: string;
6758 /** @nullable */
6759 line?: number | null;
6760 /** @nullable */
6761 parent_comment_id?: string | null;
6762 /** @nullable */
6763 path?: string | null;
6764 pull_request_id: string;
6765 resolved: boolean;
6766 /** @nullable */
6767 resolved_by?: number | null;
6768 /** @nullable */
6769 review_id?: string | null;
6770 /** @nullable */
6771 side?: string | null;
6772 /** @nullable */
6773 updated_at?: string | null;
6774}
6775
6776/**
6777 * 线程视图:顶层评论 + 其下全部回复(无递归,便于文档生成)。
6778 */
6779export type EnvelopeVecPullCommentThreadDtoDataItem = {
6780 replies: PullCommentDto[];
6781 root: PullCommentDto;
6782};
6783
6784export interface EnvelopeVecPullCommentThreadDto {
6785 code: number;
6786 data?: EnvelopeVecPullCommentThreadDtoDataItem[];
6787 /** @nullable */
6788 error?: string | null;
6789 /** @nullable */
6790 error_code?: string | null;
6791 message: string;
6792 request_id?: string;
6793}
6794
6795export type EnvelopeVecPullReviewDtoDataItem = {
6796 /** @minimum 0 */
6797 comment_count: number;
6798 commit_sha: string;
6799 /** @nullable */
6800 content?: string | null;
6801 created_at: string;
6802 id: string;
6803 official: boolean;
6804 pull_request_id: string;
6805 state: ReviewState;
6806 /** @nullable */
6807 updated_at?: string | null;
6808 user?: null | UserDto;
6809};
6810
6811export interface EnvelopeVecPullReviewDto {
6812 code: number;
6813 data?: EnvelopeVecPullReviewDtoDataItem[];
6814 /** @nullable */
6815 error?: string | null;
6816 /** @nullable */
6817 error_code?: string | null;
6818 message: string;
6819 request_id?: string;
6820}
6821
6822export type ReviewerState =
6823 "requested" | "approved" | "changes_requested" | "commented" | "dismissed";
6824export type EnvelopeVecPullReviewerDtoDataItem = {
6825 created_at: string;
6826 id: string;
6827 requested_by?: null | UserDto;
6828 required: boolean;
6829 /** @nullable */
6830 review_id?: string | null;
6831 state: ReviewerState;
6832 /** @nullable */
6833 updated_at?: string | null;
6834 user?: null | UserDto;
6835};
6836
6837export interface EnvelopeVecPullReviewerDto {
6838 code: number;
6839 data?: EnvelopeVecPullReviewerDtoDataItem[];
6840 /** @nullable */
6841 error?: string | null;
6842 /** @nullable */
6843 error_code?: string | null;
6844 message: string;
6845 request_id?: string;
6846}
6847
6848export type EnvelopeVecReactionAggDtoDataItem = {
6849 count: number;
6850 emoji: string;
6851 me: boolean;
6852};
6853
6854export interface EnvelopeVecReactionAggDto {
6855 code: number;
6856 data?: EnvelopeVecReactionAggDtoDataItem[];
6857 /** @nullable */
6858 error?: string | null;
6859 /** @nullable */
6860 error_code?: string | null;
6861 message: string;
6862 request_id?: string;
6863}
6864
6865export type EnvelopeVecReactionUserDtoDataItem = {
6866 created_at: string;
6867 emoji: string;
6868 user: UserDto;
6869};
6870
6871export interface EnvelopeVecReactionUserDto {
6872 code: number;
6873 data?: EnvelopeVecReactionUserDtoDataItem[];
6874 /** @nullable */
6875 error?: string | null;
6876 /** @nullable */
6877 error_code?: string | null;
6878 message: string;
6879 request_id?: string;
6880}
6881
6882export type EnvelopeVecRecentMentionDtoDataItem = {
6883 channel_id: string;
6884 created_at: string;
6885 id: string;
6886 message_id: string;
6887};
6888
6889export interface EnvelopeVecRecentMentionDto {
6890 code: number;
6891 data?: EnvelopeVecRecentMentionDtoDataItem[];
6892 /** @nullable */
6893 error?: string | null;
6894 /** @nullable */
6895 error_code?: string | null;
6896 message: string;
6897 request_id?: string;
6898}
6899
6900export type EnvelopeVecReminderDtoDataItem = {
6901 created_at: string;
6902 id: string;
6903 message_id: string;
6904 /** @nullable */
6905 message_preview?: string | null;
6906 /** @nullable */
6907 note?: string | null;
6908 remind_at: string;
6909 room_id: string;
6910 status: ReminderStatus;
6911};
6912
6913export interface EnvelopeVecReminderDto {
6914 code: number;
6915 data?: EnvelopeVecReminderDtoDataItem[];
6916 /** @nullable */
6917 error?: string | null;
6918 /** @nullable */
6919 error_code?: string | null;
6920 message: string;
6921 request_id?: string;
6922}
6923
6924export type EnvelopeVecRemoteDtoDataItem = {
6925 /** @nullable */
6926 fetch_url?: string | null;
6927 name: string;
6928 /** @nullable */
6929 push_url?: string | null;
6930};
6931
6932export interface EnvelopeVecRemoteDto {
6933 code: number;
6934 data?: EnvelopeVecRemoteDtoDataItem[];
6935 /** @nullable */
6936 error?: string | null;
6937 /** @nullable */
6938 error_code?: string | null;
6939 message: string;
6940 request_id?: string;
6941}
6942
6943export type EnvelopeVecRepoRelDtoDataItem = {
6944 created_at: string;
6945 id: string;
6946 issue_id: string;
6947 repo_id: string;
6948};
6949
6950export interface EnvelopeVecRepoRelDto {
6951 code: number;
6952 data?: EnvelopeVecRepoRelDtoDataItem[];
6953 /** @nullable */
6954 error?: string | null;
6955 /** @nullable */
6956 error_code?: string | null;
6957 message: string;
6958 request_id?: string;
6959}
6960
6961export type EnvelopeVecRoleSummaryDataItem = {
6962 /** @nullable */
6963 color?: string | null;
6964 created_at: string;
6965 default_role: boolean;
6966 /** @nullable */
6967 description?: string | null;
6968 /** @nullable */
6969 emoji?: string | null;
6970 /** @nullable */
6971 icon_hash?: string | null;
6972 id: string;
6973 key: string;
6974 member_count: number;
6975 name: string;
6976 organization_id: string;
6977 permissions: PermissionGrant[];
6978 position: number;
6979 rank: number;
6980 self_assignable: boolean;
6981 system: boolean;
6982 updated_at: string;
6983 version: number;
6984};
6985
6986export interface EnvelopeVecRoleSummary {
6987 code: number;
6988 data?: EnvelopeVecRoleSummaryDataItem[];
6989 /** @nullable */
6990 error?: string | null;
6991 /** @nullable */
6992 error_code?: string | null;
6993 message: string;
6994 request_id?: string;
6995}
6996
6997export type EnvelopeVecRoomBriefDtoDataItem = {
6998 created_at: string;
6999 /** @nullable */
7000 dir_id?: string | null;
7001 favorite: boolean;
7002 hidden: boolean;
7003 id: string;
7004 is_private: boolean;
7005 kind: RoomKind;
7006 /** @nullable */
7007 last_message_id?: string | null;
7008 member_count: number;
7009 muted: boolean;
7010 name: string;
7011 nsfw: boolean;
7012 owner?: null | UserDto;
7013 owner_id: number;
7014 /** @nullable */
7015 parent_id?: string | null;
7016 position: number;
7017 /** @nullable */
7018 rate_limit_per_user?: number | null;
7019 /** @nullable */
7020 space_id?: string | null;
7021 /** @nullable */
7022 topic?: string | null;
7023 unread_count: number;
7024 unread_mentions: number;
7025};
7026
7027export interface EnvelopeVecRoomBriefDto {
7028 code: number;
7029 data?: EnvelopeVecRoomBriefDtoDataItem[];
7030 /** @nullable */
7031 error?: string | null;
7032 /** @nullable */
7033 error_code?: string | null;
7034 message: string;
7035 request_id?: string;
7036}
7037
7038export interface EnvelopeVecString {
7039 code: number;
7040 data?: string[];
7041 /** @nullable */
7042 error?: string | null;
7043 /** @nullable */
7044 error_code?: string | null;
7045 message: string;
7046 request_id?: string;
7047}
7048
7049export type EnvelopeVecSubmoduleDtoDataItem = {
7050 /** @nullable */
7051 branch?: string | null;
7052 /** @nullable */
7053 commit_sha?: string | null;
7054 path: string;
7055 url: string;
7056};
7057
7058export interface EnvelopeVecSubmoduleDto {
7059 code: number;
7060 data?: EnvelopeVecSubmoduleDtoDataItem[];
7061 /** @nullable */
7062 error?: string | null;
7063 /** @nullable */
7064 error_code?: string | null;
7065 message: string;
7066 request_id?: string;
7067}
7068
7069export type SuspensionType = "temporary" | "permanent";
7070export type EnvelopeVecSuspensionDtoDataItem = {
7071 created_at: string;
7072 /** @nullable */
7073 ends_at?: string | null;
7074 id: string;
7075 /** @nullable */
7076 reason?: string | null;
7077 /** @nullable */
7078 revoked_at?: string | null;
7079 starts_at: string;
7080 suspension_type: SuspensionType;
7081};
7082
7083export interface EnvelopeVecSuspensionDto {
7084 code: number;
7085 data?: EnvelopeVecSuspensionDtoDataItem[];
7086 /** @nullable */
7087 error?: string | null;
7088 /** @nullable */
7089 error_code?: string | null;
7090 message: string;
7091 request_id?: string;
7092}
7093
7094export type EnvelopeVecTagPolicyDtoDataItem = {
7095 created_at: string;
7096 id: string;
7097 name_pattern: string;
7098 repo_id: string;
7099 updated_at: string;
7100};
7101
7102export interface EnvelopeVecTagPolicyDto {
7103 code: number;
7104 data?: EnvelopeVecTagPolicyDtoDataItem[];
7105 /** @nullable */
7106 error?: string | null;
7107 /** @nullable */
7108 error_code?: string | null;
7109 message: string;
7110 request_id?: string;
7111}
7112
7113export type EnvelopeVecTagWhitelistDtoDataItem = {
7114 policy_id: string;
7115 user?: null | UserDto;
7116 user_id: number;
7117};
7118
7119export interface EnvelopeVecTagWhitelistDto {
7120 code: number;
7121 data?: EnvelopeVecTagWhitelistDtoDataItem[];
7122 /** @nullable */
7123 error?: string | null;
7124 /** @nullable */
7125 error_code?: string | null;
7126 message: string;
7127 request_id?: string;
7128}
7129
7130export type EnvelopeVecTopicDtoDataItem = {
7131 created_at: string;
7132 id: string;
7133 name: string;
7134 updated_at: string;
7135};
7136
7137export interface EnvelopeVecTopicDto {
7138 code: number;
7139 data?: EnvelopeVecTopicDtoDataItem[];
7140 /** @nullable */
7141 error?: string | null;
7142 /** @nullable */
7143 error_code?: string | null;
7144 message: string;
7145 request_id?: string;
7146}
7147
7148export type EnvelopeVecUserOverwriteDtoDataItem = {
7149 allow_mask: number;
7150 deny_mask: number;
7151 dir_id: string;
7152 user?: null | UserDto;
7153 user_id: number;
7154};
7155
7156export interface EnvelopeVecUserOverwriteDto {
7157 code: number;
7158 data?: EnvelopeVecUserOverwriteDtoDataItem[];
7159 /** @nullable */
7160 error?: string | null;
7161 /** @nullable */
7162 error_code?: string | null;
7163 message: string;
7164 request_id?: string;
7165}
7166
7167export type EnvelopeVecUserPublicDataItem = {
7168 avatar_url: string;
7169 display_name: string;
7170 user_id: number;
7171 username: string;
7172};
7173
7174export interface EnvelopeVecUserPublic {
7175 code: number;
7176 data?: EnvelopeVecUserPublicDataItem[];
7177 /** @nullable */
7178 error?: string | null;
7179 /** @nullable */
7180 error_code?: string | null;
7181 message: string;
7182 request_id?: string;
7183}
7184
7185export interface VoiceTrackDto {
7186 kind: string;
7187 muted: boolean;
7188 sid: string;
7189 source: string;
7190}
7191
7192/**
7193 * 房间参与者快照。
7194 *
7195 * 权威来源是 LiveKit 的 list_participants,Redis 只补主持人静音等本地状态;
7196 * 这是「谁在这个频道里」的服务端视图,用于侧栏人数与未加入时的预览。
7197 * 会中界面的发言高亮、静音图标与画面轨道一律直接读浏览器里的 Room,
7198 * 因为本接口不是事件流,返回值天然是快照。
7199 */
7200export type EnvelopeVecVoiceParticipantDtoDataItem = {
7201 /** @nullable */
7202 avatar_url?: string | null;
7203 can_publish: boolean;
7204 display_name: string;
7205 joined_at: number;
7206 moderator_muted: boolean;
7207 /**
7208 * 快照值:list_participants 不返回发言状态,因此这里恒为 false;
7209 * 实时发言指示由前端从 Room 的 activeSpeakers 读取。
7210 */
7211 speaking: boolean;
7212 tracks: VoiceTrackDto[];
7213 user_id: number;
7214};
7215
7216export interface EnvelopeVecVoiceParticipantDto {
7217 code: number;
7218 data?: EnvelopeVecVoiceParticipantDtoDataItem[];
7219 /** @nullable */
7220 error?: string | null;
7221 /** @nullable */
7222 error_code?: string | null;
7223 message: string;
7224 request_id?: string;
7225}
7226
7227export type EnvelopeVerifyResultDtoData = {
7228 /** @nullable */
7229 error_message?: string | null;
7230 /** @nullable */
7231 key_id?: string | null;
7232 signed: boolean;
7233 /** @nullable */
7234 signer?: string | null;
7235 valid: boolean;
7236};
7237
7238export interface EnvelopeVerifyResultDto {
7239 code: number;
7240 data?: EnvelopeVerifyResultDtoData;
7241 /** @nullable */
7242 error?: string | null;
7243 /** @nullable */
7244 error_code?: string | null;
7245 message: string;
7246 request_id?: string;
7247}
7248
7249export type EnvelopeVoiceConfigDtoData = {
7250 enabled: boolean;
7251 recording_enabled: boolean;
7252 url: string;
7253};
7254
7255export interface EnvelopeVoiceConfigDto {
7256 code: number;
7257 data?: EnvelopeVoiceConfigDtoData;
7258 /** @nullable */
7259 error?: string | null;
7260 /** @nullable */
7261 error_code?: string | null;
7262 message: string;
7263 request_id?: string;
7264}
7265
7266export interface HandDto {
7267 /** @nullable */
7268 avatar_url?: string | null;
7269 display_name: string;
7270 requested_at: number;
7271 state: HandState;
7272 user_id: number;
7273}
7274
7275export type EnvelopeVoiceHandsDtoData = {
7276 can_moderate: boolean;
7277 hands: HandDto[];
7278 my_state?: null | HandState;
7279};
7280
7281export interface EnvelopeVoiceHandsDto {
7282 code: number;
7283 data?: EnvelopeVoiceHandsDtoData;
7284 /** @nullable */
7285 error?: string | null;
7286 /** @nullable */
7287 error_code?: string | null;
7288 message: string;
7289 request_id?: string;
7290}
7291
7292/**
7293 * 一个参与者窗口在画布里的摆位,坐标按画布宽高归一化(0~1),
7294 * 这样不同分辨率、不同窗口大小的成员看到的是同一套布局。
7295 */
7296export interface VoiceTileDto {
7297 /**
7298 * 归一化高度,和 `w` 一样按画布的可用宽高分别归一,因此窗口可以自由
7299 * 拉伸而不是只能等比缩放。旧记录没有这个字段,读出来是 `None`,客户端
7300 * 按宽度的 3/4 补一个经典比例。
7301 * @nullable
7302 */
7303 h?: number | null;
7304 /**
7305 * 服务端写入时刻(秒)。请求里被忽略,响应里供客户端判断“谁更新”,
7306 * 这样并发拖拽时一个迟到的 GET 不会把刚摆好的窗口拽回旧位置。
7307 */
7308 updated_at?: number;
7309 /** 归一化宽度。 */
7310 w: number;
7311 x: number;
7312 y: number;
7313}
7314
7315/**
7316 * key 为参与者用户 id。
7317 */
7318export type EnvelopeVoiceLayoutDtoDataTiles = { [key: string]: VoiceTileDto };
7319
7320export type EnvelopeVoiceLayoutDtoData = {
7321 /** key 为参与者用户 id。 */
7322 tiles?: EnvelopeVoiceLayoutDtoDataTiles;
7323};
7324
7325export interface EnvelopeVoiceLayoutDto {
7326 code: number;
7327 data?: EnvelopeVoiceLayoutDtoData;
7328 /** @nullable */
7329 error?: string | null;
7330 /** @nullable */
7331 error_code?: string | null;
7332 message: string;
7333 request_id?: string;
7334}
7335
7336/**
7337 * 本次写入的服务端时刻,客户端用它给本地副本盖戳。
7338 */
7339export type EnvelopeVoiceLayoutSavedDtoData = {
7340 updated_at: number;
7341};
7342
7343export interface EnvelopeVoiceLayoutSavedDto {
7344 code: number;
7345 /** 本次写入的服务端时刻,客户端用它给本地副本盖戳。 */
7346 data?: EnvelopeVoiceLayoutSavedDtoData;
7347 /** @nullable */
7348 error?: string | null;
7349 /** @nullable */
7350 error_code?: string | null;
7351 message: string;
7352 request_id?: string;
7353}
7354
7355export type EnvelopeVoiceModerationDtoData = {
7356 action: string;
7357 ok: boolean;
7358 user_id: number;
7359};
7360
7361export interface EnvelopeVoiceModerationDto {
7362 code: number;
7363 data?: EnvelopeVoiceModerationDtoData;
7364 /** @nullable */
7365 error?: string | null;
7366 /** @nullable */
7367 error_code?: string | null;
7368 message: string;
7369 request_id?: string;
7370}
7371
7372export type EnvelopeVoiceRecordingDtoData = {
7373 active: boolean;
7374 egress_id: string;
7375};
7376
7377export interface EnvelopeVoiceRecordingDto {
7378 code: number;
7379 data?: EnvelopeVoiceRecordingDtoData;
7380 /** @nullable */
7381 error?: string | null;
7382 /** @nullable */
7383 error_code?: string | null;
7384 message: string;
7385 request_id?: string;
7386}
7387
7388export interface VoiceRoomStateDto {
7389 /** @minimum 0 */
7390 count: number;
7391 room_id: string;
7392}
7393
7394export type EnvelopeVoiceSpaceStatesDtoData = {
7395 rooms: VoiceRoomStateDto[];
7396};
7397
7398export interface EnvelopeVoiceSpaceStatesDto {
7399 code: number;
7400 data?: EnvelopeVoiceSpaceStatesDtoData;
7401 /** @nullable */
7402 error?: string | null;
7403 /** @nullable */
7404 error_code?: string | null;
7405 message: string;
7406 request_id?: string;
7407}
7408
7409export type EnvelopeVoiceTokenDtoData = {
7410 can_publish: boolean;
7411 /** @minimum 0 */
7412 expires_in_secs: number;
7413 hand_state?: null | HandState;
7414 is_stage: boolean;
7415 room_name: string;
7416 token: string;
7417 url: string;
7418};
7419
7420export interface EnvelopeVoiceTokenDto {
7421 code: number;
7422 data?: EnvelopeVoiceTokenDtoData;
7423 /** @nullable */
7424 error?: string | null;
7425 /** @nullable */
7426 error_code?: string | null;
7427 message: string;
7428 request_id?: string;
7429}
7430
7431export type EnvelopeWatchDtoData = {
7432 created_at: string;
7433 id: string;
7434 /** @nullable */
7435 issue_id?: string | null;
7436 mode: WatchMode;
7437 /** @nullable */
7438 updated_at?: string | null;
7439 user?: null | UserDto;
7440};
7441
7442export interface EnvelopeWatchDto {
7443 code: number;
7444 data?: EnvelopeWatchDtoData;
7445 /** @nullable */
7446 error?: string | null;
7447 /** @nullable */
7448 error_code?: string | null;
7449 message: string;
7450 request_id?: string;
7451}
7452
7453export type EnvelopeWebhookDtoData = {
7454 created_at: string;
7455 disabled: boolean;
7456 id: string;
7457 /** @nullable */
7458 last_used_at?: string | null;
7459 name: string;
7460 room_id: string;
7461};
7462
7463export interface EnvelopeWebhookDto {
7464 code: number;
7465 data?: EnvelopeWebhookDtoData;
7466 /** @nullable */
7467 error?: string | null;
7468 /** @nullable */
7469 error_code?: string | null;
7470 message: string;
7471 request_id?: string;
7472}
7473
7474export type EnvelopeWebhookSecretDtoData = {
7475 created_at: string;
7476 disabled: boolean;
7477 id: string;
7478 name: string;
7479 room_id: string;
7480 token: string;
7481};
7482
7483export interface EnvelopeWebhookSecretDto {
7484 code: number;
7485 data?: EnvelopeWebhookSecretDtoData;
7486 /** @nullable */
7487 error?: string | null;
7488 /** @nullable */
7489 error_code?: string | null;
7490 message: string;
7491 request_id?: string;
7492}
7493
7494export interface EnvelopeBool {
7495 code: number;
7496 data?: boolean;
7497 /** @nullable */
7498 error?: string | null;
7499 /** @nullable */
7500 error_code?: string | null;
7501 message: string;
7502 request_id?: string;
7503}
7504
7505export interface EventDto {
7506 /** @nullable */
7507 comment_id?: string | null;
7508 /** @nullable */
7509 commit_sha?: string | null;
7510 /** @nullable */
7511 content?: string | null;
7512 created_at: string;
7513 event_type: IssueEventType;
7514 id: string;
7515 /** @nullable */
7516 issue_id?: string | null;
7517 /** @nullable */
7518 new_ref?: string | null;
7519 /** @nullable */
7520 new_title?: string | null;
7521 /** @nullable */
7522 old_ref?: string | null;
7523 /** @nullable */
7524 old_title?: string | null;
7525 user?: null | UserDto;
7526}
7527
7528export interface EventPath {
7529 board_id: string;
7530 issue_id: string;
7531 space_name: string;
7532}
7533
7534export type ExploreSort = "members" | "newest";
7535export interface ExploreSpaceDto {
7536 allow_join: boolean;
7537 allow_join_level: AllowJoinLevel;
7538 /** @nullable */
7539 avatar_url?: string | null;
7540 /** @nullable */
7541 banner_url?: string | null;
7542 created_at: string;
7543 /** @nullable */
7544 description?: string | null;
7545 id: string;
7546 lower_name: string;
7547 members_count: number;
7548 name: string;
7549 viewer?: null | ExploreViewerDto;
7550}
7551
7552export interface FetchResultDto {
7553 new: string[];
7554 updated: string[];
7555}
7556
7557export interface FileEntryDto {
7558 /** @items.minimum 0 */
7559 content: number[];
7560 executable: boolean;
7561 path: string;
7562}
7563
7564export interface FinalizeAttachmentCmd {
7565 /** @nullable */
7566 duration_secs?: number | null;
7567 /** @nullable */
7568 height?: number | null;
7569 /** @nullable */
7570 width?: number | null;
7571}
7572
7573export interface ForwardMessageCmd {
7574 /** @nullable */
7575 comment?: string | null;
7576 target_room_id: string;
7577}
7578
7579export interface FsckDto {
7580 broken: number;
7581 dangling: number;
7582 ok: boolean;
7583}
7584
7585export interface GroupDto {
7586 color: string;
7587 created_at: string;
7588 created_by?: null | UserDto;
7589 /** @nullable */
7590 icon_hash?: string | null;
7591 id: string;
7592 name: string;
7593 permissions: string[];
7594 position: number;
7595 space_id: string;
7596 /** @nullable */
7597 unicode_emoji?: string | null;
7598 /** @nullable */
7599 updated_at?: string | null;
7600 version: number;
7601}
7602
7603export interface GroupOverwriteDto {
7604 allow_mask: number;
7605 deny_mask: number;
7606 dir_id: string;
7607 group_id: string;
7608}
7609
7610export interface HeadInfoDto {
7611 is_detached: boolean;
7612 name: string;
7613 object: string;
7614 object_type: number;
7615}
7616
7617export type HookEventKind =
7618 "pre_receive" | "post_receive" | "update" | "push" | "tag" | "merge_request";
7619export interface HookExecBody {
7620 args?: string[];
7621}
7622
7623/**
7624 * Which representation a read endpoint should hand back.
7625 */
7626export type ImageVariant = "preview" | "original";
7627export interface ImportResultDto {
7628 commit_count: number;
7629 default_branch: string;
7630}
7631
7632export interface IncludeRevokedQuery {
7633 /** @nullable */
7634 active?: boolean | null;
7635 /** @nullable */
7636 include_revoked?: boolean | null;
7637}
7638
7639export interface IngestPackDto {
7640 object_count: number;
7641 size: number;
7642}
7643
7644export interface InlineDraft {
7645 /** @nullable */
7646 body?: string | null;
7647 line: number;
7648 path: string;
7649 /** @nullable */
7650 side?: string | null;
7651}
7652
7653export interface InviteListQuery {
7654 /** @nullable */
7655 include_revoked?: boolean | null;
7656 /**
7657 * @minimum 0
7658 * @nullable
7659 */
7660 limit?: number | null;
7661 /**
7662 * @minimum 0
7663 * @nullable
7664 */
7665 offset?: number | null;
7666}
7667
7668export interface IsAncestorResponse {
7669 is_ancestor: boolean;
7670}
7671
7672export interface IsObjectInRefResponse {
7673 contains: boolean;
7674}
7675
7676export interface IssueAttachmentDto {
7677 content_type: string;
7678 created_at: string;
7679 filename: string;
7680 id: string;
7681 /**
7682 * `None` until the draft is submitted with this attachment attached.
7683 * @nullable
7684 */
7685 issue_id?: string | null;
7686 size: number;
7687 status: IssueAttachmentStatus;
7688 uploader_id: number;
7689}
7690
7691export interface IssueDto {
7692 assignees: UserDto[];
7693 author?: null | UserDto;
7694 board_id: string;
7695 /** @nullable */
7696 closed_at?: string | null;
7697 content: string;
7698 created_at: string;
7699 /** @nullable */
7700 description?: string | null;
7701 /** @nullable */
7702 due_at?: string | null;
7703 id: string;
7704 /** @nullable */
7705 milestone_id?: string | null;
7706 number: number;
7707 priority: IssuePriority;
7708 state: IssueState;
7709 title: string;
7710 /** @nullable */
7711 updated_at?: string | null;
7712 viewer_watch?: null | WatchMode;
7713}
7714
7715export interface IssueLabelPath {
7716 board_id: string;
7717 issue_id: string;
7718 label_id: string;
7719 space_name: string;
7720}
7721
7722export interface IssueListItemDto {
7723 assignees: UserDto[];
7724 author?: null | UserDto;
7725 board_id: string;
7726 /** @nullable */
7727 closed_at?: string | null;
7728 created_at: string;
7729 /** @nullable */
7730 due_at?: string | null;
7731 id: string;
7732 /** Chips the list rows render; the detail view fetches these separately. */
7733 labels: LabelDto[];
7734 /** @nullable */
7735 milestone_id?: string | null;
7736 number: number;
7737 priority: IssuePriority;
7738 state: IssueState;
7739 title: string;
7740 /** @nullable */
7741 updated_at?: string | null;
7742}
7743
7744export interface IssueMemberDto {
7745 created_at: string;
7746 id: string;
7747 issue_id: string;
7748 kind: IssueMemberKind;
7749 /** @nullable */
7750 updated_at?: string | null;
7751 user?: null | UserDto;
7752}
7753
7754export interface IssueMemberPath {
7755 board_id: string;
7756 issue_id: string;
7757 member_id: string;
7758 space_name: string;
7759}
7760
7761export interface IssuePath {
7762 board_id: string;
7763 /** issue uuid or board-scoped number (e.g. "123") */
7764 issue_id: string;
7765 space_name: string;
7766}
7767
7768export interface IssuePullLinkDto {
7769 /** 建立关联的时间。 */
7770 linked_at: string;
7771 pull: PullDto;
7772 /** 关联行主键(issue_relation_pull.id),解除关联时作为路径参数回传。 */
7773 relation_id: string;
7774}
7775
7776export type IssueSort =
7777 "created_at" | "updated_at" | "due_at" | "priority" | "number";
7778export interface IssueUploadIntentDto {
7779 /** @minimum 0 */
7780 expires_secs: number;
7781 id: string;
7782 upload_url: string;
7783}
7784
7785export interface IssueUserDto {
7786 created_at: string;
7787 id: string;
7788 is_read: boolean;
7789 issue_id: string;
7790 user?: null | UserDto;
7791 user_id: number;
7792}
7793
7794export interface IssueUserPath {
7795 board_id: string;
7796 issue_id: string;
7797 space_name: string;
7798 user_id: number;
7799}
7800
7801export interface JoinRequestDto {
7802 created_at: string;
7803 /** @nullable */
7804 decided_at?: string | null;
7805 decided_by?: null | UserDto;
7806 id: string;
7807 /** @nullable */
7808 note?: string | null;
7809 space_id: string;
7810 status: SpaceJoinRequestState;
7811 updated_at: string;
7812 user?: null | UserDto;
7813}
7814
7815export interface JoinRuleDto {
7816 created_at: string;
7817 enabled: boolean;
7818 id: string;
7819 matcher: string;
7820 role_id: string;
7821 trigger: SpaceJoinTrigger;
7822 updated_at: string;
7823}
7824
7825export interface LabelPath {
7826 board_id: string;
7827 label_id: string;
7828 space_name: string;
7829}
7830
7831export interface LanguageStatDto {
7832 is_primary: boolean;
7833 language: string;
7834 percentage_bp: number;
7835 size: number;
7836}
7837
7838export interface LfsCleanupResponse {
7839 removed: number;
7840}
7841
7842export interface LfsLockBody {
7843 /** @nullable */
7844 oid?: string | null;
7845 path: string;
7846}
7847
7848export interface LfsLockListResponse {
7849 locks?: LfsLock[];
7850 /** @nullable */
7851 next_cursor?: string | null;
7852}
7853
7854export interface LfsVerifyLocksResponse {
7855 /** @nullable */
7856 next_cursor?: string | null;
7857 ours?: LfsLock[];
7858 theirs?: LfsLock[];
7859}
7860
7861export interface LicenseDto {
7862 body: string;
7863 created_at: string;
7864 /** @nullable */
7865 description?: string | null;
7866 display_name: string;
7867 name: string;
7868 updated_at: string;
7869 /** @nullable */
7870 url?: string | null;
7871}
7872
7873export interface LinkIssueCmd {
7874 /** PR 编号或 UUID。 */
7875 pull_ref: string;
7876 repo_name: string;
7877 space_name: string;
7878}
7879
7880export interface ListBoardQuery {
7881 /** @nullable */
7882 dir_id?: string | null;
7883 /**
7884 * @minimum 0
7885 * @nullable
7886 */
7887 limit?: number | null;
7888 /**
7889 * @minimum 0
7890 * @nullable
7891 */
7892 offset?: number | null;
7893 /** @nullable */
7894 q?: string | null;
7895}
7896
7897export type SortOrder = "asc" | "desc";
7898export interface ListCommentQuery {
7899 /**
7900 * @minimum 0
7901 * @nullable
7902 */
7903 limit?: number | null;
7904 /**
7905 * @minimum 0
7906 * @nullable
7907 */
7908 offset?: number | null;
7909 order?: null | SortOrder;
7910 /** @nullable */
7911 parent_id?: string | null;
7912 sort?: null | CommentSort;
7913}
7914
7915export interface ListContentHistoryQuery {
7916 /** @nullable */
7917 comment_id?: string | null;
7918 /**
7919 * @minimum 0
7920 * @nullable
7921 */
7922 limit?: number | null;
7923 /**
7924 * @minimum 0
7925 * @nullable
7926 */
7927 offset?: number | null;
7928}
7929
7930export interface ListEventQuery {
7931 /**
7932 * @minimum 0
7933 * @nullable
7934 */
7935 limit?: number | null;
7936 /**
7937 * @minimum 0
7938 * @nullable
7939 */
7940 offset?: number | null;
7941}
7942
7943export interface ListIssueMemberQuery {
7944 kind?: null | IssueMemberKind;
7945 /**
7946 * @minimum 0
7947 * @nullable
7948 */
7949 limit?: number | null;
7950 /**
7951 * @minimum 0
7952 * @nullable
7953 */
7954 offset?: number | null;
7955}
7956
7957export interface ListIssueQuery {
7958 /**
7959 * One id or a comma-separated id list (`a,b`); matches any of them.
7960 * @nullable
7961 */
7962 assignee_id?: string | null;
7963 /** @nullable */
7964 author_id?: number | null;
7965 /**
7966 * One id or a comma-separated id list (`a,b`); matches any of them.
7967 * @nullable
7968 */
7969 label_id?: string | null;
7970 /**
7971 * @minimum 0
7972 * @nullable
7973 */
7974 limit?: number | null;
7975 /**
7976 * One id or a comma-separated id list (`a,b`); `none` matches issues
7977 * without a milestone. Any of the listed values matches.
7978 * @nullable
7979 */
7980 milestone_id?: string | null;
7981 /**
7982 * @minimum 0
7983 * @nullable
7984 */
7985 offset?: number | null;
7986 order?: null | SortOrder;
7987 /**
7988 * One priority or a comma-separated list (`high,urgent`).
7989 * @nullable
7990 */
7991 priority?: string | null;
7992 /** @nullable */
7993 q?: string | null;
7994 sort?: null | IssueSort;
7995 state?: null | IssueState;
7996}
7997
7998export interface ListIssueUserQuery {
7999 /**
8000 * @minimum 0
8001 * @nullable
8002 */
8003 limit?: number | null;
8004 /**
8005 * @minimum 0
8006 * @nullable
8007 */
8008 offset?: number | null;
8009}
8010
8011export interface ListLabelQuery {
8012 /** @nullable */
8013 is_archived?: boolean | null;
8014 /**
8015 * @minimum 0
8016 * @nullable
8017 */
8018 limit?: number | null;
8019 /**
8020 * @minimum 0
8021 * @nullable
8022 */
8023 offset?: number | null;
8024 /** @nullable */
8025 q?: string | null;
8026}
8027
8028export interface ListLimitQuery {
8029 /**
8030 * @minimum 0
8031 * @nullable
8032 */
8033 limit?: number | null;
8034}
8035
8036export interface ListMessageQuery {
8037 /** @nullable */
8038 after_seq?: number | null;
8039 /** @nullable */
8040 author_id?: number | null;
8041 /** @nullable */
8042 before_seq?: number | null;
8043 /**
8044 * @minimum 0
8045 * @nullable
8046 */
8047 limit?: number | null;
8048 /**
8049 * @minimum 0
8050 * @nullable
8051 */
8052 offset?: number | null;
8053 /** @nullable */
8054 thread_id?: string | null;
8055}
8056
8057export interface ListMilestoneQuery {
8058 /** @nullable */
8059 is_closed?: boolean | null;
8060 /**
8061 * @minimum 0
8062 * @nullable
8063 */
8064 limit?: number | null;
8065 /**
8066 * @minimum 0
8067 * @nullable
8068 */
8069 offset?: number | null;
8070 /** @nullable */
8071 q?: string | null;
8072}
8073
8074export interface ListThreadQuery {
8075 /** @nullable */
8076 archived?: boolean | null;
8077 /**
8078 * @minimum 0
8079 * @nullable
8080 */
8081 limit?: number | null;
8082 /**
8083 * @minimum 0
8084 * @nullable
8085 */
8086 offset?: number | null;
8087}
8088
8089export interface ListTrackedTimeQuery {
8090 /**
8091 * @minimum 0
8092 * @nullable
8093 */
8094 limit?: number | null;
8095 /**
8096 * @minimum 0
8097 * @nullable
8098 */
8099 offset?: number | null;
8100 /** @nullable */
8101 user_id?: number | null;
8102}
8103
8104export interface PowProofRequest {
8105 /** @minimum 0 */
8106 nonce: number;
8107 /** @items.minimum 0 */
8108 payload: number[];
8109}
8110
8111export interface LoginCodeRequest {
8112 email: string;
8113 pow_payload: PowProofRequest;
8114}
8115
8116export interface LoginCodeResponse {
8117 /** @minimum 0 */
8118 expires_in_secs: number;
8119}
8120
8121export interface LoginCodeVerifyRequest {
8122 email: string;
8123 email_code: string;
8124 pow_payload: PowProofRequest;
8125}
8126
8127export interface LoginVerifyRequest {
8128 challenge: string;
8129 code: string;
8130}
8131
8132export interface LogoutResponse {
8133 /** @nullable */
8134 user_id?: number | null;
8135}
8136
8137export interface MarkIssueReadCmd {
8138 read: boolean;
8139}
8140
8141export interface MarkNotificationsReadCmd {
8142 all?: boolean;
8143 /** @nullable */
8144 ids?: string[] | null;
8145}
8146
8147export interface MarkReadCmd {
8148 /** @nullable */
8149 message_id?: string | null;
8150 /** @nullable */
8151 seq?: number | null;
8152}
8153
8154export interface MarkThreadReadCmd {
8155 /** @nullable */
8156 message_id?: string | null;
8157}
8158
8159export interface MarkedCountResp {
8160 /** @minimum 0 */
8161 marked: number;
8162}
8163
8164export interface MeResp {
8165 profile?: null | ProfileDto;
8166 user: UserMeDto;
8167}
8168
8169export interface MeResponse {
8170 /** @nullable */
8171 avatar_url?: string | null;
8172 created_at: string;
8173 /** @nullable */
8174 displayname?: string | null;
8175 email: string;
8176 /** @nullable */
8177 email_verified_at?: string | null;
8178 is_admin: boolean;
8179 user_id: number;
8180 username: string;
8181 version: number;
8182}
8183
8184export interface MemberDto {
8185 /** @nullable */
8186 alias_avatar_url?: string | null;
8187 /** @nullable */
8188 alias_name?: string | null;
8189 created_at: string;
8190 hide_muted_channels: boolean;
8191 /** @nullable */
8192 invited_at?: string | null;
8193 invited_by?: null | UserDto;
8194 joined_at: string;
8195 /** @nullable */
8196 last_active_at?: string | null;
8197 /** @nullable */
8198 left_at?: string | null;
8199 message_notifications: MessageNotifications;
8200 mobile_push: boolean;
8201 /** @nullable */
8202 mute_until?: string | null;
8203 muted: boolean;
8204 space_id: string;
8205 status: MemberStatus;
8206 suppress_everyone: boolean;
8207 suppress_roles: boolean;
8208 /** @nullable */
8209 updated_at?: string | null;
8210 user?: null | UserDto;
8211}
8212
8213export interface MemberListQuery {
8214 /** @nullable */
8215 include_banned?: boolean | null;
8216 /** @nullable */
8217 include_inactive?: boolean | null;
8218 /**
8219 * @minimum 0
8220 * @nullable
8221 */
8222 limit?: number | null;
8223 /**
8224 * @minimum 0
8225 * @nullable
8226 */
8227 offset?: number | null;
8228}
8229
8230export interface MemberSummary {
8231 /** @nullable */
8232 alias_avatar_url?: string | null;
8233 /** @nullable */
8234 alias_name?: string | null;
8235 ban_allow_agent_join: boolean;
8236 ban_allow_comment_any: boolean;
8237 ban_allow_push_repo: boolean;
8238 ban_allow_speak: boolean;
8239 /** @nullable */
8240 ban_expires_at?: string | null;
8241 /** @nullable */
8242 ban_reason?: string | null;
8243 /** @nullable */
8244 banned_at?: string | null;
8245 /** @nullable */
8246 displayname?: string | null;
8247 hide_muted_channels: boolean;
8248 id: string;
8249 /** @nullable */
8250 invited_by?: number | null;
8251 join_method: SpaceJoinMethod;
8252 joined_at: string;
8253 /** @nullable */
8254 last_active_at?: string | null;
8255 /** @nullable */
8256 left_at?: string | null;
8257 message_notifications: MessageNotifications;
8258 mobile_push: boolean;
8259 /** @nullable */
8260 mute_until?: string | null;
8261 muted: boolean;
8262 organization_id: string;
8263 permissions: string[];
8264 role: SpaceMemberRole;
8265 role_keys: string[];
8266 suppress_everyone: boolean;
8267 suppress_roles: boolean;
8268 user_id: number;
8269 username: string;
8270 version: number;
8271}
8272
8273export interface MemeDto {
8274 content_type: string;
8275 created_at: string;
8276 /** @nullable */
8277 height?: number | null;
8278 id: string;
8279 name: string;
8280 size: number;
8281 url: string;
8282 /** @nullable */
8283 width?: number | null;
8284}
8285
8286export interface MergeCommitDto {
8287 author_at: string;
8288 author_email: string;
8289 author_name: string;
8290 message: string;
8291 parents: string[];
8292 sha: string;
8293 subject: string;
8294}
8295
8296export interface MergePullCmd {
8297 /** @nullable */
8298 delete_branch_after_merge?: boolean | null;
8299 /** @nullable */
8300 expect_head_sha?: string | null;
8301 /**
8302 * 允许在无冲突时直接快进(method=merge 时生效)。
8303 * @nullable
8304 */
8305 fast_forward_only?: boolean | null;
8306 /** @nullable */
8307 message?: string | null;
8308 method?: null | MergeMethod;
8309 /** @nullable */
8310 title?: string | null;
8311}
8312
8313export interface MergePullDto {
8314 pull: PullDto;
8315 result: MergeResultDto;
8316 summary: PullSummaryDto;
8317}
8318
8319export interface MergeStatusDto {
8320 conflicts: string[];
8321 fast_forwardable: boolean;
8322 mergeable: boolean;
8323}
8324
8325export interface MessageEditDto {
8326 content: string;
8327 created_at: string;
8328 editor?: null | UserDto;
8329 id: string;
8330 message_id: string;
8331}
8332
8333/**
8334 * 消息页:在统一分页字段之上补回游标翻页所需的派生字段。
8335 *
8336 * `has_more`/`oldest_seq`/`newest_seq` 由本页内容推导,客户端无需自己算;
8337 * `items` 恒按 `seq` 升序,因此 `oldest_seq` 取首条、`newest_seq` 取末条。
8338 */
8339export interface MessagePage {
8340 has_more: boolean;
8341 items: MessageDto[];
8342 /** @minimum 0 */
8343 limit: number;
8344 /** @nullable */
8345 newest_seq?: number | null;
8346 /** @minimum 0 */
8347 offset: number;
8348 /** @nullable */
8349 oldest_seq?: number | null;
8350 /** @minimum 0 */
8351 total: number;
8352}
8353
8354export interface MessagePath {
8355 message_id: string;
8356 room_id: string;
8357}
8358
8359export interface MilestoneDto {
8360 board_id: string;
8361 closed_issues_count: number;
8362 created_at: string;
8363 /** @nullable */
8364 description?: string | null;
8365 /** @nullable */
8366 due_at?: string | null;
8367 id: string;
8368 is_closed: boolean;
8369 issues_count: number;
8370 name: string;
8371 /** @nullable */
8372 updated_at?: string | null;
8373}
8374
8375export interface MilestonePath {
8376 board_id: string;
8377 milestone_id: string;
8378 space_name: string;
8379}
8380
8381export interface MoveDirCmd {
8382 /** @nullable */
8383 parent_dir_id?: string | null;
8384 /** @nullable */
8385 position?: number | null;
8386}
8387
8388export interface MySpaceDto {
8389 permissions: string[];
8390 space: SpaceDto;
8391}
8392
8393export interface NoData {}
8394
8395export interface NotificationDto {
8396 /** @nullable */
8397 actor_id?: number | null;
8398 /** @nullable */
8399 body?: string | null;
8400 created_at: string;
8401 data?: null | Value;
8402 id: string;
8403 notification_type: NotificationType;
8404 /** @nullable */
8405 read_at?: string | null;
8406 title: string;
8407}
8408
8409export interface OpenDmCmd {
8410 /** @nullable */
8411 peer_user_id?: number | null;
8412 /** @nullable */
8413 peer_user_ids?: number[] | null;
8414}
8415
8416export interface OrgListQuery {
8417 /** @nullable */
8418 include_archived?: boolean | null;
8419 /**
8420 * @minimum 0
8421 * @nullable
8422 */
8423 limit?: number | null;
8424 /**
8425 * @minimum 0
8426 * @nullable
8427 */
8428 offset?: number | null;
8429}
8430
8431export interface OrganizationSummary {
8432 allow_invite: boolean;
8433 allow_join: boolean;
8434 allow_join_level: number;
8435 /** @nullable */
8436 archived_at?: string | null;
8437 /** @nullable */
8438 avatar_url?: string | null;
8439 created_at: string;
8440 /** @nullable */
8441 description?: string | null;
8442 id: string;
8443 join_policy: SpaceJoinPolicy;
8444 member_count: number;
8445 member_must_enable_2fa: boolean;
8446 my_role?: null | SpaceMemberRole;
8447 name: string;
8448 owner_user_id: number;
8449 require_email_verified: boolean;
8450 require_mfa: boolean;
8451 slug: string;
8452 status: SpaceStatus;
8453 updated_at: string;
8454 version: number;
8455 /** @nullable */
8456 welcome_message?: string | null;
8457}
8458
8459export interface OutboundWebhookDto {
8460 created_at: string;
8461 disabled: boolean;
8462 id: string;
8463 /** @nullable */
8464 last_status?: string | null;
8465 /** @nullable */
8466 last_used_at?: string | null;
8467 name: string;
8468 room_id: string;
8469 url: string;
8470}
8471
8472export interface OutboundWebhookSecretDto {
8473 created_at: string;
8474 id: string;
8475 name: string;
8476 room_id: string;
8477 secret: string;
8478 url: string;
8479}
8480
8481export interface PackStatsDto {
8482 loose_count: number;
8483 size_bytes: number;
8484}
8485
8486export interface PageQuery {
8487 /**
8488 * @minimum 0
8489 * @nullable
8490 */
8491 limit?: number | null;
8492 /**
8493 * @minimum 0
8494 * @nullable
8495 */
8496 offset?: number | null;
8497}
8498
8499export type PageBookmarkDtoItemsItem = {
8500 created_at: string;
8501 created_by_id: number;
8502 /** @nullable */
8503 emoji?: string | null;
8504 id: string;
8505 position: number;
8506 room_id: string;
8507 title: string;
8508 /** @nullable */
8509 url?: string | null;
8510};
8511
8512export interface PageBookmarkDto {
8513 items: PageBookmarkDtoItemsItem[];
8514 /** @minimum 0 */
8515 limit: number;
8516 /** @minimum 0 */
8517 offset: number;
8518 /** @minimum 0 */
8519 total: number;
8520}
8521
8522export type PageBranchDtoItemsItem = {
8523 commit_sha: string;
8524 created_at: string;
8525 /** @nullable */
8526 deleted_at?: string | null;
8527 is_deleted: boolean;
8528 is_protected: boolean;
8529 name: string;
8530 updated_at: string;
8531};
8532
8533export interface PageBranchDto {
8534 items: PageBranchDtoItemsItem[];
8535 /** @minimum 0 */
8536 limit: number;
8537 /** @minimum 0 */
8538 offset: number;
8539 /** @minimum 0 */
8540 total: number;
8541}
8542
8543export type PageBranchInfoDtoItemsItem = {
8544 /** @nullable */
8545 commit_message?: string | null;
8546 commit_sha: string;
8547 is_protected: boolean;
8548 name: string;
8549};
8550
8551export interface PageBranchInfoDto {
8552 items: PageBranchInfoDtoItemsItem[];
8553 /** @minimum 0 */
8554 limit: number;
8555 /** @minimum 0 */
8556 offset: number;
8557 /** @minimum 0 */
8558 total: number;
8559}
8560
8561export type PageDmDtoItemsItem = {
8562 created_at: string;
8563 id: string;
8564 kind: RoomKind;
8565 /** @nullable */
8566 last_message_id?: string | null;
8567 last_read_seq: number;
8568 members?: UserDto[];
8569 name: string;
8570 peer?: null | UserDto;
8571 tip_seq: number;
8572 unread_count: number;
8573};
8574
8575export interface PageDmDto {
8576 items: PageDmDtoItemsItem[];
8577 /** @minimum 0 */
8578 limit: number;
8579 /** @minimum 0 */
8580 offset: number;
8581 /** @minimum 0 */
8582 total: number;
8583}
8584
8585export type PageDraftDtoItemsItem = {
8586 content: string;
8587 room_id: string;
8588 /** @nullable */
8589 thread_id?: string | null;
8590 updated_at: string;
8591};
8592
8593export interface PageDraftDto {
8594 items: PageDraftDtoItemsItem[];
8595 /** @minimum 0 */
8596 limit: number;
8597 /** @minimum 0 */
8598 offset: number;
8599 /** @minimum 0 */
8600 total: number;
8601}
8602
8603export type PageEmojiDtoItemsItem = {
8604 animated: boolean;
8605 created_at: string;
8606 disabled: boolean;
8607 id: string;
8608 name: string;
8609 space_id: string;
8610};
8611
8612export interface PageEmojiDto {
8613 items: PageEmojiDtoItemsItem[];
8614 /** @minimum 0 */
8615 limit: number;
8616 /** @minimum 0 */
8617 offset: number;
8618 /** @minimum 0 */
8619 total: number;
8620}
8621
8622export type PageInviteSummaryItemsItem = {
8623 created_at: string;
8624 created_by: number;
8625 /** @nullable */
8626 email?: string | null;
8627 /** @nullable */
8628 expires_at?: string | null;
8629 id: string;
8630 max_uses: number;
8631 method: SpaceJoinMethod;
8632 organization_id: string;
8633 /** @nullable */
8634 revoked_at?: string | null;
8635 /** @nullable */
8636 role_id?: string | null;
8637 /** @nullable */
8638 target_user_id?: number | null;
8639 uses: number;
8640};
8641
8642export interface PageInviteSummary {
8643 items: PageInviteSummaryItemsItem[];
8644 /** @minimum 0 */
8645 limit: number;
8646 /** @minimum 0 */
8647 offset: number;
8648 /** @minimum 0 */
8649 total: number;
8650}
8651
8652export type PageIssueListItemDtoItemsItem = {
8653 assignees: UserDto[];
8654 author?: null | UserDto;
8655 board_id: string;
8656 /** @nullable */
8657 closed_at?: string | null;
8658 created_at: string;
8659 /** @nullable */
8660 due_at?: string | null;
8661 id: string;
8662 /** Chips the list rows render; the detail view fetches these separately. */
8663 labels: LabelDto[];
8664 /** @nullable */
8665 milestone_id?: string | null;
8666 number: number;
8667 priority: IssuePriority;
8668 state: IssueState;
8669 title: string;
8670 /** @nullable */
8671 updated_at?: string | null;
8672};
8673
8674export interface PageIssueListItemDto {
8675 items: PageIssueListItemDtoItemsItem[];
8676 /** @minimum 0 */
8677 limit: number;
8678 /** @minimum 0 */
8679 offset: number;
8680 /** @minimum 0 */
8681 total: number;
8682}
8683
8684export type PageLicenseDtoItemsItem = {
8685 body: string;
8686 created_at: string;
8687 /** @nullable */
8688 description?: string | null;
8689 display_name: string;
8690 name: string;
8691 updated_at: string;
8692 /** @nullable */
8693 url?: string | null;
8694};
8695
8696export interface PageLicenseDto {
8697 items: PageLicenseDtoItemsItem[];
8698 /** @minimum 0 */
8699 limit: number;
8700 /** @minimum 0 */
8701 offset: number;
8702 /** @minimum 0 */
8703 total: number;
8704}
8705
8706export type PageMemberSummaryItemsItem = {
8707 /** @nullable */
8708 alias_avatar_url?: string | null;
8709 /** @nullable */
8710 alias_name?: string | null;
8711 ban_allow_agent_join: boolean;
8712 ban_allow_comment_any: boolean;
8713 ban_allow_push_repo: boolean;
8714 ban_allow_speak: boolean;
8715 /** @nullable */
8716 ban_expires_at?: string | null;
8717 /** @nullable */
8718 ban_reason?: string | null;
8719 /** @nullable */
8720 banned_at?: string | null;
8721 /** @nullable */
8722 displayname?: string | null;
8723 hide_muted_channels: boolean;
8724 id: string;
8725 /** @nullable */
8726 invited_by?: number | null;
8727 join_method: SpaceJoinMethod;
8728 joined_at: string;
8729 /** @nullable */
8730 last_active_at?: string | null;
8731 /** @nullable */
8732 left_at?: string | null;
8733 message_notifications: MessageNotifications;
8734 mobile_push: boolean;
8735 /** @nullable */
8736 mute_until?: string | null;
8737 muted: boolean;
8738 organization_id: string;
8739 permissions: string[];
8740 role: SpaceMemberRole;
8741 role_keys: string[];
8742 suppress_everyone: boolean;
8743 suppress_roles: boolean;
8744 user_id: number;
8745 username: string;
8746 version: number;
8747};
8748
8749export interface PageMemberSummary {
8750 items: PageMemberSummaryItemsItem[];
8751 /** @minimum 0 */
8752 limit: number;
8753 /** @minimum 0 */
8754 offset: number;
8755 /** @minimum 0 */
8756 total: number;
8757}
8758
8759export type PageMessageDtoItemsItem = {
8760 attachments: AttachmentDto[];
8761 author?: null | UserDto;
8762 author_id: number;
8763 author_type: AuthorType;
8764 content: string;
8765 created_at: string;
8766 /** @nullable */
8767 deleted_at?: string | null;
8768 /** @nullable */
8769 edited_at?: string | null;
8770 embeds?: MessageEmbed[];
8771 /** @nullable */
8772 forwarded_from_id?: string | null;
8773 has_thread: boolean;
8774 id: string;
8775 mention_everyone: boolean;
8776 mentions: number[];
8777 message_type: ChatMessageType;
8778 pinned: boolean;
8779 /** @nullable */
8780 pinned_at?: string | null;
8781 /** @nullable */
8782 pinned_by_id?: number | null;
8783 reactions?: ReactionAggDto[];
8784 /** @nullable */
8785 reply_to_id?: string | null;
8786 room_id: string;
8787 seq: number;
8788 thread_broadcast: boolean;
8789 /** @nullable */
8790 thread_id?: string | null;
8791 /** @nullable */
8792 webhook_id?: string | null;
8793};
8794
8795export interface PageMessageDto {
8796 items: PageMessageDtoItemsItem[];
8797 /** @minimum 0 */
8798 limit: number;
8799 /** @minimum 0 */
8800 offset: number;
8801 /** @minimum 0 */
8802 total: number;
8803}
8804
8805export type PageMySpaceDtoItemsItem = {
8806 permissions: string[];
8807 space: SpaceDto;
8808};
8809
8810export interface PageMySpaceDto {
8811 items: PageMySpaceDtoItemsItem[];
8812 /** @minimum 0 */
8813 limit: number;
8814 /** @minimum 0 */
8815 offset: number;
8816 /** @minimum 0 */
8817 total: number;
8818}
8819
8820export type PageNotificationDtoItemsItem = {
8821 /** @nullable */
8822 actor_id?: number | null;
8823 /** @nullable */
8824 body?: string | null;
8825 created_at: string;
8826 data?: null | Value;
8827 id: string;
8828 notification_type: NotificationType;
8829 /** @nullable */
8830 read_at?: string | null;
8831 title: string;
8832};
8833
8834export interface PageNotificationDto {
8835 items: PageNotificationDtoItemsItem[];
8836 /** @minimum 0 */
8837 limit: number;
8838 /** @minimum 0 */
8839 offset: number;
8840 /** @minimum 0 */
8841 total: number;
8842}
8843
8844export type PageOrganizationSummaryItemsItem = {
8845 allow_invite: boolean;
8846 allow_join: boolean;
8847 allow_join_level: number;
8848 /** @nullable */
8849 archived_at?: string | null;
8850 /** @nullable */
8851 avatar_url?: string | null;
8852 created_at: string;
8853 /** @nullable */
8854 description?: string | null;
8855 id: string;
8856 join_policy: SpaceJoinPolicy;
8857 member_count: number;
8858 member_must_enable_2fa: boolean;
8859 my_role?: null | SpaceMemberRole;
8860 name: string;
8861 owner_user_id: number;
8862 require_email_verified: boolean;
8863 require_mfa: boolean;
8864 slug: string;
8865 status: SpaceStatus;
8866 updated_at: string;
8867 version: number;
8868 /** @nullable */
8869 welcome_message?: string | null;
8870};
8871
8872export interface PageOrganizationSummary {
8873 items: PageOrganizationSummaryItemsItem[];
8874 /** @minimum 0 */
8875 limit: number;
8876 /** @minimum 0 */
8877 offset: number;
8878 /** @minimum 0 */
8879 total: number;
8880}
8881
8882export type PagePullCommentDtoItemsItem = {
8883 author?: null | UserDto;
8884 body: string;
8885 /** @nullable */
8886 commit_sha?: string | null;
8887 created_at: string;
8888 id: string;
8889 /** @nullable */
8890 line?: number | null;
8891 /** @nullable */
8892 parent_comment_id?: string | null;
8893 /** @nullable */
8894 path?: string | null;
8895 pull_request_id: string;
8896 resolved: boolean;
8897 /** @nullable */
8898 resolved_by?: number | null;
8899 /** @nullable */
8900 review_id?: string | null;
8901 /** @nullable */
8902 side?: string | null;
8903 /** @nullable */
8904 updated_at?: string | null;
8905};
8906
8907export interface PagePullCommentDto {
8908 items: PagePullCommentDtoItemsItem[];
8909 /** @minimum 0 */
8910 limit: number;
8911 /** @minimum 0 */
8912 offset: number;
8913 /** @minimum 0 */
8914 total: number;
8915}
8916
8917export type PagePullDtoItemsItem = {
8918 additions: number;
8919 author?: null | UserDto;
8920 auto_merge: boolean;
8921 base: PullRefDto;
8922 body: string;
8923 /** @nullable */
8924 closed_at?: string | null;
8925 /** @nullable */
8926 commits_ahead?: number | null;
8927 /** @nullable */
8928 commits_behind?: number | null;
8929 /** @nullable */
8930 conflicts?: string[] | null;
8931 created_at: string;
8932 deletions: number;
8933 files_changed: number;
8934 head: PullRefDto;
8935 id: string;
8936 is_draft: boolean;
8937 /** @nullable */
8938 issue_id?: string | null;
8939 locked: boolean;
8940 merge_method: MergeMethod;
8941 /** @nullable */
8942 mergeable?: boolean | null;
8943 /** @nullable */
8944 mergeable_state?: string | null;
8945 /** @nullable */
8946 merged_at?: string | null;
8947 /** @nullable */
8948 merged_commit_sha?: string | null;
8949 merger?: null | UserDto;
8950 number: number;
8951 repo_id: string;
8952 /** @nullable */
8953 squash_commit_sha?: string | null;
8954 state: PullState;
8955 title: string;
8956 /** @nullable */
8957 updated_at?: string | null;
8958};
8959
8960export interface PagePullDto {
8961 items: PagePullDtoItemsItem[];
8962 /** @minimum 0 */
8963 limit: number;
8964 /** @minimum 0 */
8965 offset: number;
8966 /** @minimum 0 */
8967 total: number;
8968}
8969
8970export type PagePullEventDtoItemsItem = {
8971 actor?: null | UserDto;
8972 /** @nullable */
8973 commit_sha?: string | null;
8974 /** @nullable */
8975 content?: string | null;
8976 created_at: string;
8977 event_type: string;
8978 id: string;
8979 pull_request_id: string;
8980};
8981
8982export interface PagePullEventDto {
8983 items: PagePullEventDtoItemsItem[];
8984 /** @minimum 0 */
8985 limit: number;
8986 /** @minimum 0 */
8987 offset: number;
8988 /** @minimum 0 */
8989 total: number;
8990}
8991
8992export type PagePushSubscriptionDtoItemsItem = {
8993 created_at: string;
8994 endpoint: string;
8995 id: string;
8996 platform: PushSubscriptionPlatform;
8997 /** @nullable */
8998 updated_at?: string | null;
8999 /** @nullable */
9000 user_agent?: string | null;
9001};
9002
9003export interface PagePushSubscriptionDto {
9004 items: PagePushSubscriptionDtoItemsItem[];
9005 /** @minimum 0 */
9006 limit: number;
9007 /** @minimum 0 */
9008 offset: number;
9009 /** @minimum 0 */
9010 total: number;
9011}
9012
9013export type PageRepoSummaryDtoItemsItem = {
9014 /** @nullable */
9015 avatar_url?: string | null;
9016 default_branch: string;
9017 /** @nullable */
9018 description?: string | null;
9019 id: string;
9020 is_archived: boolean;
9021 is_private: boolean;
9022 /** @nullable */
9023 license_name?: string | null;
9024 name: string;
9025 /** @nullable */
9026 primary_language?: string | null;
9027 size: number;
9028 stars_count: number;
9029 updated_at: string;
9030 watchers_count: number;
9031};
9032
9033export interface PageRepoSummaryDto {
9034 items: PageRepoSummaryDtoItemsItem[];
9035 /** @minimum 0 */
9036 limit: number;
9037 /** @minimum 0 */
9038 offset: number;
9039 /** @minimum 0 */
9040 total: number;
9041}
9042
9043export type PageRoomBriefDtoItemsItem = {
9044 created_at: string;
9045 /** @nullable */
9046 dir_id?: string | null;
9047 favorite: boolean;
9048 hidden: boolean;
9049 id: string;
9050 is_private: boolean;
9051 kind: RoomKind;
9052 /** @nullable */
9053 last_message_id?: string | null;
9054 member_count: number;
9055 muted: boolean;
9056 name: string;
9057 nsfw: boolean;
9058 owner?: null | UserDto;
9059 owner_id: number;
9060 /** @nullable */
9061 parent_id?: string | null;
9062 position: number;
9063 /** @nullable */
9064 rate_limit_per_user?: number | null;
9065 /** @nullable */
9066 space_id?: string | null;
9067 /** @nullable */
9068 topic?: string | null;
9069 unread_count: number;
9070 unread_mentions: number;
9071};
9072
9073export interface PageRoomBriefDto {
9074 items: PageRoomBriefDtoItemsItem[];
9075 /** @minimum 0 */
9076 limit: number;
9077 /** @minimum 0 */
9078 offset: number;
9079 /** @minimum 0 */
9080 total: number;
9081}
9082
9083export type PageSavedMessageDtoItemsItem = {
9084 channel_id: string;
9085 id: string;
9086 message_id: string;
9087 saved_at: string;
9088};
9089
9090export interface PageSavedMessageDto {
9091 items: PageSavedMessageDtoItemsItem[];
9092 /** @minimum 0 */
9093 limit: number;
9094 /** @minimum 0 */
9095 offset: number;
9096 /** @minimum 0 */
9097 total: number;
9098}
9099
9100export type PageSessionDtoItemsItem = {
9101 /** @nullable */
9102 client_ip_hash?: string | null;
9103 created_at: string;
9104 /** @nullable */
9105 device_id?: string | null;
9106 expires_at: string;
9107 id: string;
9108 is_current: boolean;
9109 is_revoked: boolean;
9110 kind: SessionKind;
9111 last_seen_at: string;
9112 /** @nullable */
9113 revoked_at?: string | null;
9114 /** @nullable */
9115 user_agent_hash?: string | null;
9116};
9117
9118export interface PageSessionDto {
9119 items: PageSessionDtoItemsItem[];
9120 /** @minimum 0 */
9121 limit: number;
9122 /** @minimum 0 */
9123 offset: number;
9124 /** @minimum 0 */
9125 total: number;
9126}
9127
9128export type PageSpaceDtoItemsItem = {
9129 allow_invite: boolean;
9130 allow_join: boolean;
9131 allow_join_level: AllowJoinLevel;
9132 /** @nullable */
9133 avatar_url?: string | null;
9134 created_at: string;
9135 /** @nullable */
9136 description?: string | null;
9137 id: string;
9138 is_active: boolean;
9139 is_private: boolean;
9140 lower_name: string;
9141 member_must_enable_2fa: boolean;
9142 members_count: number;
9143 name: string;
9144 owner?: null | UserDto;
9145 updated_at: string;
9146 /** @nullable */
9147 welcome_message?: string | null;
9148 /** @nullable */
9149 welcome_object?: string | null;
9150};
9151
9152export interface PageSpaceDto {
9153 items: PageSpaceDtoItemsItem[];
9154 /** @minimum 0 */
9155 limit: number;
9156 /** @minimum 0 */
9157 offset: number;
9158 /** @minimum 0 */
9159 total: number;
9160}
9161
9162export type PageSshKeySummaryItemsItem = {
9163 algorithm: SshKeyAlgorithm;
9164 created_at: string;
9165 /** @nullable */
9166 description?: string | null;
9167 /** @nullable */
9168 expires_at?: string | null;
9169 fingerprint: string;
9170 id: string;
9171 /** @nullable */
9172 last_used_at?: string | null;
9173 name: string;
9174 public_key: string;
9175 /** @nullable */
9176 revoked_at?: string | null;
9177};
9178
9179export interface PageSshKeySummary {
9180 items: PageSshKeySummaryItemsItem[];
9181 /** @minimum 0 */
9182 limit: number;
9183 /** @minimum 0 */
9184 offset: number;
9185 /** @minimum 0 */
9186 total: number;
9187}
9188
9189export type PageStargazerDtoItemsItem = {
9190 avatar_url: string;
9191 display_name: string;
9192 starred_at: string;
9193 user_id: number;
9194 username: string;
9195};
9196
9197export interface PageStargazerDto {
9198 items: PageStargazerDtoItemsItem[];
9199 /** @minimum 0 */
9200 limit: number;
9201 /** @minimum 0 */
9202 offset: number;
9203 /** @minimum 0 */
9204 total: number;
9205}
9206
9207export type PageTagDtoItemsItem = {
9208 /** @nullable */
9209 created_at?: string | null;
9210 /** @nullable */
9211 message?: string | null;
9212 name: string;
9213 tag_type: TagType;
9214 /** @nullable */
9215 tagger_email?: string | null;
9216 /** @nullable */
9217 tagger_name?: string | null;
9218 target_sha: string;
9219};
9220
9221export interface PageTagDto {
9222 items: PageTagDtoItemsItem[];
9223 /** @minimum 0 */
9224 limit: number;
9225 /** @minimum 0 */
9226 offset: number;
9227 /** @minimum 0 */
9228 total: number;
9229}
9230
9231export type PageThreadDtoItemsItem = {
9232 archived: boolean;
9233 created_at: string;
9234 id: string;
9235 /** @nullable */
9236 last_reply_at?: string | null;
9237 /** @nullable */
9238 last_reply_id?: string | null;
9239 locked: boolean;
9240 /** @nullable */
9241 name?: string | null;
9242 owner?: null | UserDto;
9243 owner_id: number;
9244 participant_count: number;
9245 reply_count: number;
9246 room_id: string;
9247 root_message_id: string;
9248 updated_at: string;
9249};
9250
9251export interface PageThreadDto {
9252 items: PageThreadDtoItemsItem[];
9253 /** @minimum 0 */
9254 limit: number;
9255 /** @minimum 0 */
9256 offset: number;
9257 /** @minimum 0 */
9258 total: number;
9259}
9260
9261export type PageTopicDtoItemsItem = {
9262 created_at: string;
9263 id: string;
9264 name: string;
9265 updated_at: string;
9266};
9267
9268export interface PageTopicDto {
9269 items: PageTopicDtoItemsItem[];
9270 /** @minimum 0 */
9271 limit: number;
9272 /** @minimum 0 */
9273 offset: number;
9274 /** @minimum 0 */
9275 total: number;
9276}
9277
9278export type PageTopicRepoDtoItemsItem = {
9279 is_private: boolean;
9280 repo_id: string;
9281 repo_name: string;
9282 space_name: string;
9283};
9284
9285export interface PageTopicRepoDto {
9286 items: PageTopicRepoDtoItemsItem[];
9287 /** @minimum 0 */
9288 limit: number;
9289 /** @minimum 0 */
9290 offset: number;
9291 /** @minimum 0 */
9292 total: number;
9293}
9294
9295export type PageUserReportDtoItemsItem = {
9296 created_at: string;
9297 /** @nullable */
9298 evidence?: string | null;
9299 id: string;
9300 reason: string;
9301 reported_id: number;
9302 /** @nullable */
9303 resolution_note?: string | null;
9304 status: ReportStatus;
9305 updated_at: string;
9306};
9307
9308export interface PageUserReportDto {
9309 items: PageUserReportDtoItemsItem[];
9310 /** @minimum 0 */
9311 limit: number;
9312 /** @minimum 0 */
9313 offset: number;
9314 /** @minimum 0 */
9315 total: number;
9316}
9317
9318export type PageWatcherDtoItemsItem = {
9319 avatar_url: string;
9320 display_name: string;
9321 mode: WatchMode;
9322 user_id: number;
9323 username: string;
9324 watching_since: string;
9325};
9326
9327export interface PageWatcherDto {
9328 items: PageWatcherDtoItemsItem[];
9329 /** @minimum 0 */
9330 limit: number;
9331 /** @minimum 0 */
9332 offset: number;
9333 /** @minimum 0 */
9334 total: number;
9335}
9336
9337export type PageWebhookDtoItemsItem = {
9338 created_at: string;
9339 disabled: boolean;
9340 id: string;
9341 /** @nullable */
9342 last_used_at?: string | null;
9343 name: string;
9344 room_id: string;
9345};
9346
9347export interface PageWebhookDto {
9348 items: PageWebhookDtoItemsItem[];
9349 /** @minimum 0 */
9350 limit: number;
9351 /** @minimum 0 */
9352 offset: number;
9353 /** @minimum 0 */
9354 total: number;
9355}
9356
9357export interface ParsedPatchDto {
9358 additions: number;
9359 deletions: number;
9360 files: string[];
9361}
9362
9363export interface PasswordResetConfirmRequest {
9364 password_hash: string;
9365 pow_payload: PowProofRequest;
9366 token: string;
9367}
9368
9369export interface PasswordResetConfirmResponse {
9370 user_id: number;
9371}
9372
9373export interface PasswordResetRequest {
9374 email: string;
9375 pow_payload: PowProofRequest;
9376}
9377
9378export interface PasswordResetResponse {
9379 /** @minimum 0 */
9380 expires_in_secs: number;
9381}
9382
9383export interface PatchApplyBody {
9384 base: string;
9385 patch: string;
9386}
9387
9388export interface PatchDto {
9389 content: string;
9390 size: number;
9391}
9392
9393export interface PathLastUpdated {
9394 commit_id: string;
9395 last_updated: number;
9396 object_type: number;
9397 path: string;
9398}
9399
9400export interface PathLogEntryDto {
9401 author: string;
9402 date: string;
9403 path: string;
9404 short_sha: string;
9405 subject: string;
9406}
9407
9408export interface PermissionCheck {
9409 allowed: boolean;
9410 matched_by: string;
9411 organization_version: number;
9412 reason: string;
9413}
9414
9415export interface PinCmd {
9416 pinned: boolean;
9417}
9418
9419export interface PinDto {
9420 board_id: string;
9421 created_at: string;
9422 id: string;
9423 /** @nullable */
9424 issue_id?: string | null;
9425 pin_order: number;
9426}
9427
9428export interface PinPath {
9429 board_id: string;
9430 pin_id: string;
9431 space_name: string;
9432}
9433
9434export interface PresenceDto {
9435 activities: unknown;
9436 /** @nullable */
9437 last_seen_at?: string | null;
9438 online: boolean;
9439 status: PresenceStatus;
9440 user?: null | UserDto;
9441 user_id: number;
9442}
9443
9444export interface ProfileDetailDto {
9445 /** @nullable */
9446 accent_color?: string | null;
9447 avatar_url: string;
9448 /** @nullable */
9449 banner_url?: string | null;
9450 /** @nullable */
9451 bio?: string | null;
9452 /** @nullable */
9453 company?: string | null;
9454 display_name: string;
9455 /** @nullable */
9456 location?: string | null;
9457 /** @nullable */
9458 pronouns?: string | null;
9459 /** @nullable */
9460 real_name?: string | null;
9461 /** @nullable */
9462 show_activity?: boolean | null;
9463 /** @nullable */
9464 show_email?: boolean | null;
9465 /** @nullable */
9466 show_location?: boolean | null;
9467 /** @nullable */
9468 show_real_name?: boolean | null;
9469 updated_at: string;
9470 user_id: number;
9471 username: string;
9472 visibility?: null | ProfileVisibility;
9473 /** @nullable */
9474 website?: string | null;
9475}
9476
9477export interface PruneResultDto {
9478 reachable: number;
9479 total: number;
9480 unreachable: number;
9481}
9482
9483export interface PullAssigneeDto {
9484 created_at: string;
9485 id: string;
9486 user?: null | UserDto;
9487}
9488
9489export interface PullChecksDto {
9490 head_sha: string;
9491 statuses: CommitStatusDto[];
9492}
9493
9494/**
9495 * 线程视图:顶层评论 + 其下全部回复(无递归,便于文档生成)。
9496 */
9497export interface PullCommentThreadDto {
9498 replies: PullCommentDto[];
9499 root: PullCommentDto;
9500}
9501
9502export interface PullEventDto {
9503 actor?: null | UserDto;
9504 /** @nullable */
9505 commit_sha?: string | null;
9506 /** @nullable */
9507 content?: string | null;
9508 created_at: string;
9509 event_type: string;
9510 id: string;
9511 pull_request_id: string;
9512}
9513
9514export interface PullGateDto {
9515 conflicts: string[];
9516 gate: MergeGateDto;
9517 head_sha: string;
9518 mergeable: boolean;
9519 pending_review_requests: number;
9520}
9521
9522export interface PullReviewDto {
9523 /** @minimum 0 */
9524 comment_count: number;
9525 commit_sha: string;
9526 /** @nullable */
9527 content?: string | null;
9528 created_at: string;
9529 id: string;
9530 official: boolean;
9531 pull_request_id: string;
9532 state: ReviewState;
9533 /** @nullable */
9534 updated_at?: string | null;
9535 user?: null | UserDto;
9536}
9537
9538export interface PullReviewerDto {
9539 created_at: string;
9540 id: string;
9541 requested_by?: null | UserDto;
9542 required: boolean;
9543 /** @nullable */
9544 review_id?: string | null;
9545 state: ReviewerState;
9546 /** @nullable */
9547 updated_at?: string | null;
9548 user?: null | UserDto;
9549}
9550
9551export type PullSort = "number" | "created" | "updated";
9552/**
9553 * 前端注册 Service Worker 所需的公开参数。
9554 *
9555 * 只有公钥是公开的(它就是浏览器 `applicationServerKey` 要的东西),私钥永远
9556 * 不出现在任何响应里。`enabled=false` 时前端把整个"系统通知"开关藏起来,
9557 * 而不是让用户点了才发现服务端没开。
9558 */
9559export interface PushConfigDto {
9560 enabled: boolean;
9561 public_key: string;
9562}
9563
9564export interface PushResultDto {
9565 pushed: string[];
9566 rejected: string[];
9567}
9568
9569export interface PushSubscriptionDto {
9570 created_at: string;
9571 endpoint: string;
9572 id: string;
9573 platform: PushSubscriptionPlatform;
9574 /** @nullable */
9575 updated_at?: string | null;
9576 /** @nullable */
9577 user_agent?: string | null;
9578}
9579
9580export interface RawDownloadDto {
9581 id: string;
9582 is_lfs_pointer: boolean;
9583 size: number;
9584}
9585
9586export interface ReactionCmd {
9587 emoji: string;
9588}
9589
9590export interface ReactionDto {
9591 created_at: string;
9592 emoji: string;
9593 id: string;
9594 scope: ReactionScope;
9595 target_id: string;
9596 user?: null | UserDto;
9597}
9598
9599export interface ReactionPath {
9600 board_id: string;
9601 issue_id: string;
9602 reaction_id: string;
9603 space_name: string;
9604}
9605
9606export interface ReactionUserDto {
9607 created_at: string;
9608 emoji: string;
9609 user: UserDto;
9610}
9611
9612export interface ReasonBody {
9613 /** @nullable */
9614 reason?: string | null;
9615}
9616
9617export interface RecentMentionDto {
9618 channel_id: string;
9619 created_at: string;
9620 id: string;
9621 message_id: string;
9622}
9623
9624export interface RecoveryCodesResp {
9625 codes: string[];
9626 /** @minimum 0 */
9627 total: number;
9628 /** @minimum 0 */
9629 used: number;
9630}
9631
9632export interface RedeemInviteBody {
9633 token: string;
9634}
9635
9636export interface RedeemInviteResponse {
9637 joined: boolean;
9638 member_id: string;
9639 organization_id: string;
9640}
9641
9642export interface RegenerateRecoveryCodesCmd {
9643 password: string;
9644}
9645
9646export interface RegisterCodeRequest {
9647 email: string;
9648 pow_payload: PowProofRequest;
9649}
9650
9651export interface RegisterCodeResponse {
9652 /** @minimum 0 */
9653 expires_in_secs: number;
9654}
9655
9656export interface ReleaseDto {
9657 /** @nullable */
9658 content?: string | null;
9659 created_at: string;
9660 id: string;
9661 is_draft: boolean;
9662 is_prerelease: boolean;
9663 num_commits: number;
9664 publisher?: null | UserDto;
9665 publisher_name: string;
9666 repo_id: string;
9667 sha: string;
9668 tag_name: string;
9669 target: string;
9670 title: string;
9671 updated_at: string;
9672}
9673
9674export interface ReminderDto {
9675 created_at: string;
9676 id: string;
9677 message_id: string;
9678 /** @nullable */
9679 message_preview?: string | null;
9680 /** @nullable */
9681 note?: string | null;
9682 remind_at: string;
9683 room_id: string;
9684 status: ReminderStatus;
9685}
9686
9687export interface RemoteAddBody {
9688 url: string;
9689}
9690
9691export interface RemoteAuthDto {
9692 /** @nullable */
9693 token?: string | null;
9694 /** @nullable */
9695 username?: string | null;
9696}
9697
9698export interface RemoteDto {
9699 /** @nullable */
9700 fetch_url?: string | null;
9701 name: string;
9702 /** @nullable */
9703 push_url?: string | null;
9704}
9705
9706export interface RemoteFetchBody {
9707 auth?: null | RemoteAuthDto;
9708 remote: string;
9709}
9710
9711export interface RemoteImportBody {
9712 auth?: null | RemoteAuthDto;
9713 url: string;
9714}
9715
9716export interface RemotePushBody {
9717 auth?: null | RemoteAuthDto;
9718 /** @nullable */
9719 refspec?: string | null;
9720 remote: string;
9721}
9722
9723export interface RenameBranchCmd {
9724 new_name: string;
9725}
9726
9727export interface RepairDirResp {
9728 fixed: number;
9729 scanned: number;
9730}
9731
9732export interface RepoDto {
9733 /** 是否允许在本仓库创建合并请求(关闭后页签隐藏、接口拒绝)。 */
9734 allow_pull_requests: boolean;
9735 /** @nullable */
9736 archived_at?: string | null;
9737 /** @nullable */
9738 avatar_url?: string | null;
9739 branches_count: number;
9740 commits_count: number;
9741 created_at: string;
9742 default_branch: string;
9743 /** @nullable */
9744 description?: string | null;
9745 enable_lfs: boolean;
9746 git_size: number;
9747 /** @nullable */
9748 http_clone_url?: string | null;
9749 id: string;
9750 is_archived: boolean;
9751 is_private: boolean;
9752 /** @nullable */
9753 last_pushed_at?: string | null;
9754 lfs_size: number;
9755 /** @nullable */
9756 license_name?: string | null;
9757 me?: null | RepoMeDto;
9758 name: string;
9759 object_format: string;
9760 /** @nullable */
9761 primary_language?: string | null;
9762 pulls_count: number;
9763 size: number;
9764 /** @nullable */
9765 ssh_clone_url?: string | null;
9766 stars_count: number;
9767 /** @nullable */
9768 storage_limit_size?: number | null;
9769 /** 中间页签顺序;空数组 = 默认顺序。 */
9770 tab_order: string[];
9771 tags_count: number;
9772 updated_at: string;
9773 watchers_count: number;
9774 /** @nullable */
9775 website?: string | null;
9776}
9777
9778export interface RepoRelDto {
9779 created_at: string;
9780 id: string;
9781 issue_id: string;
9782 repo_id: string;
9783}
9784
9785export interface RepoRelPath {
9786 board_id: string;
9787 issue_id: string;
9788 rel_id: string;
9789 space_name: string;
9790}
9791
9792export type RepoSort = "created_at" | "updated_at" | "stars" | "name";
9793export interface RepoStarDto {
9794 created_at: string;
9795 repo_id: string;
9796 user_id: number;
9797}
9798
9799export interface RepoStarResp {
9800 stars: number;
9801}
9802
9803export interface RepoSummaryDto {
9804 /** @nullable */
9805 avatar_url?: string | null;
9806 default_branch: string;
9807 /** @nullable */
9808 description?: string | null;
9809 id: string;
9810 is_archived: boolean;
9811 is_private: boolean;
9812 /** @nullable */
9813 license_name?: string | null;
9814 name: string;
9815 /** @nullable */
9816 primary_language?: string | null;
9817 size: number;
9818 stars_count: number;
9819 updated_at: string;
9820 watchers_count: number;
9821}
9822
9823export interface RepoWatchDto {
9824 created_at: string;
9825 mode: WatchMode;
9826 repo_id: string;
9827 updated_at: string;
9828 user_id: number;
9829}
9830
9831export interface ReportDto {
9832 created_at: string;
9833 /** @nullable */
9834 evidence?: string | null;
9835 id: string;
9836 reason: string;
9837 reported_id: number;
9838 status: ReportStatus;
9839}
9840
9841export interface RequestReviewersCmd {
9842 /** 是否计入必需审批人数。 */
9843 required?: boolean;
9844 /** 用户名或 UUID。 */
9845 reviewers: string[];
9846}
9847
9848export type ReviewIntent =
9849 "approve" | "request_changes" | "comment" | "pending";
9850export interface RoleSummary {
9851 /** @nullable */
9852 color?: string | null;
9853 created_at: string;
9854 default_role: boolean;
9855 /** @nullable */
9856 description?: string | null;
9857 /** @nullable */
9858 emoji?: string | null;
9859 /** @nullable */
9860 icon_hash?: string | null;
9861 id: string;
9862 key: string;
9863 member_count: number;
9864 name: string;
9865 organization_id: string;
9866 permissions: PermissionGrant[];
9867 position: number;
9868 rank: number;
9869 self_assignable: boolean;
9870 system: boolean;
9871 updated_at: string;
9872 version: number;
9873}
9874
9875export interface RoomBriefDto {
9876 created_at: string;
9877 /** @nullable */
9878 dir_id?: string | null;
9879 favorite: boolean;
9880 hidden: boolean;
9881 id: string;
9882 is_private: boolean;
9883 kind: RoomKind;
9884 /** @nullable */
9885 last_message_id?: string | null;
9886 member_count: number;
9887 muted: boolean;
9888 name: string;
9889 nsfw: boolean;
9890 owner?: null | UserDto;
9891 owner_id: number;
9892 /** @nullable */
9893 parent_id?: string | null;
9894 position: number;
9895 /** @nullable */
9896 rate_limit_per_user?: number | null;
9897 /** @nullable */
9898 space_id?: string | null;
9899 /** @nullable */
9900 topic?: string | null;
9901 unread_count: number;
9902 unread_mentions: number;
9903}
9904
9905export interface RoomDto {
9906 created_at: string;
9907 /** @nullable */
9908 dir_id?: string | null;
9909 id: string;
9910 is_active: boolean;
9911 is_private: boolean;
9912 kind: RoomKind;
9913 name: string;
9914 nsfw: boolean;
9915 owner_id: number;
9916 /** @nullable */
9917 parent_id?: string | null;
9918 position: number;
9919 /** @nullable */
9920 rate_limit_per_user?: number | null;
9921 /** @nullable */
9922 space_id?: string | null;
9923 /** @nullable */
9924 topic?: string | null;
9925 updated_at: string;
9926 /** @nullable */
9927 user_limit?: number | null;
9928}
9929
9930export interface RoomSettingDto {
9931 favorite: boolean;
9932 hidden: boolean;
9933 /** @nullable */
9934 mute_until?: string | null;
9935 muted: boolean;
9936 notification_level: RoomNotificationLevel;
9937 room_id: string;
9938}
9939
9940export interface SaveMessageCmd {
9941 channel_id: string;
9942 message_id: string;
9943}
9944
9945export interface SavedMessageDto {
9946 channel_id: string;
9947 id: string;
9948 message_id: string;
9949 saved_at: string;
9950}
9951
9952export interface ScriptOutputDto {
9953 exit_code: number;
9954 stderr: string;
9955 stdout: string;
9956}
9957
9958export interface SendMessageCmd {
9959 attachments?: string[];
9960 content?: string;
9961 /** @nullable */
9962 forwarded_from?: string | null;
9963 /**
9964 * client-generated idempotency key, unique per room; retrying with the
9965 * same nonce returns the original message instead of duplicating
9966 * @nullable
9967 */
9968 nonce?: string | null;
9969 /** @nullable */
9970 reply_to_id?: string | null;
9971 thread_broadcast?: boolean;
9972 /** @nullable */
9973 thread_id?: string | null;
9974 urgent?: boolean;
9975}
9976
9977export interface SessionDto {
9978 /** @nullable */
9979 client_ip_hash?: string | null;
9980 created_at: string;
9981 /** @nullable */
9982 device_id?: string | null;
9983 expires_at: string;
9984 id: string;
9985 is_current: boolean;
9986 is_revoked: boolean;
9987 kind: SessionKind;
9988 last_seen_at: string;
9989 /** @nullable */
9990 revoked_at?: string | null;
9991 /** @nullable */
9992 user_agent_hash?: string | null;
9993}
9994
9995export interface SetCleanupVisibilityCmd {
9996 is_private: boolean;
9997}
9998
9999export interface SetCommitStatusCmd {
10000 context: string;
10001 /** @nullable */
10002 description?: string | null;
10003 sha: string;
10004 state: CommitStatusDtoState;
10005 /** @nullable */
10006 target_url?: string | null;
10007}
10008
10009export interface SetMemberRoleBody {
10010 expected_version?: number;
10011 role: SpaceMemberRole;
10012}
10013
10014export interface SetOverwriteCmd {
10015 allow_mask: number;
10016 deny_mask: number;
10017}
10018
10019export interface SetPresenceCmd {
10020 activities?: unknown;
10021 status: PresenceStatus;
10022}
10023
10024export interface SetRepoArchivedCmd {
10025 archived: boolean;
10026}
10027
10028export interface SetRolePermissionsBody {
10029 permissions?: PermissionGrant[];
10030}
10031
10032export interface SpaceImageDto {
10033 /** @minimum 0 */
10034 bytes: number;
10035 format: AvatarFormat;
10036 /** @nullable */
10037 height?: number | null;
10038 kind: SpaceImageKind;
10039 space_id: string;
10040 updated_at: string;
10041 url: string;
10042 /** @nullable */
10043 width?: number | null;
10044}
10045
10046/**
10047 * Banner geometry is recorded, not inferred: the browser knows the intrinsic
10048 * size for free, the server would have to decode the image to learn it.
10049 */
10050export interface SpaceImageUploadQuery {
10051 /** @nullable */
10052 height?: number | null;
10053 /** @nullable */
10054 width?: number | null;
10055}
10056
10057export interface SpaceInvitePath {
10058 invite_id: string;
10059 space_name: string;
10060}
10061
10062export interface SpaceMemberPath {
10063 member_id: string;
10064 space_name: string;
10065}
10066
10067export interface SpacePath {
10068 space_name: string;
10069}
10070
10071export interface SpaceReadStates {
10072 items: ReadStateDto[];
10073}
10074
10075export interface SpaceRolePath {
10076 role_id: string;
10077 space_name: string;
10078}
10079
10080export interface SshKeyAddRequest {
10081 /** @nullable */
10082 description?: string | null;
10083 /** @nullable */
10084 expires_at?: string | null;
10085 name: string;
10086 public_key: string;
10087}
10088
10089export interface SshKeySummary {
10090 algorithm: SshKeyAlgorithm;
10091 created_at: string;
10092 /** @nullable */
10093 description?: string | null;
10094 /** @nullable */
10095 expires_at?: string | null;
10096 fingerprint: string;
10097 id: string;
10098 /** @nullable */
10099 last_used_at?: string | null;
10100 name: string;
10101 public_key: string;
10102 /** @nullable */
10103 revoked_at?: string | null;
10104}
10105
10106export interface StargazerDto {
10107 avatar_url: string;
10108 display_name: string;
10109 starred_at: string;
10110 user_id: number;
10111 username: string;
10112}
10113
10114export interface StopwatchDto {
10115 /** @nullable */
10116 created_at?: string | null;
10117 /** @nullable */
10118 id?: string | null;
10119 issue_id: string;
10120 running: boolean;
10121 /** @nullable */
10122 started_at?: string | null;
10123 user?: null | UserDto;
10124}
10125
10126export interface StopwatchPath {
10127 board_id: string;
10128 issue_id: string;
10129 space_name: string;
10130}
10131
10132export interface SubmitReviewCmd {
10133 /** @nullable */
10134 body?: string | null;
10135 comments?: InlineDraft[];
10136 state: ReviewIntent;
10137}
10138
10139export interface SubmoduleDto {
10140 /** @nullable */
10141 branch?: string | null;
10142 /** @nullable */
10143 commit_sha?: string | null;
10144 path: string;
10145 url: string;
10146}
10147
10148export interface SuspensionDto {
10149 created_at: string;
10150 /** @nullable */
10151 ends_at?: string | null;
10152 id: string;
10153 /** @nullable */
10154 reason?: string | null;
10155 /** @nullable */
10156 revoked_at?: string | null;
10157 starts_at: string;
10158 suspension_type: SuspensionType;
10159}
10160
10161export interface TagDto {
10162 /** @nullable */
10163 created_at?: string | null;
10164 /** @nullable */
10165 message?: string | null;
10166 name: string;
10167 tag_type: TagType;
10168 /** @nullable */
10169 tagger_email?: string | null;
10170 /** @nullable */
10171 tagger_name?: string | null;
10172 target_sha: string;
10173}
10174
10175export interface TagPolicyDto {
10176 created_at: string;
10177 id: string;
10178 name_pattern: string;
10179 repo_id: string;
10180 updated_at: string;
10181}
10182
10183export interface TagWhitelistDto {
10184 policy_id: string;
10185 user?: null | UserDto;
10186 user_id: number;
10187}
10188
10189export interface ThreadDto {
10190 archived: boolean;
10191 created_at: string;
10192 id: string;
10193 /** @nullable */
10194 last_reply_at?: string | null;
10195 /** @nullable */
10196 last_reply_id?: string | null;
10197 locked: boolean;
10198 /** @nullable */
10199 name?: string | null;
10200 owner?: null | UserDto;
10201 owner_id: number;
10202 participant_count: number;
10203 reply_count: number;
10204 room_id: string;
10205 root_message_id: string;
10206 updated_at: string;
10207}
10208
10209export type ThreadNotifyLevel = "None" | "All";
10210export interface ThreadMemberCmd {
10211 notify_level?: null | ThreadNotifyLevel;
10212}
10213
10214export interface TopicDto {
10215 created_at: string;
10216 id: string;
10217 name: string;
10218 updated_at: string;
10219}
10220
10221export interface TopicRepoDto {
10222 is_private: boolean;
10223 repo_id: string;
10224 repo_name: string;
10225 space_name: string;
10226}
10227
10228export interface TotpCodeCmd {
10229 code: string;
10230}
10231
10232export interface TotpEnableCmd {
10233 code: string;
10234 password: string;
10235}
10236
10237export interface TotpSetupResp {
10238 otpauth_uri: string;
10239 secret: string;
10240}
10241
10242export interface TotpStatusResp {
10243 enabled: boolean;
10244}
10245
10246export interface TrackedTimeDto {
10247 created_at: string;
10248 id: string;
10249 issue_id: string;
10250 seconds: number;
10251 user?: null | UserDto;
10252}
10253
10254export interface TrackedTimeIdPath {
10255 board_id: string;
10256 issue_id: string;
10257 space_name: string;
10258 time_id: string;
10259}
10260
10261export interface TrackedTimePath {
10262 board_id: string;
10263 issue_id: string;
10264 space_name: string;
10265}
10266
10267export interface TransferBody {
10268 target_user_id: number;
10269}
10270
10271export type TreeView = "entries" | "last_updated";
10272export interface UnreadCountResp {
10273 /** @minimum 0 */
10274 count: number;
10275}
10276
10277/**
10278 * 封禁更新:原因、到期时间与四个放行位。缺失表示不变,null 表示清空。
10279 */
10280export interface UpdateBanBody {
10281 /** @nullable */
10282 allow_agent_join?: boolean | null;
10283 /** @nullable */
10284 allow_comment_any?: boolean | null;
10285 /** @nullable */
10286 allow_push_repo?: boolean | null;
10287 /** @nullable */
10288 allow_speak?: boolean | null;
10289 /** @nullable */
10290 expires_at?: string | null;
10291 /** @nullable */
10292 reason?: string | null;
10293}
10294
10295export interface UpdateBoardCmd {
10296 /** @nullable */
10297 description?: string | null;
10298 /** @nullable */
10299 icon?: string | null;
10300 /** @nullable */
10301 name?: string | null;
10302 /** @nullable */
10303 prefix?: string | null;
10304}
10305
10306export interface UpdateBookmarkCmd {
10307 /** @nullable */
10308 emoji?: string | null;
10309 /** @nullable */
10310 position?: number | null;
10311 /** @nullable */
10312 title?: string | null;
10313 /** @nullable */
10314 url?: string | null;
10315}
10316
10317export interface UpdateBranchDto {
10318 pull: PullDto;
10319 result: MergeResultDto;
10320}
10321
10322/**
10323 * 分支保护策略的更新请求(三态字段语义与其它 PATCH 一致)。
10324 */
10325export interface UpdateBranchPolicyCmd {
10326 /** @nullable */
10327 block_on_change_requested_reviews?: boolean | null;
10328 /** @nullable */
10329 block_on_outdated_branch?: boolean | null;
10330 /** @nullable */
10331 block_on_rejected_reviews?: boolean | null;
10332 /** @nullable */
10333 branch_pattern?: string | null;
10334 /** @nullable */
10335 dismiss_stale_approvals?: boolean | null;
10336 /** @nullable */
10337 enable_approvals_whitelist?: boolean | null;
10338 /** @nullable */
10339 enable_force_push?: boolean | null;
10340 /** @nullable */
10341 enable_merge_whitelist?: boolean | null;
10342 /** @nullable */
10343 enable_push?: boolean | null;
10344 /** @nullable */
10345 enable_push_whitelist?: boolean | null;
10346 /** @nullable */
10347 protected_file_patterns?: string | null;
10348 /** @nullable */
10349 require_signed_commits?: boolean | null;
10350 /** @nullable */
10351 required_approvals?: number | null;
10352 /** @nullable */
10353 required_status_contexts?: string | null;
10354 /** @nullable */
10355 unprotected_file_patterns?: string | null;
10356}
10357
10358export interface UpdateCodeCommentCmd {
10359 body: string;
10360}
10361
10362export interface UpdateCommentCmd {
10363 content: string;
10364}
10365
10366export interface UpdateDirCmd {
10367 name: string;
10368}
10369
10370export interface UpdateGroupCmd {
10371 /** @nullable */
10372 color?: string | null;
10373 /** @nullable */
10374 icon_hash?: string | null;
10375 /** @nullable */
10376 name?: string | null;
10377 /** @nullable */
10378 permissions?: string[] | null;
10379 /** @nullable */
10380 position?: number | null;
10381 /** @nullable */
10382 unicode_emoji?: string | null;
10383}
10384
10385export interface UpdateIssueCmd {
10386 /** @nullable */
10387 assignee_ids?: number[] | null;
10388 /** @nullable */
10389 content?: string | null;
10390 /** @nullable */
10391 description?: string | null;
10392 /** @nullable */
10393 due_at?: string | null;
10394 /** @nullable */
10395 label_ids?: string[] | null;
10396 /** @nullable */
10397 milestone_id?: string | null;
10398 priority?: null | IssuePriority;
10399 /** @nullable */
10400 title?: string | null;
10401}
10402
10403export interface UpdateIssueUserCmd {
10404 /** @nullable */
10405 is_read?: boolean | null;
10406}
10407
10408export interface UpdateJoinRuleCmd {
10409 /** @nullable */
10410 enabled?: boolean | null;
10411 /** @nullable */
10412 matcher?: string | null;
10413}
10414
10415export interface UpdateLabelCmd {
10416 /** @nullable */
10417 color?: string | null;
10418 /** @nullable */
10419 description?: string | null;
10420 /** @nullable */
10421 exclusive?: boolean | null;
10422 /** @nullable */
10423 exclusive_order?: number | null;
10424 /** @nullable */
10425 is_archived?: boolean | null;
10426 /** @nullable */
10427 name?: string | null;
10428}
10429
10430/**
10431 * 会籍更新:管理端可改别名、通知偏好、免打扰与封禁附加信息。
10432 * 所有字段缺失表示不变,显式 null 表示清空(仅限 Option 字段)。
10433 */
10434export interface UpdateMemberBody {
10435 /** @nullable */
10436 alias_avatar_url?: string | null;
10437 /** @nullable */
10438 alias_name?: string | null;
10439 expected_version?: number;
10440 /** @nullable */
10441 hide_muted_channels?: boolean | null;
10442 message_notifications?: null | MessageNotifications;
10443 /** @nullable */
10444 mobile_push?: boolean | null;
10445 /** @nullable */
10446 mute_until?: string | null;
10447 /** @nullable */
10448 muted?: boolean | null;
10449 /** @nullable */
10450 suppress_everyone?: boolean | null;
10451 /** @nullable */
10452 suppress_roles?: boolean | null;
10453}
10454
10455export interface UpdateMessageCmd {
10456 content: string;
10457}
10458
10459export interface UpdateMilestoneCmd {
10460 /** @nullable */
10461 description?: string | null;
10462 /** @nullable */
10463 due_at?: string | null;
10464 /** @nullable */
10465 is_closed?: boolean | null;
10466 /** @nullable */
10467 name?: string | null;
10468}
10469
10470export interface UpdateOrganizationBody {
10471 /** @nullable */
10472 allow_invite?: boolean | null;
10473 /** @nullable */
10474 allow_join?: boolean | null;
10475 /** @nullable */
10476 allow_join_level?: number | null;
10477 /** @nullable */
10478 avatar_url?: string | null;
10479 /** @nullable */
10480 description?: string | null;
10481 expected_version?: number;
10482 join_policy?: null | SpaceJoinPolicy;
10483 /** @nullable */
10484 member_must_enable_2fa?: boolean | null;
10485 /** @nullable */
10486 name?: string | null;
10487 /** @nullable */
10488 require_email_verified?: boolean | null;
10489 /** @nullable */
10490 require_mfa?: boolean | null;
10491 /** @nullable */
10492 welcome_message?: string | null;
10493}
10494
10495export interface UpdateOutboundWebhookCmd {
10496 /** @nullable */
10497 disabled?: boolean | null;
10498 /** @nullable */
10499 name?: string | null;
10500 /** @nullable */
10501 url?: string | null;
10502}
10503
10504export interface UpdatePinCmd {
10505 pin_order: number;
10506}
10507
10508export interface UpdatePreferencesCmd {
10509 allow_dms_from?: null | Audience;
10510 allow_mentions_from?: null | Audience;
10511 /** @nullable */
10512 board_view_mode?: string | null;
10513 /** @nullable */
10514 diff_view_style?: string | null;
10515 /** @nullable */
10516 email_digest?: boolean | null;
10517 /** @nullable */
10518 email_flags?: number | null;
10519 /** @nullable */
10520 in_app_flags?: number | null;
10521 /**
10522 * 三态:缺省不动、`null` 清除、给值设置(与 `lib/webapi/src/openapi.rs`
10523 * 声明的 PATCH 语义一致)。
10524 * @nullable
10525 */
10526 mute_until?: string | null;
10527 /** @nullable */
10528 push_flags?: number | null;
10529 /** @nullable */
10530 show_online_status?: boolean | null;
10531 /** @nullable */
10532 theme_mode?: string | null;
10533}
10534
10535export interface UpdateProfileCmd {
10536 /** @nullable */
10537 bio?: string | null;
10538 /** @nullable */
10539 company?: string | null;
10540 /** @nullable */
10541 date_of_birth?: string | null;
10542 /** @nullable */
10543 display_name?: string | null;
10544 /** @nullable */
10545 language?: string | null;
10546 /** @nullable */
10547 locale?: string | null;
10548 /** @nullable */
10549 location?: string | null;
10550 /** @nullable */
10551 pronouns?: string | null;
10552 /** @nullable */
10553 real_name?: string | null;
10554 /** @nullable */
10555 show_activity?: boolean | null;
10556 /** @nullable */
10557 show_email?: boolean | null;
10558 /** @nullable */
10559 show_location?: boolean | null;
10560 /** @nullable */
10561 show_real_name?: boolean | null;
10562 /** @nullable */
10563 timezone?: string | null;
10564 visibility?: null | ProfileVisibility;
10565 /** @nullable */
10566 website?: string | null;
10567}
10568
10569export interface UpdatePullCmd {
10570 /** @nullable */
10571 auto_merge?: boolean | null;
10572 /** @nullable */
10573 base_branch?: string | null;
10574 /** @nullable */
10575 body?: string | null;
10576 /** @nullable */
10577 draft?: boolean | null;
10578 /** @nullable */
10579 issue_id?: string | null;
10580 /** @nullable */
10581 title?: string | null;
10582}
10583
10584export interface UpdatePullCommentCmd {
10585 body: string;
10586}
10587
10588export interface UpdateRefResultDto {
10589 name: string;
10590 new_oid: string;
10591 /** @nullable */
10592 old_oid?: string | null;
10593 protected: boolean;
10594}
10595
10596export interface UpdateReleaseCmd {
10597 /** @nullable */
10598 content?: string | null;
10599 /** @nullable */
10600 is_draft?: boolean | null;
10601 /** @nullable */
10602 is_prerelease?: boolean | null;
10603 /** @nullable */
10604 title?: string | null;
10605}
10606
10607export interface UpdateReminderCmd {
10608 /** @nullable */
10609 note?: string | null;
10610 /** @nullable */
10611 remind_at?: string | null;
10612}
10613
10614export interface UpdateRepoCmd {
10615 /** @nullable */
10616 allow_pull_requests?: boolean | null;
10617 /** @nullable */
10618 default_branch?: string | null;
10619 /** @nullable */
10620 description?: string | null;
10621 /** @nullable */
10622 enable_lfs?: boolean | null;
10623 /** @nullable */
10624 is_private?: boolean | null;
10625 /**
10626 * 中间页签顺序;传空数组恢复默认顺序。
10627 * @nullable
10628 */
10629 tab_order?: string[] | null;
10630 /** @nullable */
10631 website?: string | null;
10632}
10633
10634export interface UpdateRoleBody {
10635 /** @nullable */
10636 default_role?: boolean | null;
10637 /** @nullable */
10638 description?: string | null;
10639 expected_version?: number;
10640 /** @nullable */
10641 name?: string | null;
10642 /** @nullable */
10643 rank?: number | null;
10644 /** @nullable */
10645 self_assignable?: boolean | null;
10646}
10647
10648export interface UpdateRoomCmd {
10649 /** @nullable */
10650 is_private?: boolean | null;
10651 /** @nullable */
10652 name?: string | null;
10653 /** @nullable */
10654 nsfw?: boolean | null;
10655 /**
10656 * Move the room under another directory node of the same space; `null` puts
10657 * it back at the space root. Absent means "leave the parent alone".
10658 * @nullable
10659 */
10660 parent_id?: string | null;
10661 /** @nullable */
10662 position?: number | null;
10663 /** @nullable */
10664 rate_limit_per_user?: number | null;
10665 /** @nullable */
10666 topic?: string | null;
10667}
10668
10669export interface UpdateRoomSettingCmd {
10670 /** @nullable */
10671 favorite?: boolean | null;
10672 /** @nullable */
10673 hidden?: boolean | null;
10674 /** @nullable */
10675 mute_minutes?: number | null;
10676 /** @nullable */
10677 muted?: boolean | null;
10678 notification_level?: null | RoomNotificationLevel;
10679}
10680
10681export interface UpdateTagPolicyCmd {
10682 /** @nullable */
10683 name_pattern?: string | null;
10684}
10685
10686export interface UpdateThreadCmd {
10687 /** @nullable */
10688 archived?: boolean | null;
10689 /** @nullable */
10690 locked?: boolean | null;
10691 /** @nullable */
10692 name?: string | null;
10693}
10694
10695export interface UpdateTrackedTimeCmd {
10696 seconds: number;
10697}
10698
10699export interface UpdateUsernameCmd {
10700 username: string;
10701}
10702
10703export interface UpdateWebhookCmd {
10704 /** @nullable */
10705 disabled?: boolean | null;
10706 /** @nullable */
10707 name?: string | null;
10708}
10709
10710export interface UploadEmojiCmd {
10711 animated?: boolean;
10712 content_type: string;
10713 data_base64: string;
10714 name: string;
10715}
10716
10717export interface UploadIntentDto {
10718 /** @minimum 0 */
10719 expires_secs: number;
10720 id: string;
10721 upload_url: string;
10722}
10723
10724export interface UpsertDraftCmd {
10725 content: string;
10726 /** @nullable */
10727 thread_id?: string | null;
10728}
10729
10730export interface UpsertLicenseCmd {
10731 body: string;
10732 /** @nullable */
10733 description?: string | null;
10734 display_name: string;
10735 /** @nullable */
10736 url?: string | null;
10737}
10738
10739export interface UpsertMemeCmd {
10740 content_type: string;
10741 /** @nullable */
10742 height?: number | null;
10743 name: string;
10744 size: number;
10745 url: string;
10746 /** @nullable */
10747 width?: number | null;
10748}
10749
10750export interface UpsertPushCmd {
10751 auth_key: string;
10752 endpoint: string;
10753 p256dh_key: string;
10754 platform: PushSubscriptionPlatform;
10755 /** @nullable */
10756 user_agent?: string | null;
10757}
10758
10759export interface UpsertWatchCmd {
10760 mode: WatchMode;
10761}
10762
10763export interface UserLoginRequest {
10764 identity: string;
10765 password_hash: string;
10766 pow_payload: PowProofRequest;
10767}
10768
10769export interface UserLoginResponse {
10770 /** @nullable */
10771 challenge?: string | null;
10772 /** @nullable */
10773 displayname?: string | null;
10774 mfa_required: boolean;
10775 user_id: number;
10776 username: string;
10777}
10778
10779export interface UserOverwriteDto {
10780 allow_mask: number;
10781 deny_mask: number;
10782 dir_id: string;
10783 user?: null | UserDto;
10784 user_id: number;
10785}
10786
10787export interface UserPreferencesDto {
10788 allow_dms_from: Audience;
10789 allow_mentions_from: Audience;
10790 /** Default view for the 问题集 page: `board` or `list`. */
10791 board_view_mode: string;
10792 /** @nullable */
10793 diff_view_style?: string | null;
10794 email_digest: boolean;
10795 email_flags: number;
10796 in_app_flags: number;
10797 /** @nullable */
10798 mute_until?: string | null;
10799 push_flags: number;
10800 show_online_status: boolean;
10801 theme_mode: string;
10802}
10803
10804export interface UserPublic {
10805 avatar_url: string;
10806 display_name: string;
10807 user_id: number;
10808 username: string;
10809}
10810
10811export interface UserRegisterRequest {
10812 birth_date: string;
10813 /** @nullable */
10814 displayname?: string | null;
10815 email: string;
10816 email_code: string;
10817 password_hash: string;
10818 pow_payload: PowProofRequest;
10819 username: string;
10820}
10821
10822export interface UserRegisterResponse {
10823 /** @nullable */
10824 displayname?: string | null;
10825 user_id: number;
10826 username: string;
10827}
10828
10829export interface UserReportDto {
10830 created_at: string;
10831 /** @nullable */
10832 evidence?: string | null;
10833 id: string;
10834 reason: string;
10835 reported_id: number;
10836 /** @nullable */
10837 resolution_note?: string | null;
10838 status: ReportStatus;
10839 updated_at: string;
10840}
10841
10842export interface VerifyResultDto {
10843 /** @nullable */
10844 error_message?: string | null;
10845 /** @nullable */
10846 key_id?: string | null;
10847 signed: boolean;
10848 /** @nullable */
10849 signer?: string | null;
10850 valid: boolean;
10851}
10852
10853export interface VoiceConfigDto {
10854 enabled: boolean;
10855 recording_enabled: boolean;
10856 url: string;
10857}
10858
10859export interface VoiceHandsDto {
10860 can_moderate: boolean;
10861 hands: HandDto[];
10862 my_state?: null | HandState;
10863}
10864
10865/**
10866 * key 为参与者用户 id。
10867 */
10868export type VoiceLayoutDtoTiles = { [key: string]: VoiceTileDto };
10869
10870export interface VoiceLayoutDto {
10871 /** key 为参与者用户 id。 */
10872 tiles?: VoiceLayoutDtoTiles;
10873}
10874
10875/**
10876 * 需要新增或覆盖的窗口(key = 参与者用户 id)。
10877 */
10878export type VoiceLayoutPatchDtoTiles = { [key: string]: VoiceTileDto };
10879
10880/**
10881 * 布局写入是**按 key 合并**的补丁而不是整表替换:每个客户端只提交自己刚拖的
10882 * 那一格,收回的格子里列在 `removed`,两个人同时摆不同窗口互不吞没。
10883 */
10884export interface VoiceLayoutPatchDto {
10885 /** 需要收回自动网格的窗口 key。 */
10886 removed?: string[];
10887 /** 需要新增或覆盖的窗口(key = 参与者用户 id)。 */
10888 tiles?: VoiceLayoutPatchDtoTiles;
10889}
10890
10891/**
10892 * 本次写入的服务端时刻,客户端用它给本地副本盖戳。
10893 */
10894export interface VoiceLayoutSavedDto {
10895 updated_at: number;
10896}
10897
10898export interface VoiceModerationDto {
10899 action: string;
10900 ok: boolean;
10901 user_id: number;
10902}
10903
10904/**
10905 * 房间参与者快照。
10906 *
10907 * 权威来源是 LiveKit 的 list_participants,Redis 只补主持人静音等本地状态;
10908 * 这是「谁在这个频道里」的服务端视图,用于侧栏人数与未加入时的预览。
10909 * 会中界面的发言高亮、静音图标与画面轨道一律直接读浏览器里的 Room,
10910 * 因为本接口不是事件流,返回值天然是快照。
10911 */
10912export interface VoiceParticipantDto {
10913 /** @nullable */
10914 avatar_url?: string | null;
10915 can_publish: boolean;
10916 display_name: string;
10917 joined_at: number;
10918 moderator_muted: boolean;
10919 /**
10920 * 快照值:list_participants 不返回发言状态,因此这里恒为 false;
10921 * 实时发言指示由前端从 Room 的 activeSpeakers 读取。
10922 */
10923 speaking: boolean;
10924 tracks: VoiceTrackDto[];
10925 user_id: number;
10926}
10927
10928export interface VoiceRecordingDto {
10929 active: boolean;
10930 egress_id: string;
10931}
10932
10933export interface VoiceSpaceStatesDto {
10934 rooms: VoiceRoomStateDto[];
10935}
10936
10937export interface VoiceTokenDto {
10938 can_publish: boolean;
10939 /** @minimum 0 */
10940 expires_in_secs: number;
10941 hand_state?: null | HandState;
10942 is_stage: boolean;
10943 room_name: string;
10944 token: string;
10945 url: string;
10946}
10947
10948export interface WatchDto {
10949 created_at: string;
10950 id: string;
10951 /** @nullable */
10952 issue_id?: string | null;
10953 mode: WatchMode;
10954 /** @nullable */
10955 updated_at?: string | null;
10956 user?: null | UserDto;
10957}
10958
10959export interface WatchPath {
10960 board_id: string;
10961 issue_id: string;
10962 space_name: string;
10963}
10964
10965export interface WatcherDto {
10966 avatar_url: string;
10967 display_name: string;
10968 mode: WatchMode;
10969 user_id: number;
10970 username: string;
10971 watching_since: string;
10972}
10973
10974export interface WebhookDto {
10975 created_at: string;
10976 disabled: boolean;
10977 id: string;
10978 /** @nullable */
10979 last_used_at?: string | null;
10980 name: string;
10981 room_id: string;
10982}
10983
10984export interface WebhookPostCmd {
10985 content?: string;
10986 /** @nullable */
10987 nonce?: string | null;
10988 /** @nullable */
10989 thread_id?: string | null;
10990}
10991
10992export interface WebhookSecretDto {
10993 created_at: string;
10994 disabled: boolean;
10995 id: string;
10996 name: string;
10997 room_id: string;
10998 token: string;
10999}
11000
11001export interface WriteBlobBody {
11002 data: string;
11003}
11004
11005export interface WriteObjectResultDto {
11006 id: string;
11007}
11008
11009export interface WriteTreeBody {
11010 files: FileEntryDto[];
11011}
11012
47011013export type AuthSshKeyListParams = {
47111014 /**
47211015 * @minimum 0
@@ -479,3 +11022,1065 @@
47911022 */
48011023 offset?: number | null;
48111024};
11025
11026export type DownloadAttachmentParams = {
11027 variant?: null | ImageVariant;
11028};
11029
11030export type ListDmsParams = {
11031 /**
11032 * @minimum 0
11033 * @nullable
11034 */
11035 limit?: number | null;
11036 /**
11037 * @minimum 0
11038 * @nullable
11039 */
11040 offset?: number | null;
11041};
11042
11043export type ListBookmarksParams = {
11044 /**
11045 * @minimum 0
11046 * @nullable
11047 */
11048 limit?: number | null;
11049 /**
11050 * @minimum 0
11051 * @nullable
11052 */
11053 offset?: number | null;
11054};
11055
11056export type GetDraftParams = {
11057 /**
11058 * @nullable
11059 */
11060 thread_id?: string | null;
11061};
11062
11063export type DeleteDraftParams = {
11064 /**
11065 * thread scope
11066 */
11067 thread_id?: string;
11068};
11069
11070export type ListMessagesParams = {
11071 /**
11072 * @nullable
11073 */
11074 before_seq?: number | null;
11075 /**
11076 * @nullable
11077 */
11078 after_seq?: number | null;
11079 /**
11080 * @minimum 0
11081 * @nullable
11082 */
11083 limit?: number | null;
11084 /**
11085 * @minimum 0
11086 * @nullable
11087 */
11088 offset?: number | null;
11089 /**
11090 * @nullable
11091 */
11092 thread_id?: string | null;
11093 /**
11094 * @nullable
11095 */
11096 author_id?: number | null;
11097};
11098
11099export type ListThreadsParams = {
11100 /**
11101 * @nullable
11102 */
11103 archived?: boolean | null;
11104 /**
11105 * @minimum 0
11106 * @nullable
11107 */
11108 limit?: number | null;
11109 /**
11110 * @minimum 0
11111 * @nullable
11112 */
11113 offset?: number | null;
11114};
11115
11116export type ModerateMuteParams = {
11117 /**
11118 * false to unmute
11119 */
11120 muted?: boolean;
11121};
11122
11123export type ListWebhooksParams = {
11124 /**
11125 * @minimum 0
11126 * @nullable
11127 */
11128 limit?: number | null;
11129 /**
11130 * @minimum 0
11131 * @nullable
11132 */
11133 offset?: number | null;
11134};
11135
11136export type ListEmojisParams = {
11137 /**
11138 * @minimum 0
11139 * @nullable
11140 */
11141 limit?: number | null;
11142 /**
11143 * @minimum 0
11144 * @nullable
11145 */
11146 offset?: number | null;
11147};
11148
11149export type ListMyThreadsParams = {
11150 /**
11151 * @minimum 0
11152 * @nullable
11153 */
11154 limit?: number | null;
11155 /**
11156 * @minimum 0
11157 * @nullable
11158 */
11159 offset?: number | null;
11160};
11161
11162export type ListBoardsParams = {
11163 /**
11164 * @nullable
11165 */
11166 dir_id?: string | null;
11167 /**
11168 * @nullable
11169 */
11170 q?: string | null;
11171 /**
11172 * @minimum 0
11173 * @nullable
11174 */
11175 limit?: number | null;
11176 /**
11177 * @minimum 0
11178 * @nullable
11179 */
11180 offset?: number | null;
11181};
11182
11183export type ListIssuesParams = {
11184 state?: null | IssueState;
11185 /**
11186 * @nullable
11187 */
11188 author_id?: number | null;
11189 /**
11190 * One id or a comma-separated id list (`a,b`); `none` matches issues
11191 * without a milestone. Any of the listed values matches.
11192 * @nullable
11193 */
11194 milestone_id?: string | null;
11195 /**
11196 * One id or a comma-separated id list (`a,b`); matches any of them.
11197 * @nullable
11198 */
11199 label_id?: string | null;
11200 /**
11201 * One id or a comma-separated id list (`a,b`); matches any of them.
11202 * @nullable
11203 */
11204 assignee_id?: string | null;
11205 /**
11206 * One priority or a comma-separated list (`high,urgent`).
11207 * @nullable
11208 */
11209 priority?: string | null;
11210 sort?: null | IssueSort;
11211 order?: null | SortOrder;
11212 /**
11213 * @nullable
11214 */
11215 q?: string | null;
11216 /**
11217 * @minimum 0
11218 * @nullable
11219 */
11220 limit?: number | null;
11221 /**
11222 * @minimum 0
11223 * @nullable
11224 */
11225 offset?: number | null;
11226};
11227
11228export type ListCommentsParams = {
11229 /**
11230 * @nullable
11231 */
11232 parent_id?: string | null;
11233 /**
11234 * @minimum 0
11235 * @nullable
11236 */
11237 limit?: number | null;
11238 /**
11239 * @minimum 0
11240 * @nullable
11241 */
11242 offset?: number | null;
11243 sort?: null | CommentSort;
11244 order?: null | SortOrder;
11245};
11246
11247export type RemoveCommentReactionParams = {
11248 emoji: string;
11249};
11250
11251export type ListEventsParams = {
11252 /**
11253 * @minimum 0
11254 * @nullable
11255 */
11256 limit?: number | null;
11257 /**
11258 * @minimum 0
11259 * @nullable
11260 */
11261 offset?: number | null;
11262};
11263
11264export type ListContentHistoryParams = {
11265 /**
11266 * @nullable
11267 */
11268 comment_id?: string | null;
11269 /**
11270 * @minimum 0
11271 * @nullable
11272 */
11273 limit?: number | null;
11274 /**
11275 * @minimum 0
11276 * @nullable
11277 */
11278 offset?: number | null;
11279};
11280
11281export type ListIssueMembersParams = {
11282 kind?: null | IssueMemberKind;
11283 /**
11284 * @minimum 0
11285 * @nullable
11286 */
11287 limit?: number | null;
11288 /**
11289 * @minimum 0
11290 * @nullable
11291 */
11292 offset?: number | null;
11293};
11294
11295export type RemoveIssueReactionParams = {
11296 emoji: string;
11297};
11298
11299export type ListTrackedTimeParams = {
11300 /**
11301 * @nullable
11302 */
11303 user_id?: number | null;
11304 /**
11305 * @minimum 0
11306 * @nullable
11307 */
11308 limit?: number | null;
11309 /**
11310 * @minimum 0
11311 * @nullable
11312 */
11313 offset?: number | null;
11314};
11315
11316export type ListIssueUsersParams = {
11317 /**
11318 * @minimum 0
11319 * @nullable
11320 */
11321 limit?: number | null;
11322 /**
11323 * @minimum 0
11324 * @nullable
11325 */
11326 offset?: number | null;
11327};
11328
11329export type ListLabelsParams = {
11330 /**
11331 * @nullable
11332 */
11333 q?: string | null;
11334 /**
11335 * @nullable
11336 */
11337 is_archived?: boolean | null;
11338 /**
11339 * @minimum 0
11340 * @nullable
11341 */
11342 limit?: number | null;
11343 /**
11344 * @minimum 0
11345 * @nullable
11346 */
11347 offset?: number | null;
11348};
11349
11350export type ListMilestonesParams = {
11351 /**
11352 * @nullable
11353 */
11354 is_closed?: boolean | null;
11355 /**
11356 * @nullable
11357 */
11358 q?: string | null;
11359 /**
11360 * @minimum 0
11361 * @nullable
11362 */
11363 limit?: number | null;
11364 /**
11365 * @minimum 0
11366 * @nullable
11367 */
11368 offset?: number | null;
11369};
11370
11371export type ListLicensesParams = {
11372 /**
11373 * @minimum 0
11374 * @nullable
11375 */
11376 limit?: number | null;
11377 /**
11378 * @minimum 0
11379 * @nullable
11380 */
11381 offset?: number | null;
11382};
11383
11384export type ListDevicesParams = {
11385 /**
11386 * @minimum 0
11387 * @nullable
11388 */
11389 limit?: number | null;
11390 /**
11391 * @minimum 0
11392 * @nullable
11393 */
11394 offset?: number | null;
11395};
11396
11397export type ListMemesParams = {
11398 /**
11399 * @minimum 0
11400 * @nullable
11401 */
11402 limit?: number | null;
11403};
11404
11405export type ListSavedMessagesParams = {
11406 /**
11407 * @minimum 0
11408 * @nullable
11409 */
11410 limit?: number | null;
11411 /**
11412 * @minimum 0
11413 * @nullable
11414 */
11415 offset?: number | null;
11416};
11417
11418export type ListNotificationsParams = {
11419 /**
11420 * @minimum 0
11421 * @nullable
11422 */
11423 limit?: number | null;
11424 /**
11425 * @minimum 0
11426 * @nullable
11427 */
11428 offset?: number | null;
11429 type?: null | NotificationType;
11430 /**
11431 * @nullable
11432 */
11433 unread?: boolean | null;
11434};
11435
11436export type ListPushSubscriptionsParams = {
11437 /**
11438 * @minimum 0
11439 * @nullable
11440 */
11441 limit?: number | null;
11442 /**
11443 * @minimum 0
11444 * @nullable
11445 */
11446 offset?: number | null;
11447};
11448
11449export type RecentMentionsParams = {
11450 /**
11451 * @minimum 0
11452 * @nullable
11453 */
11454 limit?: number | null;
11455};
11456
11457export type MyReportsParams = {
11458 /**
11459 * @minimum 0
11460 * @nullable
11461 */
11462 limit?: number | null;
11463 /**
11464 * @minimum 0
11465 * @nullable
11466 */
11467 offset?: number | null;
11468};
11469
11470export type ListSessionsParams = {
11471 kind?: null | SessionKind;
11472 /**
11473 * @nullable
11474 */
11475 include_revoked?: boolean | null;
11476 /**
11477 * @minimum 0
11478 * @nullable
11479 */
11480 limit?: number | null;
11481 /**
11482 * @minimum 0
11483 * @nullable
11484 */
11485 offset?: number | null;
11486};
11487
11488export type MySpacesParams = {
11489 /**
11490 * @minimum 0
11491 * @nullable
11492 */
11493 limit?: number | null;
11494 /**
11495 * @minimum 0
11496 * @nullable
11497 */
11498 offset?: number | null;
11499};
11500
11501export type MySuspensionsParams = {
11502 /**
11503 * @nullable
11504 */
11505 include_revoked?: boolean | null;
11506 /**
11507 * @nullable
11508 */
11509 active?: boolean | null;
11510};
11511
11512export type ListMyPullsParams = {
11513 /**
11514 * open | closed | merged | all
11515 * @nullable
11516 */
11517 state?: string | null;
11518 /**
11519 * @minimum 0
11520 * @nullable
11521 */
11522 limit?: number | null;
11523 /**
11524 * @minimum 0
11525 * @nullable
11526 */
11527 offset?: number | null;
11528};
11529
11530export type ListReposParams = {
11531 /**
11532 * @minimum 0
11533 * @nullable
11534 */
11535 limit?: number | null;
11536 /**
11537 * @minimum 0
11538 * @nullable
11539 */
11540 offset?: number | null;
11541 sort?: null | RepoSort;
11542 order?: null | SortOrder;
11543};
11544
11545export type CodeActivityParams = {
11546 /**
11547 * @nullable
11548 */
11549 branch?: string | null;
11550};
11551
11552export type GetArchiveParams = {
11553 /**
11554 * archive format
11555 */
11556 format: string;
11557 /**
11558 * path filter
11559 */
11560 path_filter?: string;
11561};
11562
11563export type BlameParams = {
11564 revision: string;
11565 path: string;
11566 /**
11567 * @minimum 0
11568 * @nullable
11569 */
11570 range_start?: number | null;
11571 /**
11572 * @minimum 0
11573 * @nullable
11574 */
11575 range_end?: number | null;
11576};
11577
11578export type ListBranchesParams = {
11579 /**
11580 * @minimum 0
11581 * @nullable
11582 */
11583 limit?: number | null;
11584 /**
11585 * @minimum 0
11586 * @nullable
11587 */
11588 offset?: number | null;
11589};
11590
11591export type DeleteBranchParams = {
11592 /**
11593 * @nullable
11594 */
11595 force?: boolean | null;
11596};
11597
11598export type ListCodeCommentsParams = {
11599 /**
11600 * @nullable
11601 */
11602 path?: string | null;
11603 /**
11604 * @nullable
11605 */
11606 revision?: string | null;
11607 /**
11608 * @nullable
11609 */
11610 resolved?: boolean | null;
11611 /**
11612 * @minimum 0
11613 * @nullable
11614 */
11615 limit?: number | null;
11616 /**
11617 * @minimum 0
11618 * @nullable
11619 */
11620 offset?: number | null;
11621};
11622
11623export type ListCommitsParams = {
11624 /**
11625 * start revision
11626 */
11627 revision?: string;
11628 /**
11629 * path filter
11630 */
11631 path?: string;
11632 /**
11633 * max commits per page (1-100)
11634 * @minimum 0
11635 */
11636 limit?: number;
11637 /**
11638 * skip commits before returning (max 5000)
11639 * @minimum 0
11640 */
11641 offset?: number;
11642 /**
11643 * since date
11644 */
11645 since?: string;
11646 /**
11647 * until date
11648 */
11649 until?: string;
11650 /**
11651 * first parent only
11652 */
11653 first_parent: boolean;
11654};
11655
11656export type IsAncestorParams = {
11657 ancestor: string;
11658 descendant: string;
11659};
11660
11661export type CommitStatsParams = {
11662 revision: string;
11663 /**
11664 * @nullable
11665 */
11666 path?: string | null;
11667};
11668
11669export type GetConflictsParams = {
11670 base: string;
11671 head: string;
11672 /**
11673 * @nullable
11674 */
11675 ancestor?: string | null;
11676};
11677
11678export type ConflictDetailParams = {
11679 base: string;
11680 head: string;
11681 path: string;
11682};
11683
11684export type GetDiffParams = {
11685 base: string;
11686 head: string;
11687 view?: DiffView;
11688 use_merge_base?: boolean;
11689};
11690
11691export type RangeDiffParams = {
11692 from: string;
11693 to: string;
11694 /**
11695 * @nullable
11696 */
11697 base?: string | null;
11698};
11699
11700export type DiffRawParams = {
11701 base: string;
11702 head: string;
11703};
11704
11705export type ListLfsPointersParams = {
11706 revision: string;
11707 /**
11708 * @minimum 0
11709 * @nullable
11710 */
11711 limit?: number | null;
11712};
11713
11714export type ListLocksParams = {
11715 /**
11716 * @nullable
11717 */
11718 cursor?: string | null;
11719 /**
11720 * @minimum 0
11721 * @nullable
11722 */
11723 limit?: number | null;
11724};
11725
11726export type UnlockParams = {
11727 path: string;
11728 /**
11729 * @nullable
11730 */
11731 force?: boolean | null;
11732};
11733
11734export type VerifyLocksParams = {
11735 /**
11736 * @minimum 0
11737 * @nullable
11738 */
11739 limit?: number | null;
11740};
11741
11742export type UnlockByIdParams = {
11743 /**
11744 * @nullable
11745 */
11746 force?: boolean | null;
11747};
11748
11749export type PatchGenerateParams = {
11750 base: string;
11751 head: string;
11752};
11753
11754export type PathLogParams = {
11755 commit_hash: string;
11756 target_dir: string;
11757};
11758
11759export type ListPullsParams = {
11760 /**
11761 * open | closed | merged | all
11762 * @nullable
11763 */
11764 state?: string | null;
11765 /**
11766 * @nullable
11767 */
11768 author?: string | null;
11769 /**
11770 * @nullable
11771 */
11772 base?: string | null;
11773 /**
11774 * @nullable
11775 */
11776 head?: string | null;
11777 /**
11778 * @nullable
11779 */
11780 draft?: boolean | null;
11781 /**
11782 * @nullable
11783 */
11784 search?: string | null;
11785 sort?: null | PullSort;
11786 order?: null | SortOrder;
11787 /**
11788 * @minimum 0
11789 * @nullable
11790 */
11791 limit?: number | null;
11792 /**
11793 * @minimum 0
11794 * @nullable
11795 */
11796 offset?: number | null;
11797};
11798
11799export type ListPullCommentsParams = {
11800 /**
11801 * @minimum 0
11802 * @nullable
11803 */
11804 limit?: number | null;
11805 /**
11806 * @minimum 0
11807 * @nullable
11808 */
11809 offset?: number | null;
11810};
11811
11812export type ListPullEventsParams = {
11813 /**
11814 * @minimum 0
11815 * @nullable
11816 */
11817 limit?: number | null;
11818 /**
11819 * @minimum 0
11820 * @nullable
11821 */
11822 offset?: number | null;
11823};
11824
11825export type ListReleasesParams = {
11826 /**
11827 * @minimum 0
11828 * @nullable
11829 */
11830 limit?: number | null;
11831 /**
11832 * @minimum 0
11833 * @nullable
11834 */
11835 offset?: number | null;
11836 /**
11837 * 仅返回草稿(true)或仅返回已发布(false);缺省返回全部。
11838 * @nullable
11839 */
11840 draft?: boolean | null;
11841};
11842
11843export type ListStargazersParams = {
11844 /**
11845 * @minimum 0
11846 * @nullable
11847 */
11848 limit?: number | null;
11849 /**
11850 * @minimum 0
11851 * @nullable
11852 */
11853 offset?: number | null;
11854};
11855
11856export type SubmoduleListParams = {
11857 revision: string;
11858};
11859
11860export type SubmoduleResolveParams = {
11861 revision: string;
11862 path: string;
11863};
11864
11865export type ListTagsParams = {
11866 /**
11867 * @minimum 0
11868 * @nullable
11869 */
11870 limit?: number | null;
11871 /**
11872 * @minimum 0
11873 * @nullable
11874 */
11875 offset?: number | null;
11876};
11877
11878export type GetTreeParams = {
11879 path?: string;
11880 recurse?: boolean;
11881 resolve?: boolean;
11882 show_trees?: boolean;
11883 view?: null | TreeView;
11884};
11885
11886export type ListWatchersParams = {
11887 /**
11888 * @minimum 0
11889 * @nullable
11890 */
11891 limit?: number | null;
11892 /**
11893 * @minimum 0
11894 * @nullable
11895 */
11896 offset?: number | null;
11897 mode?: null | WatchMode;
11898};
11899
11900export type SpaceListParams = {
11901 /**
11902 * @minimum 0
11903 * @nullable
11904 */
11905 limit?: number | null;
11906 /**
11907 * @minimum 0
11908 * @nullable
11909 */
11910 offset?: number | null;
11911 /**
11912 * @nullable
11913 */
11914 include_archived?: boolean | null;
11915};
11916
11917export type ExploreSpacesParams = {
11918 /**
11919 * @nullable
11920 */
11921 q?: string | null;
11922 sort?: null | ExploreSort;
11923 order?: null | SortOrder;
11924 /**
11925 * @minimum 0
11926 * @nullable
11927 */
11928 limit?: number | null;
11929 /**
11930 * @minimum 0
11931 * @nullable
11932 */
11933 offset?: number | null;
11934};
11935
11936export type SpaceDeleteParams = {
11937 /**
11938 * 是否连成员一并清理
11939 */
11940 force?: boolean;
11941 /**
11942 * 删除原因,最长 512 字符
11943 */
11944 reason?: string;
11945};
11946
11947export type SpaceBanListParams = {
11948 /**
11949 * 每页条数,默认 20,最多 100
11950 * @minimum 0
11951 */
11952 limit?: number;
11953 /**
11954 * 跳过条数,最多 5000
11955 * @minimum 0
11956 */
11957 offset?: number;
11958};
11959
11960export type GetSpaceDirTreeParams = {
11961 /**
11962 * @nullable
11963 */
11964 parent_id?: string | null;
11965};
11966
11967export type ListGroupsParams = {
11968 /**
11969 * @minimum 0
11970 * @nullable
11971 */
11972 limit?: number | null;
11973 /**
11974 * @minimum 0
11975 * @nullable
11976 */
11977 offset?: number | null;
11978};
11979
11980export type UploadSpaceImageParams = {
11981 /**
11982 * @nullable
11983 */
11984 width?: number | null;
11985 /**
11986 * @nullable
11987 */
11988 height?: number | null;
11989};
11990
11991export type GetSpaceImageFileParams = {
11992 variant?: null | ImageVariant;
11993};
11994
11995export type SpaceInviteListParams = {
11996 /**
11997 * 每页条数,默认 20,最多 100
11998 * @minimum 0
11999 */
12000 limit?: number;
12001 /**
12002 * 跳过条数,最多 5000
12003 * @minimum 0
12004 */
12005 offset?: number;
12006 /**
12007 * 包含已撤销邀请
12008 */
12009 include_revoked?: boolean;
12010};
12011
12012export type ListJoinRequestsParams = {
12013 status?: null | SpaceJoinRequestState;
12014 /**
12015 * @minimum 0
12016 * @nullable
12017 */
12018 limit?: number | null;
12019 /**
12020 * @minimum 0
12021 * @nullable
12022 */
12023 offset?: number | null;
12024};
12025
12026export type SpaceMemberListParams = {
12027 /**
12028 * 每页条数,默认 20,最多 100
12029 * @minimum 0
12030 */
12031 limit?: number;
12032 /**
12033 * 跳过条数,最多 5000
12034 * @minimum 0
12035 */
12036 offset?: number;
12037 /**
12038 * 包含已退出成员
12039 */
12040 include_inactive?: boolean;
12041 /**
12042 * 包含已封禁成员
12043 */
12044 include_banned?: boolean;
12045};
12046
12047export type SpaceMemberRemoveParams = {
12048 /**
12049 * 移除原因
12050 */
12051 reason?: string;
12052};
12053
12054export type ListTopicsParams = {
12055 /**
12056 * @minimum 0
12057 * @nullable
12058 */
12059 limit?: number | null;
12060 /**
12061 * @minimum 0
12062 * @nullable
12063 */
12064 offset?: number | null;
12065};
12066
12067export type ListReposByTopicParams = {
12068 /**
12069 * @minimum 0
12070 * @nullable
12071 */
12072 limit?: number | null;
12073 /**
12074 * @minimum 0
12075 * @nullable
12076 */
12077 offset?: number | null;
12078};
12079
12080export type ListUsersBatchParams = {
12081 ids: number[];
12082};
12083
12084export type GetUserAvatarParams = {
12085 variant?: null | ImageVariant;
12086};
Modified packages/apiclient/index.ts View packages/apiclient/index.ts
@@ -1 +1,39 @@
1export * from "./account/index";
2export * from "./analysis/index";
3export * from "./archives/index";
14export * from "./auth/index";
5export * from "./blame/index";
6export * from "./blobs/index";
7export * from "./branch-protection/index";
8export * from "./branches/index";
9export * from "./chat/index";
10export * from "./cleanup/index";
11export * from "./code-comments/index";
12export * from "./commits/index";
13export * from "./conflicts/index";
14export * from "./content/index";
15export * from "./diffs/index";
16export * from "./hooks/index";
17export * from "./issues/index";
18export * from "./lfs/index";
19export * from "./licenses/index";
20export * from "./logs/index";
21export * from "./notifications/index";
22export * from "./patches/index";
23export * from "./protection/index";
24export * from "./pulls/index";
25export * from "./push/index";
26export * from "./releases/index";
27export * from "./remotes/index";
28export * from "./reports/index";
29export * from "./repos/index";
30export * from "./reviews/index";
31export * from "./signatures/index";
32export * from "./space/index";
33export * from "./submodules/index";
34export * from "./tag-protection/index";
35export * from "./tags/index";
36export * from "./topics/index";
37export * from "./trees/index";
38export * from "./user/index";
39export * from "./users/index";