@randock/nameshift-api-client 0.0.503 → 0.0.504

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 (141) hide show
  1. package/.openapi-generator/FILES +32 -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 +1305 -46
  9. package/dist/apis/UsersPublicApi.d.ts +107 -3
  10. package/dist/apis/UsersPublicApi.js +388 -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 +88 -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/ChangeUserAuthenticationMethodInput.d.ts +33 -0
  22. package/dist/models/ChangeUserAuthenticationMethodInput.js +52 -0
  23. package/dist/models/ChangeUserLoginLocationVerificationInput.d.ts +32 -0
  24. package/dist/models/ChangeUserLoginLocationVerificationInput.js +51 -0
  25. package/dist/models/ChangeUserPasswordInput.d.ts +38 -0
  26. package/dist/models/ChangeUserPasswordInput.js +55 -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/LoginRecoveryCodeInput.d.ts +38 -0
  48. package/dist/models/LoginRecoveryCodeInput.js +55 -0
  49. package/dist/models/LoginStatus.d.ts +26 -0
  50. package/dist/models/LoginStatus.js +52 -0
  51. package/dist/models/PasskeyOptionsDto.d.ts +40 -0
  52. package/dist/models/PasskeyOptionsDto.js +55 -0
  53. package/dist/models/PrivateAccountGetMeResponse.d.ts +1 -0
  54. package/dist/models/PrivateAccountGetMeResponse.js +2 -1
  55. package/dist/models/ReauthenticateWithPasskeyInput.d.ts +40 -0
  56. package/dist/models/ReauthenticateWithPasskeyInput.js +55 -0
  57. package/dist/models/ReauthenticationDto.d.ts +38 -0
  58. package/dist/models/ReauthenticationDto.js +55 -0
  59. package/dist/models/RecoveryCodesDto.d.ts +32 -0
  60. package/dist/models/RecoveryCodesDto.js +51 -0
  61. package/dist/models/RegisterUserPasskeyInput.d.ts +46 -0
  62. package/dist/models/RegisterUserPasskeyInput.js +59 -0
  63. package/dist/models/RemoveUserPasskeyInput.d.ts +40 -0
  64. package/dist/models/RemoveUserPasskeyInput.js +55 -0
  65. package/dist/models/RenameUserPasskeyInput.d.ts +32 -0
  66. package/dist/models/RenameUserPasskeyInput.js +51 -0
  67. package/dist/models/SecondFactorMethod.d.ts +26 -0
  68. package/dist/models/SecondFactorMethod.js +52 -0
  69. package/dist/models/SellerSecurityUserDto.d.ts +12 -0
  70. package/dist/models/SellerSecurityUserDto.js +4 -0
  71. package/dist/models/TotpCodeInput.d.ts +32 -0
  72. package/dist/models/TotpCodeInput.js +51 -0
  73. package/dist/models/TotpEnrolmentDto.d.ts +38 -0
  74. package/dist/models/TotpEnrolmentDto.js +55 -0
  75. package/dist/models/UserAuthenticationMethod.d.ts +27 -0
  76. package/dist/models/UserAuthenticationMethod.js +53 -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 +30 -0
  82. package/dist/models/UserLoginAttemptResult.js +56 -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/index.d.ts +32 -0
  94. package/dist/models/index.js +32 -0
  95. package/package.json +1 -1
  96. package/src/apis/AdminApi.ts +172 -0
  97. package/src/apis/BuyersPublicApi.ts +6 -6
  98. package/src/apis/UsersApi.ts +1219 -48
  99. package/src/apis/UsersPublicApi.ts +375 -2
  100. package/src/models/ActivateUserTotpInput.ts +66 -0
  101. package/src/models/AdminUserSecurityDto.ts +157 -0
  102. package/src/models/BuyerLoginDto.ts +75 -0
  103. package/src/models/BuyerNotificationDto.ts +1 -0
  104. package/src/models/BuyerNotificationListItemDto.ts +1 -0
  105. package/src/models/ChangeUserAuthenticationMethodInput.ts +76 -0
  106. package/src/models/ChangeUserLoginLocationVerificationInput.ts +66 -0
  107. package/src/models/ChangeUserPasswordInput.ts +75 -0
  108. package/src/models/ConfirmLoginLocationInput.ts +66 -0
  109. package/src/models/CurrentPasswordInput.ts +66 -0
  110. package/src/models/FeatureFlagListItemDto.ts +2 -1
  111. package/src/models/IntersectionAccountDtoWithSettingsDtoWithNotificationsDtoWithFeatureFlagsDto.ts +2 -1
  112. package/src/models/ListUserLoginAttempts200Response.ts +106 -0
  113. package/src/models/LoginChallengeInput.ts +66 -0
  114. package/src/models/LoginCodeInput.ts +75 -0
  115. package/src/models/LoginDto.ts +56 -8
  116. package/src/models/LoginPasskeyInput.ts +83 -0
  117. package/src/models/LoginPasskeyOptionsInput.ts +65 -0
  118. package/src/models/LoginRecoveryCodeInput.ts +75 -0
  119. package/src/models/LoginStatus.ts +54 -0
  120. package/src/models/PasskeyOptionsDto.ts +75 -0
  121. package/src/models/PrivateAccountGetMeResponse.ts +2 -1
  122. package/src/models/ReauthenticateWithPasskeyInput.ts +75 -0
  123. package/src/models/ReauthenticationDto.ts +75 -0
  124. package/src/models/RecoveryCodesDto.ts +66 -0
  125. package/src/models/RegisterUserPasskeyInput.ts +84 -0
  126. package/src/models/RemoveUserPasskeyInput.ts +75 -0
  127. package/src/models/RenameUserPasskeyInput.ts +66 -0
  128. package/src/models/SecondFactorMethod.ts +54 -0
  129. package/src/models/SellerSecurityUserDto.ts +16 -0
  130. package/src/models/TotpCodeInput.ts +66 -0
  131. package/src/models/TotpEnrolmentDto.ts +75 -0
  132. package/src/models/UserAuthenticationMethod.ts +55 -0
  133. package/src/models/UserLoginAttemptDto.ts +164 -0
  134. package/src/models/UserLoginAttemptMethod.ts +57 -0
  135. package/src/models/UserLoginAttemptResult.ts +58 -0
  136. package/src/models/UserLoginLocationConfirmationDetailsDto.ts +111 -0
  137. package/src/models/UserNotificationDto.ts +1 -0
  138. package/src/models/UserNotificationListItemDto.ts +1 -0
  139. package/src/models/UserPasskeyDto.ts +111 -0
  140. package/src/models/UserSecurityDto.ts +173 -0
  141. package/src/models/index.ts +32 -0
@@ -15,26 +15,50 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ ConfirmLoginLocationInput,
18
19
  ForgotPasswordRequestInput,
20
+ LoginChallengeInput,
21
+ LoginCodeInput,
19
22
  LoginDto,
20
23
  LoginInput,
24
+ LoginPasskeyInput,
25
+ LoginPasskeyOptionsInput,
26
+ LoginRecoveryCodeInput,
21
27
  NotificationsUnsubscribeResultDto,
28
+ PasskeyOptionsDto,
22
29
  SetNewPasswordInput,
30
+ UserLoginLocationConfirmationDetailsDto,
23
31
  UserPasswordResetDto,
24
32
  UserSignedTokenInput,
25
33
  ValidationException,
26
34
  } from '../models/index';
27
35
  import {
36
+ ConfirmLoginLocationInputFromJSON,
37
+ ConfirmLoginLocationInputToJSON,
28
38
  ForgotPasswordRequestInputFromJSON,
29
39
  ForgotPasswordRequestInputToJSON,
40
+ LoginChallengeInputFromJSON,
41
+ LoginChallengeInputToJSON,
42
+ LoginCodeInputFromJSON,
43
+ LoginCodeInputToJSON,
30
44
  LoginDtoFromJSON,
31
45
  LoginDtoToJSON,
32
46
  LoginInputFromJSON,
33
47
  LoginInputToJSON,
48
+ LoginPasskeyInputFromJSON,
49
+ LoginPasskeyInputToJSON,
50
+ LoginPasskeyOptionsInputFromJSON,
51
+ LoginPasskeyOptionsInputToJSON,
52
+ LoginRecoveryCodeInputFromJSON,
53
+ LoginRecoveryCodeInputToJSON,
34
54
  NotificationsUnsubscribeResultDtoFromJSON,
35
55
  NotificationsUnsubscribeResultDtoToJSON,
56
+ PasskeyOptionsDtoFromJSON,
57
+ PasskeyOptionsDtoToJSON,
36
58
  SetNewPasswordInputFromJSON,
37
59
  SetNewPasswordInputToJSON,
60
+ UserLoginLocationConfirmationDetailsDtoFromJSON,
61
+ UserLoginLocationConfirmationDetailsDtoToJSON,
38
62
  UserPasswordResetDtoFromJSON,
39
63
  UserPasswordResetDtoToJSON,
40
64
  UserSignedTokenInputFromJSON,
@@ -43,6 +67,11 @@ import {
43
67
  ValidationExceptionToJSON,
44
68
  } from '../models/index';
45
69
 
70
+ export interface UsersPublicApiConfirmLoginLocationRequest {
71
+ confirmationId: string;
72
+ confirmLoginLocationInput: ConfirmLoginLocationInput;
73
+ }
74
+
46
75
  export interface UsersPublicApiForgotPasswordRequestRequest {
47
76
  forgotPasswordRequestInput: ForgotPasswordRequestInput;
48
77
  }
@@ -51,10 +80,39 @@ export interface UsersPublicApiGetForgotPasswordRequestRequest {
51
80
  passwordRequestId: string;
52
81
  }
53
82
 
83
+ export interface UsersPublicApiGetLoginLocationConfirmationDetailsRequest {
84
+ confirmationId: string;
85
+ confirmLoginLocationInput: ConfirmLoginLocationInput;
86
+ }
87
+
88
+ export interface UsersPublicApiGetLoginLocationConfirmationStatusRequest {
89
+ loginChallengeInput: LoginChallengeInput;
90
+ }
91
+
92
+ export interface UsersPublicApiGetLoginPasskeyOptionsRequest {
93
+ loginPasskeyOptionsInput: LoginPasskeyOptionsInput;
94
+ }
95
+
54
96
  export interface UsersPublicApiLoginRequest {
55
97
  loginInput: LoginInput;
56
98
  }
57
99
 
100
+ export interface UsersPublicApiLoginWithPasskeyRequest {
101
+ loginPasskeyInput: LoginPasskeyInput;
102
+ }
103
+
104
+ export interface UsersPublicApiLoginWithRecoveryCodeRequest {
105
+ loginCodeInput: LoginCodeInput;
106
+ }
107
+
108
+ export interface UsersPublicApiLoginWithRecoveryCodeInsteadOfPasskeyRequest {
109
+ loginRecoveryCodeInput: LoginRecoveryCodeInput;
110
+ }
111
+
112
+ export interface UsersPublicApiLoginWithTotpRequest {
113
+ loginCodeInput: LoginCodeInput;
114
+ }
115
+
58
116
  export interface UsersPublicApiPostNewPasswordRequest {
59
117
  passwordRequestId: string;
60
118
  setNewPasswordInput: SetNewPasswordInput;
@@ -69,6 +127,50 @@ export interface UsersPublicApiUnsubscribeFromNotificationsByTokenRequest {
69
127
  */
70
128
  export class UsersPublicApi extends runtime.BaseAPI {
71
129
 
130
+ /**
131
+ * Called by the page the email links to. It only approves the sign-in: no session is returned here.
132
+ * Approve a sign-in from a new location
133
+ */
134
+ async confirmLoginLocationRaw(requestParameters: UsersPublicApiConfirmLoginLocationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
135
+ if (requestParameters['confirmationId'] == null) {
136
+ throw new runtime.RequiredError(
137
+ 'confirmationId',
138
+ 'Required parameter "confirmationId" was null or undefined when calling confirmLoginLocation().'
139
+ );
140
+ }
141
+
142
+ if (requestParameters['confirmLoginLocationInput'] == null) {
143
+ throw new runtime.RequiredError(
144
+ 'confirmLoginLocationInput',
145
+ 'Required parameter "confirmLoginLocationInput" was null or undefined when calling confirmLoginLocation().'
146
+ );
147
+ }
148
+
149
+ const queryParameters: any = {};
150
+
151
+ const headerParameters: runtime.HTTPHeaders = {};
152
+
153
+ headerParameters['Content-Type'] = 'application/json';
154
+
155
+ const response = await this.request({
156
+ path: `/users/login/location-confirmation/{confirmationId}/confirm`.replace(`{${"confirmationId"}}`, encodeURIComponent(String(requestParameters['confirmationId']))),
157
+ method: 'POST',
158
+ headers: headerParameters,
159
+ query: queryParameters,
160
+ body: ConfirmLoginLocationInputToJSON(requestParameters['confirmLoginLocationInput']),
161
+ }, initOverrides);
162
+
163
+ return new runtime.VoidApiResponse(response);
164
+ }
165
+
166
+ /**
167
+ * Called by the page the email links to. It only approves the sign-in: no session is returned here.
168
+ * Approve a sign-in from a new location
169
+ */
170
+ async confirmLoginLocation(requestParameters: UsersPublicApiConfirmLoginLocationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
171
+ await this.confirmLoginLocationRaw(requestParameters, initOverrides);
172
+ }
173
+
72
174
  /**
73
175
  * Creates a password reset request and sends a reset link to the provided email address.
74
176
  * Request a password reset email
@@ -142,7 +244,128 @@ export class UsersPublicApi extends runtime.BaseAPI {
142
244
  }
143
245
 
144
246
  /**
145
- * Validates email and password credentials and returns a JWT token with the user locale.
247
+ * Approves nothing: the page the email links to shows these details and approves only when the user says so, so that mail scanners opening the link approve nothing.
248
+ * See the sign-in an email link asks to approve
249
+ */
250
+ async getLoginLocationConfirmationDetailsRaw(requestParameters: UsersPublicApiGetLoginLocationConfirmationDetailsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserLoginLocationConfirmationDetailsDto>> {
251
+ if (requestParameters['confirmationId'] == null) {
252
+ throw new runtime.RequiredError(
253
+ 'confirmationId',
254
+ 'Required parameter "confirmationId" was null or undefined when calling getLoginLocationConfirmationDetails().'
255
+ );
256
+ }
257
+
258
+ if (requestParameters['confirmLoginLocationInput'] == null) {
259
+ throw new runtime.RequiredError(
260
+ 'confirmLoginLocationInput',
261
+ 'Required parameter "confirmLoginLocationInput" was null or undefined when calling getLoginLocationConfirmationDetails().'
262
+ );
263
+ }
264
+
265
+ const queryParameters: any = {};
266
+
267
+ const headerParameters: runtime.HTTPHeaders = {};
268
+
269
+ headerParameters['Content-Type'] = 'application/json';
270
+
271
+ const response = await this.request({
272
+ path: `/users/login/location-confirmation/{confirmationId}/details`.replace(`{${"confirmationId"}}`, encodeURIComponent(String(requestParameters['confirmationId']))),
273
+ method: 'POST',
274
+ headers: headerParameters,
275
+ query: queryParameters,
276
+ body: ConfirmLoginLocationInputToJSON(requestParameters['confirmLoginLocationInput']),
277
+ }, initOverrides);
278
+
279
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserLoginLocationConfirmationDetailsDtoFromJSON(jsonValue));
280
+ }
281
+
282
+ /**
283
+ * Approves nothing: the page the email links to shows these details and approves only when the user says so, so that mail scanners opening the link approve nothing.
284
+ * See the sign-in an email link asks to approve
285
+ */
286
+ async getLoginLocationConfirmationDetails(requestParameters: UsersPublicApiGetLoginLocationConfirmationDetailsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserLoginLocationConfirmationDetailsDto> {
287
+ const response = await this.getLoginLocationConfirmationDetailsRaw(requestParameters, initOverrides);
288
+ return await response.value();
289
+ }
290
+
291
+ /**
292
+ * Polled by the browser that started the sign-in. It, and only it, gets the session once the user opens the link in the email.
293
+ * Wait for the email confirming a new location
294
+ */
295
+ async getLoginLocationConfirmationStatusRaw(requestParameters: UsersPublicApiGetLoginLocationConfirmationStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginDto>> {
296
+ if (requestParameters['loginChallengeInput'] == null) {
297
+ throw new runtime.RequiredError(
298
+ 'loginChallengeInput',
299
+ 'Required parameter "loginChallengeInput" was null or undefined when calling getLoginLocationConfirmationStatus().'
300
+ );
301
+ }
302
+
303
+ const queryParameters: any = {};
304
+
305
+ const headerParameters: runtime.HTTPHeaders = {};
306
+
307
+ headerParameters['Content-Type'] = 'application/json';
308
+
309
+ const response = await this.request({
310
+ path: `/users/login/location-confirmation/status`,
311
+ method: 'POST',
312
+ headers: headerParameters,
313
+ query: queryParameters,
314
+ body: LoginChallengeInputToJSON(requestParameters['loginChallengeInput']),
315
+ }, initOverrides);
316
+
317
+ return new runtime.JSONApiResponse(response, (jsonValue) => LoginDtoFromJSON(jsonValue));
318
+ }
319
+
320
+ /**
321
+ * Polled by the browser that started the sign-in. It, and only it, gets the session once the user opens the link in the email.
322
+ * Wait for the email confirming a new location
323
+ */
324
+ async getLoginLocationConfirmationStatus(requestParameters: UsersPublicApiGetLoginLocationConfirmationStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginDto> {
325
+ const response = await this.getLoginLocationConfirmationStatusRaw(requestParameters, initOverrides);
326
+ return await response.value();
327
+ }
328
+
329
+ /**
330
+ * Without a challenge token, any passkey of the site on the device can answer and signs in on its own. With one, the passkey is the second factor of that sign-in.
331
+ * Start signing in with a passkey
332
+ */
333
+ async getLoginPasskeyOptionsRaw(requestParameters: UsersPublicApiGetLoginPasskeyOptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PasskeyOptionsDto>> {
334
+ if (requestParameters['loginPasskeyOptionsInput'] == null) {
335
+ throw new runtime.RequiredError(
336
+ 'loginPasskeyOptionsInput',
337
+ 'Required parameter "loginPasskeyOptionsInput" was null or undefined when calling getLoginPasskeyOptions().'
338
+ );
339
+ }
340
+
341
+ const queryParameters: any = {};
342
+
343
+ const headerParameters: runtime.HTTPHeaders = {};
344
+
345
+ headerParameters['Content-Type'] = 'application/json';
346
+
347
+ const response = await this.request({
348
+ path: `/users/login/passkey/options`,
349
+ method: 'POST',
350
+ headers: headerParameters,
351
+ query: queryParameters,
352
+ body: LoginPasskeyOptionsInputToJSON(requestParameters['loginPasskeyOptionsInput']),
353
+ }, initOverrides);
354
+
355
+ return new runtime.JSONApiResponse(response, (jsonValue) => PasskeyOptionsDtoFromJSON(jsonValue));
356
+ }
357
+
358
+ /**
359
+ * Without a challenge token, any passkey of the site on the device can answer and signs in on its own. With one, the passkey is the second factor of that sign-in.
360
+ * Start signing in with a passkey
361
+ */
362
+ async getLoginPasskeyOptions(requestParameters: UsersPublicApiGetLoginPasskeyOptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PasskeyOptionsDto> {
363
+ const response = await this.getLoginPasskeyOptionsRaw(requestParameters, initOverrides);
364
+ return await response.value();
365
+ }
366
+
367
+ /**
368
+ * Validates email and password. Returns the session token, or a challenge token and the next step: a second factor, setting up an authenticator app, or confirming a new location by email.
146
369
  * Authenticate a seller user
147
370
  */
148
371
  async loginRaw(requestParameters: UsersPublicApiLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginDto>> {
@@ -171,7 +394,7 @@ export class UsersPublicApi extends runtime.BaseAPI {
171
394
  }
172
395
 
173
396
  /**
174
- * Validates email and password credentials and returns a JWT token with the user locale.
397
+ * Validates email and password. Returns the session token, or a challenge token and the next step: a second factor, setting up an authenticator app, or confirming a new location by email.
175
398
  * Authenticate a seller user
176
399
  */
177
400
  async login(requestParameters: UsersPublicApiLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginDto> {
@@ -179,6 +402,156 @@ export class UsersPublicApi extends runtime.BaseAPI {
179
402
  return await response.value();
180
403
  }
181
404
 
405
+ /**
406
+ * Sign in with a passkey, or prove the second factor with one
407
+ */
408
+ async loginWithPasskeyRaw(requestParameters: UsersPublicApiLoginWithPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginDto>> {
409
+ if (requestParameters['loginPasskeyInput'] == null) {
410
+ throw new runtime.RequiredError(
411
+ 'loginPasskeyInput',
412
+ 'Required parameter "loginPasskeyInput" was null or undefined when calling loginWithPasskey().'
413
+ );
414
+ }
415
+
416
+ const queryParameters: any = {};
417
+
418
+ const headerParameters: runtime.HTTPHeaders = {};
419
+
420
+ headerParameters['Content-Type'] = 'application/json';
421
+
422
+ const response = await this.request({
423
+ path: `/users/login/passkey`,
424
+ method: 'POST',
425
+ headers: headerParameters,
426
+ query: queryParameters,
427
+ body: LoginPasskeyInputToJSON(requestParameters['loginPasskeyInput']),
428
+ }, initOverrides);
429
+
430
+ return new runtime.JSONApiResponse(response, (jsonValue) => LoginDtoFromJSON(jsonValue));
431
+ }
432
+
433
+ /**
434
+ * Sign in with a passkey, or prove the second factor with one
435
+ */
436
+ async loginWithPasskey(requestParameters: UsersPublicApiLoginWithPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginDto> {
437
+ const response = await this.loginWithPasskeyRaw(requestParameters, initOverrides);
438
+ return await response.value();
439
+ }
440
+
441
+ /**
442
+ * Each recovery code works once.
443
+ * Prove the second factor with a recovery code
444
+ */
445
+ async loginWithRecoveryCodeRaw(requestParameters: UsersPublicApiLoginWithRecoveryCodeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginDto>> {
446
+ if (requestParameters['loginCodeInput'] == null) {
447
+ throw new runtime.RequiredError(
448
+ 'loginCodeInput',
449
+ 'Required parameter "loginCodeInput" was null or undefined when calling loginWithRecoveryCode().'
450
+ );
451
+ }
452
+
453
+ const queryParameters: any = {};
454
+
455
+ const headerParameters: runtime.HTTPHeaders = {};
456
+
457
+ headerParameters['Content-Type'] = 'application/json';
458
+
459
+ const response = await this.request({
460
+ path: `/users/login/recovery-code`,
461
+ method: 'POST',
462
+ headers: headerParameters,
463
+ query: queryParameters,
464
+ body: LoginCodeInputToJSON(requestParameters['loginCodeInput']),
465
+ }, initOverrides);
466
+
467
+ return new runtime.JSONApiResponse(response, (jsonValue) => LoginDtoFromJSON(jsonValue));
468
+ }
469
+
470
+ /**
471
+ * Each recovery code works once.
472
+ * Prove the second factor with a recovery code
473
+ */
474
+ async loginWithRecoveryCode(requestParameters: UsersPublicApiLoginWithRecoveryCodeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginDto> {
475
+ const response = await this.loginWithRecoveryCodeRaw(requestParameters, initOverrides);
476
+ return await response.value();
477
+ }
478
+
479
+ /**
480
+ * For users who sign in without a password: the recovery code stands in for the passkey (and the authenticator app is still asked for when the method needs it). Users who sign in with a password enter it first, then the recovery code as their verification step; here they get the same error as for a wrong code.
481
+ * Sign in with a recovery code instead of a lost passkey
482
+ */
483
+ async loginWithRecoveryCodeInsteadOfPasskeyRaw(requestParameters: UsersPublicApiLoginWithRecoveryCodeInsteadOfPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginDto>> {
484
+ if (requestParameters['loginRecoveryCodeInput'] == null) {
485
+ throw new runtime.RequiredError(
486
+ 'loginRecoveryCodeInput',
487
+ 'Required parameter "loginRecoveryCodeInput" was null or undefined when calling loginWithRecoveryCodeInsteadOfPasskey().'
488
+ );
489
+ }
490
+
491
+ const queryParameters: any = {};
492
+
493
+ const headerParameters: runtime.HTTPHeaders = {};
494
+
495
+ headerParameters['Content-Type'] = 'application/json';
496
+
497
+ const response = await this.request({
498
+ path: `/users/login/recovery-code-instead-of-passkey`,
499
+ method: 'POST',
500
+ headers: headerParameters,
501
+ query: queryParameters,
502
+ body: LoginRecoveryCodeInputToJSON(requestParameters['loginRecoveryCodeInput']),
503
+ }, initOverrides);
504
+
505
+ return new runtime.JSONApiResponse(response, (jsonValue) => LoginDtoFromJSON(jsonValue));
506
+ }
507
+
508
+ /**
509
+ * For users who sign in without a password: the recovery code stands in for the passkey (and the authenticator app is still asked for when the method needs it). Users who sign in with a password enter it first, then the recovery code as their verification step; here they get the same error as for a wrong code.
510
+ * Sign in with a recovery code instead of a lost passkey
511
+ */
512
+ async loginWithRecoveryCodeInsteadOfPasskey(requestParameters: UsersPublicApiLoginWithRecoveryCodeInsteadOfPasskeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginDto> {
513
+ const response = await this.loginWithRecoveryCodeInsteadOfPasskeyRaw(requestParameters, initOverrides);
514
+ return await response.value();
515
+ }
516
+
517
+ /**
518
+ * Accepts the code of the current period, the previous or the next one, never twice.
519
+ * Prove the second factor with an authenticator app code
520
+ */
521
+ async loginWithTotpRaw(requestParameters: UsersPublicApiLoginWithTotpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginDto>> {
522
+ if (requestParameters['loginCodeInput'] == null) {
523
+ throw new runtime.RequiredError(
524
+ 'loginCodeInput',
525
+ 'Required parameter "loginCodeInput" was null or undefined when calling loginWithTotp().'
526
+ );
527
+ }
528
+
529
+ const queryParameters: any = {};
530
+
531
+ const headerParameters: runtime.HTTPHeaders = {};
532
+
533
+ headerParameters['Content-Type'] = 'application/json';
534
+
535
+ const response = await this.request({
536
+ path: `/users/login/totp`,
537
+ method: 'POST',
538
+ headers: headerParameters,
539
+ query: queryParameters,
540
+ body: LoginCodeInputToJSON(requestParameters['loginCodeInput']),
541
+ }, initOverrides);
542
+
543
+ return new runtime.JSONApiResponse(response, (jsonValue) => LoginDtoFromJSON(jsonValue));
544
+ }
545
+
546
+ /**
547
+ * Accepts the code of the current period, the previous or the next one, never twice.
548
+ * Prove the second factor with an authenticator app code
549
+ */
550
+ async loginWithTotp(requestParameters: UsersPublicApiLoginWithTotpRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginDto> {
551
+ const response = await this.loginWithTotpRaw(requestParameters, initOverrides);
552
+ return await response.value();
553
+ }
554
+
182
555
  /**
183
556
  * Completes the password reset flow by setting a new password for the user linked to the reset request.
184
557
  * Set a new password from reset request
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Nameshift
5
+ * Nameshift domain marketplace and management API. ## Authentication - **Bearer JWT** — Seller and buyer sessions obtained via login endpoints. - **API key** — Pass the `apikey` header for programmatic seller access. ## Audiences - **(public)** tags — Unauthenticated or buyer-facing endpoints. - **Accounts / Domains / Leads / Buyers** — Seller or buyer resources. - **Partner** — Partner integrations.
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ActivateUserTotpInput
20
+ */
21
+ export interface ActivateUserTotpInput {
22
+ /**
23
+ * Code the authenticator app shows, to prove it was set up.
24
+ * @type {string}
25
+ * @memberof ActivateUserTotpInput
26
+ */
27
+ code: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the ActivateUserTotpInput interface.
32
+ */
33
+ export function instanceOfActivateUserTotpInput(value: object): value is ActivateUserTotpInput {
34
+ if (!('code' in value) || value['code'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function ActivateUserTotpInputFromJSON(json: any): ActivateUserTotpInput {
39
+ return ActivateUserTotpInputFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function ActivateUserTotpInputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActivateUserTotpInput {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'code': json['code'],
49
+ };
50
+ }
51
+
52
+ export function ActivateUserTotpInputToJSON(json: any): ActivateUserTotpInput {
53
+ return ActivateUserTotpInputToJSONTyped(json, false);
54
+ }
55
+
56
+ export function ActivateUserTotpInputToJSONTyped(value?: ActivateUserTotpInput | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'code': value['code'],
64
+ };
65
+ }
66
+
@@ -0,0 +1,157 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Nameshift
5
+ * Nameshift domain marketplace and management API. ## Authentication - **Bearer JWT** — Seller and buyer sessions obtained via login endpoints. - **API key** — Pass the `apikey` header for programmatic seller access. ## Audiences - **(public)** tags — Unauthenticated or buyer-facing endpoints. - **Accounts / Domains / Leads / Buyers** — Seller or buyer resources. - **Partner** — Partner integrations.
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { UserAuthenticationMethod } from './UserAuthenticationMethod';
17
+ import {
18
+ UserAuthenticationMethodFromJSON,
19
+ UserAuthenticationMethodFromJSONTyped,
20
+ UserAuthenticationMethodToJSON,
21
+ UserAuthenticationMethodToJSONTyped,
22
+ } from './UserAuthenticationMethod';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface AdminUserSecurityDto
28
+ */
29
+ export interface AdminUserSecurityDto {
30
+ /**
31
+ * User ID.
32
+ * @type {string}
33
+ * @memberof AdminUserSecurityDto
34
+ */
35
+ userId: string;
36
+ /**
37
+ * User email.
38
+ * @type {string}
39
+ * @memberof AdminUserSecurityDto
40
+ */
41
+ email: string;
42
+ /**
43
+ * User full name.
44
+ * @type {string}
45
+ * @memberof AdminUserSecurityDto
46
+ */
47
+ name: string;
48
+ /**
49
+ * Roles of the user.
50
+ * @type {Array<string>}
51
+ * @memberof AdminUserSecurityDto
52
+ */
53
+ roles: Array<string>;
54
+ /**
55
+ * Whether the user has a staff role, which requires a second factor or a passkey.
56
+ * @type {boolean}
57
+ * @memberof AdminUserSecurityDto
58
+ */
59
+ isStaff: boolean;
60
+ /**
61
+ * Method the user signs in with.
62
+ * @type {UserAuthenticationMethod}
63
+ * @memberof AdminUserSecurityDto
64
+ */
65
+ authenticationMethod: UserAuthenticationMethod;
66
+ /**
67
+ * Whether an authenticator app is set up.
68
+ * @type {boolean}
69
+ * @memberof AdminUserSecurityDto
70
+ */
71
+ totpEnabled: boolean;
72
+ /**
73
+ * Number of passkeys.
74
+ * @type {number}
75
+ * @memberof AdminUserSecurityDto
76
+ */
77
+ passkeys: number;
78
+ /**
79
+ * Whether a sign-in from a new network has to be confirmed by email.
80
+ * @type {boolean}
81
+ * @memberof AdminUserSecurityDto
82
+ */
83
+ loginLocationVerificationEnabled: boolean;
84
+ /**
85
+ * Last successful sign-in.
86
+ * @type {Date}
87
+ * @memberof AdminUserSecurityDto
88
+ */
89
+ lastLoginAt: Date | null;
90
+ }
91
+
92
+
93
+
94
+ /**
95
+ * Check if a given object implements the AdminUserSecurityDto interface.
96
+ */
97
+ export function instanceOfAdminUserSecurityDto(value: object): value is AdminUserSecurityDto {
98
+ if (!('userId' in value) || value['userId'] === undefined) return false;
99
+ if (!('email' in value) || value['email'] === undefined) return false;
100
+ if (!('name' in value) || value['name'] === undefined) return false;
101
+ if (!('roles' in value) || value['roles'] === undefined) return false;
102
+ if (!('isStaff' in value) || value['isStaff'] === undefined) return false;
103
+ if (!('authenticationMethod' in value) || value['authenticationMethod'] === undefined) return false;
104
+ if (!('totpEnabled' in value) || value['totpEnabled'] === undefined) return false;
105
+ if (!('passkeys' in value) || value['passkeys'] === undefined) return false;
106
+ if (!('loginLocationVerificationEnabled' in value) || value['loginLocationVerificationEnabled'] === undefined) return false;
107
+ if (!('lastLoginAt' in value) || value['lastLoginAt'] === undefined) return false;
108
+ return true;
109
+ }
110
+
111
+ export function AdminUserSecurityDtoFromJSON(json: any): AdminUserSecurityDto {
112
+ return AdminUserSecurityDtoFromJSONTyped(json, false);
113
+ }
114
+
115
+ export function AdminUserSecurityDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminUserSecurityDto {
116
+ if (json == null) {
117
+ return json;
118
+ }
119
+ return {
120
+
121
+ 'userId': json['userId'],
122
+ 'email': json['email'],
123
+ 'name': json['name'],
124
+ 'roles': json['roles'],
125
+ 'isStaff': json['isStaff'],
126
+ 'authenticationMethod': UserAuthenticationMethodFromJSON(json['authenticationMethod']),
127
+ 'totpEnabled': json['totpEnabled'],
128
+ 'passkeys': json['passkeys'],
129
+ 'loginLocationVerificationEnabled': json['loginLocationVerificationEnabled'],
130
+ 'lastLoginAt': (json['lastLoginAt'] == null ? null : new Date(json['lastLoginAt'])),
131
+ };
132
+ }
133
+
134
+ export function AdminUserSecurityDtoToJSON(json: any): AdminUserSecurityDto {
135
+ return AdminUserSecurityDtoToJSONTyped(json, false);
136
+ }
137
+
138
+ export function AdminUserSecurityDtoToJSONTyped(value?: AdminUserSecurityDto | null, ignoreDiscriminator: boolean = false): any {
139
+ if (value == null) {
140
+ return value;
141
+ }
142
+
143
+ return {
144
+
145
+ 'userId': value['userId'],
146
+ 'email': value['email'],
147
+ 'name': value['name'],
148
+ 'roles': value['roles'],
149
+ 'isStaff': value['isStaff'],
150
+ 'authenticationMethod': UserAuthenticationMethodToJSON(value['authenticationMethod']),
151
+ 'totpEnabled': value['totpEnabled'],
152
+ 'passkeys': value['passkeys'],
153
+ 'loginLocationVerificationEnabled': value['loginLocationVerificationEnabled'],
154
+ 'lastLoginAt': (value['lastLoginAt'] == null ? null : (value['lastLoginAt'] as any).toISOString()),
155
+ };
156
+ }
157
+