@gr4vy/sdk 1.5.2 → 1.5.5

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 (211) hide show
  1. package/docs/sdks/transactions/README.md +4 -4
  2. package/examples/package-lock.json +1 -1
  3. package/funcs/transactionsCreate.d.ts +1 -1
  4. package/funcs/transactionsCreate.d.ts.map +1 -1
  5. package/funcs/transactionsCreate.js +1 -1
  6. package/funcs/transactionsCreate.js.map +1 -1
  7. package/funcs/transactionsGet.d.ts +1 -1
  8. package/funcs/transactionsGet.d.ts.map +1 -1
  9. package/funcs/transactionsGet.js +1 -1
  10. package/funcs/transactionsGet.js.map +1 -1
  11. package/funcs/transactionsSync.d.ts +1 -1
  12. package/funcs/transactionsSync.d.ts.map +1 -1
  13. package/funcs/transactionsSync.js +1 -1
  14. package/funcs/transactionsSync.js.map +1 -1
  15. package/funcs/transactionsUpdate.d.ts +1 -1
  16. package/funcs/transactionsUpdate.d.ts.map +1 -1
  17. package/funcs/transactionsUpdate.js +1 -1
  18. package/funcs/transactionsUpdate.js.map +1 -1
  19. package/jsr.json +1 -1
  20. package/lib/config.d.ts +3 -3
  21. package/lib/config.js +3 -3
  22. package/models/components/auditlogentries.d.ts +3 -3
  23. package/models/components/auditlogentries.d.ts.map +1 -1
  24. package/models/components/auditlogentries.js +3 -3
  25. package/models/components/auditlogentries.js.map +1 -1
  26. package/models/components/{auditlogentry.d.ts → auditlogentryoutput.d.ts} +14 -14
  27. package/models/components/auditlogentryoutput.d.ts.map +1 -0
  28. package/models/components/{auditlogentry.js → auditlogentryoutput.js} +17 -17
  29. package/models/components/auditlogentryoutput.js.map +1 -0
  30. package/models/components/checkoutsession.d.ts +3 -3
  31. package/models/components/checkoutsession.d.ts.map +1 -1
  32. package/models/components/checkoutsession.js +3 -3
  33. package/models/components/checkoutsession.js.map +1 -1
  34. package/models/components/{checkoutsessionpaymentmethod.d.ts → checkoutsessionpaymentmethodoutput.d.ts} +14 -14
  35. package/models/components/checkoutsessionpaymentmethodoutput.d.ts.map +1 -0
  36. package/models/components/{checkoutsessionpaymentmethod.js → checkoutsessionpaymentmethodoutput.js} +17 -17
  37. package/models/components/checkoutsessionpaymentmethodoutput.js.map +1 -0
  38. package/models/components/index.d.ts +16 -12
  39. package/models/components/index.d.ts.map +1 -1
  40. package/models/components/index.js +16 -12
  41. package/models/components/index.js.map +1 -1
  42. package/models/components/paymentlink.d.ts +3 -3
  43. package/models/components/paymentlink.d.ts.map +1 -1
  44. package/models/components/paymentlink.js +3 -3
  45. package/models/components/paymentlink.js.map +1 -1
  46. package/models/components/paymentmethodsummaries.d.ts +3 -3
  47. package/models/components/paymentmethodsummaries.d.ts.map +1 -1
  48. package/models/components/paymentmethodsummaries.js +3 -3
  49. package/models/components/paymentmethodsummaries.js.map +1 -1
  50. package/models/components/{paymentmethodsummary.d.ts → paymentmethodsummaryoutput.d.ts} +14 -14
  51. package/models/components/paymentmethodsummaryoutput.d.ts.map +1 -0
  52. package/models/components/{paymentmethodsummary.js → paymentmethodsummaryoutput.js} +17 -17
  53. package/models/components/paymentmethodsummaryoutput.js.map +1 -0
  54. package/models/components/{paymentoption.d.ts → paymentoptionoutput.d.ts} +14 -14
  55. package/models/components/paymentoptionoutput.d.ts.map +1 -0
  56. package/models/components/{paymentoption.js → paymentoptionoutput.js} +17 -17
  57. package/models/components/paymentoptionoutput.js.map +1 -0
  58. package/models/components/paymentoptions.d.ts +3 -3
  59. package/models/components/paymentoptions.d.ts.map +1 -1
  60. package/models/components/paymentoptions.js +3 -3
  61. package/models/components/paymentoptions.js.map +1 -1
  62. package/models/components/payoutsummary.d.ts +6 -6
  63. package/models/components/payoutsummary.d.ts.map +1 -1
  64. package/models/components/payoutsummary.js +6 -6
  65. package/models/components/payoutsummary.js.map +1 -1
  66. package/models/components/paypaloptions.d.ts +6 -0
  67. package/models/components/paypaloptions.d.ts.map +1 -1
  68. package/models/components/paypaloptions.js +3 -0
  69. package/models/components/paypaloptions.js.map +1 -1
  70. package/models/components/paypalshippingoptions.d.ts +33 -0
  71. package/models/components/paypalshippingoptions.d.ts.map +1 -0
  72. package/models/components/paypalshippingoptions.js +72 -0
  73. package/models/components/paypalshippingoptions.js.map +1 -0
  74. package/models/components/paypalshippingoptionsitem.d.ts +75 -0
  75. package/models/components/paypalshippingoptionsitem.d.ts.map +1 -0
  76. package/models/components/paypalshippingoptionsitem.js +107 -0
  77. package/models/components/paypalshippingoptionsitem.js.map +1 -0
  78. package/models/components/paypalshippingoptionsitemamount.d.ts +37 -0
  79. package/models/components/paypalshippingoptionsitemamount.d.ts.map +1 -0
  80. package/models/components/paypalshippingoptionsitemamount.js +80 -0
  81. package/models/components/paypalshippingoptionsitemamount.js.map +1 -0
  82. package/models/components/plaidpaymentmethodcreate.d.ts +64 -0
  83. package/models/components/plaidpaymentmethodcreate.d.ts.map +1 -0
  84. package/models/components/plaidpaymentmethodcreate.js +94 -0
  85. package/models/components/plaidpaymentmethodcreate.js.map +1 -0
  86. package/models/components/{transactionbuyer.d.ts → transactionbuyeroutput.d.ts} +14 -14
  87. package/models/components/transactionbuyeroutput.d.ts.map +1 -0
  88. package/models/components/{transactionbuyer.js → transactionbuyeroutput.js} +17 -17
  89. package/models/components/transactionbuyeroutput.js.map +1 -0
  90. package/models/components/transactioncancel.d.ts +3 -3
  91. package/models/components/transactioncancel.d.ts.map +1 -1
  92. package/models/components/transactioncancel.js +3 -3
  93. package/models/components/transactioncancel.js.map +1 -1
  94. package/models/components/transactioncaptureoutput.d.ts +56 -0
  95. package/models/components/transactioncaptureoutput.d.ts.map +1 -0
  96. package/models/components/{transactioncapture.js → transactioncaptureoutput.js} +20 -20
  97. package/models/components/transactioncaptureoutput.js.map +1 -0
  98. package/models/components/transactioncreate.d.ts +5 -4
  99. package/models/components/transactioncreate.d.ts.map +1 -1
  100. package/models/components/transactioncreate.js +5 -0
  101. package/models/components/transactioncreate.js.map +1 -1
  102. package/models/components/{transactionevent.d.ts → transactioneventoutput.d.ts} +14 -14
  103. package/models/components/transactioneventoutput.d.ts.map +1 -0
  104. package/models/components/{transactionevent.js → transactioneventoutput.js} +17 -17
  105. package/models/components/transactioneventoutput.js.map +1 -0
  106. package/models/components/transactionevents.d.ts +3 -3
  107. package/models/components/transactionevents.d.ts.map +1 -1
  108. package/models/components/transactionevents.js +3 -3
  109. package/models/components/transactionevents.js.map +1 -1
  110. package/models/components/{transaction.d.ts → transactionoutput.d.ts} +23 -23
  111. package/models/components/transactionoutput.d.ts.map +1 -0
  112. package/models/components/{transaction.js → transactionoutput.js} +28 -26
  113. package/models/components/transactionoutput.js.map +1 -0
  114. package/models/components/{transactionpaymentmethod.d.ts → transactionpaymentmethodoutput.d.ts} +14 -14
  115. package/models/components/transactionpaymentmethodoutput.d.ts.map +1 -0
  116. package/models/components/{transactionpaymentmethod.js → transactionpaymentmethodoutput.js} +17 -17
  117. package/models/components/transactionpaymentmethodoutput.js.map +1 -0
  118. package/models/components/transactionsummaries.d.ts +3 -3
  119. package/models/components/transactionsummaries.d.ts.map +1 -1
  120. package/models/components/transactionsummaries.js +3 -3
  121. package/models/components/transactionsummaries.js.map +1 -1
  122. package/models/components/{transactionsummary.d.ts → transactionsummaryoutput.d.ts} +20 -20
  123. package/models/components/transactionsummaryoutput.d.ts.map +1 -0
  124. package/models/components/{transactionsummary.js → transactionsummaryoutput.js} +25 -23
  125. package/models/components/transactionsummaryoutput.js.map +1 -0
  126. package/models/components/{transactionthreedsecuresummary.d.ts → transactionthreedsecuresummaryoutput.d.ts} +14 -14
  127. package/models/components/transactionthreedsecuresummaryoutput.d.ts.map +1 -0
  128. package/models/components/{transactionthreedsecuresummary.js → transactionthreedsecuresummaryoutput.js} +17 -17
  129. package/models/components/transactionthreedsecuresummaryoutput.js.map +1 -0
  130. package/models/components/transactionvoidoutput.d.ts +56 -0
  131. package/models/components/transactionvoidoutput.d.ts.map +1 -0
  132. package/models/components/{transactionvoid.js → transactionvoidoutput.js} +20 -20
  133. package/models/components/transactionvoidoutput.js.map +1 -0
  134. package/models/operations/capturetransaction.d.ts +2 -2
  135. package/models/operations/capturetransaction.d.ts.map +1 -1
  136. package/models/operations/capturetransaction.js +4 -4
  137. package/models/operations/capturetransaction.js.map +1 -1
  138. package/models/operations/createpaymentmethod.d.ts +4 -4
  139. package/models/operations/createpaymentmethod.d.ts.map +1 -1
  140. package/models/operations/createpaymentmethod.js +4 -0
  141. package/models/operations/createpaymentmethod.js.map +1 -1
  142. package/models/operations/voidtransaction.d.ts +2 -2
  143. package/models/operations/voidtransaction.d.ts.map +1 -1
  144. package/models/operations/voidtransaction.js +4 -4
  145. package/models/operations/voidtransaction.js.map +1 -1
  146. package/package.json +1 -1
  147. package/sdk/transactions.d.ts +4 -4
  148. package/sdk/transactions.d.ts.map +1 -1
  149. package/src/funcs/transactionsCreate.ts +4 -4
  150. package/src/funcs/transactionsGet.ts +4 -4
  151. package/src/funcs/transactionsSync.ts +4 -4
  152. package/src/funcs/transactionsUpdate.ts +4 -4
  153. package/src/lib/config.ts +3 -3
  154. package/src/models/components/auditlogentries.ts +9 -9
  155. package/src/models/components/{auditlogentry.ts → auditlogentryoutput.ts} +24 -20
  156. package/src/models/components/checkoutsession.ts +12 -9
  157. package/src/models/components/{checkoutsessionpaymentmethod.ts → checkoutsessionpaymentmethodoutput.ts} +24 -22
  158. package/src/models/components/index.ts +16 -12
  159. package/src/models/components/paymentlink.ts +9 -9
  160. package/src/models/components/paymentmethodsummaries.ts +9 -9
  161. package/src/models/components/{paymentmethodsummary.ts → paymentmethodsummaryoutput.ts} +21 -21
  162. package/src/models/components/{paymentoption.ts → paymentoptionoutput.ts} +24 -20
  163. package/src/models/components/paymentoptions.ts +9 -9
  164. package/src/models/components/payoutsummary.ts +18 -18
  165. package/src/models/components/paypaloptions.ts +13 -0
  166. package/src/models/components/paypalshippingoptions.ts +77 -0
  167. package/src/models/components/paypalshippingoptionsitem.ts +150 -0
  168. package/src/models/components/paypalshippingoptionsitemamount.ts +87 -0
  169. package/src/models/components/plaidpaymentmethodcreate.ts +126 -0
  170. package/src/models/components/{transactionbuyer.ts → transactionbuyeroutput.ts} +21 -21
  171. package/src/models/components/transactioncancel.ts +9 -9
  172. package/src/models/components/{transactioncapture.ts → transactioncaptureoutput.ts} +30 -30
  173. package/src/models/components/transactioncreate.ts +14 -0
  174. package/src/models/components/{transactionevent.ts → transactioneventoutput.ts} +21 -21
  175. package/src/models/components/transactionevents.ts +9 -9
  176. package/src/models/components/{transaction.ts → transactionoutput.ts} +56 -47
  177. package/src/models/components/{transactionpaymentmethod.ts → transactionpaymentmethodoutput.ts} +23 -21
  178. package/src/models/components/transactionsummaries.ts +9 -9
  179. package/src/models/components/{transactionsummary.ts → transactionsummaryoutput.ts} +41 -39
  180. package/src/models/components/{transactionthreedsecuresummary.ts → transactionthreedsecuresummaryoutput.ts} +25 -22
  181. package/src/models/components/{transactionvoid.ts → transactionvoidoutput.ts} +32 -30
  182. package/src/models/operations/capturetransaction.ts +8 -8
  183. package/src/models/operations/createpaymentmethod.ts +12 -4
  184. package/src/models/operations/voidtransaction.ts +8 -8
  185. package/src/sdk/transactions.ts +4 -4
  186. package/models/components/auditlogentry.d.ts.map +0 -1
  187. package/models/components/auditlogentry.js.map +0 -1
  188. package/models/components/checkoutsessionpaymentmethod.d.ts.map +0 -1
  189. package/models/components/checkoutsessionpaymentmethod.js.map +0 -1
  190. package/models/components/paymentmethodsummary.d.ts.map +0 -1
  191. package/models/components/paymentmethodsummary.js.map +0 -1
  192. package/models/components/paymentoption.d.ts.map +0 -1
  193. package/models/components/paymentoption.js.map +0 -1
  194. package/models/components/transaction.d.ts.map +0 -1
  195. package/models/components/transaction.js.map +0 -1
  196. package/models/components/transactionbuyer.d.ts.map +0 -1
  197. package/models/components/transactionbuyer.js.map +0 -1
  198. package/models/components/transactioncapture.d.ts +0 -56
  199. package/models/components/transactioncapture.d.ts.map +0 -1
  200. package/models/components/transactioncapture.js.map +0 -1
  201. package/models/components/transactionevent.d.ts.map +0 -1
  202. package/models/components/transactionevent.js.map +0 -1
  203. package/models/components/transactionpaymentmethod.d.ts.map +0 -1
  204. package/models/components/transactionpaymentmethod.js.map +0 -1
  205. package/models/components/transactionsummary.d.ts.map +0 -1
  206. package/models/components/transactionsummary.js.map +0 -1
  207. package/models/components/transactionthreedsecuresummary.d.ts.map +0 -1
  208. package/models/components/transactionthreedsecuresummary.js.map +0 -1
  209. package/models/components/transactionvoid.d.ts +0 -56
  210. package/models/components/transactionvoid.d.ts.map +0 -1
  211. package/models/components/transactionvoid.js.map +0 -1
@@ -0,0 +1,150 @@
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 {
8
+ catchUnrecognizedEnum,
9
+ OpenEnum,
10
+ Unrecognized,
11
+ } from "../../types/enums.js";
12
+ import { Result as SafeParseResult } from "../../types/fp.js";
13
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
+ import {
15
+ PaypalShippingOptionsItemAmount,
16
+ PaypalShippingOptionsItemAmount$inboundSchema,
17
+ PaypalShippingOptionsItemAmount$Outbound,
18
+ PaypalShippingOptionsItemAmount$outboundSchema,
19
+ } from "./paypalshippingoptionsitemamount.js";
20
+
21
+ export const PaypalShippingOptionsItemType = {
22
+ Shipping: "SHIPPING",
23
+ Pickup: "PICKUP",
24
+ PickupInStore: "PICKUP_IN_STORE",
25
+ PickupFromPerson: "PICKUP_FROM_PERSON",
26
+ } as const;
27
+ export type PaypalShippingOptionsItemType = OpenEnum<
28
+ typeof PaypalShippingOptionsItemType
29
+ >;
30
+
31
+ export type PaypalShippingOptionsItem = {
32
+ /**
33
+ * A unique ID that identifies a payer-selected shipping option.
34
+ */
35
+ id: string;
36
+ /**
37
+ * A description that the payer sees, which helps them choose an appropriate shipping option.
38
+ */
39
+ label: string;
40
+ /**
41
+ * If the API request sets selected = true, it represents the shipping option that the payee or merchant expects to be pre-selected for the payer when they first view the shipping.options in the PayPal Checkout experience. Only one shipping.option can be set to selected=true.
42
+ */
43
+ selected: boolean;
44
+ /**
45
+ * A classification for the method of purchase fulfillment.
46
+ */
47
+ type?: PaypalShippingOptionsItemType | null | undefined;
48
+ /**
49
+ * The shipping cost for the selected option.
50
+ */
51
+ amount?: PaypalShippingOptionsItemAmount | null | undefined;
52
+ };
53
+
54
+ /** @internal */
55
+ export const PaypalShippingOptionsItemType$inboundSchema: z.ZodType<
56
+ PaypalShippingOptionsItemType,
57
+ z.ZodTypeDef,
58
+ unknown
59
+ > = z
60
+ .union([
61
+ z.nativeEnum(PaypalShippingOptionsItemType),
62
+ z.string().transform(catchUnrecognizedEnum),
63
+ ]);
64
+
65
+ /** @internal */
66
+ export const PaypalShippingOptionsItemType$outboundSchema: z.ZodType<
67
+ PaypalShippingOptionsItemType,
68
+ z.ZodTypeDef,
69
+ PaypalShippingOptionsItemType
70
+ > = z.union([
71
+ z.nativeEnum(PaypalShippingOptionsItemType),
72
+ z.string().and(z.custom<Unrecognized<string>>()),
73
+ ]);
74
+
75
+ /**
76
+ * @internal
77
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
78
+ */
79
+ export namespace PaypalShippingOptionsItemType$ {
80
+ /** @deprecated use `PaypalShippingOptionsItemType$inboundSchema` instead. */
81
+ export const inboundSchema = PaypalShippingOptionsItemType$inboundSchema;
82
+ /** @deprecated use `PaypalShippingOptionsItemType$outboundSchema` instead. */
83
+ export const outboundSchema = PaypalShippingOptionsItemType$outboundSchema;
84
+ }
85
+
86
+ /** @internal */
87
+ export const PaypalShippingOptionsItem$inboundSchema: z.ZodType<
88
+ PaypalShippingOptionsItem,
89
+ z.ZodTypeDef,
90
+ unknown
91
+ > = z.object({
92
+ id: z.string(),
93
+ label: z.string(),
94
+ selected: z.boolean(),
95
+ type: z.nullable(PaypalShippingOptionsItemType$inboundSchema).optional(),
96
+ amount: z.nullable(PaypalShippingOptionsItemAmount$inboundSchema).optional(),
97
+ });
98
+
99
+ /** @internal */
100
+ export type PaypalShippingOptionsItem$Outbound = {
101
+ id: string;
102
+ label: string;
103
+ selected: boolean;
104
+ type?: string | null | undefined;
105
+ amount?: PaypalShippingOptionsItemAmount$Outbound | null | undefined;
106
+ };
107
+
108
+ /** @internal */
109
+ export const PaypalShippingOptionsItem$outboundSchema: z.ZodType<
110
+ PaypalShippingOptionsItem$Outbound,
111
+ z.ZodTypeDef,
112
+ PaypalShippingOptionsItem
113
+ > = z.object({
114
+ id: z.string(),
115
+ label: z.string(),
116
+ selected: z.boolean(),
117
+ type: z.nullable(PaypalShippingOptionsItemType$outboundSchema).optional(),
118
+ amount: z.nullable(PaypalShippingOptionsItemAmount$outboundSchema).optional(),
119
+ });
120
+
121
+ /**
122
+ * @internal
123
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
124
+ */
125
+ export namespace PaypalShippingOptionsItem$ {
126
+ /** @deprecated use `PaypalShippingOptionsItem$inboundSchema` instead. */
127
+ export const inboundSchema = PaypalShippingOptionsItem$inboundSchema;
128
+ /** @deprecated use `PaypalShippingOptionsItem$outboundSchema` instead. */
129
+ export const outboundSchema = PaypalShippingOptionsItem$outboundSchema;
130
+ /** @deprecated use `PaypalShippingOptionsItem$Outbound` instead. */
131
+ export type Outbound = PaypalShippingOptionsItem$Outbound;
132
+ }
133
+
134
+ export function paypalShippingOptionsItemToJSON(
135
+ paypalShippingOptionsItem: PaypalShippingOptionsItem,
136
+ ): string {
137
+ return JSON.stringify(
138
+ PaypalShippingOptionsItem$outboundSchema.parse(paypalShippingOptionsItem),
139
+ );
140
+ }
141
+
142
+ export function paypalShippingOptionsItemFromJSON(
143
+ jsonString: string,
144
+ ): SafeParseResult<PaypalShippingOptionsItem, SDKValidationError> {
145
+ return safeParse(
146
+ jsonString,
147
+ (x) => PaypalShippingOptionsItem$inboundSchema.parse(JSON.parse(x)),
148
+ `Failed to parse 'PaypalShippingOptionsItem' from JSON`,
149
+ );
150
+ }
@@ -0,0 +1,87 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type PaypalShippingOptionsItemAmount = {
12
+ /**
13
+ * The three-character ISO currency code.
14
+ */
15
+ currencyCode: string;
16
+ /**
17
+ * The amount value, which might include a decimal portion.
18
+ */
19
+ value: string;
20
+ };
21
+
22
+ /** @internal */
23
+ export const PaypalShippingOptionsItemAmount$inboundSchema: z.ZodType<
24
+ PaypalShippingOptionsItemAmount,
25
+ z.ZodTypeDef,
26
+ unknown
27
+ > = z.object({
28
+ currency_code: z.string(),
29
+ value: z.string(),
30
+ }).transform((v) => {
31
+ return remap$(v, {
32
+ "currency_code": "currencyCode",
33
+ });
34
+ });
35
+
36
+ /** @internal */
37
+ export type PaypalShippingOptionsItemAmount$Outbound = {
38
+ currency_code: string;
39
+ value: string;
40
+ };
41
+
42
+ /** @internal */
43
+ export const PaypalShippingOptionsItemAmount$outboundSchema: z.ZodType<
44
+ PaypalShippingOptionsItemAmount$Outbound,
45
+ z.ZodTypeDef,
46
+ PaypalShippingOptionsItemAmount
47
+ > = z.object({
48
+ currencyCode: z.string(),
49
+ value: z.string(),
50
+ }).transform((v) => {
51
+ return remap$(v, {
52
+ currencyCode: "currency_code",
53
+ });
54
+ });
55
+
56
+ /**
57
+ * @internal
58
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
59
+ */
60
+ export namespace PaypalShippingOptionsItemAmount$ {
61
+ /** @deprecated use `PaypalShippingOptionsItemAmount$inboundSchema` instead. */
62
+ export const inboundSchema = PaypalShippingOptionsItemAmount$inboundSchema;
63
+ /** @deprecated use `PaypalShippingOptionsItemAmount$outboundSchema` instead. */
64
+ export const outboundSchema = PaypalShippingOptionsItemAmount$outboundSchema;
65
+ /** @deprecated use `PaypalShippingOptionsItemAmount$Outbound` instead. */
66
+ export type Outbound = PaypalShippingOptionsItemAmount$Outbound;
67
+ }
68
+
69
+ export function paypalShippingOptionsItemAmountToJSON(
70
+ paypalShippingOptionsItemAmount: PaypalShippingOptionsItemAmount,
71
+ ): string {
72
+ return JSON.stringify(
73
+ PaypalShippingOptionsItemAmount$outboundSchema.parse(
74
+ paypalShippingOptionsItemAmount,
75
+ ),
76
+ );
77
+ }
78
+
79
+ export function paypalShippingOptionsItemAmountFromJSON(
80
+ jsonString: string,
81
+ ): SafeParseResult<PaypalShippingOptionsItemAmount, SDKValidationError> {
82
+ return safeParse(
83
+ jsonString,
84
+ (x) => PaypalShippingOptionsItemAmount$inboundSchema.parse(JSON.parse(x)),
85
+ `Failed to parse 'PaypalShippingOptionsItemAmount' from JSON`,
86
+ );
87
+ }
@@ -0,0 +1,126 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Plaid Payment Method
13
+ *
14
+ * @remarks
15
+ *
16
+ * Plaid Payment Method to use in a transaction.
17
+ */
18
+ export type PlaidPaymentMethodCreate = {
19
+ /**
20
+ * Always `plaid`.
21
+ */
22
+ method?: "plaid" | undefined;
23
+ /**
24
+ * The public token obtained after using Plaid Link.
25
+ */
26
+ token: string;
27
+ /**
28
+ * The Plaid account ID corresponding to the end-user account. If not provided will be fetched from Plaid API expecting to only have one.
29
+ */
30
+ accountId?: string | null | undefined;
31
+ /**
32
+ * The ID of the Plaid payment service related to the provided public token. If not provided will be fetched from the currently active expecting to have a single one.
33
+ */
34
+ paymentServiceId?: string | null | undefined;
35
+ /**
36
+ * The ID of the buyer to attach the method to.
37
+ */
38
+ buyerId?: string | null | undefined;
39
+ /**
40
+ * The merchant reference for this payment method.
41
+ */
42
+ buyerExternalIdentifier?: string | null | undefined;
43
+ };
44
+
45
+ /** @internal */
46
+ export const PlaidPaymentMethodCreate$inboundSchema: z.ZodType<
47
+ PlaidPaymentMethodCreate,
48
+ z.ZodTypeDef,
49
+ unknown
50
+ > = z.object({
51
+ method: z.literal("plaid").default("plaid"),
52
+ token: z.string(),
53
+ account_id: z.nullable(z.string()).optional(),
54
+ payment_service_id: z.nullable(z.string()).optional(),
55
+ buyer_id: z.nullable(z.string()).optional(),
56
+ buyer_external_identifier: z.nullable(z.string()).optional(),
57
+ }).transform((v) => {
58
+ return remap$(v, {
59
+ "account_id": "accountId",
60
+ "payment_service_id": "paymentServiceId",
61
+ "buyer_id": "buyerId",
62
+ "buyer_external_identifier": "buyerExternalIdentifier",
63
+ });
64
+ });
65
+
66
+ /** @internal */
67
+ export type PlaidPaymentMethodCreate$Outbound = {
68
+ method: "plaid";
69
+ token: string;
70
+ account_id?: string | null | undefined;
71
+ payment_service_id?: string | null | undefined;
72
+ buyer_id?: string | null | undefined;
73
+ buyer_external_identifier?: string | null | undefined;
74
+ };
75
+
76
+ /** @internal */
77
+ export const PlaidPaymentMethodCreate$outboundSchema: z.ZodType<
78
+ PlaidPaymentMethodCreate$Outbound,
79
+ z.ZodTypeDef,
80
+ PlaidPaymentMethodCreate
81
+ > = z.object({
82
+ method: z.literal("plaid").default("plaid" as const),
83
+ token: z.string(),
84
+ accountId: z.nullable(z.string()).optional(),
85
+ paymentServiceId: z.nullable(z.string()).optional(),
86
+ buyerId: z.nullable(z.string()).optional(),
87
+ buyerExternalIdentifier: z.nullable(z.string()).optional(),
88
+ }).transform((v) => {
89
+ return remap$(v, {
90
+ accountId: "account_id",
91
+ paymentServiceId: "payment_service_id",
92
+ buyerId: "buyer_id",
93
+ buyerExternalIdentifier: "buyer_external_identifier",
94
+ });
95
+ });
96
+
97
+ /**
98
+ * @internal
99
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
100
+ */
101
+ export namespace PlaidPaymentMethodCreate$ {
102
+ /** @deprecated use `PlaidPaymentMethodCreate$inboundSchema` instead. */
103
+ export const inboundSchema = PlaidPaymentMethodCreate$inboundSchema;
104
+ /** @deprecated use `PlaidPaymentMethodCreate$outboundSchema` instead. */
105
+ export const outboundSchema = PlaidPaymentMethodCreate$outboundSchema;
106
+ /** @deprecated use `PlaidPaymentMethodCreate$Outbound` instead. */
107
+ export type Outbound = PlaidPaymentMethodCreate$Outbound;
108
+ }
109
+
110
+ export function plaidPaymentMethodCreateToJSON(
111
+ plaidPaymentMethodCreate: PlaidPaymentMethodCreate,
112
+ ): string {
113
+ return JSON.stringify(
114
+ PlaidPaymentMethodCreate$outboundSchema.parse(plaidPaymentMethodCreate),
115
+ );
116
+ }
117
+
118
+ export function plaidPaymentMethodCreateFromJSON(
119
+ jsonString: string,
120
+ ): SafeParseResult<PlaidPaymentMethodCreate, SDKValidationError> {
121
+ return safeParse(
122
+ jsonString,
123
+ (x) => PlaidPaymentMethodCreate$inboundSchema.parse(JSON.parse(x)),
124
+ `Failed to parse 'PlaidPaymentMethodCreate' from JSON`,
125
+ );
126
+ }
@@ -14,7 +14,7 @@ import {
14
14
  BillingDetailsOutput$outboundSchema,
15
15
  } from "./billingdetailsoutput.js";
16
16
 
17
- export type TransactionBuyer = {
17
+ export type TransactionBuyerOutput = {
18
18
  /**
19
19
  * Always `buyer`.
20
20
  */
@@ -42,8 +42,8 @@ export type TransactionBuyer = {
42
42
  };
43
43
 
44
44
  /** @internal */
45
- export const TransactionBuyer$inboundSchema: z.ZodType<
46
- TransactionBuyer,
45
+ export const TransactionBuyerOutput$inboundSchema: z.ZodType<
46
+ TransactionBuyerOutput,
47
47
  z.ZodTypeDef,
48
48
  unknown
49
49
  > = z.object({
@@ -63,7 +63,7 @@ export const TransactionBuyer$inboundSchema: z.ZodType<
63
63
  });
64
64
 
65
65
  /** @internal */
66
- export type TransactionBuyer$Outbound = {
66
+ export type TransactionBuyerOutput$Outbound = {
67
67
  type: "buyer";
68
68
  id?: string | null | undefined;
69
69
  display_name?: string | null | undefined;
@@ -73,10 +73,10 @@ export type TransactionBuyer$Outbound = {
73
73
  };
74
74
 
75
75
  /** @internal */
76
- export const TransactionBuyer$outboundSchema: z.ZodType<
77
- TransactionBuyer$Outbound,
76
+ export const TransactionBuyerOutput$outboundSchema: z.ZodType<
77
+ TransactionBuyerOutput$Outbound,
78
78
  z.ZodTypeDef,
79
- TransactionBuyer
79
+ TransactionBuyerOutput
80
80
  > = z.object({
81
81
  type: z.literal("buyer").default("buyer" as const),
82
82
  id: z.nullable(z.string()).optional(),
@@ -97,29 +97,29 @@ export const TransactionBuyer$outboundSchema: z.ZodType<
97
97
  * @internal
98
98
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
99
99
  */
100
- export namespace TransactionBuyer$ {
101
- /** @deprecated use `TransactionBuyer$inboundSchema` instead. */
102
- export const inboundSchema = TransactionBuyer$inboundSchema;
103
- /** @deprecated use `TransactionBuyer$outboundSchema` instead. */
104
- export const outboundSchema = TransactionBuyer$outboundSchema;
105
- /** @deprecated use `TransactionBuyer$Outbound` instead. */
106
- export type Outbound = TransactionBuyer$Outbound;
100
+ export namespace TransactionBuyerOutput$ {
101
+ /** @deprecated use `TransactionBuyerOutput$inboundSchema` instead. */
102
+ export const inboundSchema = TransactionBuyerOutput$inboundSchema;
103
+ /** @deprecated use `TransactionBuyerOutput$outboundSchema` instead. */
104
+ export const outboundSchema = TransactionBuyerOutput$outboundSchema;
105
+ /** @deprecated use `TransactionBuyerOutput$Outbound` instead. */
106
+ export type Outbound = TransactionBuyerOutput$Outbound;
107
107
  }
108
108
 
109
- export function transactionBuyerToJSON(
110
- transactionBuyer: TransactionBuyer,
109
+ export function transactionBuyerOutputToJSON(
110
+ transactionBuyerOutput: TransactionBuyerOutput,
111
111
  ): string {
112
112
  return JSON.stringify(
113
- TransactionBuyer$outboundSchema.parse(transactionBuyer),
113
+ TransactionBuyerOutput$outboundSchema.parse(transactionBuyerOutput),
114
114
  );
115
115
  }
116
116
 
117
- export function transactionBuyerFromJSON(
117
+ export function transactionBuyerOutputFromJSON(
118
118
  jsonString: string,
119
- ): SafeParseResult<TransactionBuyer, SDKValidationError> {
119
+ ): SafeParseResult<TransactionBuyerOutput, SDKValidationError> {
120
120
  return safeParse(
121
121
  jsonString,
122
- (x) => TransactionBuyer$inboundSchema.parse(JSON.parse(x)),
123
- `Failed to parse 'TransactionBuyer' from JSON`,
122
+ (x) => TransactionBuyerOutput$inboundSchema.parse(JSON.parse(x)),
123
+ `Failed to parse 'TransactionBuyerOutput' from JSON`,
124
124
  );
125
125
  }
@@ -13,11 +13,11 @@ import {
13
13
  CancelStatus$outboundSchema,
14
14
  } from "./cancelstatus.js";
15
15
  import {
16
- Transaction,
17
- Transaction$inboundSchema,
18
- Transaction$Outbound,
19
- Transaction$outboundSchema,
20
- } from "./transaction.js";
16
+ TransactionOutput,
17
+ TransactionOutput$inboundSchema,
18
+ TransactionOutput$Outbound,
19
+ TransactionOutput$outboundSchema,
20
+ } from "./transactionoutput.js";
21
21
 
22
22
  export type TransactionCancel = {
23
23
  /**
@@ -40,7 +40,7 @@ export type TransactionCancel = {
40
40
  /**
41
41
  * A full transaction resource.
42
42
  */
43
- transaction: Transaction;
43
+ transaction: TransactionOutput;
44
44
  };
45
45
 
46
46
  /** @internal */
@@ -54,7 +54,7 @@ export const TransactionCancel$inboundSchema: z.ZodType<
54
54
  code: z.nullable(z.string()),
55
55
  raw_response_code: z.nullable(z.string()),
56
56
  raw_response_description: z.nullable(z.string()),
57
- transaction: Transaction$inboundSchema,
57
+ transaction: TransactionOutput$inboundSchema,
58
58
  }).transform((v) => {
59
59
  return remap$(v, {
60
60
  "raw_response_code": "rawResponseCode",
@@ -69,7 +69,7 @@ export type TransactionCancel$Outbound = {
69
69
  code: string | null;
70
70
  raw_response_code: string | null;
71
71
  raw_response_description: string | null;
72
- transaction: Transaction$Outbound;
72
+ transaction: TransactionOutput$Outbound;
73
73
  };
74
74
 
75
75
  /** @internal */
@@ -83,7 +83,7 @@ export const TransactionCancel$outboundSchema: z.ZodType<
83
83
  code: z.nullable(z.string()),
84
84
  rawResponseCode: z.nullable(z.string()),
85
85
  rawResponseDescription: z.nullable(z.string()),
86
- transaction: Transaction$outboundSchema,
86
+ transaction: TransactionOutput$outboundSchema,
87
87
  }).transform((v) => {
88
88
  return remap$(v, {
89
89
  rawResponseCode: "raw_response_code",
@@ -13,13 +13,13 @@ import {
13
13
  CaptureStatus$outboundSchema,
14
14
  } from "./capturestatus.js";
15
15
  import {
16
- Transaction,
17
- Transaction$inboundSchema,
18
- Transaction$Outbound,
19
- Transaction$outboundSchema,
20
- } from "./transaction.js";
16
+ TransactionOutput,
17
+ TransactionOutput$inboundSchema,
18
+ TransactionOutput$Outbound,
19
+ TransactionOutput$outboundSchema,
20
+ } from "./transactionoutput.js";
21
21
 
22
- export type TransactionCapture = {
22
+ export type TransactionCaptureOutput = {
23
23
  /**
24
24
  * Always `transaction-capture`.
25
25
  */
@@ -40,12 +40,12 @@ export type TransactionCapture = {
40
40
  /**
41
41
  * A full transaction resource.
42
42
  */
43
- transaction: Transaction;
43
+ transaction: TransactionOutput;
44
44
  };
45
45
 
46
46
  /** @internal */
47
- export const TransactionCapture$inboundSchema: z.ZodType<
48
- TransactionCapture,
47
+ export const TransactionCaptureOutput$inboundSchema: z.ZodType<
48
+ TransactionCaptureOutput,
49
49
  z.ZodTypeDef,
50
50
  unknown
51
51
  > = z.object({
@@ -54,7 +54,7 @@ export const TransactionCapture$inboundSchema: z.ZodType<
54
54
  code: z.nullable(z.string()),
55
55
  raw_response_code: z.nullable(z.string()),
56
56
  raw_response_description: z.nullable(z.string()),
57
- transaction: Transaction$inboundSchema,
57
+ transaction: TransactionOutput$inboundSchema,
58
58
  }).transform((v) => {
59
59
  return remap$(v, {
60
60
  "raw_response_code": "rawResponseCode",
@@ -63,20 +63,20 @@ export const TransactionCapture$inboundSchema: z.ZodType<
63
63
  });
64
64
 
65
65
  /** @internal */
66
- export type TransactionCapture$Outbound = {
66
+ export type TransactionCaptureOutput$Outbound = {
67
67
  type: "transaction-capture";
68
68
  status: string;
69
69
  code: string | null;
70
70
  raw_response_code: string | null;
71
71
  raw_response_description: string | null;
72
- transaction: Transaction$Outbound;
72
+ transaction: TransactionOutput$Outbound;
73
73
  };
74
74
 
75
75
  /** @internal */
76
- export const TransactionCapture$outboundSchema: z.ZodType<
77
- TransactionCapture$Outbound,
76
+ export const TransactionCaptureOutput$outboundSchema: z.ZodType<
77
+ TransactionCaptureOutput$Outbound,
78
78
  z.ZodTypeDef,
79
- TransactionCapture
79
+ TransactionCaptureOutput
80
80
  > = z.object({
81
81
  type: z.literal("transaction-capture").default(
82
82
  "transaction-capture" as const,
@@ -85,7 +85,7 @@ export const TransactionCapture$outboundSchema: z.ZodType<
85
85
  code: z.nullable(z.string()),
86
86
  rawResponseCode: z.nullable(z.string()),
87
87
  rawResponseDescription: z.nullable(z.string()),
88
- transaction: Transaction$outboundSchema,
88
+ transaction: TransactionOutput$outboundSchema,
89
89
  }).transform((v) => {
90
90
  return remap$(v, {
91
91
  rawResponseCode: "raw_response_code",
@@ -97,29 +97,29 @@ export const TransactionCapture$outboundSchema: z.ZodType<
97
97
  * @internal
98
98
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
99
99
  */
100
- export namespace TransactionCapture$ {
101
- /** @deprecated use `TransactionCapture$inboundSchema` instead. */
102
- export const inboundSchema = TransactionCapture$inboundSchema;
103
- /** @deprecated use `TransactionCapture$outboundSchema` instead. */
104
- export const outboundSchema = TransactionCapture$outboundSchema;
105
- /** @deprecated use `TransactionCapture$Outbound` instead. */
106
- export type Outbound = TransactionCapture$Outbound;
100
+ export namespace TransactionCaptureOutput$ {
101
+ /** @deprecated use `TransactionCaptureOutput$inboundSchema` instead. */
102
+ export const inboundSchema = TransactionCaptureOutput$inboundSchema;
103
+ /** @deprecated use `TransactionCaptureOutput$outboundSchema` instead. */
104
+ export const outboundSchema = TransactionCaptureOutput$outboundSchema;
105
+ /** @deprecated use `TransactionCaptureOutput$Outbound` instead. */
106
+ export type Outbound = TransactionCaptureOutput$Outbound;
107
107
  }
108
108
 
109
- export function transactionCaptureToJSON(
110
- transactionCapture: TransactionCapture,
109
+ export function transactionCaptureOutputToJSON(
110
+ transactionCaptureOutput: TransactionCaptureOutput,
111
111
  ): string {
112
112
  return JSON.stringify(
113
- TransactionCapture$outboundSchema.parse(transactionCapture),
113
+ TransactionCaptureOutput$outboundSchema.parse(transactionCaptureOutput),
114
114
  );
115
115
  }
116
116
 
117
- export function transactionCaptureFromJSON(
117
+ export function transactionCaptureOutputFromJSON(
118
118
  jsonString: string,
119
- ): SafeParseResult<TransactionCapture, SDKValidationError> {
119
+ ): SafeParseResult<TransactionCaptureOutput, SDKValidationError> {
120
120
  return safeParse(
121
121
  jsonString,
122
- (x) => TransactionCapture$inboundSchema.parse(JSON.parse(x)),
123
- `Failed to parse 'TransactionCapture' from JSON`,
122
+ (x) => TransactionCaptureOutput$inboundSchema.parse(JSON.parse(x)),
123
+ `Failed to parse 'TransactionCaptureOutput' from JSON`,
124
124
  );
125
125
  }