@gr4vy/sdk 1.1.28 → 1.1.30

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.
Files changed (63) hide show
  1. package/FUNCTIONS.md +9 -9
  2. package/README.md +91 -61
  3. package/docs/sdks/all/README.md +9 -13
  4. package/docs/sdks/auditlogs/README.md +9 -13
  5. package/docs/sdks/balances/README.md +9 -13
  6. package/docs/sdks/buyers/README.md +45 -65
  7. package/docs/sdks/cardschemedefinitions/README.md +9 -13
  8. package/docs/sdks/checkoutsessions/README.md +36 -52
  9. package/docs/sdks/cryptogram/README.md +9 -13
  10. package/docs/sdks/digitalwallets/README.md +45 -65
  11. package/docs/sdks/domains/README.md +18 -26
  12. package/docs/sdks/events/README.md +9 -13
  13. package/docs/sdks/executions/README.md +27 -39
  14. package/docs/sdks/giftcards/README.md +36 -52
  15. package/docs/sdks/gr4vy/README.md +0 -83
  16. package/docs/sdks/gr4vygiftcards/README.md +9 -13
  17. package/docs/sdks/gr4vypaymentmethods/README.md +9 -13
  18. package/docs/sdks/gr4vyrefunds/README.md +27 -39
  19. package/docs/sdks/jobs/README.md +9 -13
  20. package/docs/sdks/merchantaccounts/README.md +36 -48
  21. package/docs/sdks/networktokens/README.md +45 -65
  22. package/docs/sdks/paymentlinks/README.md +36 -52
  23. package/docs/sdks/paymentmethods/README.md +36 -52
  24. package/docs/sdks/paymentoptions/README.md +9 -13
  25. package/docs/sdks/paymentservicedefinitions/README.md +27 -36
  26. package/docs/sdks/paymentservices/README.md +63 -91
  27. package/docs/sdks/paymentservicetokens/README.md +27 -39
  28. package/docs/sdks/payouts/README.md +27 -39
  29. package/docs/sdks/refunds/README.md +9 -13
  30. package/docs/sdks/reportexecutions/README.md +9 -13
  31. package/docs/sdks/reports/README.md +36 -52
  32. package/docs/sdks/sessions/README.md +27 -38
  33. package/docs/sdks/settlements/README.md +18 -26
  34. package/docs/sdks/shippingdetails/README.md +45 -65
  35. package/docs/sdks/transactions/README.md +63 -91
  36. package/examples/accountUpdaterJobsCreate.example.ts +37 -0
  37. package/examples/package-lock.json +2716 -0
  38. package/jsr.json +1 -1
  39. package/lib/config.d.ts +3 -3
  40. package/lib/config.js +3 -3
  41. package/models/operations/index.d.ts +0 -1
  42. package/models/operations/index.d.ts.map +1 -1
  43. package/models/operations/index.js +0 -1
  44. package/models/operations/index.js.map +1 -1
  45. package/package.json +1 -1
  46. package/sdk/sdk.d.ts +1 -5
  47. package/sdk/sdk.d.ts.map +1 -1
  48. package/sdk/sdk.js +0 -8
  49. package/sdk/sdk.js.map +1 -1
  50. package/src/lib/config.ts +3 -3
  51. package/src/models/operations/index.ts +0 -1
  52. package/src/sdk/sdk.ts +1 -17
  53. package/examples/browsePaymentMethodDefinitionsGet.example.ts +0 -27
  54. package/funcs/browsePaymentMethodDefinitionsGet.d.ts +0 -14
  55. package/funcs/browsePaymentMethodDefinitionsGet.d.ts.map +0 -1
  56. package/funcs/browsePaymentMethodDefinitionsGet.js +0 -130
  57. package/funcs/browsePaymentMethodDefinitionsGet.js.map +0 -1
  58. package/models/operations/browsepaymentmethoddefinitionsget.d.ts +0 -57
  59. package/models/operations/browsepaymentmethoddefinitionsget.d.ts.map +0 -1
  60. package/models/operations/browsepaymentmethoddefinitionsget.js +0 -96
  61. package/models/operations/browsepaymentmethoddefinitionsget.js.map +0 -1
  62. package/src/funcs/browsePaymentMethodDefinitionsGet.ts +0 -188
  63. package/src/models/operations/browsepaymentmethoddefinitionsget.ts +0 -149
@@ -1,188 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
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
- * Browse
31
- */
32
- export function browsePaymentMethodDefinitionsGet(
33
- client: Gr4vyCore,
34
- merchantAccountId?: string | null | undefined,
35
- options?: RequestOptions,
36
- ): APIPromise<
37
- Result<
38
- any,
39
- | errors.HTTPValidationError
40
- | Gr4vyError
41
- | ResponseValidationError
42
- | ConnectionError
43
- | RequestAbortedError
44
- | RequestTimeoutError
45
- | InvalidRequestError
46
- | UnexpectedClientError
47
- | SDKValidationError
48
- >
49
- > {
50
- return new APIPromise($do(
51
- client,
52
- merchantAccountId,
53
- options,
54
- ));
55
- }
56
-
57
- async function $do(
58
- client: Gr4vyCore,
59
- merchantAccountId?: string | null | undefined,
60
- options?: RequestOptions,
61
- ): Promise<
62
- [
63
- Result<
64
- any,
65
- | errors.HTTPValidationError
66
- | Gr4vyError
67
- | ResponseValidationError
68
- | ConnectionError
69
- | RequestAbortedError
70
- | RequestTimeoutError
71
- | InvalidRequestError
72
- | UnexpectedClientError
73
- | SDKValidationError
74
- >,
75
- APICall,
76
- ]
77
- > {
78
- const input: operations.BrowsePaymentMethodDefinitionsGetRequest | undefined =
79
- {
80
- merchantAccountId: merchantAccountId,
81
- };
82
-
83
- const parsed = safeParse(
84
- input,
85
- (value) =>
86
- operations.BrowsePaymentMethodDefinitionsGetRequest$outboundSchema
87
- .optional().parse(value),
88
- "Input validation failed",
89
- );
90
- if (!parsed.ok) {
91
- return [parsed, { status: "invalid" }];
92
- }
93
- const payload = parsed.value;
94
- const body = null;
95
-
96
- const path = pathToFunc("/payment-method-definitions")();
97
-
98
- const headers = new Headers(compactMap({
99
- Accept: "application/json",
100
- "x-gr4vy-merchant-account-id": encodeSimple(
101
- "x-gr4vy-merchant-account-id",
102
- payload?.merchantAccountId ?? client._options.merchantAccountId,
103
- { explode: false, charEncoding: "none" },
104
- ),
105
- }));
106
-
107
- const secConfig = await extractSecurity(client._options.bearerAuth);
108
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
109
- const requestSecurity = resolveGlobalSecurity(securityInput);
110
-
111
- const context = {
112
- options: client._options,
113
- baseURL: options?.serverURL ?? client._baseURL ?? "",
114
- operationID: "browse_payment_method_definitions_get",
115
- oAuth2Scopes: [],
116
-
117
- resolvedSecurity: requestSecurity,
118
-
119
- securitySource: client._options.bearerAuth,
120
- retryConfig: options?.retries
121
- || client._options.retryConfig
122
- || {
123
- strategy: "backoff",
124
- backoff: {
125
- initialInterval: 200,
126
- maxInterval: 200,
127
- exponent: 1,
128
- maxElapsedTime: 1000,
129
- },
130
- retryConnectionErrors: true,
131
- }
132
- || { strategy: "none" },
133
- retryCodes: options?.retryCodes || ["5XX"],
134
- };
135
-
136
- const requestRes = client._createRequest(context, {
137
- security: requestSecurity,
138
- method: "GET",
139
- baseURL: options?.serverURL,
140
- path: path,
141
- headers: headers,
142
- body: body,
143
- userAgent: client._options.userAgent,
144
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
145
- }, options);
146
- if (!requestRes.ok) {
147
- return [requestRes, { status: "invalid" }];
148
- }
149
- const req = requestRes.value;
150
-
151
- const doResult = await client._do(req, {
152
- context,
153
- errorCodes: ["422", "4XX", "5XX"],
154
- retryConfig: context.retryConfig,
155
- retryCodes: context.retryCodes,
156
- });
157
- if (!doResult.ok) {
158
- return [doResult, { status: "request-error", request: req }];
159
- }
160
- const response = doResult.value;
161
-
162
- const responseFields = {
163
- HttpMeta: { Response: response, Request: req },
164
- };
165
-
166
- const [result] = await M.match<
167
- any,
168
- | errors.HTTPValidationError
169
- | Gr4vyError
170
- | ResponseValidationError
171
- | ConnectionError
172
- | RequestAbortedError
173
- | RequestTimeoutError
174
- | InvalidRequestError
175
- | UnexpectedClientError
176
- | SDKValidationError
177
- >(
178
- M.json(200, z.any()),
179
- M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
180
- M.fail("4XX"),
181
- M.fail("5XX"),
182
- )(response, req, { extraFields: responseFields });
183
- if (!result.ok) {
184
- return [result, { status: "complete", request: req, response }];
185
- }
186
-
187
- return [result, { status: "complete", request: req, response }];
188
- }
@@ -1,149 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
-
10
- export type BrowsePaymentMethodDefinitionsGetGlobals = {
11
- merchantAccountId?: string | undefined;
12
- };
13
-
14
- export type BrowsePaymentMethodDefinitionsGetRequest = {
15
- /**
16
- * The ID of the merchant account to use for this request.
17
- */
18
- merchantAccountId?: string | null | undefined;
19
- };
20
-
21
- /** @internal */
22
- export const BrowsePaymentMethodDefinitionsGetGlobals$inboundSchema: z.ZodType<
23
- BrowsePaymentMethodDefinitionsGetGlobals,
24
- z.ZodTypeDef,
25
- unknown
26
- > = z.object({
27
- merchantAccountId: z.string().optional(),
28
- });
29
-
30
- /** @internal */
31
- export type BrowsePaymentMethodDefinitionsGetGlobals$Outbound = {
32
- merchantAccountId?: string | undefined;
33
- };
34
-
35
- /** @internal */
36
- export const BrowsePaymentMethodDefinitionsGetGlobals$outboundSchema: z.ZodType<
37
- BrowsePaymentMethodDefinitionsGetGlobals$Outbound,
38
- z.ZodTypeDef,
39
- BrowsePaymentMethodDefinitionsGetGlobals
40
- > = z.object({
41
- merchantAccountId: z.string().optional(),
42
- });
43
-
44
- /**
45
- * @internal
46
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
47
- */
48
- export namespace BrowsePaymentMethodDefinitionsGetGlobals$ {
49
- /** @deprecated use `BrowsePaymentMethodDefinitionsGetGlobals$inboundSchema` instead. */
50
- export const inboundSchema =
51
- BrowsePaymentMethodDefinitionsGetGlobals$inboundSchema;
52
- /** @deprecated use `BrowsePaymentMethodDefinitionsGetGlobals$outboundSchema` instead. */
53
- export const outboundSchema =
54
- BrowsePaymentMethodDefinitionsGetGlobals$outboundSchema;
55
- /** @deprecated use `BrowsePaymentMethodDefinitionsGetGlobals$Outbound` instead. */
56
- export type Outbound = BrowsePaymentMethodDefinitionsGetGlobals$Outbound;
57
- }
58
-
59
- export function browsePaymentMethodDefinitionsGetGlobalsToJSON(
60
- browsePaymentMethodDefinitionsGetGlobals:
61
- BrowsePaymentMethodDefinitionsGetGlobals,
62
- ): string {
63
- return JSON.stringify(
64
- BrowsePaymentMethodDefinitionsGetGlobals$outboundSchema.parse(
65
- browsePaymentMethodDefinitionsGetGlobals,
66
- ),
67
- );
68
- }
69
-
70
- export function browsePaymentMethodDefinitionsGetGlobalsFromJSON(
71
- jsonString: string,
72
- ): SafeParseResult<
73
- BrowsePaymentMethodDefinitionsGetGlobals,
74
- SDKValidationError
75
- > {
76
- return safeParse(
77
- jsonString,
78
- (x) =>
79
- BrowsePaymentMethodDefinitionsGetGlobals$inboundSchema.parse(
80
- JSON.parse(x),
81
- ),
82
- `Failed to parse 'BrowsePaymentMethodDefinitionsGetGlobals' from JSON`,
83
- );
84
- }
85
-
86
- /** @internal */
87
- export const BrowsePaymentMethodDefinitionsGetRequest$inboundSchema: z.ZodType<
88
- BrowsePaymentMethodDefinitionsGetRequest,
89
- z.ZodTypeDef,
90
- unknown
91
- > = z.object({
92
- merchantAccountId: z.nullable(z.string()).optional(),
93
- });
94
-
95
- /** @internal */
96
- export type BrowsePaymentMethodDefinitionsGetRequest$Outbound = {
97
- merchantAccountId?: string | null | undefined;
98
- };
99
-
100
- /** @internal */
101
- export const BrowsePaymentMethodDefinitionsGetRequest$outboundSchema: z.ZodType<
102
- BrowsePaymentMethodDefinitionsGetRequest$Outbound,
103
- z.ZodTypeDef,
104
- BrowsePaymentMethodDefinitionsGetRequest
105
- > = z.object({
106
- merchantAccountId: z.nullable(z.string()).optional(),
107
- });
108
-
109
- /**
110
- * @internal
111
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
112
- */
113
- export namespace BrowsePaymentMethodDefinitionsGetRequest$ {
114
- /** @deprecated use `BrowsePaymentMethodDefinitionsGetRequest$inboundSchema` instead. */
115
- export const inboundSchema =
116
- BrowsePaymentMethodDefinitionsGetRequest$inboundSchema;
117
- /** @deprecated use `BrowsePaymentMethodDefinitionsGetRequest$outboundSchema` instead. */
118
- export const outboundSchema =
119
- BrowsePaymentMethodDefinitionsGetRequest$outboundSchema;
120
- /** @deprecated use `BrowsePaymentMethodDefinitionsGetRequest$Outbound` instead. */
121
- export type Outbound = BrowsePaymentMethodDefinitionsGetRequest$Outbound;
122
- }
123
-
124
- export function browsePaymentMethodDefinitionsGetRequestToJSON(
125
- browsePaymentMethodDefinitionsGetRequest:
126
- BrowsePaymentMethodDefinitionsGetRequest,
127
- ): string {
128
- return JSON.stringify(
129
- BrowsePaymentMethodDefinitionsGetRequest$outboundSchema.parse(
130
- browsePaymentMethodDefinitionsGetRequest,
131
- ),
132
- );
133
- }
134
-
135
- export function browsePaymentMethodDefinitionsGetRequestFromJSON(
136
- jsonString: string,
137
- ): SafeParseResult<
138
- BrowsePaymentMethodDefinitionsGetRequest,
139
- SDKValidationError
140
- > {
141
- return safeParse(
142
- jsonString,
143
- (x) =>
144
- BrowsePaymentMethodDefinitionsGetRequest$inboundSchema.parse(
145
- JSON.parse(x),
146
- ),
147
- `Failed to parse 'BrowsePaymentMethodDefinitionsGetRequest' from JSON`,
148
- );
149
- }