@leaflow/sdk 0.32.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,6 +2,8 @@ export type { paths, components, operations, webhooks } from "./schema.js";
|
|
|
2
2
|
import type { operations } from "./schema.js";
|
|
3
3
|
/** `GET /account/v1/settings` 成功时的响应体。 */
|
|
4
4
|
export type GetSettingsResult = operations["get-settings"]["responses"][200]["content"]["application/json"];
|
|
5
|
+
/** `GET /account/v1/locales` 成功时的响应体。 */
|
|
6
|
+
export type ListLocalesResult = operations["list-locales"]["responses"][200]["content"]["application/json"];
|
|
5
7
|
/** `GET /account/v1/agreements` 成功时的响应体。 */
|
|
6
8
|
export type ListAgreementsResult = operations["list-agreements"]["responses"][200]["content"]["application/json"];
|
|
7
9
|
/** `GET /account/v1/me/consents` 成功时的响应体。 */
|
|
@@ -16,6 +18,10 @@ export type RegisterResult = operations["register"]["responses"][201]["content"]
|
|
|
16
18
|
export type RegisterBody = NonNullable<operations["register"]["requestBody"]>["content"]["application/json"];
|
|
17
19
|
/** `GET /account/v1/me` 成功时的响应体。 */
|
|
18
20
|
export type GetAccountResult = operations["get-account"]["responses"][200]["content"]["application/json"];
|
|
21
|
+
/** `PATCH /account/v1/me` 成功时的响应体。 */
|
|
22
|
+
export type UpdateAccountResult = operations["update-account"]["responses"][200]["content"]["application/json"];
|
|
23
|
+
/** `PATCH /account/v1/me` 的请求体。 */
|
|
24
|
+
export type UpdateAccountBody = NonNullable<operations["update-account"]["requestBody"]>["content"]["application/json"];
|
|
19
25
|
/** `GET /account/v1/me/identity-verification` 成功时的响应体。 */
|
|
20
26
|
export type GetIdentityVerificationResult = operations["get-identity-verification"]["responses"][200]["content"]["application/json"];
|
|
21
27
|
/** `POST /account/v1/me/identity-verification` 成功时的响应体。 */
|
|
@@ -27,6 +27,28 @@ export interface paths {
|
|
|
27
27
|
patch?: never;
|
|
28
28
|
trace?: never;
|
|
29
29
|
};
|
|
30
|
+
"/account/v1/locales": {
|
|
31
|
+
parameters: {
|
|
32
|
+
query?: never;
|
|
33
|
+
header?: never;
|
|
34
|
+
path?: never;
|
|
35
|
+
cookie?: never;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* 注册页要用的国家/地区和语言清单
|
|
39
|
+
* @description 免认证:注册页在还没有账号的时候就要画出这两个下拉框。
|
|
40
|
+
* 国家名和排序都跟着 `Accept-Language` 走——一个英文用户看到的是 China 而不是「中国」, 而顺序按那种语言自己的规则(中文按拼音,英文按字母),不是按码点。头缺失时用简体中文。
|
|
41
|
+
* 清单来自 CLDR,不是我们自己维护的一份:ISO 3166 每年都改,而抄下来的那份不会跟着改。 已经退役的代码(苏联、南斯拉夫)和不是地方的代码(欧盟、联合国)都不在里面。
|
|
42
|
+
*/
|
|
43
|
+
get: operations["list-locales"];
|
|
44
|
+
put?: never;
|
|
45
|
+
post?: never;
|
|
46
|
+
delete?: never;
|
|
47
|
+
options?: never;
|
|
48
|
+
head?: never;
|
|
49
|
+
patch?: never;
|
|
50
|
+
trace?: never;
|
|
51
|
+
};
|
|
30
52
|
"/account/v1/agreements": {
|
|
31
53
|
parameters: {
|
|
32
54
|
query?: never;
|
|
@@ -114,7 +136,11 @@ export interface paths {
|
|
|
114
136
|
delete?: never;
|
|
115
137
|
options?: never;
|
|
116
138
|
head?: never;
|
|
117
|
-
|
|
139
|
+
/**
|
|
140
|
+
* 改当前账号的国家/地区和语言
|
|
141
|
+
* @description 姓名和邮箱不在这里改:它们来自身份提供方,改了会在下一次登录同步时被覆盖回去。
|
|
142
|
+
*/
|
|
143
|
+
patch: operations["update-account"];
|
|
118
144
|
trace?: never;
|
|
119
145
|
};
|
|
120
146
|
"/account/v1/me/identity-verification": {
|
|
@@ -339,6 +365,10 @@ export interface components {
|
|
|
339
365
|
id: string;
|
|
340
366
|
/** @description 来自登录信息,可能为空 */
|
|
341
367
|
last_name: string;
|
|
368
|
+
/** @description ISO 3166-1 alpha-2。这两个字段是后加的,注册时才开始要求填——已经注册过的人这里 是空串,让他们在设置里补,补之前一切照常。 */
|
|
369
|
+
country?: string;
|
|
370
|
+
/** @description 为空表示没设过,那时按请求头(Accept-Language)走,两者都没有才用平台默认 */
|
|
371
|
+
locale?: string;
|
|
342
372
|
pending_agreements: components["schemas"]["AgreementResource"][] | null;
|
|
343
373
|
/** @enum {string} */
|
|
344
374
|
status: "ACTIVE" | "SUSPENDED" | "BANNED" | "DELETING";
|
|
@@ -346,6 +376,35 @@ export interface components {
|
|
|
346
376
|
RegisterRequestBody: {
|
|
347
377
|
/** @description 当前生效的必签文件全部要在里面,版本号要和 GET /api/v1/agreements 给的一致 */
|
|
348
378
|
consents: components["schemas"]["ConsentBody"][] | null;
|
|
379
|
+
/** @description ISO 3166-1 alpha-2(CN、HK、US)。必须是现实世界里真实存在的国家或地区——EU、ZZ 这类在标准里有位置但不是国家的代码会被拒。存代码不存名字:名字是本地化的,存下来 的那份只会是某一种语言的。 */
|
|
380
|
+
country: string;
|
|
381
|
+
locale: components["schemas"]["Locale"];
|
|
382
|
+
};
|
|
383
|
+
LocaleOptionsResource: {
|
|
384
|
+
countries: components["schemas"]["CountryOption"][];
|
|
385
|
+
languages: components["schemas"]["LanguageOption"][];
|
|
386
|
+
};
|
|
387
|
+
CountryOption: {
|
|
388
|
+
/** @description ISO 3166-1 alpha-2,注册时原样回传 */
|
|
389
|
+
code: string;
|
|
390
|
+
/** @description 按 Accept-Language 渲染的名字 */
|
|
391
|
+
name: string;
|
|
392
|
+
};
|
|
393
|
+
LanguageOption: {
|
|
394
|
+
code: components["schemas"]["Locale"];
|
|
395
|
+
/** @description 这种语言的自称,用它自己写(「简体中文」「繁體中文(香港)」「English」)。不跟着 Accept-Language 变——一个只看得懂繁体的人,在一个全简体的列表里找不到自己那一项。 */
|
|
396
|
+
name: string;
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* @description 界面和邮件用哪种语言。它和 country 是两件事,不能互相推——一个在香港的人可能读简体, 一个在美国的人可能读繁体。
|
|
400
|
+
* @enum {string}
|
|
401
|
+
*/
|
|
402
|
+
Locale: "zh-Hans" | "zh-Hant-HK" | "en";
|
|
403
|
+
/** @description 两个字段都是「不传就不动」。设置页上它们是两个独立的控件,用户可能只改其中一个;做成 整体替换的话,一次只想改语言的提交会把国家清掉,而那种丢失不报错。 */
|
|
404
|
+
UpdateAccountRequestBody: {
|
|
405
|
+
/** @description 同注册时那个 country */
|
|
406
|
+
country?: string;
|
|
407
|
+
locale?: components["schemas"]["Locale"];
|
|
349
408
|
};
|
|
350
409
|
IdentityVerificationResource: {
|
|
351
410
|
reject_reason: string;
|
|
@@ -523,6 +582,35 @@ export interface operations {
|
|
|
523
582
|
};
|
|
524
583
|
};
|
|
525
584
|
};
|
|
585
|
+
"list-locales": {
|
|
586
|
+
parameters: {
|
|
587
|
+
query?: never;
|
|
588
|
+
header?: never;
|
|
589
|
+
path?: never;
|
|
590
|
+
cookie?: never;
|
|
591
|
+
};
|
|
592
|
+
requestBody?: never;
|
|
593
|
+
responses: {
|
|
594
|
+
/** @description OK */
|
|
595
|
+
200: {
|
|
596
|
+
headers: {
|
|
597
|
+
[name: string]: unknown;
|
|
598
|
+
};
|
|
599
|
+
content: {
|
|
600
|
+
"application/json": components["schemas"]["LocaleOptionsResource"];
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
/** @description Error */
|
|
604
|
+
default: {
|
|
605
|
+
headers: {
|
|
606
|
+
[name: string]: unknown;
|
|
607
|
+
};
|
|
608
|
+
content: {
|
|
609
|
+
"application/json": components["schemas"]["Error"];
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
};
|
|
613
|
+
};
|
|
526
614
|
"list-agreements": {
|
|
527
615
|
parameters: {
|
|
528
616
|
query?: never;
|
|
@@ -676,6 +764,39 @@ export interface operations {
|
|
|
676
764
|
};
|
|
677
765
|
};
|
|
678
766
|
};
|
|
767
|
+
"update-account": {
|
|
768
|
+
parameters: {
|
|
769
|
+
query?: never;
|
|
770
|
+
header?: never;
|
|
771
|
+
path?: never;
|
|
772
|
+
cookie?: never;
|
|
773
|
+
};
|
|
774
|
+
requestBody: {
|
|
775
|
+
content: {
|
|
776
|
+
"application/json": components["schemas"]["UpdateAccountRequestBody"];
|
|
777
|
+
};
|
|
778
|
+
};
|
|
779
|
+
responses: {
|
|
780
|
+
/** @description OK */
|
|
781
|
+
200: {
|
|
782
|
+
headers: {
|
|
783
|
+
[name: string]: unknown;
|
|
784
|
+
};
|
|
785
|
+
content: {
|
|
786
|
+
"application/json": components["schemas"]["AccountResource"];
|
|
787
|
+
};
|
|
788
|
+
};
|
|
789
|
+
/** @description Error */
|
|
790
|
+
default: {
|
|
791
|
+
headers: {
|
|
792
|
+
[name: string]: unknown;
|
|
793
|
+
};
|
|
794
|
+
content: {
|
|
795
|
+
"application/json": components["schemas"]["Error"];
|
|
796
|
+
};
|
|
797
|
+
};
|
|
798
|
+
};
|
|
799
|
+
};
|
|
679
800
|
"get-identity-verification": {
|
|
680
801
|
parameters: {
|
|
681
802
|
query?: never;
|
|
@@ -18,6 +18,10 @@ export type GetNotificationResult = operations["get-notification"]["responses"][
|
|
|
18
18
|
export type MarkNotificationReadResult = operations["mark-notification-read"]["responses"][200]["content"]["application/json"];
|
|
19
19
|
/** `POST /api/v1/notifications/{notificationId}/archive` 成功时的响应体。 */
|
|
20
20
|
export type ArchiveNotificationResult = operations["archive-notification"]["responses"][200]["content"]["application/json"];
|
|
21
|
+
/** `GET /api/v1/announcements` 成功时的响应体。 */
|
|
22
|
+
export type ListAnnouncementsResult = operations["list-announcements"]["responses"][200]["content"]["application/json"];
|
|
23
|
+
/** `POST /api/v1/announcements/read` 成功时的响应体。 */
|
|
24
|
+
export type ReadAllAnnouncementsResult = operations["read-all-announcements"]["responses"][200]["content"]["application/json"];
|
|
21
25
|
/** `GET /api/v1/notification-types` 成功时的响应体。 */
|
|
22
26
|
export type ListNotificationTypesResult = operations["list-notification-types"]["responses"][200]["content"]["application/json"];
|
|
23
27
|
/** `GET /api/v1/preferences` 成功时的响应体。 */
|
|
@@ -134,6 +134,80 @@ export interface paths {
|
|
|
134
134
|
patch?: never;
|
|
135
135
|
trace?: never;
|
|
136
136
|
};
|
|
137
|
+
"/api/v1/announcements": {
|
|
138
|
+
parameters: {
|
|
139
|
+
query?: never;
|
|
140
|
+
header?: never;
|
|
141
|
+
path?: never;
|
|
142
|
+
cookie?: never;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* List platform announcements
|
|
146
|
+
* @description Announcements the platform published for everyone, filtered to the ones you can still see:
|
|
147
|
+
* published, not expired, and targeted at you.
|
|
148
|
+
*
|
|
149
|
+
* They are not part of `GET /api/v1/notifications`. A notification is addressed to you and has
|
|
150
|
+
* a row per recipient; an announcement is one row for the whole platform and never fans out —
|
|
151
|
+
* a hundred thousand users would be a hundred thousand rows, and almost none of them would
|
|
152
|
+
* ever be read. Whether you have read one is recorded separately, so unread means "no such
|
|
153
|
+
* record" rather than "a record with a null timestamp".
|
|
154
|
+
*
|
|
155
|
+
* The list is short by design: expired announcements drop out of it. There is no paging.
|
|
156
|
+
*
|
|
157
|
+
* Text comes back in the language on your preferences. An announcement that has no text in
|
|
158
|
+
* that language falls back to the platform default — a readable announcement in the wrong
|
|
159
|
+
* language beats a blank title.
|
|
160
|
+
*/
|
|
161
|
+
get: operations["list-announcements"];
|
|
162
|
+
put?: never;
|
|
163
|
+
post?: never;
|
|
164
|
+
delete?: never;
|
|
165
|
+
options?: never;
|
|
166
|
+
head?: never;
|
|
167
|
+
patch?: never;
|
|
168
|
+
trace?: never;
|
|
169
|
+
};
|
|
170
|
+
"/api/v1/announcements/read": {
|
|
171
|
+
parameters: {
|
|
172
|
+
query?: never;
|
|
173
|
+
header?: never;
|
|
174
|
+
path?: never;
|
|
175
|
+
cookie?: never;
|
|
176
|
+
};
|
|
177
|
+
get?: never;
|
|
178
|
+
put?: never;
|
|
179
|
+
/**
|
|
180
|
+
* Mark every visible announcement as read
|
|
181
|
+
* @description Idempotent. Announcements you had already read stay read, and the count only covers the ones this call changed.
|
|
182
|
+
*/
|
|
183
|
+
post: operations["read-all-announcements"];
|
|
184
|
+
delete?: never;
|
|
185
|
+
options?: never;
|
|
186
|
+
head?: never;
|
|
187
|
+
patch?: never;
|
|
188
|
+
trace?: never;
|
|
189
|
+
};
|
|
190
|
+
"/api/v1/announcements/{announcementId}/read": {
|
|
191
|
+
parameters: {
|
|
192
|
+
query?: never;
|
|
193
|
+
header?: never;
|
|
194
|
+
path?: never;
|
|
195
|
+
cookie?: never;
|
|
196
|
+
};
|
|
197
|
+
get?: never;
|
|
198
|
+
put?: never;
|
|
199
|
+
/**
|
|
200
|
+
* Mark one announcement as read
|
|
201
|
+
* @description Idempotent: marking one twice is the same as marking it once. There is no way to mark it
|
|
202
|
+
* unread — having read something is a fact, not a state.
|
|
203
|
+
*/
|
|
204
|
+
post: operations["read-announcement"];
|
|
205
|
+
delete?: never;
|
|
206
|
+
options?: never;
|
|
207
|
+
head?: never;
|
|
208
|
+
patch?: never;
|
|
209
|
+
trace?: never;
|
|
210
|
+
};
|
|
137
211
|
"/api/v1/notification-types": {
|
|
138
212
|
parameters: {
|
|
139
213
|
query?: never;
|
|
@@ -525,6 +599,38 @@ export interface components {
|
|
|
525
599
|
* @enum {string}
|
|
526
600
|
*/
|
|
527
601
|
NotificationAudience: "explicit" | "account" | "address" | "project_members" | "project_owner" | "project_admins" | "broadcast";
|
|
602
|
+
/** @description One announcement, with its text in the language on your preferences. */
|
|
603
|
+
AnnouncementResource: {
|
|
604
|
+
/** Format: uuid */
|
|
605
|
+
id: string;
|
|
606
|
+
title: string;
|
|
607
|
+
/** @description The text as a fragment of HTML, same rules as a notification body */
|
|
608
|
+
body: string;
|
|
609
|
+
severity: components["schemas"]["NotificationSeverity"];
|
|
610
|
+
/** @description You cannot dismiss this one. It is a property of the announcement rather than a second type, because what the operator judges when writing it is "is this important enough to push", and that is the question this asks. */
|
|
611
|
+
critical: boolean;
|
|
612
|
+
/** Format: date-time */
|
|
613
|
+
published_at: string;
|
|
614
|
+
/**
|
|
615
|
+
* Format: date-time
|
|
616
|
+
* @description When it drops out of this list; null means it stays
|
|
617
|
+
*/
|
|
618
|
+
expires_at?: string | null;
|
|
619
|
+
/**
|
|
620
|
+
* Format: date-time
|
|
621
|
+
* @description When you read it; null means you have not
|
|
622
|
+
*/
|
|
623
|
+
read_at?: string | null;
|
|
624
|
+
};
|
|
625
|
+
AnnouncementListResource: {
|
|
626
|
+
items: components["schemas"]["AnnouncementResource"][];
|
|
627
|
+
/** @description How many of them you have not read */
|
|
628
|
+
unread: number;
|
|
629
|
+
};
|
|
630
|
+
AnnouncementReadResultResource: {
|
|
631
|
+
/** @description How many this call changed; already-read ones are not counted */
|
|
632
|
+
marked: number;
|
|
633
|
+
};
|
|
528
634
|
/**
|
|
529
635
|
* @description One notification, with its text rendered in the language on your preferences at the moment
|
|
530
636
|
* it was read.
|
|
@@ -1068,6 +1174,93 @@ export interface operations {
|
|
|
1068
1174
|
};
|
|
1069
1175
|
};
|
|
1070
1176
|
};
|
|
1177
|
+
"list-announcements": {
|
|
1178
|
+
parameters: {
|
|
1179
|
+
query?: never;
|
|
1180
|
+
header?: never;
|
|
1181
|
+
path?: never;
|
|
1182
|
+
cookie?: never;
|
|
1183
|
+
};
|
|
1184
|
+
requestBody?: never;
|
|
1185
|
+
responses: {
|
|
1186
|
+
/** @description OK */
|
|
1187
|
+
200: {
|
|
1188
|
+
headers: {
|
|
1189
|
+
[name: string]: unknown;
|
|
1190
|
+
};
|
|
1191
|
+
content: {
|
|
1192
|
+
"application/json": components["schemas"]["AnnouncementListResource"];
|
|
1193
|
+
};
|
|
1194
|
+
};
|
|
1195
|
+
/** @description Error */
|
|
1196
|
+
default: {
|
|
1197
|
+
headers: {
|
|
1198
|
+
[name: string]: unknown;
|
|
1199
|
+
};
|
|
1200
|
+
content: {
|
|
1201
|
+
"application/json": components["schemas"]["Error"];
|
|
1202
|
+
};
|
|
1203
|
+
};
|
|
1204
|
+
};
|
|
1205
|
+
};
|
|
1206
|
+
"read-all-announcements": {
|
|
1207
|
+
parameters: {
|
|
1208
|
+
query?: never;
|
|
1209
|
+
header?: never;
|
|
1210
|
+
path?: never;
|
|
1211
|
+
cookie?: never;
|
|
1212
|
+
};
|
|
1213
|
+
requestBody?: never;
|
|
1214
|
+
responses: {
|
|
1215
|
+
/** @description OK */
|
|
1216
|
+
200: {
|
|
1217
|
+
headers: {
|
|
1218
|
+
[name: string]: unknown;
|
|
1219
|
+
};
|
|
1220
|
+
content: {
|
|
1221
|
+
"application/json": components["schemas"]["AnnouncementReadResultResource"];
|
|
1222
|
+
};
|
|
1223
|
+
};
|
|
1224
|
+
/** @description Error */
|
|
1225
|
+
default: {
|
|
1226
|
+
headers: {
|
|
1227
|
+
[name: string]: unknown;
|
|
1228
|
+
};
|
|
1229
|
+
content: {
|
|
1230
|
+
"application/json": components["schemas"]["Error"];
|
|
1231
|
+
};
|
|
1232
|
+
};
|
|
1233
|
+
};
|
|
1234
|
+
};
|
|
1235
|
+
"read-announcement": {
|
|
1236
|
+
parameters: {
|
|
1237
|
+
query?: never;
|
|
1238
|
+
header?: never;
|
|
1239
|
+
path: {
|
|
1240
|
+
announcementId: string;
|
|
1241
|
+
};
|
|
1242
|
+
cookie?: never;
|
|
1243
|
+
};
|
|
1244
|
+
requestBody?: never;
|
|
1245
|
+
responses: {
|
|
1246
|
+
/** @description No Content */
|
|
1247
|
+
204: {
|
|
1248
|
+
headers: {
|
|
1249
|
+
[name: string]: unknown;
|
|
1250
|
+
};
|
|
1251
|
+
content?: never;
|
|
1252
|
+
};
|
|
1253
|
+
/** @description Error */
|
|
1254
|
+
default: {
|
|
1255
|
+
headers: {
|
|
1256
|
+
[name: string]: unknown;
|
|
1257
|
+
};
|
|
1258
|
+
content: {
|
|
1259
|
+
"application/json": components["schemas"]["Error"];
|
|
1260
|
+
};
|
|
1261
|
+
};
|
|
1262
|
+
};
|
|
1263
|
+
};
|
|
1071
1264
|
"list-notification-types": {
|
|
1072
1265
|
parameters: {
|
|
1073
1266
|
query?: never;
|