@leaflow/sdk 0.41.0 → 0.42.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.
@@ -34,6 +34,10 @@ 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
+ /** `POST /account/v1/projects/{projectId}/quote` 成功时的响应体。 */
38
+ export type QuoteProjectUsageResult = operations["quote-project-usage"]["responses"][200]["content"]["application/json"];
39
+ /** `POST /account/v1/projects/{projectId}/quote` 的请求体。 */
40
+ export type QuoteProjectUsageBody = NonNullable<operations["quote-project-usage"]["requestBody"]>["content"]["application/json"];
37
41
  /** `POST /account/v1/billing-accounts/{accountKey}/quote` 成功时的响应体。 */
38
42
  export type QuoteUsageResult = operations["quote-usage"]["responses"][200]["content"]["application/json"];
39
43
  /** `POST /account/v1/billing-accounts/{accountKey}/quote` 的请求体。 */
@@ -326,6 +326,52 @@ export interface paths {
326
326
  patch?: never;
327
327
  trace?: never;
328
328
  };
329
+ "/account/v1/projects/{projectId}/quote": {
330
+ parameters: {
331
+ query?: never;
332
+ header?: never;
333
+ path?: never;
334
+ cookie?: never;
335
+ };
336
+ get?: never;
337
+ put?: never;
338
+ /**
339
+ * What a usage would cost in this project
340
+ * @description Prices a set of usages against whatever plan pays for this project, and returns **every
341
+ * intermediate step** rather than a single number.
342
+ *
343
+ * # Why by project rather than by billing account
344
+ *
345
+ * The page that needs this is the one where somebody is about to create a machine, and all it has
346
+ * is a project. Which account pays for that project is billing's own bookkeeping — asking the
347
+ * caller to resolve it first would put that mapping into a page that otherwise has no business
348
+ * knowing accounts exist.
349
+ *
350
+ * # Quantities are raw
351
+ *
352
+ * Seconds, token counts, GiB-seconds: the amount a service reports. Conversion happens here, which
353
+ * is why services keep no conversion tables of their own and why the caller must not do the
354
+ * arithmetic itself.
355
+ *
356
+ * Name each usage by `service` and `product_id` rather than by key: the key is a hash of a
357
+ * convention that has exactly one implementation on purpose.
358
+ *
359
+ * # It is an estimate
360
+ *
361
+ * The engine computes the real amount; this reproduces the same rules. Every step comes back for
362
+ * that reason — a single number that disagrees with the bill says nothing about which step was
363
+ * wrong.
364
+ *
365
+ * `404` means the project has no billing account, or its account is on no plan. Both are worth
366
+ * showing: nothing can be created in either case, because admission refuses it.
367
+ */
368
+ post: operations["quote-project-usage"];
369
+ delete?: never;
370
+ options?: never;
371
+ head?: never;
372
+ patch?: never;
373
+ trace?: never;
374
+ };
329
375
  "/account/v1/billing-accounts/{accountKey}/quote": {
330
376
  parameters: {
331
377
  query?: never;
@@ -1710,6 +1756,41 @@ export interface operations {
1710
1756
  };
1711
1757
  };
1712
1758
  };
1759
+ "quote-project-usage": {
1760
+ parameters: {
1761
+ query?: never;
1762
+ header?: never;
1763
+ path: {
1764
+ projectId: string;
1765
+ };
1766
+ cookie?: never;
1767
+ };
1768
+ requestBody: {
1769
+ content: {
1770
+ "application/json": components["schemas"]["QuoteRequest"];
1771
+ };
1772
+ };
1773
+ responses: {
1774
+ /** @description OK */
1775
+ 200: {
1776
+ headers: {
1777
+ [name: string]: unknown;
1778
+ };
1779
+ content: {
1780
+ "application/json": components["schemas"]["Quote"];
1781
+ };
1782
+ };
1783
+ /** @description Error */
1784
+ default: {
1785
+ headers: {
1786
+ [name: string]: unknown;
1787
+ };
1788
+ content: {
1789
+ "application/json": components["schemas"]["Error"];
1790
+ };
1791
+ };
1792
+ };
1793
+ };
1713
1794
  "quote-usage": {
1714
1795
  parameters: {
1715
1796
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {