@gr4vy/sdk 1.6.8 → 1.6.10
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/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +3 -1
- package/lib/encodings.js.map +1 -1
- package/models/components/cybersourceoptions.d.ts +5 -0
- package/models/components/cybersourceoptions.d.ts.map +1 -1
- package/models/components/cybersourceoptions.js +1 -0
- package/models/components/cybersourceoptions.js.map +1 -1
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/nuveiidealoptions.d.ts +15 -0
- package/models/components/nuveiidealoptions.d.ts.map +1 -0
- package/models/components/nuveiidealoptions.js +49 -0
- package/models/components/nuveiidealoptions.js.map +1 -0
- package/models/components/reportcreate.d.ts.map +1 -1
- package/models/components/reportcreate.js +8 -24
- package/models/components/reportcreate.js.map +1 -1
- package/models/components/transactionconnectionoptions.d.ts +6 -0
- package/models/components/transactionconnectionoptions.d.ts.map +1 -1
- package/models/components/transactionconnectionoptions.js +3 -0
- package/models/components/transactionconnectionoptions.js.map +1 -1
- package/models/operations/capturetransaction.d.ts +27 -1
- package/models/operations/capturetransaction.d.ts.map +1 -1
- package/models/operations/capturetransaction.js +13 -2
- package/models/operations/capturetransaction.js.map +1 -1
- package/models/operations/voidtransaction.d.ts +27 -1
- package/models/operations/voidtransaction.d.ts.map +1 -1
- package/models/operations/voidtransaction.js +13 -2
- package/models/operations/voidtransaction.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +4 -3
- package/src/models/components/cybersourceoptions.ts +6 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/nuveiidealoptions.ts +34 -0
- package/src/models/components/reportcreate.ts +8 -24
- package/src/models/components/transactionconnectionoptions.ts +12 -0
- package/src/models/operations/capturetransaction.ts +52 -4
- package/src/models/operations/voidtransaction.ts +52 -4
- package/src/types/enums.ts +1 -21
- package/src/types/index.ts +2 -1
- package/src/types/unrecognized.ts +27 -0
- package/types/enums.d.ts +1 -8
- package/types/enums.d.ts.map +1 -1
- package/types/enums.js +3 -21
- package/types/enums.js.map +1 -1
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/index.js +15 -0
- package/types/index.js.map +1 -1
- package/types/unrecognized.d.ts +10 -0
- package/types/unrecognized.d.ts.map +1 -0
- package/types/unrecognized.js +26 -0
- package/types/unrecognized.js.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capturetransaction.js","sourceRoot":"","sources":["../../src/models/operations/capturetransaction.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"capturetransaction.js","sourceRoot":"","sources":["../../src/models/operations/capturetransaction.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEH,0EAMC;AAkDD,oHAcC;AA5ID,0CAA4B;AAC5B,2DAA0D;AAC1D,qDAAiD;AAEjD,mEAAqD;AAiDrD,gBAAgB;AACH,QAAA,wCAAwC,GAIjD,CAAC,CAAC,MAAM,CAAC;IACX,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;IAClD,iBAAiB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpD,wBAAwB,EAAE,UAAU,CAAC,uCAAuC;CAC7E,CAAC,CAAC,SAAS,CAAC,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@ -22,7 +22,33 @@ export type VoidTransactionRequest = {
|
|
|
22
22
|
/**
|
|
23
23
|
* Successful Response
|
|
24
24
|
*/
|
|
25
|
-
export type VoidTransactionResponseVoidTransaction = components.TransactionOutput
|
|
25
|
+
export type VoidTransactionResponseVoidTransaction = (components.TransactionOutput & {
|
|
26
|
+
status: "processing";
|
|
27
|
+
}) | (components.TransactionOutput & {
|
|
28
|
+
status: "authorization_succeeded";
|
|
29
|
+
}) | (components.TransactionOutput & {
|
|
30
|
+
status: "authorization_declined";
|
|
31
|
+
}) | (components.TransactionOutput & {
|
|
32
|
+
status: "authorization_failed";
|
|
33
|
+
}) | (components.TransactionOutput & {
|
|
34
|
+
status: "authorization_voided";
|
|
35
|
+
}) | (components.TransactionOutput & {
|
|
36
|
+
status: "authorization_void_pending";
|
|
37
|
+
}) | (components.TransactionOutput & {
|
|
38
|
+
status: "capture_succeeded";
|
|
39
|
+
}) | (components.TransactionOutput & {
|
|
40
|
+
status: "capture_pending";
|
|
41
|
+
}) | (components.TransactionOutput & {
|
|
42
|
+
status: "buyer_approval_pending";
|
|
43
|
+
}) | (components.TransactionVoidOutput & {
|
|
44
|
+
status: "succeeded";
|
|
45
|
+
}) | (components.TransactionVoidOutput & {
|
|
46
|
+
status: "pending";
|
|
47
|
+
}) | (components.TransactionVoidOutput & {
|
|
48
|
+
status: "declined";
|
|
49
|
+
}) | (components.TransactionVoidOutput & {
|
|
50
|
+
status: "failed";
|
|
51
|
+
});
|
|
26
52
|
/** @internal */
|
|
27
53
|
export type VoidTransactionRequest$Outbound = {
|
|
28
54
|
transaction_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voidtransaction.d.ts","sourceRoot":"","sources":["../../src/models/operations/voidtransaction.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,UAA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G,SAAS,CAAC;CAC/C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAC3D,+BAA+B,EAC/B,CAAC,CAAC,UAAU,EACZ,sBAAsB,CAStB,CAAC;AAEH,wBAAgB,4BAA4B,CAC1C,sBAAsB,EAAE,sBAAsB,GAC7C,MAAM,CAIR;AAED,gBAAgB;AAChB,eAAO,MAAM,oDAAoD,EAAE,CAAC,CAAC,OAAO,CAC1E,sCAAsC,EACtC,CAAC,CAAC,UAAU,EACZ,OAAO,CAyCP,CAAC;AAEH,wBAAgB,8CAA8C,CAC5D,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,sCAAsC,EAAE,kBAAkB,CAAC,CAO7E"}
|
|
@@ -58,8 +58,19 @@ function voidTransactionRequestToJSON(voidTransactionRequest) {
|
|
|
58
58
|
}
|
|
59
59
|
/** @internal */
|
|
60
60
|
exports.VoidTransactionResponseVoidTransaction$inboundSchema = z.union([
|
|
61
|
-
components.TransactionOutput$inboundSchema,
|
|
62
|
-
components.
|
|
61
|
+
components.TransactionOutput$inboundSchema.and(z.object({ status: z.literal("processing") })),
|
|
62
|
+
components.TransactionOutput$inboundSchema.and(z.object({ status: z.literal("authorization_succeeded") })),
|
|
63
|
+
components.TransactionOutput$inboundSchema.and(z.object({ status: z.literal("authorization_declined") })),
|
|
64
|
+
components.TransactionOutput$inboundSchema.and(z.object({ status: z.literal("authorization_failed") })),
|
|
65
|
+
components.TransactionOutput$inboundSchema.and(z.object({ status: z.literal("authorization_voided") })),
|
|
66
|
+
components.TransactionOutput$inboundSchema.and(z.object({ status: z.literal("authorization_void_pending") })),
|
|
67
|
+
components.TransactionOutput$inboundSchema.and(z.object({ status: z.literal("capture_succeeded") })),
|
|
68
|
+
components.TransactionOutput$inboundSchema.and(z.object({ status: z.literal("capture_pending") })),
|
|
69
|
+
components.TransactionOutput$inboundSchema.and(z.object({ status: z.literal("buyer_approval_pending") })),
|
|
70
|
+
components.TransactionVoidOutput$inboundSchema.and(z.object({ status: z.literal("succeeded") })),
|
|
71
|
+
components.TransactionVoidOutput$inboundSchema.and(z.object({ status: z.literal("pending") })),
|
|
72
|
+
components.TransactionVoidOutput$inboundSchema.and(z.object({ status: z.literal("declined") })),
|
|
73
|
+
components.TransactionVoidOutput$inboundSchema.and(z.object({ status: z.literal("failed") })),
|
|
63
74
|
]);
|
|
64
75
|
function voidTransactionResponseVoidTransactionFromJSON(jsonString) {
|
|
65
76
|
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.VoidTransactionResponseVoidTransaction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VoidTransactionResponseVoidTransaction' from JSON`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voidtransaction.js","sourceRoot":"","sources":["../../src/models/operations/voidtransaction.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"voidtransaction.js","sourceRoot":"","sources":["../../src/models/operations/voidtransaction.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEH,oEAMC;AAiDD,wGASC;AAlID,0CAA4B;AAC5B,2DAA0D;AAC1D,qDAAiD;AAEjD,mEAAqD;AA+CrD,gBAAgB;AACH,QAAA,qCAAqC,GAI9C,CAAC,CAAC,MAAM,CAAC;IACX,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;IAClD,iBAAiB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EA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| null {
|
|
|
77
77
|
export const SDK_METADATA = {
|
|
78
78
|
language: "typescript",
|
|
79
79
|
openapiDocVersion: "1.0.0",
|
|
80
|
-
sdkVersion: "1.6.
|
|
81
|
-
genVersion: "2.
|
|
82
|
-
userAgent: "speakeasy-sdk/typescript 1.6.
|
|
80
|
+
sdkVersion: "1.6.10",
|
|
81
|
+
genVersion: "2.763.2",
|
|
82
|
+
userAgent: "speakeasy-sdk/typescript 1.6.10 2.763.2 1.0.0 @gr4vy/sdk",
|
|
83
83
|
} as const;
|
package/src/lib/encodings.ts
CHANGED
|
@@ -102,8 +102,9 @@ export function encodeLabel(
|
|
|
102
102
|
});
|
|
103
103
|
encValue = mapped?.join("").slice(1);
|
|
104
104
|
} else {
|
|
105
|
-
const k =
|
|
106
|
-
|
|
105
|
+
const k = options?.explode && isPlainObject(value)
|
|
106
|
+
? `${encodeString(pk)}=`
|
|
107
|
+
: "";
|
|
107
108
|
encValue = `${k}${encodeValue(pv)}`;
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -440,7 +441,7 @@ type BulkQueryEncoder = (
|
|
|
440
441
|
) => string;
|
|
441
442
|
|
|
442
443
|
export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
|
|
443
|
-
const bulkEncode = function
|
|
444
|
+
const bulkEncode = function(
|
|
444
445
|
values: Record<string, unknown>,
|
|
445
446
|
options?: QueryEncoderOptions,
|
|
446
447
|
): string {
|
|
@@ -18,6 +18,10 @@ export type CybersourceOptions = {
|
|
|
18
18
|
* The shipping method for this transaction.
|
|
19
19
|
*/
|
|
20
20
|
shipToMethod?: string | null | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Brief description of the order or any comment you wish to add to the order.
|
|
23
|
+
*/
|
|
24
|
+
comments?: string | null | undefined;
|
|
21
25
|
};
|
|
22
26
|
|
|
23
27
|
/** @internal */
|
|
@@ -25,6 +29,7 @@ export type CybersourceOptions$Outbound = {
|
|
|
25
29
|
meta_key_merchant_id?: string | null | undefined;
|
|
26
30
|
merchant_defined_information?: { [k: string]: string } | null | undefined;
|
|
27
31
|
ship_to_method?: string | null | undefined;
|
|
32
|
+
comments?: string | null | undefined;
|
|
28
33
|
};
|
|
29
34
|
|
|
30
35
|
/** @internal */
|
|
@@ -36,6 +41,7 @@ export const CybersourceOptions$outboundSchema: z.ZodType<
|
|
|
36
41
|
metaKeyMerchantId: z.nullable(z.string()).optional(),
|
|
37
42
|
merchantDefinedInformation: z.nullable(z.record(z.string())).optional(),
|
|
38
43
|
shipToMethod: z.nullable(z.string()).optional(),
|
|
44
|
+
comments: z.nullable(z.string()).optional(),
|
|
39
45
|
}).transform((v) => {
|
|
40
46
|
return remap$(v, {
|
|
41
47
|
metaKeyMerchantId: "meta_key_merchant_id",
|
|
@@ -141,6 +141,7 @@ export * from "./networktokenpaymentmethodcreate.js";
|
|
|
141
141
|
export * from "./networktokens.js";
|
|
142
142
|
export * from "./networktokenstatus.js";
|
|
143
143
|
export * from "./nuveiairlinedataoptions.js";
|
|
144
|
+
export * from "./nuveiidealoptions.js";
|
|
144
145
|
export * from "./nuveioptions.js";
|
|
145
146
|
export * from "./nuveipseoptions.js";
|
|
146
147
|
export * from "./oxxooptions.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
|
|
7
|
+
export type NuveiIDealOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Additional data to be sent to Nuvei.
|
|
10
|
+
*/
|
|
11
|
+
customData?: string | null | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type NuveiIDealOptions$Outbound = {
|
|
16
|
+
customData?: string | null | undefined;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const NuveiIDealOptions$outboundSchema: z.ZodType<
|
|
21
|
+
NuveiIDealOptions$Outbound,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
NuveiIDealOptions
|
|
24
|
+
> = z.object({
|
|
25
|
+
customData: z.nullable(z.string()).optional(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function nuveiIDealOptionsToJSON(
|
|
29
|
+
nuveiIDealOptions: NuveiIDealOptions,
|
|
30
|
+
): string {
|
|
31
|
+
return JSON.stringify(
|
|
32
|
+
NuveiIDealOptions$outboundSchema.parse(nuveiIDealOptions),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -77,24 +77,16 @@ export type Spec$Outbound =
|
|
|
77
77
|
export const Spec$outboundSchema: z.ZodType<Spec$Outbound, z.ZodTypeDef, Spec> =
|
|
78
78
|
z.union([
|
|
79
79
|
AccountsReceivablesReportSpec$outboundSchema.and(
|
|
80
|
-
z.object({ model: z.literal("accounts_receivables") })
|
|
81
|
-
model: v.model,
|
|
82
|
-
})),
|
|
80
|
+
z.object({ model: z.literal("accounts_receivables") }),
|
|
83
81
|
),
|
|
84
82
|
DetailedSettlementReportSpec$outboundSchema.and(
|
|
85
|
-
z.object({ model: z.literal("detailed_settlement") })
|
|
86
|
-
model: v.model,
|
|
87
|
-
})),
|
|
83
|
+
z.object({ model: z.literal("detailed_settlement") }),
|
|
88
84
|
),
|
|
89
85
|
TransactionRetriesReportSpec$outboundSchema.and(
|
|
90
|
-
z.object({ model: z.literal("transaction_retries") })
|
|
91
|
-
model: v.model,
|
|
92
|
-
})),
|
|
86
|
+
z.object({ model: z.literal("transaction_retries") }),
|
|
93
87
|
),
|
|
94
88
|
TransactionsReportSpec$outboundSchema.and(
|
|
95
|
-
z.object({ model: z.literal("transactions") })
|
|
96
|
-
model: v.model,
|
|
97
|
-
})),
|
|
89
|
+
z.object({ model: z.literal("transactions") }),
|
|
98
90
|
),
|
|
99
91
|
]);
|
|
100
92
|
|
|
@@ -131,24 +123,16 @@ export const ReportCreate$outboundSchema: z.ZodType<
|
|
|
131
123
|
scheduleTimezone: z.string().default("Etc/UTC"),
|
|
132
124
|
spec: z.union([
|
|
133
125
|
AccountsReceivablesReportSpec$outboundSchema.and(
|
|
134
|
-
z.object({ model: z.literal("accounts_receivables") })
|
|
135
|
-
model: v.model,
|
|
136
|
-
})),
|
|
126
|
+
z.object({ model: z.literal("accounts_receivables") }),
|
|
137
127
|
),
|
|
138
128
|
DetailedSettlementReportSpec$outboundSchema.and(
|
|
139
|
-
z.object({ model: z.literal("detailed_settlement") })
|
|
140
|
-
model: v.model,
|
|
141
|
-
})),
|
|
129
|
+
z.object({ model: z.literal("detailed_settlement") }),
|
|
142
130
|
),
|
|
143
131
|
TransactionRetriesReportSpec$outboundSchema.and(
|
|
144
|
-
z.object({ model: z.literal("transaction_retries") })
|
|
145
|
-
model: v.model,
|
|
146
|
-
})),
|
|
132
|
+
z.object({ model: z.literal("transaction_retries") }),
|
|
147
133
|
),
|
|
148
134
|
TransactionsReportSpec$outboundSchema.and(
|
|
149
|
-
z.object({ model: z.literal("transactions") })
|
|
150
|
-
model: v.model,
|
|
151
|
-
})),
|
|
135
|
+
z.object({ model: z.literal("transactions") }),
|
|
152
136
|
),
|
|
153
137
|
]),
|
|
154
138
|
}).transform((v) => {
|
|
@@ -89,6 +89,11 @@ import {
|
|
|
89
89
|
MonatoSpeiOptions$Outbound,
|
|
90
90
|
MonatoSpeiOptions$outboundSchema,
|
|
91
91
|
} from "./monatospeioptions.js";
|
|
92
|
+
import {
|
|
93
|
+
NuveiIDealOptions,
|
|
94
|
+
NuveiIDealOptions$Outbound,
|
|
95
|
+
NuveiIDealOptions$outboundSchema,
|
|
96
|
+
} from "./nuveiidealoptions.js";
|
|
92
97
|
import {
|
|
93
98
|
NuveiOptions,
|
|
94
99
|
NuveiOptions$Outbound,
|
|
@@ -261,6 +266,10 @@ export type TransactionConnectionOptions = {
|
|
|
261
266
|
* Custom options to be passed to the `nuvei-card` connector.
|
|
262
267
|
*/
|
|
263
268
|
nuveiCard?: NuveiOptions | null | undefined;
|
|
269
|
+
/**
|
|
270
|
+
* Custom options to be passed to the `nuvei-ideal` connector.
|
|
271
|
+
*/
|
|
272
|
+
nuveiIdeal?: NuveiIDealOptions | null | undefined;
|
|
264
273
|
/**
|
|
265
274
|
* Custom options to be passed to the `nuvei-pse` connector.
|
|
266
275
|
*/
|
|
@@ -338,6 +347,7 @@ export type TransactionConnectionOptions$Outbound = {
|
|
|
338
347
|
"monato-spei"?: MonatoSpeiOptions$Outbound | null | undefined;
|
|
339
348
|
"mock-card"?: MockCardOptions$Outbound | null | undefined;
|
|
340
349
|
"nuvei-card"?: NuveiOptions$Outbound | null | undefined;
|
|
350
|
+
"nuvei-ideal"?: NuveiIDealOptions$Outbound | null | undefined;
|
|
341
351
|
"nuvei-pse"?: NuveiPSEOptions$Outbound | null | undefined;
|
|
342
352
|
"oxxo-oxxo"?: OxxoOptions$Outbound | null | undefined;
|
|
343
353
|
"paypal-paypal"?: PaypalOptions$Outbound | null | undefined;
|
|
@@ -389,6 +399,7 @@ export const TransactionConnectionOptions$outboundSchema: z.ZodType<
|
|
|
389
399
|
monatoSpei: z.nullable(MonatoSpeiOptions$outboundSchema).optional(),
|
|
390
400
|
mockCard: z.nullable(MockCardOptions$outboundSchema).optional(),
|
|
391
401
|
nuveiCard: z.nullable(NuveiOptions$outboundSchema).optional(),
|
|
402
|
+
nuveiIdeal: z.nullable(NuveiIDealOptions$outboundSchema).optional(),
|
|
392
403
|
nuveiPse: z.nullable(NuveiPSEOptions$outboundSchema).optional(),
|
|
393
404
|
oxxoOxxo: z.nullable(OxxoOptions$outboundSchema).optional(),
|
|
394
405
|
paypalPaypal: z.nullable(PaypalOptions$outboundSchema).optional(),
|
|
@@ -431,6 +442,7 @@ export const TransactionConnectionOptions$outboundSchema: z.ZodType<
|
|
|
431
442
|
monatoSpei: "monato-spei",
|
|
432
443
|
mockCard: "mock-card",
|
|
433
444
|
nuveiCard: "nuvei-card",
|
|
445
|
+
nuveiIdeal: "nuvei-ideal",
|
|
434
446
|
nuveiPse: "nuvei-pse",
|
|
435
447
|
oxxoOxxo: "oxxo-oxxo",
|
|
436
448
|
paypalPaypal: "paypal-paypal",
|
|
@@ -33,8 +33,19 @@ export type CaptureTransactionRequest = {
|
|
|
33
33
|
* Successful Response
|
|
34
34
|
*/
|
|
35
35
|
export type CaptureTransactionResponseCaptureTransaction =
|
|
36
|
-
| components.TransactionOutput
|
|
37
|
-
| components.
|
|
36
|
+
| (components.TransactionOutput & { status: "processing" })
|
|
37
|
+
| (components.TransactionOutput & { status: "authorization_succeeded" })
|
|
38
|
+
| (components.TransactionOutput & { status: "authorization_declined" })
|
|
39
|
+
| (components.TransactionOutput & { status: "authorization_failed" })
|
|
40
|
+
| (components.TransactionOutput & { status: "authorization_voided" })
|
|
41
|
+
| (components.TransactionOutput & { status: "authorization_void_pending" })
|
|
42
|
+
| (components.TransactionOutput & { status: "capture_succeeded" })
|
|
43
|
+
| (components.TransactionOutput & { status: "capture_pending" })
|
|
44
|
+
| (components.TransactionOutput & { status: "buyer_approval_pending" })
|
|
45
|
+
| (components.TransactionCaptureOutput & { status: "succeeded" })
|
|
46
|
+
| (components.TransactionCaptureOutput & { status: "pending" })
|
|
47
|
+
| (components.TransactionCaptureOutput & { status: "declined" })
|
|
48
|
+
| (components.TransactionCaptureOutput & { status: "failed" });
|
|
38
49
|
|
|
39
50
|
/** @internal */
|
|
40
51
|
export type CaptureTransactionRequest$Outbound = {
|
|
@@ -76,8 +87,45 @@ export const CaptureTransactionResponseCaptureTransaction$inboundSchema:
|
|
|
76
87
|
z.ZodTypeDef,
|
|
77
88
|
unknown
|
|
78
89
|
> = z.union([
|
|
79
|
-
components.TransactionOutput$inboundSchema
|
|
80
|
-
|
|
90
|
+
components.TransactionOutput$inboundSchema.and(
|
|
91
|
+
z.object({ status: z.literal("processing") }),
|
|
92
|
+
),
|
|
93
|
+
components.TransactionOutput$inboundSchema.and(
|
|
94
|
+
z.object({ status: z.literal("authorization_succeeded") }),
|
|
95
|
+
),
|
|
96
|
+
components.TransactionOutput$inboundSchema.and(
|
|
97
|
+
z.object({ status: z.literal("authorization_declined") }),
|
|
98
|
+
),
|
|
99
|
+
components.TransactionOutput$inboundSchema.and(
|
|
100
|
+
z.object({ status: z.literal("authorization_failed") }),
|
|
101
|
+
),
|
|
102
|
+
components.TransactionOutput$inboundSchema.and(
|
|
103
|
+
z.object({ status: z.literal("authorization_voided") }),
|
|
104
|
+
),
|
|
105
|
+
components.TransactionOutput$inboundSchema.and(
|
|
106
|
+
z.object({ status: z.literal("authorization_void_pending") }),
|
|
107
|
+
),
|
|
108
|
+
components.TransactionOutput$inboundSchema.and(
|
|
109
|
+
z.object({ status: z.literal("capture_succeeded") }),
|
|
110
|
+
),
|
|
111
|
+
components.TransactionOutput$inboundSchema.and(
|
|
112
|
+
z.object({ status: z.literal("capture_pending") }),
|
|
113
|
+
),
|
|
114
|
+
components.TransactionOutput$inboundSchema.and(
|
|
115
|
+
z.object({ status: z.literal("buyer_approval_pending") }),
|
|
116
|
+
),
|
|
117
|
+
components.TransactionCaptureOutput$inboundSchema.and(
|
|
118
|
+
z.object({ status: z.literal("succeeded") }),
|
|
119
|
+
),
|
|
120
|
+
components.TransactionCaptureOutput$inboundSchema.and(
|
|
121
|
+
z.object({ status: z.literal("pending") }),
|
|
122
|
+
),
|
|
123
|
+
components.TransactionCaptureOutput$inboundSchema.and(
|
|
124
|
+
z.object({ status: z.literal("declined") }),
|
|
125
|
+
),
|
|
126
|
+
components.TransactionCaptureOutput$inboundSchema.and(
|
|
127
|
+
z.object({ status: z.literal("failed") }),
|
|
128
|
+
),
|
|
81
129
|
]);
|
|
82
130
|
|
|
83
131
|
export function captureTransactionResponseCaptureTransactionFromJSON(
|
|
@@ -32,8 +32,19 @@ export type VoidTransactionRequest = {
|
|
|
32
32
|
* Successful Response
|
|
33
33
|
*/
|
|
34
34
|
export type VoidTransactionResponseVoidTransaction =
|
|
35
|
-
| components.TransactionOutput
|
|
36
|
-
| components.
|
|
35
|
+
| (components.TransactionOutput & { status: "processing" })
|
|
36
|
+
| (components.TransactionOutput & { status: "authorization_succeeded" })
|
|
37
|
+
| (components.TransactionOutput & { status: "authorization_declined" })
|
|
38
|
+
| (components.TransactionOutput & { status: "authorization_failed" })
|
|
39
|
+
| (components.TransactionOutput & { status: "authorization_voided" })
|
|
40
|
+
| (components.TransactionOutput & { status: "authorization_void_pending" })
|
|
41
|
+
| (components.TransactionOutput & { status: "capture_succeeded" })
|
|
42
|
+
| (components.TransactionOutput & { status: "capture_pending" })
|
|
43
|
+
| (components.TransactionOutput & { status: "buyer_approval_pending" })
|
|
44
|
+
| (components.TransactionVoidOutput & { status: "succeeded" })
|
|
45
|
+
| (components.TransactionVoidOutput & { status: "pending" })
|
|
46
|
+
| (components.TransactionVoidOutput & { status: "declined" })
|
|
47
|
+
| (components.TransactionVoidOutput & { status: "failed" });
|
|
37
48
|
|
|
38
49
|
/** @internal */
|
|
39
50
|
export type VoidTransactionRequest$Outbound = {
|
|
@@ -71,8 +82,45 @@ export const VoidTransactionResponseVoidTransaction$inboundSchema: z.ZodType<
|
|
|
71
82
|
z.ZodTypeDef,
|
|
72
83
|
unknown
|
|
73
84
|
> = z.union([
|
|
74
|
-
components.TransactionOutput$inboundSchema
|
|
75
|
-
|
|
85
|
+
components.TransactionOutput$inboundSchema.and(
|
|
86
|
+
z.object({ status: z.literal("processing") }),
|
|
87
|
+
),
|
|
88
|
+
components.TransactionOutput$inboundSchema.and(
|
|
89
|
+
z.object({ status: z.literal("authorization_succeeded") }),
|
|
90
|
+
),
|
|
91
|
+
components.TransactionOutput$inboundSchema.and(
|
|
92
|
+
z.object({ status: z.literal("authorization_declined") }),
|
|
93
|
+
),
|
|
94
|
+
components.TransactionOutput$inboundSchema.and(
|
|
95
|
+
z.object({ status: z.literal("authorization_failed") }),
|
|
96
|
+
),
|
|
97
|
+
components.TransactionOutput$inboundSchema.and(
|
|
98
|
+
z.object({ status: z.literal("authorization_voided") }),
|
|
99
|
+
),
|
|
100
|
+
components.TransactionOutput$inboundSchema.and(
|
|
101
|
+
z.object({ status: z.literal("authorization_void_pending") }),
|
|
102
|
+
),
|
|
103
|
+
components.TransactionOutput$inboundSchema.and(
|
|
104
|
+
z.object({ status: z.literal("capture_succeeded") }),
|
|
105
|
+
),
|
|
106
|
+
components.TransactionOutput$inboundSchema.and(
|
|
107
|
+
z.object({ status: z.literal("capture_pending") }),
|
|
108
|
+
),
|
|
109
|
+
components.TransactionOutput$inboundSchema.and(
|
|
110
|
+
z.object({ status: z.literal("buyer_approval_pending") }),
|
|
111
|
+
),
|
|
112
|
+
components.TransactionVoidOutput$inboundSchema.and(
|
|
113
|
+
z.object({ status: z.literal("succeeded") }),
|
|
114
|
+
),
|
|
115
|
+
components.TransactionVoidOutput$inboundSchema.and(
|
|
116
|
+
z.object({ status: z.literal("pending") }),
|
|
117
|
+
),
|
|
118
|
+
components.TransactionVoidOutput$inboundSchema.and(
|
|
119
|
+
z.object({ status: z.literal("declined") }),
|
|
120
|
+
),
|
|
121
|
+
components.TransactionVoidOutput$inboundSchema.and(
|
|
122
|
+
z.object({ status: z.literal("failed") }),
|
|
123
|
+
),
|
|
76
124
|
]);
|
|
77
125
|
|
|
78
126
|
export function voidTransactionResponseVoidTransactionFromJSON(
|
package/src/types/enums.ts
CHANGED
|
@@ -3,34 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import { Unrecognized, unrecognized } from "./unrecognized.js";
|
|
6
7
|
|
|
7
|
-
declare const __brand: unique symbol;
|
|
8
|
-
export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
|
|
9
8
|
export type ClosedEnum<T extends Readonly<Record<string, string | number>>> =
|
|
10
9
|
T[keyof T];
|
|
11
10
|
export type OpenEnum<T extends Readonly<Record<string, string | number>>> =
|
|
12
11
|
| T[keyof T]
|
|
13
12
|
| Unrecognized<T[keyof T] extends number ? number : string>;
|
|
14
13
|
|
|
15
|
-
function unrecognized<T>(value: T): Unrecognized<T> {
|
|
16
|
-
unrecognizedCount++;
|
|
17
|
-
return value as Unrecognized<T>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
let unrecognizedCount = 0;
|
|
21
|
-
let refCount = 0;
|
|
22
|
-
export function unrecognizedCounter() {
|
|
23
|
-
refCount++;
|
|
24
|
-
const start = unrecognizedCount;
|
|
25
|
-
return {
|
|
26
|
-
count: () => {
|
|
27
|
-
const count = unrecognizedCount - start;
|
|
28
|
-
if (--refCount === 0) unrecognizedCount = 0;
|
|
29
|
-
return count;
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
14
|
export function inboundSchema<T extends Record<string, string>>(
|
|
35
15
|
enumObj: T,
|
|
36
16
|
): z.ZodType<OpenEnum<T>, z.ZodTypeDef, unknown> {
|
package/src/types/index.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export { blobLikeSchema, isBlobLike } from "./blobs.js";
|
|
6
|
-
export type { ClosedEnum, OpenEnum
|
|
6
|
+
export type { ClosedEnum, OpenEnum } from "./enums.js";
|
|
7
7
|
export type { Result } from "./fp.js";
|
|
8
8
|
export type { PageIterator, Paginator } from "./operations.js";
|
|
9
9
|
export { createPageIterator } from "./operations.js";
|
|
10
10
|
export { RFCDate } from "./rfcdate.js";
|
|
11
|
+
export * from "./unrecognized.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
declare const __brand: unique symbol;
|
|
6
|
+
export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
|
|
7
|
+
|
|
8
|
+
function unrecognized<T>(value: T): Unrecognized<T> {
|
|
9
|
+
globalCount++;
|
|
10
|
+
return value as Unrecognized<T>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let globalCount = 0;
|
|
14
|
+
let refCount = 0;
|
|
15
|
+
export function startCountingUnrecognized() {
|
|
16
|
+
refCount++;
|
|
17
|
+
const start = globalCount;
|
|
18
|
+
return {
|
|
19
|
+
end: () => {
|
|
20
|
+
const count = globalCount - start;
|
|
21
|
+
if (--refCount === 0) globalCount = 0;
|
|
22
|
+
return count;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { unrecognized };
|
package/types/enums.d.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import * as z from "zod/v3";
|
|
2
|
-
|
|
3
|
-
export type Unrecognized<T> = T & {
|
|
4
|
-
[__brand]: "unrecognized";
|
|
5
|
-
};
|
|
2
|
+
import { Unrecognized } from "./unrecognized.js";
|
|
6
3
|
export type ClosedEnum<T extends Readonly<Record<string, string | number>>> = T[keyof T];
|
|
7
4
|
export type OpenEnum<T extends Readonly<Record<string, string | number>>> = T[keyof T] | Unrecognized<T[keyof T] extends number ? number : string>;
|
|
8
|
-
export declare function unrecognizedCounter(): {
|
|
9
|
-
count: () => number;
|
|
10
|
-
};
|
|
11
5
|
export declare function inboundSchema<T extends Record<string, string>>(enumObj: T): z.ZodType<OpenEnum<T>, z.ZodTypeDef, unknown>;
|
|
12
6
|
export declare function inboundSchemaInt<T extends Record<string, number | string>>(enumObj: T): z.ZodType<OpenEnum<T>, z.ZodTypeDef, unknown>;
|
|
13
7
|
export declare function outboundSchema<T extends Record<string, string>>(_: T): z.ZodType<string, z.ZodTypeDef, OpenEnum<T>>;
|
|
14
8
|
export declare function outboundSchemaInt<T extends Record<string, number | string>>(_: T): z.ZodType<number, z.ZodTypeDef, OpenEnum<T>>;
|
|
15
|
-
export {};
|
|
16
9
|
//# sourceMappingURL=enums.d.ts.map
|
package/types/enums.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../src/types/enums.ts"],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,CAAC,CAE9C;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACzE,CAAC,EAAE,CAAC,GACH,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAE9C"}
|
package/types/enums.js
CHANGED
|
@@ -36,35 +36,17 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.unrecognizedCounter = unrecognizedCounter;
|
|
40
39
|
exports.inboundSchema = inboundSchema;
|
|
41
40
|
exports.inboundSchemaInt = inboundSchemaInt;
|
|
42
41
|
exports.outboundSchema = outboundSchema;
|
|
43
42
|
exports.outboundSchemaInt = outboundSchemaInt;
|
|
44
43
|
const z = __importStar(require("zod/v3"));
|
|
45
|
-
|
|
46
|
-
unrecognizedCount++;
|
|
47
|
-
return value;
|
|
48
|
-
}
|
|
49
|
-
let unrecognizedCount = 0;
|
|
50
|
-
let refCount = 0;
|
|
51
|
-
function unrecognizedCounter() {
|
|
52
|
-
refCount++;
|
|
53
|
-
const start = unrecognizedCount;
|
|
54
|
-
return {
|
|
55
|
-
count: () => {
|
|
56
|
-
const count = unrecognizedCount - start;
|
|
57
|
-
if (--refCount === 0)
|
|
58
|
-
unrecognizedCount = 0;
|
|
59
|
-
return count;
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
44
|
+
const unrecognized_js_1 = require("./unrecognized.js");
|
|
63
45
|
function inboundSchema(enumObj) {
|
|
64
46
|
const options = Object.values(enumObj);
|
|
65
47
|
return z.union([
|
|
66
48
|
...options.map(x => z.literal(x)),
|
|
67
|
-
z.string().transform(x => unrecognized(x)),
|
|
49
|
+
z.string().transform(x => (0, unrecognized_js_1.unrecognized)(x)),
|
|
68
50
|
]);
|
|
69
51
|
}
|
|
70
52
|
function inboundSchemaInt(enumObj) {
|
|
@@ -72,7 +54,7 @@ function inboundSchemaInt(enumObj) {
|
|
|
72
54
|
const options = Object.values(enumObj).filter(v => typeof v === "number");
|
|
73
55
|
return z.union([
|
|
74
56
|
...options.map(x => z.literal(x)),
|
|
75
|
-
z.number().int().transform(x => unrecognized(x)),
|
|
57
|
+
z.number().int().transform(x => (0, unrecognized_js_1.unrecognized)(x)),
|
|
76
58
|
]);
|
|
77
59
|
}
|
|
78
60
|
function outboundSchema(_) {
|
package/types/enums.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../src/types/enums.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../src/types/enums.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWH,sCAQC;AAED,4CASC;AAED,wCAIC;AAED,8CAIC;AAxCD,0CAA4B;AAC5B,uDAA+D;AAQ/D,SAAgB,aAAa,CAC3B,OAAU;IAEV,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,KAAK,CAAC;QACb,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,8BAAY,EAAC,CAAC,CAAC,CAAC;KACpC,CAAC,CAAC;AACZ,CAAC;AAED,SAAgB,gBAAgB,CAC9B,OAAU;IAEV,wEAAwE;IACxE,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;IAC1E,OAAO,CAAC,CAAC,KAAK,CAAC;QACb,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,8BAAY,EAAC,CAAC,CAAC,CAAC;KAC1C,CAAC,CAAC;AACZ,CAAC;AAED,SAAgB,cAAc,CAC5B,CAAI;IAEJ,OAAO,CAAC,CAAC,MAAM,EAAS,CAAC;AAC3B,CAAC;AAED,SAAgB,iBAAiB,CAC/B,CAAI;IAEJ,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAS,CAAC;AACjC,CAAC"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { blobLikeSchema, isBlobLike } from "./blobs.js";
|
|
2
|
-
export type { ClosedEnum, OpenEnum
|
|
2
|
+
export type { ClosedEnum, OpenEnum } from "./enums.js";
|
|
3
3
|
export type { Result } from "./fp.js";
|
|
4
4
|
export type { PageIterator, Paginator } from "./operations.js";
|
|
5
5
|
export { createPageIterator } from "./operations.js";
|
|
6
6
|
export { RFCDate } from "./rfcdate.js";
|
|
7
|
+
export * from "./unrecognized.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxD,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACvD,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|