@leaflow/sdk 0.129.1 → 0.130.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 (163) 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 +241 -85
  68. package/dist/canopy/v1/generated/models.js +19 -4
  69. package/dist/canopy/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  70. package/dist/canopy/v1/generated/validators/refund.zod.d.ts +1 -0
  71. package/dist/canopy/v1/generated/validators/refundList.zod.d.ts +1 -0
  72. package/dist/canopy/v1/generated/validators/transaction.zod.d.ts +1 -0
  73. package/dist/canopy/v1/generated/validators/transactionList.zod.d.ts +1 -0
  74. package/dist/canopy/v1/generated/validators/transactionType.zod.d.ts +1 -0
  75. package/dist/canopy/v1/generated/validators/transactionType.zod.js +1 -1
  76. package/dist/canopy/v1/generated/validators/withdrawal.zod.d.ts +63 -0
  77. package/dist/canopy/v1/generated/validators/withdrawal.zod.js +66 -0
  78. package/dist/canopy/v1/generated/validators/withdrawalAllocation.zod.d.ts +42 -0
  79. package/dist/canopy/v1/generated/validators/withdrawalAllocation.zod.js +40 -0
  80. package/dist/canopy/v1/generated/validators/withdrawalCreate.zod.d.ts +48 -0
  81. package/dist/canopy/v1/generated/validators/withdrawalCreate.zod.js +42 -0
  82. package/dist/canopy/v1/generated/validators/withdrawalItem.zod.d.ts +69 -0
  83. package/dist/canopy/v1/generated/validators/withdrawalItem.zod.js +60 -0
  84. package/dist/canopy/v1/generated/validators/withdrawalItemList.zod.d.ts +71 -0
  85. package/dist/canopy/v1/generated/validators/withdrawalItemList.zod.js +37 -0
  86. package/dist/canopy/v1/generated/validators/withdrawalList.zod.d.ts +62 -0
  87. package/dist/canopy/v1/generated/validators/withdrawalList.zod.js +37 -0
  88. package/dist/canopy/v1/generated/validators/withdrawalPreview.zod.d.ts +63 -0
  89. package/dist/canopy/v1/generated/validators/withdrawalPreview.zod.js +48 -0
  90. package/dist/canopy/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +51 -0
  91. package/dist/canopy/v1/generated/validators/withdrawalPreviewItem.zod.js +42 -0
  92. package/dist/canopy/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +38 -0
  93. package/dist/canopy/v1/generated/validators/withdrawalPreviewRequest.zod.js +36 -0
  94. package/dist/canopy/v1/generated/validators/withdrawalSource.zod.d.ts +46 -0
  95. package/dist/canopy/v1/generated/validators/withdrawalSource.zod.js +46 -0
  96. package/dist/compute/v1/generated/models.d.ts +241 -85
  97. package/dist/compute/v1/generated/models.js +19 -4
  98. package/dist/compute/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  99. package/dist/compute/v1/generated/validators/refund.zod.d.ts +1 -0
  100. package/dist/compute/v1/generated/validators/refundList.zod.d.ts +1 -0
  101. package/dist/compute/v1/generated/validators/transaction.zod.d.ts +1 -0
  102. package/dist/compute/v1/generated/validators/transactionList.zod.d.ts +1 -0
  103. package/dist/compute/v1/generated/validators/transactionType.zod.d.ts +1 -0
  104. package/dist/compute/v1/generated/validators/transactionType.zod.js +1 -1
  105. package/dist/compute/v1/generated/validators/withdrawal.zod.d.ts +56 -0
  106. package/dist/compute/v1/generated/validators/withdrawal.zod.js +59 -0
  107. package/dist/compute/v1/generated/validators/withdrawalAllocation.zod.d.ts +35 -0
  108. package/dist/compute/v1/generated/validators/withdrawalAllocation.zod.js +33 -0
  109. package/dist/compute/v1/generated/validators/withdrawalCreate.zod.d.ts +41 -0
  110. package/dist/compute/v1/generated/validators/withdrawalCreate.zod.js +35 -0
  111. package/dist/compute/v1/generated/validators/withdrawalItem.zod.d.ts +62 -0
  112. package/dist/compute/v1/generated/validators/withdrawalItem.zod.js +53 -0
  113. package/dist/compute/v1/generated/validators/withdrawalItemList.zod.d.ts +64 -0
  114. package/dist/compute/v1/generated/validators/withdrawalItemList.zod.js +30 -0
  115. package/dist/compute/v1/generated/validators/withdrawalList.zod.d.ts +55 -0
  116. package/dist/compute/v1/generated/validators/withdrawalList.zod.js +30 -0
  117. package/dist/compute/v1/generated/validators/withdrawalPreview.zod.d.ts +56 -0
  118. package/dist/compute/v1/generated/validators/withdrawalPreview.zod.js +41 -0
  119. package/dist/compute/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +44 -0
  120. package/dist/compute/v1/generated/validators/withdrawalPreviewItem.zod.js +35 -0
  121. package/dist/compute/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +31 -0
  122. package/dist/compute/v1/generated/validators/withdrawalPreviewRequest.zod.js +29 -0
  123. package/dist/compute/v1/generated/validators/withdrawalSource.zod.d.ts +39 -0
  124. package/dist/compute/v1/generated/validators/withdrawalSource.zod.js +39 -0
  125. package/dist/membership/v1/generated/models.d.ts +247 -85
  126. package/dist/membership/v1/generated/models.js +19 -4
  127. package/dist/membership/v1/generated/validators/grant.zod.d.ts +2 -0
  128. package/dist/membership/v1/generated/validators/grant.zod.js +5 -0
  129. package/dist/membership/v1/generated/validators/membership.zod.d.ts +2 -0
  130. package/dist/membership/v1/generated/validators/membershipList.zod.d.ts +2 -0
  131. package/dist/membership/v1/generated/validators/membershipPurchase.zod.d.ts +2 -0
  132. package/dist/membership/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  133. package/dist/membership/v1/generated/validators/period.zod.d.ts +2 -0
  134. package/dist/membership/v1/generated/validators/periodList.zod.d.ts +2 -0
  135. package/dist/membership/v1/generated/validators/refund.zod.d.ts +1 -0
  136. package/dist/membership/v1/generated/validators/refundList.zod.d.ts +1 -0
  137. package/dist/membership/v1/generated/validators/transaction.zod.d.ts +1 -0
  138. package/dist/membership/v1/generated/validators/transactionList.zod.d.ts +1 -0
  139. package/dist/membership/v1/generated/validators/transactionType.zod.d.ts +1 -0
  140. package/dist/membership/v1/generated/validators/transactionType.zod.js +1 -1
  141. package/dist/membership/v1/generated/validators/withdrawal.zod.d.ts +40 -0
  142. package/dist/membership/v1/generated/validators/withdrawal.zod.js +43 -0
  143. package/dist/membership/v1/generated/validators/withdrawalAllocation.zod.d.ts +19 -0
  144. package/dist/membership/v1/generated/validators/withdrawalAllocation.zod.js +17 -0
  145. package/dist/membership/v1/generated/validators/withdrawalCreate.zod.d.ts +25 -0
  146. package/dist/membership/v1/generated/validators/withdrawalCreate.zod.js +19 -0
  147. package/dist/membership/v1/generated/validators/withdrawalItem.zod.d.ts +46 -0
  148. package/dist/membership/v1/generated/validators/withdrawalItem.zod.js +37 -0
  149. package/dist/membership/v1/generated/validators/withdrawalItemList.zod.d.ts +48 -0
  150. package/dist/membership/v1/generated/validators/withdrawalItemList.zod.js +14 -0
  151. package/dist/membership/v1/generated/validators/withdrawalList.zod.d.ts +39 -0
  152. package/dist/membership/v1/generated/validators/withdrawalList.zod.js +14 -0
  153. package/dist/membership/v1/generated/validators/withdrawalPreview.zod.d.ts +40 -0
  154. package/dist/membership/v1/generated/validators/withdrawalPreview.zod.js +25 -0
  155. package/dist/membership/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +28 -0
  156. package/dist/membership/v1/generated/validators/withdrawalPreviewItem.zod.js +19 -0
  157. package/dist/membership/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +15 -0
  158. package/dist/membership/v1/generated/validators/withdrawalPreviewRequest.zod.js +13 -0
  159. package/dist/membership/v1/generated/validators/withdrawalSource.zod.d.ts +23 -0
  160. package/dist/membership/v1/generated/validators/withdrawalSource.zod.js +23 -0
  161. package/dist/routes.d.ts +40 -0
  162. package/dist/routes.js +45 -0
  163. package/package.json +1 -1
@@ -586,108 +586,159 @@ export interface CursorPagination {
586
586
  /** @nullable */
587
587
  next_cursor?: string | null;
588
588
  }
589
+ export interface WithdrawalAllocation {
590
+ source_transaction_id: string;
591
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
592
+ amount: string;
593
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
594
+ fee_amount: string;
595
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
596
+ refund_amount: string;
597
+ }
598
+ export type WithdrawalItemStatus = (typeof WithdrawalItemStatus)[keyof typeof WithdrawalItemStatus];
599
+ export declare const WithdrawalItemStatus: {
600
+ readonly pending: "pending";
601
+ readonly succeeded: "succeeded";
602
+ readonly failed: "failed";
603
+ readonly reversed: "reversed";
604
+ };
589
605
  /**
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.
606
+ * 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
607
  */
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
- };
608
+ export interface WithdrawalSource {
609
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
610
+ amount: string;
611
+ /**
612
+ * @minLength 3
613
+ * @maxLength 3
614
+ */
615
+ currency: string;
616
+ received_at: string;
617
+ payment_gateway: string;
618
+ method_type: string;
619
+ card_brand?: string;
620
+ /** @pattern ^[0-9]{4}$ */
621
+ card_last4?: string;
622
+ }
600
623
  /**
601
- * A billing-account contact profile with one address. An account can hold multiple contacts; this is not a login identity.
624
+ * 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
625
  */
603
- export interface Contact {
626
+ export interface WithdrawalItem {
627
+ source_transaction_id: string;
628
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
629
+ amount: string;
630
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
631
+ fee_amount: string;
632
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
633
+ refund_amount: string;
604
634
  id: string;
635
+ withdrawal_id: string;
605
636
  billing_account_id: number;
606
637
  /**
607
- * @minLength 1
608
- * @maxLength 255
638
+ * @minLength 3
639
+ * @maxLength 3
609
640
  */
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;
641
+ currency: string;
642
+ refund_id: string;
643
+ fee_transaction_id?: string;
644
+ status: WithdrawalItemStatus;
645
+ completed_at?: string;
646
+ payment_gateway: string;
647
+ method_type: string;
648
+ source: WithdrawalSource;
649
+ /** The original gateway failure code when a refund failed, or refund_reversed when a completed refund was reversed. Absent while pending or successful. */
650
+ failure_code?: string;
651
+ }
652
+ export type WithdrawalStatus = (typeof WithdrawalStatus)[keyof typeof WithdrawalStatus];
653
+ export declare const WithdrawalStatus: {
654
+ readonly pending: "pending";
655
+ readonly processing: "processing";
656
+ readonly succeeded: "succeeded";
657
+ readonly partially_completed: "partially_completed";
658
+ readonly failed: "failed";
659
+ readonly reversed: "reversed";
660
+ };
661
+ /**
662
+ * 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.
663
+ */
664
+ export interface Withdrawal {
665
+ id: string;
666
+ billing_account_id: number;
629
667
  /**
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.
668
+ * @minLength 3
669
+ * @maxLength 3
633
670
  */
634
- tax_exempt: ContactTaxExempt;
635
- active: boolean;
671
+ currency: string;
672
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
673
+ amount: string;
674
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
675
+ fee_amount: string;
676
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
677
+ refund_amount: string;
678
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
679
+ deducted_amount: string;
680
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
681
+ settled_amount: string;
682
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
683
+ charged_fee_amount: string;
684
+ status: WithdrawalStatus;
636
685
  created_at: string;
637
- }
638
- export interface ContactCreate {
686
+ completed_at?: string;
687
+ /** Identity that submitted this withdrawal. It can differ from the billing account owner. */
688
+ created_by?: string;
689
+ }
690
+ export interface WithdrawalPreviewItem {
691
+ source_transaction_id: string;
692
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
693
+ amount: string;
694
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
695
+ fee_amount: string;
696
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
697
+ refund_amount: string;
698
+ source: WithdrawalSource;
699
+ }
700
+ export interface WithdrawalPreview {
701
+ billing_account_id: number;
639
702
  /**
640
- * @minLength 1
641
- * @maxLength 255
703
+ * @minLength 3
704
+ * @maxLength 3
642
705
  */
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;
706
+ currency: string;
707
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
708
+ available_amount: string;
709
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
710
+ amount: string;
711
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
712
+ fee_amount: string;
713
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
714
+ refund_amount: string;
715
+ /** @maxItems 200 */
716
+ items: WithdrawalPreviewItem[];
717
+ }
718
+ export interface WithdrawalPreviewRequest {
719
+ billing_account_id: number;
720
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
721
+ amount?: string;
662
722
  }
663
- export interface ContactUpdate {
723
+ export interface WithdrawalCreate {
724
+ id: string;
725
+ billing_account_id: number;
726
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
727
+ amount: string;
728
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
729
+ expected_refund_amount: string;
664
730
  /**
665
- * @minLength 1
666
- * @maxLength 255
731
+ * @minItems 1
732
+ * @maxItems 200
667
733
  */
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;
734
+ expected_items: WithdrawalAllocation[];
688
735
  }
689
- export interface ContactList {
690
- items: Contact[];
736
+ export interface WithdrawalList {
737
+ items: Withdrawal[];
738
+ pagination: OffsetPagination;
739
+ }
740
+ export interface WithdrawalItemList {
741
+ items: WithdrawalItem[];
691
742
  pagination: OffsetPagination;
692
743
  }
693
744
  /**
@@ -1749,6 +1800,7 @@ export declare const TransactionType: {
1749
1800
  readonly payment: "payment";
1750
1801
  readonly refund: "refund";
1751
1802
  readonly adjustment: "adjustment";
1803
+ readonly fee: "fee";
1752
1804
  };
1753
1805
  /**
1754
1806
  * 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 +3412,110 @@ export interface QuoteRequest {
3360
3412
  promotion_code?: string;
3361
3413
  refund?: OrderRefundQuoteInput;
3362
3414
  }
3415
+ /**
3416
+ * How tax applies to the customer, as in Stripe. `none` taxes normally. `exempt` charges no tax.
3417
+ * `reverse` charges no tax and leaves it to the customer under the reverse-charge mechanism;
3418
+ * invoices state this. Only operators change it.
3419
+ */
3420
+ export type ContactTaxExempt = (typeof ContactTaxExempt)[keyof typeof ContactTaxExempt];
3421
+ export declare const ContactTaxExempt: {
3422
+ readonly none: "none";
3423
+ readonly exempt: "exempt";
3424
+ readonly reverse: "reverse";
3425
+ };
3426
+ /**
3427
+ * A billing-account contact profile with one address. An account can hold multiple contacts; this is not a login identity.
3428
+ */
3429
+ export interface Contact {
3430
+ id: string;
3431
+ billing_account_id: number;
3432
+ /**
3433
+ * @minLength 1
3434
+ * @maxLength 255
3435
+ */
3436
+ name: string;
3437
+ /** @maxLength 255 */
3438
+ legal_name?: string;
3439
+ /** @maxLength 255 */
3440
+ email?: string;
3441
+ /** @maxLength 64 */
3442
+ tax_id?: string;
3443
+ /** @maxLength 255 */
3444
+ address_line1?: string;
3445
+ /** @maxLength 255 */
3446
+ address_line2?: string;
3447
+ /** @maxLength 128 */
3448
+ address_city?: string;
3449
+ /** @maxLength 128 */
3450
+ address_state?: string;
3451
+ /** @maxLength 32 */
3452
+ address_postal_code?: string;
3453
+ /** @pattern ^([A-Z]{2})?$ */
3454
+ address_country?: string;
3455
+ /**
3456
+ * How tax applies to the customer, as in Stripe. `none` taxes normally. `exempt` charges no tax.
3457
+ * `reverse` charges no tax and leaves it to the customer under the reverse-charge mechanism;
3458
+ * invoices state this. Only operators change it.
3459
+ */
3460
+ tax_exempt: ContactTaxExempt;
3461
+ active: boolean;
3462
+ created_at: string;
3463
+ }
3464
+ export interface ContactCreate {
3465
+ /**
3466
+ * @minLength 1
3467
+ * @maxLength 255
3468
+ */
3469
+ name: string;
3470
+ /** @maxLength 255 */
3471
+ legal_name?: string;
3472
+ /** @maxLength 255 */
3473
+ email?: string;
3474
+ /** @maxLength 64 */
3475
+ tax_id?: string;
3476
+ /** @maxLength 255 */
3477
+ address_line1?: string;
3478
+ /** @maxLength 255 */
3479
+ address_line2?: string;
3480
+ /** @maxLength 128 */
3481
+ address_city?: string;
3482
+ /** @maxLength 128 */
3483
+ address_state?: string;
3484
+ /** @maxLength 32 */
3485
+ address_postal_code?: string;
3486
+ /** @pattern ^([A-Z]{2})?$ */
3487
+ address_country?: string;
3488
+ }
3489
+ export interface ContactUpdate {
3490
+ /**
3491
+ * @minLength 1
3492
+ * @maxLength 255
3493
+ */
3494
+ name?: string;
3495
+ /** @maxLength 255 */
3496
+ legal_name?: string;
3497
+ /** @maxLength 255 */
3498
+ email?: string;
3499
+ /** @maxLength 64 */
3500
+ tax_id?: string;
3501
+ /** @maxLength 255 */
3502
+ address_line1?: string;
3503
+ /** @maxLength 255 */
3504
+ address_line2?: string;
3505
+ /** @maxLength 128 */
3506
+ address_city?: string;
3507
+ /** @maxLength 128 */
3508
+ address_state?: string;
3509
+ /** @maxLength 32 */
3510
+ address_postal_code?: string;
3511
+ /** @pattern ^([A-Z]{2})?$ */
3512
+ address_country?: string;
3513
+ active?: boolean;
3514
+ }
3515
+ export interface ContactList {
3516
+ items: Contact[];
3517
+ pagination: OffsetPagination;
3518
+ }
3363
3519
  export interface CancelSubscriptionRequest {
3364
3520
  mode: TerminationPolicy;
3365
3521
  /** 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",
@@ -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;
@@ -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.");
@@ -0,0 +1,42 @@
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 withdrawalAllocationAmountRegExp: RegExp;
33
+ export declare const withdrawalAllocationFeeAmountRegExp: RegExp;
34
+ export declare const withdrawalAllocationRefundAmountRegExp: RegExp;
35
+ export declare const WithdrawalAllocation: zod.ZodObject<{
36
+ source_transaction_id: zod.ZodUUID;
37
+ amount: zod.ZodString;
38
+ fee_amount: zod.ZodString;
39
+ refund_amount: zod.ZodString;
40
+ }, zod.z.core.$strict>;
41
+ export type WithdrawalAllocation = zod.input<typeof WithdrawalAllocation>;
42
+ export type WithdrawalAllocationOutput = zod.output<typeof WithdrawalAllocation>;