@frontegg/rest-api 3.0.64 → 3.0.67
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/auth/index.d.ts +48 -21
- package/auth/index.js +28 -6
- package/auth/interfaces.d.ts +33 -1
- package/auth/secutiry-poilicy/index.d.ts +9 -1
- package/auth/secutiry-poilicy/index.js +6 -0
- package/constants.d.ts +6 -0
- package/constants.js +6 -0
- package/index.js +1 -1
- package/node/auth/index.js +40 -0
- package/node/auth/secutiry-poilicy/index.js +10 -0
- package/node/constants.js +6 -0
- package/node/index.js +1 -1
- package/package.json +1 -1
package/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
import { ISamlRolesGroup } from
|
|
4
|
-
import { IAcceptInvitation, IActivateAccount, IAllowedToRememberMfaDevice, ICreateSamlGroup, IDeleteApiToken, IDisableMfa, IEnrollMfaResponse, IForgotPassword, IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse, IGetUserById, IGetUserPasswordConfig, ILogin, ILoginResponse, ILoginViaSocialLogin, ILoginViaSocialLoginResponse, ILoginWithMfa, IOidcPostLogin, IOidcConfiguration, IPostLogin, IPreLogin, IRecoverMFAToken, IResendActivationEmail, IResetPassword, ISamlConfiguration, ISamlVendorConfigResponse, ISignUpResponse, ISignUpUser, ISocialLoginProviderConfiguration, ITenantApiTokensData, IUpdateSamlConfiguration, IUpdateSamlGroup, IUpdateSamlRoles, IUpdateSamlVendorMetadata, IUpdateTenantApiTokensData, IUpdateUserApiTokensData, IUserApiTokensData, IUserIdResponse, IVendorConfig, IVerifyMfa, IVerifyMfaResponse, TestConfig, ISSOPublicConfiguration, IPreLoginWithIdpTypeResponse, IPasswordlessPreLogin, IPasswordlessPostLogin, ICreateSSODomain, IVerifyInviteToken, ISSODomain, ISSOConfigurationDefaultRoles, ISSOConfiguration, IUpdateSSOConfiguration, IOidcPostLoginV2, IExchangeOAuthTokens, IOAuthTokenResponse, ISocialLoginProviderConfigurationV2, ILoginResponseV2, IResetPhoneNumber, IVerifyResetPhoneNumber, IChangePhoneNumber, IVerifyResetPhoneNumberResponse, IResetPhoneNumberResponse, IWebAuthnPreLogin, IWebAuthnPostLogin, IVerifyNewWebAuthnDevice, IWebAuthnPreLoginResponse, ICreateNewDeviceSessionResponse, IAuthStrategiesConfig, ISessionResponse, IChangePhoneNumberWithVerification, IChangePhoneNumberWithVerificationResponse, IVerifyChangePhoneNumber, ISessionConfigurations, IResendInvitationEmail, IPreEnrollMFA, IEnrollMFAAuthenticatorApp, IPreEnrollMFASMS, IEnrollMFASMS, IEnrollMFAWebAuthn, IPreEnrollMFAAuthenticatorAppResponse, IPreEnrollMFAWebAuthnResponse, IVerifyMFAAuthenticatorApp, IPreVerifyMFA, IPreVerifyMFASMSResponse, IVerifyMFASMS, IPreVerifyMFAWebAuthnResponse, IVerifyMFAWebAuthn, IPreEnrollMFASMSResponse, IPreDisableMFASMSResponse, IDisableMFASMS, IDisableMFAWebAuthn, IPreDisableMFAWebAuthnResponse, UserMFADevicesResponse, WithoutMFAToken, IMFAStrategiesResponse, IOAuthLogout } from "./interfaces";
|
|
1
|
+
export * from "./secutiry-poilicy";
|
|
2
|
+
export * from "./enums";
|
|
3
|
+
import { ISamlRolesGroup } from "../teams/interfaces";
|
|
4
|
+
import { IAcceptInvitation, IActivateAccount, IAllowedToRememberMfaDevice, ICreateSamlGroup, IDeleteApiToken, IDisableMfa, IEnrollMfaResponse, IForgotPassword, IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse, IGetUserById, IGetUserPasswordConfig, ILogin, ILoginResponse, ILoginViaSocialLogin, ILoginViaSocialLoginResponse, ILoginWithMfa, IOidcPostLogin, IOidcConfiguration, IPostLogin, IPreLogin, IRecoverMFAToken, IResendActivationEmail, IResetPassword, ISamlConfiguration, ISamlVendorConfigResponse, ISignUpResponse, ISignUpUser, ISocialLoginProviderConfiguration, ITenantApiTokensData, IUpdateSamlConfiguration, IUpdateSamlGroup, IUpdateSamlRoles, IUpdateSamlVendorMetadata, IUpdateTenantApiTokensData, IUpdateUserApiTokensData, IUserApiTokensData, IUserIdResponse, IVendorConfig, IVerifyMfa, IVerifyMfaResponse, TestConfig, ISSOPublicConfiguration, IPreLoginWithIdpTypeResponse, IPasswordlessPreLogin, IPasswordlessPostLogin, ICreateSSODomain, IVerifyInviteToken, ISSODomain, ISSOConfigurationDefaultRoles, ISSOConfiguration, IUpdateSSOConfiguration, IOidcPostLoginV2, IExchangeOAuthTokens, IOAuthTokenResponse, ISocialLoginProviderConfigurationV2, ILoginResponseV2, IResetPhoneNumber, IVerifyResetPhoneNumber, IChangePhoneNumber, IVerifyResetPhoneNumberResponse, IResetPhoneNumberResponse, IWebAuthnPreLogin, IWebAuthnPostLogin, IVerifyNewWebAuthnDevice, IWebAuthnPreLoginResponse, ICreateNewDeviceSessionResponse, IAuthStrategiesConfig, ISessionResponse, IChangePhoneNumberWithVerification, IChangePhoneNumberWithVerificationResponse, IVerifyChangePhoneNumber, ISessionConfigurations, IResendInvitationEmail, IPreEnrollMFA, IEnrollMFAAuthenticatorApp, IPreEnrollMFASMS, IEnrollMFASMS, IEnrollMFAWebAuthn, IPreEnrollMFAAuthenticatorAppResponse, IPreEnrollMFAWebAuthnResponse, IVerifyMFAAuthenticatorApp, IPreVerifyMFA, IPreVerifyMFASMSResponse, IVerifyMFASMS, IPreVerifyMFAWebAuthnResponse, IVerifyMFAWebAuthn, IPreEnrollMFASMSResponse, IPreDisableMFASMSResponse, IDisableMFASMS, IDisableMFAWebAuthn, IPreDisableMFAWebAuthnResponse, UserMFADevicesResponse, WithoutMFAToken, IMFAStrategiesResponse, IOAuthLogout, IGetUserAccessTokens, IGetTenantAccessTokens, IDeleteAccessToken, ICreateTenantAccessTokenData, ICreateUserAccessTokenData } from "./interfaces";
|
|
5
5
|
/*****************************************
|
|
6
6
|
* Authentication
|
|
7
7
|
*****************************************/
|
|
@@ -234,8 +234,8 @@ export declare function preEnrollMFAAuthenticatorAppForLogin(body: IPreEnrollMFA
|
|
|
234
234
|
*/
|
|
235
235
|
export declare function enrollMFAAuthenticatorAppForLogin(body: IEnrollMFAAuthenticatorApp): Promise<ILoginResponse>;
|
|
236
236
|
/**
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
* after login succeeded with mfaRequired token response, this function should be called
|
|
238
|
+
* with the selected authenticator app id, mfaToken and the generated code from your authenticator app.
|
|
239
239
|
*/
|
|
240
240
|
export declare function verifyMFAAuthenticatorAppForLogin(deviceId: string, body: IVerifyMFAAuthenticatorApp): Promise<ILoginResponse>;
|
|
241
241
|
/**
|
|
@@ -250,13 +250,13 @@ export declare function preEnrollMFASMSForLogin(body: IPreEnrollMFASMS): Promise
|
|
|
250
250
|
*/
|
|
251
251
|
export declare function enrollMFASMSForLogin(body: IEnrollMFASMS): Promise<ILoginResponse>;
|
|
252
252
|
/**
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
* after login succeeded with mfaRequired token response, if the user asked to use SMS as MFA
|
|
254
|
+
* this function should be called with the selected device id and mfaToken
|
|
255
255
|
*/
|
|
256
256
|
export declare function preVerifyMFASMSForLogin(deviceId: string, body: IPreVerifyMFA): Promise<IPreVerifyMFASMSResponse>;
|
|
257
257
|
/**
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
* after pre verify with SMS, this function should be called with otcToken, mfaToken and the code
|
|
259
|
+
* that has been sent to the selected device.
|
|
260
260
|
*/
|
|
261
261
|
export declare function verifyMFASMSForLogin(deviceId: string, body: IVerifyMFASMS): Promise<ILoginResponse>;
|
|
262
262
|
/**
|
|
@@ -271,13 +271,13 @@ export declare function preEnrollMFAWebAuthnForLogin(body: IPreEnrollMFA): Promi
|
|
|
271
271
|
*/
|
|
272
272
|
export declare function enrollMFAWebAuthnForLogin(body: IEnrollMFAWebAuthn): Promise<ILoginResponse>;
|
|
273
273
|
/**
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
* after login succeeded with mfaRequired token response, if the user asked to use WebAuthn as MFA
|
|
275
|
+
* this function should be called with the selected device id and mfaToken.
|
|
276
276
|
*/
|
|
277
277
|
export declare function preVerifyMFAWebAuthnForLogin(deviceId: string, body: IPreVerifyMFA): Promise<IPreVerifyMFAWebAuthnResponse>;
|
|
278
278
|
/**
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
* after pre verify with WebAuthn, this function should be called with webauthnTokenToken, mfaToken
|
|
280
|
+
* and the assertion response.
|
|
281
281
|
*/
|
|
282
282
|
export declare function verifyMFAWebAuthnForLogin(deviceId: string, body: IVerifyMFAWebAuthn): Promise<ILoginResponse>;
|
|
283
283
|
/**
|
|
@@ -329,15 +329,15 @@ export declare function getSamlRolesGroups(): Promise<ISamlRolesGroup[]>;
|
|
|
329
329
|
/**
|
|
330
330
|
* Update Saml roles for authorization
|
|
331
331
|
*/
|
|
332
|
-
export declare function updateSamlRoles({ roleIds }: IUpdateSamlRoles): Promise<void>;
|
|
332
|
+
export declare function updateSamlRoles({ roleIds, }: IUpdateSamlRoles): Promise<void>;
|
|
333
333
|
/**
|
|
334
334
|
* Create Saml group roles for authorization
|
|
335
335
|
*/
|
|
336
|
-
export declare function createSamlGroup({ roleIds, group }: ICreateSamlGroup): Promise<void>;
|
|
336
|
+
export declare function createSamlGroup({ roleIds, group, }: ICreateSamlGroup): Promise<void>;
|
|
337
337
|
/**
|
|
338
338
|
* Update Saml group roles for authorization
|
|
339
339
|
*/
|
|
340
|
-
export declare function updateSamlGroup({ roleIds, group, id }: IUpdateSamlGroup): Promise<void>;
|
|
340
|
+
export declare function updateSamlGroup({ roleIds, group, id, }: IUpdateSamlGroup): Promise<void>;
|
|
341
341
|
/**
|
|
342
342
|
* Delete Saml group
|
|
343
343
|
*/
|
|
@@ -409,6 +409,33 @@ export declare function deleteSessionForUser(id: string): Promise<void>;
|
|
|
409
409
|
* Delete all user sessions
|
|
410
410
|
*/
|
|
411
411
|
export declare function deleteAllSessionsForUser(): Promise<void>;
|
|
412
|
+
/**
|
|
413
|
+
* Access tokens Configurations
|
|
414
|
+
*/
|
|
415
|
+
/**
|
|
416
|
+
* Get user access tokens data
|
|
417
|
+
*/
|
|
418
|
+
export declare function getUserAccessTokensData(): Promise<IGetUserAccessTokens>;
|
|
419
|
+
/**
|
|
420
|
+
* Get tenant access tokens data
|
|
421
|
+
*/
|
|
422
|
+
export declare function getTenantAccessTokensData(): Promise<IGetTenantAccessTokens>;
|
|
423
|
+
/**
|
|
424
|
+
* Delete Tenant access Token
|
|
425
|
+
*/
|
|
426
|
+
export declare function deleteTenantAccessToken({ id, }: IDeleteAccessToken): Promise<void>;
|
|
427
|
+
/**
|
|
428
|
+
* Delete Tenant access Token
|
|
429
|
+
*/
|
|
430
|
+
export declare function deleteUserAccessToken({ id, }: IDeleteAccessToken): Promise<void>;
|
|
431
|
+
/**
|
|
432
|
+
* Create User Access Token.
|
|
433
|
+
*/
|
|
434
|
+
export declare function createUserAccessToken(body: ICreateUserAccessTokenData): Promise<IUserApiTokensData>;
|
|
435
|
+
/**
|
|
436
|
+
* Create Tenant Access Token
|
|
437
|
+
*/
|
|
438
|
+
export declare function createTenantAccessToken(body: ICreateTenantAccessTokenData): Promise<ITenantApiTokensData>;
|
|
412
439
|
/**
|
|
413
440
|
* Api tokens Configurations
|
|
414
441
|
*/
|
|
@@ -431,15 +458,15 @@ export declare function updateTenantApiTokensData(body: IUpdateTenantApiTokensDa
|
|
|
431
458
|
/**
|
|
432
459
|
* Delete Tenant Api Token
|
|
433
460
|
*/
|
|
434
|
-
export declare function deleteTenantApiToken({ tokenId }: IDeleteApiToken): Promise<void>;
|
|
461
|
+
export declare function deleteTenantApiToken({ tokenId, }: IDeleteApiToken): Promise<void>;
|
|
435
462
|
/**
|
|
436
463
|
* Delete Tenant Api Token
|
|
437
464
|
*/
|
|
438
|
-
export declare function deleteUserApiToken({ tokenId }: IDeleteApiToken): Promise<void>;
|
|
465
|
+
export declare function deleteUserApiToken({ tokenId, }: IDeleteApiToken): Promise<void>;
|
|
439
466
|
/**
|
|
440
467
|
* Get Tenant Api Token Creator User
|
|
441
468
|
*/
|
|
442
|
-
export declare function getUserById({ userId }: IGetUserById): Promise<IUserIdResponse>;
|
|
469
|
+
export declare function getUserById({ userId, }: IGetUserById): Promise<IUserIdResponse>;
|
|
443
470
|
/**
|
|
444
471
|
* Checks if remember MFA device is enabled for user.
|
|
445
472
|
*/
|
|
@@ -454,7 +481,7 @@ export declare function passwordlessPostLogin({ type, ...body }: IPasswordlessPo
|
|
|
454
481
|
* @param token - invitation token
|
|
455
482
|
* @returns tenant name
|
|
456
483
|
*/
|
|
457
|
-
export declare function verifyInviteToken({ token }: IVerifyInviteToken): Promise<string>;
|
|
484
|
+
export declare function verifyInviteToken({ token, }: IVerifyInviteToken): Promise<string>;
|
|
458
485
|
/**
|
|
459
486
|
* SSO Configurations V1
|
|
460
487
|
*/
|
package/auth/index.js
CHANGED
|
@@ -3,12 +3,12 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
const _excluded = ["type"],
|
|
4
4
|
_excluded2 = ["type"];
|
|
5
5
|
import { getTenants } from "../tenants";
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
import { urls } from
|
|
9
|
-
import { ContextHolder } from
|
|
10
|
-
import { Delete, Get, Patch, Post, Put } from
|
|
11
|
-
import { jwtDecode } from
|
|
6
|
+
export * from "./secutiry-poilicy";
|
|
7
|
+
export * from "./enums";
|
|
8
|
+
import { urls } from "../constants";
|
|
9
|
+
import { ContextHolder } from "../ContextHolder";
|
|
10
|
+
import { Delete, Get, Patch, Post, Put } from "../fetch";
|
|
11
|
+
import { jwtDecode } from "../jwt";
|
|
12
12
|
export async function generateLoginResponse(loginResponse) {
|
|
13
13
|
if (!loginResponse.accessToken) {
|
|
14
14
|
return loginResponse;
|
|
@@ -350,6 +350,28 @@ export async function deleteSessionForUser(id) {
|
|
|
350
350
|
export async function deleteAllSessionsForUser() {
|
|
351
351
|
await Delete(`${urls.identity.users.sessions.currentUser.v1}/all`);
|
|
352
352
|
}
|
|
353
|
+
export async function getUserAccessTokensData() {
|
|
354
|
+
return Get(urls.identity.users.accessTokens.v1);
|
|
355
|
+
}
|
|
356
|
+
export async function getTenantAccessTokensData() {
|
|
357
|
+
return Get(urls.identity.tenants.accessTokens.v1);
|
|
358
|
+
}
|
|
359
|
+
export async function deleteTenantAccessToken({
|
|
360
|
+
id
|
|
361
|
+
}) {
|
|
362
|
+
return Delete(`${urls.identity.tenants.accessTokens.v1}/${id}`);
|
|
363
|
+
}
|
|
364
|
+
export async function deleteUserAccessToken({
|
|
365
|
+
id
|
|
366
|
+
}) {
|
|
367
|
+
return Delete(`${urls.identity.users.accessTokens.v1}/${id}`);
|
|
368
|
+
}
|
|
369
|
+
export async function createUserAccessToken(body) {
|
|
370
|
+
return Post(urls.identity.users.accessTokens.v1, body);
|
|
371
|
+
}
|
|
372
|
+
export async function createTenantAccessToken(body) {
|
|
373
|
+
return Post(urls.identity.tenants.accessTokens.v1, body);
|
|
374
|
+
}
|
|
353
375
|
export async function getUserApiTokensData() {
|
|
354
376
|
return Get(urls.identity.users.apiTokens.v1);
|
|
355
377
|
}
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -248,6 +248,38 @@ export interface IUpdateTenantApiTokensData {
|
|
|
248
248
|
export interface IDeleteApiToken {
|
|
249
249
|
tokenId: string;
|
|
250
250
|
}
|
|
251
|
+
export interface IAccessTokensData {
|
|
252
|
+
id: string;
|
|
253
|
+
description?: string;
|
|
254
|
+
createdAt: Date;
|
|
255
|
+
secret?: string;
|
|
256
|
+
expires?: Date;
|
|
257
|
+
}
|
|
258
|
+
export interface IUserAccessTokenData extends IAccessTokensData {
|
|
259
|
+
}
|
|
260
|
+
export interface ITenantAccessTokenData extends IAccessTokensData {
|
|
261
|
+
roleIds: string[];
|
|
262
|
+
}
|
|
263
|
+
export interface IGetUserAccessTokens {
|
|
264
|
+
accessTokens: IUserAccessTokenData[];
|
|
265
|
+
}
|
|
266
|
+
export interface IGetTenantAccessTokens {
|
|
267
|
+
accessTokens: ITenantAccessTokenData[];
|
|
268
|
+
}
|
|
269
|
+
export interface IGetUserAccessTokensData {
|
|
270
|
+
accessTokens: IUserAccessTokenData[];
|
|
271
|
+
}
|
|
272
|
+
export interface ICreateAccessTokensData {
|
|
273
|
+
description: string;
|
|
274
|
+
}
|
|
275
|
+
export interface ICreateUserAccessTokenData extends ICreateAccessTokensData {
|
|
276
|
+
}
|
|
277
|
+
export interface ICreateTenantAccessTokenData extends ICreateAccessTokensData {
|
|
278
|
+
roleIds: string[];
|
|
279
|
+
}
|
|
280
|
+
export interface IDeleteAccessToken {
|
|
281
|
+
id: string;
|
|
282
|
+
}
|
|
251
283
|
export interface IUpdateSamlRoles {
|
|
252
284
|
roleIds: string[];
|
|
253
285
|
}
|
|
@@ -562,7 +594,7 @@ export interface IDisableMFAWebAuthn {
|
|
|
562
594
|
export interface IPreEnrollMFAAuthenticatorApp {
|
|
563
595
|
qrCode: string;
|
|
564
596
|
}
|
|
565
|
-
export declare type WithoutMFAToken<T> = Omit<T |
|
|
597
|
+
export declare type WithoutMFAToken<T> = Omit<T | "mfaToken", "rememberDevice">;
|
|
566
598
|
export interface IMFAStrategyResponse {
|
|
567
599
|
strategy: MFAStrategyEnum;
|
|
568
600
|
isActive: boolean;
|
|
@@ -9,7 +9,7 @@ export declare function getGlobalSecurityPolicy(): Promise<ISecurityPolicy>;
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function getMfaPolicy(): Promise<ISecurityPolicyMfa>;
|
|
11
11
|
/**
|
|
12
|
-
* Get Mfa configuration from security policy
|
|
12
|
+
* Get Vendor Mfa configuration from security policy
|
|
13
13
|
*/
|
|
14
14
|
export declare function getVendorMfaPolicy(): Promise<ISecurityPolicyMfa>;
|
|
15
15
|
/**
|
|
@@ -20,6 +20,10 @@ export declare function saveMfaPolicy(body: ISaveSecurityPolicyMfa): Promise<ISe
|
|
|
20
20
|
* Get Lockout configuration from security policy
|
|
21
21
|
*/
|
|
22
22
|
export declare function getLockoutPolicy(): Promise<ISecurityPolicyLockout>;
|
|
23
|
+
/**
|
|
24
|
+
* Get Vendor Lockout configuration from security policy
|
|
25
|
+
*/
|
|
26
|
+
export declare function getVendorLockoutPolicy(): Promise<ISecurityPolicyLockout>;
|
|
23
27
|
/**
|
|
24
28
|
* Create/Update Lockout configuration from security policy
|
|
25
29
|
*/
|
|
@@ -32,6 +36,10 @@ export declare function getCaptchaPolicy(): Promise<ISecurityPolicyCaptcha | nul
|
|
|
32
36
|
* Get Password History configuration from security policy
|
|
33
37
|
*/
|
|
34
38
|
export declare function getPasswordHistoryPolicy(): Promise<ISecurityPolicyPasswordHistory>;
|
|
39
|
+
/**
|
|
40
|
+
* Get Vendor Password History configuration from security policy
|
|
41
|
+
*/
|
|
42
|
+
export declare function getVendorPasswordHistoryPolicy(): Promise<ISecurityPolicyPasswordHistory>;
|
|
35
43
|
/**
|
|
36
44
|
* Create/Update Password History configuration from security policy
|
|
37
45
|
*/
|
|
@@ -19,6 +19,9 @@ export async function saveMfaPolicy(body) {
|
|
|
19
19
|
export async function getLockoutPolicy() {
|
|
20
20
|
return Get(`${urls.identity.configurations.v1}/lockout-policy`);
|
|
21
21
|
}
|
|
22
|
+
export async function getVendorLockoutPolicy() {
|
|
23
|
+
return Get(`${urls.identity.configurations.v1}/lockout-policy/vendor`);
|
|
24
|
+
}
|
|
22
25
|
export async function saveLockoutPolicy(body) {
|
|
23
26
|
if (body.id) {
|
|
24
27
|
return Patch(`${urls.identity.configurations.v1}/lockout-policy`, body);
|
|
@@ -36,6 +39,9 @@ export async function getCaptchaPolicy() {
|
|
|
36
39
|
export async function getPasswordHistoryPolicy() {
|
|
37
40
|
return Get(`${urls.identity.configurations.v1}/password-history-policy`);
|
|
38
41
|
}
|
|
42
|
+
export async function getVendorPasswordHistoryPolicy() {
|
|
43
|
+
return Get(`${urls.identity.configurations.v1}/password-history-policy/vendor`);
|
|
44
|
+
}
|
|
39
45
|
export async function savePasswordHistoryPolicy(body) {
|
|
40
46
|
if (body.id) {
|
|
41
47
|
return Patch(`${urls.identity.configurations.v1}/password-history-policy`, body);
|
package/constants.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export declare const urls: {
|
|
|
14
14
|
apiTokens: {
|
|
15
15
|
v1: string;
|
|
16
16
|
};
|
|
17
|
+
accessTokens: {
|
|
18
|
+
v1: string;
|
|
19
|
+
};
|
|
17
20
|
sessions: {
|
|
18
21
|
v1: string;
|
|
19
22
|
currentUser: {
|
|
@@ -52,6 +55,9 @@ export declare const urls: {
|
|
|
52
55
|
v1: string;
|
|
53
56
|
v2: string;
|
|
54
57
|
};
|
|
58
|
+
accessTokens: {
|
|
59
|
+
v1: string;
|
|
60
|
+
};
|
|
55
61
|
invites: {
|
|
56
62
|
user: {
|
|
57
63
|
v1: string;
|
package/constants.js
CHANGED
|
@@ -14,6 +14,9 @@ export const urls = {
|
|
|
14
14
|
apiTokens: {
|
|
15
15
|
v1: '/identity/resources/users/api-tokens/v1'
|
|
16
16
|
},
|
|
17
|
+
accessTokens: {
|
|
18
|
+
v1: '/identity/resources/users/access-tokens/v1'
|
|
19
|
+
},
|
|
17
20
|
sessions: {
|
|
18
21
|
v1: '/identity/resources/users/sessions/v1',
|
|
19
22
|
currentUser: {
|
|
@@ -52,6 +55,9 @@ export const urls = {
|
|
|
52
55
|
v1: '/identity/resources/tenants/api-tokens/v1',
|
|
53
56
|
v2: '/identity/resources/tenants/api-tokens/v2'
|
|
54
57
|
},
|
|
58
|
+
accessTokens: {
|
|
59
|
+
v1: '/identity/resources/tenants/access-tokens/v1'
|
|
60
|
+
},
|
|
55
61
|
invites: {
|
|
56
62
|
user: {
|
|
57
63
|
v1: '/identity/resources/tenants/invites/v1/user'
|
package/index.js
CHANGED
package/node/auth/index.js
CHANGED
|
@@ -79,6 +79,12 @@ var _exportNames = {
|
|
|
79
79
|
createOrUpdateSessionConfigrations: true,
|
|
80
80
|
deleteSessionForUser: true,
|
|
81
81
|
deleteAllSessionsForUser: true,
|
|
82
|
+
getUserAccessTokensData: true,
|
|
83
|
+
getTenantAccessTokensData: true,
|
|
84
|
+
deleteTenantAccessToken: true,
|
|
85
|
+
deleteUserAccessToken: true,
|
|
86
|
+
createUserAccessToken: true,
|
|
87
|
+
createTenantAccessToken: true,
|
|
82
88
|
getUserApiTokensData: true,
|
|
83
89
|
getTenantApiTokensData: true,
|
|
84
90
|
updateUserApiTokensData: true,
|
|
@@ -133,13 +139,17 @@ exports.createSSOConfigurationByMetadata = createSSOConfigurationByMetadata;
|
|
|
133
139
|
exports.createSSODomain = createSSODomain;
|
|
134
140
|
exports.createSSOGroup = createSSOGroup;
|
|
135
141
|
exports.createSamlGroup = createSamlGroup;
|
|
142
|
+
exports.createTenantAccessToken = createTenantAccessToken;
|
|
143
|
+
exports.createUserAccessToken = createUserAccessToken;
|
|
136
144
|
exports.deleteAllSessionsForUser = deleteAllSessionsForUser;
|
|
137
145
|
exports.deleteSSOConfiguration = deleteSSOConfiguration;
|
|
138
146
|
exports.deleteSSODomain = deleteSSODomain;
|
|
139
147
|
exports.deleteSSOGroup = deleteSSOGroup;
|
|
140
148
|
exports.deleteSamlGroup = deleteSamlGroup;
|
|
141
149
|
exports.deleteSessionForUser = deleteSessionForUser;
|
|
150
|
+
exports.deleteTenantAccessToken = deleteTenantAccessToken;
|
|
142
151
|
exports.deleteTenantApiToken = deleteTenantApiToken;
|
|
152
|
+
exports.deleteUserAccessToken = deleteUserAccessToken;
|
|
143
153
|
exports.deleteUserApiToken = deleteUserApiToken;
|
|
144
154
|
exports.disableMFAAuthenticatorApp = disableMFAAuthenticatorApp;
|
|
145
155
|
exports.disableMFASMS = disableMFASMS;
|
|
@@ -174,7 +184,9 @@ exports.getSamlVendorConfiguration = getSamlVendorConfiguration;
|
|
|
174
184
|
exports.getSessionConfigurations = getSessionConfigurations;
|
|
175
185
|
exports.getSocialLoginProviders = getSocialLoginProviders;
|
|
176
186
|
exports.getSocialLoginProvidersV2 = getSocialLoginProvidersV2;
|
|
187
|
+
exports.getTenantAccessTokensData = getTenantAccessTokensData;
|
|
177
188
|
exports.getTenantApiTokensData = getTenantApiTokensData;
|
|
189
|
+
exports.getUserAccessTokensData = getUserAccessTokensData;
|
|
178
190
|
exports.getUserApiTokensData = getUserApiTokensData;
|
|
179
191
|
exports.getUserById = getUserById;
|
|
180
192
|
exports.getVendorConfig = getVendorConfig;
|
|
@@ -698,6 +710,34 @@ async function deleteAllSessionsForUser() {
|
|
|
698
710
|
await (0, _fetch.Delete)(`${_constants.urls.identity.users.sessions.currentUser.v1}/all`);
|
|
699
711
|
}
|
|
700
712
|
|
|
713
|
+
async function getUserAccessTokensData() {
|
|
714
|
+
return (0, _fetch.Get)(_constants.urls.identity.users.accessTokens.v1);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
async function getTenantAccessTokensData() {
|
|
718
|
+
return (0, _fetch.Get)(_constants.urls.identity.tenants.accessTokens.v1);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
async function deleteTenantAccessToken({
|
|
722
|
+
id
|
|
723
|
+
}) {
|
|
724
|
+
return (0, _fetch.Delete)(`${_constants.urls.identity.tenants.accessTokens.v1}/${id}`);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
async function deleteUserAccessToken({
|
|
728
|
+
id
|
|
729
|
+
}) {
|
|
730
|
+
return (0, _fetch.Delete)(`${_constants.urls.identity.users.accessTokens.v1}/${id}`);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
async function createUserAccessToken(body) {
|
|
734
|
+
return (0, _fetch.Post)(_constants.urls.identity.users.accessTokens.v1, body);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
async function createTenantAccessToken(body) {
|
|
738
|
+
return (0, _fetch.Post)(_constants.urls.identity.tenants.accessTokens.v1, body);
|
|
739
|
+
}
|
|
740
|
+
|
|
701
741
|
async function getUserApiTokensData() {
|
|
702
742
|
return (0, _fetch.Get)(_constants.urls.identity.users.apiTokens.v1);
|
|
703
743
|
}
|
|
@@ -18,7 +18,9 @@ exports.getLockoutPolicy = getLockoutPolicy;
|
|
|
18
18
|
exports.getMfaPolicy = getMfaPolicy;
|
|
19
19
|
exports.getPasswordConfigPolicy = getPasswordConfigPolicy;
|
|
20
20
|
exports.getPasswordHistoryPolicy = getPasswordHistoryPolicy;
|
|
21
|
+
exports.getVendorLockoutPolicy = getVendorLockoutPolicy;
|
|
21
22
|
exports.getVendorMfaPolicy = getVendorMfaPolicy;
|
|
23
|
+
exports.getVendorPasswordHistoryPolicy = getVendorPasswordHistoryPolicy;
|
|
22
24
|
exports.saveLockoutPolicy = saveLockoutPolicy;
|
|
23
25
|
exports.saveMfaPolicy = saveMfaPolicy;
|
|
24
26
|
exports.savePasswordHistoryPolicy = savePasswordHistoryPolicy;
|
|
@@ -55,6 +57,10 @@ async function getLockoutPolicy() {
|
|
|
55
57
|
return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/lockout-policy`);
|
|
56
58
|
}
|
|
57
59
|
|
|
60
|
+
async function getVendorLockoutPolicy() {
|
|
61
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/lockout-policy/vendor`);
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
async function saveLockoutPolicy(body) {
|
|
59
65
|
if (body.id) {
|
|
60
66
|
return (0, _fetch.Patch)(`${_constants.urls.identity.configurations.v1}/lockout-policy`, body);
|
|
@@ -75,6 +81,10 @@ async function getPasswordHistoryPolicy() {
|
|
|
75
81
|
return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/password-history-policy`);
|
|
76
82
|
}
|
|
77
83
|
|
|
84
|
+
async function getVendorPasswordHistoryPolicy() {
|
|
85
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/password-history-policy/vendor`);
|
|
86
|
+
}
|
|
87
|
+
|
|
78
88
|
async function savePasswordHistoryPolicy(body) {
|
|
79
89
|
if (body.id) {
|
|
80
90
|
return (0, _fetch.Patch)(`${_constants.urls.identity.configurations.v1}/password-history-policy`, body);
|
package/node/constants.js
CHANGED
|
@@ -20,6 +20,9 @@ const urls = {
|
|
|
20
20
|
apiTokens: {
|
|
21
21
|
v1: '/identity/resources/users/api-tokens/v1'
|
|
22
22
|
},
|
|
23
|
+
accessTokens: {
|
|
24
|
+
v1: '/identity/resources/users/access-tokens/v1'
|
|
25
|
+
},
|
|
23
26
|
sessions: {
|
|
24
27
|
v1: '/identity/resources/users/sessions/v1',
|
|
25
28
|
currentUser: {
|
|
@@ -58,6 +61,9 @@ const urls = {
|
|
|
58
61
|
v1: '/identity/resources/tenants/api-tokens/v1',
|
|
59
62
|
v2: '/identity/resources/tenants/api-tokens/v2'
|
|
60
63
|
},
|
|
64
|
+
accessTokens: {
|
|
65
|
+
v1: '/identity/resources/tenants/access-tokens/v1'
|
|
66
|
+
},
|
|
61
67
|
invites: {
|
|
62
68
|
user: {
|
|
63
69
|
v1: '/identity/resources/tenants/invites/v1/user'
|
package/node/index.js
CHANGED