@outseta/api-client 0.3.2 → 0.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outseta/api-client",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Generated API client for the Outseta REST API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -103,7 +103,6 @@ export * from './authGetTokenParams';
103
103
  export * from './authResendTwoFactorParams';
104
104
  export * from './authSwitchTwoFactorMechanismParams';
105
105
  export * from './authVerifyTwoFactorRecoveryParams';
106
- export * from './authVerifyTwoFactorTokenParams';
107
106
  export * from './backGroundTaskType';
108
107
  export * from './billSettings';
109
108
  export * from './billSettingsAllOf';
@@ -484,6 +483,7 @@ export * from './translationAllOf';
484
483
  export * from './twoFactorChallengePayload';
485
484
  export * from './twoFactorEnrollmentConfirmationPayload';
486
485
  export * from './twoFactorTotpEnrollmentPayload';
486
+ export * from './twoFactorVerifyRequest';
487
487
  export * from './usage';
488
488
  export * from './usageAddUsageBody';
489
489
  export * from './usageAllOf';
@@ -32,4 +32,6 @@ export type SendGridDomainAuthenticationAllOf = {
32
32
  LastValidationAttempt?: string | null;
33
33
  /** @nullable */
34
34
  DnsEntries?: DnsEntry[] | null;
35
+ /** @nullable */
36
+ LegacyDnsEntries?: DnsEntry[] | null;
35
37
  };
@@ -9,5 +9,7 @@ export interface TokenPayload {
9
9
  /** @nullable */
10
10
  id_token?: string | null;
11
11
  /** @nullable */
12
+ refresh_token?: string | null;
13
+ /** @nullable */
12
14
  token_type?: string | null;
13
15
  }
@@ -0,0 +1,25 @@
1
+ // @ts-nocheck
2
+
3
+ /**
4
+ * Request body for POST /api/v1/tokens/two-factor: the challenge token
5
+ from the login response plus the user's one-time code. Property names are
6
+ snake_case to match the wire format of the token endpoints.
7
+
8
+ The action binds the body as a loose JObject at runtime; this type
9
+ exists so the API docs describe the body instead of an opaque data
10
+ parameter (see [OpenApiRequestBody] on the action).
11
+ */
12
+ export interface TwoFactorVerifyRequest {
13
+ /**
14
+ * The challenge_token returned by POST /api/v1/tokens when
15
+ two-factor authentication is required. Echo it back verbatim.
16
+ * @nullable
17
+ */
18
+ challenge_token?: string | null;
19
+ /**
20
+ * The user's one-time code: the emailed code for an Email challenge,
21
+ or the current code from their authenticator app for a Totp challenge.
22
+ * @nullable
23
+ */
24
+ code?: string | null;
25
+ }
@@ -4,7 +4,6 @@ import type {
4
4
  AuthResendTwoFactorParams,
5
5
  AuthSwitchTwoFactorMechanismParams,
6
6
  AuthVerifyTwoFactorRecoveryParams,
7
- AuthVerifyTwoFactorTokenParams,
8
7
  TokenPayload,
9
8
  TokenTwoFactorEnrollmentBeginEmailParams,
10
9
  TokenTwoFactorEnrollmentBeginTotpParams,
@@ -12,7 +11,8 @@ import type {
12
11
  TokenTwoFactorEnrollmentConfirmTotpParams,
13
12
  TwoFactorChallengePayload,
14
13
  TwoFactorEnrollmentConfirmationPayload,
15
- TwoFactorTotpEnrollmentPayload
14
+ TwoFactorTotpEnrollmentPayload,
15
+ TwoFactorVerifyRequest
16
16
  } from '.././models';
17
17
 
18
18
  import { customFetch } from '../../client';
@@ -22,9 +22,9 @@ import { customFetch } from '../../client';
22
22
 
23
23
  { "username": "user@example.com", "password": "their-password" }
24
24
 
25
- On success the response is `200` with an access token:
25
+ On success the response is `200` with an access token and refresh token:
26
26
 
27
- { "access_token": "eyJ...", "token_type": "Bearer", "expires_in": 31536000 }
27
+ { "access_token": "eyJ...", "refresh_token": "...", "token_type": "Bearer", "expires_in": 31536000 }
28
28
 
29
29
  **Two-factor authentication.** If the user has a verified 2FA method,
30
30
  the password alone is not enough. After verifying the password this
@@ -117,13 +117,13 @@ authenticator app):
117
117
  On success the response is `200` with the final access token, in the
118
118
  same shape as `POST /api/v1/tokens`:
119
119
 
120
- { "access_token": "eyJ...", "token_type": "Bearer", "expires_in": 31536000 }
120
+ { "access_token": "eyJ...", "refresh_token": "...", "token_type": "Bearer", "expires_in": 31536000 }
121
121
 
122
122
  An incorrect code returns `400` (`invalid_grant`). A code has at most
123
123
  five attempts before the challenge locks. An expired challenge returns
124
124
  `410` (`challenge_expired`) — restart at `POST /api/v1/tokens`. The
125
125
  endpoint is rate limited to 10 requests per minute (`429`).
126
- * @summary Complete a two-factor login challenge and obtain a JWT access token.
126
+ * @summary Complete login when user has two-factor authentication enabled.
127
127
  */
128
128
  export type authVerifyTwoFactorTokenResponse200 = {
129
129
  data: TokenPayload
@@ -149,29 +149,23 @@ export type authVerifyTwoFactorTokenResponseError = (authVerifyTwoFactorTokenRes
149
149
 
150
150
  export type authVerifyTwoFactorTokenResponse = (authVerifyTwoFactorTokenResponseSuccess | authVerifyTwoFactorTokenResponseError)
151
151
 
152
- export const getAuthVerifyTwoFactorTokenUrl = (params: AuthVerifyTwoFactorTokenParams,) => {
153
- const normalizedParams = new URLSearchParams();
152
+ export const getAuthVerifyTwoFactorTokenUrl = () => {
154
153
 
155
- Object.entries(params || {}).forEach(([key, value]) => {
156
-
157
- if (value !== undefined) {
158
- normalizedParams.append(key, value === null ? 'null' : value.toString())
159
- }
160
- });
161
154
 
162
- const stringifiedParams = normalizedParams.toString();
155
+
163
156
 
164
- return stringifiedParams.length > 0 ? `/api/v1/tokens/two-factor?${stringifiedParams}` : `/api/v1/tokens/two-factor`
157
+ return `/api/v1/tokens/two-factor`
165
158
  }
166
159
 
167
- export const authVerifyTwoFactorToken = async (params: AuthVerifyTwoFactorTokenParams, options?: RequestInit): Promise<authVerifyTwoFactorTokenResponse> => {
160
+ export const authVerifyTwoFactorToken = async (twoFactorVerifyRequest: TwoFactorVerifyRequest, options?: RequestInit): Promise<authVerifyTwoFactorTokenResponse> => {
168
161
 
169
- return customFetch<authVerifyTwoFactorTokenResponse>(getAuthVerifyTwoFactorTokenUrl(params),
162
+ return customFetch<authVerifyTwoFactorTokenResponse>(getAuthVerifyTwoFactorTokenUrl(),
170
163
  {
171
164
  ...options,
172
- method: 'POST'
173
-
174
-
165
+ method: 'POST',
166
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
167
+ body: JSON.stringify(
168
+ twoFactorVerifyRequest,)
175
169
  }
176
170
  );}
177
171
 
@@ -319,8 +313,7 @@ requests per minute (`429`).
319
313
 
320
314
  Used by the embed login widget; the hosted Razor flow has its own
321
315
  equivalent action on the AuthenticationController.
322
- * @summary Complete a two-factor login challenge with a recovery code instead of
323
- the primary one-time code, and obtain a JWT access token.
316
+ * @summary Complete login with a two-factor recovery code.
324
317
  */
325
318
  export type authVerifyTwoFactorRecoveryResponse200 = {
326
319
  data: TokenPayload
@@ -1,8 +0,0 @@
1
- // @ts-nocheck
2
-
3
- export type AuthVerifyTwoFactorTokenParams = {
4
- /**
5
- * @nullable
6
- */
7
- data: unknown | null;
8
- };