mollie-api-typescript 1.6.0 → 1.6.2
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/FUNCTIONS.md +6 -0
- package/README.md +30 -0
- package/dist/commonjs/funcs/oauthGenerate.d.ts +1 -1
- package/dist/commonjs/funcs/oauthGenerate.d.ts.map +1 -1
- package/dist/commonjs/funcs/oauthGenerate.js +4 -3
- package/dist/commonjs/funcs/oauthGenerate.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +2 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/listpaymentresponse.d.ts +1 -1
- package/dist/commonjs/models/listsettlementpaymentresponse.d.ts +1 -1
- package/dist/commonjs/models/oauthgranttype.d.ts +10 -0
- package/dist/commonjs/models/oauthgranttype.d.ts.map +1 -0
- package/dist/commonjs/models/oauthgranttype.js +48 -0
- package/dist/commonjs/models/oauthgranttype.js.map +1 -0
- package/dist/commonjs/models/oauthtokentypehint.d.ts +10 -0
- package/dist/commonjs/models/oauthtokentypehint.d.ts.map +1 -0
- package/dist/commonjs/models/oauthtokentypehint.js +48 -0
- package/dist/commonjs/models/oauthtokentypehint.js.map +1 -0
- package/dist/commonjs/models/operations/oauthgeneratetokens.d.ts +11 -19
- package/dist/commonjs/models/operations/oauthgeneratetokens.d.ts.map +1 -1
- package/dist/commonjs/models/operations/oauthgeneratetokens.js +10 -9
- package/dist/commonjs/models/operations/oauthgeneratetokens.js.map +1 -1
- package/dist/commonjs/models/operations/oauthrevoketokens.d.ts +2 -8
- package/dist/commonjs/models/operations/oauthrevoketokens.d.ts.map +1 -1
- package/dist/commonjs/models/operations/oauthrevoketokens.js +2 -1
- package/dist/commonjs/models/operations/oauthrevoketokens.js.map +1 -1
- package/dist/commonjs/models/operations/updatepayment.d.ts +1 -1
- package/dist/commonjs/models/paymentrequest.d.ts +1 -1
- package/dist/commonjs/models/paymentresponse.d.ts +1 -1
- package/dist/commonjs/sdk/oauth.d.ts +1 -1
- package/dist/commonjs/sdk/oauth.d.ts.map +1 -1
- package/dist/esm/funcs/oauthGenerate.d.ts +1 -1
- package/dist/esm/funcs/oauthGenerate.d.ts.map +1 -1
- package/dist/esm/funcs/oauthGenerate.js +4 -3
- package/dist/esm/funcs/oauthGenerate.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +2 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/listpaymentresponse.d.ts +1 -1
- package/dist/esm/models/listsettlementpaymentresponse.d.ts +1 -1
- package/dist/esm/models/oauthgranttype.d.ts +10 -0
- package/dist/esm/models/oauthgranttype.d.ts.map +1 -0
- package/dist/esm/models/oauthgranttype.js +12 -0
- package/dist/esm/models/oauthgranttype.js.map +1 -0
- package/dist/esm/models/oauthtokentypehint.d.ts +10 -0
- package/dist/esm/models/oauthtokentypehint.d.ts.map +1 -0
- package/dist/esm/models/oauthtokentypehint.js +12 -0
- package/dist/esm/models/oauthtokentypehint.js.map +1 -0
- package/dist/esm/models/operations/oauthgeneratetokens.d.ts +11 -19
- package/dist/esm/models/operations/oauthgeneratetokens.d.ts.map +1 -1
- package/dist/esm/models/operations/oauthgeneratetokens.js +8 -7
- package/dist/esm/models/operations/oauthgeneratetokens.js.map +1 -1
- package/dist/esm/models/operations/oauthrevoketokens.d.ts +2 -8
- package/dist/esm/models/operations/oauthrevoketokens.d.ts.map +1 -1
- package/dist/esm/models/operations/oauthrevoketokens.js +2 -1
- package/dist/esm/models/operations/oauthrevoketokens.js.map +1 -1
- package/dist/esm/models/operations/updatepayment.d.ts +1 -1
- package/dist/esm/models/paymentrequest.d.ts +1 -1
- package/dist/esm/models/paymentresponse.d.ts +1 -1
- package/dist/esm/sdk/oauth.d.ts +1 -1
- package/dist/esm/sdk/oauth.d.ts.map +1 -1
- package/examples/oauthGenerate.example.ts +6 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/oauthGenerate.ts +7 -6
- package/src/lib/config.ts +2 -2
- package/src/models/index.ts +2 -0
- package/src/models/listpaymentresponse.ts +1 -1
- package/src/models/listsettlementpaymentresponse.ts +1 -1
- package/src/models/oauthgranttype.ts +18 -0
- package/src/models/oauthtokentypehint.ts +18 -0
- package/src/models/operations/oauthgeneratetokens.ts +19 -27
- package/src/models/operations/oauthrevoketokens.ts +3 -9
- package/src/models/operations/updatepayment.ts +1 -1
- package/src/models/paymentrequest.ts +1 -1
- package/src/models/paymentresponse.ts +1 -1
- package/src/sdk/oauth.ts +1 -1
package/src/lib/config.ts
CHANGED
|
@@ -78,8 +78,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
78
78
|
export const SDK_METADATA = {
|
|
79
79
|
language: "typescript",
|
|
80
80
|
openapiDocVersion: "1.0.0",
|
|
81
|
-
sdkVersion: "1.6.
|
|
81
|
+
sdkVersion: "1.6.2",
|
|
82
82
|
genVersion: "2.881.4",
|
|
83
83
|
userAgent:
|
|
84
|
-
"speakeasy-sdk/typescript 1.6.
|
|
84
|
+
"speakeasy-sdk/typescript 1.6.2 2.881.4 1.0.0 mollie-api-typescript",
|
|
85
85
|
} as const;
|
package/src/models/index.ts
CHANGED
|
@@ -111,6 +111,8 @@ export * from "./methodresourceparameter.js";
|
|
|
111
111
|
export * from "./methodresponse.js";
|
|
112
112
|
export * from "./methodstatus.js";
|
|
113
113
|
export * from "./mode.js";
|
|
114
|
+
export * from "./oauthgranttype.js";
|
|
115
|
+
export * from "./oauthtokentypehint.js";
|
|
114
116
|
export * from "./onboardingvatregulation.js";
|
|
115
117
|
export * from "./organizationvatregulation.js";
|
|
116
118
|
export * from "./paymentaddress.js";
|
|
@@ -808,7 +808,7 @@ export type ListPaymentResponse = {
|
|
|
808
808
|
*/
|
|
809
809
|
mode: Mode;
|
|
810
810
|
/**
|
|
811
|
-
* The description of the payment
|
|
811
|
+
* The description of the payment will be shown to your customer on their card or bank statement when possible.
|
|
812
812
|
*
|
|
813
813
|
* @remarks
|
|
814
814
|
* We truncate the description automatically according to the limits of the used payment method. The description is
|
|
@@ -788,7 +788,7 @@ export type ListSettlementPaymentResponse = {
|
|
|
788
788
|
*/
|
|
789
789
|
mode: SettlementMode;
|
|
790
790
|
/**
|
|
791
|
-
* The description of the payment
|
|
791
|
+
* The description of the payment will be shown to your customer on their card or bank statement when possible.
|
|
792
792
|
*
|
|
793
793
|
* @remarks
|
|
794
794
|
* We truncate the description automatically according to the limits of the used payment method. The description is
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: fb8dae64ac82
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const OauthGrantType = {
|
|
10
|
+
AuthorizationCode: "authorization_code",
|
|
11
|
+
RefreshToken: "refresh_token",
|
|
12
|
+
} as const;
|
|
13
|
+
export type OauthGrantType = ClosedEnum<typeof OauthGrantType>;
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const OauthGrantType$outboundSchema: z.ZodNativeEnum<
|
|
17
|
+
typeof OauthGrantType
|
|
18
|
+
> = z.nativeEnum(OauthGrantType);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: c0c84485847b
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const OauthTokenTypeHint = {
|
|
10
|
+
AccessToken: "access_token",
|
|
11
|
+
RefreshToken: "refresh_token",
|
|
12
|
+
} as const;
|
|
13
|
+
export type OauthTokenTypeHint = ClosedEnum<typeof OauthTokenTypeHint>;
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const OauthTokenTypeHint$outboundSchema: z.ZodNativeEnum<
|
|
17
|
+
typeof OauthTokenTypeHint
|
|
18
|
+
> = z.nativeEnum(OauthTokenTypeHint);
|
|
@@ -8,36 +8,28 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
8
8
|
import { safeParse } from "../../lib/schemas.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import * as models from "../index.js";
|
|
11
12
|
|
|
12
13
|
export const OauthGenerateTokensServerList = [
|
|
13
14
|
"https://api.mollie.com/oauth2",
|
|
14
15
|
] as const;
|
|
15
16
|
|
|
16
17
|
export type OauthGenerateTokensRequestBody = {
|
|
17
|
-
|
|
18
|
-
* If you wish to exchange your authorization code for an app access token, use grant type
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* `authorization_code`. If you wish to renew your app access token with your refresh token, use grant type
|
|
22
|
-
* `refresh_token`.
|
|
23
|
-
*
|
|
24
|
-
* Possible values: `authorization_code` `refresh_token`
|
|
25
|
-
*/
|
|
26
|
-
grantType: string;
|
|
18
|
+
grantType: models.OauthGrantType;
|
|
27
19
|
/**
|
|
28
20
|
* The authorization code you received when creating the authorization. Only use this field when using
|
|
29
21
|
*
|
|
30
22
|
* @remarks
|
|
31
23
|
* grant type `authorization_code`.
|
|
32
24
|
*/
|
|
33
|
-
code?: string |
|
|
25
|
+
code?: string | undefined;
|
|
34
26
|
/**
|
|
35
27
|
* The refresh token you received when creating the authorization. Only use this field when using grant
|
|
36
28
|
*
|
|
37
29
|
* @remarks
|
|
38
30
|
* type `refresh_token`.
|
|
39
31
|
*/
|
|
40
|
-
refreshToken?: string |
|
|
32
|
+
refreshToken?: string | undefined;
|
|
41
33
|
/**
|
|
42
34
|
* The URL the merchant is sent back to once the request has been authorized. It must match the URL you set
|
|
43
35
|
*
|
|
@@ -47,7 +39,7 @@ export type OauthGenerateTokensRequestBody = {
|
|
|
47
39
|
* For consecutive refresh token requests, this parameter is required only if the initial authorization
|
|
48
40
|
* code grant request also contained a `redirect_uri`.
|
|
49
41
|
*/
|
|
50
|
-
redirectUri?: string |
|
|
42
|
+
redirectUri?: string | undefined;
|
|
51
43
|
};
|
|
52
44
|
|
|
53
45
|
export type OauthGenerateTokensRequest = {
|
|
@@ -61,7 +53,7 @@ export type OauthGenerateTokensRequest = {
|
|
|
61
53
|
/**
|
|
62
54
|
* The newly generated access token and refresh token.
|
|
63
55
|
*/
|
|
64
|
-
export type
|
|
56
|
+
export type OauthGenerateTokensResponse = {
|
|
65
57
|
/**
|
|
66
58
|
* The app access token, with which you will be able to access the Mollie API on the merchant's behalf.
|
|
67
59
|
*/
|
|
@@ -97,9 +89,9 @@ export type OauthGenerateTokensResponseBody = {
|
|
|
97
89
|
/** @internal */
|
|
98
90
|
export type OauthGenerateTokensRequestBody$Outbound = {
|
|
99
91
|
grant_type: string;
|
|
100
|
-
code?: string |
|
|
101
|
-
refresh_token?: string |
|
|
102
|
-
redirect_uri?: string |
|
|
92
|
+
code?: string | undefined;
|
|
93
|
+
refresh_token?: string | undefined;
|
|
94
|
+
redirect_uri?: string | undefined;
|
|
103
95
|
};
|
|
104
96
|
|
|
105
97
|
/** @internal */
|
|
@@ -108,10 +100,10 @@ export const OauthGenerateTokensRequestBody$outboundSchema: z.ZodType<
|
|
|
108
100
|
z.ZodTypeDef,
|
|
109
101
|
OauthGenerateTokensRequestBody
|
|
110
102
|
> = z.object({
|
|
111
|
-
grantType:
|
|
112
|
-
code: z.
|
|
113
|
-
refreshToken: z.
|
|
114
|
-
redirectUri: z.
|
|
103
|
+
grantType: models.OauthGrantType$outboundSchema,
|
|
104
|
+
code: z.string().optional(),
|
|
105
|
+
refreshToken: z.string().optional(),
|
|
106
|
+
redirectUri: z.string().optional(),
|
|
115
107
|
}).transform((v) => {
|
|
116
108
|
return remap$(v, {
|
|
117
109
|
grantType: "grant_type",
|
|
@@ -161,8 +153,8 @@ export function oauthGenerateTokensRequestToJSON(
|
|
|
161
153
|
}
|
|
162
154
|
|
|
163
155
|
/** @internal */
|
|
164
|
-
export const
|
|
165
|
-
|
|
156
|
+
export const OauthGenerateTokensResponse$inboundSchema: z.ZodType<
|
|
157
|
+
OauthGenerateTokensResponse,
|
|
166
158
|
z.ZodTypeDef,
|
|
167
159
|
unknown
|
|
168
160
|
> = z.object({
|
|
@@ -180,12 +172,12 @@ export const OauthGenerateTokensResponseBody$inboundSchema: z.ZodType<
|
|
|
180
172
|
});
|
|
181
173
|
});
|
|
182
174
|
|
|
183
|
-
export function
|
|
175
|
+
export function oauthGenerateTokensResponseFromJSON(
|
|
184
176
|
jsonString: string,
|
|
185
|
-
): SafeParseResult<
|
|
177
|
+
): SafeParseResult<OauthGenerateTokensResponse, SDKValidationError> {
|
|
186
178
|
return safeParse(
|
|
187
179
|
jsonString,
|
|
188
|
-
(x) =>
|
|
189
|
-
`Failed to parse '
|
|
180
|
+
(x) => OauthGenerateTokensResponse$inboundSchema.parse(JSON.parse(x)),
|
|
181
|
+
`Failed to parse 'OauthGenerateTokensResponse' from JSON`,
|
|
190
182
|
);
|
|
191
183
|
}
|
|
@@ -5,20 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
import * as z from "zod/v3";
|
|
7
7
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import * as models from "../index.js";
|
|
8
9
|
|
|
9
10
|
export const OauthRevokeTokensServerList = [
|
|
10
11
|
"https://api.mollie.com/oauth2",
|
|
11
12
|
] as const;
|
|
12
13
|
|
|
13
14
|
export type OauthRevokeTokensRequestBody = {
|
|
14
|
-
|
|
15
|
-
* The type of token you want to revoke.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
*
|
|
19
|
-
* Possible values: `access_token` `refresh_token`
|
|
20
|
-
*/
|
|
21
|
-
tokenTypeHint: string;
|
|
15
|
+
tokenTypeHint: models.OauthTokenTypeHint;
|
|
22
16
|
/**
|
|
23
17
|
* The token you want to revoke.
|
|
24
18
|
*/
|
|
@@ -45,7 +39,7 @@ export const OauthRevokeTokensRequestBody$outboundSchema: z.ZodType<
|
|
|
45
39
|
z.ZodTypeDef,
|
|
46
40
|
OauthRevokeTokensRequestBody
|
|
47
41
|
> = z.object({
|
|
48
|
-
tokenTypeHint:
|
|
42
|
+
tokenTypeHint: models.OauthTokenTypeHint$outboundSchema,
|
|
49
43
|
token: z.string(),
|
|
50
44
|
}).transform((v) => {
|
|
51
45
|
return remap$(v, {
|
|
@@ -9,7 +9,7 @@ import * as models from "../index.js";
|
|
|
9
9
|
|
|
10
10
|
export type UpdatePaymentRequestBody = {
|
|
11
11
|
/**
|
|
12
|
-
* The description of the payment
|
|
12
|
+
* The description of the payment will be shown to your customer on their card or bank statement when possible.
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
15
|
* We truncate the description automatically according to the limits of the used payment method. The description is
|
|
@@ -259,7 +259,7 @@ export type Company = {
|
|
|
259
259
|
|
|
260
260
|
export type PaymentRequest = {
|
|
261
261
|
/**
|
|
262
|
-
* The description of the payment
|
|
262
|
+
* The description of the payment will be shown to your customer on their card or bank statement when possible.
|
|
263
263
|
*
|
|
264
264
|
* @remarks
|
|
265
265
|
* We truncate the description automatically according to the limits of the used payment method. The description is
|
|
@@ -810,7 +810,7 @@ export type PaymentResponse = {
|
|
|
810
810
|
*/
|
|
811
811
|
mode: Mode;
|
|
812
812
|
/**
|
|
813
|
-
* The description of the payment
|
|
813
|
+
* The description of the payment will be shown to your customer on their card or bank statement when possible.
|
|
814
814
|
*
|
|
815
815
|
* @remarks
|
|
816
816
|
* We truncate the description automatically according to the limits of the used payment method. The description is
|
package/src/sdk/oauth.ts
CHANGED
|
@@ -22,7 +22,7 @@ export class Oauth extends ClientSDK {
|
|
|
22
22
|
async generate(
|
|
23
23
|
request?: operations.OauthGenerateTokensRequest | undefined,
|
|
24
24
|
options?: RequestOptions,
|
|
25
|
-
): Promise<
|
|
25
|
+
): Promise<operations.OauthGenerateTokensResponse> {
|
|
26
26
|
return unwrapAsync(oauthGenerate(
|
|
27
27
|
this,
|
|
28
28
|
request,
|