@randock/nameshift-api-client 0.0.503 → 0.0.505

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 (144) hide show
  1. package/.openapi-generator/FILES +33 -0
  2. package/README.md +3 -3
  3. package/dist/apis/AdminApi.d.ts +44 -1
  4. package/dist/apis/AdminApi.js +177 -0
  5. package/dist/apis/BuyersPublicApi.d.ts +3 -3
  6. package/dist/apis/BuyersPublicApi.js +1 -1
  7. package/dist/apis/UsersApi.d.ts +285 -1
  8. package/dist/apis/UsersApi.js +1304 -46
  9. package/dist/apis/UsersPublicApi.d.ts +120 -3
  10. package/dist/apis/UsersPublicApi.js +436 -2
  11. package/dist/models/ActivateUserTotpInput.d.ts +32 -0
  12. package/dist/models/ActivateUserTotpInput.js +51 -0
  13. package/dist/models/AdminUserSecurityDto.d.ts +87 -0
  14. package/dist/models/AdminUserSecurityDto.js +87 -0
  15. package/dist/models/BuyerLoginDto.d.ts +38 -0
  16. package/dist/models/BuyerLoginDto.js +55 -0
  17. package/dist/models/BuyerNotificationDto.d.ts +1 -0
  18. package/dist/models/BuyerNotificationDto.js +1 -0
  19. package/dist/models/BuyerNotificationListItemDto.d.ts +1 -0
  20. package/dist/models/BuyerNotificationListItemDto.js +1 -0
  21. package/dist/models/ChangeUserLoginLocationVerificationInput.d.ts +32 -0
  22. package/dist/models/ChangeUserLoginLocationVerificationInput.js +51 -0
  23. package/dist/models/ChangeUserPasswordInput.d.ts +38 -0
  24. package/dist/models/ChangeUserPasswordInput.js +55 -0
  25. package/dist/models/ChangeUserSignInStepsInput.d.ts +33 -0
  26. package/dist/models/ChangeUserSignInStepsInput.js +51 -0
  27. package/dist/models/ConfirmLoginLocationInput.d.ts +32 -0
  28. package/dist/models/ConfirmLoginLocationInput.js +51 -0
  29. package/dist/models/CurrentPasswordInput.d.ts +32 -0
  30. package/dist/models/CurrentPasswordInput.js +51 -0
  31. package/dist/models/FeatureFlagListItemDto.d.ts +1 -0
  32. package/dist/models/FeatureFlagListItemDto.js +2 -1
  33. package/dist/models/IntersectionAccountDtoWithSettingsDtoWithNotificationsDtoWithFeatureFlagsDto.d.ts +1 -0
  34. package/dist/models/IntersectionAccountDtoWithSettingsDtoWithNotificationsDtoWithFeatureFlagsDto.js +2 -1
  35. package/dist/models/ListUserLoginAttempts200Response.d.ts +47 -0
  36. package/dist/models/ListUserLoginAttempts200Response.js +62 -0
  37. package/dist/models/LoginChallengeInput.d.ts +32 -0
  38. package/dist/models/LoginChallengeInput.js +51 -0
  39. package/dist/models/LoginCodeInput.d.ts +38 -0
  40. package/dist/models/LoginCodeInput.js +55 -0
  41. package/dist/models/LoginDto.d.ts +30 -4
  42. package/dist/models/LoginDto.js +13 -5
  43. package/dist/models/LoginPasskeyInput.d.ts +46 -0
  44. package/dist/models/LoginPasskeyInput.js +57 -0
  45. package/dist/models/LoginPasskeyOptionsInput.d.ts +32 -0
  46. package/dist/models/LoginPasskeyOptionsInput.js +49 -0
  47. package/dist/models/LoginPasswordInput.d.ts +38 -0
  48. package/dist/models/LoginPasswordInput.js +55 -0
  49. package/dist/models/LoginRecoveryCodeInput.d.ts +38 -0
  50. package/dist/models/LoginRecoveryCodeInput.js +55 -0
  51. package/dist/models/LoginStatus.d.ts +26 -0
  52. package/dist/models/LoginStatus.js +52 -0
  53. package/dist/models/PasskeyOptionsDto.d.ts +40 -0
  54. package/dist/models/PasskeyOptionsDto.js +55 -0
  55. package/dist/models/PrivateAccountGetMeResponse.d.ts +1 -0
  56. package/dist/models/PrivateAccountGetMeResponse.js +2 -1
  57. package/dist/models/ReauthenticateWithPasskeyInput.d.ts +40 -0
  58. package/dist/models/ReauthenticateWithPasskeyInput.js +55 -0
  59. package/dist/models/ReauthenticationDto.d.ts +38 -0
  60. package/dist/models/ReauthenticationDto.js +55 -0
  61. package/dist/models/RecoveryCodesDto.d.ts +32 -0
  62. package/dist/models/RecoveryCodesDto.js +51 -0
  63. package/dist/models/RegisterUserPasskeyInput.d.ts +46 -0
  64. package/dist/models/RegisterUserPasskeyInput.js +59 -0
  65. package/dist/models/RemoveUserPasskeyInput.d.ts +40 -0
  66. package/dist/models/RemoveUserPasskeyInput.js +55 -0
  67. package/dist/models/RenameUserPasskeyInput.d.ts +32 -0
  68. package/dist/models/RenameUserPasskeyInput.js +51 -0
  69. package/dist/models/SecondFactorMethod.d.ts +27 -0
  70. package/dist/models/SecondFactorMethod.js +53 -0
  71. package/dist/models/SellerSecurityUserDto.d.ts +12 -0
  72. package/dist/models/SellerSecurityUserDto.js +4 -0
  73. package/dist/models/TotpCodeInput.d.ts +32 -0
  74. package/dist/models/TotpCodeInput.js +51 -0
  75. package/dist/models/TotpEnrolmentDto.d.ts +38 -0
  76. package/dist/models/TotpEnrolmentDto.js +55 -0
  77. package/dist/models/UserLoginAttemptDto.d.ts +88 -0
  78. package/dist/models/UserLoginAttemptDto.js +89 -0
  79. package/dist/models/UserLoginAttemptMethod.d.ts +29 -0
  80. package/dist/models/UserLoginAttemptMethod.js +55 -0
  81. package/dist/models/UserLoginAttemptResult.d.ts +31 -0
  82. package/dist/models/UserLoginAttemptResult.js +57 -0
  83. package/dist/models/UserLoginLocationConfirmationDetailsDto.d.ts +62 -0
  84. package/dist/models/UserLoginLocationConfirmationDetailsDto.js +71 -0
  85. package/dist/models/UserNotificationDto.d.ts +1 -0
  86. package/dist/models/UserNotificationDto.js +1 -0
  87. package/dist/models/UserNotificationListItemDto.d.ts +1 -0
  88. package/dist/models/UserNotificationListItemDto.js +1 -0
  89. package/dist/models/UserPasskeyDto.d.ts +62 -0
  90. package/dist/models/UserPasskeyDto.js +71 -0
  91. package/dist/models/UserSecurityDto.d.ts +94 -0
  92. package/dist/models/UserSecurityDto.js +93 -0
  93. package/dist/models/UserSignInFactor.d.ts +26 -0
  94. package/dist/models/UserSignInFactor.js +52 -0
  95. package/dist/models/index.d.ts +33 -0
  96. package/dist/models/index.js +33 -0
  97. package/package.json +1 -1
  98. package/src/apis/AdminApi.ts +172 -0
  99. package/src/apis/BuyersPublicApi.ts +6 -6
  100. package/src/apis/UsersApi.ts +1218 -48
  101. package/src/apis/UsersPublicApi.ts +420 -2
  102. package/src/models/ActivateUserTotpInput.ts +66 -0
  103. package/src/models/AdminUserSecurityDto.ts +155 -0
  104. package/src/models/BuyerLoginDto.ts +75 -0
  105. package/src/models/BuyerNotificationDto.ts +1 -0
  106. package/src/models/BuyerNotificationListItemDto.ts +1 -0
  107. package/src/models/ChangeUserLoginLocationVerificationInput.ts +66 -0
  108. package/src/models/ChangeUserPasswordInput.ts +75 -0
  109. package/src/models/ChangeUserSignInStepsInput.ts +74 -0
  110. package/src/models/ConfirmLoginLocationInput.ts +66 -0
  111. package/src/models/CurrentPasswordInput.ts +66 -0
  112. package/src/models/FeatureFlagListItemDto.ts +2 -1
  113. package/src/models/IntersectionAccountDtoWithSettingsDtoWithNotificationsDtoWithFeatureFlagsDto.ts +2 -1
  114. package/src/models/ListUserLoginAttempts200Response.ts +106 -0
  115. package/src/models/LoginChallengeInput.ts +66 -0
  116. package/src/models/LoginCodeInput.ts +75 -0
  117. package/src/models/LoginDto.ts +56 -8
  118. package/src/models/LoginPasskeyInput.ts +83 -0
  119. package/src/models/LoginPasskeyOptionsInput.ts +65 -0
  120. package/src/models/LoginPasswordInput.ts +75 -0
  121. package/src/models/LoginRecoveryCodeInput.ts +75 -0
  122. package/src/models/LoginStatus.ts +54 -0
  123. package/src/models/PasskeyOptionsDto.ts +75 -0
  124. package/src/models/PrivateAccountGetMeResponse.ts +2 -1
  125. package/src/models/ReauthenticateWithPasskeyInput.ts +75 -0
  126. package/src/models/ReauthenticationDto.ts +75 -0
  127. package/src/models/RecoveryCodesDto.ts +66 -0
  128. package/src/models/RegisterUserPasskeyInput.ts +84 -0
  129. package/src/models/RemoveUserPasskeyInput.ts +75 -0
  130. package/src/models/RenameUserPasskeyInput.ts +66 -0
  131. package/src/models/SecondFactorMethod.ts +55 -0
  132. package/src/models/SellerSecurityUserDto.ts +16 -0
  133. package/src/models/TotpCodeInput.ts +66 -0
  134. package/src/models/TotpEnrolmentDto.ts +75 -0
  135. package/src/models/UserLoginAttemptDto.ts +164 -0
  136. package/src/models/UserLoginAttemptMethod.ts +57 -0
  137. package/src/models/UserLoginAttemptResult.ts +59 -0
  138. package/src/models/UserLoginLocationConfirmationDetailsDto.ts +111 -0
  139. package/src/models/UserNotificationDto.ts +1 -0
  140. package/src/models/UserNotificationListItemDto.ts +1 -0
  141. package/src/models/UserPasskeyDto.ts +111 -0
  142. package/src/models/UserSecurityDto.ts +171 -0
  143. package/src/models/UserSignInFactor.ts +54 -0
  144. package/src/models/index.ts +33 -0
@@ -15,69 +15,984 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ ActivateUserTotpInput,
18
19
  ChangeUserEmailWithOtpInput,
20
+ ChangeUserLoginLocationVerificationInput,
21
+ ChangeUserPasswordInput,
22
+ ChangeUserSignInStepsInput,
23
+ CurrentPasswordInput,
24
+ ListUserLoginAttempts200Response,
25
+ PasskeyOptionsDto,
26
+ ReauthenticateWithPasskeyInput,
27
+ ReauthenticationDto,
28
+ RecoveryCodesDto,
29
+ RegisterUserPasskeyInput,
19
30
  RegisterUserPushTokenInput,
31
+ RemoveUserPasskeyInput,
32
+ RenameUserPasskeyInput,
20
33
  RequestUserEmailChangeOtpInput,
21
34
  StoreUserLocaleInput,
35
+ TotpCodeInput,
36
+ TotpEnrolmentDto,
22
37
  UpdateUserNotificationSettingsInput,
23
38
  UserNotificationSettingsDto,
39
+ UserSecurityDto,
24
40
  ValidationException,
25
41
  } from '../models/index';
26
42
  import {
43
+ ActivateUserTotpInputFromJSON,
44
+ ActivateUserTotpInputToJSON,
27
45
  ChangeUserEmailWithOtpInputFromJSON,
28
46
  ChangeUserEmailWithOtpInputToJSON,
47
+ ChangeUserLoginLocationVerificationInputFromJSON,
48
+ ChangeUserLoginLocationVerificationInputToJSON,
49
+ ChangeUserPasswordInputFromJSON,
50
+ ChangeUserPasswordInputToJSON,
51
+ ChangeUserSignInStepsInputFromJSON,
52
+ ChangeUserSignInStepsInputToJSON,
53
+ CurrentPasswordInputFromJSON,
54
+ CurrentPasswordInputToJSON,
55
+ ListUserLoginAttempts200ResponseFromJSON,
56
+ ListUserLoginAttempts200ResponseToJSON,
57
+ PasskeyOptionsDtoFromJSON,
58
+ PasskeyOptionsDtoToJSON,
59
+ ReauthenticateWithPasskeyInputFromJSON,
60
+ ReauthenticateWithPasskeyInputToJSON,
61
+ ReauthenticationDtoFromJSON,
62
+ ReauthenticationDtoToJSON,
63
+ RecoveryCodesDtoFromJSON,
64
+ RecoveryCodesDtoToJSON,
65
+ RegisterUserPasskeyInputFromJSON,
66
+ RegisterUserPasskeyInputToJSON,
29
67
  RegisterUserPushTokenInputFromJSON,
30
68
  RegisterUserPushTokenInputToJSON,
69
+ RemoveUserPasskeyInputFromJSON,
70
+ RemoveUserPasskeyInputToJSON,
71
+ RenameUserPasskeyInputFromJSON,
72
+ RenameUserPasskeyInputToJSON,
31
73
  RequestUserEmailChangeOtpInputFromJSON,
32
74
  RequestUserEmailChangeOtpInputToJSON,
33
75
  StoreUserLocaleInputFromJSON,
34
76
  StoreUserLocaleInputToJSON,
77
+ TotpCodeInputFromJSON,
78
+ TotpCodeInputToJSON,
79
+ TotpEnrolmentDtoFromJSON,
80
+ TotpEnrolmentDtoToJSON,
35
81
  UpdateUserNotificationSettingsInputFromJSON,
36
82
  UpdateUserNotificationSettingsInputToJSON,
37
83
  UserNotificationSettingsDtoFromJSON,
38
84
  UserNotificationSettingsDtoToJSON,
85
+ UserSecurityDtoFromJSON,
86
+ UserSecurityDtoToJSON,
39
87
  ValidationExceptionFromJSON,
40
88
  ValidationExceptionToJSON,
41
89
  } from '../models/index';
42
90
 
91
+ export interface UsersApiActivateUserTotpRequest {
92
+ activateUserTotpInput: ActivateUserTotpInput;
93
+ }
94
+
95
+ export interface UsersApiActivateUserTotpReplacementRequest {
96
+ activateUserTotpInput: ActivateUserTotpInput;
97
+ }
98
+
43
99
  export interface UsersApiChangeUserEmailWithOtpRequest {
44
100
  changeUserEmailWithOtpInput: ChangeUserEmailWithOtpInput;
45
101
  }
46
102
 
47
- export interface UsersApiRegisterUserPushTokenRequest {
48
- registerUserPushTokenInput: RegisterUserPushTokenInput;
49
- }
103
+ export interface UsersApiChangeUserLoginLocationVerificationRequest {
104
+ changeUserLoginLocationVerificationInput: ChangeUserLoginLocationVerificationInput;
105
+ xReauthenticationToken?: string;
106
+ }
107
+
108
+ export interface UsersApiChangeUserPasswordRequest {
109
+ changeUserPasswordInput: ChangeUserPasswordInput;
110
+ }
111
+
112
+ export interface UsersApiChangeUserSignInStepsRequest {
113
+ xReauthenticationToken: string;
114
+ changeUserSignInStepsInput: ChangeUserSignInStepsInput;
115
+ }
116
+
117
+ export interface UsersApiDisableUserRecoveryCodesRequest {
118
+ xReauthenticationToken: string;
119
+ }
120
+
121
+ export interface UsersApiDisableUserTotpRequest {
122
+ totpCodeInput: TotpCodeInput;
123
+ }
124
+
125
+ export interface UsersApiEnableUserRecoveryCodesRequest {
126
+ xReauthenticationToken: string;
127
+ }
128
+
129
+ export interface UsersApiGetUserPasskeyRegistrationOptionsRequest {
130
+ xReauthenticationToken: string;
131
+ }
132
+
133
+ export interface UsersApiGetUserPasskeyVerificationOptionsRequest {
134
+ passkeyId: string;
135
+ }
136
+
137
+ export interface UsersApiListUserLoginAttemptsRequest {
138
+ filter?: { [key: string]: string; };
139
+ page?: number;
140
+ limit?: number;
141
+ sortBy?: Array<string>;
142
+ filterResult?: string;
143
+ filterMethod?: string;
144
+ }
145
+
146
+ export interface UsersApiReauthenticateWithPasskeyRequest {
147
+ reauthenticateWithPasskeyInput: ReauthenticateWithPasskeyInput;
148
+ }
149
+
150
+ export interface UsersApiReauthenticateWithPasswordRequest {
151
+ currentPasswordInput: CurrentPasswordInput;
152
+ }
153
+
154
+ export interface UsersApiReauthenticateWithTotpRequest {
155
+ activateUserTotpInput: ActivateUserTotpInput;
156
+ }
157
+
158
+ export interface UsersApiRegenerateUserRecoveryCodesRequest {
159
+ xReauthenticationToken: string;
160
+ }
161
+
162
+ export interface UsersApiRegisterUserPasskeyRequest {
163
+ xReauthenticationToken: string;
164
+ registerUserPasskeyInput: RegisterUserPasskeyInput;
165
+ }
166
+
167
+ export interface UsersApiRegisterUserPushTokenRequest {
168
+ registerUserPushTokenInput: RegisterUserPushTokenInput;
169
+ }
170
+
171
+ export interface UsersApiRemoveUserPasskeyRequest {
172
+ passkeyId: string;
173
+ removeUserPasskeyInput: RemoveUserPasskeyInput;
174
+ }
175
+
176
+ export interface UsersApiRemoveUserPushTokenRequest {
177
+ token: string;
178
+ }
179
+
180
+ export interface UsersApiRenameUserPasskeyRequest {
181
+ passkeyId: string;
182
+ renameUserPasskeyInput: RenameUserPasskeyInput;
183
+ }
184
+
185
+ export interface UsersApiRequestUserEmailChangeOtpRequest {
186
+ requestUserEmailChangeOtpInput: RequestUserEmailChangeOtpInput;
187
+ }
188
+
189
+ export interface UsersApiSetLocaleRequest {
190
+ storeUserLocaleInput: StoreUserLocaleInput;
191
+ }
192
+
193
+ export interface UsersApiStartUserTotpEnrolmentRequest {
194
+ xReauthenticationToken: string;
195
+ }
196
+
197
+ export interface UsersApiStartUserTotpReplacementRequest {
198
+ totpCodeInput: TotpCodeInput;
199
+ }
200
+
201
+ export interface UsersApiUpdateUserNotificationSettingsRequest {
202
+ updateUserNotificationSettingsInput: UpdateUserNotificationSettingsInput;
203
+ }
204
+
205
+ /**
206
+ *
207
+ */
208
+ export class UsersApi extends runtime.BaseAPI {
209
+
210
+ /**
211
+ * Turn the authenticator app on with one of its codes
212
+ */
213
+ async activateUserTotpRaw(requestParameters: UsersApiActivateUserTotpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
214
+ if (requestParameters['activateUserTotpInput'] == null) {
215
+ throw new runtime.RequiredError(
216
+ 'activateUserTotpInput',
217
+ 'Required parameter "activateUserTotpInput" was null or undefined when calling activateUserTotp().'
218
+ );
219
+ }
220
+
221
+ const queryParameters: any = {};
222
+
223
+ const headerParameters: runtime.HTTPHeaders = {};
224
+
225
+ headerParameters['Content-Type'] = 'application/json';
226
+
227
+ if (this.configuration && this.configuration.accessToken) {
228
+ const token = this.configuration.accessToken;
229
+ const tokenString = await token("bearer", []);
230
+
231
+ if (tokenString) {
232
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
233
+ }
234
+ }
235
+ const response = await this.request({
236
+ path: `/private/users/security/totp/activate`,
237
+ method: 'POST',
238
+ headers: headerParameters,
239
+ query: queryParameters,
240
+ body: ActivateUserTotpInputToJSON(requestParameters['activateUserTotpInput']),
241
+ }, initOverrides);
242
+
243
+ return new runtime.VoidApiResponse(response);
244
+ }
245
+
246
+ /**
247
+ * Turn the authenticator app on with one of its codes
248
+ */
249
+ async activateUserTotp(requestParameters: UsersApiActivateUserTotpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
250
+ await this.activateUserTotpRaw(requestParameters, initOverrides);
251
+ }
252
+
253
+ /**
254
+ * The new app replaces the current one. The sign-in method and the recovery codes stay as they are.
255
+ * Move to the new authenticator app with one of its codes
256
+ */
257
+ async activateUserTotpReplacementRaw(requestParameters: UsersApiActivateUserTotpReplacementRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
258
+ if (requestParameters['activateUserTotpInput'] == null) {
259
+ throw new runtime.RequiredError(
260
+ 'activateUserTotpInput',
261
+ 'Required parameter "activateUserTotpInput" was null or undefined when calling activateUserTotpReplacement().'
262
+ );
263
+ }
264
+
265
+ const queryParameters: any = {};
266
+
267
+ const headerParameters: runtime.HTTPHeaders = {};
268
+
269
+ headerParameters['Content-Type'] = 'application/json';
270
+
271
+ if (this.configuration && this.configuration.accessToken) {
272
+ const token = this.configuration.accessToken;
273
+ const tokenString = await token("bearer", []);
274
+
275
+ if (tokenString) {
276
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
277
+ }
278
+ }
279
+ const response = await this.request({
280
+ path: `/private/users/security/totp/replace/activate`,
281
+ method: 'POST',
282
+ headers: headerParameters,
283
+ query: queryParameters,
284
+ body: ActivateUserTotpInputToJSON(requestParameters['activateUserTotpInput']),
285
+ }, initOverrides);
286
+
287
+ return new runtime.VoidApiResponse(response);
288
+ }
289
+
290
+ /**
291
+ * The new app replaces the current one. The sign-in method and the recovery codes stay as they are.
292
+ * Move to the new authenticator app with one of its codes
293
+ */
294
+ async activateUserTotpReplacement(requestParameters: UsersApiActivateUserTotpReplacementRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
295
+ await this.activateUserTotpReplacementRaw(requestParameters, initOverrides);
296
+ }
297
+
298
+ /**
299
+ * Changes the seller user email after validating the OTP sent to the new address. **API key scope required:** `USER_EMAIL_WRITE`. Requests authenticated with a seller session do not need any scope.
300
+ * Change user email with OTP
301
+ */
302
+ async changeUserEmailWithOtpRaw(requestParameters: UsersApiChangeUserEmailWithOtpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
303
+ if (requestParameters['changeUserEmailWithOtpInput'] == null) {
304
+ throw new runtime.RequiredError(
305
+ 'changeUserEmailWithOtpInput',
306
+ 'Required parameter "changeUserEmailWithOtpInput" was null or undefined when calling changeUserEmailWithOtp().'
307
+ );
308
+ }
309
+
310
+ const queryParameters: any = {};
311
+
312
+ const headerParameters: runtime.HTTPHeaders = {};
313
+
314
+ headerParameters['Content-Type'] = 'application/json';
315
+
316
+ if (this.configuration && this.configuration.apiKey) {
317
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
318
+ }
319
+
320
+ if (this.configuration && this.configuration.accessToken) {
321
+ const token = this.configuration.accessToken;
322
+ const tokenString = await token("bearer", []);
323
+
324
+ if (tokenString) {
325
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
326
+ }
327
+ }
328
+ const response = await this.request({
329
+ path: `/private/users/email`,
330
+ method: 'PATCH',
331
+ headers: headerParameters,
332
+ query: queryParameters,
333
+ body: ChangeUserEmailWithOtpInputToJSON(requestParameters['changeUserEmailWithOtpInput']),
334
+ }, initOverrides);
335
+
336
+ return new runtime.VoidApiResponse(response);
337
+ }
338
+
339
+ /**
340
+ * Changes the seller user email after validating the OTP sent to the new address. **API key scope required:** `USER_EMAIL_WRITE`. Requests authenticated with a seller session do not need any scope.
341
+ * Change user email with OTP
342
+ */
343
+ async changeUserEmailWithOtp(requestParameters: UsersApiChangeUserEmailWithOtpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
344
+ await this.changeUserEmailWithOtpRaw(requestParameters, initOverrides);
345
+ }
346
+
347
+ /**
348
+ * Turning it off needs the reauthentication token.
349
+ * Turn the email confirmation of new locations on or off
350
+ */
351
+ async changeUserLoginLocationVerificationRaw(requestParameters: UsersApiChangeUserLoginLocationVerificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserSecurityDto>> {
352
+ if (requestParameters['changeUserLoginLocationVerificationInput'] == null) {
353
+ throw new runtime.RequiredError(
354
+ 'changeUserLoginLocationVerificationInput',
355
+ 'Required parameter "changeUserLoginLocationVerificationInput" was null or undefined when calling changeUserLoginLocationVerification().'
356
+ );
357
+ }
358
+
359
+ const queryParameters: any = {};
360
+
361
+ const headerParameters: runtime.HTTPHeaders = {};
362
+
363
+ headerParameters['Content-Type'] = 'application/json';
364
+
365
+ if (requestParameters['xReauthenticationToken'] != null) {
366
+ headerParameters['x-reauthentication-token'] = String(requestParameters['xReauthenticationToken']);
367
+ }
368
+
369
+ if (this.configuration && this.configuration.accessToken) {
370
+ const token = this.configuration.accessToken;
371
+ const tokenString = await token("bearer", []);
372
+
373
+ if (tokenString) {
374
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
375
+ }
376
+ }
377
+ const response = await this.request({
378
+ path: `/private/users/security/login-location-verification`,
379
+ method: 'PATCH',
380
+ headers: headerParameters,
381
+ query: queryParameters,
382
+ body: ChangeUserLoginLocationVerificationInputToJSON(requestParameters['changeUserLoginLocationVerificationInput']),
383
+ }, initOverrides);
384
+
385
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserSecurityDtoFromJSON(jsonValue));
386
+ }
387
+
388
+ /**
389
+ * Turning it off needs the reauthentication token.
390
+ * Turn the email confirmation of new locations on or off
391
+ */
392
+ async changeUserLoginLocationVerification(requestParameters: UsersApiChangeUserLoginLocationVerificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserSecurityDto> {
393
+ const response = await this.changeUserLoginLocationVerificationRaw(requestParameters, initOverrides);
394
+ return await response.value();
395
+ }
396
+
397
+ /**
398
+ * Requires the current password.
399
+ * Change the password
400
+ */
401
+ async changeUserPasswordRaw(requestParameters: UsersApiChangeUserPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
402
+ if (requestParameters['changeUserPasswordInput'] == null) {
403
+ throw new runtime.RequiredError(
404
+ 'changeUserPasswordInput',
405
+ 'Required parameter "changeUserPasswordInput" was null or undefined when calling changeUserPassword().'
406
+ );
407
+ }
408
+
409
+ const queryParameters: any = {};
410
+
411
+ const headerParameters: runtime.HTTPHeaders = {};
412
+
413
+ headerParameters['Content-Type'] = 'application/json';
414
+
415
+ if (this.configuration && this.configuration.accessToken) {
416
+ const token = this.configuration.accessToken;
417
+ const tokenString = await token("bearer", []);
418
+
419
+ if (tokenString) {
420
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
421
+ }
422
+ }
423
+ const response = await this.request({
424
+ path: `/private/users/password`,
425
+ method: 'PATCH',
426
+ headers: headerParameters,
427
+ query: queryParameters,
428
+ body: ChangeUserPasswordInputToJSON(requestParameters['changeUserPasswordInput']),
429
+ }, initOverrides);
430
+
431
+ return new runtime.VoidApiResponse(response);
432
+ }
433
+
434
+ /**
435
+ * Requires the current password.
436
+ * Change the password
437
+ */
438
+ async changeUserPassword(requestParameters: UsersApiChangeUserPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
439
+ await this.changeUserPasswordRaw(requestParameters, initOverrides);
440
+ }
441
+
442
+ /**
443
+ * Only factors the user set up (see setUpSignInFactors), at least minSignInSteps steps, no authenticator app in the first step and no factor in two steps; otherwise a SIGN_IN_STEPS_* error. Needs the reauthentication token: other steps can also lock the user out of a sign-in they rely on.
444
+ * Change the steps the user signs in with
445
+ */
446
+ async changeUserSignInStepsRaw(requestParameters: UsersApiChangeUserSignInStepsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserSecurityDto>> {
447
+ if (requestParameters['xReauthenticationToken'] == null) {
448
+ throw new runtime.RequiredError(
449
+ 'xReauthenticationToken',
450
+ 'Required parameter "xReauthenticationToken" was null or undefined when calling changeUserSignInSteps().'
451
+ );
452
+ }
453
+
454
+ if (requestParameters['changeUserSignInStepsInput'] == null) {
455
+ throw new runtime.RequiredError(
456
+ 'changeUserSignInStepsInput',
457
+ 'Required parameter "changeUserSignInStepsInput" was null or undefined when calling changeUserSignInSteps().'
458
+ );
459
+ }
460
+
461
+ const queryParameters: any = {};
462
+
463
+ const headerParameters: runtime.HTTPHeaders = {};
464
+
465
+ headerParameters['Content-Type'] = 'application/json';
466
+
467
+ if (requestParameters['xReauthenticationToken'] != null) {
468
+ headerParameters['x-reauthentication-token'] = String(requestParameters['xReauthenticationToken']);
469
+ }
470
+
471
+ if (this.configuration && this.configuration.accessToken) {
472
+ const token = this.configuration.accessToken;
473
+ const tokenString = await token("bearer", []);
474
+
475
+ if (tokenString) {
476
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
477
+ }
478
+ }
479
+ const response = await this.request({
480
+ path: `/private/users/security/sign-in-steps`,
481
+ method: 'PATCH',
482
+ headers: headerParameters,
483
+ query: queryParameters,
484
+ body: ChangeUserSignInStepsInputToJSON(requestParameters['changeUserSignInStepsInput']),
485
+ }, initOverrides);
486
+
487
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserSecurityDtoFromJSON(jsonValue));
488
+ }
489
+
490
+ /**
491
+ * Only factors the user set up (see setUpSignInFactors), at least minSignInSteps steps, no authenticator app in the first step and no factor in two steps; otherwise a SIGN_IN_STEPS_* error. Needs the reauthentication token: other steps can also lock the user out of a sign-in they rely on.
492
+ * Change the steps the user signs in with
493
+ */
494
+ async changeUserSignInSteps(requestParameters: UsersApiChangeUserSignInStepsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserSecurityDto> {
495
+ const response = await this.changeUserSignInStepsRaw(requestParameters, initOverrides);
496
+ return await response.value();
497
+ }
498
+
499
+ /**
500
+ * The current codes stop working.
501
+ * Turn recovery codes off
502
+ */
503
+ async disableUserRecoveryCodesRaw(requestParameters: UsersApiDisableUserRecoveryCodesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
504
+ if (requestParameters['xReauthenticationToken'] == null) {
505
+ throw new runtime.RequiredError(
506
+ 'xReauthenticationToken',
507
+ 'Required parameter "xReauthenticationToken" was null or undefined when calling disableUserRecoveryCodes().'
508
+ );
509
+ }
510
+
511
+ const queryParameters: any = {};
512
+
513
+ const headerParameters: runtime.HTTPHeaders = {};
514
+
515
+ if (requestParameters['xReauthenticationToken'] != null) {
516
+ headerParameters['x-reauthentication-token'] = String(requestParameters['xReauthenticationToken']);
517
+ }
518
+
519
+ if (this.configuration && this.configuration.accessToken) {
520
+ const token = this.configuration.accessToken;
521
+ const tokenString = await token("bearer", []);
522
+
523
+ if (tokenString) {
524
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
525
+ }
526
+ }
527
+ const response = await this.request({
528
+ path: `/private/users/security/recovery-codes`,
529
+ method: 'DELETE',
530
+ headers: headerParameters,
531
+ query: queryParameters,
532
+ }, initOverrides);
533
+
534
+ return new runtime.VoidApiResponse(response);
535
+ }
536
+
537
+ /**
538
+ * The current codes stop working.
539
+ * Turn recovery codes off
540
+ */
541
+ async disableUserRecoveryCodes(requestParameters: UsersApiDisableUserRecoveryCodesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
542
+ await this.disableUserRecoveryCodesRaw(requestParameters, initOverrides);
543
+ }
544
+
545
+ /**
546
+ * Needs a code of the app being turned off. Wrong codes count towards locking the verification step.
547
+ * Turn the authenticator app off
548
+ */
549
+ async disableUserTotpRaw(requestParameters: UsersApiDisableUserTotpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
550
+ if (requestParameters['totpCodeInput'] == null) {
551
+ throw new runtime.RequiredError(
552
+ 'totpCodeInput',
553
+ 'Required parameter "totpCodeInput" was null or undefined when calling disableUserTotp().'
554
+ );
555
+ }
556
+
557
+ const queryParameters: any = {};
558
+
559
+ const headerParameters: runtime.HTTPHeaders = {};
560
+
561
+ headerParameters['Content-Type'] = 'application/json';
562
+
563
+ if (this.configuration && this.configuration.accessToken) {
564
+ const token = this.configuration.accessToken;
565
+ const tokenString = await token("bearer", []);
566
+
567
+ if (tokenString) {
568
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
569
+ }
570
+ }
571
+ const response = await this.request({
572
+ path: `/private/users/security/totp`,
573
+ method: 'DELETE',
574
+ headers: headerParameters,
575
+ query: queryParameters,
576
+ body: TotpCodeInputToJSON(requestParameters['totpCodeInput']),
577
+ }, initOverrides);
578
+
579
+ return new runtime.VoidApiResponse(response);
580
+ }
581
+
582
+ /**
583
+ * Needs a code of the app being turned off. Wrong codes count towards locking the verification step.
584
+ * Turn the authenticator app off
585
+ */
586
+ async disableUserTotp(requestParameters: UsersApiDisableUserTotpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
587
+ await this.disableUserTotpRaw(requestParameters, initOverrides);
588
+ }
589
+
590
+ /**
591
+ * Returns the codes, only this once. Needs an authenticator app or a passkey for them to stand in for.
592
+ * Turn recovery codes on
593
+ */
594
+ async enableUserRecoveryCodesRaw(requestParameters: UsersApiEnableUserRecoveryCodesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RecoveryCodesDto>> {
595
+ if (requestParameters['xReauthenticationToken'] == null) {
596
+ throw new runtime.RequiredError(
597
+ 'xReauthenticationToken',
598
+ 'Required parameter "xReauthenticationToken" was null or undefined when calling enableUserRecoveryCodes().'
599
+ );
600
+ }
601
+
602
+ const queryParameters: any = {};
603
+
604
+ const headerParameters: runtime.HTTPHeaders = {};
605
+
606
+ if (requestParameters['xReauthenticationToken'] != null) {
607
+ headerParameters['x-reauthentication-token'] = String(requestParameters['xReauthenticationToken']);
608
+ }
609
+
610
+ if (this.configuration && this.configuration.accessToken) {
611
+ const token = this.configuration.accessToken;
612
+ const tokenString = await token("bearer", []);
613
+
614
+ if (tokenString) {
615
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
616
+ }
617
+ }
618
+ const response = await this.request({
619
+ path: `/private/users/security/recovery-codes/enable`,
620
+ method: 'POST',
621
+ headers: headerParameters,
622
+ query: queryParameters,
623
+ }, initOverrides);
624
+
625
+ return new runtime.JSONApiResponse(response, (jsonValue) => RecoveryCodesDtoFromJSON(jsonValue));
626
+ }
627
+
628
+ /**
629
+ * Returns the codes, only this once. Needs an authenticator app or a passkey for them to stand in for.
630
+ * Turn recovery codes on
631
+ */
632
+ async enableUserRecoveryCodes(requestParameters: UsersApiEnableUserRecoveryCodesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RecoveryCodesDto> {
633
+ const response = await this.enableUserRecoveryCodesRaw(requestParameters, initOverrides);
634
+ return await response.value();
635
+ }
636
+
637
+ /**
638
+ * Start confirming it is you with a passkey
639
+ */
640
+ async getReauthenticationPasskeyOptionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PasskeyOptionsDto>> {
641
+ const queryParameters: any = {};
642
+
643
+ const headerParameters: runtime.HTTPHeaders = {};
644
+
645
+ if (this.configuration && this.configuration.accessToken) {
646
+ const token = this.configuration.accessToken;
647
+ const tokenString = await token("bearer", []);
648
+
649
+ if (tokenString) {
650
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
651
+ }
652
+ }
653
+ const response = await this.request({
654
+ path: `/private/users/security/reauthenticate/passkey/options`,
655
+ method: 'POST',
656
+ headers: headerParameters,
657
+ query: queryParameters,
658
+ }, initOverrides);
659
+
660
+ return new runtime.JSONApiResponse(response, (jsonValue) => PasskeyOptionsDtoFromJSON(jsonValue));
661
+ }
662
+
663
+ /**
664
+ * Start confirming it is you with a passkey
665
+ */
666
+ async getReauthenticationPasskeyOptions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PasskeyOptionsDto> {
667
+ const response = await this.getReauthenticationPasskeyOptionsRaw(initOverrides);
668
+ return await response.value();
669
+ }
670
+
671
+ /**
672
+ * Returns the notification preferences configured for the seller user. **API key scope required:** `USERS_READ`. Requests authenticated with a seller session do not need any scope.
673
+ * Get user notification settings
674
+ */
675
+ async getUserNotificationSettingsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserNotificationSettingsDto>> {
676
+ const queryParameters: any = {};
677
+
678
+ const headerParameters: runtime.HTTPHeaders = {};
679
+
680
+ if (this.configuration && this.configuration.apiKey) {
681
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
682
+ }
683
+
684
+ if (this.configuration && this.configuration.accessToken) {
685
+ const token = this.configuration.accessToken;
686
+ const tokenString = await token("bearer", []);
687
+
688
+ if (tokenString) {
689
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
690
+ }
691
+ }
692
+ const response = await this.request({
693
+ path: `/private/users/notification-settings`,
694
+ method: 'GET',
695
+ headers: headerParameters,
696
+ query: queryParameters,
697
+ }, initOverrides);
698
+
699
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserNotificationSettingsDtoFromJSON(jsonValue));
700
+ }
701
+
702
+ /**
703
+ * Returns the notification preferences configured for the seller user. **API key scope required:** `USERS_READ`. Requests authenticated with a seller session do not need any scope.
704
+ * Get user notification settings
705
+ */
706
+ async getUserNotificationSettings(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserNotificationSettingsDto> {
707
+ const response = await this.getUserNotificationSettingsRaw(initOverrides);
708
+ return await response.value();
709
+ }
710
+
711
+ /**
712
+ * Needs the reauthentication token: a passkey signs in on its own.
713
+ * Start adding a passkey
714
+ */
715
+ async getUserPasskeyRegistrationOptionsRaw(requestParameters: UsersApiGetUserPasskeyRegistrationOptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PasskeyOptionsDto>> {
716
+ if (requestParameters['xReauthenticationToken'] == null) {
717
+ throw new runtime.RequiredError(
718
+ 'xReauthenticationToken',
719
+ 'Required parameter "xReauthenticationToken" was null or undefined when calling getUserPasskeyRegistrationOptions().'
720
+ );
721
+ }
722
+
723
+ const queryParameters: any = {};
724
+
725
+ const headerParameters: runtime.HTTPHeaders = {};
726
+
727
+ if (requestParameters['xReauthenticationToken'] != null) {
728
+ headerParameters['x-reauthentication-token'] = String(requestParameters['xReauthenticationToken']);
729
+ }
730
+
731
+ if (this.configuration && this.configuration.accessToken) {
732
+ const token = this.configuration.accessToken;
733
+ const tokenString = await token("bearer", []);
734
+
735
+ if (tokenString) {
736
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
737
+ }
738
+ }
739
+ const response = await this.request({
740
+ path: `/private/users/security/passkeys/options`,
741
+ method: 'POST',
742
+ headers: headerParameters,
743
+ query: queryParameters,
744
+ }, initOverrides);
745
+
746
+ return new runtime.JSONApiResponse(response, (jsonValue) => PasskeyOptionsDtoFromJSON(jsonValue));
747
+ }
748
+
749
+ /**
750
+ * Needs the reauthentication token: a passkey signs in on its own.
751
+ * Start adding a passkey
752
+ */
753
+ async getUserPasskeyRegistrationOptions(requestParameters: UsersApiGetUserPasskeyRegistrationOptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PasskeyOptionsDto> {
754
+ const response = await this.getUserPasskeyRegistrationOptionsRaw(requestParameters, initOverrides);
755
+ return await response.value();
756
+ }
757
+
758
+ /**
759
+ * Only that passkey can answer.
760
+ * Start using a passkey to prove it, before removing it
761
+ */
762
+ async getUserPasskeyVerificationOptionsRaw(requestParameters: UsersApiGetUserPasskeyVerificationOptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PasskeyOptionsDto>> {
763
+ if (requestParameters['passkeyId'] == null) {
764
+ throw new runtime.RequiredError(
765
+ 'passkeyId',
766
+ 'Required parameter "passkeyId" was null or undefined when calling getUserPasskeyVerificationOptions().'
767
+ );
768
+ }
769
+
770
+ const queryParameters: any = {};
771
+
772
+ const headerParameters: runtime.HTTPHeaders = {};
773
+
774
+ if (this.configuration && this.configuration.accessToken) {
775
+ const token = this.configuration.accessToken;
776
+ const tokenString = await token("bearer", []);
777
+
778
+ if (tokenString) {
779
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
780
+ }
781
+ }
782
+ const response = await this.request({
783
+ path: `/private/users/security/passkeys/{passkeyId}/verification-options`.replace(`{${"passkeyId"}}`, encodeURIComponent(String(requestParameters['passkeyId']))),
784
+ method: 'POST',
785
+ headers: headerParameters,
786
+ query: queryParameters,
787
+ }, initOverrides);
788
+
789
+ return new runtime.JSONApiResponse(response, (jsonValue) => PasskeyOptionsDtoFromJSON(jsonValue));
790
+ }
791
+
792
+ /**
793
+ * Only that passkey can answer.
794
+ * Start using a passkey to prove it, before removing it
795
+ */
796
+ async getUserPasskeyVerificationOptions(requestParameters: UsersApiGetUserPasskeyVerificationOptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PasskeyOptionsDto> {
797
+ const response = await this.getUserPasskeyVerificationOptionsRaw(requestParameters, initOverrides);
798
+ return await response.value();
799
+ }
800
+
801
+ /**
802
+ * Get how the user signs in
803
+ */
804
+ async getUserSecurityRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserSecurityDto>> {
805
+ const queryParameters: any = {};
806
+
807
+ const headerParameters: runtime.HTTPHeaders = {};
808
+
809
+ if (this.configuration && this.configuration.accessToken) {
810
+ const token = this.configuration.accessToken;
811
+ const tokenString = await token("bearer", []);
812
+
813
+ if (tokenString) {
814
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
815
+ }
816
+ }
817
+ const response = await this.request({
818
+ path: `/private/users/security`,
819
+ method: 'GET',
820
+ headers: headerParameters,
821
+ query: queryParameters,
822
+ }, initOverrides);
823
+
824
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserSecurityDtoFromJSON(jsonValue));
825
+ }
826
+
827
+ /**
828
+ * Get how the user signs in
829
+ */
830
+ async getUserSecurity(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserSecurityDto> {
831
+ const response = await this.getUserSecurityRaw(initOverrides);
832
+ return await response.value();
833
+ }
834
+
835
+ /**
836
+ * Every step of every sign-in, successful or not, newest first by default.
837
+ * List the sign-ins of the user
838
+ */
839
+ async listUserLoginAttemptsRaw(requestParameters: UsersApiListUserLoginAttemptsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListUserLoginAttempts200Response>> {
840
+ const queryParameters: any = {};
841
+
842
+ if (requestParameters['filter'] != null) {
843
+ queryParameters['filter'] = requestParameters['filter'];
844
+ }
845
+
846
+ if (requestParameters['page'] != null) {
847
+ queryParameters['page'] = requestParameters['page'];
848
+ }
849
+
850
+ if (requestParameters['limit'] != null) {
851
+ queryParameters['limit'] = requestParameters['limit'];
852
+ }
853
+
854
+ if (requestParameters['sortBy'] != null) {
855
+ queryParameters['sortBy'] = requestParameters['sortBy'];
856
+ }
857
+
858
+ if (requestParameters['filterResult'] != null) {
859
+ queryParameters['filter[result]'] = requestParameters['filterResult'];
860
+ }
861
+
862
+ if (requestParameters['filterMethod'] != null) {
863
+ queryParameters['filter[method]'] = requestParameters['filterMethod'];
864
+ }
865
+
866
+ const headerParameters: runtime.HTTPHeaders = {};
867
+
868
+ if (this.configuration && this.configuration.accessToken) {
869
+ const token = this.configuration.accessToken;
870
+ const tokenString = await token("bearer", []);
871
+
872
+ if (tokenString) {
873
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
874
+ }
875
+ }
876
+ const response = await this.request({
877
+ path: `/private/users/login-attempts`,
878
+ method: 'GET',
879
+ headers: headerParameters,
880
+ query: queryParameters,
881
+ }, initOverrides);
882
+
883
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListUserLoginAttempts200ResponseFromJSON(jsonValue));
884
+ }
885
+
886
+ /**
887
+ * Every step of every sign-in, successful or not, newest first by default.
888
+ * List the sign-ins of the user
889
+ */
890
+ async listUserLoginAttempts(requestParameters: UsersApiListUserLoginAttemptsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListUserLoginAttempts200Response> {
891
+ const response = await this.listUserLoginAttemptsRaw(requestParameters, initOverrides);
892
+ return await response.value();
893
+ }
894
+
895
+ /**
896
+ * For the next ten minutes, sensitive changes accept the returned token.
897
+ * Confirm it is you with a passkey
898
+ */
899
+ async reauthenticateWithPasskeyRaw(requestParameters: UsersApiReauthenticateWithPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ReauthenticationDto>> {
900
+ if (requestParameters['reauthenticateWithPasskeyInput'] == null) {
901
+ throw new runtime.RequiredError(
902
+ 'reauthenticateWithPasskeyInput',
903
+ 'Required parameter "reauthenticateWithPasskeyInput" was null or undefined when calling reauthenticateWithPasskey().'
904
+ );
905
+ }
906
+
907
+ const queryParameters: any = {};
908
+
909
+ const headerParameters: runtime.HTTPHeaders = {};
910
+
911
+ headerParameters['Content-Type'] = 'application/json';
912
+
913
+ if (this.configuration && this.configuration.accessToken) {
914
+ const token = this.configuration.accessToken;
915
+ const tokenString = await token("bearer", []);
916
+
917
+ if (tokenString) {
918
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
919
+ }
920
+ }
921
+ const response = await this.request({
922
+ path: `/private/users/security/reauthenticate/passkey`,
923
+ method: 'POST',
924
+ headers: headerParameters,
925
+ query: queryParameters,
926
+ body: ReauthenticateWithPasskeyInputToJSON(requestParameters['reauthenticateWithPasskeyInput']),
927
+ }, initOverrides);
928
+
929
+ return new runtime.JSONApiResponse(response, (jsonValue) => ReauthenticationDtoFromJSON(jsonValue));
930
+ }
931
+
932
+ /**
933
+ * For the next ten minutes, sensitive changes accept the returned token.
934
+ * Confirm it is you with a passkey
935
+ */
936
+ async reauthenticateWithPasskey(requestParameters: UsersApiReauthenticateWithPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ReauthenticationDto> {
937
+ const response = await this.reauthenticateWithPasskeyRaw(requestParameters, initOverrides);
938
+ return await response.value();
939
+ }
940
+
941
+ /**
942
+ * For the next ten minutes, sensitive changes accept the returned token.
943
+ * Confirm it is you with your password
944
+ */
945
+ async reauthenticateWithPasswordRaw(requestParameters: UsersApiReauthenticateWithPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ReauthenticationDto>> {
946
+ if (requestParameters['currentPasswordInput'] == null) {
947
+ throw new runtime.RequiredError(
948
+ 'currentPasswordInput',
949
+ 'Required parameter "currentPasswordInput" was null or undefined when calling reauthenticateWithPassword().'
950
+ );
951
+ }
952
+
953
+ const queryParameters: any = {};
50
954
 
51
- export interface UsersApiRemoveUserPushTokenRequest {
52
- token: string;
53
- }
955
+ const headerParameters: runtime.HTTPHeaders = {};
54
956
 
55
- export interface UsersApiRequestUserEmailChangeOtpRequest {
56
- requestUserEmailChangeOtpInput: RequestUserEmailChangeOtpInput;
57
- }
957
+ headerParameters['Content-Type'] = 'application/json';
58
958
 
59
- export interface UsersApiSetLocaleRequest {
60
- storeUserLocaleInput: StoreUserLocaleInput;
61
- }
959
+ if (this.configuration && this.configuration.accessToken) {
960
+ const token = this.configuration.accessToken;
961
+ const tokenString = await token("bearer", []);
62
962
 
63
- export interface UsersApiUpdateUserNotificationSettingsRequest {
64
- updateUserNotificationSettingsInput: UpdateUserNotificationSettingsInput;
65
- }
963
+ if (tokenString) {
964
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
965
+ }
966
+ }
967
+ const response = await this.request({
968
+ path: `/private/users/security/reauthenticate/password`,
969
+ method: 'POST',
970
+ headers: headerParameters,
971
+ query: queryParameters,
972
+ body: CurrentPasswordInputToJSON(requestParameters['currentPasswordInput']),
973
+ }, initOverrides);
66
974
 
67
- /**
68
- *
69
- */
70
- export class UsersApi extends runtime.BaseAPI {
975
+ return new runtime.JSONApiResponse(response, (jsonValue) => ReauthenticationDtoFromJSON(jsonValue));
976
+ }
71
977
 
72
978
  /**
73
- * Changes the seller user email after validating the OTP sent to the new address. **API key scope required:** `USER_EMAIL_WRITE`. Requests authenticated with a seller session do not need any scope.
74
- * Change user email with OTP
979
+ * For the next ten minutes, sensitive changes accept the returned token.
980
+ * Confirm it is you with your password
75
981
  */
76
- async changeUserEmailWithOtpRaw(requestParameters: UsersApiChangeUserEmailWithOtpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
77
- if (requestParameters['changeUserEmailWithOtpInput'] == null) {
982
+ async reauthenticateWithPassword(requestParameters: UsersApiReauthenticateWithPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ReauthenticationDto> {
983
+ const response = await this.reauthenticateWithPasswordRaw(requestParameters, initOverrides);
984
+ return await response.value();
985
+ }
986
+
987
+ /**
988
+ * For the next ten minutes, sensitive changes accept the returned token. Wrong codes count towards locking the verification step.
989
+ * Confirm it is you with the code from your authenticator app
990
+ */
991
+ async reauthenticateWithTotpRaw(requestParameters: UsersApiReauthenticateWithTotpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ReauthenticationDto>> {
992
+ if (requestParameters['activateUserTotpInput'] == null) {
78
993
  throw new runtime.RequiredError(
79
- 'changeUserEmailWithOtpInput',
80
- 'Required parameter "changeUserEmailWithOtpInput" was null or undefined when calling changeUserEmailWithOtp().'
994
+ 'activateUserTotpInput',
995
+ 'Required parameter "activateUserTotpInput" was null or undefined when calling reauthenticateWithTotp().'
81
996
  );
82
997
  }
83
998
 
@@ -87,8 +1002,52 @@ export class UsersApi extends runtime.BaseAPI {
87
1002
 
88
1003
  headerParameters['Content-Type'] = 'application/json';
89
1004
 
90
- if (this.configuration && this.configuration.apiKey) {
91
- headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
1005
+ if (this.configuration && this.configuration.accessToken) {
1006
+ const token = this.configuration.accessToken;
1007
+ const tokenString = await token("bearer", []);
1008
+
1009
+ if (tokenString) {
1010
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1011
+ }
1012
+ }
1013
+ const response = await this.request({
1014
+ path: `/private/users/security/reauthenticate/totp`,
1015
+ method: 'POST',
1016
+ headers: headerParameters,
1017
+ query: queryParameters,
1018
+ body: ActivateUserTotpInputToJSON(requestParameters['activateUserTotpInput']),
1019
+ }, initOverrides);
1020
+
1021
+ return new runtime.JSONApiResponse(response, (jsonValue) => ReauthenticationDtoFromJSON(jsonValue));
1022
+ }
1023
+
1024
+ /**
1025
+ * For the next ten minutes, sensitive changes accept the returned token. Wrong codes count towards locking the verification step.
1026
+ * Confirm it is you with the code from your authenticator app
1027
+ */
1028
+ async reauthenticateWithTotp(requestParameters: UsersApiReauthenticateWithTotpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ReauthenticationDto> {
1029
+ const response = await this.reauthenticateWithTotpRaw(requestParameters, initOverrides);
1030
+ return await response.value();
1031
+ }
1032
+
1033
+ /**
1034
+ * The previous codes stop working. Only while recovery codes are on.
1035
+ * Replace the recovery codes
1036
+ */
1037
+ async regenerateUserRecoveryCodesRaw(requestParameters: UsersApiRegenerateUserRecoveryCodesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RecoveryCodesDto>> {
1038
+ if (requestParameters['xReauthenticationToken'] == null) {
1039
+ throw new runtime.RequiredError(
1040
+ 'xReauthenticationToken',
1041
+ 'Required parameter "xReauthenticationToken" was null or undefined when calling regenerateUserRecoveryCodes().'
1042
+ );
1043
+ }
1044
+
1045
+ const queryParameters: any = {};
1046
+
1047
+ const headerParameters: runtime.HTTPHeaders = {};
1048
+
1049
+ if (requestParameters['xReauthenticationToken'] != null) {
1050
+ headerParameters['x-reauthentication-token'] = String(requestParameters['xReauthenticationToken']);
92
1051
  }
93
1052
 
94
1053
  if (this.configuration && this.configuration.accessToken) {
@@ -100,35 +1059,51 @@ export class UsersApi extends runtime.BaseAPI {
100
1059
  }
101
1060
  }
102
1061
  const response = await this.request({
103
- path: `/private/users/email`,
104
- method: 'PATCH',
1062
+ path: `/private/users/security/recovery-codes`,
1063
+ method: 'POST',
105
1064
  headers: headerParameters,
106
1065
  query: queryParameters,
107
- body: ChangeUserEmailWithOtpInputToJSON(requestParameters['changeUserEmailWithOtpInput']),
108
1066
  }, initOverrides);
109
1067
 
110
- return new runtime.VoidApiResponse(response);
1068
+ return new runtime.JSONApiResponse(response, (jsonValue) => RecoveryCodesDtoFromJSON(jsonValue));
111
1069
  }
112
1070
 
113
1071
  /**
114
- * Changes the seller user email after validating the OTP sent to the new address. **API key scope required:** `USER_EMAIL_WRITE`. Requests authenticated with a seller session do not need any scope.
115
- * Change user email with OTP
1072
+ * The previous codes stop working. Only while recovery codes are on.
1073
+ * Replace the recovery codes
116
1074
  */
117
- async changeUserEmailWithOtp(requestParameters: UsersApiChangeUserEmailWithOtpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
118
- await this.changeUserEmailWithOtpRaw(requestParameters, initOverrides);
1075
+ async regenerateUserRecoveryCodes(requestParameters: UsersApiRegenerateUserRecoveryCodesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RecoveryCodesDto> {
1076
+ const response = await this.regenerateUserRecoveryCodesRaw(requestParameters, initOverrides);
1077
+ return await response.value();
119
1078
  }
120
1079
 
121
1080
  /**
122
- * Returns the notification preferences configured for the seller user. **API key scope required:** `USERS_READ`. Requests authenticated with a seller session do not need any scope.
123
- * Get user notification settings
1081
+ * Needs the reauthentication token: a passkey signs in on its own.
1082
+ * Add a passkey
124
1083
  */
125
- async getUserNotificationSettingsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserNotificationSettingsDto>> {
1084
+ async registerUserPasskeyRaw(requestParameters: UsersApiRegisterUserPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
1085
+ if (requestParameters['xReauthenticationToken'] == null) {
1086
+ throw new runtime.RequiredError(
1087
+ 'xReauthenticationToken',
1088
+ 'Required parameter "xReauthenticationToken" was null or undefined when calling registerUserPasskey().'
1089
+ );
1090
+ }
1091
+
1092
+ if (requestParameters['registerUserPasskeyInput'] == null) {
1093
+ throw new runtime.RequiredError(
1094
+ 'registerUserPasskeyInput',
1095
+ 'Required parameter "registerUserPasskeyInput" was null or undefined when calling registerUserPasskey().'
1096
+ );
1097
+ }
1098
+
126
1099
  const queryParameters: any = {};
127
1100
 
128
1101
  const headerParameters: runtime.HTTPHeaders = {};
129
1102
 
130
- if (this.configuration && this.configuration.apiKey) {
131
- headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
1103
+ headerParameters['Content-Type'] = 'application/json';
1104
+
1105
+ if (requestParameters['xReauthenticationToken'] != null) {
1106
+ headerParameters['x-reauthentication-token'] = String(requestParameters['xReauthenticationToken']);
132
1107
  }
133
1108
 
134
1109
  if (this.configuration && this.configuration.accessToken) {
@@ -140,22 +1115,22 @@ export class UsersApi extends runtime.BaseAPI {
140
1115
  }
141
1116
  }
142
1117
  const response = await this.request({
143
- path: `/private/users/notification-settings`,
144
- method: 'GET',
1118
+ path: `/private/users/security/passkeys`,
1119
+ method: 'POST',
145
1120
  headers: headerParameters,
146
1121
  query: queryParameters,
1122
+ body: RegisterUserPasskeyInputToJSON(requestParameters['registerUserPasskeyInput']),
147
1123
  }, initOverrides);
148
1124
 
149
- return new runtime.JSONApiResponse(response, (jsonValue) => UserNotificationSettingsDtoFromJSON(jsonValue));
1125
+ return new runtime.VoidApiResponse(response);
150
1126
  }
151
1127
 
152
1128
  /**
153
- * Returns the notification preferences configured for the seller user. **API key scope required:** `USERS_READ`. Requests authenticated with a seller session do not need any scope.
154
- * Get user notification settings
1129
+ * Needs the reauthentication token: a passkey signs in on its own.
1130
+ * Add a passkey
155
1131
  */
156
- async getUserNotificationSettings(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserNotificationSettingsDto> {
157
- const response = await this.getUserNotificationSettingsRaw(initOverrides);
158
- return await response.value();
1132
+ async registerUserPasskey(requestParameters: UsersApiRegisterUserPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
1133
+ await this.registerUserPasskeyRaw(requestParameters, initOverrides);
159
1134
  }
160
1135
 
161
1136
  /**
@@ -203,6 +1178,58 @@ export class UsersApi extends runtime.BaseAPI {
203
1178
  await this.registerUserPushTokenRaw(requestParameters, initOverrides);
204
1179
  }
205
1180
 
1181
+ /**
1182
+ * Needs that very passkey, used one last time (see the verification options).
1183
+ * Remove a passkey
1184
+ */
1185
+ async removeUserPasskeyRaw(requestParameters: UsersApiRemoveUserPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
1186
+ if (requestParameters['passkeyId'] == null) {
1187
+ throw new runtime.RequiredError(
1188
+ 'passkeyId',
1189
+ 'Required parameter "passkeyId" was null or undefined when calling removeUserPasskey().'
1190
+ );
1191
+ }
1192
+
1193
+ if (requestParameters['removeUserPasskeyInput'] == null) {
1194
+ throw new runtime.RequiredError(
1195
+ 'removeUserPasskeyInput',
1196
+ 'Required parameter "removeUserPasskeyInput" was null or undefined when calling removeUserPasskey().'
1197
+ );
1198
+ }
1199
+
1200
+ const queryParameters: any = {};
1201
+
1202
+ const headerParameters: runtime.HTTPHeaders = {};
1203
+
1204
+ headerParameters['Content-Type'] = 'application/json';
1205
+
1206
+ if (this.configuration && this.configuration.accessToken) {
1207
+ const token = this.configuration.accessToken;
1208
+ const tokenString = await token("bearer", []);
1209
+
1210
+ if (tokenString) {
1211
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1212
+ }
1213
+ }
1214
+ const response = await this.request({
1215
+ path: `/private/users/security/passkeys/{passkeyId}`.replace(`{${"passkeyId"}}`, encodeURIComponent(String(requestParameters['passkeyId']))),
1216
+ method: 'DELETE',
1217
+ headers: headerParameters,
1218
+ query: queryParameters,
1219
+ body: RemoveUserPasskeyInputToJSON(requestParameters['removeUserPasskeyInput']),
1220
+ }, initOverrides);
1221
+
1222
+ return new runtime.VoidApiResponse(response);
1223
+ }
1224
+
1225
+ /**
1226
+ * Needs that very passkey, used one last time (see the verification options).
1227
+ * Remove a passkey
1228
+ */
1229
+ async removeUserPasskey(requestParameters: UsersApiRemoveUserPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
1230
+ await this.removeUserPasskeyRaw(requestParameters, initOverrides);
1231
+ }
1232
+
206
1233
  /**
207
1234
  * Unregisters an Expo push token for the current user, e.g. on logout. Seller session only.
208
1235
  * Remove a push token
@@ -245,6 +1272,56 @@ export class UsersApi extends runtime.BaseAPI {
245
1272
  await this.removeUserPushTokenRaw(requestParameters, initOverrides);
246
1273
  }
247
1274
 
1275
+ /**
1276
+ * Rename a passkey
1277
+ */
1278
+ async renameUserPasskeyRaw(requestParameters: UsersApiRenameUserPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
1279
+ if (requestParameters['passkeyId'] == null) {
1280
+ throw new runtime.RequiredError(
1281
+ 'passkeyId',
1282
+ 'Required parameter "passkeyId" was null or undefined when calling renameUserPasskey().'
1283
+ );
1284
+ }
1285
+
1286
+ if (requestParameters['renameUserPasskeyInput'] == null) {
1287
+ throw new runtime.RequiredError(
1288
+ 'renameUserPasskeyInput',
1289
+ 'Required parameter "renameUserPasskeyInput" was null or undefined when calling renameUserPasskey().'
1290
+ );
1291
+ }
1292
+
1293
+ const queryParameters: any = {};
1294
+
1295
+ const headerParameters: runtime.HTTPHeaders = {};
1296
+
1297
+ headerParameters['Content-Type'] = 'application/json';
1298
+
1299
+ if (this.configuration && this.configuration.accessToken) {
1300
+ const token = this.configuration.accessToken;
1301
+ const tokenString = await token("bearer", []);
1302
+
1303
+ if (tokenString) {
1304
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1305
+ }
1306
+ }
1307
+ const response = await this.request({
1308
+ path: `/private/users/security/passkeys/{passkeyId}`.replace(`{${"passkeyId"}}`, encodeURIComponent(String(requestParameters['passkeyId']))),
1309
+ method: 'PATCH',
1310
+ headers: headerParameters,
1311
+ query: queryParameters,
1312
+ body: RenameUserPasskeyInputToJSON(requestParameters['renameUserPasskeyInput']),
1313
+ }, initOverrides);
1314
+
1315
+ return new runtime.VoidApiResponse(response);
1316
+ }
1317
+
1318
+ /**
1319
+ * Rename a passkey
1320
+ */
1321
+ async renameUserPasskey(requestParameters: UsersApiRenameUserPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
1322
+ await this.renameUserPasskeyRaw(requestParameters, initOverrides);
1323
+ }
1324
+
248
1325
  /**
249
1326
  * Sends a one-time password to the new email address to verify ownership before changing the account email. **API key scope required:** `USER_EMAIL_WRITE`. Requests authenticated with a seller session do not need any scope.
250
1327
  * Request email change OTP
@@ -343,6 +1420,99 @@ export class UsersApi extends runtime.BaseAPI {
343
1420
  await this.setLocaleRaw(requestParameters, initOverrides);
344
1421
  }
345
1422
 
1423
+ /**
1424
+ * Returns the QR code URI and the secret to type by hand. The app is only turned on once a code of it is checked; a new call replaces the secret. Needs the reauthentication token: whoever sets up the app holds the verification step.
1425
+ * Start setting up an authenticator app
1426
+ */
1427
+ async startUserTotpEnrolmentRaw(requestParameters: UsersApiStartUserTotpEnrolmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TotpEnrolmentDto>> {
1428
+ if (requestParameters['xReauthenticationToken'] == null) {
1429
+ throw new runtime.RequiredError(
1430
+ 'xReauthenticationToken',
1431
+ 'Required parameter "xReauthenticationToken" was null or undefined when calling startUserTotpEnrolment().'
1432
+ );
1433
+ }
1434
+
1435
+ const queryParameters: any = {};
1436
+
1437
+ const headerParameters: runtime.HTTPHeaders = {};
1438
+
1439
+ if (requestParameters['xReauthenticationToken'] != null) {
1440
+ headerParameters['x-reauthentication-token'] = String(requestParameters['xReauthenticationToken']);
1441
+ }
1442
+
1443
+ if (this.configuration && this.configuration.accessToken) {
1444
+ const token = this.configuration.accessToken;
1445
+ const tokenString = await token("bearer", []);
1446
+
1447
+ if (tokenString) {
1448
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1449
+ }
1450
+ }
1451
+ const response = await this.request({
1452
+ path: `/private/users/security/totp`,
1453
+ method: 'POST',
1454
+ headers: headerParameters,
1455
+ query: queryParameters,
1456
+ }, initOverrides);
1457
+
1458
+ return new runtime.JSONApiResponse(response, (jsonValue) => TotpEnrolmentDtoFromJSON(jsonValue));
1459
+ }
1460
+
1461
+ /**
1462
+ * Returns the QR code URI and the secret to type by hand. The app is only turned on once a code of it is checked; a new call replaces the secret. Needs the reauthentication token: whoever sets up the app holds the verification step.
1463
+ * Start setting up an authenticator app
1464
+ */
1465
+ async startUserTotpEnrolment(requestParameters: UsersApiStartUserTotpEnrolmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TotpEnrolmentDto> {
1466
+ const response = await this.startUserTotpEnrolmentRaw(requestParameters, initOverrides);
1467
+ return await response.value();
1468
+ }
1469
+
1470
+ /**
1471
+ * Needs a code of the app being replaced; wrong codes count towards locking the verification step. Returns the QR code URI and the secret of the new app. The current app keeps working until a code of the new one is checked.
1472
+ * Start moving to another authenticator app
1473
+ */
1474
+ async startUserTotpReplacementRaw(requestParameters: UsersApiStartUserTotpReplacementRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TotpEnrolmentDto>> {
1475
+ if (requestParameters['totpCodeInput'] == null) {
1476
+ throw new runtime.RequiredError(
1477
+ 'totpCodeInput',
1478
+ 'Required parameter "totpCodeInput" was null or undefined when calling startUserTotpReplacement().'
1479
+ );
1480
+ }
1481
+
1482
+ const queryParameters: any = {};
1483
+
1484
+ const headerParameters: runtime.HTTPHeaders = {};
1485
+
1486
+ headerParameters['Content-Type'] = 'application/json';
1487
+
1488
+ if (this.configuration && this.configuration.accessToken) {
1489
+ const token = this.configuration.accessToken;
1490
+ const tokenString = await token("bearer", []);
1491
+
1492
+ if (tokenString) {
1493
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1494
+ }
1495
+ }
1496
+ const response = await this.request({
1497
+ path: `/private/users/security/totp/replace`,
1498
+ method: 'POST',
1499
+ headers: headerParameters,
1500
+ query: queryParameters,
1501
+ body: TotpCodeInputToJSON(requestParameters['totpCodeInput']),
1502
+ }, initOverrides);
1503
+
1504
+ return new runtime.JSONApiResponse(response, (jsonValue) => TotpEnrolmentDtoFromJSON(jsonValue));
1505
+ }
1506
+
1507
+ /**
1508
+ * Needs a code of the app being replaced; wrong codes count towards locking the verification step. Returns the QR code URI and the secret of the new app. The current app keeps working until a code of the new one is checked.
1509
+ * Start moving to another authenticator app
1510
+ */
1511
+ async startUserTotpReplacement(requestParameters: UsersApiStartUserTotpReplacementRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TotpEnrolmentDto> {
1512
+ const response = await this.startUserTotpReplacementRaw(requestParameters, initOverrides);
1513
+ return await response.value();
1514
+ }
1515
+
346
1516
  /**
347
1517
  * Updates one or more notification preferences for the seller user. **API key scope required:** `USERS_WRITE`. Requests authenticated with a seller session do not need any scope.
348
1518
  * Update user notification settings