@leaflow/sdk 0.115.1 → 0.117.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.
Files changed (71) hide show
  1. package/dist/billing/v1/generated/functions.d.ts +172 -35
  2. package/dist/billing/v1/generated/functions.js +199 -29
  3. package/dist/billing/v1/generated/models.d.ts +252 -112
  4. package/dist/billing/v1/generated/models.js +16 -8
  5. package/dist/billing/v1/generated/schemas.zod.d.ts +125 -31
  6. package/dist/billing/v1/generated/schemas.zod.js +128 -22
  7. package/dist/billing/v1/generated/validators/accountBalance.zod.d.ts +5 -4
  8. package/dist/billing/v1/generated/validators/accountBalance.zod.js +5 -3
  9. package/dist/billing/v1/generated/validators/applicability.zod.d.ts +2 -3
  10. package/dist/billing/v1/generated/validators/billingAccount.zod.d.ts +1 -9
  11. package/dist/billing/v1/generated/validators/billingAccount.zod.js +4 -12
  12. package/dist/billing/v1/generated/validators/billingAccountCreate.zod.d.ts +0 -4
  13. package/dist/billing/v1/generated/validators/billingAccountCreate.zod.js +0 -4
  14. package/dist/billing/v1/generated/validators/billingAccountList.zod.d.ts +1 -9
  15. package/dist/billing/v1/generated/validators/billingAccountUpdate.zod.d.ts +1 -19
  16. package/dist/billing/v1/generated/validators/billingAccountUpdate.zod.js +4 -23
  17. package/dist/billing/v1/generated/validators/contact.zod.d.ts +37 -0
  18. package/dist/billing/v1/generated/validators/contact.zod.js +37 -0
  19. package/dist/billing/v1/generated/validators/contactCreate.zod.d.ts +32 -0
  20. package/dist/billing/v1/generated/validators/contactCreate.zod.js +30 -0
  21. package/dist/billing/v1/generated/validators/contactList.zod.d.ts +34 -0
  22. package/dist/billing/v1/generated/validators/contactList.zod.js +14 -0
  23. package/dist/billing/v1/generated/validators/contactUpdate.zod.d.ts +33 -0
  24. package/dist/billing/v1/generated/validators/contactUpdate.zod.js +31 -0
  25. package/dist/billing/v1/generated/validators/creditGrant.zod.d.ts +2 -3
  26. package/dist/billing/v1/generated/validators/creditGrantList.zod.d.ts +2 -3
  27. package/dist/billing/v1/generated/validators/creditGroup.zod.d.ts +2 -3
  28. package/dist/billing/v1/generated/validators/discount.zod.d.ts +2 -3
  29. package/dist/billing/v1/generated/validators/discountList.zod.d.ts +2 -3
  30. package/dist/billing/v1/generated/validators/getStatementUsageParams.zod.d.ts +29 -0
  31. package/dist/billing/v1/generated/validators/getStatementUsageParams.zod.js +33 -0
  32. package/dist/billing/v1/generated/validators/invoice.zod.d.ts +1 -6
  33. package/dist/billing/v1/generated/validators/invoice.zod.js +4 -8
  34. package/dist/billing/v1/generated/validators/invoiceItem.zod.d.ts +0 -2
  35. package/dist/billing/v1/generated/validators/invoiceItem.zod.js +0 -5
  36. package/dist/billing/v1/generated/validators/invoiceItemList.zod.d.ts +0 -2
  37. package/dist/billing/v1/generated/validators/invoiceList.zod.d.ts +1 -6
  38. package/dist/billing/v1/generated/validators/invoiceStatus.zod.js +1 -1
  39. package/dist/billing/v1/generated/validators/listContactsParams.zod.d.ts +18 -0
  40. package/dist/billing/v1/generated/validators/listContactsParams.zod.js +20 -0
  41. package/dist/billing/v1/generated/validators/listStatementsParams.zod.d.ts +25 -0
  42. package/dist/billing/v1/generated/validators/listStatementsParams.zod.js +25 -0
  43. package/dist/billing/v1/generated/validators/listUsageChargesParams.zod.d.ts +1 -0
  44. package/dist/billing/v1/generated/validators/listUsageChargesParams.zod.js +1 -0
  45. package/dist/billing/v1/generated/validators/order.zod.d.ts +2 -1
  46. package/dist/billing/v1/generated/validators/orderItem.zod.d.ts +1 -0
  47. package/dist/billing/v1/generated/validators/orderItem.zod.js +4 -0
  48. package/dist/billing/v1/generated/validators/orderItemList.zod.d.ts +1 -0
  49. package/dist/billing/v1/generated/validators/orderList.zod.d.ts +2 -1
  50. package/dist/billing/v1/generated/validators/purchaseOperation.zod.d.ts +2 -3
  51. package/dist/billing/v1/generated/validators/purchaseOperation.zod.js +2 -2
  52. package/dist/billing/v1/generated/validators/statement.zod.d.ts +34 -0
  53. package/dist/billing/v1/generated/validators/statement.zod.js +36 -0
  54. package/dist/billing/v1/generated/validators/statementAmounts.zod.d.ts +16 -0
  55. package/dist/billing/v1/generated/validators/statementAmounts.zod.js +15 -0
  56. package/dist/billing/v1/generated/validators/statementItem.zod.d.ts +20 -0
  57. package/dist/billing/v1/generated/validators/statementItem.zod.js +25 -0
  58. package/dist/billing/v1/generated/validators/statementList.zod.d.ts +41 -0
  59. package/dist/billing/v1/generated/validators/statementList.zod.js +14 -0
  60. package/dist/billing/v1/generated/validators/statementStatus.zod.d.ts +14 -0
  61. package/dist/billing/v1/generated/validators/statementStatus.zod.js +9 -0
  62. package/dist/billing/v1/generated/validators/statementSummary.zod.d.ts +36 -0
  63. package/dist/billing/v1/generated/validators/statementSummary.zod.js +19 -0
  64. package/dist/billing/v1/generated/validators/usageCharge.zod.d.ts +1 -0
  65. package/dist/billing/v1/generated/validators/usageCharge.zod.js +1 -0
  66. package/dist/billing/v1/generated/validators/usageChargeList.zod.d.ts +1 -0
  67. package/dist/routes.d.ts +64 -8
  68. package/dist/routes.js +72 -9
  69. package/package.json +1 -1
  70. package/dist/billing/v1/generated/validators/meteredUsage.zod.d.ts +0 -20
  71. package/dist/billing/v1/generated/validators/meteredUsage.zod.js +0 -27
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ import { StatementStatus } from "./statementStatus.zod.js";
10
+ export const listStatementsParamsPageDefault = 1;
11
+ export const listStatementsParamsPageMax = 2147483647;
12
+ export const listStatementsParamsPageSizeDefault = 50;
13
+ export const listStatementsParamsPageSizeMax = 200;
14
+ export const ListStatementsParams = zod.strictObject({
15
+ billing_account_id: zod.int().optional(),
16
+ status: StatementStatus.optional(),
17
+ from: zod.iso.datetime({ offset: true }).optional(),
18
+ to: zod.iso.datetime({ offset: true }).optional(),
19
+ page: zod.int().min(1).max(listStatementsParamsPageMax).default(listStatementsParamsPageDefault),
20
+ page_size: zod
21
+ .int()
22
+ .min(1)
23
+ .max(listStatementsParamsPageSizeMax)
24
+ .default(listStatementsParamsPageSizeDefault),
25
+ });
@@ -22,6 +22,7 @@ export declare const ListUsageChargesParams: zod.ZodObject<{
22
22
  to: zod.ZodOptional<zod.z.ZodISODateTime>;
23
23
  project_ids: zod.ZodOptional<zod.ZodArray<zod.ZodUUID>>;
24
24
  meter_id: zod.ZodOptional<zod.ZodUUID>;
25
+ statement_id: zod.ZodOptional<zod.ZodUUID>;
25
26
  }, zod.z.core.$strict>;
26
27
  export type ListUsageChargesParams = zod.input<typeof ListUsageChargesParams>;
27
28
  export type ListUsageChargesParamsOutput = zod.output<typeof ListUsageChargesParams>;
@@ -31,4 +31,5 @@ export const ListUsageChargesParams = zod.strictObject({
31
31
  to: zod.iso.datetime({ offset: true }).optional(),
32
32
  project_ids: zod.array(zod.uuid()).min(1).max(listUsageChargesParamsProjectIdsMax).optional(),
33
33
  meter_id: zod.uuid().optional(),
34
+ statement_id: zod.uuid().optional(),
34
35
  });
@@ -60,9 +60,9 @@ export declare const Order: zod.ZodObject<{
60
60
  billing_account_id: zod.ZodOptional<zod.ZodInt>;
61
61
  currency: zod.ZodString;
62
62
  type: zod.ZodEnum<{
63
- purchase: "purchase";
64
63
  renew: "renew";
65
64
  change: "change";
65
+ purchase: "purchase";
66
66
  adopt: "adopt";
67
67
  }>;
68
68
  status: zod.ZodEnum<{
@@ -82,6 +82,7 @@ export declare const Order: zod.ZodObject<{
82
82
  expires_at: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
83
83
  created_at: zod.z.ZodISODateTime;
84
84
  items: zod.ZodArray<zod.ZodObject<{
85
+ invoice_item_ids: zod.ZodOptional<zod.ZodArray<zod.ZodUUID>>;
85
86
  position: zod.ZodOptional<zod.ZodInt>;
86
87
  configuration: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
87
88
  subscription_id: zod.ZodOptional<zod.ZodUUID>;
@@ -8,6 +8,7 @@
8
8
  import * as zod from "zod";
9
9
  export declare const orderItemPositionMin = 0;
10
10
  export declare const OrderItem: zod.ZodObject<{
11
+ invoice_item_ids: zod.ZodOptional<zod.ZodArray<zod.ZodUUID>>;
11
12
  position: zod.ZodOptional<zod.ZodInt>;
12
13
  configuration: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
13
14
  subscription_id: zod.ZodOptional<zod.ZodUUID>;
@@ -15,6 +15,10 @@ import { TerminationPolicy } from "./terminationPolicy.zod.js";
15
15
  export const orderItemPositionMin = 0;
16
16
  export const OrderItem = zod
17
17
  .strictObject({
18
+ invoice_item_ids: zod
19
+ .array(zod.uuid())
20
+ .optional()
21
+ .describe("Financial lines produced by this purchase item, including setup charges."),
18
22
  position: zod.int().min(orderItemPositionMin).optional(),
19
23
  configuration: zod.record(zod.string(), zod.unknown()).optional(),
20
24
  subscription_id: zod
@@ -8,6 +8,7 @@
8
8
  import * as zod from "zod";
9
9
  export declare const OrderItemList: zod.ZodObject<{
10
10
  items: zod.ZodArray<zod.ZodObject<{
11
+ invoice_item_ids: zod.ZodOptional<zod.ZodArray<zod.ZodUUID>>;
11
12
  position: zod.ZodOptional<zod.ZodInt>;
12
13
  configuration: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
13
14
  subscription_id: zod.ZodOptional<zod.ZodUUID>;
@@ -61,9 +61,9 @@ export declare const OrderList: zod.ZodObject<{
61
61
  billing_account_id: zod.ZodOptional<zod.ZodInt>;
62
62
  currency: zod.ZodString;
63
63
  type: zod.ZodEnum<{
64
- purchase: "purchase";
65
64
  renew: "renew";
66
65
  change: "change";
66
+ purchase: "purchase";
67
67
  adopt: "adopt";
68
68
  }>;
69
69
  status: zod.ZodEnum<{
@@ -83,6 +83,7 @@ export declare const OrderList: zod.ZodObject<{
83
83
  expires_at: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
84
84
  created_at: zod.z.ZodISODateTime;
85
85
  items: zod.ZodArray<zod.ZodObject<{
86
+ invoice_item_ids: zod.ZodOptional<zod.ZodArray<zod.ZodUUID>>;
86
87
  position: zod.ZodOptional<zod.ZodInt>;
87
88
  configuration: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
88
89
  subscription_id: zod.ZodOptional<zod.ZodUUID>;
@@ -7,10 +7,9 @@
7
7
  */
8
8
  import * as zod from "zod";
9
9
  export declare const PurchaseOperation: zod.ZodEnum<{
10
- purchase: "purchase";
10
+ new: "new";
11
11
  renew: "renew";
12
- upgrade: "upgrade";
13
- downgrade: "downgrade";
12
+ change: "change";
14
13
  }>;
15
14
  export type PurchaseOperation = zod.input<typeof PurchaseOperation>;
16
15
  export type PurchaseOperationOutput = zod.output<typeof PurchaseOperation>;
@@ -7,5 +7,5 @@
7
7
  */
8
8
  import * as zod from "zod";
9
9
  export const PurchaseOperation = zod
10
- .enum(["purchase", "renew", "upgrade", "downgrade"])
11
- .describe("Which purchase this applies to. `upgrade` and `downgrade` are told apart by money: a change\nthat costs more for the remainder of the period is an upgrade, one that returns money\nis a downgrade. A change that costs neither more nor less is neither.\n\n`purchase` means a new purchase as opposed to a renewal or a change. It does not mean the\naccount's first purchase.");
10
+ .enum(["new", "renew", "change"])
11
+ .describe("Which purchase operation this applies to. `new` covers every new purchase, including\nzero-charge purchases. It does not mean the account's first purchase; use\n`first_purchase_only` for that restriction. `renew` covers renewals. `change` covers\nconfiguration or billing-term changes, including changes that increase or decrease\nthe amount due and changes with no additional charge or refund.");
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const Statement: zod.ZodObject<{
10
+ id: zod.ZodUUID;
11
+ billing_account_id: zod.ZodInt;
12
+ currency: zod.ZodString;
13
+ period_start: zod.z.ZodISODateTime;
14
+ period_end: zod.z.ZodISODateTime;
15
+ sequence: zod.ZodInt;
16
+ status: zod.ZodEnum<{
17
+ open: "open";
18
+ closed: "closed";
19
+ }>;
20
+ estimated: zod.ZodBoolean;
21
+ amounts: zod.ZodObject<{
22
+ subtotal: zod.ZodString;
23
+ discount_amount: zod.ZodString;
24
+ tax_amount: zod.ZodString;
25
+ total: zod.ZodString;
26
+ }, zod.z.core.$strict>;
27
+ closed_at: zod.ZodOptional<zod.z.ZodISODateTime>;
28
+ invoice_id: zod.ZodOptional<zod.ZodUUID>;
29
+ created_at: zod.z.ZodISODateTime;
30
+ calculated_at: zod.ZodOptional<zod.z.ZodISODateTime>;
31
+ credited_amount: zod.ZodString;
32
+ }, zod.z.core.$strict>;
33
+ export type Statement = zod.input<typeof Statement>;
34
+ export type StatementOutput = zod.output<typeof Statement>;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ import { Money } from "./money.zod.js";
10
+ import { StatementAmounts } from "./statementAmounts.zod.js";
11
+ import { StatementStatus } from "./statementStatus.zod.js";
12
+ export const Statement = zod
13
+ .strictObject({
14
+ id: zod.uuid(),
15
+ billing_account_id: zod.int(),
16
+ currency: zod.string(),
17
+ period_start: zod.iso.datetime({ offset: true }),
18
+ period_end: zod.iso.datetime({ offset: true }),
19
+ sequence: zod
20
+ .int()
21
+ .describe("1 for the first closing of the period; higher for statements that collect usage priced after an earlier closing."),
22
+ status: StatementStatus,
23
+ estimated: zod
24
+ .boolean()
25
+ .describe("True while the statement is open. The estimate is the priced usage plus tax for the current invoice contact; tier adjustments over the whole period and minimum charges are determined at closing."),
26
+ amounts: StatementAmounts,
27
+ closed_at: zod.iso.datetime({ offset: true }).optional(),
28
+ invoice_id: zod
29
+ .uuid()
30
+ .optional()
31
+ .describe("The invoice issued at this closing, when it produced one."),
32
+ created_at: zod.iso.datetime({ offset: true }),
33
+ calculated_at: zod.iso.datetime({ offset: true }).optional(),
34
+ credited_amount: Money,
35
+ })
36
+ .describe("An account's consumption for one billing period, collected at one closing. The first statement of a period (sequence 1) closes after the period ends. Usage priced after that closing is collected in a later statement for the same period, which closes and invoices separately; a closed statement is never rewritten. Payments apply to issued invoices.");
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const StatementAmounts: zod.ZodObject<{
10
+ subtotal: zod.ZodString;
11
+ discount_amount: zod.ZodString;
12
+ tax_amount: zod.ZodString;
13
+ total: zod.ZodString;
14
+ }, zod.z.core.$strict>;
15
+ export type StatementAmounts = zod.input<typeof StatementAmounts>;
16
+ export type StatementAmountsOutput = zod.output<typeof StatementAmounts>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ import { Money } from "./money.zod.js";
10
+ export const StatementAmounts = zod.strictObject({
11
+ subtotal: Money,
12
+ discount_amount: Money,
13
+ tax_amount: Money,
14
+ total: Money,
15
+ });
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const StatementItem: zod.ZodObject<{
10
+ project_id: zod.ZodOptional<zod.ZodUUID>;
11
+ product_id: zod.ZodOptional<zod.ZodString>;
12
+ meter_id: zod.ZodOptional<zod.ZodUUID>;
13
+ unit: zod.ZodOptional<zod.ZodString>;
14
+ quantity: zod.ZodOptional<zod.ZodString>;
15
+ deducted_quantity: zod.ZodOptional<zod.ZodString>;
16
+ unrated_quantity: zod.ZodOptional<zod.ZodString>;
17
+ amount: zod.ZodString;
18
+ }, zod.z.core.$strict>;
19
+ export type StatementItem = zod.input<typeof StatementItem>;
20
+ export type StatementItemOutput = zod.output<typeof StatementItem>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ import { Money } from "./money.zod.js";
10
+ export const StatementItem = zod.strictObject({
11
+ project_id: zod.uuid().optional(),
12
+ product_id: zod.string().optional(),
13
+ meter_id: zod.uuid().optional(),
14
+ unit: zod.string().optional(),
15
+ quantity: zod
16
+ .string()
17
+ .optional()
18
+ .describe("Net usage quantity. Included only when grouping by meter."),
19
+ deducted_quantity: zod.string().optional(),
20
+ unrated_quantity: zod
21
+ .string()
22
+ .optional()
23
+ .describe("Usage not yet priced; not a zero-cost charge."),
24
+ amount: Money,
25
+ });
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const StatementList: zod.ZodObject<{
10
+ items: zod.ZodArray<zod.ZodObject<{
11
+ id: zod.ZodUUID;
12
+ billing_account_id: zod.ZodInt;
13
+ currency: zod.ZodString;
14
+ period_start: zod.z.ZodISODateTime;
15
+ period_end: zod.z.ZodISODateTime;
16
+ sequence: zod.ZodInt;
17
+ status: zod.ZodEnum<{
18
+ open: "open";
19
+ closed: "closed";
20
+ }>;
21
+ estimated: zod.ZodBoolean;
22
+ amounts: zod.ZodObject<{
23
+ subtotal: zod.ZodString;
24
+ discount_amount: zod.ZodString;
25
+ tax_amount: zod.ZodString;
26
+ total: zod.ZodString;
27
+ }, zod.z.core.$strict>;
28
+ closed_at: zod.ZodOptional<zod.z.ZodISODateTime>;
29
+ invoice_id: zod.ZodOptional<zod.ZodUUID>;
30
+ created_at: zod.z.ZodISODateTime;
31
+ calculated_at: zod.ZodOptional<zod.z.ZodISODateTime>;
32
+ credited_amount: zod.ZodString;
33
+ }, zod.z.core.$strict>>;
34
+ pagination: zod.ZodObject<{
35
+ page: zod.ZodInt;
36
+ page_size: zod.ZodInt;
37
+ total_count: zod.ZodOptional<zod.ZodInt>;
38
+ }, zod.z.core.$strict>;
39
+ }, zod.z.core.$strict>;
40
+ export type StatementList = zod.input<typeof StatementList>;
41
+ export type StatementListOutput = zod.output<typeof StatementList>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ import { OffsetPagination } from "./offsetPagination.zod.js";
10
+ import { Statement } from "./statement.zod.js";
11
+ export const StatementList = zod.strictObject({
12
+ items: zod.array(Statement),
13
+ pagination: OffsetPagination,
14
+ });
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const StatementStatus: zod.ZodEnum<{
10
+ open: "open";
11
+ closed: "closed";
12
+ }>;
13
+ export type StatementStatus = zod.input<typeof StatementStatus>;
14
+ export type StatementStatusOutput = zod.output<typeof StatementStatus>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export const StatementStatus = zod.enum(["open", "closed"]);
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const StatementSummary: zod.ZodObject<{
10
+ statement_id: zod.ZodUUID;
11
+ currency: zod.ZodString;
12
+ estimated: zod.ZodBoolean;
13
+ calculated_at: zod.ZodOptional<zod.z.ZodISODateTime>;
14
+ group_by: zod.ZodEnum<{
15
+ project: "project";
16
+ product: "product";
17
+ meter: "meter";
18
+ }>;
19
+ items: zod.ZodArray<zod.ZodObject<{
20
+ project_id: zod.ZodOptional<zod.ZodUUID>;
21
+ product_id: zod.ZodOptional<zod.ZodString>;
22
+ meter_id: zod.ZodOptional<zod.ZodUUID>;
23
+ unit: zod.ZodOptional<zod.ZodString>;
24
+ quantity: zod.ZodOptional<zod.ZodString>;
25
+ deducted_quantity: zod.ZodOptional<zod.ZodString>;
26
+ unrated_quantity: zod.ZodOptional<zod.ZodString>;
27
+ amount: zod.ZodString;
28
+ }, zod.z.core.$strict>>;
29
+ pagination: zod.ZodObject<{
30
+ page: zod.ZodInt;
31
+ page_size: zod.ZodInt;
32
+ total_count: zod.ZodOptional<zod.ZodInt>;
33
+ }, zod.z.core.$strict>;
34
+ }, zod.z.core.$strict>;
35
+ export type StatementSummary = zod.input<typeof StatementSummary>;
36
+ export type StatementSummaryOutput = zod.output<typeof StatementSummary>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ import { OffsetPagination } from "./offsetPagination.zod.js";
10
+ import { StatementItem } from "./statementItem.zod.js";
11
+ export const StatementSummary = zod.strictObject({
12
+ statement_id: zod.uuid(),
13
+ currency: zod.string(),
14
+ estimated: zod.boolean(),
15
+ calculated_at: zod.iso.datetime({ offset: true }).optional(),
16
+ group_by: zod.enum(["project", "product", "meter"]),
17
+ items: zod.array(StatementItem),
18
+ pagination: OffsetPagination,
19
+ });
@@ -37,6 +37,7 @@ export declare const UsageCharge: zod.ZodObject<{
37
37
  currency: zod.ZodString;
38
38
  invoice_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
39
39
  invoice_item_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
40
+ statement_id: zod.ZodOptional<zod.ZodUUID>;
40
41
  }, zod.z.core.$strict>;
41
42
  export type UsageCharge = zod.input<typeof UsageCharge>;
42
43
  export type UsageChargeOutput = zod.output<typeof UsageCharge>;
@@ -53,4 +53,5 @@ export const UsageCharge = zod.strictObject({
53
53
  .uuid()
54
54
  .nullish()
55
55
  .describe("The usage invoice line this charge was summed into. Absent while it waits to be priced."),
56
+ statement_id: zod.uuid().optional().describe("The statement this charge was collected into."),
56
57
  });
@@ -38,6 +38,7 @@ export declare const UsageChargeList: zod.ZodObject<{
38
38
  currency: zod.ZodString;
39
39
  invoice_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
40
40
  invoice_item_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
41
+ statement_id: zod.ZodOptional<zod.ZodUUID>;
41
42
  }, zod.z.core.$strict>>;
42
43
  pagination: zod.ZodObject<{
43
44
  page: zod.ZodInt;
package/dist/routes.d.ts CHANGED
@@ -486,6 +486,46 @@ export declare const routes: readonly [{
486
486
  readonly operationId: "revert-thread";
487
487
  readonly securityScheme: "ScopedToken";
488
488
  readonly upstreamUrl: "https://assistant.leaflow.cloud";
489
+ }, {
490
+ readonly service: "billing";
491
+ readonly contract: "billing";
492
+ readonly method: "GET";
493
+ readonly path: "/api/v1/billing-accounts/{accountId}/contacts";
494
+ readonly operationId: "list-contacts";
495
+ readonly securityScheme: "AccessToken";
496
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
497
+ }, {
498
+ readonly service: "billing";
499
+ readonly contract: "billing";
500
+ readonly method: "POST";
501
+ readonly path: "/api/v1/billing-accounts/{accountId}/contacts";
502
+ readonly operationId: "create-contact";
503
+ readonly securityScheme: "AccessToken";
504
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
505
+ }, {
506
+ readonly service: "billing";
507
+ readonly contract: "billing";
508
+ readonly method: "GET";
509
+ readonly path: "/api/v1/contacts/{contactId}";
510
+ readonly operationId: "get-contact";
511
+ readonly securityScheme: "AccessToken";
512
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
513
+ }, {
514
+ readonly service: "billing";
515
+ readonly contract: "billing";
516
+ readonly method: "PATCH";
517
+ readonly path: "/api/v1/contacts/{contactId}";
518
+ readonly operationId: "update-contact";
519
+ readonly securityScheme: "AccessToken";
520
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
521
+ }, {
522
+ readonly service: "billing";
523
+ readonly contract: "billing";
524
+ readonly method: "DELETE";
525
+ readonly path: "/api/v1/contacts/{contactId}";
526
+ readonly operationId: "delete-contact";
527
+ readonly securityScheme: "AccessToken";
528
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
489
529
  }, {
490
530
  readonly service: "billing";
491
531
  readonly contract: "billing";
@@ -534,14 +574,6 @@ export declare const routes: readonly [{
534
574
  readonly operationId: "get-account-balance";
535
575
  readonly securityScheme: "AccessToken";
536
576
  readonly upstreamUrl: "https://billing.leaflow.cloud";
537
- }, {
538
- readonly service: "billing";
539
- readonly contract: "billing";
540
- readonly method: "GET";
541
- readonly path: "/api/v1/billing-accounts/{accountId}/metered-usage";
542
- readonly operationId: "get-account-metered-usage";
543
- readonly securityScheme: "AccessToken";
544
- readonly upstreamUrl: "https://billing.leaflow.cloud";
545
577
  }, {
546
578
  readonly service: "billing";
547
579
  readonly contract: "billing";
@@ -1006,6 +1038,30 @@ export declare const routes: readonly [{
1006
1038
  readonly operationId: "list-spend";
1007
1039
  readonly securityScheme: "AccessToken";
1008
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/statements";
1046
+ readonly operationId: "list-statements";
1047
+ readonly securityScheme: "AccessToken";
1048
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
1049
+ }, {
1050
+ readonly service: "billing";
1051
+ readonly contract: "billing";
1052
+ readonly method: "GET";
1053
+ readonly path: "/api/v1/statements/{statementId}";
1054
+ readonly operationId: "get-statement";
1055
+ readonly securityScheme: "AccessToken";
1056
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
1057
+ }, {
1058
+ readonly service: "billing";
1059
+ readonly contract: "billing";
1060
+ readonly method: "GET";
1061
+ readonly path: "/api/v1/statements/{statementId}/usage-summary";
1062
+ readonly operationId: "get-statement-usage";
1063
+ readonly securityScheme: "AccessToken";
1064
+ readonly upstreamUrl: "https://billing.leaflow.cloud";
1009
1065
  }, {
1010
1066
  readonly service: "canopy";
1011
1067
  readonly contract: "canopy";
package/dist/routes.js CHANGED
@@ -549,6 +549,51 @@ export const routes = [
549
549
  securityScheme: "ScopedToken",
550
550
  upstreamUrl: "https://assistant.leaflow.cloud",
551
551
  },
552
+ {
553
+ service: "billing",
554
+ contract: "billing",
555
+ method: "GET",
556
+ path: "/api/v1/billing-accounts/{accountId}/contacts",
557
+ operationId: "list-contacts",
558
+ securityScheme: "AccessToken",
559
+ upstreamUrl: "https://billing.leaflow.cloud",
560
+ },
561
+ {
562
+ service: "billing",
563
+ contract: "billing",
564
+ method: "POST",
565
+ path: "/api/v1/billing-accounts/{accountId}/contacts",
566
+ operationId: "create-contact",
567
+ securityScheme: "AccessToken",
568
+ upstreamUrl: "https://billing.leaflow.cloud",
569
+ },
570
+ {
571
+ service: "billing",
572
+ contract: "billing",
573
+ method: "GET",
574
+ path: "/api/v1/contacts/{contactId}",
575
+ operationId: "get-contact",
576
+ securityScheme: "AccessToken",
577
+ upstreamUrl: "https://billing.leaflow.cloud",
578
+ },
579
+ {
580
+ service: "billing",
581
+ contract: "billing",
582
+ method: "PATCH",
583
+ path: "/api/v1/contacts/{contactId}",
584
+ operationId: "update-contact",
585
+ securityScheme: "AccessToken",
586
+ upstreamUrl: "https://billing.leaflow.cloud",
587
+ },
588
+ {
589
+ service: "billing",
590
+ contract: "billing",
591
+ method: "DELETE",
592
+ path: "/api/v1/contacts/{contactId}",
593
+ operationId: "delete-contact",
594
+ securityScheme: "AccessToken",
595
+ upstreamUrl: "https://billing.leaflow.cloud",
596
+ },
552
597
  {
553
598
  service: "billing",
554
599
  contract: "billing",
@@ -603,15 +648,6 @@ export const routes = [
603
648
  securityScheme: "AccessToken",
604
649
  upstreamUrl: "https://billing.leaflow.cloud",
605
650
  },
606
- {
607
- service: "billing",
608
- contract: "billing",
609
- method: "GET",
610
- path: "/api/v1/billing-accounts/{accountId}/metered-usage",
611
- operationId: "get-account-metered-usage",
612
- securityScheme: "AccessToken",
613
- upstreamUrl: "https://billing.leaflow.cloud",
614
- },
615
651
  {
616
652
  service: "billing",
617
653
  contract: "billing",
@@ -1134,6 +1170,33 @@ export const routes = [
1134
1170
  securityScheme: "AccessToken",
1135
1171
  upstreamUrl: "https://billing.leaflow.cloud",
1136
1172
  },
1173
+ {
1174
+ service: "billing",
1175
+ contract: "billing",
1176
+ method: "GET",
1177
+ path: "/api/v1/statements",
1178
+ operationId: "list-statements",
1179
+ securityScheme: "AccessToken",
1180
+ upstreamUrl: "https://billing.leaflow.cloud",
1181
+ },
1182
+ {
1183
+ service: "billing",
1184
+ contract: "billing",
1185
+ method: "GET",
1186
+ path: "/api/v1/statements/{statementId}",
1187
+ operationId: "get-statement",
1188
+ securityScheme: "AccessToken",
1189
+ upstreamUrl: "https://billing.leaflow.cloud",
1190
+ },
1191
+ {
1192
+ service: "billing",
1193
+ contract: "billing",
1194
+ method: "GET",
1195
+ path: "/api/v1/statements/{statementId}/usage-summary",
1196
+ operationId: "get-statement-usage",
1197
+ securityScheme: "AccessToken",
1198
+ upstreamUrl: "https://billing.leaflow.cloud",
1199
+ },
1137
1200
  {
1138
1201
  service: "canopy",
1139
1202
  contract: "canopy",