@leaflow/sdk 0.34.0 → 0.35.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.
@@ -18,6 +18,10 @@ export type ListCreditTransactionsResult = operations["list-credit-transactions"
18
18
  export type ReadBillingAccountBalanceResult = operations["read-billing-account-balance"]["responses"][200]["content"]["application/json"];
19
19
  /** `PUT /account/v1/billing-accounts/{accountKey}/projects/{projectId}` 成功时的响应体。 */
20
20
  export type BindProjectToBillingAccountResult = operations["bind-project-to-billing-account"]["responses"][200]["content"]["application/json"];
21
+ /** `GET /account/v1/billing-accounts/{accountKey}/orders` 成功时的响应体。 */
22
+ export type ListOrdersResult = operations["list-orders"]["responses"][200]["content"]["application/json"];
23
+ /** `GET /account/v1/billing-accounts/{accountKey}/orders/{orderId}` 成功时的响应体。 */
24
+ export type GetOrderResult = operations["get-order"]["responses"][200]["content"]["application/json"];
21
25
  /** `GET /account/v1/billing-accounts/{accountKey}/top-ups` 成功时的响应体。 */
22
26
  export type ListTopUpsResult = operations["list-top-ups"]["responses"][200]["content"]["application/json"];
23
27
  /** `POST /account/v1/billing-accounts/{accountKey}/top-ups` 成功时的响应体。 */
@@ -167,6 +167,54 @@ export interface paths {
167
167
  patch?: never;
168
168
  trace?: never;
169
169
  };
170
+ "/account/v1/billing-accounts/{accountKey}/orders": {
171
+ parameters: {
172
+ query?: never;
173
+ header?: never;
174
+ path?: never;
175
+ cookie?: never;
176
+ };
177
+ /**
178
+ * My orders
179
+ * @description Every provisioning request made against the projects this account pays for, newest first.
180
+ *
181
+ * An order that never went through stays here on purpose. Removing it would leave nothing to
182
+ * look at in exactly the case someone wants to look: a resource was asked for, was not
183
+ * delivered, and the question is what happened.
184
+ *
185
+ * The list carries no lines. An order has only a handful, but shipping them on every page
186
+ * means carrying data no column shows.
187
+ */
188
+ get: operations["list-orders"];
189
+ put?: never;
190
+ post?: never;
191
+ delete?: never;
192
+ options?: never;
193
+ head?: never;
194
+ patch?: never;
195
+ trace?: never;
196
+ };
197
+ "/account/v1/billing-accounts/{accountKey}/orders/{orderId}": {
198
+ parameters: {
199
+ query?: never;
200
+ header?: never;
201
+ path?: never;
202
+ cookie?: never;
203
+ };
204
+ /**
205
+ * One order, with its lines
206
+ * @description Each line names what was asked for and how much of it. This is the only route that carries
207
+ * them.
208
+ */
209
+ get: operations["get-order"];
210
+ put?: never;
211
+ post?: never;
212
+ delete?: never;
213
+ options?: never;
214
+ head?: never;
215
+ patch?: never;
216
+ trace?: never;
217
+ };
170
218
  "/account/v1/billing-accounts/{accountKey}/top-ups": {
171
219
  parameters: {
172
220
  query?: never;
@@ -638,6 +686,36 @@ export interface components {
638
686
  UpdateBillingAccountRequestBody: {
639
687
  display_name: string;
640
688
  };
689
+ Order: {
690
+ id: string;
691
+ project_id: string;
692
+ placed_by: string;
693
+ /**
694
+ * @description Whether the request went through. It is not the state of what was provisioned: that
695
+ * belongs to each resource and outlives the order.
696
+ * @enum {string}
697
+ */
698
+ state: "pending" | "fulfilled" | "failed";
699
+ failure_reason?: string;
700
+ /** Format: date-time */
701
+ created_at: string;
702
+ /** @description Only present on the single-order route. */
703
+ lines?: components["schemas"]["OrderLine"][];
704
+ };
705
+ OrderLine: {
706
+ id: string;
707
+ /** @enum {string} */
708
+ action: "add" | "renew" | "modify" | "remove";
709
+ /** @description Which service holds the thing, for example `compute`. */
710
+ service: string;
711
+ /** @description That service's own catalogue identifier for what was asked for. */
712
+ product_id: string;
713
+ /** Format: int64 */
714
+ quantity: number;
715
+ };
716
+ OrderList: {
717
+ orders: components["schemas"]["Order"][];
718
+ };
641
719
  TopUpList: {
642
720
  top_ups: components["schemas"]["TopUpStatus"][];
643
721
  };
@@ -1251,6 +1329,77 @@ export interface operations {
1251
1329
  };
1252
1330
  };
1253
1331
  };
1332
+ "list-orders": {
1333
+ parameters: {
1334
+ query?: never;
1335
+ header?: never;
1336
+ path: {
1337
+ /**
1338
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1339
+ * which is why the key is what addresses the account.
1340
+ */
1341
+ accountKey: components["parameters"]["AccountKey"];
1342
+ };
1343
+ cookie?: never;
1344
+ };
1345
+ requestBody?: never;
1346
+ responses: {
1347
+ /** @description OK */
1348
+ 200: {
1349
+ headers: {
1350
+ [name: string]: unknown;
1351
+ };
1352
+ content: {
1353
+ "application/json": components["schemas"]["OrderList"];
1354
+ };
1355
+ };
1356
+ /** @description Error */
1357
+ default: {
1358
+ headers: {
1359
+ [name: string]: unknown;
1360
+ };
1361
+ content: {
1362
+ "application/json": components["schemas"]["Error"];
1363
+ };
1364
+ };
1365
+ };
1366
+ };
1367
+ "get-order": {
1368
+ parameters: {
1369
+ query?: never;
1370
+ header?: never;
1371
+ path: {
1372
+ /**
1373
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1374
+ * which is why the key is what addresses the account.
1375
+ */
1376
+ accountKey: components["parameters"]["AccountKey"];
1377
+ orderId: string;
1378
+ };
1379
+ cookie?: never;
1380
+ };
1381
+ requestBody?: never;
1382
+ responses: {
1383
+ /** @description OK */
1384
+ 200: {
1385
+ headers: {
1386
+ [name: string]: unknown;
1387
+ };
1388
+ content: {
1389
+ "application/json": components["schemas"]["Order"];
1390
+ };
1391
+ };
1392
+ /** @description Error */
1393
+ default: {
1394
+ headers: {
1395
+ [name: string]: unknown;
1396
+ };
1397
+ content: {
1398
+ "application/json": components["schemas"]["Error"];
1399
+ };
1400
+ };
1401
+ };
1402
+ };
1254
1403
  "list-top-ups": {
1255
1404
  parameters: {
1256
1405
  query?: never;
@@ -16,8 +16,12 @@ export type CountUnreadNotificationsQuery = operations["count-unread-notificatio
16
16
  export type GetNotificationResult = operations["get-notification"]["responses"][200]["content"]["application/json"];
17
17
  /** `POST /api/v1/notifications/{notificationId}/read` 成功时的响应体。 */
18
18
  export type MarkNotificationReadResult = operations["mark-notification-read"]["responses"][200]["content"]["application/json"];
19
+ /** `DELETE /api/v1/notifications/{notificationId}/read` 成功时的响应体。 */
20
+ export type MarkNotificationUnreadResult = operations["mark-notification-unread"]["responses"][200]["content"]["application/json"];
19
21
  /** `POST /api/v1/notifications/{notificationId}/archive` 成功时的响应体。 */
20
22
  export type ArchiveNotificationResult = operations["archive-notification"]["responses"][200]["content"]["application/json"];
23
+ /** `DELETE /api/v1/notifications/{notificationId}/archive` 成功时的响应体。 */
24
+ export type UnarchiveNotificationResult = operations["unarchive-notification"]["responses"][200]["content"]["application/json"];
21
25
  /** `GET /api/v1/announcements` 成功时的响应体。 */
22
26
  export type ListAnnouncementsResult = operations["list-announcements"]["responses"][200]["content"]["application/json"];
23
27
  /** `POST /api/v1/announcements/read` 成功时的响应体。 */
@@ -14,9 +14,10 @@ export interface paths {
14
14
  * List notifications addressed to you
15
15
  * @description Returns notifications in reverse chronological order, newest first.
16
16
  *
17
- * Announcements published to the whole platform appear here alongside notifications
18
- * addressed to you individually and are distinguished by `kind`. They are read and archived
19
- * through the same operations.
17
+ * Announcements are not in this list. They are one row for the whole platform rather than
18
+ * one per reader, so they are listed, read and counted by their own operations under
19
+ * `/api/v1/announcements`. `kind` is on every item here for clients that merge the two lists
20
+ * themselves, and it is `notification` for everything this operation returns.
20
21
  */
21
22
  get: operations["list-notifications"];
22
23
  put?: never;
@@ -107,7 +108,14 @@ export interface paths {
107
108
  * @description Marking a notification that is already read succeeds and changes nothing.
108
109
  */
109
110
  post: operations["mark-notification-read"];
110
- delete?: never;
111
+ /**
112
+ * Mark one notification as unread
113
+ * @description Puts it back in the unread count, which is what somebody wants after opening a thing by
114
+ * accident and needing it to stay in front of them.
115
+ *
116
+ * Marking one that is already unread succeeds and changes nothing.
117
+ */
118
+ delete: operations["mark-notification-unread"];
111
119
  options?: never;
112
120
  head?: never;
113
121
  patch?: never;
@@ -128,7 +136,18 @@ export interface paths {
128
136
  * `include_archived` to see it again. Archiving also marks it read.
129
137
  */
130
138
  post: operations["archive-notification"];
131
- delete?: never;
139
+ /**
140
+ * Take one notification out of the archive
141
+ * @description Returns it to the default listing. Archiving is one click away from anything in the list,
142
+ * so undoing it has to be too; without this operation a mistaken archive is permanent, and
143
+ * the notification stays reachable only by asking for archived ones.
144
+ *
145
+ * It does not mark it unread again: archiving marked it read, and that it was read is still
146
+ * true. Use `mark-notification-unread` for that.
147
+ *
148
+ * Unarchiving one that is not archived succeeds and changes nothing.
149
+ */
150
+ delete: operations["unarchive-notification"];
132
151
  options?: never;
133
152
  head?: never;
134
153
  patch?: never;
@@ -1142,6 +1161,38 @@ export interface operations {
1142
1161
  };
1143
1162
  };
1144
1163
  };
1164
+ "mark-notification-unread": {
1165
+ parameters: {
1166
+ query?: never;
1167
+ header?: never;
1168
+ path: {
1169
+ /** @description The notification, or the announcement when kind is announcement */
1170
+ notificationId: components["parameters"]["NotificationId"];
1171
+ };
1172
+ cookie?: never;
1173
+ };
1174
+ requestBody?: never;
1175
+ responses: {
1176
+ /** @description OK */
1177
+ 200: {
1178
+ headers: {
1179
+ [name: string]: unknown;
1180
+ };
1181
+ content: {
1182
+ "application/json": components["schemas"]["NotificationResource"];
1183
+ };
1184
+ };
1185
+ /** @description Error */
1186
+ default: {
1187
+ headers: {
1188
+ [name: string]: unknown;
1189
+ };
1190
+ content: {
1191
+ "application/json": components["schemas"]["Error"];
1192
+ };
1193
+ };
1194
+ };
1195
+ };
1145
1196
  "archive-notification": {
1146
1197
  parameters: {
1147
1198
  query?: never;
@@ -1174,6 +1225,38 @@ export interface operations {
1174
1225
  };
1175
1226
  };
1176
1227
  };
1228
+ "unarchive-notification": {
1229
+ parameters: {
1230
+ query?: never;
1231
+ header?: never;
1232
+ path: {
1233
+ /** @description The notification, or the announcement when kind is announcement */
1234
+ notificationId: components["parameters"]["NotificationId"];
1235
+ };
1236
+ cookie?: never;
1237
+ };
1238
+ requestBody?: never;
1239
+ responses: {
1240
+ /** @description OK */
1241
+ 200: {
1242
+ headers: {
1243
+ [name: string]: unknown;
1244
+ };
1245
+ content: {
1246
+ "application/json": components["schemas"]["NotificationResource"];
1247
+ };
1248
+ };
1249
+ /** @description Error */
1250
+ default: {
1251
+ headers: {
1252
+ [name: string]: unknown;
1253
+ };
1254
+ content: {
1255
+ "application/json": components["schemas"]["Error"];
1256
+ };
1257
+ };
1258
+ };
1259
+ };
1177
1260
  "list-announcements": {
1178
1261
  parameters: {
1179
1262
  query?: never;
@@ -18,8 +18,8 @@ export interface paths {
18
18
  * pages, which are reached before a project has been selected. It returns a narrower shape
19
19
  * than the authenticated operations and is not paginated.
20
20
  *
21
- * Platform announcements are not served here. They belong to the notification service, which
22
- * owns announcements for the whole platform.
21
+ * Platform announcements are not part of this API. They are served by the notification
22
+ * service, which owns platform-wide announcements.
23
23
  */
24
24
  get: operations["list-notices"];
25
25
  put?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {