@gr4vy/sdk 1.1.16 → 1.1.18
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/all/README.md +1 -0
- package/docs/sdks/auditlogs/README.md +1 -0
- package/docs/sdks/balances/README.md +1 -0
- package/docs/sdks/buyers/README.md +5 -0
- package/docs/sdks/cardschemedefinitions/README.md +1 -0
- package/docs/sdks/checkoutsessions/README.md +4 -0
- package/docs/sdks/cryptogram/README.md +1 -0
- package/docs/sdks/digitalwallets/README.md +5 -0
- package/docs/sdks/domains/README.md +2 -0
- package/docs/sdks/events/README.md +1 -0
- package/docs/sdks/executions/README.md +3 -0
- package/docs/sdks/giftcards/README.md +4 -0
- package/docs/sdks/gr4vygiftcards/README.md +1 -0
- package/docs/sdks/gr4vypaymentmethods/README.md +1 -0
- package/docs/sdks/gr4vyrefunds/README.md +3 -0
- package/docs/sdks/jobs/README.md +1 -0
- package/docs/sdks/merchantaccounts/README.md +4 -0
- package/docs/sdks/networktokens/README.md +5 -0
- package/docs/sdks/paymentlinks/README.md +4 -0
- package/docs/sdks/paymentmethods/README.md +4 -0
- package/docs/sdks/paymentoptions/README.md +1 -0
- package/docs/sdks/paymentservicedefinitions/README.md +3 -0
- package/docs/sdks/paymentservices/README.md +7 -0
- package/docs/sdks/paymentservicetokens/README.md +3 -0
- package/docs/sdks/payouts/README.md +3 -0
- package/docs/sdks/refunds/README.md +1 -0
- package/docs/sdks/reportexecutions/README.md +1 -0
- package/docs/sdks/reports/README.md +4 -0
- package/docs/sdks/sessions/README.md +3 -0
- package/docs/sdks/settlements/README.md +2 -0
- package/docs/sdks/shippingdetails/README.md +5 -0
- package/docs/sdks/transactions/README.md +10 -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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
catchUnrecognizedEnum,
|
|
8
|
+
OpenEnum,
|
|
9
|
+
Unrecognized,
|
|
10
|
+
} from "../../types/enums.js";
|
|
11
|
+
|
|
12
|
+
export const VoidStatus = {
|
|
13
|
+
Succeeded: "succeeded",
|
|
14
|
+
Pending: "pending",
|
|
15
|
+
Declined: "declined",
|
|
16
|
+
Failed: "failed",
|
|
17
|
+
} as const;
|
|
18
|
+
export type VoidStatus = OpenEnum<typeof VoidStatus>;
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const VoidStatus$inboundSchema: z.ZodType<
|
|
22
|
+
VoidStatus,
|
|
23
|
+
z.ZodTypeDef,
|
|
24
|
+
unknown
|
|
25
|
+
> = z
|
|
26
|
+
.union([
|
|
27
|
+
z.nativeEnum(VoidStatus),
|
|
28
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const VoidStatus$outboundSchema: z.ZodType<
|
|
33
|
+
VoidStatus,
|
|
34
|
+
z.ZodTypeDef,
|
|
35
|
+
VoidStatus
|
|
36
|
+
> = z.union([
|
|
37
|
+
z.nativeEnum(VoidStatus),
|
|
38
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
39
|
+
]);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
44
|
+
*/
|
|
45
|
+
export namespace VoidStatus$ {
|
|
46
|
+
/** @deprecated use `VoidStatus$inboundSchema` instead. */
|
|
47
|
+
export const inboundSchema = VoidStatus$inboundSchema;
|
|
48
|
+
/** @deprecated use `VoidStatus$outboundSchema` instead. */
|
|
49
|
+
export const outboundSchema = VoidStatus$outboundSchema;
|
|
50
|
+
}
|
|
@@ -21,7 +21,7 @@ export type CaptureTransactionRequest = {
|
|
|
21
21
|
/**
|
|
22
22
|
* The preferred resource type in the response.
|
|
23
23
|
*/
|
|
24
|
-
prefer?: string | null | undefined;
|
|
24
|
+
prefer?: Array<string> | null | undefined;
|
|
25
25
|
/**
|
|
26
26
|
* The ID of the merchant account to use for this request.
|
|
27
27
|
*/
|
|
@@ -97,7 +97,7 @@ export const CaptureTransactionRequest$inboundSchema: z.ZodType<
|
|
|
97
97
|
unknown
|
|
98
98
|
> = z.object({
|
|
99
99
|
transaction_id: z.string(),
|
|
100
|
-
prefer: z.nullable(z.string()).optional(),
|
|
100
|
+
prefer: z.nullable(z.array(z.string())).optional(),
|
|
101
101
|
merchantAccountId: z.nullable(z.string()).optional(),
|
|
102
102
|
TransactionCaptureCreate: components.TransactionCaptureCreate$inboundSchema,
|
|
103
103
|
}).transform((v) => {
|
|
@@ -110,7 +110,7 @@ export const CaptureTransactionRequest$inboundSchema: z.ZodType<
|
|
|
110
110
|
/** @internal */
|
|
111
111
|
export type CaptureTransactionRequest$Outbound = {
|
|
112
112
|
transaction_id: string;
|
|
113
|
-
prefer?: string | null | undefined;
|
|
113
|
+
prefer?: Array<string> | null | undefined;
|
|
114
114
|
merchantAccountId?: string | null | undefined;
|
|
115
115
|
TransactionCaptureCreate: components.TransactionCaptureCreate$Outbound;
|
|
116
116
|
};
|
|
@@ -122,7 +122,7 @@ export const CaptureTransactionRequest$outboundSchema: z.ZodType<
|
|
|
122
122
|
CaptureTransactionRequest
|
|
123
123
|
> = z.object({
|
|
124
124
|
transactionId: z.string(),
|
|
125
|
-
prefer: z.nullable(z.string()).optional(),
|
|
125
|
+
prefer: z.nullable(z.array(z.string())).optional(),
|
|
126
126
|
merchantAccountId: z.nullable(z.string()).optional(),
|
|
127
127
|
transactionCaptureCreate: components.TransactionCaptureCreate$outboundSchema,
|
|
128
128
|
}).transform((v) => {
|
|
@@ -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
|
));
|