@gr4vy/sdk 2.0.7 → 2.0.8
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/funcs/buyersDelete.js.map +1 -1
- package/funcs/buyersGet.js.map +1 -1
- package/funcs/buyersShippingDetailsCreate.js.map +1 -1
- package/funcs/buyersShippingDetailsDelete.js.map +1 -1
- package/funcs/buyersShippingDetailsGet.js.map +1 -1
- package/funcs/buyersShippingDetailsList.js.map +1 -1
- package/funcs/buyersShippingDetailsUpdate.js.map +1 -1
- package/funcs/buyersUpdate.js.map +1 -1
- package/funcs/checkoutSessionsDelete.js.map +1 -1
- package/funcs/checkoutSessionsGet.js.map +1 -1
- package/funcs/checkoutSessionsUpdate.js.map +1 -1
- package/funcs/digitalWalletsDelete.js.map +1 -1
- package/funcs/digitalWalletsDomainsCreate.js.map +1 -1
- package/funcs/digitalWalletsDomainsDelete.js.map +1 -1
- package/funcs/digitalWalletsGet.js.map +1 -1
- package/funcs/digitalWalletsUpdate.js.map +1 -1
- package/funcs/giftCardsDelete.js.map +1 -1
- package/funcs/giftCardsGet.js.map +1 -1
- package/funcs/merchantAccountsGet.js.map +1 -1
- package/funcs/merchantAccountsThreeDsConfigurationCreate.js.map +1 -1
- package/funcs/merchantAccountsThreeDsConfigurationDelete.js.map +1 -1
- package/funcs/merchantAccountsThreeDsConfigurationList.js.map +1 -1
- package/funcs/merchantAccountsThreeDsConfigurationUpdate.js.map +1 -1
- package/funcs/merchantAccountsUpdate.js.map +1 -1
- package/funcs/paymentLinksExpire.js.map +1 -1
- package/funcs/paymentLinksGet.js.map +1 -1
- package/funcs/paymentMethodsDelete.js.map +1 -1
- package/funcs/paymentMethodsGet.js.map +1 -1
- package/funcs/paymentMethodsNetworkTokensCreate.js.map +1 -1
- package/funcs/paymentMethodsNetworkTokensCryptogramCreate.js.map +1 -1
- package/funcs/paymentMethodsNetworkTokensDelete.js.map +1 -1
- package/funcs/paymentMethodsNetworkTokensList.js.map +1 -1
- package/funcs/paymentMethodsNetworkTokensResume.js.map +1 -1
- package/funcs/paymentMethodsNetworkTokensSuspend.js.map +1 -1
- package/funcs/paymentMethodsPaymentServiceTokensCreate.js.map +1 -1
- package/funcs/paymentMethodsPaymentServiceTokensDelete.js.map +1 -1
- package/funcs/paymentMethodsPaymentServiceTokensList.js.map +1 -1
- package/funcs/paymentServiceDefinitionsGet.js.map +1 -1
- package/funcs/paymentServiceDefinitionsSession.js.map +1 -1
- package/funcs/paymentServicesDelete.js.map +1 -1
- package/funcs/paymentServicesGet.js.map +1 -1
- package/funcs/paymentServicesSession.js.map +1 -1
- package/funcs/paymentServicesUpdate.js.map +1 -1
- package/funcs/payoutsGet.js.map +1 -1
- package/funcs/refundsGet.js.map +1 -1
- package/funcs/reportsExecutionsGet.js.map +1 -1
- package/funcs/reportsExecutionsList.js.map +1 -1
- package/funcs/reportsExecutionsUrl.js.map +1 -1
- package/funcs/reportsGet.js.map +1 -1
- package/funcs/reportsPut.js.map +1 -1
- package/funcs/threeDsScenariosDelete.js.map +1 -1
- package/funcs/threeDsScenariosUpdate.js.map +1 -1
- package/funcs/transactionsActionsList.js.map +1 -1
- package/funcs/transactionsCancel.js.map +1 -1
- package/funcs/transactionsCapture.js.map +1 -1
- package/funcs/transactionsEventsList.js.map +1 -1
- package/funcs/transactionsGet.js.map +1 -1
- package/funcs/transactionsRefundsAllCreate.js.map +1 -1
- package/funcs/transactionsRefundsCreate.js.map +1 -1
- package/funcs/transactionsRefundsGet.js.map +1 -1
- package/funcs/transactionsRefundsList.js.map +1 -1
- package/funcs/transactionsSettlementsGet.js.map +1 -1
- package/funcs/transactionsSettlementsList.js.map +1 -1
- package/funcs/transactionsSync.js.map +1 -1
- package/funcs/transactionsUpdate.js.map +1 -1
- package/funcs/transactionsVoid.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +8 -4
- package/lib/sdks.js.map +1 -1
- package/lib/url.d.ts.map +1 -1
- package/lib/url.js +4 -2
- package/lib/url.js.map +1 -1
- package/models/errors/error409.d.ts +8 -0
- package/models/errors/error409.d.ts.map +1 -1
- package/models/errors/error409.js +8 -1
- package/models/errors/error409.js.map +1 -1
- package/package.json +1 -1
- package/src/funcs/buyersDelete.ts +0 -1
- package/src/funcs/buyersGet.ts +0 -1
- package/src/funcs/buyersShippingDetailsCreate.ts +0 -1
- package/src/funcs/buyersShippingDetailsDelete.ts +0 -1
- package/src/funcs/buyersShippingDetailsGet.ts +0 -1
- package/src/funcs/buyersShippingDetailsList.ts +0 -1
- package/src/funcs/buyersShippingDetailsUpdate.ts +0 -1
- package/src/funcs/buyersUpdate.ts +0 -1
- package/src/funcs/checkoutSessionsDelete.ts +0 -1
- package/src/funcs/checkoutSessionsGet.ts +0 -1
- package/src/funcs/checkoutSessionsUpdate.ts +0 -1
- package/src/funcs/digitalWalletsDelete.ts +0 -1
- package/src/funcs/digitalWalletsDomainsCreate.ts +0 -1
- package/src/funcs/digitalWalletsDomainsDelete.ts +0 -1
- package/src/funcs/digitalWalletsGet.ts +0 -1
- package/src/funcs/digitalWalletsUpdate.ts +0 -1
- package/src/funcs/giftCardsDelete.ts +0 -1
- package/src/funcs/giftCardsGet.ts +0 -1
- package/src/funcs/merchantAccountsGet.ts +0 -1
- package/src/funcs/merchantAccountsThreeDsConfigurationCreate.ts +0 -1
- package/src/funcs/merchantAccountsThreeDsConfigurationDelete.ts +0 -1
- package/src/funcs/merchantAccountsThreeDsConfigurationList.ts +0 -1
- package/src/funcs/merchantAccountsThreeDsConfigurationUpdate.ts +0 -1
- package/src/funcs/merchantAccountsUpdate.ts +0 -1
- package/src/funcs/paymentLinksExpire.ts +0 -1
- package/src/funcs/paymentLinksGet.ts +0 -1
- package/src/funcs/paymentMethodsDelete.ts +0 -1
- package/src/funcs/paymentMethodsGet.ts +0 -1
- package/src/funcs/paymentMethodsNetworkTokensCreate.ts +0 -1
- package/src/funcs/paymentMethodsNetworkTokensCryptogramCreate.ts +0 -1
- package/src/funcs/paymentMethodsNetworkTokensDelete.ts +0 -1
- package/src/funcs/paymentMethodsNetworkTokensList.ts +0 -1
- package/src/funcs/paymentMethodsNetworkTokensResume.ts +0 -1
- package/src/funcs/paymentMethodsNetworkTokensSuspend.ts +0 -1
- package/src/funcs/paymentMethodsPaymentServiceTokensCreate.ts +0 -1
- package/src/funcs/paymentMethodsPaymentServiceTokensDelete.ts +0 -1
- package/src/funcs/paymentMethodsPaymentServiceTokensList.ts +0 -1
- package/src/funcs/paymentServiceDefinitionsGet.ts +0 -1
- package/src/funcs/paymentServiceDefinitionsSession.ts +0 -1
- package/src/funcs/paymentServicesDelete.ts +0 -1
- package/src/funcs/paymentServicesGet.ts +0 -1
- package/src/funcs/paymentServicesSession.ts +0 -1
- package/src/funcs/paymentServicesUpdate.ts +0 -1
- package/src/funcs/payoutsGet.ts +0 -1
- package/src/funcs/refundsGet.ts +0 -1
- package/src/funcs/reportsExecutionsGet.ts +0 -1
- package/src/funcs/reportsExecutionsList.ts +0 -1
- package/src/funcs/reportsExecutionsUrl.ts +0 -1
- package/src/funcs/reportsGet.ts +0 -1
- package/src/funcs/reportsPut.ts +0 -1
- package/src/funcs/threeDsScenariosDelete.ts +0 -1
- package/src/funcs/threeDsScenariosUpdate.ts +0 -1
- package/src/funcs/transactionsActionsList.ts +0 -1
- package/src/funcs/transactionsCancel.ts +0 -1
- package/src/funcs/transactionsCapture.ts +0 -1
- package/src/funcs/transactionsEventsList.ts +0 -1
- package/src/funcs/transactionsGet.ts +0 -1
- package/src/funcs/transactionsRefundsAllCreate.ts +0 -1
- package/src/funcs/transactionsRefundsCreate.ts +0 -1
- package/src/funcs/transactionsRefundsGet.ts +0 -1
- package/src/funcs/transactionsRefundsList.ts +0 -1
- package/src/funcs/transactionsSettlementsGet.ts +0 -1
- package/src/funcs/transactionsSettlementsList.ts +0 -1
- package/src/funcs/transactionsSync.ts +0 -1
- package/src/funcs/transactionsUpdate.ts +0 -1
- package/src/funcs/transactionsVoid.ts +0 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +7 -5
- package/src/lib/url.ts +16 -14
- package/src/models/errors/error409.ts +16 -1
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.0.8",
|
|
81
|
+
genVersion: "2.869.10",
|
|
82
|
+
userAgent: "speakeasy-sdk/typescript 2.0.8 2.869.10 1.0.0 @gr4vy/sdk",
|
|
83
83
|
} as const;
|
package/src/lib/sdks.ts
CHANGED
|
@@ -128,13 +128,15 @@ export class ClientSDK {
|
|
|
128
128
|
if (!base) {
|
|
129
129
|
return ERR(new InvalidRequestError("No base URL provided for operation"));
|
|
130
130
|
}
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
const baseURL = new URL(base);
|
|
132
|
+
let reqURL: URL;
|
|
134
133
|
if (path) {
|
|
135
|
-
|
|
136
|
-
reqURL
|
|
134
|
+
baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/";
|
|
135
|
+
reqURL = new URL(path, baseURL);
|
|
136
|
+
} else {
|
|
137
|
+
reqURL = baseURL;
|
|
137
138
|
}
|
|
139
|
+
reqURL.hash = "";
|
|
138
140
|
|
|
139
141
|
let finalQuery = query || "";
|
|
140
142
|
|
package/src/lib/url.ts
CHANGED
|
@@ -13,21 +13,23 @@ export function pathToFunc(
|
|
|
13
13
|
const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
|
|
14
14
|
|
|
15
15
|
return function buildURLPath(params: Record<string, unknown> = {}): string {
|
|
16
|
-
return pathPattern
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
return pathPattern
|
|
17
|
+
.replace(paramRE, function (_, placeholder) {
|
|
18
|
+
if (!hasOwn.call(params, placeholder)) {
|
|
19
|
+
throw new Error(`Parameter '${placeholder}' is required`);
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const value = params[placeholder];
|
|
23
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
24
|
+
throw new Error(
|
|
25
|
+
`Parameter '${placeholder}' must be a string or number`,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
return options?.charEncoding === "percent"
|
|
30
|
+
? encodeURIComponent(`${value}`)
|
|
31
|
+
: `${value}`;
|
|
32
|
+
})
|
|
33
|
+
.replace(/^\/+/, "");
|
|
32
34
|
};
|
|
33
35
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
7
|
import * as components from "../components/index.js";
|
|
7
8
|
import { Gr4vyError } from "./gr4vyerror.js";
|
|
8
9
|
|
|
@@ -27,6 +28,10 @@ export type Error409Data = {
|
|
|
27
28
|
* A list of details that further ellaborate on the error.
|
|
28
29
|
*/
|
|
29
30
|
details?: Array<components.ErrorDetail> | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* The ID of the conflicting resource.
|
|
33
|
+
*/
|
|
34
|
+
resourceId?: string | null | undefined;
|
|
30
35
|
};
|
|
31
36
|
|
|
32
37
|
export class Error409 extends Gr4vyError {
|
|
@@ -46,6 +51,10 @@ export class Error409 extends Gr4vyError {
|
|
|
46
51
|
* A list of details that further ellaborate on the error.
|
|
47
52
|
*/
|
|
48
53
|
details?: Array<components.ErrorDetail> | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* The ID of the conflicting resource.
|
|
56
|
+
*/
|
|
57
|
+
resourceId?: string | null | undefined;
|
|
49
58
|
|
|
50
59
|
/** The original data that was passed to this error instance. */
|
|
51
60
|
data$: Error409Data;
|
|
@@ -61,6 +70,7 @@ export class Error409 extends Gr4vyError {
|
|
|
61
70
|
if (err.code != null) this.code = err.code;
|
|
62
71
|
if (err.status != null) this.status = err.status;
|
|
63
72
|
if (err.details != null) this.details = err.details;
|
|
73
|
+
if (err.resourceId != null) this.resourceId = err.resourceId;
|
|
64
74
|
|
|
65
75
|
this.name = "Error409";
|
|
66
76
|
}
|
|
@@ -77,12 +87,17 @@ export const Error409$inboundSchema: z.ZodType<
|
|
|
77
87
|
status: z.number().int().default(409),
|
|
78
88
|
message: z.string().default("Generic error"),
|
|
79
89
|
details: z.array(components.ErrorDetail$inboundSchema).optional(),
|
|
90
|
+
resource_id: z.nullable(z.string()).optional(),
|
|
80
91
|
request$: z.instanceof(Request),
|
|
81
92
|
response$: z.instanceof(Response),
|
|
82
93
|
body$: z.string(),
|
|
83
94
|
})
|
|
84
95
|
.transform((v) => {
|
|
85
|
-
|
|
96
|
+
const remapped = remap$(v, {
|
|
97
|
+
"resource_id": "resourceId",
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
return new Error409(remapped, {
|
|
86
101
|
request: v.request$,
|
|
87
102
|
response: v.response$,
|
|
88
103
|
body: v.body$,
|