@gr4vy/sdk 1.9.11 → 1.9.13
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/README.md +11 -0
- package/examples/package-lock.json +1 -1
- package/funcs/threeDsScenariosCreate.d.ts +18 -0
- package/funcs/threeDsScenariosCreate.d.ts.map +1 -0
- package/funcs/threeDsScenariosCreate.js +141 -0
- package/funcs/threeDsScenariosCreate.js.map +1 -0
- package/funcs/threeDsScenariosDelete.d.ts +17 -0
- package/funcs/threeDsScenariosDelete.d.ts.map +1 -0
- package/funcs/threeDsScenariosDelete.js +141 -0
- package/funcs/threeDsScenariosDelete.js.map +1 -0
- package/funcs/threeDsScenariosList.d.ts +21 -0
- package/funcs/threeDsScenariosList.d.ts.map +1 -0
- package/funcs/threeDsScenariosList.js +177 -0
- package/funcs/threeDsScenariosList.js.map +1 -0
- package/funcs/threeDsScenariosUpdate.d.ts +18 -0
- package/funcs/threeDsScenariosUpdate.d.ts.map +1 -0
- package/funcs/threeDsScenariosUpdate.js +145 -0
- package/funcs/threeDsScenariosUpdate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/index.d.ts +8 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +8 -0
- package/models/components/index.js.map +1 -1
- package/models/components/threedsecurescenario.d.ts +33 -0
- package/models/components/threedsecurescenario.d.ts.map +1 -0
- package/models/components/threedsecurescenario.js +65 -0
- package/models/components/threedsecurescenario.js.map +1 -0
- package/models/components/threedsecurescenarioconditions.d.ts +45 -0
- package/models/components/threedsecurescenarioconditions.d.ts.map +1 -0
- package/models/components/threedsecurescenarioconditions.js +85 -0
- package/models/components/threedsecurescenarioconditions.js.map +1 -0
- package/models/components/threedsecurescenariocreate.d.ts +16 -0
- package/models/components/threedsecurescenariocreate.d.ts.map +1 -0
- package/models/components/threedsecurescenariocreate.js +52 -0
- package/models/components/threedsecurescenariocreate.js.map +1 -0
- package/models/components/threedsecurescenariooutcome.d.ts +29 -0
- package/models/components/threedsecurescenariooutcome.d.ts.map +1 -0
- package/models/components/threedsecurescenariooutcome.js +66 -0
- package/models/components/threedsecurescenariooutcome.js.map +1 -0
- package/models/components/threedsecurescenariooutcomeauthentication.d.ts +41 -0
- package/models/components/threedsecurescenariooutcomeauthentication.d.ts.map +1 -0
- package/models/components/threedsecurescenariooutcomeauthentication.js +84 -0
- package/models/components/threedsecurescenariooutcomeauthentication.js.map +1 -0
- package/models/components/threedsecurescenariooutcomeresult.d.ts +37 -0
- package/models/components/threedsecurescenariooutcomeresult.d.ts.map +1 -0
- package/models/components/threedsecurescenariooutcomeresult.js +80 -0
- package/models/components/threedsecurescenariooutcomeresult.js.map +1 -0
- package/models/components/threedsecurescenarios.d.ts +26 -0
- package/models/components/threedsecurescenarios.d.ts.map +1 -0
- package/models/components/threedsecurescenarios.js +60 -0
- package/models/components/threedsecurescenarios.js.map +1 -0
- package/models/components/threedsecurescenarioupdate.d.ts +22 -0
- package/models/components/threedsecurescenarioupdate.d.ts.map +1 -0
- package/models/components/threedsecurescenarioupdate.js +53 -0
- package/models/components/threedsecurescenarioupdate.js.map +1 -0
- package/models/operations/createthreedsscenario.d.ts +21 -0
- package/models/operations/createthreedsscenario.d.ts.map +1 -0
- package/models/operations/createthreedsscenario.js +56 -0
- package/models/operations/createthreedsscenario.js.map +1 -0
- package/models/operations/deletethreedsscenario.d.ts +23 -0
- package/models/operations/deletethreedsscenario.d.ts.map +1 -0
- package/models/operations/deletethreedsscenario.js +55 -0
- package/models/operations/deletethreedsscenario.js.map +1 -0
- package/models/operations/getthreedsscenario.d.ts +37 -0
- package/models/operations/getthreedsscenario.d.ts.map +1 -0
- package/models/operations/getthreedsscenario.js +66 -0
- package/models/operations/getthreedsscenario.js.map +1 -0
- package/models/operations/index.d.ts +4 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +4 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/updatethreedsscenario.d.ts +26 -0
- package/models/operations/updatethreedsscenario.d.ts.map +1 -0
- package/models/operations/updatethreedsscenario.js +58 -0
- package/models/operations/updatethreedsscenario.js.map +1 -0
- package/package.json +1 -1
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/threedsscenarios.d.ts +37 -0
- package/sdk/threedsscenarios.d.ts.map +1 -0
- package/sdk/threedsscenarios.js +53 -0
- package/sdk/threedsscenarios.js.map +1 -0
- package/src/funcs/threeDsScenariosCreate.ts +245 -0
- package/src/funcs/threeDsScenariosDelete.ts +252 -0
- package/src/funcs/threeDsScenariosList.ts +337 -0
- package/src/funcs/threeDsScenariosUpdate.ts +259 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +8 -0
- package/src/models/components/threedsecurescenario.ts +73 -0
- package/src/models/components/threedsecurescenarioconditions.ts +108 -0
- package/src/models/components/threedsecurescenariocreate.ts +44 -0
- package/src/models/components/threedsecurescenariooutcome.ts +81 -0
- package/src/models/components/threedsecurescenariooutcomeauthentication.ts +114 -0
- package/src/models/components/threedsecurescenariooutcomeresult.ts +103 -0
- package/src/models/components/threedsecurescenarios.ts +59 -0
- package/src/models/components/threedsecurescenarioupdate.ts +51 -0
- package/src/models/operations/createthreedsscenario.ts +50 -0
- package/src/models/operations/deletethreedsscenario.ts +51 -0
- package/src/models/operations/getthreedsscenario.ts +82 -0
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/updatethreedsscenario.ts +57 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/threedsscenarios.ts +97 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Gr4vyCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import { Gr4vyError } from "../models/errors/gr4vyerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Create a 3DS scenario
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Create a new 3DS scenario for a merchant account. Only available in sandbox environments.
|
|
34
|
+
*/
|
|
35
|
+
export function threeDsScenariosCreate(
|
|
36
|
+
client: Gr4vyCore,
|
|
37
|
+
threeDSecureScenarioCreate: components.ThreeDSecureScenarioCreate,
|
|
38
|
+
merchantAccountId?: string | null | undefined,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
components.ThreeDSecureScenario,
|
|
43
|
+
| errors.Error400
|
|
44
|
+
| errors.Error401
|
|
45
|
+
| errors.Error403
|
|
46
|
+
| errors.Error404
|
|
47
|
+
| errors.Error405
|
|
48
|
+
| errors.Error409
|
|
49
|
+
| errors.HTTPValidationError
|
|
50
|
+
| errors.Error425
|
|
51
|
+
| errors.Error429
|
|
52
|
+
| errors.Error500
|
|
53
|
+
| errors.Error502
|
|
54
|
+
| errors.Error504
|
|
55
|
+
| Gr4vyError
|
|
56
|
+
| ResponseValidationError
|
|
57
|
+
| ConnectionError
|
|
58
|
+
| RequestAbortedError
|
|
59
|
+
| RequestTimeoutError
|
|
60
|
+
| InvalidRequestError
|
|
61
|
+
| UnexpectedClientError
|
|
62
|
+
| SDKValidationError
|
|
63
|
+
>
|
|
64
|
+
> {
|
|
65
|
+
return new APIPromise($do(
|
|
66
|
+
client,
|
|
67
|
+
threeDSecureScenarioCreate,
|
|
68
|
+
merchantAccountId,
|
|
69
|
+
options,
|
|
70
|
+
));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function $do(
|
|
74
|
+
client: Gr4vyCore,
|
|
75
|
+
threeDSecureScenarioCreate: components.ThreeDSecureScenarioCreate,
|
|
76
|
+
merchantAccountId?: string | null | undefined,
|
|
77
|
+
options?: RequestOptions,
|
|
78
|
+
): Promise<
|
|
79
|
+
[
|
|
80
|
+
Result<
|
|
81
|
+
components.ThreeDSecureScenario,
|
|
82
|
+
| errors.Error400
|
|
83
|
+
| errors.Error401
|
|
84
|
+
| errors.Error403
|
|
85
|
+
| errors.Error404
|
|
86
|
+
| errors.Error405
|
|
87
|
+
| errors.Error409
|
|
88
|
+
| errors.HTTPValidationError
|
|
89
|
+
| errors.Error425
|
|
90
|
+
| errors.Error429
|
|
91
|
+
| errors.Error500
|
|
92
|
+
| errors.Error502
|
|
93
|
+
| errors.Error504
|
|
94
|
+
| Gr4vyError
|
|
95
|
+
| ResponseValidationError
|
|
96
|
+
| ConnectionError
|
|
97
|
+
| RequestAbortedError
|
|
98
|
+
| RequestTimeoutError
|
|
99
|
+
| InvalidRequestError
|
|
100
|
+
| UnexpectedClientError
|
|
101
|
+
| SDKValidationError
|
|
102
|
+
>,
|
|
103
|
+
APICall,
|
|
104
|
+
]
|
|
105
|
+
> {
|
|
106
|
+
const input: operations.CreateThreeDsScenarioRequest = {
|
|
107
|
+
threeDSecureScenarioCreate: threeDSecureScenarioCreate,
|
|
108
|
+
merchantAccountId: merchantAccountId,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const parsed = safeParse(
|
|
112
|
+
input,
|
|
113
|
+
(value) =>
|
|
114
|
+
operations.CreateThreeDsScenarioRequest$outboundSchema.parse(value),
|
|
115
|
+
"Input validation failed",
|
|
116
|
+
);
|
|
117
|
+
if (!parsed.ok) {
|
|
118
|
+
return [parsed, { status: "invalid" }];
|
|
119
|
+
}
|
|
120
|
+
const payload = parsed.value;
|
|
121
|
+
const body = encodeJSON("body", payload.ThreeDSecureScenarioCreate, {
|
|
122
|
+
explode: true,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const path = pathToFunc("/three-ds-scenarios")();
|
|
126
|
+
|
|
127
|
+
const headers = new Headers(compactMap({
|
|
128
|
+
"Content-Type": "application/json",
|
|
129
|
+
Accept: "application/json",
|
|
130
|
+
"x-gr4vy-merchant-account-id": encodeSimple(
|
|
131
|
+
"x-gr4vy-merchant-account-id",
|
|
132
|
+
payload.merchantAccountId ?? client._options.merchantAccountId,
|
|
133
|
+
{ explode: false, charEncoding: "none" },
|
|
134
|
+
),
|
|
135
|
+
}));
|
|
136
|
+
|
|
137
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
138
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
139
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
140
|
+
|
|
141
|
+
const context = {
|
|
142
|
+
options: client._options,
|
|
143
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
144
|
+
operationID: "create_three_ds_scenario",
|
|
145
|
+
oAuth2Scopes: null,
|
|
146
|
+
|
|
147
|
+
resolvedSecurity: requestSecurity,
|
|
148
|
+
|
|
149
|
+
securitySource: client._options.bearerAuth,
|
|
150
|
+
retryConfig: options?.retries
|
|
151
|
+
|| client._options.retryConfig
|
|
152
|
+
|| { strategy: "none" },
|
|
153
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const requestRes = client._createRequest(context, {
|
|
157
|
+
security: requestSecurity,
|
|
158
|
+
method: "POST",
|
|
159
|
+
baseURL: options?.serverURL,
|
|
160
|
+
path: path,
|
|
161
|
+
headers: headers,
|
|
162
|
+
body: body,
|
|
163
|
+
userAgent: client._options.userAgent,
|
|
164
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
165
|
+
}, options);
|
|
166
|
+
if (!requestRes.ok) {
|
|
167
|
+
return [requestRes, { status: "invalid" }];
|
|
168
|
+
}
|
|
169
|
+
const req = requestRes.value;
|
|
170
|
+
|
|
171
|
+
const doResult = await client._do(req, {
|
|
172
|
+
context,
|
|
173
|
+
errorCodes: [
|
|
174
|
+
"400",
|
|
175
|
+
"401",
|
|
176
|
+
"403",
|
|
177
|
+
"404",
|
|
178
|
+
"405",
|
|
179
|
+
"409",
|
|
180
|
+
"422",
|
|
181
|
+
"425",
|
|
182
|
+
"429",
|
|
183
|
+
"4XX",
|
|
184
|
+
"500",
|
|
185
|
+
"502",
|
|
186
|
+
"504",
|
|
187
|
+
"5XX",
|
|
188
|
+
],
|
|
189
|
+
retryConfig: context.retryConfig,
|
|
190
|
+
retryCodes: context.retryCodes,
|
|
191
|
+
});
|
|
192
|
+
if (!doResult.ok) {
|
|
193
|
+
return [doResult, { status: "request-error", request: req }];
|
|
194
|
+
}
|
|
195
|
+
const response = doResult.value;
|
|
196
|
+
|
|
197
|
+
const responseFields = {
|
|
198
|
+
HttpMeta: { Response: response, Request: req },
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const [result] = await M.match<
|
|
202
|
+
components.ThreeDSecureScenario,
|
|
203
|
+
| errors.Error400
|
|
204
|
+
| errors.Error401
|
|
205
|
+
| errors.Error403
|
|
206
|
+
| errors.Error404
|
|
207
|
+
| errors.Error405
|
|
208
|
+
| errors.Error409
|
|
209
|
+
| errors.HTTPValidationError
|
|
210
|
+
| errors.Error425
|
|
211
|
+
| errors.Error429
|
|
212
|
+
| errors.Error500
|
|
213
|
+
| errors.Error502
|
|
214
|
+
| errors.Error504
|
|
215
|
+
| Gr4vyError
|
|
216
|
+
| ResponseValidationError
|
|
217
|
+
| ConnectionError
|
|
218
|
+
| RequestAbortedError
|
|
219
|
+
| RequestTimeoutError
|
|
220
|
+
| InvalidRequestError
|
|
221
|
+
| UnexpectedClientError
|
|
222
|
+
| SDKValidationError
|
|
223
|
+
>(
|
|
224
|
+
M.json(201, components.ThreeDSecureScenario$inboundSchema),
|
|
225
|
+
M.jsonErr(400, errors.Error400$inboundSchema),
|
|
226
|
+
M.jsonErr(401, errors.Error401$inboundSchema),
|
|
227
|
+
M.jsonErr(403, errors.Error403$inboundSchema),
|
|
228
|
+
M.jsonErr(404, errors.Error404$inboundSchema),
|
|
229
|
+
M.jsonErr(405, errors.Error405$inboundSchema),
|
|
230
|
+
M.jsonErr(409, errors.Error409$inboundSchema),
|
|
231
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
232
|
+
M.jsonErr(425, errors.Error425$inboundSchema),
|
|
233
|
+
M.jsonErr(429, errors.Error429$inboundSchema),
|
|
234
|
+
M.jsonErr(500, errors.Error500$inboundSchema),
|
|
235
|
+
M.jsonErr(502, errors.Error502$inboundSchema),
|
|
236
|
+
M.jsonErr(504, errors.Error504$inboundSchema),
|
|
237
|
+
M.fail("4XX"),
|
|
238
|
+
M.fail("5XX"),
|
|
239
|
+
)(response, req, { extraFields: responseFields });
|
|
240
|
+
if (!result.ok) {
|
|
241
|
+
return [result, { status: "complete", request: req, response }];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return [result, { status: "complete", request: req, response }];
|
|
245
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { Gr4vyCore } from "../core.js";
|
|
7
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { Gr4vyError } from "../models/errors/gr4vyerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Delete a 3DS scenario
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Removes a 3DS scenario from our system. Only available in sandbox environments.
|
|
34
|
+
*/
|
|
35
|
+
export function threeDsScenariosDelete(
|
|
36
|
+
client: Gr4vyCore,
|
|
37
|
+
threeDsScenarioId: string,
|
|
38
|
+
merchantAccountId?: string | null | undefined,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
void,
|
|
43
|
+
| errors.Error400
|
|
44
|
+
| errors.Error401
|
|
45
|
+
| errors.Error403
|
|
46
|
+
| errors.Error404
|
|
47
|
+
| errors.Error405
|
|
48
|
+
| errors.Error409
|
|
49
|
+
| errors.HTTPValidationError
|
|
50
|
+
| errors.Error425
|
|
51
|
+
| errors.Error429
|
|
52
|
+
| errors.Error500
|
|
53
|
+
| errors.Error502
|
|
54
|
+
| errors.Error504
|
|
55
|
+
| Gr4vyError
|
|
56
|
+
| ResponseValidationError
|
|
57
|
+
| ConnectionError
|
|
58
|
+
| RequestAbortedError
|
|
59
|
+
| RequestTimeoutError
|
|
60
|
+
| InvalidRequestError
|
|
61
|
+
| UnexpectedClientError
|
|
62
|
+
| SDKValidationError
|
|
63
|
+
>
|
|
64
|
+
> {
|
|
65
|
+
return new APIPromise($do(
|
|
66
|
+
client,
|
|
67
|
+
threeDsScenarioId,
|
|
68
|
+
merchantAccountId,
|
|
69
|
+
options,
|
|
70
|
+
));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function $do(
|
|
74
|
+
client: Gr4vyCore,
|
|
75
|
+
threeDsScenarioId: string,
|
|
76
|
+
merchantAccountId?: string | null | undefined,
|
|
77
|
+
options?: RequestOptions,
|
|
78
|
+
): Promise<
|
|
79
|
+
[
|
|
80
|
+
Result<
|
|
81
|
+
void,
|
|
82
|
+
| errors.Error400
|
|
83
|
+
| errors.Error401
|
|
84
|
+
| errors.Error403
|
|
85
|
+
| errors.Error404
|
|
86
|
+
| errors.Error405
|
|
87
|
+
| errors.Error409
|
|
88
|
+
| errors.HTTPValidationError
|
|
89
|
+
| errors.Error425
|
|
90
|
+
| errors.Error429
|
|
91
|
+
| errors.Error500
|
|
92
|
+
| errors.Error502
|
|
93
|
+
| errors.Error504
|
|
94
|
+
| Gr4vyError
|
|
95
|
+
| ResponseValidationError
|
|
96
|
+
| ConnectionError
|
|
97
|
+
| RequestAbortedError
|
|
98
|
+
| RequestTimeoutError
|
|
99
|
+
| InvalidRequestError
|
|
100
|
+
| UnexpectedClientError
|
|
101
|
+
| SDKValidationError
|
|
102
|
+
>,
|
|
103
|
+
APICall,
|
|
104
|
+
]
|
|
105
|
+
> {
|
|
106
|
+
const input: operations.DeleteThreeDsScenarioRequest = {
|
|
107
|
+
threeDsScenarioId: threeDsScenarioId,
|
|
108
|
+
merchantAccountId: merchantAccountId,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const parsed = safeParse(
|
|
112
|
+
input,
|
|
113
|
+
(value) =>
|
|
114
|
+
operations.DeleteThreeDsScenarioRequest$outboundSchema.parse(value),
|
|
115
|
+
"Input validation failed",
|
|
116
|
+
);
|
|
117
|
+
if (!parsed.ok) {
|
|
118
|
+
return [parsed, { status: "invalid" }];
|
|
119
|
+
}
|
|
120
|
+
const payload = parsed.value;
|
|
121
|
+
const body = null;
|
|
122
|
+
|
|
123
|
+
const pathParams = {
|
|
124
|
+
three_ds_scenario_id: encodeSimple(
|
|
125
|
+
"three_ds_scenario_id",
|
|
126
|
+
payload.three_ds_scenario_id,
|
|
127
|
+
{ explode: false, charEncoding: "percent" },
|
|
128
|
+
),
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const path = pathToFunc("/three-ds-scenarios/{three_ds_scenario_id}")(
|
|
132
|
+
pathParams,
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
const headers = new Headers(compactMap({
|
|
136
|
+
Accept: "application/json",
|
|
137
|
+
"x-gr4vy-merchant-account-id": encodeSimple(
|
|
138
|
+
"x-gr4vy-merchant-account-id",
|
|
139
|
+
payload.merchantAccountId ?? client._options.merchantAccountId,
|
|
140
|
+
{ explode: false, charEncoding: "none" },
|
|
141
|
+
),
|
|
142
|
+
}));
|
|
143
|
+
|
|
144
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
145
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
146
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
147
|
+
|
|
148
|
+
const context = {
|
|
149
|
+
options: client._options,
|
|
150
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
151
|
+
operationID: "delete_three_ds_scenario",
|
|
152
|
+
oAuth2Scopes: null,
|
|
153
|
+
|
|
154
|
+
resolvedSecurity: requestSecurity,
|
|
155
|
+
|
|
156
|
+
securitySource: client._options.bearerAuth,
|
|
157
|
+
retryConfig: options?.retries
|
|
158
|
+
|| client._options.retryConfig
|
|
159
|
+
|| { strategy: "none" },
|
|
160
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const requestRes = client._createRequest(context, {
|
|
164
|
+
security: requestSecurity,
|
|
165
|
+
method: "DELETE",
|
|
166
|
+
baseURL: options?.serverURL,
|
|
167
|
+
path: path,
|
|
168
|
+
headers: headers,
|
|
169
|
+
body: body,
|
|
170
|
+
userAgent: client._options.userAgent,
|
|
171
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
172
|
+
}, options);
|
|
173
|
+
if (!requestRes.ok) {
|
|
174
|
+
return [requestRes, { status: "invalid" }];
|
|
175
|
+
}
|
|
176
|
+
const req = requestRes.value;
|
|
177
|
+
|
|
178
|
+
const doResult = await client._do(req, {
|
|
179
|
+
context,
|
|
180
|
+
errorCodes: [
|
|
181
|
+
"400",
|
|
182
|
+
"401",
|
|
183
|
+
"403",
|
|
184
|
+
"404",
|
|
185
|
+
"405",
|
|
186
|
+
"409",
|
|
187
|
+
"422",
|
|
188
|
+
"425",
|
|
189
|
+
"429",
|
|
190
|
+
"4XX",
|
|
191
|
+
"500",
|
|
192
|
+
"502",
|
|
193
|
+
"504",
|
|
194
|
+
"5XX",
|
|
195
|
+
],
|
|
196
|
+
retryConfig: context.retryConfig,
|
|
197
|
+
retryCodes: context.retryCodes,
|
|
198
|
+
});
|
|
199
|
+
if (!doResult.ok) {
|
|
200
|
+
return [doResult, { status: "request-error", request: req }];
|
|
201
|
+
}
|
|
202
|
+
const response = doResult.value;
|
|
203
|
+
|
|
204
|
+
const responseFields = {
|
|
205
|
+
HttpMeta: { Response: response, Request: req },
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const [result] = await M.match<
|
|
209
|
+
void,
|
|
210
|
+
| errors.Error400
|
|
211
|
+
| errors.Error401
|
|
212
|
+
| errors.Error403
|
|
213
|
+
| errors.Error404
|
|
214
|
+
| errors.Error405
|
|
215
|
+
| errors.Error409
|
|
216
|
+
| errors.HTTPValidationError
|
|
217
|
+
| errors.Error425
|
|
218
|
+
| errors.Error429
|
|
219
|
+
| errors.Error500
|
|
220
|
+
| errors.Error502
|
|
221
|
+
| errors.Error504
|
|
222
|
+
| Gr4vyError
|
|
223
|
+
| ResponseValidationError
|
|
224
|
+
| ConnectionError
|
|
225
|
+
| RequestAbortedError
|
|
226
|
+
| RequestTimeoutError
|
|
227
|
+
| InvalidRequestError
|
|
228
|
+
| UnexpectedClientError
|
|
229
|
+
| SDKValidationError
|
|
230
|
+
>(
|
|
231
|
+
M.nil(204, z.void()),
|
|
232
|
+
M.jsonErr(400, errors.Error400$inboundSchema),
|
|
233
|
+
M.jsonErr(401, errors.Error401$inboundSchema),
|
|
234
|
+
M.jsonErr(403, errors.Error403$inboundSchema),
|
|
235
|
+
M.jsonErr(404, errors.Error404$inboundSchema),
|
|
236
|
+
M.jsonErr(405, errors.Error405$inboundSchema),
|
|
237
|
+
M.jsonErr(409, errors.Error409$inboundSchema),
|
|
238
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
239
|
+
M.jsonErr(425, errors.Error425$inboundSchema),
|
|
240
|
+
M.jsonErr(429, errors.Error429$inboundSchema),
|
|
241
|
+
M.jsonErr(500, errors.Error500$inboundSchema),
|
|
242
|
+
M.jsonErr(502, errors.Error502$inboundSchema),
|
|
243
|
+
M.jsonErr(504, errors.Error504$inboundSchema),
|
|
244
|
+
M.fail("4XX"),
|
|
245
|
+
M.fail("5XX"),
|
|
246
|
+
)(response, req, { extraFields: responseFields });
|
|
247
|
+
if (!result.ok) {
|
|
248
|
+
return [result, { status: "complete", request: req, response }];
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return [result, { status: "complete", request: req, response }];
|
|
252
|
+
}
|