@leaflow/sdk 0.126.0 → 0.127.1

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.
Files changed (39) hide show
  1. package/dist/billing/type/order/v1/generated/models.d.ts +26 -1
  2. package/dist/billing/type/order/v1/generated/validators/accountBalance.zod.js +1 -1
  3. package/dist/billing/type/order/v1/generated/validators/monthlyStatement.zod.d.ts +36 -0
  4. package/dist/billing/type/order/v1/generated/validators/monthlyStatement.zod.js +30 -0
  5. package/dist/billing/type/order/v1/generated/validators/monthlyStatementList.zod.d.ts +43 -0
  6. package/dist/billing/type/order/v1/generated/validators/monthlyStatementList.zod.js +14 -0
  7. package/dist/billing/v1/generated/functions.d.ts +32 -6
  8. package/dist/billing/v1/generated/functions.js +35 -5
  9. package/dist/billing/v1/generated/models.d.ts +49 -1
  10. package/dist/billing/v1/generated/schemas.zod.d.ts +25 -5
  11. package/dist/billing/v1/generated/schemas.zod.js +35 -5
  12. package/dist/billing/v1/generated/validators/accountBalance.zod.js +1 -1
  13. package/dist/billing/v1/generated/validators/listMonthlyStatementsParams.zod.d.ts +21 -0
  14. package/dist/billing/v1/generated/validators/listMonthlyStatementsParams.zod.js +27 -0
  15. package/dist/billing/v1/generated/validators/monthlyStatement.zod.d.ts +36 -0
  16. package/dist/billing/v1/generated/validators/monthlyStatement.zod.js +30 -0
  17. package/dist/billing/v1/generated/validators/monthlyStatementList.zod.d.ts +43 -0
  18. package/dist/billing/v1/generated/validators/monthlyStatementList.zod.js +14 -0
  19. package/dist/canopy/v1/generated/models.d.ts +26 -1
  20. package/dist/canopy/v1/generated/validators/accountBalance.zod.js +1 -1
  21. package/dist/canopy/v1/generated/validators/monthlyStatement.zod.d.ts +59 -0
  22. package/dist/canopy/v1/generated/validators/monthlyStatement.zod.js +53 -0
  23. package/dist/canopy/v1/generated/validators/monthlyStatementList.zod.d.ts +66 -0
  24. package/dist/canopy/v1/generated/validators/monthlyStatementList.zod.js +37 -0
  25. package/dist/compute/v1/generated/models.d.ts +26 -1
  26. package/dist/compute/v1/generated/validators/accountBalance.zod.js +1 -1
  27. package/dist/compute/v1/generated/validators/monthlyStatement.zod.d.ts +52 -0
  28. package/dist/compute/v1/generated/validators/monthlyStatement.zod.js +46 -0
  29. package/dist/compute/v1/generated/validators/monthlyStatementList.zod.d.ts +59 -0
  30. package/dist/compute/v1/generated/validators/monthlyStatementList.zod.js +30 -0
  31. package/dist/membership/v1/generated/models.d.ts +26 -1
  32. package/dist/membership/v1/generated/validators/accountBalance.zod.js +1 -1
  33. package/dist/membership/v1/generated/validators/monthlyStatement.zod.d.ts +36 -0
  34. package/dist/membership/v1/generated/validators/monthlyStatement.zod.js +30 -0
  35. package/dist/membership/v1/generated/validators/monthlyStatementList.zod.d.ts +43 -0
  36. package/dist/membership/v1/generated/validators/monthlyStatementList.zod.js +14 -0
  37. package/dist/routes.d.ts +8 -0
  38. package/dist/routes.js +9 -0
  39. package/package.json +1 -1
@@ -1180,7 +1180,7 @@ export interface AccountBalance {
1180
1180
  * spendable balance and may differ from the recorded credits total.
1181
1181
  */
1182
1182
  credit_groups: CreditGroup[];
1183
- /** Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
1183
+ /** Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
1184
1184
  due: Money;
1185
1185
  pending_returns_amount: Money;
1186
1186
  }
@@ -3165,6 +3165,31 @@ export interface StatementAmounts {
3165
3165
  tax_amount: Money;
3166
3166
  total: Money;
3167
3167
  }
3168
+ /**
3169
+ * One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.
3170
+ */
3171
+ export interface MonthlyStatement {
3172
+ billing_account_id: number;
3173
+ currency: string;
3174
+ period_start: string;
3175
+ period_end: string;
3176
+ /** True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here. */
3177
+ finalized: boolean;
3178
+ finalized_at?: string;
3179
+ /** Statements of the period, including the open one. */
3180
+ statement_count: number;
3181
+ billed: StatementAmounts;
3182
+ credited_amount: Money;
3183
+ unbilled?: StatementAmounts;
3184
+ credit_applied: Money;
3185
+ amount_paid: Money;
3186
+ amount_due: Money;
3187
+ amount_refunded: Money;
3188
+ }
3189
+ export interface MonthlyStatementList {
3190
+ items: MonthlyStatement[];
3191
+ pagination: OffsetPagination;
3192
+ }
3168
3193
  export type StatementStatus = (typeof StatementStatus)[keyof typeof StatementStatus];
3169
3194
  export declare const StatementStatus: {
3170
3195
  readonly open: "open";
@@ -21,7 +21,7 @@ export const AccountBalance = zod
21
21
  credit_groups: zod
22
22
  .array(CreditGroup)
23
23
  .describe("Currently valid, unspent credit grouped by permitted use. Restrictions and\nvalidity dates determine which charges a group can cover, so these groups are not a general\nspendable balance and may differ from the recorded credits total."),
24
- due: Money.describe("Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
24
+ due: Money.describe("Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
25
25
  pending_returns_amount: Money,
26
26
  })
27
27
  .describe("Account balance, credits, and unpaid charges are reported separately.");
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Membership API
5
+ * Membership tiers and account memberships. Catalog queries support any configured currency; purchases use the billing account currency.
6
+ * OpenAPI spec version: 1.0.0
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const MonthlyStatement: zod.ZodObject<{
10
+ billing_account_id: zod.ZodInt;
11
+ currency: zod.ZodString;
12
+ period_start: zod.z.ZodISODateTime;
13
+ period_end: zod.z.ZodISODateTime;
14
+ finalized: zod.ZodBoolean;
15
+ finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
16
+ statement_count: zod.ZodInt;
17
+ billed: zod.ZodObject<{
18
+ subtotal: zod.ZodString;
19
+ discount_amount: zod.ZodString;
20
+ tax_amount: zod.ZodString;
21
+ total: zod.ZodString;
22
+ }, zod.z.core.$strict>;
23
+ credited_amount: zod.ZodString;
24
+ unbilled: zod.ZodOptional<zod.ZodObject<{
25
+ subtotal: zod.ZodString;
26
+ discount_amount: zod.ZodString;
27
+ tax_amount: zod.ZodString;
28
+ total: zod.ZodString;
29
+ }, zod.z.core.$strict>>;
30
+ credit_applied: zod.ZodString;
31
+ amount_paid: zod.ZodString;
32
+ amount_due: zod.ZodString;
33
+ amount_refunded: zod.ZodString;
34
+ }, zod.z.core.$strict>;
35
+ export type MonthlyStatement = zod.input<typeof MonthlyStatement>;
36
+ export type MonthlyStatementOutput = zod.output<typeof MonthlyStatement>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Membership API
5
+ * Membership tiers and account memberships. Catalog queries support any configured currency; purchases use the billing account currency.
6
+ * OpenAPI spec version: 1.0.0
7
+ */
8
+ import * as zod from "zod";
9
+ import { Money } from "./money.zod.js";
10
+ import { StatementAmounts } from "./statementAmounts.zod.js";
11
+ export const MonthlyStatement = zod
12
+ .strictObject({
13
+ billing_account_id: zod.int(),
14
+ currency: zod.string(),
15
+ period_start: zod.iso.datetime({ offset: true }),
16
+ period_end: zod.iso.datetime({ offset: true }),
17
+ finalized: zod
18
+ .boolean()
19
+ .describe("True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here."),
20
+ finalized_at: zod.iso.datetime({ offset: true }).optional(),
21
+ statement_count: zod.int().describe("Statements of the period, including the open one."),
22
+ billed: StatementAmounts,
23
+ credited_amount: Money,
24
+ unbilled: StatementAmounts.optional(),
25
+ credit_applied: Money,
26
+ amount_paid: Money,
27
+ amount_due: Money,
28
+ amount_refunded: Money,
29
+ })
30
+ .describe("One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.");
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Membership API
5
+ * Membership tiers and account memberships. Catalog queries support any configured currency; purchases use the billing account currency.
6
+ * OpenAPI spec version: 1.0.0
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const MonthlyStatementList: zod.ZodObject<{
10
+ items: zod.ZodArray<zod.ZodObject<{
11
+ billing_account_id: zod.ZodInt;
12
+ currency: zod.ZodString;
13
+ period_start: zod.z.ZodISODateTime;
14
+ period_end: zod.z.ZodISODateTime;
15
+ finalized: zod.ZodBoolean;
16
+ finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
17
+ statement_count: zod.ZodInt;
18
+ billed: zod.ZodObject<{
19
+ subtotal: zod.ZodString;
20
+ discount_amount: zod.ZodString;
21
+ tax_amount: zod.ZodString;
22
+ total: zod.ZodString;
23
+ }, zod.z.core.$strict>;
24
+ credited_amount: zod.ZodString;
25
+ unbilled: zod.ZodOptional<zod.ZodObject<{
26
+ subtotal: zod.ZodString;
27
+ discount_amount: zod.ZodString;
28
+ tax_amount: zod.ZodString;
29
+ total: zod.ZodString;
30
+ }, zod.z.core.$strict>>;
31
+ credit_applied: zod.ZodString;
32
+ amount_paid: zod.ZodString;
33
+ amount_due: zod.ZodString;
34
+ amount_refunded: zod.ZodString;
35
+ }, zod.z.core.$strict>>;
36
+ pagination: zod.ZodObject<{
37
+ page: zod.ZodInt;
38
+ page_size: zod.ZodInt;
39
+ total_count: zod.ZodOptional<zod.ZodInt>;
40
+ }, zod.z.core.$strict>;
41
+ }, zod.z.core.$strict>;
42
+ export type MonthlyStatementList = zod.input<typeof MonthlyStatementList>;
43
+ export type MonthlyStatementListOutput = zod.output<typeof MonthlyStatementList>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Membership API
5
+ * Membership tiers and account memberships. Catalog queries support any configured currency; purchases use the billing account currency.
6
+ * OpenAPI spec version: 1.0.0
7
+ */
8
+ import * as zod from "zod";
9
+ import { MonthlyStatement } from "./monthlyStatement.zod.js";
10
+ import { OffsetPagination } from "./offsetPagination.zod.js";
11
+ export const MonthlyStatementList = zod.strictObject({
12
+ items: zod.array(MonthlyStatement),
13
+ pagination: OffsetPagination,
14
+ });
package/dist/routes.d.ts CHANGED
@@ -1038,6 +1038,14 @@ export declare const routes: readonly [{
1038
1038
  readonly operationId: "list-spend";
1039
1039
  readonly securityScheme: "AccessToken";
1040
1040
  readonly upstreamUrl: "https://billing.leaflow.cloud";
1041
+ }, {
1042
+ readonly service: "billing";
1043
+ readonly contract: "billing";
1044
+ readonly method: "GET";
1045
+ readonly path: "/api/v1/monthly-statements";
1046
+ readonly operationId: "list-monthly-statements";
1047
+ readonly securityScheme: "AccessToken";
1048
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
1041
1049
  }, {
1042
1050
  readonly service: "billing";
1043
1051
  readonly contract: "billing";
package/dist/routes.js CHANGED
@@ -1170,6 +1170,15 @@ export const routes = [
1170
1170
  securityScheme: "AccessToken",
1171
1171
  upstreamUrl: "https://billing.leaflow.cloud",
1172
1172
  },
1173
+ {
1174
+ service: "billing",
1175
+ contract: "billing",
1176
+ method: "GET",
1177
+ path: "/api/v1/monthly-statements",
1178
+ operationId: "list-monthly-statements",
1179
+ securityScheme: "AccessToken",
1180
+ upstreamUrl: "https://billing.leaflow.cloud",
1181
+ },
1173
1182
  {
1174
1183
  service: "billing",
1175
1184
  contract: "billing",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.126.0",
3
+ "version": "0.127.1",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {