@leaflow/sdk 0.129.2 → 0.131.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 (159) hide show
  1. package/dist/billing/type/order/v1/generated/models.d.ts +241 -85
  2. package/dist/billing/type/order/v1/generated/models.js +19 -4
  3. package/dist/billing/type/order/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  4. package/dist/billing/type/order/v1/generated/validators/refund.zod.d.ts +1 -0
  5. package/dist/billing/type/order/v1/generated/validators/refundList.zod.d.ts +1 -0
  6. package/dist/billing/type/order/v1/generated/validators/transaction.zod.d.ts +1 -0
  7. package/dist/billing/type/order/v1/generated/validators/transactionList.zod.d.ts +1 -0
  8. package/dist/billing/type/order/v1/generated/validators/transactionType.zod.d.ts +1 -0
  9. package/dist/billing/type/order/v1/generated/validators/transactionType.zod.js +1 -1
  10. package/dist/billing/type/order/v1/generated/validators/withdrawal.zod.d.ts +40 -0
  11. package/dist/billing/type/order/v1/generated/validators/withdrawal.zod.js +43 -0
  12. package/dist/billing/type/order/v1/generated/validators/withdrawalAllocation.zod.d.ts +19 -0
  13. package/dist/billing/type/order/v1/generated/validators/withdrawalAllocation.zod.js +17 -0
  14. package/dist/billing/type/order/v1/generated/validators/withdrawalCreate.zod.d.ts +25 -0
  15. package/dist/billing/type/order/v1/generated/validators/withdrawalCreate.zod.js +19 -0
  16. package/dist/billing/type/order/v1/generated/validators/withdrawalItem.zod.d.ts +46 -0
  17. package/dist/billing/type/order/v1/generated/validators/withdrawalItem.zod.js +37 -0
  18. package/dist/billing/type/order/v1/generated/validators/withdrawalItemList.zod.d.ts +48 -0
  19. package/dist/billing/type/order/v1/generated/validators/withdrawalItemList.zod.js +14 -0
  20. package/dist/billing/type/order/v1/generated/validators/withdrawalList.zod.d.ts +39 -0
  21. package/dist/billing/type/order/v1/generated/validators/withdrawalList.zod.js +14 -0
  22. package/dist/billing/type/order/v1/generated/validators/withdrawalPreview.zod.d.ts +40 -0
  23. package/dist/billing/type/order/v1/generated/validators/withdrawalPreview.zod.js +25 -0
  24. package/dist/billing/type/order/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +28 -0
  25. package/dist/billing/type/order/v1/generated/validators/withdrawalPreviewItem.zod.js +19 -0
  26. package/dist/billing/type/order/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +15 -0
  27. package/dist/billing/type/order/v1/generated/validators/withdrawalPreviewRequest.zod.js +13 -0
  28. package/dist/billing/type/order/v1/generated/validators/withdrawalSource.zod.d.ts +23 -0
  29. package/dist/billing/type/order/v1/generated/validators/withdrawalSource.zod.js +23 -0
  30. package/dist/billing/v1/generated/functions.d.ts +106 -1
  31. package/dist/billing/v1/generated/functions.js +132 -0
  32. package/dist/billing/v1/generated/models.d.ts +194 -9
  33. package/dist/billing/v1/generated/models.js +15 -0
  34. package/dist/billing/v1/generated/schemas.zod.d.ts +59 -0
  35. package/dist/billing/v1/generated/schemas.zod.js +67 -0
  36. package/dist/billing/v1/generated/validators/listWithdrawalItemsParams.zod.d.ts +18 -0
  37. package/dist/billing/v1/generated/validators/listWithdrawalItemsParams.zod.js +24 -0
  38. package/dist/billing/v1/generated/validators/listWithdrawalsParams.zod.d.ts +19 -0
  39. package/dist/billing/v1/generated/validators/listWithdrawalsParams.zod.js +25 -0
  40. package/dist/billing/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  41. package/dist/billing/v1/generated/validators/refund.zod.d.ts +1 -0
  42. package/dist/billing/v1/generated/validators/refundList.zod.d.ts +1 -0
  43. package/dist/billing/v1/generated/validators/transaction.zod.d.ts +1 -0
  44. package/dist/billing/v1/generated/validators/transactionList.zod.d.ts +1 -0
  45. package/dist/billing/v1/generated/validators/transactionType.zod.d.ts +1 -0
  46. package/dist/billing/v1/generated/validators/transactionType.zod.js +1 -1
  47. package/dist/billing/v1/generated/validators/withdrawal.zod.d.ts +40 -0
  48. package/dist/billing/v1/generated/validators/withdrawal.zod.js +43 -0
  49. package/dist/billing/v1/generated/validators/withdrawalAllocation.zod.d.ts +19 -0
  50. package/dist/billing/v1/generated/validators/withdrawalAllocation.zod.js +17 -0
  51. package/dist/billing/v1/generated/validators/withdrawalCreate.zod.d.ts +25 -0
  52. package/dist/billing/v1/generated/validators/withdrawalCreate.zod.js +19 -0
  53. package/dist/billing/v1/generated/validators/withdrawalItem.zod.d.ts +46 -0
  54. package/dist/billing/v1/generated/validators/withdrawalItem.zod.js +37 -0
  55. package/dist/billing/v1/generated/validators/withdrawalItemList.zod.d.ts +48 -0
  56. package/dist/billing/v1/generated/validators/withdrawalItemList.zod.js +14 -0
  57. package/dist/billing/v1/generated/validators/withdrawalList.zod.d.ts +39 -0
  58. package/dist/billing/v1/generated/validators/withdrawalList.zod.js +14 -0
  59. package/dist/billing/v1/generated/validators/withdrawalPreview.zod.d.ts +40 -0
  60. package/dist/billing/v1/generated/validators/withdrawalPreview.zod.js +25 -0
  61. package/dist/billing/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +28 -0
  62. package/dist/billing/v1/generated/validators/withdrawalPreviewItem.zod.js +19 -0
  63. package/dist/billing/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +15 -0
  64. package/dist/billing/v1/generated/validators/withdrawalPreviewRequest.zod.js +13 -0
  65. package/dist/billing/v1/generated/validators/withdrawalSource.zod.d.ts +23 -0
  66. package/dist/billing/v1/generated/validators/withdrawalSource.zod.js +23 -0
  67. package/dist/canopy/v1/generated/models.d.ts +246 -86
  68. package/dist/canopy/v1/generated/models.js +19 -4
  69. package/dist/canopy/v1/generated/validators/cursorPageRequestResource.zod.d.ts +1 -1
  70. package/dist/canopy/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  71. package/dist/canopy/v1/generated/validators/refund.zod.d.ts +1 -0
  72. package/dist/canopy/v1/generated/validators/refundList.zod.d.ts +1 -0
  73. package/dist/canopy/v1/generated/validators/requestResource.zod.d.ts +1 -1
  74. package/dist/canopy/v1/generated/validators/requestResource.zod.js +4 -1
  75. package/dist/canopy/v1/generated/validators/transaction.zod.d.ts +1 -0
  76. package/dist/canopy/v1/generated/validators/transactionList.zod.d.ts +1 -0
  77. package/dist/canopy/v1/generated/validators/transactionType.zod.d.ts +1 -0
  78. package/dist/canopy/v1/generated/validators/transactionType.zod.js +1 -1
  79. package/dist/canopy/v1/generated/validators/withdrawal.zod.d.ts +63 -0
  80. package/dist/canopy/v1/generated/validators/withdrawal.zod.js +66 -0
  81. package/dist/canopy/v1/generated/validators/withdrawalAllocation.zod.d.ts +42 -0
  82. package/dist/canopy/v1/generated/validators/withdrawalAllocation.zod.js +40 -0
  83. package/dist/canopy/v1/generated/validators/withdrawalCreate.zod.d.ts +48 -0
  84. package/dist/canopy/v1/generated/validators/withdrawalCreate.zod.js +42 -0
  85. package/dist/canopy/v1/generated/validators/withdrawalItem.zod.d.ts +69 -0
  86. package/dist/canopy/v1/generated/validators/withdrawalItem.zod.js +60 -0
  87. package/dist/canopy/v1/generated/validators/withdrawalItemList.zod.d.ts +71 -0
  88. package/dist/canopy/v1/generated/validators/withdrawalItemList.zod.js +37 -0
  89. package/dist/canopy/v1/generated/validators/withdrawalList.zod.d.ts +62 -0
  90. package/dist/canopy/v1/generated/validators/withdrawalList.zod.js +37 -0
  91. package/dist/canopy/v1/generated/validators/withdrawalPreview.zod.d.ts +63 -0
  92. package/dist/canopy/v1/generated/validators/withdrawalPreview.zod.js +48 -0
  93. package/dist/canopy/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +51 -0
  94. package/dist/canopy/v1/generated/validators/withdrawalPreviewItem.zod.js +42 -0
  95. package/dist/canopy/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +38 -0
  96. package/dist/canopy/v1/generated/validators/withdrawalPreviewRequest.zod.js +36 -0
  97. package/dist/canopy/v1/generated/validators/withdrawalSource.zod.d.ts +46 -0
  98. package/dist/canopy/v1/generated/validators/withdrawalSource.zod.js +46 -0
  99. package/dist/compute/v1/generated/models.d.ts +241 -85
  100. package/dist/compute/v1/generated/models.js +19 -4
  101. package/dist/compute/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  102. package/dist/compute/v1/generated/validators/refund.zod.d.ts +1 -0
  103. package/dist/compute/v1/generated/validators/refundList.zod.d.ts +1 -0
  104. package/dist/compute/v1/generated/validators/transaction.zod.d.ts +1 -0
  105. package/dist/compute/v1/generated/validators/transactionList.zod.d.ts +1 -0
  106. package/dist/compute/v1/generated/validators/transactionType.zod.d.ts +1 -0
  107. package/dist/compute/v1/generated/validators/transactionType.zod.js +1 -1
  108. package/dist/compute/v1/generated/validators/withdrawal.zod.d.ts +56 -0
  109. package/dist/compute/v1/generated/validators/withdrawal.zod.js +59 -0
  110. package/dist/compute/v1/generated/validators/withdrawalAllocation.zod.d.ts +35 -0
  111. package/dist/compute/v1/generated/validators/withdrawalAllocation.zod.js +33 -0
  112. package/dist/compute/v1/generated/validators/withdrawalCreate.zod.d.ts +41 -0
  113. package/dist/compute/v1/generated/validators/withdrawalCreate.zod.js +35 -0
  114. package/dist/compute/v1/generated/validators/withdrawalItem.zod.d.ts +62 -0
  115. package/dist/compute/v1/generated/validators/withdrawalItem.zod.js +53 -0
  116. package/dist/compute/v1/generated/validators/withdrawalItemList.zod.d.ts +64 -0
  117. package/dist/compute/v1/generated/validators/withdrawalItemList.zod.js +30 -0
  118. package/dist/compute/v1/generated/validators/withdrawalList.zod.d.ts +55 -0
  119. package/dist/compute/v1/generated/validators/withdrawalList.zod.js +30 -0
  120. package/dist/compute/v1/generated/validators/withdrawalPreview.zod.d.ts +56 -0
  121. package/dist/compute/v1/generated/validators/withdrawalPreview.zod.js +41 -0
  122. package/dist/compute/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +44 -0
  123. package/dist/compute/v1/generated/validators/withdrawalPreviewItem.zod.js +35 -0
  124. package/dist/compute/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +31 -0
  125. package/dist/compute/v1/generated/validators/withdrawalPreviewRequest.zod.js +29 -0
  126. package/dist/compute/v1/generated/validators/withdrawalSource.zod.d.ts +39 -0
  127. package/dist/compute/v1/generated/validators/withdrawalSource.zod.js +39 -0
  128. package/dist/membership/v1/generated/models.d.ts +241 -85
  129. package/dist/membership/v1/generated/models.js +19 -4
  130. package/dist/membership/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  131. package/dist/membership/v1/generated/validators/refund.zod.d.ts +1 -0
  132. package/dist/membership/v1/generated/validators/refundList.zod.d.ts +1 -0
  133. package/dist/membership/v1/generated/validators/transaction.zod.d.ts +1 -0
  134. package/dist/membership/v1/generated/validators/transactionList.zod.d.ts +1 -0
  135. package/dist/membership/v1/generated/validators/transactionType.zod.d.ts +1 -0
  136. package/dist/membership/v1/generated/validators/transactionType.zod.js +1 -1
  137. package/dist/membership/v1/generated/validators/withdrawal.zod.d.ts +40 -0
  138. package/dist/membership/v1/generated/validators/withdrawal.zod.js +43 -0
  139. package/dist/membership/v1/generated/validators/withdrawalAllocation.zod.d.ts +19 -0
  140. package/dist/membership/v1/generated/validators/withdrawalAllocation.zod.js +17 -0
  141. package/dist/membership/v1/generated/validators/withdrawalCreate.zod.d.ts +25 -0
  142. package/dist/membership/v1/generated/validators/withdrawalCreate.zod.js +19 -0
  143. package/dist/membership/v1/generated/validators/withdrawalItem.zod.d.ts +46 -0
  144. package/dist/membership/v1/generated/validators/withdrawalItem.zod.js +37 -0
  145. package/dist/membership/v1/generated/validators/withdrawalItemList.zod.d.ts +48 -0
  146. package/dist/membership/v1/generated/validators/withdrawalItemList.zod.js +14 -0
  147. package/dist/membership/v1/generated/validators/withdrawalList.zod.d.ts +39 -0
  148. package/dist/membership/v1/generated/validators/withdrawalList.zod.js +14 -0
  149. package/dist/membership/v1/generated/validators/withdrawalPreview.zod.d.ts +40 -0
  150. package/dist/membership/v1/generated/validators/withdrawalPreview.zod.js +25 -0
  151. package/dist/membership/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +28 -0
  152. package/dist/membership/v1/generated/validators/withdrawalPreviewItem.zod.js +19 -0
  153. package/dist/membership/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +15 -0
  154. package/dist/membership/v1/generated/validators/withdrawalPreviewRequest.zod.js +13 -0
  155. package/dist/membership/v1/generated/validators/withdrawalSource.zod.d.ts +23 -0
  156. package/dist/membership/v1/generated/validators/withdrawalSource.zod.js +23 -0
  157. package/dist/routes.d.ts +40 -0
  158. package/dist/routes.js +45 -0
  159. package/package.json +1 -1
@@ -249,7 +249,11 @@ export declare const RequestResourceUsageSource: {
249
249
  readonly estimated: "estimated";
250
250
  };
251
251
  export interface RequestResource {
252
- api_key_id: string;
252
+ /**
253
+ * Null for a request made by an internal service directly for the project.
254
+ * @nullable
255
+ */
256
+ api_key_id: string | null;
253
257
  /** The portion served from the upstream prefix cache, which costs an order of magnitude less than ordinary input */
254
258
  cache_read_tokens: number;
255
259
  cache_write_tokens: number;
@@ -586,108 +590,159 @@ export interface CursorPagination {
586
590
  /** @nullable */
587
591
  next_cursor?: string | null;
588
592
  }
593
+ export interface WithdrawalAllocation {
594
+ source_transaction_id: string;
595
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
596
+ amount: string;
597
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
598
+ fee_amount: string;
599
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
600
+ refund_amount: string;
601
+ }
602
+ export type WithdrawalItemStatus = (typeof WithdrawalItemStatus)[keyof typeof WithdrawalItemStatus];
603
+ export declare const WithdrawalItemStatus: {
604
+ readonly pending: "pending";
605
+ readonly succeeded: "succeeded";
606
+ readonly failed: "failed";
607
+ readonly reversed: "reversed";
608
+ };
589
609
  /**
590
- * How tax applies to the customer, as in Stripe. `none` taxes normally. `exempt` charges no tax.
591
- * `reverse` charges no tax and leaves it to the customer under the reverse-charge mechanism;
592
- * invoices state this. Only operators change it.
610
+ * The original top-up and its refund destination. Card details are included when the original payment method was saved; missing card details do not change the original refund route.
593
611
  */
594
- export type ContactTaxExempt = (typeof ContactTaxExempt)[keyof typeof ContactTaxExempt];
595
- export declare const ContactTaxExempt: {
596
- readonly none: "none";
597
- readonly exempt: "exempt";
598
- readonly reverse: "reverse";
599
- };
612
+ export interface WithdrawalSource {
613
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
614
+ amount: string;
615
+ /**
616
+ * @minLength 3
617
+ * @maxLength 3
618
+ */
619
+ currency: string;
620
+ received_at: string;
621
+ payment_gateway: string;
622
+ method_type: string;
623
+ card_brand?: string;
624
+ /** @pattern ^[0-9]{4}$ */
625
+ card_last4?: string;
626
+ }
600
627
  /**
601
- * A billing-account contact profile with one address. An account can hold multiple contacts; this is not a login identity.
628
+ * The fixed principal deduction, withdrawal fee and exact refund obligation for one original top-up. Each item has its own refund; payment_gateway and method_type identify the original route.
602
629
  */
603
- export interface Contact {
630
+ export interface WithdrawalItem {
631
+ source_transaction_id: string;
632
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
633
+ amount: string;
634
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
635
+ fee_amount: string;
636
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
637
+ refund_amount: string;
604
638
  id: string;
639
+ withdrawal_id: string;
605
640
  billing_account_id: number;
606
641
  /**
607
- * @minLength 1
608
- * @maxLength 255
642
+ * @minLength 3
643
+ * @maxLength 3
609
644
  */
610
- name: string;
611
- /** @maxLength 255 */
612
- legal_name?: string;
613
- /** @maxLength 255 */
614
- email?: string;
615
- /** @maxLength 64 */
616
- tax_id?: string;
617
- /** @maxLength 255 */
618
- address_line1?: string;
619
- /** @maxLength 255 */
620
- address_line2?: string;
621
- /** @maxLength 128 */
622
- address_city?: string;
623
- /** @maxLength 128 */
624
- address_state?: string;
625
- /** @maxLength 32 */
626
- address_postal_code?: string;
627
- /** @pattern ^([A-Z]{2})?$ */
628
- address_country?: string;
645
+ currency: string;
646
+ refund_id: string;
647
+ fee_transaction_id?: string;
648
+ status: WithdrawalItemStatus;
649
+ completed_at?: string;
650
+ payment_gateway: string;
651
+ method_type: string;
652
+ source: WithdrawalSource;
653
+ /** The original gateway failure code when a refund failed, or refund_reversed when a completed refund was reversed. Absent while pending or successful. */
654
+ failure_code?: string;
655
+ }
656
+ export type WithdrawalStatus = (typeof WithdrawalStatus)[keyof typeof WithdrawalStatus];
657
+ export declare const WithdrawalStatus: {
658
+ readonly pending: "pending";
659
+ readonly processing: "processing";
660
+ readonly succeeded: "succeeded";
661
+ readonly partially_completed: "partially_completed";
662
+ readonly failed: "failed";
663
+ readonly reversed: "reversed";
664
+ };
665
+ /**
666
+ * An account withdrawal to the original payment methods of its unused top-ups. Accepted amounts are fixed. deducted_amount, settled_amount and charged_fee_amount report completed source items. Failed items release their principal and fee reservations; successful items are retained when another source fails.
667
+ */
668
+ export interface Withdrawal {
669
+ id: string;
670
+ billing_account_id: number;
629
671
  /**
630
- * How tax applies to the customer, as in Stripe. `none` taxes normally. `exempt` charges no tax.
631
- * `reverse` charges no tax and leaves it to the customer under the reverse-charge mechanism;
632
- * invoices state this. Only operators change it.
672
+ * @minLength 3
673
+ * @maxLength 3
633
674
  */
634
- tax_exempt: ContactTaxExempt;
635
- active: boolean;
675
+ currency: string;
676
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
677
+ amount: string;
678
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
679
+ fee_amount: string;
680
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
681
+ refund_amount: string;
682
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
683
+ deducted_amount: string;
684
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
685
+ settled_amount: string;
686
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
687
+ charged_fee_amount: string;
688
+ status: WithdrawalStatus;
636
689
  created_at: string;
637
- }
638
- export interface ContactCreate {
690
+ completed_at?: string;
691
+ /** Identity that submitted this withdrawal. It can differ from the billing account owner. */
692
+ created_by?: string;
693
+ }
694
+ export interface WithdrawalPreviewItem {
695
+ source_transaction_id: string;
696
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
697
+ amount: string;
698
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
699
+ fee_amount: string;
700
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
701
+ refund_amount: string;
702
+ source: WithdrawalSource;
703
+ }
704
+ export interface WithdrawalPreview {
705
+ billing_account_id: number;
639
706
  /**
640
- * @minLength 1
641
- * @maxLength 255
707
+ * @minLength 3
708
+ * @maxLength 3
642
709
  */
643
- name: string;
644
- /** @maxLength 255 */
645
- legal_name?: string;
646
- /** @maxLength 255 */
647
- email?: string;
648
- /** @maxLength 64 */
649
- tax_id?: string;
650
- /** @maxLength 255 */
651
- address_line1?: string;
652
- /** @maxLength 255 */
653
- address_line2?: string;
654
- /** @maxLength 128 */
655
- address_city?: string;
656
- /** @maxLength 128 */
657
- address_state?: string;
658
- /** @maxLength 32 */
659
- address_postal_code?: string;
660
- /** @pattern ^([A-Z]{2})?$ */
661
- address_country?: string;
710
+ currency: string;
711
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
712
+ available_amount: string;
713
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
714
+ amount: string;
715
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
716
+ fee_amount: string;
717
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
718
+ refund_amount: string;
719
+ /** @maxItems 200 */
720
+ items: WithdrawalPreviewItem[];
721
+ }
722
+ export interface WithdrawalPreviewRequest {
723
+ billing_account_id: number;
724
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
725
+ amount?: string;
662
726
  }
663
- export interface ContactUpdate {
727
+ export interface WithdrawalCreate {
728
+ id: string;
729
+ billing_account_id: number;
730
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
731
+ amount: string;
732
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
733
+ expected_refund_amount: string;
664
734
  /**
665
- * @minLength 1
666
- * @maxLength 255
735
+ * @minItems 1
736
+ * @maxItems 200
667
737
  */
668
- name?: string;
669
- /** @maxLength 255 */
670
- legal_name?: string;
671
- /** @maxLength 255 */
672
- email?: string;
673
- /** @maxLength 64 */
674
- tax_id?: string;
675
- /** @maxLength 255 */
676
- address_line1?: string;
677
- /** @maxLength 255 */
678
- address_line2?: string;
679
- /** @maxLength 128 */
680
- address_city?: string;
681
- /** @maxLength 128 */
682
- address_state?: string;
683
- /** @maxLength 32 */
684
- address_postal_code?: string;
685
- /** @pattern ^([A-Z]{2})?$ */
686
- address_country?: string;
687
- active?: boolean;
738
+ expected_items: WithdrawalAllocation[];
688
739
  }
689
- export interface ContactList {
690
- items: Contact[];
740
+ export interface WithdrawalList {
741
+ items: Withdrawal[];
742
+ pagination: OffsetPagination;
743
+ }
744
+ export interface WithdrawalItemList {
745
+ items: WithdrawalItem[];
691
746
  pagination: OffsetPagination;
692
747
  }
693
748
  /**
@@ -1749,6 +1804,7 @@ export declare const TransactionType: {
1749
1804
  readonly payment: "payment";
1750
1805
  readonly refund: "refund";
1751
1806
  readonly adjustment: "adjustment";
1807
+ readonly fee: "fee";
1752
1808
  };
1753
1809
  /**
1754
1810
  * A funds operation. Each payment has one source; refunds identify the original successful transaction. Unknown gateway results remain pending. Payments from the balance or a gateway are distinct from credit-grant payments.
@@ -3360,6 +3416,110 @@ export interface QuoteRequest {
3360
3416
  promotion_code?: string;
3361
3417
  refund?: OrderRefundQuoteInput;
3362
3418
  }
3419
+ /**
3420
+ * How tax applies to the customer, as in Stripe. `none` taxes normally. `exempt` charges no tax.
3421
+ * `reverse` charges no tax and leaves it to the customer under the reverse-charge mechanism;
3422
+ * invoices state this. Only operators change it.
3423
+ */
3424
+ export type ContactTaxExempt = (typeof ContactTaxExempt)[keyof typeof ContactTaxExempt];
3425
+ export declare const ContactTaxExempt: {
3426
+ readonly none: "none";
3427
+ readonly exempt: "exempt";
3428
+ readonly reverse: "reverse";
3429
+ };
3430
+ /**
3431
+ * A billing-account contact profile with one address. An account can hold multiple contacts; this is not a login identity.
3432
+ */
3433
+ export interface Contact {
3434
+ id: string;
3435
+ billing_account_id: number;
3436
+ /**
3437
+ * @minLength 1
3438
+ * @maxLength 255
3439
+ */
3440
+ name: string;
3441
+ /** @maxLength 255 */
3442
+ legal_name?: string;
3443
+ /** @maxLength 255 */
3444
+ email?: string;
3445
+ /** @maxLength 64 */
3446
+ tax_id?: string;
3447
+ /** @maxLength 255 */
3448
+ address_line1?: string;
3449
+ /** @maxLength 255 */
3450
+ address_line2?: string;
3451
+ /** @maxLength 128 */
3452
+ address_city?: string;
3453
+ /** @maxLength 128 */
3454
+ address_state?: string;
3455
+ /** @maxLength 32 */
3456
+ address_postal_code?: string;
3457
+ /** @pattern ^([A-Z]{2})?$ */
3458
+ address_country?: string;
3459
+ /**
3460
+ * How tax applies to the customer, as in Stripe. `none` taxes normally. `exempt` charges no tax.
3461
+ * `reverse` charges no tax and leaves it to the customer under the reverse-charge mechanism;
3462
+ * invoices state this. Only operators change it.
3463
+ */
3464
+ tax_exempt: ContactTaxExempt;
3465
+ active: boolean;
3466
+ created_at: string;
3467
+ }
3468
+ export interface ContactCreate {
3469
+ /**
3470
+ * @minLength 1
3471
+ * @maxLength 255
3472
+ */
3473
+ name: string;
3474
+ /** @maxLength 255 */
3475
+ legal_name?: string;
3476
+ /** @maxLength 255 */
3477
+ email?: string;
3478
+ /** @maxLength 64 */
3479
+ tax_id?: string;
3480
+ /** @maxLength 255 */
3481
+ address_line1?: string;
3482
+ /** @maxLength 255 */
3483
+ address_line2?: string;
3484
+ /** @maxLength 128 */
3485
+ address_city?: string;
3486
+ /** @maxLength 128 */
3487
+ address_state?: string;
3488
+ /** @maxLength 32 */
3489
+ address_postal_code?: string;
3490
+ /** @pattern ^([A-Z]{2})?$ */
3491
+ address_country?: string;
3492
+ }
3493
+ export interface ContactUpdate {
3494
+ /**
3495
+ * @minLength 1
3496
+ * @maxLength 255
3497
+ */
3498
+ name?: string;
3499
+ /** @maxLength 255 */
3500
+ legal_name?: string;
3501
+ /** @maxLength 255 */
3502
+ email?: string;
3503
+ /** @maxLength 64 */
3504
+ tax_id?: string;
3505
+ /** @maxLength 255 */
3506
+ address_line1?: string;
3507
+ /** @maxLength 255 */
3508
+ address_line2?: string;
3509
+ /** @maxLength 128 */
3510
+ address_city?: string;
3511
+ /** @maxLength 128 */
3512
+ address_state?: string;
3513
+ /** @maxLength 32 */
3514
+ address_postal_code?: string;
3515
+ /** @pattern ^([A-Z]{2})?$ */
3516
+ address_country?: string;
3517
+ active?: boolean;
3518
+ }
3519
+ export interface ContactList {
3520
+ items: Contact[];
3521
+ pagination: OffsetPagination;
3522
+ }
3363
3523
  export interface CancelSubscriptionRequest {
3364
3524
  mode: TerminationPolicy;
3365
3525
  /** For immediate cancellation, the quoted whole-second refund basis. Now when omitted. */
@@ -54,10 +54,19 @@ export const InvoiceStatus = {
54
54
  void: "void",
55
55
  uncollectible: "uncollectible",
56
56
  };
57
- export const ContactTaxExempt = {
58
- none: "none",
59
- exempt: "exempt",
60
- reverse: "reverse",
57
+ export const WithdrawalItemStatus = {
58
+ pending: "pending",
59
+ succeeded: "succeeded",
60
+ failed: "failed",
61
+ reversed: "reversed",
62
+ };
63
+ export const WithdrawalStatus = {
64
+ pending: "pending",
65
+ processing: "processing",
66
+ succeeded: "succeeded",
67
+ partially_completed: "partially_completed",
68
+ failed: "failed",
69
+ reversed: "reversed",
61
70
  };
62
71
  export const TerminationPolicy = {
63
72
  immediate: "immediate",
@@ -192,6 +201,7 @@ export const TransactionType = {
192
201
  payment: "payment",
193
202
  refund: "refund",
194
203
  adjustment: "adjustment",
204
+ fee: "fee",
195
205
  };
196
206
  export const InvoiceCustomerTaxExempt = {
197
207
  none: "none",
@@ -402,6 +412,11 @@ export const ActiveResourceStatus = {
402
412
  closing: "closing",
403
413
  closed: "closed",
404
414
  };
415
+ export const ContactTaxExempt = {
416
+ none: "none",
417
+ exempt: "exempt",
418
+ reverse: "reverse",
419
+ };
405
420
  export const StatementStatus = {
406
421
  open: "open",
407
422
  closed: "closed",
@@ -31,7 +31,7 @@
31
31
  import * as zod from "zod";
32
32
  export declare const CursorPageRequestResource: zod.ZodObject<{
33
33
  items: zod.ZodArray<zod.ZodObject<{
34
- api_key_id: zod.ZodUUID;
34
+ api_key_id: zod.ZodNullable<zod.ZodUUID>;
35
35
  cache_read_tokens: zod.ZodInt;
36
36
  cache_write_tokens: zod.ZodInt;
37
37
  error_code: zod.ZodString;
@@ -66,6 +66,7 @@ export declare const PaymentResult: zod.ZodObject<{
66
66
  payment: "payment";
67
67
  refund: "refund";
68
68
  adjustment: "adjustment";
69
+ fee: "fee";
69
70
  }>;
70
71
  amount: zod.ZodString;
71
72
  remaining_amount: zod.ZodString;
@@ -68,6 +68,7 @@ export declare const Refund: zod.ZodObject<{
68
68
  payment: "payment";
69
69
  refund: "refund";
70
70
  adjustment: "adjustment";
71
+ fee: "fee";
71
72
  }>;
72
73
  amount: zod.ZodString;
73
74
  remaining_amount: zod.ZodString;
@@ -69,6 +69,7 @@ export declare const RefundList: zod.ZodObject<{
69
69
  payment: "payment";
70
70
  refund: "refund";
71
71
  adjustment: "adjustment";
72
+ fee: "fee";
72
73
  }>;
73
74
  amount: zod.ZodString;
74
75
  remaining_amount: zod.ZodString;
@@ -30,7 +30,7 @@
30
30
  */
31
31
  import * as zod from "zod";
32
32
  export declare const RequestResource: zod.ZodObject<{
33
- api_key_id: zod.ZodUUID;
33
+ api_key_id: zod.ZodNullable<zod.ZodUUID>;
34
34
  cache_read_tokens: zod.ZodInt;
35
35
  cache_write_tokens: zod.ZodInt;
36
36
  error_code: zod.ZodString;
@@ -30,7 +30,10 @@
30
30
  */
31
31
  import * as zod from "zod";
32
32
  export const RequestResource = zod.strictObject({
33
- api_key_id: zod.uuid(),
33
+ api_key_id: zod
34
+ .uuid()
35
+ .nullable()
36
+ .describe("Null for a request made by an internal service directly for the project."),
34
37
  cache_read_tokens: zod
35
38
  .int()
36
39
  .describe("The portion served from the upstream prefix cache, which costs an order of magnitude less than ordinary input"),
@@ -65,6 +65,7 @@ export declare const Transaction: zod.ZodObject<{
65
65
  payment: "payment";
66
66
  refund: "refund";
67
67
  adjustment: "adjustment";
68
+ fee: "fee";
68
69
  }>;
69
70
  amount: zod.ZodString;
70
71
  remaining_amount: zod.ZodString;
@@ -66,6 +66,7 @@ export declare const TransactionList: zod.ZodObject<{
66
66
  payment: "payment";
67
67
  refund: "refund";
68
68
  adjustment: "adjustment";
69
+ fee: "fee";
69
70
  }>;
70
71
  amount: zod.ZodString;
71
72
  remaining_amount: zod.ZodString;
@@ -34,6 +34,7 @@ export declare const TransactionType: zod.ZodEnum<{
34
34
  payment: "payment";
35
35
  refund: "refund";
36
36
  adjustment: "adjustment";
37
+ fee: "fee";
37
38
  }>;
38
39
  export type TransactionType = zod.input<typeof TransactionType>;
39
40
  export type TransactionTypeOutput = zod.output<typeof TransactionType>;
@@ -30,5 +30,5 @@
30
30
  */
31
31
  import * as zod from "zod";
32
32
  export const TransactionType = zod
33
- .enum(["topup", "payment", "refund", "adjustment"])
33
+ .enum(["topup", "payment", "refund", "adjustment", "fee"])
34
34
  .describe("topup adds to the balance; payment settles an invoice; refund returns original funds; adjustment changes the balance with an audit reason.");
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ export declare const withdrawalCurrencyMin = 3;
33
+ export declare const withdrawalCurrencyMax = 3;
34
+ export declare const withdrawalAmountRegExp: RegExp;
35
+ export declare const withdrawalFeeAmountRegExp: RegExp;
36
+ export declare const withdrawalRefundAmountRegExp: RegExp;
37
+ export declare const withdrawalDeductedAmountRegExp: RegExp;
38
+ export declare const withdrawalSettledAmountRegExp: RegExp;
39
+ export declare const withdrawalChargedFeeAmountRegExp: RegExp;
40
+ export declare const Withdrawal: zod.ZodObject<{
41
+ id: zod.ZodUUID;
42
+ billing_account_id: zod.ZodInt;
43
+ currency: zod.ZodString;
44
+ amount: zod.ZodString;
45
+ fee_amount: zod.ZodString;
46
+ refund_amount: zod.ZodString;
47
+ deducted_amount: zod.ZodString;
48
+ settled_amount: zod.ZodString;
49
+ charged_fee_amount: zod.ZodString;
50
+ status: zod.ZodEnum<{
51
+ pending: "pending";
52
+ failed: "failed";
53
+ succeeded: "succeeded";
54
+ processing: "processing";
55
+ partially_completed: "partially_completed";
56
+ reversed: "reversed";
57
+ }>;
58
+ created_at: zod.z.ZodISODateTime;
59
+ completed_at: zod.ZodOptional<zod.z.ZodISODateTime>;
60
+ created_by: zod.ZodOptional<zod.ZodString>;
61
+ }, zod.z.core.$strict>;
62
+ export type Withdrawal = zod.input<typeof Withdrawal>;
63
+ export type WithdrawalOutput = zod.output<typeof Withdrawal>;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ export const withdrawalCurrencyMin = 3;
33
+ export const withdrawalCurrencyMax = 3;
34
+ export const withdrawalAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
35
+ export const withdrawalFeeAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
36
+ export const withdrawalRefundAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
37
+ export const withdrawalDeductedAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
38
+ export const withdrawalSettledAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
39
+ export const withdrawalChargedFeeAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
40
+ export const Withdrawal = zod
41
+ .strictObject({
42
+ id: zod.uuid(),
43
+ billing_account_id: zod.int(),
44
+ currency: zod.string().min(withdrawalCurrencyMin).max(withdrawalCurrencyMax),
45
+ amount: zod.string().regex(withdrawalAmountRegExp),
46
+ fee_amount: zod.string().regex(withdrawalFeeAmountRegExp),
47
+ refund_amount: zod.string().regex(withdrawalRefundAmountRegExp),
48
+ deducted_amount: zod.string().regex(withdrawalDeductedAmountRegExp),
49
+ settled_amount: zod.string().regex(withdrawalSettledAmountRegExp),
50
+ charged_fee_amount: zod.string().regex(withdrawalChargedFeeAmountRegExp),
51
+ status: zod.enum([
52
+ "pending",
53
+ "processing",
54
+ "succeeded",
55
+ "partially_completed",
56
+ "failed",
57
+ "reversed",
58
+ ]),
59
+ created_at: zod.iso.datetime({ offset: true }),
60
+ completed_at: zod.iso.datetime({ offset: true }).optional(),
61
+ created_by: zod
62
+ .string()
63
+ .optional()
64
+ .describe("Identity that submitted this withdrawal. It can differ from the billing account owner."),
65
+ })
66
+ .describe("An account withdrawal to the original payment methods of its unused top-ups. Accepted amounts are fixed. deducted_amount, settled_amount and charged_fee_amount report completed source items. Failed items release their principal and fee reservations; successful items are retained when another source fails.");