@gr4vy/sdk 1.1.16 → 1.1.17
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.
- package/docs/sdks/transactions/README.md +3 -2
- package/funcs/transactionsCapture.d.ts +1 -1
- package/funcs/transactionsCapture.d.ts.map +1 -1
- package/funcs/transactionsCapture.js.map +1 -1
- package/funcs/transactionsVoid.d.ts +2 -2
- package/funcs/transactionsVoid.d.ts.map +1 -1
- package/funcs/transactionsVoid.js +9 -5
- package/funcs/transactionsVoid.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/components/transactionvoid.d.ts +56 -0
- package/models/components/transactionvoid.d.ts.map +1 -0
- package/models/components/transactionvoid.js +82 -0
- package/models/components/transactionvoid.js.map +1 -0
- package/models/components/voidstatus.d.ts +24 -0
- package/models/components/voidstatus.d.ts.map +1 -0
- package/models/components/voidstatus.js +60 -0
- package/models/components/voidstatus.js.map +1 -0
- package/models/operations/capturetransaction.d.ts +2 -2
- package/models/operations/capturetransaction.d.ts.map +1 -1
- package/models/operations/capturetransaction.js +2 -2
- package/models/operations/capturetransaction.js.map +1 -1
- package/models/operations/voidtransaction.d.ts +30 -0
- package/models/operations/voidtransaction.d.ts.map +1 -1
- package/models/operations/voidtransaction.js +33 -1
- package/models/operations/voidtransaction.js.map +1 -1
- package/package.json +1 -1
- package/sdk/transactions.d.ts +2 -2
- package/sdk/transactions.d.ts.map +1 -1
- package/sdk/transactions.js +2 -2
- package/sdk/transactions.js.map +1 -1
- package/src/funcs/transactionsCapture.ts +2 -2
- package/src/funcs/transactionsVoid.ts +15 -5
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +2 -0
- package/src/models/components/transactionvoid.ts +121 -0
- package/src/models/components/voidstatus.ts +50 -0
- package/src/models/operations/capturetransaction.ts +4 -4
- package/src/models/operations/voidtransaction.ts +77 -0
- package/src/sdk/transactions.ts +4 -2
|
@@ -6,6 +6,7 @@ import * as z from "zod";
|
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as components from "../components/index.js";
|
|
9
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
11
|
|
|
11
12
|
export type VoidTransactionGlobals = {
|
|
@@ -17,12 +18,23 @@ export type VoidTransactionRequest = {
|
|
|
17
18
|
* The ID of the transaction
|
|
18
19
|
*/
|
|
19
20
|
transactionId: string;
|
|
21
|
+
/**
|
|
22
|
+
* The preferred resource type in the response.
|
|
23
|
+
*/
|
|
24
|
+
prefer?: Array<string> | null | undefined;
|
|
20
25
|
/**
|
|
21
26
|
* The ID of the merchant account to use for this request.
|
|
22
27
|
*/
|
|
23
28
|
merchantAccountId?: string | null | undefined;
|
|
24
29
|
};
|
|
25
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Successful Response
|
|
33
|
+
*/
|
|
34
|
+
export type VoidTransactionResponseVoidTransaction =
|
|
35
|
+
| components.Transaction
|
|
36
|
+
| components.TransactionVoid;
|
|
37
|
+
|
|
26
38
|
/** @internal */
|
|
27
39
|
export const VoidTransactionGlobals$inboundSchema: z.ZodType<
|
|
28
40
|
VoidTransactionGlobals,
|
|
@@ -84,6 +96,7 @@ export const VoidTransactionRequest$inboundSchema: z.ZodType<
|
|
|
84
96
|
unknown
|
|
85
97
|
> = z.object({
|
|
86
98
|
transaction_id: z.string(),
|
|
99
|
+
prefer: z.nullable(z.array(z.string())).optional(),
|
|
87
100
|
merchantAccountId: z.nullable(z.string()).optional(),
|
|
88
101
|
}).transform((v) => {
|
|
89
102
|
return remap$(v, {
|
|
@@ -94,6 +107,7 @@ export const VoidTransactionRequest$inboundSchema: z.ZodType<
|
|
|
94
107
|
/** @internal */
|
|
95
108
|
export type VoidTransactionRequest$Outbound = {
|
|
96
109
|
transaction_id: string;
|
|
110
|
+
prefer?: Array<string> | null | undefined;
|
|
97
111
|
merchantAccountId?: string | null | undefined;
|
|
98
112
|
};
|
|
99
113
|
|
|
@@ -104,6 +118,7 @@ export const VoidTransactionRequest$outboundSchema: z.ZodType<
|
|
|
104
118
|
VoidTransactionRequest
|
|
105
119
|
> = z.object({
|
|
106
120
|
transactionId: z.string(),
|
|
121
|
+
prefer: z.nullable(z.array(z.string())).optional(),
|
|
107
122
|
merchantAccountId: z.nullable(z.string()).optional(),
|
|
108
123
|
}).transform((v) => {
|
|
109
124
|
return remap$(v, {
|
|
@@ -141,3 +156,65 @@ export function voidTransactionRequestFromJSON(
|
|
|
141
156
|
`Failed to parse 'VoidTransactionRequest' from JSON`,
|
|
142
157
|
);
|
|
143
158
|
}
|
|
159
|
+
|
|
160
|
+
/** @internal */
|
|
161
|
+
export const VoidTransactionResponseVoidTransaction$inboundSchema: z.ZodType<
|
|
162
|
+
VoidTransactionResponseVoidTransaction,
|
|
163
|
+
z.ZodTypeDef,
|
|
164
|
+
unknown
|
|
165
|
+
> = z.union([
|
|
166
|
+
components.Transaction$inboundSchema,
|
|
167
|
+
components.TransactionVoid$inboundSchema,
|
|
168
|
+
]);
|
|
169
|
+
|
|
170
|
+
/** @internal */
|
|
171
|
+
export type VoidTransactionResponseVoidTransaction$Outbound =
|
|
172
|
+
| components.Transaction$Outbound
|
|
173
|
+
| components.TransactionVoid$Outbound;
|
|
174
|
+
|
|
175
|
+
/** @internal */
|
|
176
|
+
export const VoidTransactionResponseVoidTransaction$outboundSchema: z.ZodType<
|
|
177
|
+
VoidTransactionResponseVoidTransaction$Outbound,
|
|
178
|
+
z.ZodTypeDef,
|
|
179
|
+
VoidTransactionResponseVoidTransaction
|
|
180
|
+
> = z.union([
|
|
181
|
+
components.Transaction$outboundSchema,
|
|
182
|
+
components.TransactionVoid$outboundSchema,
|
|
183
|
+
]);
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @internal
|
|
187
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
188
|
+
*/
|
|
189
|
+
export namespace VoidTransactionResponseVoidTransaction$ {
|
|
190
|
+
/** @deprecated use `VoidTransactionResponseVoidTransaction$inboundSchema` instead. */
|
|
191
|
+
export const inboundSchema =
|
|
192
|
+
VoidTransactionResponseVoidTransaction$inboundSchema;
|
|
193
|
+
/** @deprecated use `VoidTransactionResponseVoidTransaction$outboundSchema` instead. */
|
|
194
|
+
export const outboundSchema =
|
|
195
|
+
VoidTransactionResponseVoidTransaction$outboundSchema;
|
|
196
|
+
/** @deprecated use `VoidTransactionResponseVoidTransaction$Outbound` instead. */
|
|
197
|
+
export type Outbound = VoidTransactionResponseVoidTransaction$Outbound;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function voidTransactionResponseVoidTransactionToJSON(
|
|
201
|
+
voidTransactionResponseVoidTransaction:
|
|
202
|
+
VoidTransactionResponseVoidTransaction,
|
|
203
|
+
): string {
|
|
204
|
+
return JSON.stringify(
|
|
205
|
+
VoidTransactionResponseVoidTransaction$outboundSchema.parse(
|
|
206
|
+
voidTransactionResponseVoidTransaction,
|
|
207
|
+
),
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function voidTransactionResponseVoidTransactionFromJSON(
|
|
212
|
+
jsonString: string,
|
|
213
|
+
): SafeParseResult<VoidTransactionResponseVoidTransaction, SDKValidationError> {
|
|
214
|
+
return safeParse(
|
|
215
|
+
jsonString,
|
|
216
|
+
(x) =>
|
|
217
|
+
VoidTransactionResponseVoidTransaction$inboundSchema.parse(JSON.parse(x)),
|
|
218
|
+
`Failed to parse 'VoidTransactionResponseVoidTransaction' from JSON`,
|
|
219
|
+
);
|
|
220
|
+
}
|
package/src/sdk/transactions.ts
CHANGED
|
@@ -125,7 +125,7 @@ export class Transactions extends ClientSDK {
|
|
|
125
125
|
async capture(
|
|
126
126
|
transactionCaptureCreate: components.TransactionCaptureCreate,
|
|
127
127
|
transactionId: string,
|
|
128
|
-
prefer?: string | null | undefined,
|
|
128
|
+
prefer?: Array<string> | null | undefined,
|
|
129
129
|
merchantAccountId?: string | null | undefined,
|
|
130
130
|
options?: RequestOptions,
|
|
131
131
|
): Promise<operations.CaptureTransactionResponseCaptureTransaction> {
|
|
@@ -147,12 +147,14 @@ export class Transactions extends ClientSDK {
|
|
|
147
147
|
*/
|
|
148
148
|
async void(
|
|
149
149
|
transactionId: string,
|
|
150
|
+
prefer?: Array<string> | null | undefined,
|
|
150
151
|
merchantAccountId?: string | null | undefined,
|
|
151
152
|
options?: RequestOptions,
|
|
152
|
-
): Promise<
|
|
153
|
+
): Promise<operations.VoidTransactionResponseVoidTransaction> {
|
|
153
154
|
return unwrapAsync(transactionsVoid(
|
|
154
155
|
this,
|
|
155
156
|
transactionId,
|
|
157
|
+
prefer,
|
|
156
158
|
merchantAccountId,
|
|
157
159
|
options,
|
|
158
160
|
));
|