@leaflow/sdk 0.116.0 → 0.117.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 (63) 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 +247 -105
  4. package/dist/billing/v1/generated/models.js +14 -5
  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 +3 -1
  8. package/dist/billing/v1/generated/validators/accountBalance.zod.js +5 -3
  9. package/dist/billing/v1/generated/validators/billingAccount.zod.d.ts +1 -9
  10. package/dist/billing/v1/generated/validators/billingAccount.zod.js +4 -12
  11. package/dist/billing/v1/generated/validators/billingAccountCreate.zod.d.ts +0 -4
  12. package/dist/billing/v1/generated/validators/billingAccountCreate.zod.js +0 -4
  13. package/dist/billing/v1/generated/validators/billingAccountList.zod.d.ts +1 -9
  14. package/dist/billing/v1/generated/validators/billingAccountUpdate.zod.d.ts +1 -19
  15. package/dist/billing/v1/generated/validators/billingAccountUpdate.zod.js +4 -23
  16. package/dist/billing/v1/generated/validators/contact.zod.d.ts +37 -0
  17. package/dist/billing/v1/generated/validators/contact.zod.js +37 -0
  18. package/dist/billing/v1/generated/validators/contactCreate.zod.d.ts +32 -0
  19. package/dist/billing/v1/generated/validators/contactCreate.zod.js +30 -0
  20. package/dist/billing/v1/generated/validators/contactList.zod.d.ts +34 -0
  21. package/dist/billing/v1/generated/validators/contactList.zod.js +14 -0
  22. package/dist/billing/v1/generated/validators/contactUpdate.zod.d.ts +33 -0
  23. package/dist/billing/v1/generated/validators/contactUpdate.zod.js +31 -0
  24. package/dist/billing/v1/generated/validators/getStatementUsageParams.zod.d.ts +29 -0
  25. package/dist/billing/v1/generated/validators/getStatementUsageParams.zod.js +33 -0
  26. package/dist/billing/v1/generated/validators/invoice.zod.d.ts +1 -6
  27. package/dist/billing/v1/generated/validators/invoice.zod.js +4 -8
  28. package/dist/billing/v1/generated/validators/invoiceItem.zod.d.ts +0 -2
  29. package/dist/billing/v1/generated/validators/invoiceItem.zod.js +0 -5
  30. package/dist/billing/v1/generated/validators/invoiceItemList.zod.d.ts +0 -2
  31. package/dist/billing/v1/generated/validators/invoiceList.zod.d.ts +1 -6
  32. package/dist/billing/v1/generated/validators/invoiceStatus.zod.js +1 -1
  33. package/dist/billing/v1/generated/validators/listContactsParams.zod.d.ts +18 -0
  34. package/dist/billing/v1/generated/validators/listContactsParams.zod.js +20 -0
  35. package/dist/billing/v1/generated/validators/listStatementsParams.zod.d.ts +25 -0
  36. package/dist/billing/v1/generated/validators/listStatementsParams.zod.js +25 -0
  37. package/dist/billing/v1/generated/validators/listUsageChargesParams.zod.d.ts +1 -0
  38. package/dist/billing/v1/generated/validators/listUsageChargesParams.zod.js +1 -0
  39. package/dist/billing/v1/generated/validators/order.zod.d.ts +1 -0
  40. package/dist/billing/v1/generated/validators/orderItem.zod.d.ts +1 -0
  41. package/dist/billing/v1/generated/validators/orderItem.zod.js +4 -0
  42. package/dist/billing/v1/generated/validators/orderItemList.zod.d.ts +1 -0
  43. package/dist/billing/v1/generated/validators/orderList.zod.d.ts +1 -0
  44. package/dist/billing/v1/generated/validators/statement.zod.d.ts +34 -0
  45. package/dist/billing/v1/generated/validators/statement.zod.js +36 -0
  46. package/dist/billing/v1/generated/validators/statementAmounts.zod.d.ts +16 -0
  47. package/dist/billing/v1/generated/validators/statementAmounts.zod.js +15 -0
  48. package/dist/billing/v1/generated/validators/statementItem.zod.d.ts +20 -0
  49. package/dist/billing/v1/generated/validators/statementItem.zod.js +25 -0
  50. package/dist/billing/v1/generated/validators/statementList.zod.d.ts +41 -0
  51. package/dist/billing/v1/generated/validators/statementList.zod.js +14 -0
  52. package/dist/billing/v1/generated/validators/statementStatus.zod.d.ts +14 -0
  53. package/dist/billing/v1/generated/validators/statementStatus.zod.js +9 -0
  54. package/dist/billing/v1/generated/validators/statementSummary.zod.d.ts +36 -0
  55. package/dist/billing/v1/generated/validators/statementSummary.zod.js +19 -0
  56. package/dist/billing/v1/generated/validators/usageCharge.zod.d.ts +1 -0
  57. package/dist/billing/v1/generated/validators/usageCharge.zod.js +3 -2
  58. package/dist/billing/v1/generated/validators/usageChargeList.zod.d.ts +1 -0
  59. package/dist/routes.d.ts +64 -8
  60. package/dist/routes.js +72 -9
  61. package/package.json +1 -1
  62. package/dist/billing/v1/generated/validators/meteredUsage.zod.d.ts +0 -20
  63. package/dist/billing/v1/generated/validators/meteredUsage.zod.js +0 -27
@@ -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 applies tier pricing to the period's usage so far and adds tax for the current invoice contact. Minimum charges are added at closing, and a tier reduction larger than this statement's own charges is credited to earlier invoices of the period 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 that had no applicable price when it occurred. It is not charged, either now or later."),
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>;
@@ -48,9 +48,10 @@ export const UsageCharge = zod.strictObject({
48
48
  invoice_id: zod
49
49
  .uuid()
50
50
  .nullish()
51
- .describe("The usage invoice this charge was added to. Absent while it waits to be priced."),
51
+ .describe("The usage invoice this charge was added to. Absent until its statement closes and always absent for unrated charges."),
52
52
  invoice_item_id: zod
53
53
  .uuid()
54
54
  .nullish()
55
- .describe("The usage invoice line this charge was summed into. Absent while it waits to be priced."),
55
+ .describe("The usage invoice line this charge was summed into. Absent until its statement closes and always absent for unrated charges."),
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.116.0",
3
+ "version": "0.117.1",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,20 +0,0 @@
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 MeteredUsage: zod.ZodObject<{
10
- billing_account_id: zod.ZodInt;
11
- currency: zod.ZodString;
12
- active_resource_count: zod.ZodInt;
13
- postpaid_subscription_count: zod.ZodInt;
14
- window_start: zod.z.ZodISODateTime;
15
- window_end: zod.z.ZodISODateTime;
16
- amount: zod.ZodString;
17
- average_daily_amount: zod.ZodString;
18
- }, zod.z.core.$strict>;
19
- export type MeteredUsage = zod.input<typeof MeteredUsage>;
20
- export type MeteredUsageOutput = zod.output<typeof MeteredUsage>;
@@ -1,27 +0,0 @@
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 MeteredUsage = zod.strictObject({
11
- billing_account_id: zod.int(),
12
- currency: zod.string(),
13
- active_resource_count: zod
14
- .int()
15
- .describe("Resources still metered in the projects the account currently pays for."),
16
- postpaid_subscription_count: zod
17
- .int()
18
- .describe("Subscriptions billed by usage that the account currently pays for and that have not ended."),
19
- window_start: zod.iso
20
- .datetime({ offset: true })
21
- .describe("The start of the seven days the amounts cover."),
22
- window_end: zod.iso
23
- .datetime({ offset: true })
24
- .describe("The end of those seven days, the time usage was last priced."),
25
- amount: Money.describe("Usage priced in the window, before tax and before credit grants. Usage not yet priced is not included."),
26
- average_daily_amount: Money.describe("`amount` per day. Over the window, or over the part of it since the account's usage began\nwhen that is shorter, counting at least one day."),
27
- });