@gr4vy/sdk 2.0.54 → 2.1.0
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 +2 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionComplete.d.ts +18 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionComplete.d.ts.map +1 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionComplete.js +127 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionComplete.js.map +1 -0
- 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/models/components/index.d.ts +7 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +7 -0
- package/models/components/index.js.map +1 -1
- package/models/components/pazebillingaddress.d.ts +4 -4
- package/models/components/pazebillingaddress.d.ts.map +1 -1
- package/models/components/pazebillingaddress.js +4 -4
- package/models/components/pazebillingaddress.js.map +1 -1
- package/models/components/pazedeliverycontactdetails.d.ts +9 -1
- package/models/components/pazedeliverycontactdetails.d.ts.map +1 -1
- package/models/components/pazedeliverycontactdetails.js +10 -1
- package/models/components/pazedeliverycontactdetails.js.map +1 -1
- package/models/components/pazeecomdata.d.ts +36 -0
- package/models/components/pazeecomdata.d.ts.map +1 -0
- package/models/components/pazeecomdata.js +55 -0
- package/models/components/pazeecomdata.js.map +1 -0
- package/models/components/pazeenhancedtransactiondata.d.ts +22 -0
- package/models/components/pazeenhancedtransactiondata.d.ts.map +1 -0
- package/models/components/pazeenhancedtransactiondata.js +52 -0
- package/models/components/pazeenhancedtransactiondata.js.map +1 -0
- package/models/components/pazelocationaddress.d.ts +50 -0
- package/models/components/pazelocationaddress.d.ts.map +1 -0
- package/models/components/pazelocationaddress.js +56 -0
- package/models/components/pazelocationaddress.js.map +1 -0
- package/models/components/pazemobilenumber.d.ts +8 -0
- package/models/components/pazemobilenumber.d.ts.map +1 -1
- package/models/components/pazemobilenumber.js +10 -1
- package/models/components/pazemobilenumber.js.map +1 -1
- package/models/components/pazesessioncomplete.d.ts +33 -0
- package/models/components/pazesessioncomplete.d.ts.map +1 -0
- package/models/components/pazesessioncomplete.js +60 -0
- package/models/components/pazesessioncomplete.js.map +1 -0
- package/models/components/pazesessioncompleterequest.d.ts +76 -0
- package/models/components/pazesessioncompleterequest.d.ts.map +1 -0
- package/models/components/pazesessioncompleterequest.js +78 -0
- package/models/components/pazesessioncompleterequest.js.map +1 -0
- package/models/components/pazeshippingaddress.d.ts +17 -3
- package/models/components/pazeshippingaddress.d.ts.map +1 -1
- package/models/components/pazeshippingaddress.js +18 -3
- package/models/components/pazeshippingaddress.js.map +1 -1
- package/models/components/pazetransactionoptions.d.ts +40 -0
- package/models/components/pazetransactionoptions.d.ts.map +1 -0
- package/models/components/pazetransactionoptions.js +65 -0
- package/models/components/pazetransactionoptions.js.map +1 -0
- package/models/components/pazetraveldata.d.ts +41 -0
- package/models/components/pazetraveldata.d.ts.map +1 -0
- package/models/components/pazetraveldata.js +55 -0
- package/models/components/pazetraveldata.js.map +1 -0
- package/models/components/transactioncapturecreate.d.ts +6 -0
- package/models/components/transactioncapturecreate.d.ts.map +1 -1
- package/models/components/transactioncapturecreate.js +7 -0
- package/models/components/transactioncapturecreate.js.map +1 -1
- package/models/operations/completepazemobilesession.d.ts +21 -0
- package/models/operations/completepazemobilesession.d.ts.map +1 -0
- package/models/operations/completepazemobilesession.js +56 -0
- package/models/operations/completepazemobilesession.js.map +1 -0
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/sessions.d.ts +7 -0
- package/sdk/sessions.d.ts.map +1 -1
- package/sdk/sessions.js +10 -0
- package/sdk/sessions.js.map +1 -1
- package/src/funcs/digitalWalletsSessionsPazeMobileSessionComplete.ts +232 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +7 -0
- package/src/models/components/pazebillingaddress.ts +8 -8
- package/src/models/components/pazedeliverycontactdetails.ts +24 -0
- package/src/models/components/pazeecomdata.ts +60 -0
- package/src/models/components/pazeenhancedtransactiondata.ts +52 -0
- package/src/models/components/pazelocationaddress.ts +76 -0
- package/src/models/components/pazemobilenumber.ts +22 -0
- package/src/models/components/pazesessioncomplete.ts +64 -0
- package/src/models/components/pazesessioncompleterequest.ts +133 -0
- package/src/models/components/pazeshippingaddress.ts +40 -4
- package/src/models/components/pazetransactionoptions.ts +82 -0
- package/src/models/components/pazetraveldata.ts +65 -0
- package/src/models/components/transactioncapturecreate.ts +16 -0
- package/src/models/operations/completepazemobilesession.ts +50 -0
- package/src/models/operations/index.ts +1 -0
- package/src/sdk/sessions.ts +20 -0
|
@@ -0,0 +1,232 @@
|
|
|
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 { matchStatusCode } from "../lib/http.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 * as components from "../models/components/index.js";
|
|
15
|
+
import { Gr4vyError } from "../models/errors/gr4vyerror.js";
|
|
16
|
+
import {
|
|
17
|
+
ConnectionError,
|
|
18
|
+
InvalidRequestError,
|
|
19
|
+
RequestAbortedError,
|
|
20
|
+
RequestTimeoutError,
|
|
21
|
+
UnexpectedClientError,
|
|
22
|
+
} from "../models/errors/httpclienterrors.js";
|
|
23
|
+
import * as errors from "../models/errors/index.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Complete a Paze session
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Complete a Paze checkout session and retrieve the secure payload required to settle the payment.
|
|
35
|
+
*/
|
|
36
|
+
export function digitalWalletsSessionsPazeMobileSessionComplete(
|
|
37
|
+
client: Gr4vyCore,
|
|
38
|
+
pazeSessionCompleteRequest: components.PazeSessionCompleteRequest,
|
|
39
|
+
merchantAccountId?: string | null | undefined,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
components.PazeSessionComplete,
|
|
44
|
+
| errors.Error400
|
|
45
|
+
| errors.Error401
|
|
46
|
+
| errors.Error403
|
|
47
|
+
| errors.Error404
|
|
48
|
+
| errors.Error405
|
|
49
|
+
| errors.Error409
|
|
50
|
+
| errors.HTTPValidationError
|
|
51
|
+
| errors.Error425
|
|
52
|
+
| errors.Error429
|
|
53
|
+
| errors.Error500
|
|
54
|
+
| errors.Error502
|
|
55
|
+
| errors.Error504
|
|
56
|
+
| Gr4vyError
|
|
57
|
+
| ResponseValidationError
|
|
58
|
+
| ConnectionError
|
|
59
|
+
| RequestAbortedError
|
|
60
|
+
| RequestTimeoutError
|
|
61
|
+
| InvalidRequestError
|
|
62
|
+
| UnexpectedClientError
|
|
63
|
+
| SDKValidationError
|
|
64
|
+
>
|
|
65
|
+
> {
|
|
66
|
+
return new APIPromise($do(
|
|
67
|
+
client,
|
|
68
|
+
pazeSessionCompleteRequest,
|
|
69
|
+
merchantAccountId,
|
|
70
|
+
options,
|
|
71
|
+
));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function $do(
|
|
75
|
+
client: Gr4vyCore,
|
|
76
|
+
pazeSessionCompleteRequest: components.PazeSessionCompleteRequest,
|
|
77
|
+
merchantAccountId?: string | null | undefined,
|
|
78
|
+
options?: RequestOptions,
|
|
79
|
+
): Promise<
|
|
80
|
+
[
|
|
81
|
+
Result<
|
|
82
|
+
components.PazeSessionComplete,
|
|
83
|
+
| errors.Error400
|
|
84
|
+
| errors.Error401
|
|
85
|
+
| errors.Error403
|
|
86
|
+
| errors.Error404
|
|
87
|
+
| errors.Error405
|
|
88
|
+
| errors.Error409
|
|
89
|
+
| errors.HTTPValidationError
|
|
90
|
+
| errors.Error425
|
|
91
|
+
| errors.Error429
|
|
92
|
+
| errors.Error500
|
|
93
|
+
| errors.Error502
|
|
94
|
+
| errors.Error504
|
|
95
|
+
| Gr4vyError
|
|
96
|
+
| ResponseValidationError
|
|
97
|
+
| ConnectionError
|
|
98
|
+
| RequestAbortedError
|
|
99
|
+
| RequestTimeoutError
|
|
100
|
+
| InvalidRequestError
|
|
101
|
+
| UnexpectedClientError
|
|
102
|
+
| SDKValidationError
|
|
103
|
+
>,
|
|
104
|
+
APICall,
|
|
105
|
+
]
|
|
106
|
+
> {
|
|
107
|
+
const input: operations.CompletePazeMobileSessionRequest = {
|
|
108
|
+
pazeSessionCompleteRequest: pazeSessionCompleteRequest,
|
|
109
|
+
merchantAccountId: merchantAccountId,
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const parsed = safeParse(
|
|
113
|
+
input,
|
|
114
|
+
(value) =>
|
|
115
|
+
operations.CompletePazeMobileSessionRequest$outboundSchema.parse(value),
|
|
116
|
+
"Input validation failed",
|
|
117
|
+
);
|
|
118
|
+
if (!parsed.ok) {
|
|
119
|
+
return [parsed, { status: "invalid" }];
|
|
120
|
+
}
|
|
121
|
+
const payload = parsed.value;
|
|
122
|
+
const body = encodeJSON("body", payload.PazeSessionCompleteRequest, {
|
|
123
|
+
explode: true,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const path = pathToFunc("/digital-wallets/paze/session/complete")();
|
|
127
|
+
|
|
128
|
+
const headers = new Headers(compactMap({
|
|
129
|
+
"Content-Type": "application/json",
|
|
130
|
+
Accept: "application/json",
|
|
131
|
+
"x-gr4vy-merchant-account-id": encodeSimple(
|
|
132
|
+
"x-gr4vy-merchant-account-id",
|
|
133
|
+
payload.merchantAccountId ?? client._options.merchantAccountId,
|
|
134
|
+
{ explode: false, charEncoding: "none" },
|
|
135
|
+
),
|
|
136
|
+
}));
|
|
137
|
+
|
|
138
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
139
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
140
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
141
|
+
|
|
142
|
+
const context = {
|
|
143
|
+
options: client._options,
|
|
144
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
145
|
+
operationID: "complete_paze_mobile_session",
|
|
146
|
+
oAuth2Scopes: null,
|
|
147
|
+
|
|
148
|
+
resolvedSecurity: requestSecurity,
|
|
149
|
+
|
|
150
|
+
securitySource: client._options.bearerAuth,
|
|
151
|
+
retryConfig: options?.retries
|
|
152
|
+
|| client._options.retryConfig
|
|
153
|
+
|| { strategy: "none" },
|
|
154
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const requestRes = client._createRequest(context, {
|
|
158
|
+
security: requestSecurity,
|
|
159
|
+
method: "POST",
|
|
160
|
+
baseURL: options?.serverURL,
|
|
161
|
+
path: path,
|
|
162
|
+
headers: headers,
|
|
163
|
+
body: body,
|
|
164
|
+
userAgent: client._options.userAgent,
|
|
165
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
166
|
+
}, options);
|
|
167
|
+
if (!requestRes.ok) {
|
|
168
|
+
return [requestRes, { status: "invalid" }];
|
|
169
|
+
}
|
|
170
|
+
const req = requestRes.value;
|
|
171
|
+
|
|
172
|
+
const doResult = await client._do(req, {
|
|
173
|
+
context,
|
|
174
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
175
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
176
|
+
retryConfig: context.retryConfig,
|
|
177
|
+
retryCodes: context.retryCodes,
|
|
178
|
+
});
|
|
179
|
+
if (!doResult.ok) {
|
|
180
|
+
return [doResult, { status: "request-error", request: req }];
|
|
181
|
+
}
|
|
182
|
+
const response = doResult.value;
|
|
183
|
+
|
|
184
|
+
const responseFields = {
|
|
185
|
+
HttpMeta: { Response: response, Request: req },
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const [result] = await M.match<
|
|
189
|
+
components.PazeSessionComplete,
|
|
190
|
+
| errors.Error400
|
|
191
|
+
| errors.Error401
|
|
192
|
+
| errors.Error403
|
|
193
|
+
| errors.Error404
|
|
194
|
+
| errors.Error405
|
|
195
|
+
| errors.Error409
|
|
196
|
+
| errors.HTTPValidationError
|
|
197
|
+
| errors.Error425
|
|
198
|
+
| errors.Error429
|
|
199
|
+
| errors.Error500
|
|
200
|
+
| errors.Error502
|
|
201
|
+
| errors.Error504
|
|
202
|
+
| Gr4vyError
|
|
203
|
+
| ResponseValidationError
|
|
204
|
+
| ConnectionError
|
|
205
|
+
| RequestAbortedError
|
|
206
|
+
| RequestTimeoutError
|
|
207
|
+
| InvalidRequestError
|
|
208
|
+
| UnexpectedClientError
|
|
209
|
+
| SDKValidationError
|
|
210
|
+
>(
|
|
211
|
+
M.json(200, components.PazeSessionComplete$inboundSchema),
|
|
212
|
+
M.jsonErr(400, errors.Error400$inboundSchema),
|
|
213
|
+
M.jsonErr(401, errors.Error401$inboundSchema),
|
|
214
|
+
M.jsonErr(403, errors.Error403$inboundSchema),
|
|
215
|
+
M.jsonErr(404, errors.Error404$inboundSchema),
|
|
216
|
+
M.jsonErr(405, errors.Error405$inboundSchema),
|
|
217
|
+
M.jsonErr(409, errors.Error409$inboundSchema),
|
|
218
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
219
|
+
M.jsonErr(425, errors.Error425$inboundSchema),
|
|
220
|
+
M.jsonErr(429, errors.Error429$inboundSchema),
|
|
221
|
+
M.jsonErr(500, errors.Error500$inboundSchema),
|
|
222
|
+
M.jsonErr(502, errors.Error502$inboundSchema),
|
|
223
|
+
M.jsonErr(504, errors.Error504$inboundSchema),
|
|
224
|
+
M.fail("4XX"),
|
|
225
|
+
M.fail("5XX"),
|
|
226
|
+
)(response, req, { extraFields: responseFields });
|
|
227
|
+
if (!result.ok) {
|
|
228
|
+
return [result, { status: "complete", request: req, response }];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return [result, { status: "complete", request: req, response }];
|
|
232
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -77,7 +77,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
77
77
|
export const SDK_METADATA = {
|
|
78
78
|
language: "typescript",
|
|
79
79
|
openapiDocVersion: "1.0.0",
|
|
80
|
-
sdkVersion: "2.0
|
|
81
|
-
genVersion: "2.
|
|
82
|
-
userAgent: "speakeasy-sdk/typescript 2.0
|
|
80
|
+
sdkVersion: "2.1.0",
|
|
81
|
+
genVersion: "2.889.1",
|
|
82
|
+
userAgent: "speakeasy-sdk/typescript 2.1.0 2.889.1 1.0.0 @gr4vy/sdk",
|
|
83
83
|
} as const;
|
|
@@ -213,18 +213,25 @@ export * from "./pazecobranditem.js";
|
|
|
213
213
|
export * from "./pazeconsumer.js";
|
|
214
214
|
export * from "./pazedeliverycontactdetails.js";
|
|
215
215
|
export * from "./pazedigitalcarddata.js";
|
|
216
|
+
export * from "./pazeecomdata.js";
|
|
217
|
+
export * from "./pazeenhancedtransactiondata.js";
|
|
218
|
+
export * from "./pazelocationaddress.js";
|
|
216
219
|
export * from "./pazemaskedcard.js";
|
|
217
220
|
export * from "./pazemobilenumber.js";
|
|
218
221
|
export * from "./pazemobilesession.js";
|
|
219
222
|
export * from "./pazemobilesessioncreate.js";
|
|
220
223
|
export * from "./pazemobilesessioncreaterequest.js";
|
|
221
224
|
export * from "./pazepaymentmethodcreate.js";
|
|
225
|
+
export * from "./pazesessioncomplete.js";
|
|
226
|
+
export * from "./pazesessioncompleterequest.js";
|
|
222
227
|
export * from "./pazesessionrequest.js";
|
|
223
228
|
export * from "./pazesessionreview.js";
|
|
224
229
|
export * from "./pazesessionreviewlinks.js";
|
|
225
230
|
export * from "./pazesessionreviewrequest.js";
|
|
226
231
|
export * from "./pazeshippingaddress.js";
|
|
232
|
+
export * from "./pazetransactionoptions.js";
|
|
227
233
|
export * from "./pazetransactionvalue.js";
|
|
234
|
+
export * from "./pazetraveldata.js";
|
|
228
235
|
export * from "./pazewebsession.js";
|
|
229
236
|
export * from "./plaidpaymentmethodcreate.js";
|
|
230
237
|
export * from "./powertranzoptions.js";
|
|
@@ -11,7 +11,7 @@ export type PazeBillingAddress = {
|
|
|
11
11
|
/**
|
|
12
12
|
* Name of the organization or entity at the address.
|
|
13
13
|
*/
|
|
14
|
-
name
|
|
14
|
+
name?: string | null | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Line 1 of the address.
|
|
17
17
|
*/
|
|
@@ -19,11 +19,11 @@ export type PazeBillingAddress = {
|
|
|
19
19
|
/**
|
|
20
20
|
* Line 2 of the address.
|
|
21
21
|
*/
|
|
22
|
-
line2
|
|
22
|
+
line2?: string | null | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* Line 3 of the address.
|
|
25
25
|
*/
|
|
26
|
-
line3
|
|
26
|
+
line3?: string | null | undefined;
|
|
27
27
|
/**
|
|
28
28
|
* City.
|
|
29
29
|
*/
|
|
@@ -39,7 +39,7 @@ export type PazeBillingAddress = {
|
|
|
39
39
|
/**
|
|
40
40
|
* ISO 3166-1 alpha-2 country code.
|
|
41
41
|
*/
|
|
42
|
-
countryCode
|
|
42
|
+
countryCode?: string | null | undefined;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/** @internal */
|
|
@@ -48,14 +48,14 @@ export const PazeBillingAddress$inboundSchema: z.ZodType<
|
|
|
48
48
|
z.ZodTypeDef,
|
|
49
49
|
unknown
|
|
50
50
|
> = z.object({
|
|
51
|
-
name: z.nullable(z.string()),
|
|
51
|
+
name: z.nullable(z.string()).optional(),
|
|
52
52
|
line1: z.string(),
|
|
53
|
-
line2: z.nullable(z.string()),
|
|
54
|
-
line3: z.nullable(z.string()),
|
|
53
|
+
line2: z.nullable(z.string()).optional(),
|
|
54
|
+
line3: z.nullable(z.string()).optional(),
|
|
55
55
|
city: z.string(),
|
|
56
56
|
state: z.string(),
|
|
57
57
|
zip: z.string(),
|
|
58
|
-
countryCode: z.nullable(z.string()),
|
|
58
|
+
countryCode: z.nullable(z.string()).optional(),
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
export function pazeBillingAddressFromJSON(
|
|
@@ -9,6 +9,8 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
9
9
|
import {
|
|
10
10
|
PazeMobileNumber,
|
|
11
11
|
PazeMobileNumber$inboundSchema,
|
|
12
|
+
PazeMobileNumber$Outbound,
|
|
13
|
+
PazeMobileNumber$outboundSchema,
|
|
12
14
|
} from "./pazemobilenumber.js";
|
|
13
15
|
|
|
14
16
|
export type PazeDeliveryContactDetails = {
|
|
@@ -28,7 +30,29 @@ export const PazeDeliveryContactDetails$inboundSchema: z.ZodType<
|
|
|
28
30
|
contactFullName: z.nullable(z.string()),
|
|
29
31
|
contactPhoneNumber: z.nullable(PazeMobileNumber$inboundSchema),
|
|
30
32
|
});
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type PazeDeliveryContactDetails$Outbound = {
|
|
35
|
+
contactFullName: string | null;
|
|
36
|
+
contactPhoneNumber: PazeMobileNumber$Outbound | null;
|
|
37
|
+
};
|
|
31
38
|
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const PazeDeliveryContactDetails$outboundSchema: z.ZodType<
|
|
41
|
+
PazeDeliveryContactDetails$Outbound,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
PazeDeliveryContactDetails
|
|
44
|
+
> = z.object({
|
|
45
|
+
contactFullName: z.nullable(z.string()),
|
|
46
|
+
contactPhoneNumber: z.nullable(PazeMobileNumber$outboundSchema),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export function pazeDeliveryContactDetailsToJSON(
|
|
50
|
+
pazeDeliveryContactDetails: PazeDeliveryContactDetails,
|
|
51
|
+
): string {
|
|
52
|
+
return JSON.stringify(
|
|
53
|
+
PazeDeliveryContactDetails$outboundSchema.parse(pazeDeliveryContactDetails),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
32
56
|
export function pazeDeliveryContactDetailsFromJSON(
|
|
33
57
|
jsonString: string,
|
|
34
58
|
): SafeParseResult<PazeDeliveryContactDetails, SDKValidationError> {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import {
|
|
7
|
+
PazeShippingAddress,
|
|
8
|
+
PazeShippingAddress$Outbound,
|
|
9
|
+
PazeShippingAddress$outboundSchema,
|
|
10
|
+
} from "./pazeshippingaddress.js";
|
|
11
|
+
|
|
12
|
+
export type PazeEcomData = {
|
|
13
|
+
/**
|
|
14
|
+
* Whether the current transaction includes a gift card purchase.
|
|
15
|
+
*/
|
|
16
|
+
cartContainsGiftCard?: boolean | null | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the consumer order will be picked up rather than shipped.
|
|
19
|
+
*/
|
|
20
|
+
orderForPickup?: boolean | null | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Dollar value of the most expensive item ordered.
|
|
23
|
+
*/
|
|
24
|
+
orderHighestCost?: string | null | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Number of items ordered.
|
|
27
|
+
*/
|
|
28
|
+
orderQuantity?: string | null | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The selected shipping address. Returned only when `shippingPreference` is not `NONE`.
|
|
31
|
+
*/
|
|
32
|
+
finalShippingAddress?: PazeShippingAddress | null | undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export type PazeEcomData$Outbound = {
|
|
37
|
+
cartContainsGiftCard?: boolean | null | undefined;
|
|
38
|
+
orderForPickup?: boolean | null | undefined;
|
|
39
|
+
orderHighestCost?: string | null | undefined;
|
|
40
|
+
orderQuantity?: string | null | undefined;
|
|
41
|
+
finalShippingAddress?: PazeShippingAddress$Outbound | null | undefined;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const PazeEcomData$outboundSchema: z.ZodType<
|
|
46
|
+
PazeEcomData$Outbound,
|
|
47
|
+
z.ZodTypeDef,
|
|
48
|
+
PazeEcomData
|
|
49
|
+
> = z.object({
|
|
50
|
+
cartContainsGiftCard: z.nullable(z.boolean()).optional(),
|
|
51
|
+
orderForPickup: z.nullable(z.boolean()).optional(),
|
|
52
|
+
orderHighestCost: z.nullable(z.string()).optional(),
|
|
53
|
+
orderQuantity: z.nullable(z.string()).optional(),
|
|
54
|
+
finalShippingAddress: z.nullable(PazeShippingAddress$outboundSchema)
|
|
55
|
+
.optional(),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export function pazeEcomDataToJSON(pazeEcomData: PazeEcomData): string {
|
|
59
|
+
return JSON.stringify(PazeEcomData$outboundSchema.parse(pazeEcomData));
|
|
60
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import {
|
|
7
|
+
PazeEcomData,
|
|
8
|
+
PazeEcomData$Outbound,
|
|
9
|
+
PazeEcomData$outboundSchema,
|
|
10
|
+
} from "./pazeecomdata.js";
|
|
11
|
+
import {
|
|
12
|
+
PazeTravelData,
|
|
13
|
+
PazeTravelData$Outbound,
|
|
14
|
+
PazeTravelData$outboundSchema,
|
|
15
|
+
} from "./pazetraveldata.js";
|
|
16
|
+
|
|
17
|
+
export type PazeEnhancedTransactionData = {
|
|
18
|
+
/**
|
|
19
|
+
* Details pertaining to electronic commerce purchases.
|
|
20
|
+
*/
|
|
21
|
+
ecomData?: PazeEcomData | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Details pertaining to travel bookings.
|
|
24
|
+
*/
|
|
25
|
+
travelData?: PazeTravelData | null | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type PazeEnhancedTransactionData$Outbound = {
|
|
30
|
+
ecomData?: PazeEcomData$Outbound | null | undefined;
|
|
31
|
+
travelData?: PazeTravelData$Outbound | null | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const PazeEnhancedTransactionData$outboundSchema: z.ZodType<
|
|
36
|
+
PazeEnhancedTransactionData$Outbound,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
PazeEnhancedTransactionData
|
|
39
|
+
> = z.object({
|
|
40
|
+
ecomData: z.nullable(PazeEcomData$outboundSchema).optional(),
|
|
41
|
+
travelData: z.nullable(PazeTravelData$outboundSchema).optional(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export function pazeEnhancedTransactionDataToJSON(
|
|
45
|
+
pazeEnhancedTransactionData: PazeEnhancedTransactionData,
|
|
46
|
+
): string {
|
|
47
|
+
return JSON.stringify(
|
|
48
|
+
PazeEnhancedTransactionData$outboundSchema.parse(
|
|
49
|
+
pazeEnhancedTransactionData,
|
|
50
|
+
),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 PazeLocationAddress = {
|
|
8
|
+
/**
|
|
9
|
+
* Name of the organization or entity at the address.
|
|
10
|
+
*/
|
|
11
|
+
name?: string | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Line 1 of the address.
|
|
14
|
+
*/
|
|
15
|
+
line1: string;
|
|
16
|
+
/**
|
|
17
|
+
* Line 2 of the address.
|
|
18
|
+
*/
|
|
19
|
+
line2?: string | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Line 3 of the address.
|
|
22
|
+
*/
|
|
23
|
+
line3?: string | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* City.
|
|
26
|
+
*/
|
|
27
|
+
city: string;
|
|
28
|
+
/**
|
|
29
|
+
* State or region.
|
|
30
|
+
*/
|
|
31
|
+
state: string;
|
|
32
|
+
/**
|
|
33
|
+
* Postal code.
|
|
34
|
+
*/
|
|
35
|
+
zip: string;
|
|
36
|
+
/**
|
|
37
|
+
* ISO 3166-1 alpha-2 country code.
|
|
38
|
+
*/
|
|
39
|
+
countryCode: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export type PazeLocationAddress$Outbound = {
|
|
44
|
+
name?: string | null | undefined;
|
|
45
|
+
line1: string;
|
|
46
|
+
line2?: string | null | undefined;
|
|
47
|
+
line3?: string | null | undefined;
|
|
48
|
+
city: string;
|
|
49
|
+
state: string;
|
|
50
|
+
zip: string;
|
|
51
|
+
countryCode: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export const PazeLocationAddress$outboundSchema: z.ZodType<
|
|
56
|
+
PazeLocationAddress$Outbound,
|
|
57
|
+
z.ZodTypeDef,
|
|
58
|
+
PazeLocationAddress
|
|
59
|
+
> = z.object({
|
|
60
|
+
name: z.nullable(z.string()).optional(),
|
|
61
|
+
line1: z.string(),
|
|
62
|
+
line2: z.nullable(z.string()).optional(),
|
|
63
|
+
line3: z.nullable(z.string()).optional(),
|
|
64
|
+
city: z.string(),
|
|
65
|
+
state: z.string(),
|
|
66
|
+
zip: z.string(),
|
|
67
|
+
countryCode: z.string(),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export function pazeLocationAddressToJSON(
|
|
71
|
+
pazeLocationAddress: PazeLocationAddress,
|
|
72
|
+
): string {
|
|
73
|
+
return JSON.stringify(
|
|
74
|
+
PazeLocationAddress$outboundSchema.parse(pazeLocationAddress),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -27,7 +27,29 @@ export const PazeMobileNumber$inboundSchema: z.ZodType<
|
|
|
27
27
|
countryCode: z.string(),
|
|
28
28
|
phoneNumber: z.string(),
|
|
29
29
|
});
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type PazeMobileNumber$Outbound = {
|
|
32
|
+
countryCode: string;
|
|
33
|
+
phoneNumber: string;
|
|
34
|
+
};
|
|
30
35
|
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const PazeMobileNumber$outboundSchema: z.ZodType<
|
|
38
|
+
PazeMobileNumber$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
PazeMobileNumber
|
|
41
|
+
> = z.object({
|
|
42
|
+
countryCode: z.string(),
|
|
43
|
+
phoneNumber: z.string(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export function pazeMobileNumberToJSON(
|
|
47
|
+
pazeMobileNumber: PazeMobileNumber,
|
|
48
|
+
): string {
|
|
49
|
+
return JSON.stringify(
|
|
50
|
+
PazeMobileNumber$outboundSchema.parse(pazeMobileNumber),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
31
53
|
export function pazeMobileNumberFromJSON(
|
|
32
54
|
jsonString: string,
|
|
33
55
|
): SafeParseResult<PazeMobileNumber, SDKValidationError> {
|
|
@@ -0,0 +1,64 @@
|
|
|
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 PazeSessionComplete = {
|
|
12
|
+
/**
|
|
13
|
+
* Unique identifier generated by Paze to track and link the wallet transaction. Used as the wallet transaction identifier.
|
|
14
|
+
*/
|
|
15
|
+
payloadId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Opaque token returned by Paze for the completion call.
|
|
18
|
+
*/
|
|
19
|
+
completeResponse: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Signed and encrypted payload containing the data necessary to process the payment. Returned when `payloadTypeIndicator` is PAYMENT.
|
|
22
|
+
*/
|
|
23
|
+
securePayload: string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Echo of the `clientContext` sent on the request. Returned by Paze for client-side tracing.
|
|
26
|
+
*/
|
|
27
|
+
clientContext: string;
|
|
28
|
+
/**
|
|
29
|
+
* Paze-issued session identifier returned for tracing.
|
|
30
|
+
*/
|
|
31
|
+
ewSID: string;
|
|
32
|
+
/**
|
|
33
|
+
* Server timestamp of the Paze response in ISO 8601 format. Returned for tracing.
|
|
34
|
+
*/
|
|
35
|
+
timestampIso8601: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const PazeSessionComplete$inboundSchema: z.ZodType<
|
|
40
|
+
PazeSessionComplete,
|
|
41
|
+
z.ZodTypeDef,
|
|
42
|
+
unknown
|
|
43
|
+
> = z.object({
|
|
44
|
+
payloadId: z.string(),
|
|
45
|
+
completeResponse: z.nullable(z.string()),
|
|
46
|
+
securePayload: z.nullable(z.string()),
|
|
47
|
+
clientContext: z.string(),
|
|
48
|
+
ewSID: z.string(),
|
|
49
|
+
timestampISO8601: z.string(),
|
|
50
|
+
}).transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
"timestampISO8601": "timestampIso8601",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export function pazeSessionCompleteFromJSON(
|
|
57
|
+
jsonString: string,
|
|
58
|
+
): SafeParseResult<PazeSessionComplete, SDKValidationError> {
|
|
59
|
+
return safeParse(
|
|
60
|
+
jsonString,
|
|
61
|
+
(x) => PazeSessionComplete$inboundSchema.parse(JSON.parse(x)),
|
|
62
|
+
`Failed to parse 'PazeSessionComplete' from JSON`,
|
|
63
|
+
);
|
|
64
|
+
}
|