@knowledge-stack/ksapi 1.87.1 → 1.88.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +18 -0
- package/README.md +16 -2
- package/dist/apis/AuthApi.d.ts +218 -13
- package/dist/apis/AuthApi.js +224 -6
- package/dist/esm/apis/AuthApi.d.ts +218 -13
- package/dist/esm/apis/AuthApi.js +225 -7
- package/dist/esm/models/ChangePhoneNumberRequest.d.ts +53 -0
- package/dist/esm/models/ChangePhoneNumberRequest.js +48 -0
- package/dist/esm/models/CreatePhonePasswordUserRequest.d.ts +71 -0
- package/dist/esm/models/CreatePhonePasswordUserRequest.js +60 -0
- package/dist/esm/models/FeaturesResponse.d.ts +6 -0
- package/dist/esm/models/FeaturesResponse.js +4 -0
- package/dist/esm/models/PasswordResetTokenResponse.d.ts +47 -0
- package/dist/esm/models/PasswordResetTokenResponse.js +44 -0
- package/dist/esm/models/PasswordResetWithTokenRequest.d.ts +2 -2
- package/dist/esm/models/PasswordResetWithTokenRequest.js +3 -3
- package/dist/esm/models/PhoneValidationResponse.d.ts +47 -0
- package/dist/esm/models/PhoneValidationResponse.js +44 -0
- package/dist/esm/models/PhoneVerificationRequest.d.ts +47 -0
- package/dist/esm/models/PhoneVerificationRequest.js +44 -0
- package/dist/esm/models/RequestPhoneChangeRequest.d.ts +47 -0
- package/dist/esm/models/RequestPhoneChangeRequest.js +44 -0
- package/dist/esm/models/ResponseSendPwResetEmail.d.ts +53 -0
- package/dist/esm/models/ResponseSendPwResetEmail.js +48 -0
- package/dist/esm/models/SendPasswordResetRequest.d.ts +67 -0
- package/dist/esm/models/SendPasswordResetRequest.js +53 -0
- package/dist/esm/models/SignInRequest.d.ts +3 -3
- package/dist/esm/models/SignInRequest.js +3 -3
- package/dist/esm/models/UserResponse.d.ts +6 -0
- package/dist/esm/models/UserResponse.js +2 -0
- package/dist/esm/models/ValidateResetCodeRequest.d.ts +53 -0
- package/dist/esm/models/ValidateResetCodeRequest.js +48 -0
- package/dist/esm/models/index.d.ts +9 -0
- package/dist/esm/models/index.js +9 -0
- package/dist/models/ChangePhoneNumberRequest.d.ts +53 -0
- package/dist/models/ChangePhoneNumberRequest.js +56 -0
- package/dist/models/CreatePhonePasswordUserRequest.d.ts +71 -0
- package/dist/models/CreatePhonePasswordUserRequest.js +68 -0
- package/dist/models/FeaturesResponse.d.ts +6 -0
- package/dist/models/FeaturesResponse.js +4 -0
- package/dist/models/PasswordResetTokenResponse.d.ts +47 -0
- package/dist/models/PasswordResetTokenResponse.js +52 -0
- package/dist/models/PasswordResetWithTokenRequest.d.ts +2 -2
- package/dist/models/PasswordResetWithTokenRequest.js +3 -3
- package/dist/models/PhoneValidationResponse.d.ts +47 -0
- package/dist/models/PhoneValidationResponse.js +52 -0
- package/dist/models/PhoneVerificationRequest.d.ts +47 -0
- package/dist/models/PhoneVerificationRequest.js +52 -0
- package/dist/models/RequestPhoneChangeRequest.d.ts +47 -0
- package/dist/models/RequestPhoneChangeRequest.js +52 -0
- package/dist/models/ResponseSendPwResetEmail.d.ts +53 -0
- package/dist/models/ResponseSendPwResetEmail.js +56 -0
- package/dist/models/SendPasswordResetRequest.d.ts +67 -0
- package/dist/models/SendPasswordResetRequest.js +61 -0
- package/dist/models/SignInRequest.d.ts +3 -3
- package/dist/models/SignInRequest.js +3 -3
- package/dist/models/UserResponse.d.ts +6 -0
- package/dist/models/UserResponse.js +2 -0
- package/dist/models/ValidateResetCodeRequest.d.ts +53 -0
- package/dist/models/ValidateResetCodeRequest.js +56 -0
- package/dist/models/index.d.ts +9 -0
- package/dist/models/index.js +9 -0
- package/docs/AuthApi.md +365 -6
- package/docs/ChangePhoneNumberRequest.md +37 -0
- package/docs/CreatePhonePasswordUserRequest.md +43 -0
- package/docs/FeaturesResponse.md +2 -0
- package/docs/PasswordResetTokenResponse.md +34 -0
- package/docs/PasswordResetWithTokenRequest.md +2 -2
- package/docs/PhoneValidationResponse.md +34 -0
- package/docs/PhoneVerificationRequest.md +34 -0
- package/docs/RequestPhoneChangeRequest.md +34 -0
- package/docs/ResponseSendPwResetEmail.md +36 -0
- package/docs/SendPasswordResetRequest.md +38 -0
- package/docs/SignInRequest.md +3 -2
- package/docs/UserResponse.md +2 -0
- package/docs/ValidateResetCodeRequest.md +36 -0
- package/package.json +1 -1
- package/src/apis/AuthApi.ts +452 -17
- package/src/models/ChangePhoneNumberRequest.ts +92 -0
- package/src/models/CreatePhonePasswordUserRequest.ts +120 -0
- package/src/models/FeaturesResponse.ts +9 -0
- package/src/models/PasswordResetTokenResponse.ts +83 -0
- package/src/models/PasswordResetWithTokenRequest.ts +5 -5
- package/src/models/PhoneValidationResponse.ts +83 -0
- package/src/models/PhoneVerificationRequest.ts +83 -0
- package/src/models/RequestPhoneChangeRequest.ts +83 -0
- package/src/models/ResponseSendPwResetEmail.ts +107 -0
- package/src/models/SendPasswordResetRequest.ts +109 -0
- package/src/models/SignInRequest.ts +6 -6
- package/src/models/UserResponse.ts +8 -0
- package/src/models/ValidateResetCodeRequest.ts +92 -0
- package/src/models/index.ts +9 -0
package/dist/esm/apis/AuthApi.js
CHANGED
|
@@ -21,11 +21,56 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
import * as runtime from '../runtime';
|
|
24
|
-
import { CreatePasswordUserRequestToJSON, DirectorySyncResponseFromJSON, EmailSentResponseFromJSON, EmailVerificationRequestToJSON, PasswordResetRequestToJSON, PasswordResetWithTokenRequestToJSON, SSOInitiateResponseFromJSON, SignInRequestToJSON, UserResponseFromJSON, } from '../models/index';
|
|
24
|
+
import { ChangePhoneNumberRequestToJSON, CreatePasswordUserRequestToJSON, CreatePhonePasswordUserRequestToJSON, DirectorySyncResponseFromJSON, EmailSentResponseFromJSON, EmailVerificationRequestToJSON, PasswordResetRequestToJSON, PasswordResetTokenResponseFromJSON, PasswordResetWithTokenRequestToJSON, PhoneValidationResponseFromJSON, PhoneVerificationRequestToJSON, RequestPhoneChangeRequestToJSON, ResponseSendPwResetEmailFromJSON, SSOInitiateResponseFromJSON, SendPasswordResetRequestToJSON, SignInRequestToJSON, UserResponseFromJSON, ValidateResetCodeRequestToJSON, } from '../models/index';
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
28
28
|
export class AuthApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Creates request options for changePhoneNumber without sending the request
|
|
31
|
+
*/
|
|
32
|
+
changePhoneNumberRequestOpts(requestParameters) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (requestParameters['changePhoneNumberRequest'] == null) {
|
|
35
|
+
throw new runtime.RequiredError('changePhoneNumberRequest', 'Required parameter "changePhoneNumberRequest" was null or undefined when calling changePhoneNumber().');
|
|
36
|
+
}
|
|
37
|
+
const queryParameters = {};
|
|
38
|
+
const headerParameters = {};
|
|
39
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
40
|
+
if (requestParameters['authorization'] != null) {
|
|
41
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
42
|
+
}
|
|
43
|
+
let urlPath = `/v1/auth/pw/me/phone_number`;
|
|
44
|
+
return {
|
|
45
|
+
path: urlPath,
|
|
46
|
+
method: 'PUT',
|
|
47
|
+
headers: headerParameters,
|
|
48
|
+
query: queryParameters,
|
|
49
|
+
body: ChangePhoneNumberRequestToJSON(requestParameters['changePhoneNumberRequest']),
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Apply a verified phone-number change to the authenticated user. The new phone is read from the Redis validation record pinned by ``/me/phone_number/verify``.
|
|
55
|
+
* Change Phone Number Handler
|
|
56
|
+
*/
|
|
57
|
+
changePhoneNumberRaw(requestParameters, initOverrides) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const requestOptions = yield this.changePhoneNumberRequestOpts(requestParameters);
|
|
60
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
61
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UserResponseFromJSON(jsonValue));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Apply a verified phone-number change to the authenticated user. The new phone is read from the Redis validation record pinned by ``/me/phone_number/verify``.
|
|
66
|
+
* Change Phone Number Handler
|
|
67
|
+
*/
|
|
68
|
+
changePhoneNumber(requestParameters, initOverrides) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const response = yield this.changePhoneNumberRaw(requestParameters, initOverrides);
|
|
71
|
+
return yield response.value();
|
|
72
|
+
});
|
|
73
|
+
}
|
|
29
74
|
/**
|
|
30
75
|
* Creates request options for createPasswordUser without sending the request
|
|
31
76
|
*/
|
|
@@ -66,6 +111,48 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
66
111
|
return yield response.value();
|
|
67
112
|
});
|
|
68
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Creates request options for createPhonePasswordUser without sending the request
|
|
116
|
+
*/
|
|
117
|
+
createPhonePasswordUserRequestOpts(requestParameters) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
if (requestParameters['createPhonePasswordUserRequest'] == null) {
|
|
120
|
+
throw new runtime.RequiredError('createPhonePasswordUserRequest', 'Required parameter "createPhonePasswordUserRequest" was null or undefined when calling createPhonePasswordUser().');
|
|
121
|
+
}
|
|
122
|
+
const queryParameters = {};
|
|
123
|
+
const headerParameters = {};
|
|
124
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
125
|
+
let urlPath = `/v1/auth/pw/phone_user`;
|
|
126
|
+
return {
|
|
127
|
+
path: urlPath,
|
|
128
|
+
method: 'POST',
|
|
129
|
+
headers: headerParameters,
|
|
130
|
+
query: queryParameters,
|
|
131
|
+
body: CreatePhonePasswordUserRequestToJSON(requestParameters['createPhonePasswordUserRequest']),
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Complete phone-based signup using a verified validation code. The phone number is read from the Redis validation record — it was pinned there by ``/phone_verification`` — so the client cannot submit a different phone here than the one it just proved ownership of.
|
|
137
|
+
* Create Phone Password User Handler
|
|
138
|
+
*/
|
|
139
|
+
createPhonePasswordUserRaw(requestParameters, initOverrides) {
|
|
140
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
const requestOptions = yield this.createPhonePasswordUserRequestOpts(requestParameters);
|
|
142
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
143
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UserResponseFromJSON(jsonValue));
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Complete phone-based signup using a verified validation code. The phone number is read from the Redis validation record — it was pinned there by ``/phone_verification`` — so the client cannot submit a different phone here than the one it just proved ownership of.
|
|
148
|
+
* Create Phone Password User Handler
|
|
149
|
+
*/
|
|
150
|
+
createPhonePasswordUser(requestParameters, initOverrides) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
const response = yield this.createPhonePasswordUserRaw(requestParameters, initOverrides);
|
|
153
|
+
return yield response.value();
|
|
154
|
+
});
|
|
155
|
+
}
|
|
69
156
|
/**
|
|
70
157
|
* Creates request options for fanweiDirectorySync without sending the request
|
|
71
158
|
*/
|
|
@@ -300,6 +387,48 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
300
387
|
return yield response.value();
|
|
301
388
|
});
|
|
302
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* Creates request options for pwPhoneVerification without sending the request
|
|
392
|
+
*/
|
|
393
|
+
pwPhoneVerificationRequestOpts(requestParameters) {
|
|
394
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
395
|
+
if (requestParameters['phoneVerificationRequest'] == null) {
|
|
396
|
+
throw new runtime.RequiredError('phoneVerificationRequest', 'Required parameter "phoneVerificationRequest" was null or undefined when calling pwPhoneVerification().');
|
|
397
|
+
}
|
|
398
|
+
const queryParameters = {};
|
|
399
|
+
const headerParameters = {};
|
|
400
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
401
|
+
let urlPath = `/v1/auth/pw/phone_verification`;
|
|
402
|
+
return {
|
|
403
|
+
path: urlPath,
|
|
404
|
+
method: 'POST',
|
|
405
|
+
headers: headerParameters,
|
|
406
|
+
query: queryParameters,
|
|
407
|
+
body: PhoneVerificationRequestToJSON(requestParameters['phoneVerificationRequest']),
|
|
408
|
+
};
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Send a 6-digit signup verification code to ``phone_number``. Rejects (409) if a user already exists for this phone — this leaks enumeration but matches the duplicate-signup UX of the email flow.
|
|
413
|
+
* Pw Phone Verification Handler
|
|
414
|
+
*/
|
|
415
|
+
pwPhoneVerificationRaw(requestParameters, initOverrides) {
|
|
416
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
417
|
+
const requestOptions = yield this.pwPhoneVerificationRequestOpts(requestParameters);
|
|
418
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
419
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PhoneValidationResponseFromJSON(jsonValue));
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Send a 6-digit signup verification code to ``phone_number``. Rejects (409) if a user already exists for this phone — this leaks enumeration but matches the duplicate-signup UX of the email flow.
|
|
424
|
+
* Pw Phone Verification Handler
|
|
425
|
+
*/
|
|
426
|
+
pwPhoneVerification(requestParameters, initOverrides) {
|
|
427
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
428
|
+
const response = yield this.pwPhoneVerificationRaw(requestParameters, initOverrides);
|
|
429
|
+
return yield response.value();
|
|
430
|
+
});
|
|
431
|
+
}
|
|
303
432
|
/**
|
|
304
433
|
* Creates request options for pwSignin without sending the request
|
|
305
434
|
*/
|
|
@@ -385,6 +514,51 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
385
514
|
return yield response.value();
|
|
386
515
|
});
|
|
387
516
|
}
|
|
517
|
+
/**
|
|
518
|
+
* Creates request options for requestPhoneChange without sending the request
|
|
519
|
+
*/
|
|
520
|
+
requestPhoneChangeRequestOpts(requestParameters) {
|
|
521
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
522
|
+
if (requestParameters['requestPhoneChangeRequest'] == null) {
|
|
523
|
+
throw new runtime.RequiredError('requestPhoneChangeRequest', 'Required parameter "requestPhoneChangeRequest" was null or undefined when calling requestPhoneChange().');
|
|
524
|
+
}
|
|
525
|
+
const queryParameters = {};
|
|
526
|
+
const headerParameters = {};
|
|
527
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
528
|
+
if (requestParameters['authorization'] != null) {
|
|
529
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
530
|
+
}
|
|
531
|
+
let urlPath = `/v1/auth/pw/me/phone_number/verify`;
|
|
532
|
+
return {
|
|
533
|
+
path: urlPath,
|
|
534
|
+
method: 'POST',
|
|
535
|
+
headers: headerParameters,
|
|
536
|
+
query: queryParameters,
|
|
537
|
+
body: RequestPhoneChangeRequestToJSON(requestParameters['requestPhoneChangeRequest']),
|
|
538
|
+
};
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Dispatch an SMS code to authorize a phone-number change. Confirms the new phone isn\'t already taken by *another* user. The caller is identified by their UAT, so authentication is required.
|
|
543
|
+
* Request Phone Change Handler
|
|
544
|
+
*/
|
|
545
|
+
requestPhoneChangeRaw(requestParameters, initOverrides) {
|
|
546
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
547
|
+
const requestOptions = yield this.requestPhoneChangeRequestOpts(requestParameters);
|
|
548
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
549
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PhoneValidationResponseFromJSON(jsonValue));
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Dispatch an SMS code to authorize a phone-number change. Confirms the new phone isn\'t already taken by *another* user. The caller is identified by their UAT, so authentication is required.
|
|
554
|
+
* Request Phone Change Handler
|
|
555
|
+
*/
|
|
556
|
+
requestPhoneChange(requestParameters, initOverrides) {
|
|
557
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
558
|
+
const response = yield this.requestPhoneChangeRaw(requestParameters, initOverrides);
|
|
559
|
+
return yield response.value();
|
|
560
|
+
});
|
|
561
|
+
}
|
|
388
562
|
/**
|
|
389
563
|
* Creates request options for resetPassword without sending the request
|
|
390
564
|
*/
|
|
@@ -452,7 +626,7 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
452
626
|
});
|
|
453
627
|
}
|
|
454
628
|
/**
|
|
455
|
-
* Reset password with
|
|
629
|
+
* Reset password with a single-use PasswordResetToken JWT
|
|
456
630
|
* Reset Password With Token Handler
|
|
457
631
|
*/
|
|
458
632
|
resetPasswordWithTokenRaw(requestParameters, initOverrides) {
|
|
@@ -463,7 +637,7 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
463
637
|
});
|
|
464
638
|
}
|
|
465
639
|
/**
|
|
466
|
-
* Reset password with
|
|
640
|
+
* Reset password with a single-use PasswordResetToken JWT
|
|
467
641
|
* Reset Password With Token Handler
|
|
468
642
|
*/
|
|
469
643
|
resetPasswordWithToken(requestParameters, initOverrides) {
|
|
@@ -477,8 +651,8 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
477
651
|
*/
|
|
478
652
|
sendPwResetEmailRequestOpts(requestParameters) {
|
|
479
653
|
return __awaiter(this, void 0, void 0, function* () {
|
|
480
|
-
if (requestParameters['
|
|
481
|
-
throw new runtime.RequiredError('
|
|
654
|
+
if (requestParameters['sendPasswordResetRequest'] == null) {
|
|
655
|
+
throw new runtime.RequiredError('sendPasswordResetRequest', 'Required parameter "sendPasswordResetRequest" was null or undefined when calling sendPwResetEmail().');
|
|
482
656
|
}
|
|
483
657
|
const queryParameters = {};
|
|
484
658
|
const headerParameters = {};
|
|
@@ -489,21 +663,23 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
489
663
|
method: 'POST',
|
|
490
664
|
headers: headerParameters,
|
|
491
665
|
query: queryParameters,
|
|
492
|
-
body:
|
|
666
|
+
body: SendPasswordResetRequestToJSON(requestParameters['sendPasswordResetRequest']),
|
|
493
667
|
};
|
|
494
668
|
});
|
|
495
669
|
}
|
|
496
670
|
/**
|
|
671
|
+
* Initiate a password reset via the requested ``method``. ``method=EMAIL`` (default) mints a ``PasswordResetToken`` and sends the existing reset email. ``method=SMS`` looks up the user by phone, dispatches an SMS verification code, and the caller must follow up with ``/validate_reset_code``.
|
|
497
672
|
* Send Pw Reset Email Handler
|
|
498
673
|
*/
|
|
499
674
|
sendPwResetEmailRaw(requestParameters, initOverrides) {
|
|
500
675
|
return __awaiter(this, void 0, void 0, function* () {
|
|
501
676
|
const requestOptions = yield this.sendPwResetEmailRequestOpts(requestParameters);
|
|
502
677
|
const response = yield this.request(requestOptions, initOverrides);
|
|
503
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
678
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ResponseSendPwResetEmailFromJSON(jsonValue));
|
|
504
679
|
});
|
|
505
680
|
}
|
|
506
681
|
/**
|
|
682
|
+
* Initiate a password reset via the requested ``method``. ``method=EMAIL`` (default) mints a ``PasswordResetToken`` and sends the existing reset email. ``method=SMS`` looks up the user by phone, dispatches an SMS verification code, and the caller must follow up with ``/validate_reset_code``.
|
|
507
683
|
* Send Pw Reset Email Handler
|
|
508
684
|
*/
|
|
509
685
|
sendPwResetEmail(requestParameters, initOverrides) {
|
|
@@ -595,4 +771,46 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
595
771
|
yield this.ssoSigninRaw(requestParameters, initOverrides);
|
|
596
772
|
});
|
|
597
773
|
}
|
|
774
|
+
/**
|
|
775
|
+
* Creates request options for validatePwResetCode without sending the request
|
|
776
|
+
*/
|
|
777
|
+
validatePwResetCodeRequestOpts(requestParameters) {
|
|
778
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
779
|
+
if (requestParameters['validateResetCodeRequest'] == null) {
|
|
780
|
+
throw new runtime.RequiredError('validateResetCodeRequest', 'Required parameter "validateResetCodeRequest" was null or undefined when calling validatePwResetCode().');
|
|
781
|
+
}
|
|
782
|
+
const queryParameters = {};
|
|
783
|
+
const headerParameters = {};
|
|
784
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
785
|
+
let urlPath = `/v1/auth/pw/validate_reset_code`;
|
|
786
|
+
return {
|
|
787
|
+
path: urlPath,
|
|
788
|
+
method: 'POST',
|
|
789
|
+
headers: headerParameters,
|
|
790
|
+
query: queryParameters,
|
|
791
|
+
body: ValidateResetCodeRequestToJSON(requestParameters['validateResetCodeRequest']),
|
|
792
|
+
};
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Validate an SMS reset code and return a single-use reset JWT.
|
|
797
|
+
* Validate Reset Code Handler
|
|
798
|
+
*/
|
|
799
|
+
validatePwResetCodeRaw(requestParameters, initOverrides) {
|
|
800
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
801
|
+
const requestOptions = yield this.validatePwResetCodeRequestOpts(requestParameters);
|
|
802
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
803
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PasswordResetTokenResponseFromJSON(jsonValue));
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Validate an SMS reset code and return a single-use reset JWT.
|
|
808
|
+
* Validate Reset Code Handler
|
|
809
|
+
*/
|
|
810
|
+
validatePwResetCode(requestParameters, initOverrides) {
|
|
811
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
812
|
+
const response = yield this.validatePwResetCodeRaw(requestParameters, initOverrides);
|
|
813
|
+
return yield response.value();
|
|
814
|
+
});
|
|
815
|
+
}
|
|
598
816
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Phone change — the new phone is retrieved from the validation record.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface ChangePhoneNumberRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface ChangePhoneNumberRequest {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof ChangePhoneNumberRequest
|
|
22
|
+
*/
|
|
23
|
+
phoneValidationId: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof ChangePhoneNumberRequest
|
|
28
|
+
*/
|
|
29
|
+
code: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const ChangePhoneNumberRequestPropertyValidationAttributesMap: {
|
|
32
|
+
[property: string]: {
|
|
33
|
+
maxLength?: number;
|
|
34
|
+
minLength?: number;
|
|
35
|
+
pattern?: string;
|
|
36
|
+
maximum?: number;
|
|
37
|
+
exclusiveMaximum?: boolean;
|
|
38
|
+
minimum?: number;
|
|
39
|
+
exclusiveMinimum?: boolean;
|
|
40
|
+
multipleOf?: number;
|
|
41
|
+
maxItems?: number;
|
|
42
|
+
minItems?: number;
|
|
43
|
+
uniqueItems?: boolean;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Check if a given object implements the ChangePhoneNumberRequest interface.
|
|
48
|
+
*/
|
|
49
|
+
export declare function instanceOfChangePhoneNumberRequest(value: object): value is ChangePhoneNumberRequest;
|
|
50
|
+
export declare function ChangePhoneNumberRequestFromJSON(json: any): ChangePhoneNumberRequest;
|
|
51
|
+
export declare function ChangePhoneNumberRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChangePhoneNumberRequest;
|
|
52
|
+
export declare function ChangePhoneNumberRequestToJSON(json: any): ChangePhoneNumberRequest;
|
|
53
|
+
export declare function ChangePhoneNumberRequestToJSONTyped(value?: ChangePhoneNumberRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.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
|
+
export const ChangePhoneNumberRequestPropertyValidationAttributesMap = {};
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the ChangePhoneNumberRequest interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfChangePhoneNumberRequest(value) {
|
|
19
|
+
if (!('phoneValidationId' in value) || value['phoneValidationId'] === undefined)
|
|
20
|
+
return false;
|
|
21
|
+
if (!('code' in value) || value['code'] === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
export function ChangePhoneNumberRequestFromJSON(json) {
|
|
26
|
+
return ChangePhoneNumberRequestFromJSONTyped(json, false);
|
|
27
|
+
}
|
|
28
|
+
export function ChangePhoneNumberRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
29
|
+
if (json == null) {
|
|
30
|
+
return json;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
'phoneValidationId': json['phone_validation_id'],
|
|
34
|
+
'code': json['code'],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function ChangePhoneNumberRequestToJSON(json) {
|
|
38
|
+
return ChangePhoneNumberRequestToJSONTyped(json, false);
|
|
39
|
+
}
|
|
40
|
+
export function ChangePhoneNumberRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
41
|
+
if (value == null) {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
'phone_validation_id': value['phoneValidationId'],
|
|
46
|
+
'code': value['code'],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Phone signup — the phone is retrieved from the validation record.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface CreatePhonePasswordUserRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface CreatePhonePasswordUserRequest {
|
|
18
|
+
/**
|
|
19
|
+
* Password
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof CreatePhonePasswordUserRequest
|
|
22
|
+
*/
|
|
23
|
+
password: string;
|
|
24
|
+
/**
|
|
25
|
+
* 6-digit verification code
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof CreatePhonePasswordUserRequest
|
|
28
|
+
*/
|
|
29
|
+
code: string;
|
|
30
|
+
/**
|
|
31
|
+
* ID returned by phone_verification
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof CreatePhonePasswordUserRequest
|
|
34
|
+
*/
|
|
35
|
+
phoneValidationId: string;
|
|
36
|
+
/**
|
|
37
|
+
* First name
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof CreatePhonePasswordUserRequest
|
|
40
|
+
*/
|
|
41
|
+
firstName?: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Last name
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof CreatePhonePasswordUserRequest
|
|
46
|
+
*/
|
|
47
|
+
lastName?: string | null;
|
|
48
|
+
}
|
|
49
|
+
export declare const CreatePhonePasswordUserRequestPropertyValidationAttributesMap: {
|
|
50
|
+
[property: string]: {
|
|
51
|
+
maxLength?: number;
|
|
52
|
+
minLength?: number;
|
|
53
|
+
pattern?: string;
|
|
54
|
+
maximum?: number;
|
|
55
|
+
exclusiveMaximum?: boolean;
|
|
56
|
+
minimum?: number;
|
|
57
|
+
exclusiveMinimum?: boolean;
|
|
58
|
+
multipleOf?: number;
|
|
59
|
+
maxItems?: number;
|
|
60
|
+
minItems?: number;
|
|
61
|
+
uniqueItems?: boolean;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Check if a given object implements the CreatePhonePasswordUserRequest interface.
|
|
66
|
+
*/
|
|
67
|
+
export declare function instanceOfCreatePhonePasswordUserRequest(value: object): value is CreatePhonePasswordUserRequest;
|
|
68
|
+
export declare function CreatePhonePasswordUserRequestFromJSON(json: any): CreatePhonePasswordUserRequest;
|
|
69
|
+
export declare function CreatePhonePasswordUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreatePhonePasswordUserRequest;
|
|
70
|
+
export declare function CreatePhonePasswordUserRequestToJSON(json: any): CreatePhonePasswordUserRequest;
|
|
71
|
+
export declare function CreatePhonePasswordUserRequestToJSONTyped(value?: CreatePhonePasswordUserRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.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
|
+
export const CreatePhonePasswordUserRequestPropertyValidationAttributesMap = {
|
|
15
|
+
password: {
|
|
16
|
+
minLength: 8,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Check if a given object implements the CreatePhonePasswordUserRequest interface.
|
|
21
|
+
*/
|
|
22
|
+
export function instanceOfCreatePhonePasswordUserRequest(value) {
|
|
23
|
+
if (!('password' in value) || value['password'] === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (!('code' in value) || value['code'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('phoneValidationId' in value) || value['phoneValidationId'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
export function CreatePhonePasswordUserRequestFromJSON(json) {
|
|
32
|
+
return CreatePhonePasswordUserRequestFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
export function CreatePhonePasswordUserRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
if (json == null) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
'password': json['password'],
|
|
40
|
+
'code': json['code'],
|
|
41
|
+
'phoneValidationId': json['phone_validation_id'],
|
|
42
|
+
'firstName': json['first_name'] == null ? undefined : json['first_name'],
|
|
43
|
+
'lastName': json['last_name'] == null ? undefined : json['last_name'],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function CreatePhonePasswordUserRequestToJSON(json) {
|
|
47
|
+
return CreatePhonePasswordUserRequestToJSONTyped(json, false);
|
|
48
|
+
}
|
|
49
|
+
export function CreatePhonePasswordUserRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
50
|
+
if (value == null) {
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
'password': value['password'],
|
|
55
|
+
'code': value['code'],
|
|
56
|
+
'phone_validation_id': value['phoneValidationId'],
|
|
57
|
+
'first_name': value['firstName'],
|
|
58
|
+
'last_name': value['lastName'],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -23,6 +23,8 @@ export function instanceOfFeaturesResponse(value) {
|
|
|
23
23
|
return false;
|
|
24
24
|
if (!('githubLoginEnabled' in value) || value['githubLoginEnabled'] === undefined)
|
|
25
25
|
return false;
|
|
26
|
+
if (!('smsLoginEnabled' in value) || value['smsLoginEnabled'] === undefined)
|
|
27
|
+
return false;
|
|
26
28
|
if (!('defaultFrontendLanguage' in value) || value['defaultFrontendLanguage'] === undefined)
|
|
27
29
|
return false;
|
|
28
30
|
return true;
|
|
@@ -38,6 +40,7 @@ export function FeaturesResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
38
40
|
'googleLoginEnabled': json['google_login_enabled'],
|
|
39
41
|
'microsoftLoginEnabled': json['microsoft_login_enabled'],
|
|
40
42
|
'githubLoginEnabled': json['github_login_enabled'],
|
|
43
|
+
'smsLoginEnabled': json['sms_login_enabled'],
|
|
41
44
|
'defaultFrontendLanguage': SupportedLanguageFromJSON(json['default_frontend_language']),
|
|
42
45
|
};
|
|
43
46
|
}
|
|
@@ -52,6 +55,7 @@ export function FeaturesResponseToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
52
55
|
'google_login_enabled': value['googleLoginEnabled'],
|
|
53
56
|
'microsoft_login_enabled': value['microsoftLoginEnabled'],
|
|
54
57
|
'github_login_enabled': value['githubLoginEnabled'],
|
|
58
|
+
'sms_login_enabled': value['smsLoginEnabled'],
|
|
55
59
|
'default_frontend_language': SupportedLanguageToJSON(value['defaultFrontendLanguage']),
|
|
56
60
|
};
|
|
57
61
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface PasswordResetTokenResponse
|
|
16
|
+
*/
|
|
17
|
+
export interface PasswordResetTokenResponse {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof PasswordResetTokenResponse
|
|
22
|
+
*/
|
|
23
|
+
passwordResetToken: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const PasswordResetTokenResponsePropertyValidationAttributesMap: {
|
|
26
|
+
[property: string]: {
|
|
27
|
+
maxLength?: number;
|
|
28
|
+
minLength?: number;
|
|
29
|
+
pattern?: string;
|
|
30
|
+
maximum?: number;
|
|
31
|
+
exclusiveMaximum?: boolean;
|
|
32
|
+
minimum?: number;
|
|
33
|
+
exclusiveMinimum?: boolean;
|
|
34
|
+
multipleOf?: number;
|
|
35
|
+
maxItems?: number;
|
|
36
|
+
minItems?: number;
|
|
37
|
+
uniqueItems?: boolean;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Check if a given object implements the PasswordResetTokenResponse interface.
|
|
42
|
+
*/
|
|
43
|
+
export declare function instanceOfPasswordResetTokenResponse(value: object): value is PasswordResetTokenResponse;
|
|
44
|
+
export declare function PasswordResetTokenResponseFromJSON(json: any): PasswordResetTokenResponse;
|
|
45
|
+
export declare function PasswordResetTokenResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PasswordResetTokenResponse;
|
|
46
|
+
export declare function PasswordResetTokenResponseToJSON(json: any): PasswordResetTokenResponse;
|
|
47
|
+
export declare function PasswordResetTokenResponseToJSONTyped(value?: PasswordResetTokenResponse | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.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
|
+
export const PasswordResetTokenResponsePropertyValidationAttributesMap = {};
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the PasswordResetTokenResponse interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfPasswordResetTokenResponse(value) {
|
|
19
|
+
if (!('passwordResetToken' in value) || value['passwordResetToken'] === undefined)
|
|
20
|
+
return false;
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
export function PasswordResetTokenResponseFromJSON(json) {
|
|
24
|
+
return PasswordResetTokenResponseFromJSONTyped(json, false);
|
|
25
|
+
}
|
|
26
|
+
export function PasswordResetTokenResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
27
|
+
if (json == null) {
|
|
28
|
+
return json;
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
'passwordResetToken': json['password_reset_token'],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function PasswordResetTokenResponseToJSON(json) {
|
|
35
|
+
return PasswordResetTokenResponseToJSONTyped(json, false);
|
|
36
|
+
}
|
|
37
|
+
export function PasswordResetTokenResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
38
|
+
if (value == null) {
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
'password_reset_token': value['passwordResetToken'],
|
|
43
|
+
};
|
|
44
|
+
}
|