@moovio/sdk 26.7.0-dev.2 → 26.7.0-dev.3

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 (170) hide show
  1. package/bin/mcp-server.js +234 -52
  2. package/bin/mcp-server.js.map +38 -30
  3. package/jsr.json +1 -1
  4. package/lib/config.d.ts +3 -3
  5. package/lib/config.js +3 -3
  6. package/mcp-server/mcp-server.js +1 -1
  7. package/mcp-server/server.js +1 -1
  8. package/models/components/amountdetails.d.ts +26 -0
  9. package/models/components/amountdetails.d.ts.map +1 -0
  10. package/models/components/amountdetails.js +62 -0
  11. package/models/components/amountdetails.js.map +1 -0
  12. package/models/components/amountdetailsupdate.d.ts +26 -0
  13. package/models/components/amountdetailsupdate.d.ts.map +1 -0
  14. package/models/components/amountdetailsupdate.js +62 -0
  15. package/models/components/amountdetailsupdate.js.map +1 -0
  16. package/models/components/amountdetailsvalidationerror.d.ts +19 -0
  17. package/models/components/amountdetailsvalidationerror.d.ts.map +1 -0
  18. package/models/components/amountdetailsvalidationerror.js +61 -0
  19. package/models/components/amountdetailsvalidationerror.js.map +1 -0
  20. package/models/components/asynccreatedrefund.d.ts +3 -0
  21. package/models/components/asynccreatedrefund.d.ts.map +1 -1
  22. package/models/components/asynccreatedrefund.js +3 -0
  23. package/models/components/asynccreatedrefund.js.map +1 -1
  24. package/models/components/cardacquiringrefund.d.ts +3 -0
  25. package/models/components/cardacquiringrefund.d.ts.map +1 -1
  26. package/models/components/cardacquiringrefund.js +3 -0
  27. package/models/components/cardacquiringrefund.js.map +1 -1
  28. package/models/components/createinvoice.d.ts +3 -3
  29. package/models/components/createinvoice.d.ts.map +1 -1
  30. package/models/components/createinvoice.js +3 -3
  31. package/models/components/createinvoice.js.map +1 -1
  32. package/models/components/createpaymentlinkamountdetails.d.ts +5 -0
  33. package/models/components/createpaymentlinkamountdetails.d.ts.map +1 -1
  34. package/models/components/createpaymentlinkamountdetails.js +2 -0
  35. package/models/components/createpaymentlinkamountdetails.js.map +1 -1
  36. package/models/components/createpaymentlinkamountdetailsvalidationerror.d.ts +2 -0
  37. package/models/components/createpaymentlinkamountdetailsvalidationerror.d.ts.map +1 -1
  38. package/models/components/createpaymentlinkamountdetailsvalidationerror.js +2 -0
  39. package/models/components/createpaymentlinkamountdetailsvalidationerror.js.map +1 -1
  40. package/models/components/createrefund.d.ts +6 -0
  41. package/models/components/createrefund.d.ts.map +1 -1
  42. package/models/components/createrefund.js +3 -0
  43. package/models/components/createrefund.js.map +1 -1
  44. package/models/components/createreversal.d.ts +6 -0
  45. package/models/components/createreversal.d.ts.map +1 -1
  46. package/models/components/createreversal.js +3 -0
  47. package/models/components/createreversal.js.map +1 -1
  48. package/models/components/createtransferamountdetails.d.ts +5 -0
  49. package/models/components/createtransferamountdetails.d.ts.map +1 -1
  50. package/models/components/createtransferamountdetails.js +2 -0
  51. package/models/components/createtransferamountdetails.js.map +1 -1
  52. package/models/components/createtransferamountdetailsvalidationerror.d.ts +2 -0
  53. package/models/components/createtransferamountdetailsvalidationerror.d.ts.map +1 -1
  54. package/models/components/createtransferamountdetailsvalidationerror.js +2 -0
  55. package/models/components/createtransferamountdetailsvalidationerror.js.map +1 -1
  56. package/models/components/index.d.ts +8 -0
  57. package/models/components/index.d.ts.map +1 -1
  58. package/models/components/index.js +8 -0
  59. package/models/components/index.js.map +1 -1
  60. package/models/components/invoice.d.ts +4 -3
  61. package/models/components/invoice.d.ts.map +1 -1
  62. package/models/components/invoice.js +3 -2
  63. package/models/components/invoice.js.map +1 -1
  64. package/models/components/paymentlinkamountdetails.d.ts +5 -0
  65. package/models/components/paymentlinkamountdetails.d.ts.map +1 -1
  66. package/models/components/paymentlinkamountdetails.js +2 -0
  67. package/models/components/paymentlinkamountdetails.js.map +1 -1
  68. package/models/components/refundamountdetails.d.ts +21 -0
  69. package/models/components/refundamountdetails.d.ts.map +1 -0
  70. package/models/components/refundamountdetails.js +60 -0
  71. package/models/components/refundamountdetails.js.map +1 -0
  72. package/models/components/refundamountdetailsvalidationerror.d.ts +17 -0
  73. package/models/components/refundamountdetailsvalidationerror.d.ts.map +1 -0
  74. package/models/components/refundamountdetailsvalidationerror.js +59 -0
  75. package/models/components/refundamountdetailsvalidationerror.js.map +1 -0
  76. package/models/components/reversalamountdetails.d.ts +21 -0
  77. package/models/components/reversalamountdetails.d.ts.map +1 -0
  78. package/models/components/reversalamountdetails.js +60 -0
  79. package/models/components/reversalamountdetails.js.map +1 -0
  80. package/models/components/reversalamountdetailsvalidationerror.d.ts +17 -0
  81. package/models/components/reversalamountdetailsvalidationerror.d.ts.map +1 -0
  82. package/models/components/reversalamountdetailsvalidationerror.js +59 -0
  83. package/models/components/reversalamountdetailsvalidationerror.js.map +1 -0
  84. package/models/components/transferamountdetails.d.ts +5 -0
  85. package/models/components/transferamountdetails.d.ts.map +1 -1
  86. package/models/components/transferamountdetails.js +2 -0
  87. package/models/components/transferamountdetails.js.map +1 -1
  88. package/models/components/transferconfig.d.ts +3 -0
  89. package/models/components/transferconfig.d.ts.map +1 -1
  90. package/models/components/transferconfig.js +3 -0
  91. package/models/components/transferconfig.js.map +1 -1
  92. package/models/components/transfercontrols.d.ts +43 -0
  93. package/models/components/transfercontrols.d.ts.map +1 -0
  94. package/models/components/transfercontrols.js +67 -0
  95. package/models/components/transfercontrols.js.map +1 -0
  96. package/models/components/updateinvoice.d.ts +9 -9
  97. package/models/components/updateinvoice.d.ts.map +1 -1
  98. package/models/components/updateinvoice.js +3 -3
  99. package/models/components/updateinvoice.js.map +1 -1
  100. package/models/components/updatepaymentlinkamountdetails.d.ts +5 -0
  101. package/models/components/updatepaymentlinkamountdetails.d.ts.map +1 -1
  102. package/models/components/updatepaymentlinkamountdetails.js +2 -0
  103. package/models/components/updatepaymentlinkamountdetails.js.map +1 -1
  104. package/models/components/updatepaymentlinkamountdetailsvalidationerror.d.ts +2 -0
  105. package/models/components/updatepaymentlinkamountdetailsvalidationerror.d.ts.map +1 -1
  106. package/models/components/updatepaymentlinkamountdetailsvalidationerror.js +2 -0
  107. package/models/components/updatepaymentlinkamountdetailsvalidationerror.js.map +1 -1
  108. package/models/errors/cardacquiringrefund.d.ts +3 -0
  109. package/models/errors/cardacquiringrefund.d.ts.map +1 -1
  110. package/models/errors/cardacquiringrefund.js +4 -0
  111. package/models/errors/cardacquiringrefund.js.map +1 -1
  112. package/models/errors/createinvoiceerror.d.ts +3 -3
  113. package/models/errors/createinvoiceerror.d.ts.map +1 -1
  114. package/models/errors/createinvoiceerror.js +4 -4
  115. package/models/errors/createinvoiceerror.js.map +1 -1
  116. package/models/errors/refundvalidationerror.d.ts +4 -0
  117. package/models/errors/refundvalidationerror.d.ts.map +1 -1
  118. package/models/errors/refundvalidationerror.js +6 -0
  119. package/models/errors/refundvalidationerror.js.map +1 -1
  120. package/models/errors/reversalvalidationerror.d.ts +4 -0
  121. package/models/errors/reversalvalidationerror.d.ts.map +1 -1
  122. package/models/errors/reversalvalidationerror.js +6 -0
  123. package/models/errors/reversalvalidationerror.js.map +1 -1
  124. package/models/errors/updateinvoiceerror.d.ts +3 -3
  125. package/models/errors/updateinvoiceerror.d.ts.map +1 -1
  126. package/models/errors/updateinvoiceerror.js +4 -4
  127. package/models/errors/updateinvoiceerror.js.map +1 -1
  128. package/package.json +1 -1
  129. package/src/lib/config.ts +3 -3
  130. package/src/mcp-server/mcp-server.ts +1 -1
  131. package/src/mcp-server/server.ts +1 -1
  132. package/src/models/components/amountdetails.ts +64 -0
  133. package/src/models/components/amountdetailsupdate.ts +68 -0
  134. package/src/models/components/amountdetailsvalidationerror.ts +58 -0
  135. package/src/models/components/asynccreatedrefund.ts +10 -0
  136. package/src/models/components/cardacquiringrefund.ts +10 -0
  137. package/src/models/components/createinvoice.ts +9 -9
  138. package/src/models/components/createpaymentlinkamountdetails.ts +7 -0
  139. package/src/models/components/createpaymentlinkamountdetailsvalidationerror.ts +4 -0
  140. package/src/models/components/createrefund.ts +13 -0
  141. package/src/models/components/createreversal.ts +13 -0
  142. package/src/models/components/createtransferamountdetails.ts +7 -0
  143. package/src/models/components/createtransferamountdetailsvalidationerror.ts +4 -0
  144. package/src/models/components/index.ts +8 -0
  145. package/src/models/components/invoice.ts +11 -5
  146. package/src/models/components/paymentlinkamountdetails.ts +7 -0
  147. package/src/models/components/refundamountdetails.ts +61 -0
  148. package/src/models/components/refundamountdetailsvalidationerror.ts +55 -0
  149. package/src/models/components/reversalamountdetails.ts +61 -0
  150. package/src/models/components/reversalamountdetailsvalidationerror.ts +55 -0
  151. package/src/models/components/transferamountdetails.ts +7 -0
  152. package/src/models/components/transferconfig.ts +10 -0
  153. package/src/models/components/transfercontrols.ts +86 -0
  154. package/src/models/components/updateinvoice.ts +15 -15
  155. package/src/models/components/updatepaymentlinkamountdetails.ts +7 -0
  156. package/src/models/components/updatepaymentlinkamountdetailsvalidationerror.ts +4 -0
  157. package/src/models/errors/cardacquiringrefund.ts +6 -0
  158. package/src/models/errors/createinvoiceerror.ts +7 -7
  159. package/src/models/errors/refundvalidationerror.ts +12 -0
  160. package/src/models/errors/reversalvalidationerror.ts +12 -0
  161. package/src/models/errors/updateinvoiceerror.ts +7 -7
  162. package/src/types/async.ts +8 -7
  163. package/src/types/primitives.ts +0 -24
  164. package/types/async.d.ts.map +1 -1
  165. package/types/async.js +8 -7
  166. package/types/async.js.map +1 -1
  167. package/types/primitives.d.ts +0 -2
  168. package/types/primitives.d.ts.map +1 -1
  169. package/types/primitives.js +0 -23
  170. package/types/primitives.js.map +1 -1
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ AmountDecimal,
12
+ AmountDecimal$inboundSchema,
13
+ AmountDecimal$Outbound,
14
+ AmountDecimal$outboundSchema,
15
+ } from "./amountdecimal.js";
16
+
17
+ export type RefundAmountDetails = {
18
+ /**
19
+ * The amount of surcharge to refund. Should be proportionate to the surcharge on the original transfer
20
+ */
21
+ surcharge?: AmountDecimal | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export const RefundAmountDetails$inboundSchema: z.ZodType<
26
+ RefundAmountDetails,
27
+ z.ZodTypeDef,
28
+ unknown
29
+ > = z.object({
30
+ surcharge: types.optional(AmountDecimal$inboundSchema),
31
+ });
32
+ /** @internal */
33
+ export type RefundAmountDetails$Outbound = {
34
+ surcharge?: AmountDecimal$Outbound | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const RefundAmountDetails$outboundSchema: z.ZodType<
39
+ RefundAmountDetails$Outbound,
40
+ z.ZodTypeDef,
41
+ RefundAmountDetails
42
+ > = z.object({
43
+ surcharge: AmountDecimal$outboundSchema.optional(),
44
+ });
45
+
46
+ export function refundAmountDetailsToJSON(
47
+ refundAmountDetails: RefundAmountDetails,
48
+ ): string {
49
+ return JSON.stringify(
50
+ RefundAmountDetails$outboundSchema.parse(refundAmountDetails),
51
+ );
52
+ }
53
+ export function refundAmountDetailsFromJSON(
54
+ jsonString: string,
55
+ ): SafeParseResult<RefundAmountDetails, SDKValidationError> {
56
+ return safeParse(
57
+ jsonString,
58
+ (x) => RefundAmountDetails$inboundSchema.parse(JSON.parse(x)),
59
+ `Failed to parse 'RefundAmountDetails' from JSON`,
60
+ );
61
+ }
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type RefundAmountDetailsValidationError = {
12
+ surcharge?: string | undefined;
13
+ };
14
+
15
+ /** @internal */
16
+ export const RefundAmountDetailsValidationError$inboundSchema: z.ZodType<
17
+ RefundAmountDetailsValidationError,
18
+ z.ZodTypeDef,
19
+ unknown
20
+ > = z.object({
21
+ surcharge: types.optional(types.string()),
22
+ });
23
+ /** @internal */
24
+ export type RefundAmountDetailsValidationError$Outbound = {
25
+ surcharge?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const RefundAmountDetailsValidationError$outboundSchema: z.ZodType<
30
+ RefundAmountDetailsValidationError$Outbound,
31
+ z.ZodTypeDef,
32
+ RefundAmountDetailsValidationError
33
+ > = z.object({
34
+ surcharge: z.string().optional(),
35
+ });
36
+
37
+ export function refundAmountDetailsValidationErrorToJSON(
38
+ refundAmountDetailsValidationError: RefundAmountDetailsValidationError,
39
+ ): string {
40
+ return JSON.stringify(
41
+ RefundAmountDetailsValidationError$outboundSchema.parse(
42
+ refundAmountDetailsValidationError,
43
+ ),
44
+ );
45
+ }
46
+ export function refundAmountDetailsValidationErrorFromJSON(
47
+ jsonString: string,
48
+ ): SafeParseResult<RefundAmountDetailsValidationError, SDKValidationError> {
49
+ return safeParse(
50
+ jsonString,
51
+ (x) =>
52
+ RefundAmountDetailsValidationError$inboundSchema.parse(JSON.parse(x)),
53
+ `Failed to parse 'RefundAmountDetailsValidationError' from JSON`,
54
+ );
55
+ }
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ AmountDecimal,
12
+ AmountDecimal$inboundSchema,
13
+ AmountDecimal$Outbound,
14
+ AmountDecimal$outboundSchema,
15
+ } from "./amountdecimal.js";
16
+
17
+ export type ReversalAmountDetails = {
18
+ /**
19
+ * The amount of surcharge to refund. Should be proportionate to the surcharge on the original transfer. This does not reply if the reversal resulted in a cancellation instead of a refund
20
+ */
21
+ surcharge?: AmountDecimal | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export const ReversalAmountDetails$inboundSchema: z.ZodType<
26
+ ReversalAmountDetails,
27
+ z.ZodTypeDef,
28
+ unknown
29
+ > = z.object({
30
+ surcharge: types.optional(AmountDecimal$inboundSchema),
31
+ });
32
+ /** @internal */
33
+ export type ReversalAmountDetails$Outbound = {
34
+ surcharge?: AmountDecimal$Outbound | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const ReversalAmountDetails$outboundSchema: z.ZodType<
39
+ ReversalAmountDetails$Outbound,
40
+ z.ZodTypeDef,
41
+ ReversalAmountDetails
42
+ > = z.object({
43
+ surcharge: AmountDecimal$outboundSchema.optional(),
44
+ });
45
+
46
+ export function reversalAmountDetailsToJSON(
47
+ reversalAmountDetails: ReversalAmountDetails,
48
+ ): string {
49
+ return JSON.stringify(
50
+ ReversalAmountDetails$outboundSchema.parse(reversalAmountDetails),
51
+ );
52
+ }
53
+ export function reversalAmountDetailsFromJSON(
54
+ jsonString: string,
55
+ ): SafeParseResult<ReversalAmountDetails, SDKValidationError> {
56
+ return safeParse(
57
+ jsonString,
58
+ (x) => ReversalAmountDetails$inboundSchema.parse(JSON.parse(x)),
59
+ `Failed to parse 'ReversalAmountDetails' from JSON`,
60
+ );
61
+ }
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type ReversalAmountDetailsValidationError = {
12
+ surcharge?: string | undefined;
13
+ };
14
+
15
+ /** @internal */
16
+ export const ReversalAmountDetailsValidationError$inboundSchema: z.ZodType<
17
+ ReversalAmountDetailsValidationError,
18
+ z.ZodTypeDef,
19
+ unknown
20
+ > = z.object({
21
+ surcharge: types.optional(types.string()),
22
+ });
23
+ /** @internal */
24
+ export type ReversalAmountDetailsValidationError$Outbound = {
25
+ surcharge?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const ReversalAmountDetailsValidationError$outboundSchema: z.ZodType<
30
+ ReversalAmountDetailsValidationError$Outbound,
31
+ z.ZodTypeDef,
32
+ ReversalAmountDetailsValidationError
33
+ > = z.object({
34
+ surcharge: z.string().optional(),
35
+ });
36
+
37
+ export function reversalAmountDetailsValidationErrorToJSON(
38
+ reversalAmountDetailsValidationError: ReversalAmountDetailsValidationError,
39
+ ): string {
40
+ return JSON.stringify(
41
+ ReversalAmountDetailsValidationError$outboundSchema.parse(
42
+ reversalAmountDetailsValidationError,
43
+ ),
44
+ );
45
+ }
46
+ export function reversalAmountDetailsValidationErrorFromJSON(
47
+ jsonString: string,
48
+ ): SafeParseResult<ReversalAmountDetailsValidationError, SDKValidationError> {
49
+ return safeParse(
50
+ jsonString,
51
+ (x) =>
52
+ ReversalAmountDetailsValidationError$inboundSchema.parse(JSON.parse(x)),
53
+ `Failed to parse 'ReversalAmountDetailsValidationError' from JSON`,
54
+ );
55
+ }
@@ -23,6 +23,10 @@ export type TransferAmountDetails = {
23
23
  * The amount of tax applied to the transfer.
24
24
  */
25
25
  tax?: AmountDecimal | undefined;
26
+ /**
27
+ * The amount of surcharge applied to the transfer.
28
+ */
29
+ surcharge?: AmountDecimal | undefined;
26
30
  };
27
31
 
28
32
  /** @internal */
@@ -33,11 +37,13 @@ export const TransferAmountDetails$inboundSchema: z.ZodType<
33
37
  > = z.object({
34
38
  tip: types.optional(AmountDecimal$inboundSchema),
35
39
  tax: types.optional(AmountDecimal$inboundSchema),
40
+ surcharge: types.optional(AmountDecimal$inboundSchema),
36
41
  });
37
42
  /** @internal */
38
43
  export type TransferAmountDetails$Outbound = {
39
44
  tip?: AmountDecimal$Outbound | undefined;
40
45
  tax?: AmountDecimal$Outbound | undefined;
46
+ surcharge?: AmountDecimal$Outbound | undefined;
41
47
  };
42
48
 
43
49
  /** @internal */
@@ -48,6 +54,7 @@ export const TransferAmountDetails$outboundSchema: z.ZodType<
48
54
  > = z.object({
49
55
  tip: AmountDecimal$outboundSchema.optional(),
50
56
  tax: AmountDecimal$outboundSchema.optional(),
57
+ surcharge: AmountDecimal$outboundSchema.optional(),
51
58
  });
52
59
 
53
60
  export function transferAmountDetailsToJSON(
@@ -13,6 +13,12 @@ import {
13
13
  TipPresets$Outbound,
14
14
  TipPresets$outboundSchema,
15
15
  } from "./tippresets.js";
16
+ import {
17
+ TransferControls,
18
+ TransferControls$inboundSchema,
19
+ TransferControls$Outbound,
20
+ TransferControls$outboundSchema,
21
+ } from "./transfercontrols.js";
16
22
 
17
23
  /**
18
24
  * Configurable options for a transfer.
@@ -22,6 +28,7 @@ export type TransferConfig = {
22
28
  * Tip presets when calculating tips for a transfer.
23
29
  */
24
30
  tipPresets?: TipPresets | undefined;
31
+ transferControls?: Array<TransferControls> | undefined;
25
32
  };
26
33
 
27
34
  /** @internal */
@@ -31,10 +38,12 @@ export const TransferConfig$inboundSchema: z.ZodType<
31
38
  unknown
32
39
  > = z.object({
33
40
  tipPresets: types.optional(TipPresets$inboundSchema),
41
+ transferControls: types.optional(z.array(TransferControls$inboundSchema)),
34
42
  });
35
43
  /** @internal */
36
44
  export type TransferConfig$Outbound = {
37
45
  tipPresets?: TipPresets$Outbound | undefined;
46
+ transferControls?: Array<TransferControls$Outbound> | undefined;
38
47
  };
39
48
 
40
49
  /** @internal */
@@ -44,6 +53,7 @@ export const TransferConfig$outboundSchema: z.ZodType<
44
53
  TransferConfig
45
54
  > = z.object({
46
55
  tipPresets: TipPresets$outboundSchema.optional(),
56
+ transferControls: z.array(TransferControls$outboundSchema).optional(),
47
57
  });
48
58
 
49
59
  export function transferConfigToJSON(transferConfig: TransferConfig): string {
@@ -0,0 +1,86 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Controls for transfers created through a given partner
13
+ */
14
+ export type TransferControls = {
15
+ /**
16
+ * ID of the merchant account.
17
+ */
18
+ accountID: string;
19
+ /**
20
+ * ID of the partner account.
21
+ */
22
+ partnerAccountID: string;
23
+ /**
24
+ * Indicates if the account is configured for debt repayment.
25
+ */
26
+ debtRepayment: boolean;
27
+ /**
28
+ * Indicates if the account is allowed to set dynamic descriptors on transfers.
29
+ */
30
+ allowDynamicDescriptor: boolean;
31
+ /**
32
+ * Indicates if the account is allowed to apply surcharges to transfers.
33
+ */
34
+ allowSurcharge: boolean;
35
+ };
36
+
37
+ /** @internal */
38
+ export const TransferControls$inboundSchema: z.ZodType<
39
+ TransferControls,
40
+ z.ZodTypeDef,
41
+ unknown
42
+ > = z.object({
43
+ accountID: types.string(),
44
+ partnerAccountID: types.string(),
45
+ debtRepayment: types.boolean(),
46
+ allowDynamicDescriptor: types.boolean(),
47
+ allowSurcharge: types.boolean(),
48
+ });
49
+ /** @internal */
50
+ export type TransferControls$Outbound = {
51
+ accountID: string;
52
+ partnerAccountID: string;
53
+ debtRepayment: boolean;
54
+ allowDynamicDescriptor: boolean;
55
+ allowSurcharge: boolean;
56
+ };
57
+
58
+ /** @internal */
59
+ export const TransferControls$outboundSchema: z.ZodType<
60
+ TransferControls$Outbound,
61
+ z.ZodTypeDef,
62
+ TransferControls
63
+ > = z.object({
64
+ accountID: z.string(),
65
+ partnerAccountID: z.string(),
66
+ debtRepayment: z.boolean(),
67
+ allowDynamicDescriptor: z.boolean(),
68
+ allowSurcharge: z.boolean(),
69
+ });
70
+
71
+ export function transferControlsToJSON(
72
+ transferControls: TransferControls,
73
+ ): string {
74
+ return JSON.stringify(
75
+ TransferControls$outboundSchema.parse(transferControls),
76
+ );
77
+ }
78
+ export function transferControlsFromJSON(
79
+ jsonString: string,
80
+ ): SafeParseResult<TransferControls, SDKValidationError> {
81
+ return safeParse(
82
+ jsonString,
83
+ (x) => TransferControls$inboundSchema.parse(JSON.parse(x)),
84
+ `Failed to parse 'TransferControls' from JSON`,
85
+ );
86
+ }
@@ -8,11 +8,11 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import * as types from "../../types/primitives.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
  import {
11
- AmountDecimalUpdate,
12
- AmountDecimalUpdate$inboundSchema,
13
- AmountDecimalUpdate$Outbound,
14
- AmountDecimalUpdate$outboundSchema,
15
- } from "./amountdecimalupdate.js";
11
+ AmountDetailsUpdate,
12
+ AmountDetailsUpdate$inboundSchema,
13
+ AmountDetailsUpdate$Outbound,
14
+ AmountDetailsUpdate$outboundSchema,
15
+ } from "./amountdetailsupdate.js";
16
16
  import {
17
17
  CreateInvoiceLineItemsUpdate,
18
18
  CreateInvoiceLineItemsUpdate$inboundSchema,
@@ -34,17 +34,17 @@ export type UpdateInvoice = {
34
34
  invoiceDate?: Date | null | undefined;
35
35
  dueDate?: Date | null | undefined;
36
36
  /**
37
- * The status can be updated to one of the following values under specific conditions:
37
+ * The status can be updated to one of the following values under specific conditions:
38
38
  *
39
39
  * @remarks
40
- * - `canceled`: Can only be set if the current status is `draft`, `unpaid`, or `overdue`. Canceling an invoice
41
- * indicates the invoice is no longer expected to be paid (e.g., the charge was waived or terms changed).
42
- * Canceled invoices still appear in list results by default and remain part of the invoice history.
43
- * To completely discard an invoice created by mistake, use the delete endpoint instead.
44
- * - `unpaid`: Can only be set if the current status is `draft`. Setting the status to `unpaid` finalizes the invoice and sends an email with a payment link to the customer.
40
+ * - `canceled`: Can only be set if the current status is `draft`, `unpaid`, or `overdue`. Canceling an invoice
41
+ * indicates the invoice is no longer expected to be paid (e.g., the charge was waived or terms changed).
42
+ * Canceled invoices still appear in list results by default and remain part of the invoice history.
43
+ * To completely discard an invoice created by mistake, use the delete endpoint instead.
44
+ * - `unpaid`: Can only be set if the current status is `draft`. Setting the status to `unpaid` finalizes the invoice and sends an email with a payment link to the customer.
45
45
  */
46
46
  status?: InvoiceStatus | undefined;
47
- taxAmount?: AmountDecimalUpdate | undefined;
47
+ amountDetails?: AmountDetailsUpdate | undefined;
48
48
  };
49
49
 
50
50
  /** @internal */
@@ -58,7 +58,7 @@ export const UpdateInvoice$inboundSchema: z.ZodType<
58
58
  invoiceDate: z.nullable(types.date()).optional(),
59
59
  dueDate: z.nullable(types.date()).optional(),
60
60
  status: types.optional(InvoiceStatus$inboundSchema),
61
- taxAmount: types.optional(AmountDecimalUpdate$inboundSchema),
61
+ amountDetails: types.optional(AmountDetailsUpdate$inboundSchema),
62
62
  });
63
63
  /** @internal */
64
64
  export type UpdateInvoice$Outbound = {
@@ -67,7 +67,7 @@ export type UpdateInvoice$Outbound = {
67
67
  invoiceDate?: string | null | undefined;
68
68
  dueDate?: string | null | undefined;
69
69
  status?: string | undefined;
70
- taxAmount?: AmountDecimalUpdate$Outbound | undefined;
70
+ amountDetails?: AmountDetailsUpdate$Outbound | undefined;
71
71
  };
72
72
 
73
73
  /** @internal */
@@ -81,7 +81,7 @@ export const UpdateInvoice$outboundSchema: z.ZodType<
81
81
  invoiceDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
82
82
  dueDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
83
83
  status: InvoiceStatus$outboundSchema.optional(),
84
- taxAmount: AmountDecimalUpdate$outboundSchema.optional(),
84
+ amountDetails: AmountDetailsUpdate$outboundSchema.optional(),
85
85
  });
86
86
 
87
87
  export function updateInvoiceToJSON(updateInvoice: UpdateInvoice): string {
@@ -19,6 +19,10 @@ export type UpdatePaymentLinkAmountDetails = {
19
19
  * The amount of tax applied to the payment link.
20
20
  */
21
21
  tax?: AmountDecimalUpdate | undefined;
22
+ /**
23
+ * The amount of surcharge applied to the payment link.
24
+ */
25
+ surcharge?: AmountDecimalUpdate | undefined;
22
26
  };
23
27
 
24
28
  /** @internal */
@@ -28,10 +32,12 @@ export const UpdatePaymentLinkAmountDetails$inboundSchema: z.ZodType<
28
32
  unknown
29
33
  > = z.object({
30
34
  tax: types.optional(AmountDecimalUpdate$inboundSchema),
35
+ surcharge: types.optional(AmountDecimalUpdate$inboundSchema),
31
36
  });
32
37
  /** @internal */
33
38
  export type UpdatePaymentLinkAmountDetails$Outbound = {
34
39
  tax?: AmountDecimalUpdate$Outbound | undefined;
40
+ surcharge?: AmountDecimalUpdate$Outbound | undefined;
35
41
  };
36
42
 
37
43
  /** @internal */
@@ -41,6 +47,7 @@ export const UpdatePaymentLinkAmountDetails$outboundSchema: z.ZodType<
41
47
  UpdatePaymentLinkAmountDetails
42
48
  > = z.object({
43
49
  tax: AmountDecimalUpdate$outboundSchema.optional(),
50
+ surcharge: AmountDecimalUpdate$outboundSchema.optional(),
44
51
  });
45
52
 
46
53
  export function updatePaymentLinkAmountDetailsToJSON(
@@ -10,6 +10,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
 
11
11
  export type UpdatePaymentLinkAmountDetailsValidationError = {
12
12
  tax?: string | undefined;
13
+ surcharge?: string | undefined;
13
14
  };
14
15
 
15
16
  /** @internal */
@@ -20,10 +21,12 @@ export const UpdatePaymentLinkAmountDetailsValidationError$inboundSchema:
20
21
  unknown
21
22
  > = z.object({
22
23
  tax: types.optional(types.string()),
24
+ surcharge: types.optional(types.string()),
23
25
  });
24
26
  /** @internal */
25
27
  export type UpdatePaymentLinkAmountDetailsValidationError$Outbound = {
26
28
  tax?: string | undefined;
29
+ surcharge?: string | undefined;
27
30
  };
28
31
 
29
32
  /** @internal */
@@ -34,6 +37,7 @@ export const UpdatePaymentLinkAmountDetailsValidationError$outboundSchema:
34
37
  UpdatePaymentLinkAmountDetailsValidationError
35
38
  > = z.object({
36
39
  tax: z.string().optional(),
40
+ surcharge: z.string().optional(),
37
41
  });
38
42
 
39
43
  export function updatePaymentLinkAmountDetailsValidationErrorToJSON(
@@ -19,6 +19,7 @@ export type CardAcquiringRefundData = {
19
19
  updatedOn: Date;
20
20
  status: components.RefundStatus;
21
21
  amount: components.Amount;
22
+ amountDetails?: components.RefundAmountDetails | undefined;
22
23
  cardDetails?: components.RefundCardDetails | undefined;
23
24
  };
24
25
 
@@ -34,6 +35,7 @@ export class CardAcquiringRefund extends MoovError {
34
35
  updatedOn: Date;
35
36
  status: components.RefundStatus;
36
37
  amount: components.Amount;
38
+ amountDetails?: components.RefundAmountDetails | undefined;
37
39
  cardDetails?: components.RefundCardDetails | undefined;
38
40
 
39
41
  /** The original data that was passed to this error instance. */
@@ -53,6 +55,7 @@ export class CardAcquiringRefund extends MoovError {
53
55
  this.updatedOn = err.updatedOn;
54
56
  this.status = err.status;
55
57
  this.amount = err.amount;
58
+ if (err.amountDetails != null) this.amountDetails = err.amountDetails;
56
59
  if (err.cardDetails != null) this.cardDetails = err.cardDetails;
57
60
 
58
61
  this.name = "CardAcquiringRefund";
@@ -70,6 +73,7 @@ export const CardAcquiringRefund$inboundSchema: z.ZodType<
70
73
  updatedOn: types.date(),
71
74
  status: components.RefundStatus$inboundSchema,
72
75
  amount: components.Amount$inboundSchema,
76
+ amountDetails: types.optional(components.RefundAmountDetails$inboundSchema),
73
77
  cardDetails: types.optional(components.RefundCardDetails$inboundSchema),
74
78
  request$: z.instanceof(Request),
75
79
  response$: z.instanceof(Response),
@@ -90,6 +94,7 @@ export type CardAcquiringRefund$Outbound = {
90
94
  updatedOn: string;
91
95
  status: string;
92
96
  amount: components.Amount$Outbound;
97
+ amountDetails?: components.RefundAmountDetails$Outbound | undefined;
93
98
  cardDetails?: components.RefundCardDetails$Outbound | undefined;
94
99
  };
95
100
 
@@ -106,5 +111,6 @@ export const CardAcquiringRefund$outboundSchema: z.ZodType<
106
111
  updatedOn: z.date().transform(v => v.toISOString()),
107
112
  status: components.RefundStatus$outboundSchema,
108
113
  amount: components.Amount$outboundSchema,
114
+ amountDetails: components.RefundAmountDetails$outboundSchema.optional(),
109
115
  cardDetails: components.RefundCardDetails$outboundSchema.optional(),
110
116
  }));
@@ -13,7 +13,7 @@ export type CreateInvoiceErrorData = {
13
13
  lineItems?: components.CreateInvoiceLineItemsValidationError | undefined;
14
14
  invoiceDate?: string | undefined;
15
15
  dueDate?: string | undefined;
16
- taxAmount?: components.AmountDecimalValidationError | undefined;
16
+ amountDetails?: components.AmountDetailsValidationError | undefined;
17
17
  };
18
18
 
19
19
  export class CreateInvoiceError extends MoovError {
@@ -22,7 +22,7 @@ export class CreateInvoiceError extends MoovError {
22
22
  lineItems?: components.CreateInvoiceLineItemsValidationError | undefined;
23
23
  invoiceDate?: string | undefined;
24
24
  dueDate?: string | undefined;
25
- taxAmount?: components.AmountDecimalValidationError | undefined;
25
+ amountDetails?: components.AmountDetailsValidationError | undefined;
26
26
 
27
27
  /** The original data that was passed to this error instance. */
28
28
  data$: CreateInvoiceErrorData;
@@ -43,7 +43,7 @@ export class CreateInvoiceError extends MoovError {
43
43
  if (err.lineItems != null) this.lineItems = err.lineItems;
44
44
  if (err.invoiceDate != null) this.invoiceDate = err.invoiceDate;
45
45
  if (err.dueDate != null) this.dueDate = err.dueDate;
46
- if (err.taxAmount != null) this.taxAmount = err.taxAmount;
46
+ if (err.amountDetails != null) this.amountDetails = err.amountDetails;
47
47
 
48
48
  this.name = "CreateInvoiceError";
49
49
  }
@@ -62,8 +62,8 @@ export const CreateInvoiceError$inboundSchema: z.ZodType<
62
62
  ),
63
63
  invoiceDate: types.optional(types.string()),
64
64
  dueDate: types.optional(types.string()),
65
- taxAmount: types.optional(
66
- components.AmountDecimalValidationError$inboundSchema,
65
+ amountDetails: types.optional(
66
+ components.AmountDetailsValidationError$inboundSchema,
67
67
  ),
68
68
  request$: z.instanceof(Request),
69
69
  response$: z.instanceof(Response),
@@ -86,7 +86,7 @@ export type CreateInvoiceError$Outbound = {
86
86
  | undefined;
87
87
  invoiceDate?: string | undefined;
88
88
  dueDate?: string | undefined;
89
- taxAmount?: components.AmountDecimalValidationError$Outbound | undefined;
89
+ amountDetails?: components.AmountDetailsValidationError$Outbound | undefined;
90
90
  };
91
91
 
92
92
  /** @internal */
@@ -103,6 +103,6 @@ export const CreateInvoiceError$outboundSchema: z.ZodType<
103
103
  .optional(),
104
104
  invoiceDate: z.string().optional(),
105
105
  dueDate: z.string().optional(),
106
- taxAmount: components.AmountDecimalValidationError$outboundSchema
106
+ amountDetails: components.AmountDetailsValidationError$outboundSchema
107
107
  .optional(),
108
108
  }));
@@ -4,10 +4,12 @@
4
4
 
5
5
  import * as z from "zod/v3";
6
6
  import * as types from "../../types/primitives.js";
7
+ import * as components from "../components/index.js";
7
8
  import { MoovError } from "./mooverror.js";
8
9
 
9
10
  export type RefundValidationErrorData = {
10
11
  amount?: string | undefined;
12
+ amountDetails?: components.RefundAmountDetailsValidationError | undefined;
11
13
  /**
12
14
  * Used for generic errors when invalid request data isn't attributed to a single request field.
13
15
  */
@@ -16,6 +18,7 @@ export type RefundValidationErrorData = {
16
18
 
17
19
  export class RefundValidationError extends MoovError {
18
20
  amount?: string | undefined;
21
+ amountDetails?: components.RefundAmountDetailsValidationError | undefined;
19
22
  /**
20
23
  * Used for generic errors when invalid request data isn't attributed to a single request field.
21
24
  */
@@ -34,6 +37,7 @@ export class RefundValidationError extends MoovError {
34
37
  super(message, httpMeta);
35
38
  this.data$ = err;
36
39
  if (err.amount != null) this.amount = err.amount;
40
+ if (err.amountDetails != null) this.amountDetails = err.amountDetails;
37
41
  if (err.error != null) this.error = err.error;
38
42
 
39
43
  this.name = "RefundValidationError";
@@ -47,6 +51,9 @@ export const RefundValidationError$inboundSchema: z.ZodType<
47
51
  unknown
48
52
  > = z.object({
49
53
  amount: types.optional(types.string()),
54
+ amountDetails: types.optional(
55
+ components.RefundAmountDetailsValidationError$inboundSchema,
56
+ ),
50
57
  error: types.optional(types.string()),
51
58
  request$: z.instanceof(Request),
52
59
  response$: z.instanceof(Response),
@@ -63,6 +70,9 @@ export const RefundValidationError$inboundSchema: z.ZodType<
63
70
  /** @internal */
64
71
  export type RefundValidationError$Outbound = {
65
72
  amount?: string | undefined;
73
+ amountDetails?:
74
+ | components.RefundAmountDetailsValidationError$Outbound
75
+ | undefined;
66
76
  error?: string | undefined;
67
77
  };
68
78
 
@@ -75,5 +85,7 @@ export const RefundValidationError$outboundSchema: z.ZodType<
75
85
  .transform(v => v.data$)
76
86
  .pipe(z.object({
77
87
  amount: z.string().optional(),
88
+ amountDetails: components.RefundAmountDetailsValidationError$outboundSchema
89
+ .optional(),
78
90
  error: z.string().optional(),
79
91
  }));