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.
Files changed (84) hide show
  1. package/FUNCTIONS.md +6 -0
  2. package/README.md +30 -0
  3. package/dist/commonjs/funcs/oauthGenerate.d.ts +1 -1
  4. package/dist/commonjs/funcs/oauthGenerate.d.ts.map +1 -1
  5. package/dist/commonjs/funcs/oauthGenerate.js +4 -3
  6. package/dist/commonjs/funcs/oauthGenerate.js.map +1 -1
  7. package/dist/commonjs/lib/config.d.ts +2 -2
  8. package/dist/commonjs/lib/config.js +2 -2
  9. package/dist/commonjs/models/index.d.ts +2 -0
  10. package/dist/commonjs/models/index.d.ts.map +1 -1
  11. package/dist/commonjs/models/index.js +2 -0
  12. package/dist/commonjs/models/index.js.map +1 -1
  13. package/dist/commonjs/models/listpaymentresponse.d.ts +1 -1
  14. package/dist/commonjs/models/listsettlementpaymentresponse.d.ts +1 -1
  15. package/dist/commonjs/models/oauthgranttype.d.ts +10 -0
  16. package/dist/commonjs/models/oauthgranttype.d.ts.map +1 -0
  17. package/dist/commonjs/models/oauthgranttype.js +48 -0
  18. package/dist/commonjs/models/oauthgranttype.js.map +1 -0
  19. package/dist/commonjs/models/oauthtokentypehint.d.ts +10 -0
  20. package/dist/commonjs/models/oauthtokentypehint.d.ts.map +1 -0
  21. package/dist/commonjs/models/oauthtokentypehint.js +48 -0
  22. package/dist/commonjs/models/oauthtokentypehint.js.map +1 -0
  23. package/dist/commonjs/models/operations/oauthgeneratetokens.d.ts +11 -19
  24. package/dist/commonjs/models/operations/oauthgeneratetokens.d.ts.map +1 -1
  25. package/dist/commonjs/models/operations/oauthgeneratetokens.js +10 -9
  26. package/dist/commonjs/models/operations/oauthgeneratetokens.js.map +1 -1
  27. package/dist/commonjs/models/operations/oauthrevoketokens.d.ts +2 -8
  28. package/dist/commonjs/models/operations/oauthrevoketokens.d.ts.map +1 -1
  29. package/dist/commonjs/models/operations/oauthrevoketokens.js +2 -1
  30. package/dist/commonjs/models/operations/oauthrevoketokens.js.map +1 -1
  31. package/dist/commonjs/models/operations/updatepayment.d.ts +1 -1
  32. package/dist/commonjs/models/paymentrequest.d.ts +1 -1
  33. package/dist/commonjs/models/paymentresponse.d.ts +1 -1
  34. package/dist/commonjs/sdk/oauth.d.ts +1 -1
  35. package/dist/commonjs/sdk/oauth.d.ts.map +1 -1
  36. package/dist/esm/funcs/oauthGenerate.d.ts +1 -1
  37. package/dist/esm/funcs/oauthGenerate.d.ts.map +1 -1
  38. package/dist/esm/funcs/oauthGenerate.js +4 -3
  39. package/dist/esm/funcs/oauthGenerate.js.map +1 -1
  40. package/dist/esm/lib/config.d.ts +2 -2
  41. package/dist/esm/lib/config.js +2 -2
  42. package/dist/esm/models/index.d.ts +2 -0
  43. package/dist/esm/models/index.d.ts.map +1 -1
  44. package/dist/esm/models/index.js +2 -0
  45. package/dist/esm/models/index.js.map +1 -1
  46. package/dist/esm/models/listpaymentresponse.d.ts +1 -1
  47. package/dist/esm/models/listsettlementpaymentresponse.d.ts +1 -1
  48. package/dist/esm/models/oauthgranttype.d.ts +10 -0
  49. package/dist/esm/models/oauthgranttype.d.ts.map +1 -0
  50. package/dist/esm/models/oauthgranttype.js +12 -0
  51. package/dist/esm/models/oauthgranttype.js.map +1 -0
  52. package/dist/esm/models/oauthtokentypehint.d.ts +10 -0
  53. package/dist/esm/models/oauthtokentypehint.d.ts.map +1 -0
  54. package/dist/esm/models/oauthtokentypehint.js +12 -0
  55. package/dist/esm/models/oauthtokentypehint.js.map +1 -0
  56. package/dist/esm/models/operations/oauthgeneratetokens.d.ts +11 -19
  57. package/dist/esm/models/operations/oauthgeneratetokens.d.ts.map +1 -1
  58. package/dist/esm/models/operations/oauthgeneratetokens.js +8 -7
  59. package/dist/esm/models/operations/oauthgeneratetokens.js.map +1 -1
  60. package/dist/esm/models/operations/oauthrevoketokens.d.ts +2 -8
  61. package/dist/esm/models/operations/oauthrevoketokens.d.ts.map +1 -1
  62. package/dist/esm/models/operations/oauthrevoketokens.js +2 -1
  63. package/dist/esm/models/operations/oauthrevoketokens.js.map +1 -1
  64. package/dist/esm/models/operations/updatepayment.d.ts +1 -1
  65. package/dist/esm/models/paymentrequest.d.ts +1 -1
  66. package/dist/esm/models/paymentresponse.d.ts +1 -1
  67. package/dist/esm/sdk/oauth.d.ts +1 -1
  68. package/dist/esm/sdk/oauth.d.ts.map +1 -1
  69. package/examples/oauthGenerate.example.ts +6 -0
  70. package/jsr.json +1 -1
  71. package/package.json +1 -1
  72. package/src/funcs/oauthGenerate.ts +7 -6
  73. package/src/lib/config.ts +2 -2
  74. package/src/models/index.ts +2 -0
  75. package/src/models/listpaymentresponse.ts +1 -1
  76. package/src/models/listsettlementpaymentresponse.ts +1 -1
  77. package/src/models/oauthgranttype.ts +18 -0
  78. package/src/models/oauthtokentypehint.ts +18 -0
  79. package/src/models/operations/oauthgeneratetokens.ts +19 -27
  80. package/src/models/operations/oauthrevoketokens.ts +3 -9
  81. package/src/models/operations/updatepayment.ts +1 -1
  82. package/src/models/paymentrequest.ts +1 -1
  83. package/src/models/paymentresponse.ts +1 -1
  84. 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.0",
81
+ sdkVersion: "1.6.2",
82
82
  genVersion: "2.881.4",
83
83
  userAgent:
84
- "speakeasy-sdk/typescript 1.6.0 2.881.4 1.0.0 mollie-api-typescript",
84
+ "speakeasy-sdk/typescript 1.6.2 2.881.4 1.0.0 mollie-api-typescript",
85
85
  } as const;
@@ -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. This will be shown to your customer on their card or bank statement when possible.
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. This will be shown to your customer on their card or bank statement when possible.
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 | null | undefined;
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 | null | undefined;
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 | null | undefined;
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 OauthGenerateTokensResponseBody = {
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 | null | undefined;
101
- refresh_token?: string | null | undefined;
102
- redirect_uri?: string | null | undefined;
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: z.string(),
112
- code: z.nullable(z.string()).optional(),
113
- refreshToken: z.nullable(z.string()).optional(),
114
- redirectUri: z.nullable(z.string()).optional(),
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 OauthGenerateTokensResponseBody$inboundSchema: z.ZodType<
165
- OauthGenerateTokensResponseBody,
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 oauthGenerateTokensResponseBodyFromJSON(
175
+ export function oauthGenerateTokensResponseFromJSON(
184
176
  jsonString: string,
185
- ): SafeParseResult<OauthGenerateTokensResponseBody, SDKValidationError> {
177
+ ): SafeParseResult<OauthGenerateTokensResponse, SDKValidationError> {
186
178
  return safeParse(
187
179
  jsonString,
188
- (x) => OauthGenerateTokensResponseBody$inboundSchema.parse(JSON.parse(x)),
189
- `Failed to parse 'OauthGenerateTokensResponseBody' from JSON`,
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: z.string(),
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. This will be shown to your customer on their card or bank statement when possible.
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. This will be shown to your customer on their card or bank statement when possible.
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. This will be shown to your customer on their card or bank statement when possible.
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<Uint8Array> {
25
+ ): Promise<operations.OauthGenerateTokensResponse> {
26
26
  return unwrapAsync(oauthGenerate(
27
27
  this,
28
28
  request,