@leaflow/sdk 0.0.0-dev.125.ged02bc4 → 0.0.0-dev.129.g409f04f

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.
@@ -680,6 +680,12 @@ export interface components {
680
680
  code?: string;
681
681
  message: string;
682
682
  meta?: {
683
+ /**
684
+ * @description Present on every response whose `code` is `VALIDATION_FAILED`, and on no
685
+ * other response.
686
+ */
687
+ violations?: components["schemas"]["Violation"][];
688
+ } & {
683
689
  [key: string]: unknown;
684
690
  };
685
691
  /** Format: int64 */
@@ -1423,6 +1429,29 @@ export interface components {
1423
1429
  UpdateFolderRequestBody: {
1424
1430
  name: string;
1425
1431
  };
1432
+ /**
1433
+ * @description A single mismatch between the request and the contract.
1434
+ *
1435
+ * Use `field` to locate the input, `rule` to decide what to tell the user, and
1436
+ * `reason` only for diagnostics.
1437
+ */
1438
+ Violation: {
1439
+ /**
1440
+ * @description Dot-separated path to the field, such as `name` or
1441
+ * `schedule.0.start_time_seconds`.
1442
+ */
1443
+ field: string;
1444
+ /**
1445
+ * @description The JSON Schema keyword that failed, such as `minLength`, `minimum` or
1446
+ * `pattern`.
1447
+ */
1448
+ rule: string;
1449
+ /**
1450
+ * @description The validator's own wording, in English. Intended for diagnostics; do not
1451
+ * display it to end users.
1452
+ */
1453
+ reason?: string;
1454
+ };
1426
1455
  };
1427
1456
  responses: never;
1428
1457
  parameters: never;
@@ -62,6 +62,10 @@ export type SetDefaultPaymentMethodResult = operations["set-default-payment-meth
62
62
  export type PayInvoiceResult = operations["pay-invoice"]["responses"][200]["content"]["application/json"];
63
63
  /** `POST /account/v1/invoices/{invoiceId}/pay` 的请求体。 */
64
64
  export type PayInvoiceBody = NonNullable<operations["pay-invoice"]["requestBody"]>["content"]["application/json"];
65
+ /** `POST /account/v1/payments` 成功时的响应体。 */
66
+ export type PayTogetherResult = operations["pay-together"]["responses"][200]["content"]["application/json"];
67
+ /** `POST /account/v1/payments` 的请求体。 */
68
+ export type PayTogetherBody = NonNullable<operations["pay-together"]["requestBody"]>["content"]["application/json"];
65
69
  /** `POST /account/v1/orders/{orderId}/pay` 成功时的响应体。 */
66
70
  export type PayOrderResult = operations["pay-order"]["responses"][200]["content"]["application/json"];
67
71
  /** `POST /account/v1/orders/{orderId}/pay` 的请求体。 */
@@ -86,12 +90,12 @@ export type ListCreditGrantsQuery = operations["list-credit-grants"]["parameters
86
90
  export type ListAllocationsResult = operations["list-allocations"]["responses"][200]["content"]["application/json"];
87
91
  /** `GET /account/v1/allocations` 的查询参数。 */
88
92
  export type ListAllocationsQuery = operations["list-allocations"]["parameters"]["query"];
93
+ /** `GET /account/v1/refunds` 成功时的响应体。 */
94
+ export type ListRefundsResult = operations["list-refunds"]["responses"][200]["content"]["application/json"];
89
95
  /** `POST /account/v1/refunds` 成功时的响应体。 */
90
96
  export type RequestRefundResult = operations["request-refund"]["responses"][201]["content"]["application/json"];
91
97
  /** `POST /account/v1/refunds` 的请求体。 */
92
98
  export type RequestRefundBody = NonNullable<operations["request-refund"]["requestBody"]>["content"]["application/json"];
93
- /** `GET /account/v1/refunds` 成功时的响应体。 */
94
- export type ListRefundsResult = operations["list-refunds"]["responses"][200]["content"]["application/json"];
95
99
  /** `GET /account/v1/usage-charges` 成功时的响应体。 */
96
100
  export type ListUsageChargesResult = operations["list-usage-charges"]["responses"][200]["content"]["application/json"];
97
101
  /** `GET /account/v1/usage-charges` 的查询参数。 */
@@ -166,6 +170,8 @@ export type ListOrdersResult = operations["list-orders"]["responses"][200]["cont
166
170
  export type ListOrdersQuery = operations["list-orders"]["parameters"]["query"];
167
171
  /** `GET /account/v1/orders/{orderId}` 成功时的响应体。 */
168
172
  export type GetOrderResult = operations["get-order"]["responses"][200]["content"]["application/json"];
173
+ /** `POST /account/v1/orders/{orderId}/cancel` 成功时的响应体。 */
174
+ export type CancelScheduledChangeResult = operations["cancel-scheduled-change"]["responses"][200]["content"]["application/json"];
169
175
  /** `GET /account/v1/orders/{orderId}/items` 成功时的响应体。 */
170
176
  export type ListOrderItemsResult = operations["list-order-items"]["responses"][200]["content"]["application/json"];
171
177
  /** `GET /account/v1/orders/{orderId}/refund-quote` 成功时的响应体。 */
@@ -419,6 +419,38 @@ export interface paths {
419
419
  patch?: never;
420
420
  trace?: never;
421
421
  };
422
+ "/account/v1/payments": {
423
+ parameters: {
424
+ query?: never;
425
+ header?: never;
426
+ path?: never;
427
+ cookie?: never;
428
+ };
429
+ get?: never;
430
+ put?: never;
431
+ /**
432
+ * Pay several outstanding invoices and orders at once
433
+ * @description All of them or none. Nothing is settled unless everything named here can be, so a
434
+ * partial result is not a state this can leave behind.
435
+ *
436
+ * The balance is not split across the two cases: either it covers the whole total and
437
+ * everything is settled from it, or it is left untouched and the full total is collected
438
+ * through the provider. It is never partly spent against an unpaid remainder.
439
+ *
440
+ * When the provider is needed, this returns a checkout address and settles nothing.
441
+ * Call it again once the payment has landed — the balance then covers the total and the
442
+ * same call settles everything.
443
+ *
444
+ * Anything already paid is skipped rather than refused, so a repeated call after a
445
+ * partial success is safe.
446
+ */
447
+ post: operations["pay-together"];
448
+ delete?: never;
449
+ options?: never;
450
+ head?: never;
451
+ patch?: never;
452
+ trace?: never;
453
+ };
422
454
  "/account/v1/orders/{orderId}/pay": {
423
455
  parameters: {
424
456
  query?: never;
@@ -1086,6 +1118,33 @@ export interface paths {
1086
1118
  patch?: never;
1087
1119
  trace?: never;
1088
1120
  };
1121
+ "/account/v1/orders/{orderId}/cancel": {
1122
+ parameters: {
1123
+ query?: never;
1124
+ header?: never;
1125
+ path: {
1126
+ orderId: components["parameters"]["OrderId"];
1127
+ };
1128
+ cookie?: never;
1129
+ };
1130
+ get?: never;
1131
+ put?: never;
1132
+ /**
1133
+ * Call off a plan change that has not taken effect yet
1134
+ * @description Only for a change scheduled for the end of the period, and only while it is still
1135
+ * pending. An immediate change has already happened by the time it is placed, and there is
1136
+ * nothing to call off.
1137
+ *
1138
+ * Nothing was charged or returned when it was scheduled, so nothing moves here either. The
1139
+ * subscription keeps running on what it is on now, and the item is free to be changed again.
1140
+ */
1141
+ post: operations["cancel-scheduled-change"];
1142
+ delete?: never;
1143
+ options?: never;
1144
+ head?: never;
1145
+ patch?: never;
1146
+ trace?: never;
1147
+ };
1089
1148
  "/account/v1/orders/{orderId}/items": {
1090
1149
  parameters: {
1091
1150
  query?: never;
@@ -1241,6 +1300,12 @@ export interface components {
1241
1300
  code?: string;
1242
1301
  message: string;
1243
1302
  meta?: {
1303
+ /**
1304
+ * @description Present on every response whose `code` is `VALIDATION_FAILED`, and on no
1305
+ * other response.
1306
+ */
1307
+ violations?: components["schemas"]["Violation"][];
1308
+ } & {
1244
1309
  [key: string]: unknown;
1245
1310
  };
1246
1311
  /** Format: int64 */
@@ -1542,8 +1607,14 @@ export interface components {
1542
1607
  Quote: {
1543
1608
  lines?: components["schemas"]["QuoteLineResult"][];
1544
1609
  changes?: components["schemas"]["QuoteChangeResult"][];
1545
- /** @description What would be owed in total. Amounts to be returned are not netted off it. */
1546
- total: components["schemas"]["Money"];
1610
+ /**
1611
+ * @description What would be owed in total. Amounts to be returned are not netted off it.
1612
+ *
1613
+ * Null when any line could not be priced. What would be owed is not knowable then, and a
1614
+ * total that silently left the unpriced lines out would read as a smaller bill rather than
1615
+ * an incomplete one — the per-line `priced` flag is easy to skip, a missing total is not.
1616
+ */
1617
+ total?: components["schemas"]["Money"] | null;
1547
1618
  /** @description What would be returned in total. */
1548
1619
  total_refundable?: components["schemas"]["Money"];
1549
1620
  currency: string;
@@ -1569,6 +1640,17 @@ export interface components {
1569
1640
  currency: string;
1570
1641
  /** @enum {string} */
1571
1642
  status: "active" | "suspended" | "closed";
1643
+ /**
1644
+ * @description How far past the suspension threshold this account may go before its resources are
1645
+ * suspended. "0" means none: the account is suspended as soon as it crosses the threshold.
1646
+ */
1647
+ grace_amount?: string;
1648
+ /**
1649
+ * Format: int64
1650
+ * @description How long this account has to top up after crossing the suspension threshold.
1651
+ * 0 means none. Whichever runs out first — this or grace_amount — ends the grace.
1652
+ */
1653
+ grace_period_seconds?: number;
1572
1654
  /** Format: date-time */
1573
1655
  created_at: string;
1574
1656
  };
@@ -1830,6 +1912,20 @@ export interface components {
1830
1912
  use_balance?: boolean;
1831
1913
  return_url?: string;
1832
1914
  };
1915
+ /**
1916
+ * @description Name at least one invoice or order. They must all belong to the same account and share
1917
+ * its currency; anything else is refused rather than partly paid.
1918
+ */
1919
+ PayTogetherRequest: {
1920
+ invoice_ids?: string[];
1921
+ order_ids?: string[];
1922
+ return_url?: string;
1923
+ /**
1924
+ * @description Required when the provider is involved, because that is where the money moves. The
1925
+ * same key returns the same checkout address instead of opening a second one.
1926
+ */
1927
+ idempotency_key?: string;
1928
+ };
1833
1929
  /**
1834
1930
  * @description Where the payment has got to.
1835
1931
  *
@@ -2373,11 +2469,23 @@ export interface components {
2373
2469
  amount: components["schemas"]["Money"];
2374
2470
  /** @description What is still outstanding. Zero once paid. */
2375
2471
  amount_due?: components["schemas"]["Money"];
2472
+ /** @description How much of `refundable_amount` has already gone back. */
2473
+ refunded_amount?: components["schemas"]["Money"];
2376
2474
  /**
2377
- * @description Returned as part of a downgrade. It is returned to the sources that originally paid
2378
- * rather than deducted from `amount`.
2475
+ * @description When a plan change takes effect. `none` on anything that is not a change.
2476
+ *
2477
+ * `period_end` orders stay pending until the current paid period runs out. Renewing in
2478
+ * the meantime moves that moment along with it.
2479
+ * @enum {string}
2379
2480
  */
2380
- refunded_amount?: components["schemas"]["Money"];
2481
+ change_effective?: "none" | "immediate" | "period_end";
2482
+ /**
2483
+ * @description What a downgrade gives back. It is returned to the sources that originally paid
2484
+ * rather than deducted from `amount`, so paying with granted credit gives back credit.
2485
+ *
2486
+ * Always "0" on a `period_end` change: nothing is left of the period at its end.
2487
+ */
2488
+ refundable_amount?: components["schemas"]["Money"];
2381
2489
  /**
2382
2490
  * Format: date-time
2383
2491
  * @description When the funds and any stock held for this order are released. After this it can no
@@ -2707,6 +2815,29 @@ export interface components {
2707
2815
  /** Format: int64 */
2708
2816
  total_count?: number;
2709
2817
  };
2818
+ /**
2819
+ * @description A single mismatch between the request and the contract.
2820
+ *
2821
+ * Use `field` to locate the input, `rule` to decide what to tell the user, and
2822
+ * `reason` only for diagnostics.
2823
+ */
2824
+ Violation: {
2825
+ /**
2826
+ * @description Dot-separated path to the field, such as `name` or
2827
+ * `schedule.0.start_time_seconds`.
2828
+ */
2829
+ field: string;
2830
+ /**
2831
+ * @description The JSON Schema keyword that failed, such as `minLength`, `minimum` or
2832
+ * `pattern`.
2833
+ */
2834
+ rule: string;
2835
+ /**
2836
+ * @description The validator's own wording, in English. Intended for diagnostics; do not
2837
+ * display it to end users.
2838
+ */
2839
+ reason?: string;
2840
+ };
2710
2841
  };
2711
2842
  responses: {
2712
2843
  /** @description Unchanged since the `ETag` that was sent. No body. */
@@ -3409,6 +3540,31 @@ export interface operations {
3409
3540
  default: components["responses"]["Error"];
3410
3541
  };
3411
3542
  };
3543
+ "pay-together": {
3544
+ parameters: {
3545
+ query?: never;
3546
+ header?: never;
3547
+ path?: never;
3548
+ cookie?: never;
3549
+ };
3550
+ requestBody: {
3551
+ content: {
3552
+ "application/json": components["schemas"]["PayTogetherRequest"];
3553
+ };
3554
+ };
3555
+ responses: {
3556
+ /** @description OK */
3557
+ 200: {
3558
+ headers: {
3559
+ [name: string]: unknown;
3560
+ };
3561
+ content: {
3562
+ "application/json": components["schemas"]["PaymentResult"];
3563
+ };
3564
+ };
3565
+ default: components["responses"]["Error"];
3566
+ };
3567
+ };
3412
3568
  "pay-order": {
3413
3569
  parameters: {
3414
3570
  query?: never;
@@ -4297,6 +4453,29 @@ export interface operations {
4297
4453
  default: components["responses"]["Error"];
4298
4454
  };
4299
4455
  };
4456
+ "cancel-scheduled-change": {
4457
+ parameters: {
4458
+ query?: never;
4459
+ header?: never;
4460
+ path: {
4461
+ orderId: components["parameters"]["OrderId"];
4462
+ };
4463
+ cookie?: never;
4464
+ };
4465
+ requestBody?: never;
4466
+ responses: {
4467
+ /** @description OK */
4468
+ 200: {
4469
+ headers: {
4470
+ [name: string]: unknown;
4471
+ };
4472
+ content: {
4473
+ "application/json": components["schemas"]["Order"];
4474
+ };
4475
+ };
4476
+ default: components["responses"]["Error"];
4477
+ };
4478
+ };
4300
4479
  "list-order-items": {
4301
4480
  parameters: {
4302
4481
  query?: {