@silexpert/core 1.3.156 → 1.3.157-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/resources/Mfa.d.ts +19 -0
- package/dist/cjs/api/resources/Mfa.d.ts.map +1 -0
- package/dist/cjs/api/resources/Mfa.js +27 -0
- package/dist/cjs/api/resources/Mfa.js.map +1 -0
- package/dist/cjs/api/resources.d.ts +2 -0
- package/dist/cjs/api/resources.d.ts.map +1 -1
- package/dist/cjs/api/resources.js +2 -0
- package/dist/cjs/api/resources.js.map +1 -1
- package/dist/cjs/types/Interface/api/authentification/AuthenticationResponse.d.ts +7 -0
- package/dist/cjs/types/Interface/api/authentification/AuthenticationResponse.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/authentification/AuthenticationResponse.js +3 -0
- package/dist/cjs/types/Interface/api/authentification/AuthenticationResponse.js.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/DisableMfa.d.ts +4 -0
- package/dist/cjs/types/Interface/api/mfa/DisableMfa.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/DisableMfa.js +22 -0
- package/dist/cjs/types/Interface/api/mfa/DisableMfa.js.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/SetupInit.d.ts +5 -0
- package/dist/cjs/types/Interface/api/mfa/SetupInit.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/SetupInit.js +27 -0
- package/dist/cjs/types/Interface/api/mfa/SetupInit.js.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/SetupVerify.d.ts +5 -0
- package/dist/cjs/types/Interface/api/mfa/SetupVerify.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/SetupVerify.js +27 -0
- package/dist/cjs/types/Interface/api/mfa/SetupVerify.js.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/VerifyCode.d.ts +5 -0
- package/dist/cjs/types/Interface/api/mfa/VerifyCode.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/VerifyCode.js +27 -0
- package/dist/cjs/types/Interface/api/mfa/VerifyCode.js.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/VerifyRecoveryCode.d.ts +5 -0
- package/dist/cjs/types/Interface/api/mfa/VerifyRecoveryCode.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/VerifyRecoveryCode.js +27 -0
- package/dist/cjs/types/Interface/api/mfa/VerifyRecoveryCode.js.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/mfa.d.ts +19 -0
- package/dist/cjs/types/Interface/api/mfa/mfa.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/mfa/mfa.js +3 -0
- package/dist/cjs/types/Interface/api/mfa/mfa.js.map +1 -0
- package/dist/cjs/types/Interface/models/IUser.d.ts +1 -0
- package/dist/cjs/types/Interface/models/IUser.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IUser.js.map +1 -1
- package/dist/cjs/types/Interface/models/IUserMfa.d.ts +12 -0
- package/dist/cjs/types/Interface/models/IUserMfa.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/IUserMfa.js +3 -0
- package/dist/cjs/types/Interface/models/IUserMfa.js.map +1 -0
- package/dist/cjs/types/Interface/models/IUserMfaRecoveryCode.d.ts +9 -0
- package/dist/cjs/types/Interface/models/IUserMfaRecoveryCode.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/IUserMfaRecoveryCode.js +3 -0
- package/dist/cjs/types/Interface/models/IUserMfaRecoveryCode.js.map +1 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/mjs/api/resources/Mfa.d.ts +19 -0
- package/dist/mjs/api/resources/Mfa.d.ts.map +1 -0
- package/dist/mjs/api/resources/Mfa.js +23 -0
- package/dist/mjs/api/resources/Mfa.js.map +1 -0
- package/dist/mjs/api/resources.d.ts +2 -0
- package/dist/mjs/api/resources.d.ts.map +1 -1
- package/dist/mjs/api/resources.js +2 -0
- package/dist/mjs/api/resources.js.map +1 -1
- package/dist/mjs/types/Interface/api/authentification/AuthenticationResponse.d.ts +7 -0
- package/dist/mjs/types/Interface/api/authentification/AuthenticationResponse.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/authentification/AuthenticationResponse.js +2 -0
- package/dist/mjs/types/Interface/api/authentification/AuthenticationResponse.js.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/DisableMfa.d.ts +4 -0
- package/dist/mjs/types/Interface/api/mfa/DisableMfa.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/DisableMfa.js +19 -0
- package/dist/mjs/types/Interface/api/mfa/DisableMfa.js.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/SetupInit.d.ts +5 -0
- package/dist/mjs/types/Interface/api/mfa/SetupInit.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/SetupInit.js +25 -0
- package/dist/mjs/types/Interface/api/mfa/SetupInit.js.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/SetupVerify.d.ts +5 -0
- package/dist/mjs/types/Interface/api/mfa/SetupVerify.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/SetupVerify.js +25 -0
- package/dist/mjs/types/Interface/api/mfa/SetupVerify.js.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/VerifyCode.d.ts +5 -0
- package/dist/mjs/types/Interface/api/mfa/VerifyCode.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/VerifyCode.js +25 -0
- package/dist/mjs/types/Interface/api/mfa/VerifyCode.js.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/VerifyRecoveryCode.d.ts +5 -0
- package/dist/mjs/types/Interface/api/mfa/VerifyRecoveryCode.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/VerifyRecoveryCode.js +25 -0
- package/dist/mjs/types/Interface/api/mfa/VerifyRecoveryCode.js.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/mfa.d.ts +19 -0
- package/dist/mjs/types/Interface/api/mfa/mfa.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/mfa/mfa.js +2 -0
- package/dist/mjs/types/Interface/api/mfa/mfa.js.map +1 -0
- package/dist/mjs/types/Interface/models/IUser.d.ts +1 -0
- package/dist/mjs/types/Interface/models/IUser.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IUser.js.map +1 -1
- package/dist/mjs/types/Interface/models/IUserMfa.d.ts +12 -0
- package/dist/mjs/types/Interface/models/IUserMfa.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/IUserMfa.js +2 -0
- package/dist/mjs/types/Interface/models/IUserMfa.js.map +1 -0
- package/dist/mjs/types/Interface/models/IUserMfaRecoveryCode.d.ts +9 -0
- package/dist/mjs/types/Interface/models/IUserMfaRecoveryCode.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/IUserMfaRecoveryCode.js +2 -0
- package/dist/mjs/types/Interface/models/IUserMfaRecoveryCode.js.map +1 -0
- package/dist/mjs/types/index.d.ts +1 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +1 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Mfa.ts +29 -0
- package/ts/api/resources.ts +2 -0
- package/ts/types/Interface/api/authentification/AuthenticationResponse.ts +6 -0
- package/ts/types/Interface/api/mfa/DisableMfa.ts +7 -0
- package/ts/types/Interface/api/mfa/SetupInit.ts +11 -0
- package/ts/types/Interface/api/mfa/SetupVerify.ts +11 -0
- package/ts/types/Interface/api/mfa/VerifyCode.ts +11 -0
- package/ts/types/Interface/api/mfa/VerifyRecoveryCode.ts +11 -0
- package/ts/types/Interface/api/mfa/mfa.ts +21 -0
- package/ts/types/Interface/models/IUser.ts +1 -0
- package/ts/types/Interface/models/IUserMfa.ts +11 -0
- package/ts/types/Interface/models/IUserMfaRecoveryCode.ts +8 -0
- package/ts/types/index.ts +1 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MfaSetupInitResult, MfaSetupVerifyResult } from '../../types/Interface/api/mfa/mfa';
|
|
2
|
+
import { Resource } from '../Resource';
|
|
3
|
+
|
|
4
|
+
export class UserMfa extends Resource {
|
|
5
|
+
setupInit(userId: number, userEmail: string): Promise<MfaSetupInitResult> {
|
|
6
|
+
return this.axios.$post('/mfa/setup/init', { userId, userEmail });
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
setupVerify(userId: number, code: string): Promise<MfaSetupVerifyResult> {
|
|
10
|
+
return this.axios.$post('/mfa/setup/verify', { userId, code });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
disable(userId: number): Promise<boolean> {
|
|
14
|
+
return this.axios.$post('/mfa/disable', { userId });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
verifyCode(userId: number, code: string): Promise<{ success: boolean; token?: string }> {
|
|
18
|
+
return this.axios.$post('/mfa/verify/code', { userId, code });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
verifyRecoveryCode(userId: number, recoveryCode: string): Promise<{ success: boolean; token?: string }> {
|
|
22
|
+
return this.axios.$post('/mfa/verify/recovery-code', { userId, recoveryCode });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
isMfaEnabled(userId?: number): Promise<{ isEnabled: boolean }> {
|
|
26
|
+
// Si userId est fourni, l'envoyer en query param, sinon vérifier l'user connecté
|
|
27
|
+
return this.axios.$get('/mfa/is-enabled', userId ? { params: { userId } } : undefined);
|
|
28
|
+
}
|
|
29
|
+
}
|
package/ts/api/resources.ts
CHANGED
|
@@ -181,6 +181,7 @@ import { Gdpr } from './resources/Gdpr';
|
|
|
181
181
|
import { Sellsy } from './resources/Sellsy';
|
|
182
182
|
import { BankDedup } from './resources/BankDedup';
|
|
183
183
|
import { StripePurchase } from './resources/StripePurchase';
|
|
184
|
+
import { UserMfa } from './resources/Mfa';
|
|
184
185
|
import { DashboardLayout } from './resources/DashboardLayout';
|
|
185
186
|
import { DocumentRequest } from './resources/DocumentRequest';
|
|
186
187
|
import { BalanceSheetReport } from './resources/BalanceSheetReport';
|
|
@@ -321,6 +322,7 @@ export const resources = {
|
|
|
321
322
|
visualizedInformation: VisualizedInformation,
|
|
322
323
|
fusion: Fusion,
|
|
323
324
|
salesContract: SalesContract,
|
|
325
|
+
userMfa: UserMfa,
|
|
324
326
|
leadsToPartners: LeadsToPartners,
|
|
325
327
|
changeLog: ChangeLog,
|
|
326
328
|
constitutionHistory: ConstitutionHistory,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface MfaSetupInitResult {
|
|
2
|
+
otpauthUri: string;
|
|
3
|
+
tempSecret: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface MfaSetupVerifyResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
recoveryCodes: string[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface MfaAuthenticationResponse {
|
|
13
|
+
requiresMfa: boolean;
|
|
14
|
+
userId?: number;
|
|
15
|
+
token?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface MfaVerificationResponse {
|
|
19
|
+
success: boolean;
|
|
20
|
+
token?: string;
|
|
21
|
+
}
|
|
@@ -51,6 +51,7 @@ export interface IUser {
|
|
|
51
51
|
textMessageNumber?: string | null;
|
|
52
52
|
prefix?: string | null;
|
|
53
53
|
tokenLostPassword?: string | null;
|
|
54
|
+
twoFactorEnabled?: boolean | null;
|
|
54
55
|
tokenApi?: string | null;
|
|
55
56
|
tokenNotification?: string | null;
|
|
56
57
|
tokenSocket?: string | null;
|
package/ts/types/index.ts
CHANGED
|
@@ -557,6 +557,7 @@ export * from './Enum/PartneredAccountantServiceTypeId';
|
|
|
557
557
|
export * from './Enum/PaymentAttempt';
|
|
558
558
|
|
|
559
559
|
// Interfaces API
|
|
560
|
+
export * from './Interface/api/authentification/AuthenticationResponse';
|
|
560
561
|
export * from './Interface/api/exercice/ReadExercice';
|
|
561
562
|
export * from './Interface/api/balanceSheet/consistency/Read';
|
|
562
563
|
export * from './Interface/api/kilometricAllowance/ReadKilometricAllowance';
|