@leaflow/sdk 0.0.0-dev.101.g01ce843 → 0.0.0-dev.103.g8b5237f

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.
@@ -34,6 +34,8 @@ export type ListChargesResult = operations["list-charges"]["responses"][200]["co
34
34
  export type ListInvoicesResult = operations["list-invoices"]["responses"][200]["content"]["application/json"];
35
35
  /** `GET /account/v1/billing-accounts/{accountKey}/invoices/{invoiceId}` 成功时的响应体。 */
36
36
  export type GetInvoiceResult = operations["get-invoice"]["responses"][200]["content"]["application/json"];
37
+ /** `GET /account/v1/projects/{projectId}/billing-account` 成功时的响应体。 */
38
+ export type ReadProjectBillingAccountResult = operations["read-project-billing-account"]["responses"][200]["content"]["application/json"];
37
39
  /** `POST /account/v1/projects/{projectId}/quote` 成功时的响应体。 */
38
40
  export type QuoteProjectUsageResult = operations["quote-project-usage"]["responses"][200]["content"]["application/json"];
39
41
  /** `POST /account/v1/projects/{projectId}/quote` 的请求体。 */
@@ -326,6 +326,49 @@ export interface paths {
326
326
  patch?: never;
327
327
  trace?: never;
328
328
  };
329
+ "/account/v1/projects/{projectId}/billing-account": {
330
+ parameters: {
331
+ query?: never;
332
+ header?: never;
333
+ path?: never;
334
+ cookie?: never;
335
+ };
336
+ /**
337
+ * Which account pays for this project
338
+ * @description The account a project's resources are charged to, resolved from the project rather than
339
+ * guessed.
340
+ *
341
+ * ## Why a console needs this
342
+ *
343
+ * Everything in a console happens inside a project, while billing accounts belong to a person —
344
+ * and a person can have many. Showing "the first one" next to a sentence like *you are
345
+ * overdrawn, new resources will be refused* pairs one account's balance with another account's
346
+ * rule. Both directions are wrong and one of them is silent: the figures look healthy while
347
+ * creating anything is refused, and the refusal names a reason the page just contradicted.
348
+ *
349
+ * ## Being a member is enough to ask, but not to see the money
350
+ *
351
+ * The answer is the account's identity, not its balance. A project's members are not
352
+ * necessarily the people paying for it — a company account can pay for a project someone else
353
+ * works in — and their balance is not those members' business. Whoever owns the account reads
354
+ * the figures from the balance route as before; `owned_by_me` says which case this is, so a
355
+ * page can tell "you are overdrawn" apart from "ask whoever pays for this project".
356
+ *
357
+ * ## A project with no account is a normal state, and it answers 404
358
+ *
359
+ * A project nobody has bound yet cannot create resources at all — admission refuses it. That is
360
+ * worth saying plainly ("this project has no billing account, bind one") rather than falling
361
+ * back to some other account of theirs, which is how the wrong-account problem started.
362
+ */
363
+ get: operations["read-project-billing-account"];
364
+ put?: never;
365
+ post?: never;
366
+ delete?: never;
367
+ options?: never;
368
+ head?: never;
369
+ patch?: never;
370
+ trace?: never;
371
+ };
329
372
  "/account/v1/projects/{projectId}/quote": {
330
373
  parameters: {
331
374
  query?: never;
@@ -1231,6 +1274,19 @@ export interface components {
1231
1274
  */
1232
1275
  available: string;
1233
1276
  };
1277
+ /** @description The account a project's resources are charged to */
1278
+ ProjectBillingAccount: {
1279
+ account_key: string;
1280
+ project_id: string;
1281
+ display_name: string;
1282
+ currency: components["schemas"]["Currency"];
1283
+ /**
1284
+ * @description Whether the caller owns this account, and therefore whether the balance routes will
1285
+ * answer for it. False means someone else pays for this project: the figures are theirs,
1286
+ * not the caller's, and a page should say so rather than showing nothing.
1287
+ */
1288
+ owned_by_me: boolean;
1289
+ };
1234
1290
  /** @description Which account pays for which project, as it stands once the request has been applied */
1235
1291
  ProjectBinding: {
1236
1292
  account_key: string;
@@ -1315,6 +1371,48 @@ export interface components {
1315
1371
  * just started as zero
1316
1372
  */
1317
1373
  total: string;
1374
+ /**
1375
+ * @description Which meter it is for, when the charge came from usage. A hash, not something to show —
1376
+ * it is here so two rows can be told apart programmatically and so support can line a row
1377
+ * up with the catalogue.
1378
+ */
1379
+ feature_key?: string;
1380
+ /**
1381
+ * @description Whether this figure moves. A usage charge climbs through the period; a flat fee does not.
1382
+ * Without it, the same number on two refreshes could mean "nobody used it" or "it never
1383
+ * moves", and those need different next steps.
1384
+ * @enum {string}
1385
+ */
1386
+ type: "usage_based" | "flat_fee";
1387
+ /**
1388
+ * Format: date-time
1389
+ * @description Start of the service period this charge covers.
1390
+ *
1391
+ * This is what tells two same-named rows apart. Something billed by the hour produces
1392
+ * hundreds of identically named charges in a month, and a list carrying only a name and an
1393
+ * amount shows them as a wall of duplicates — which is what it looks like today.
1394
+ */
1395
+ period_from: string;
1396
+ /**
1397
+ * Format: date-time
1398
+ * @description End of the service period this charge covers.
1399
+ */
1400
+ period_to: string;
1401
+ /**
1402
+ * @description How much of this charge was covered by credit, as a decimal string.
1403
+ *
1404
+ * It is the answer to "I have a balance, why am I still being charged". Without it the
1405
+ * customer sees a number that disagrees with what they expected and the only thing that
1406
+ * explains it is on our side.
1407
+ */
1408
+ credits?: string;
1409
+ /**
1410
+ * @description How much was taken off by a discount, as a decimal string. A usage allowance (the first N
1411
+ * units free) lands here too.
1412
+ */
1413
+ discounts?: string;
1414
+ /** @description Free text from the charge, usually empty. Set on charges raised by hand. */
1415
+ description?: string;
1318
1416
  };
1319
1417
  ChargeList: {
1320
1418
  currency: components["schemas"]["Currency"];
@@ -1959,6 +2057,38 @@ export interface operations {
1959
2057
  };
1960
2058
  };
1961
2059
  };
2060
+ "read-project-billing-account": {
2061
+ parameters: {
2062
+ query?: never;
2063
+ header?: never;
2064
+ path: {
2065
+ /** @description The project being worked in */
2066
+ projectId: string;
2067
+ };
2068
+ cookie?: never;
2069
+ };
2070
+ requestBody?: never;
2071
+ responses: {
2072
+ /** @description OK */
2073
+ 200: {
2074
+ headers: {
2075
+ [name: string]: unknown;
2076
+ };
2077
+ content: {
2078
+ "application/json": components["schemas"]["ProjectBillingAccount"];
2079
+ };
2080
+ };
2081
+ /** @description Error */
2082
+ default: {
2083
+ headers: {
2084
+ [name: string]: unknown;
2085
+ };
2086
+ content: {
2087
+ "application/json": components["schemas"]["Error"];
2088
+ };
2089
+ };
2090
+ };
2091
+ };
1962
2092
  "quote-project-usage": {
1963
2093
  parameters: {
1964
2094
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.0.0-dev.101.g01ce843",
3
+ "version": "0.0.0-dev.103.g8b5237f",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {