@mudrichenkoevgeny/shared-foundation 0.0.51 → 0.0.53
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/index.d.ts +67 -62
- package/index.js +98 -93
- package/index.mjs +98 -93
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -280,6 +280,11 @@ export declare const ManagementUserConfigurationRoutes: {
|
|
|
280
280
|
readonly GET_CONFIGURATION: "/management/user-configuration";
|
|
281
281
|
};
|
|
282
282
|
|
|
283
|
+
export declare const WebSocketContract: {
|
|
284
|
+
readonly WS_OPEN_REALTIME_PATH: "/ws/realtime";
|
|
285
|
+
readonly WS_MANAGEMENT_REALTIME_PATH: "/management/ws/realtime";
|
|
286
|
+
};
|
|
287
|
+
|
|
283
288
|
export declare const CommonApiFields: {
|
|
284
289
|
readonly ITEMS: "items";
|
|
285
290
|
readonly TOTAL_COUNT: "total_count";
|
|
@@ -1011,19 +1016,7 @@ readonly MANAGEMENT: 'MANAGEMENT';
|
|
|
1011
1016
|
}
|
|
1012
1017
|
export const confirmationKeySchema: z.ZodType<ConfirmationKey>;
|
|
1013
1018
|
|
|
1014
|
-
export interface
|
|
1015
|
-
readonly deviceInfo: ClientDeviceInfo;
|
|
1016
|
-
readonly userAgent: string | null;
|
|
1017
|
-
readonly ipAddress: string | null;
|
|
1018
|
-
readonly host: string | null;
|
|
1019
|
-
readonly origin: string | null;
|
|
1020
|
-
readonly apiVersion: string | null;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
export declare const toClientInfo: (payload: ClientInfoPayload) => ClientInfo;
|
|
1024
|
-
export declare const toClientInfoPayload: (domain: ClientInfo) => ClientInfoPayload;
|
|
1025
|
-
|
|
1026
|
-
export interface ClientDeviceInfo {
|
|
1019
|
+
export interface ClientDeviceInfo {
|
|
1027
1020
|
readonly deviceId: ClientDeviceId | null;
|
|
1028
1021
|
readonly deviceName: string | null;
|
|
1029
1022
|
readonly clientType: ClientType | null;
|
|
@@ -1035,6 +1028,18 @@ readonly operationSystemVersion: string | null;
|
|
|
1035
1028
|
export declare const toClientDeviceInfo: (payload: ClientDeviceInfoPayload) => ClientDeviceInfo;
|
|
1036
1029
|
export declare const toClientDeviceInfoPayload: (domain: ClientDeviceInfo) => ClientDeviceInfoPayload;
|
|
1037
1030
|
|
|
1031
|
+
export interface ClientInfo {
|
|
1032
|
+
readonly deviceInfo: ClientDeviceInfo;
|
|
1033
|
+
readonly userAgent: string | null;
|
|
1034
|
+
readonly ipAddress: string | null;
|
|
1035
|
+
readonly host: string | null;
|
|
1036
|
+
readonly origin: string | null;
|
|
1037
|
+
readonly apiVersion: string | null;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
export declare const toClientInfo: (payload: ClientInfoPayload) => ClientInfo;
|
|
1041
|
+
export declare const toClientInfoPayload: (domain: ClientInfo) => ClientInfoPayload;
|
|
1042
|
+
|
|
1038
1043
|
export interface AccountLockoutPolicy {
|
|
1039
1044
|
readonly maxFailedPasswordAttempts: number;
|
|
1040
1045
|
readonly maxFailedOtpAttempts: number;
|
|
@@ -1165,6 +1170,14 @@ readonly minSupportedAppVersions: Record<string, string>;
|
|
|
1165
1170
|
export declare const toOpenGlobalSettings: (payload: OpenGlobalSettingsPayload) => OpenGlobalSettings;
|
|
1166
1171
|
export declare const toOpenGlobalSettingsPayload: (domain: OpenGlobalSettings) => OpenGlobalSettingsPayload;
|
|
1167
1172
|
|
|
1173
|
+
export interface AuditEventMetadata {
|
|
1174
|
+
readonly key: AuditMetadataKey;
|
|
1175
|
+
readonly value: string;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
export declare const toAuditEventMetadata: (payload: AuditEventMetadataPayload, metadataKeyParser: CompositeAuditMetadataKeyParser) => AuditEventMetadata;
|
|
1179
|
+
export declare const toAuditEventMetadataPayload: (domain: AuditEventMetadata) => AuditEventMetadataPayload;
|
|
1180
|
+
|
|
1168
1181
|
export interface AuditEvent {
|
|
1169
1182
|
readonly id: AuditEventId;
|
|
1170
1183
|
readonly actorId: UserId | null;
|
|
@@ -1183,13 +1196,37 @@ readonly createdAt: Instant;
|
|
|
1183
1196
|
export declare const toAuditEvent: (payload: AuditEventPayload, actionTypeParser: CompositeAuditActionTypeParser, resourceTypeParser: CompositeAuditResourceTypeParser, metadataKeyParser: CompositeAuditMetadataKeyParser) => AuditEvent;
|
|
1184
1197
|
export declare const toAuditEventPayload: (domain: AuditEvent) => AuditEventPayload;
|
|
1185
1198
|
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
readonly
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1199
|
+
export interface SessionToken {
|
|
1200
|
+
readonly accessToken: AccessToken;
|
|
1201
|
+
readonly refreshToken: RefreshToken;
|
|
1202
|
+
readonly expiresAt: Instant;
|
|
1203
|
+
readonly tokenType: string;
|
|
1204
|
+
readonly sessionId: UserSessionId;
|
|
1205
|
+
readonly identifierId: UserIdentifierId;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
export declare const toSessionToken: (payload: SessionTokenPayload) => SessionToken;
|
|
1209
|
+
export declare const toSessionTokenPayload: (domain: SessionToken) => SessionTokenPayload;
|
|
1210
|
+
|
|
1211
|
+
export interface UserDetails {
|
|
1212
|
+
readonly id: UserId;
|
|
1213
|
+
readonly role: UserRole;
|
|
1214
|
+
readonly accountStatus: UserAccountStatus;
|
|
1215
|
+
readonly accountStatusOnRestore: UserAccountStatus | null;
|
|
1216
|
+
readonly authorityLevel: number;
|
|
1217
|
+
readonly permissionCodes: PermissionCode[];
|
|
1218
|
+
readonly isTotpEnabled: boolean;
|
|
1219
|
+
readonly lastLoginAt: Instant | null;
|
|
1220
|
+
readonly lastActiveAt: Instant | null;
|
|
1221
|
+
readonly createdAt: Instant;
|
|
1222
|
+
readonly updatedAt: Instant | null;
|
|
1223
|
+
readonly scheduledPermanentDeletionAt: Instant | null;
|
|
1224
|
+
readonly lockoutType: AccountLockoutType;
|
|
1225
|
+
readonly temporaryLockoutUntil: Instant | null;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
export declare const toUserDetails: (payload: UserDetailsPayload) => UserDetails;
|
|
1229
|
+
export declare const toUserDetailsPayload: (domain: UserDetails) => UserDetailsPayload;
|
|
1193
1230
|
|
|
1194
1231
|
export interface AuthData {
|
|
1195
1232
|
readonly userDetails: UserDetails;
|
|
@@ -1207,6 +1244,16 @@ readonly secondary: UserAuthProvider[];
|
|
|
1207
1244
|
export declare const toAvailableAuthProviders: (payload: AvailableAuthProvidersPayload) => AvailableAuthProviders;
|
|
1208
1245
|
export declare const toAvailableAuthProvidersPayload: (domain: AvailableAuthProviders) => AvailableAuthProvidersPayload;
|
|
1209
1246
|
|
|
1247
|
+
export interface EmailRestrictionPolicy {
|
|
1248
|
+
readonly isBlacklistEnabled: boolean;
|
|
1249
|
+
readonly blacklist: string[];
|
|
1250
|
+
readonly isWhitelistEnabled: boolean;
|
|
1251
|
+
readonly whitelist: string[];
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
export declare const toEmailRestrictionPolicy: (payload: EmailRestrictionPolicyPayload) => EmailRestrictionPolicy;
|
|
1255
|
+
export declare const toEmailRestrictionPolicyPayload: (domain: EmailRestrictionPolicy) => EmailRestrictionPolicyPayload;
|
|
1256
|
+
|
|
1210
1257
|
export interface ManagementAuthSettings {
|
|
1211
1258
|
readonly availableAuthProviders: AvailableAuthProviders;
|
|
1212
1259
|
readonly maxTotalIdentifiers: number;
|
|
@@ -1257,16 +1304,6 @@ readonly openAuthSettings: OpenAuthSettings;
|
|
|
1257
1304
|
export declare const toOpenUserConfiguration: (payload: OpenUserConfigurationPayload) => OpenUserConfiguration;
|
|
1258
1305
|
export declare const toOpenUserConfigurationPayload: (domain: OpenUserConfiguration) => OpenUserConfigurationPayload;
|
|
1259
1306
|
|
|
1260
|
-
export interface EmailRestrictionPolicy {
|
|
1261
|
-
readonly isBlacklistEnabled: boolean;
|
|
1262
|
-
readonly blacklist: string[];
|
|
1263
|
-
readonly isWhitelistEnabled: boolean;
|
|
1264
|
-
readonly whitelist: string[];
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
export declare const toEmailRestrictionPolicy: (payload: EmailRestrictionPolicyPayload) => EmailRestrictionPolicy;
|
|
1268
|
-
export declare const toEmailRestrictionPolicyPayload: (domain: EmailRestrictionPolicy) => EmailRestrictionPolicyPayload;
|
|
1269
|
-
|
|
1270
1307
|
export interface UserIdentifier {
|
|
1271
1308
|
readonly id: UserIdentifierId;
|
|
1272
1309
|
readonly userId: UserId;
|
|
@@ -1311,38 +1348,6 @@ readonly updatedAt: Instant | null;
|
|
|
1311
1348
|
export declare const toUserSession: (payload: UserSessionPayload) => UserSession;
|
|
1312
1349
|
export declare const toUserSessionPayload: (domain: UserSession) => UserSessionPayload;
|
|
1313
1350
|
|
|
1314
|
-
export interface SessionToken {
|
|
1315
|
-
readonly accessToken: AccessToken;
|
|
1316
|
-
readonly refreshToken: RefreshToken;
|
|
1317
|
-
readonly expiresAt: Instant;
|
|
1318
|
-
readonly tokenType: string;
|
|
1319
|
-
readonly sessionId: UserSessionId;
|
|
1320
|
-
readonly identifierId: UserIdentifierId;
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
export declare const toSessionToken: (payload: SessionTokenPayload) => SessionToken;
|
|
1324
|
-
export declare const toSessionTokenPayload: (domain: SessionToken) => SessionTokenPayload;
|
|
1325
|
-
|
|
1326
|
-
export interface UserDetails {
|
|
1327
|
-
readonly id: UserId;
|
|
1328
|
-
readonly role: UserRole;
|
|
1329
|
-
readonly accountStatus: UserAccountStatus;
|
|
1330
|
-
readonly accountStatusOnRestore: UserAccountStatus | null;
|
|
1331
|
-
readonly authorityLevel: number;
|
|
1332
|
-
readonly permissionCodes: PermissionCode[];
|
|
1333
|
-
readonly isTotpEnabled: boolean;
|
|
1334
|
-
readonly lastLoginAt: Instant | null;
|
|
1335
|
-
readonly lastActiveAt: Instant | null;
|
|
1336
|
-
readonly createdAt: Instant;
|
|
1337
|
-
readonly updatedAt: Instant | null;
|
|
1338
|
-
readonly scheduledPermanentDeletionAt: Instant | null;
|
|
1339
|
-
readonly lockoutType: AccountLockoutType;
|
|
1340
|
-
readonly temporaryLockoutUntil: Instant | null;
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
export declare const toUserDetails: (payload: UserDetailsPayload) => UserDetails;
|
|
1344
|
-
export declare const toUserDetailsPayload: (domain: UserDetails) => UserDetailsPayload;
|
|
1345
|
-
|
|
1346
1351
|
export interface UserPublic {
|
|
1347
1352
|
readonly id: UserId;
|
|
1348
1353
|
readonly role: UserRole;
|
package/index.js
CHANGED
|
@@ -573,6 +573,11 @@ export const ManagementUserConfigurationRoutes = {
|
|
|
573
573
|
GET_CONFIGURATION: "/management/user-configuration"
|
|
574
574
|
};
|
|
575
575
|
|
|
576
|
+
export const WebSocketContract = {
|
|
577
|
+
WS_OPEN_REALTIME_PATH: "/ws/realtime",
|
|
578
|
+
WS_MANAGEMENT_REALTIME_PATH: "/management/ws/realtime"
|
|
579
|
+
};
|
|
580
|
+
|
|
576
581
|
export const CommonApiFields = {
|
|
577
582
|
ITEMS: "items",
|
|
578
583
|
TOTAL_COUNT: "total_count",
|
|
@@ -1011,23 +1016,7 @@ export const UserPermissionCode = {
|
|
|
1011
1016
|
|
|
1012
1017
|
};
|
|
1013
1018
|
|
|
1014
|
-
export const
|
|
1015
|
-
deviceInfo: toClientDeviceInfo(payload.client_device_info),
|
|
1016
|
-
userAgent: payload.user_agent,
|
|
1017
|
-
ipAddress: payload.ip_address,
|
|
1018
|
-
host: null,
|
|
1019
|
-
origin: null,
|
|
1020
|
-
apiVersion: payload.api_version
|
|
1021
|
-
});
|
|
1022
|
-
|
|
1023
|
-
export const toClientInfoPayload = (domain) => ({
|
|
1024
|
-
client_device_info: toClientDeviceInfoPayload(domain.deviceInfo),
|
|
1025
|
-
user_agent: domain.userAgent,
|
|
1026
|
-
ip_address: domain.ipAddress,
|
|
1027
|
-
api_version: domain.apiVersion
|
|
1028
|
-
});
|
|
1029
|
-
|
|
1030
|
-
export const toClientDeviceInfo = (payload) => ({
|
|
1019
|
+
export const toClientDeviceInfo = (payload) => ({
|
|
1031
1020
|
deviceId: payload.device_id ? toClientDeviceIdOrThrow(payload.device_id) : null,
|
|
1032
1021
|
deviceName: payload.device_name,
|
|
1033
1022
|
clientType: payload.client_type,
|
|
@@ -1045,6 +1034,22 @@ app_version: domain.appVersion,
|
|
|
1045
1034
|
operation_system_version: domain.operationSystemVersion
|
|
1046
1035
|
});
|
|
1047
1036
|
|
|
1037
|
+
export const toClientInfo = (payload) => ({
|
|
1038
|
+
deviceInfo: toClientDeviceInfo(payload.client_device_info),
|
|
1039
|
+
userAgent: payload.user_agent,
|
|
1040
|
+
ipAddress: payload.ip_address,
|
|
1041
|
+
host: null,
|
|
1042
|
+
origin: null,
|
|
1043
|
+
apiVersion: payload.api_version
|
|
1044
|
+
});
|
|
1045
|
+
|
|
1046
|
+
export const toClientInfoPayload = (domain) => ({
|
|
1047
|
+
client_device_info: toClientDeviceInfoPayload(domain.deviceInfo),
|
|
1048
|
+
user_agent: domain.userAgent,
|
|
1049
|
+
ip_address: domain.ipAddress,
|
|
1050
|
+
api_version: domain.apiVersion
|
|
1051
|
+
});
|
|
1052
|
+
|
|
1048
1053
|
export const toAccountLockoutPolicy = (payload) => ({
|
|
1049
1054
|
maxFailedPasswordAttempts: payload.max_failed_password_attempts,
|
|
1050
1055
|
maxFailedOtpAttempts: payload.max_failed_otp_attempts,
|
|
@@ -1233,6 +1238,18 @@ contact_support_email: domain.contactSupportEmail,
|
|
|
1233
1238
|
min_supported_app_versions: domain.minSupportedAppVersions
|
|
1234
1239
|
});
|
|
1235
1240
|
|
|
1241
|
+
export const toAuditEventMetadata = (payload, metadataKeyParser) => ({
|
|
1242
|
+
key: metadataKeyParser.fromValueOrThrow(payload.key),
|
|
1243
|
+
value: payload.value,
|
|
1244
|
+
valueSensitivity: payload.valueSensitivity
|
|
1245
|
+
});
|
|
1246
|
+
|
|
1247
|
+
export const toAuditEventMetadataPayload = (domain) => ({
|
|
1248
|
+
key: domain.key,
|
|
1249
|
+
value: domain.value,
|
|
1250
|
+
valueSensitivity: domain.valueSensitivity
|
|
1251
|
+
});
|
|
1252
|
+
|
|
1236
1253
|
export const toAuditEvent = (payload, actionTypeParser, resourceTypeParser, metadataKeyParser) => ({
|
|
1237
1254
|
id: toAuditEventIdOrThrow(payload.id),
|
|
1238
1255
|
actorId: payload.actorId,
|
|
@@ -1262,17 +1279,57 @@ export const toAuditEventPayload = (domain) => ({
|
|
|
1262
1279
|
createdAt: domain.createdAt
|
|
1263
1280
|
});
|
|
1264
1281
|
|
|
1265
|
-
export const
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1282
|
+
export const toSessionToken = (payload) => ({
|
|
1283
|
+
accessToken: payload.access_token,
|
|
1284
|
+
refreshToken: payload.refresh_token,
|
|
1285
|
+
expiresAt: payload.expires_at,
|
|
1286
|
+
tokenType: payload.token_type,
|
|
1287
|
+
sessionId: toUserSessionIdOrThrow(payload.session_id),
|
|
1288
|
+
identifierId: toUserIdentifierIdOrThrow(payload.identifier_id)
|
|
1289
|
+
});
|
|
1290
|
+
|
|
1291
|
+
export const toSessionTokenPayload = (domain) => ({
|
|
1292
|
+
access_token: domain.accessToken,
|
|
1293
|
+
refresh_token: domain.refreshToken,
|
|
1294
|
+
expires_at: domain.expiresAt,
|
|
1295
|
+
token_type: domain.tokenType,
|
|
1296
|
+
session_id: domain.sessionId,
|
|
1297
|
+
identifier_id: domain.identifierId
|
|
1298
|
+
});
|
|
1270
1299
|
|
|
1271
|
-
export const
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1300
|
+
export const toUserDetails = (payload) => ({
|
|
1301
|
+
id: toUserIdOrThrow(payload.id),
|
|
1302
|
+
role: payload.role,
|
|
1303
|
+
accountStatus: payload.account_status,
|
|
1304
|
+
accountStatusOnRestore: payload.account_status_on_restore,
|
|
1305
|
+
authorityLevel: payload.authority_level,
|
|
1306
|
+
permissionCodes: payload.permission_codes ? payload.permission_codes.map(val => toPermissionCodeOrThrow(val)) : [],
|
|
1307
|
+
isTotpEnabled: payload.is_totp_enabled,
|
|
1308
|
+
lastLoginAt: payload.last_login_at,
|
|
1309
|
+
lastActiveAt: payload.last_active_at,
|
|
1310
|
+
createdAt: payload.created_at,
|
|
1311
|
+
updatedAt: payload.updated_at,
|
|
1312
|
+
scheduledPermanentDeletionAt: payload.scheduled_permanent_deletion_at,
|
|
1313
|
+
lockoutType: payload.account_lockout_type,
|
|
1314
|
+
temporaryLockoutUntil: payload.temporary_lockout_until
|
|
1315
|
+
});
|
|
1316
|
+
|
|
1317
|
+
export const toUserDetailsPayload = (domain) => ({
|
|
1318
|
+
id: domain.id,
|
|
1319
|
+
role: domain.role,
|
|
1320
|
+
account_status: domain.accountStatus,
|
|
1321
|
+
account_status_on_restore: domain.accountStatusOnRestore,
|
|
1322
|
+
authority_level: domain.authorityLevel,
|
|
1323
|
+
permission_codes: domain.permissionCodes,
|
|
1324
|
+
is_totp_enabled: domain.isTotpEnabled,
|
|
1325
|
+
last_login_at: domain.lastLoginAt,
|
|
1326
|
+
last_active_at: domain.lastActiveAt,
|
|
1327
|
+
created_at: domain.createdAt,
|
|
1328
|
+
updated_at: domain.updatedAt,
|
|
1329
|
+
scheduled_permanent_deletion_at: domain.scheduledPermanentDeletionAt,
|
|
1330
|
+
account_lockout_type: domain.lockoutType,
|
|
1331
|
+
temporary_lockout_until: domain.temporaryLockoutUntil
|
|
1332
|
+
});
|
|
1276
1333
|
|
|
1277
1334
|
export const toAuthData = (payload) => ({
|
|
1278
1335
|
userDetails: toUserDetails(payload.user),
|
|
@@ -1294,6 +1351,20 @@ secondary: payload.secondary
|
|
|
1294
1351
|
secondary: domain.secondary
|
|
1295
1352
|
});
|
|
1296
1353
|
|
|
1354
|
+
export const toEmailRestrictionPolicy = (payload) => ({
|
|
1355
|
+
isBlacklistEnabled: payload.is_blacklist_enabled,
|
|
1356
|
+
blacklist: payload.blacklist,
|
|
1357
|
+
isWhitelistEnabled: payload.is_whitelist_enabled,
|
|
1358
|
+
whitelist: payload.whitelist
|
|
1359
|
+
});
|
|
1360
|
+
|
|
1361
|
+
export const toEmailRestrictionPolicyPayload = (domain) => ({
|
|
1362
|
+
is_blacklist_enabled: domain.isBlacklistEnabled,
|
|
1363
|
+
blacklist: domain.blacklist,
|
|
1364
|
+
is_whitelist_enabled: domain.isWhitelistEnabled,
|
|
1365
|
+
whitelist: domain.whitelist
|
|
1366
|
+
});
|
|
1367
|
+
|
|
1297
1368
|
export const toManagementAuthSettings = (payload) => ({
|
|
1298
1369
|
availableAuthProviders: toAvailableAuthProviders(payload.available_auth_providers),
|
|
1299
1370
|
maxTotalIdentifiers: payload.max_total_identifiers,
|
|
@@ -1370,20 +1441,6 @@ open_security_settings: toOpenSecuritySettingsPayload(domain.openSecuritySetting
|
|
|
1370
1441
|
open_auth_settings: toOpenAuthSettingsPayload(domain.openAuthSettings)
|
|
1371
1442
|
});
|
|
1372
1443
|
|
|
1373
|
-
export const toEmailRestrictionPolicy = (payload) => ({
|
|
1374
|
-
isBlacklistEnabled: payload.is_blacklist_enabled,
|
|
1375
|
-
blacklist: payload.blacklist,
|
|
1376
|
-
isWhitelistEnabled: payload.is_whitelist_enabled,
|
|
1377
|
-
whitelist: payload.whitelist
|
|
1378
|
-
});
|
|
1379
|
-
|
|
1380
|
-
export const toEmailRestrictionPolicyPayload = (domain) => ({
|
|
1381
|
-
is_blacklist_enabled: domain.isBlacklistEnabled,
|
|
1382
|
-
blacklist: domain.blacklist,
|
|
1383
|
-
is_whitelist_enabled: domain.isWhitelistEnabled,
|
|
1384
|
-
whitelist: domain.whitelist
|
|
1385
|
-
});
|
|
1386
|
-
|
|
1387
1444
|
export const toUserIdentifier = (payload) => ({
|
|
1388
1445
|
id: toUserIdentifierIdOrThrow(payload.id),
|
|
1389
1446
|
userId: toUserIdOrThrow(payload.user_id),
|
|
@@ -1454,58 +1511,6 @@ created_at: domain.createdAt,
|
|
|
1454
1511
|
updated_at: domain.updatedAt
|
|
1455
1512
|
});
|
|
1456
1513
|
|
|
1457
|
-
export const toSessionToken = (payload) => ({
|
|
1458
|
-
accessToken: payload.access_token,
|
|
1459
|
-
refreshToken: payload.refresh_token,
|
|
1460
|
-
expiresAt: payload.expires_at,
|
|
1461
|
-
tokenType: payload.token_type,
|
|
1462
|
-
sessionId: toUserSessionIdOrThrow(payload.session_id),
|
|
1463
|
-
identifierId: toUserIdentifierIdOrThrow(payload.identifier_id)
|
|
1464
|
-
});
|
|
1465
|
-
|
|
1466
|
-
export const toSessionTokenPayload = (domain) => ({
|
|
1467
|
-
access_token: domain.accessToken,
|
|
1468
|
-
refresh_token: domain.refreshToken,
|
|
1469
|
-
expires_at: domain.expiresAt,
|
|
1470
|
-
token_type: domain.tokenType,
|
|
1471
|
-
session_id: domain.sessionId,
|
|
1472
|
-
identifier_id: domain.identifierId
|
|
1473
|
-
});
|
|
1474
|
-
|
|
1475
|
-
export const toUserDetails = (payload) => ({
|
|
1476
|
-
id: toUserIdOrThrow(payload.id),
|
|
1477
|
-
role: payload.role,
|
|
1478
|
-
accountStatus: payload.account_status,
|
|
1479
|
-
accountStatusOnRestore: payload.account_status_on_restore,
|
|
1480
|
-
authorityLevel: payload.authority_level,
|
|
1481
|
-
permissionCodes: payload.permission_codes ? payload.permission_codes.map(val => toPermissionCodeOrThrow(val)) : [],
|
|
1482
|
-
isTotpEnabled: payload.is_totp_enabled,
|
|
1483
|
-
lastLoginAt: payload.last_login_at,
|
|
1484
|
-
lastActiveAt: payload.last_active_at,
|
|
1485
|
-
createdAt: payload.created_at,
|
|
1486
|
-
updatedAt: payload.updated_at,
|
|
1487
|
-
scheduledPermanentDeletionAt: payload.scheduled_permanent_deletion_at,
|
|
1488
|
-
lockoutType: payload.account_lockout_type,
|
|
1489
|
-
temporaryLockoutUntil: payload.temporary_lockout_until
|
|
1490
|
-
});
|
|
1491
|
-
|
|
1492
|
-
export const toUserDetailsPayload = (domain) => ({
|
|
1493
|
-
id: domain.id,
|
|
1494
|
-
role: domain.role,
|
|
1495
|
-
account_status: domain.accountStatus,
|
|
1496
|
-
account_status_on_restore: domain.accountStatusOnRestore,
|
|
1497
|
-
authority_level: domain.authorityLevel,
|
|
1498
|
-
permission_codes: domain.permissionCodes,
|
|
1499
|
-
is_totp_enabled: domain.isTotpEnabled,
|
|
1500
|
-
last_login_at: domain.lastLoginAt,
|
|
1501
|
-
last_active_at: domain.lastActiveAt,
|
|
1502
|
-
created_at: domain.createdAt,
|
|
1503
|
-
updated_at: domain.updatedAt,
|
|
1504
|
-
scheduled_permanent_deletion_at: domain.scheduledPermanentDeletionAt,
|
|
1505
|
-
account_lockout_type: domain.lockoutType,
|
|
1506
|
-
temporary_lockout_until: domain.temporaryLockoutUntil
|
|
1507
|
-
});
|
|
1508
|
-
|
|
1509
1514
|
export const toUserPublic = (payload) => ({
|
|
1510
1515
|
id: toUserIdOrThrow(payload.id),
|
|
1511
1516
|
role: payload.role,
|
package/index.mjs
CHANGED
|
@@ -573,6 +573,11 @@ export const ManagementUserConfigurationRoutes = {
|
|
|
573
573
|
GET_CONFIGURATION: "/management/user-configuration"
|
|
574
574
|
};
|
|
575
575
|
|
|
576
|
+
export const WebSocketContract = {
|
|
577
|
+
WS_OPEN_REALTIME_PATH: "/ws/realtime",
|
|
578
|
+
WS_MANAGEMENT_REALTIME_PATH: "/management/ws/realtime"
|
|
579
|
+
};
|
|
580
|
+
|
|
576
581
|
export const CommonApiFields = {
|
|
577
582
|
ITEMS: "items",
|
|
578
583
|
TOTAL_COUNT: "total_count",
|
|
@@ -1011,23 +1016,7 @@ export const UserPermissionCode = {
|
|
|
1011
1016
|
|
|
1012
1017
|
};
|
|
1013
1018
|
|
|
1014
|
-
export const
|
|
1015
|
-
deviceInfo: toClientDeviceInfo(payload.client_device_info),
|
|
1016
|
-
userAgent: payload.user_agent,
|
|
1017
|
-
ipAddress: payload.ip_address,
|
|
1018
|
-
host: null,
|
|
1019
|
-
origin: null,
|
|
1020
|
-
apiVersion: payload.api_version
|
|
1021
|
-
});
|
|
1022
|
-
|
|
1023
|
-
export const toClientInfoPayload = (domain) => ({
|
|
1024
|
-
client_device_info: toClientDeviceInfoPayload(domain.deviceInfo),
|
|
1025
|
-
user_agent: domain.userAgent,
|
|
1026
|
-
ip_address: domain.ipAddress,
|
|
1027
|
-
api_version: domain.apiVersion
|
|
1028
|
-
});
|
|
1029
|
-
|
|
1030
|
-
export const toClientDeviceInfo = (payload) => ({
|
|
1019
|
+
export const toClientDeviceInfo = (payload) => ({
|
|
1031
1020
|
deviceId: payload.device_id ? toClientDeviceIdOrThrow(payload.device_id) : null,
|
|
1032
1021
|
deviceName: payload.device_name,
|
|
1033
1022
|
clientType: payload.client_type,
|
|
@@ -1045,6 +1034,22 @@ app_version: domain.appVersion,
|
|
|
1045
1034
|
operation_system_version: domain.operationSystemVersion
|
|
1046
1035
|
});
|
|
1047
1036
|
|
|
1037
|
+
export const toClientInfo = (payload) => ({
|
|
1038
|
+
deviceInfo: toClientDeviceInfo(payload.client_device_info),
|
|
1039
|
+
userAgent: payload.user_agent,
|
|
1040
|
+
ipAddress: payload.ip_address,
|
|
1041
|
+
host: null,
|
|
1042
|
+
origin: null,
|
|
1043
|
+
apiVersion: payload.api_version
|
|
1044
|
+
});
|
|
1045
|
+
|
|
1046
|
+
export const toClientInfoPayload = (domain) => ({
|
|
1047
|
+
client_device_info: toClientDeviceInfoPayload(domain.deviceInfo),
|
|
1048
|
+
user_agent: domain.userAgent,
|
|
1049
|
+
ip_address: domain.ipAddress,
|
|
1050
|
+
api_version: domain.apiVersion
|
|
1051
|
+
});
|
|
1052
|
+
|
|
1048
1053
|
export const toAccountLockoutPolicy = (payload) => ({
|
|
1049
1054
|
maxFailedPasswordAttempts: payload.max_failed_password_attempts,
|
|
1050
1055
|
maxFailedOtpAttempts: payload.max_failed_otp_attempts,
|
|
@@ -1233,6 +1238,18 @@ contact_support_email: domain.contactSupportEmail,
|
|
|
1233
1238
|
min_supported_app_versions: domain.minSupportedAppVersions
|
|
1234
1239
|
});
|
|
1235
1240
|
|
|
1241
|
+
export const toAuditEventMetadata = (payload, metadataKeyParser) => ({
|
|
1242
|
+
key: metadataKeyParser.fromValueOrThrow(payload.key),
|
|
1243
|
+
value: payload.value,
|
|
1244
|
+
valueSensitivity: payload.valueSensitivity
|
|
1245
|
+
});
|
|
1246
|
+
|
|
1247
|
+
export const toAuditEventMetadataPayload = (domain) => ({
|
|
1248
|
+
key: domain.key,
|
|
1249
|
+
value: domain.value,
|
|
1250
|
+
valueSensitivity: domain.valueSensitivity
|
|
1251
|
+
});
|
|
1252
|
+
|
|
1236
1253
|
export const toAuditEvent = (payload, actionTypeParser, resourceTypeParser, metadataKeyParser) => ({
|
|
1237
1254
|
id: toAuditEventIdOrThrow(payload.id),
|
|
1238
1255
|
actorId: payload.actorId,
|
|
@@ -1262,17 +1279,57 @@ export const toAuditEventPayload = (domain) => ({
|
|
|
1262
1279
|
createdAt: domain.createdAt
|
|
1263
1280
|
});
|
|
1264
1281
|
|
|
1265
|
-
export const
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1282
|
+
export const toSessionToken = (payload) => ({
|
|
1283
|
+
accessToken: payload.access_token,
|
|
1284
|
+
refreshToken: payload.refresh_token,
|
|
1285
|
+
expiresAt: payload.expires_at,
|
|
1286
|
+
tokenType: payload.token_type,
|
|
1287
|
+
sessionId: toUserSessionIdOrThrow(payload.session_id),
|
|
1288
|
+
identifierId: toUserIdentifierIdOrThrow(payload.identifier_id)
|
|
1289
|
+
});
|
|
1290
|
+
|
|
1291
|
+
export const toSessionTokenPayload = (domain) => ({
|
|
1292
|
+
access_token: domain.accessToken,
|
|
1293
|
+
refresh_token: domain.refreshToken,
|
|
1294
|
+
expires_at: domain.expiresAt,
|
|
1295
|
+
token_type: domain.tokenType,
|
|
1296
|
+
session_id: domain.sessionId,
|
|
1297
|
+
identifier_id: domain.identifierId
|
|
1298
|
+
});
|
|
1270
1299
|
|
|
1271
|
-
export const
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1300
|
+
export const toUserDetails = (payload) => ({
|
|
1301
|
+
id: toUserIdOrThrow(payload.id),
|
|
1302
|
+
role: payload.role,
|
|
1303
|
+
accountStatus: payload.account_status,
|
|
1304
|
+
accountStatusOnRestore: payload.account_status_on_restore,
|
|
1305
|
+
authorityLevel: payload.authority_level,
|
|
1306
|
+
permissionCodes: payload.permission_codes ? payload.permission_codes.map(val => toPermissionCodeOrThrow(val)) : [],
|
|
1307
|
+
isTotpEnabled: payload.is_totp_enabled,
|
|
1308
|
+
lastLoginAt: payload.last_login_at,
|
|
1309
|
+
lastActiveAt: payload.last_active_at,
|
|
1310
|
+
createdAt: payload.created_at,
|
|
1311
|
+
updatedAt: payload.updated_at,
|
|
1312
|
+
scheduledPermanentDeletionAt: payload.scheduled_permanent_deletion_at,
|
|
1313
|
+
lockoutType: payload.account_lockout_type,
|
|
1314
|
+
temporaryLockoutUntil: payload.temporary_lockout_until
|
|
1315
|
+
});
|
|
1316
|
+
|
|
1317
|
+
export const toUserDetailsPayload = (domain) => ({
|
|
1318
|
+
id: domain.id,
|
|
1319
|
+
role: domain.role,
|
|
1320
|
+
account_status: domain.accountStatus,
|
|
1321
|
+
account_status_on_restore: domain.accountStatusOnRestore,
|
|
1322
|
+
authority_level: domain.authorityLevel,
|
|
1323
|
+
permission_codes: domain.permissionCodes,
|
|
1324
|
+
is_totp_enabled: domain.isTotpEnabled,
|
|
1325
|
+
last_login_at: domain.lastLoginAt,
|
|
1326
|
+
last_active_at: domain.lastActiveAt,
|
|
1327
|
+
created_at: domain.createdAt,
|
|
1328
|
+
updated_at: domain.updatedAt,
|
|
1329
|
+
scheduled_permanent_deletion_at: domain.scheduledPermanentDeletionAt,
|
|
1330
|
+
account_lockout_type: domain.lockoutType,
|
|
1331
|
+
temporary_lockout_until: domain.temporaryLockoutUntil
|
|
1332
|
+
});
|
|
1276
1333
|
|
|
1277
1334
|
export const toAuthData = (payload) => ({
|
|
1278
1335
|
userDetails: toUserDetails(payload.user),
|
|
@@ -1294,6 +1351,20 @@ secondary: payload.secondary
|
|
|
1294
1351
|
secondary: domain.secondary
|
|
1295
1352
|
});
|
|
1296
1353
|
|
|
1354
|
+
export const toEmailRestrictionPolicy = (payload) => ({
|
|
1355
|
+
isBlacklistEnabled: payload.is_blacklist_enabled,
|
|
1356
|
+
blacklist: payload.blacklist,
|
|
1357
|
+
isWhitelistEnabled: payload.is_whitelist_enabled,
|
|
1358
|
+
whitelist: payload.whitelist
|
|
1359
|
+
});
|
|
1360
|
+
|
|
1361
|
+
export const toEmailRestrictionPolicyPayload = (domain) => ({
|
|
1362
|
+
is_blacklist_enabled: domain.isBlacklistEnabled,
|
|
1363
|
+
blacklist: domain.blacklist,
|
|
1364
|
+
is_whitelist_enabled: domain.isWhitelistEnabled,
|
|
1365
|
+
whitelist: domain.whitelist
|
|
1366
|
+
});
|
|
1367
|
+
|
|
1297
1368
|
export const toManagementAuthSettings = (payload) => ({
|
|
1298
1369
|
availableAuthProviders: toAvailableAuthProviders(payload.available_auth_providers),
|
|
1299
1370
|
maxTotalIdentifiers: payload.max_total_identifiers,
|
|
@@ -1370,20 +1441,6 @@ open_security_settings: toOpenSecuritySettingsPayload(domain.openSecuritySetting
|
|
|
1370
1441
|
open_auth_settings: toOpenAuthSettingsPayload(domain.openAuthSettings)
|
|
1371
1442
|
});
|
|
1372
1443
|
|
|
1373
|
-
export const toEmailRestrictionPolicy = (payload) => ({
|
|
1374
|
-
isBlacklistEnabled: payload.is_blacklist_enabled,
|
|
1375
|
-
blacklist: payload.blacklist,
|
|
1376
|
-
isWhitelistEnabled: payload.is_whitelist_enabled,
|
|
1377
|
-
whitelist: payload.whitelist
|
|
1378
|
-
});
|
|
1379
|
-
|
|
1380
|
-
export const toEmailRestrictionPolicyPayload = (domain) => ({
|
|
1381
|
-
is_blacklist_enabled: domain.isBlacklistEnabled,
|
|
1382
|
-
blacklist: domain.blacklist,
|
|
1383
|
-
is_whitelist_enabled: domain.isWhitelistEnabled,
|
|
1384
|
-
whitelist: domain.whitelist
|
|
1385
|
-
});
|
|
1386
|
-
|
|
1387
1444
|
export const toUserIdentifier = (payload) => ({
|
|
1388
1445
|
id: toUserIdentifierIdOrThrow(payload.id),
|
|
1389
1446
|
userId: toUserIdOrThrow(payload.user_id),
|
|
@@ -1454,58 +1511,6 @@ created_at: domain.createdAt,
|
|
|
1454
1511
|
updated_at: domain.updatedAt
|
|
1455
1512
|
});
|
|
1456
1513
|
|
|
1457
|
-
export const toSessionToken = (payload) => ({
|
|
1458
|
-
accessToken: payload.access_token,
|
|
1459
|
-
refreshToken: payload.refresh_token,
|
|
1460
|
-
expiresAt: payload.expires_at,
|
|
1461
|
-
tokenType: payload.token_type,
|
|
1462
|
-
sessionId: toUserSessionIdOrThrow(payload.session_id),
|
|
1463
|
-
identifierId: toUserIdentifierIdOrThrow(payload.identifier_id)
|
|
1464
|
-
});
|
|
1465
|
-
|
|
1466
|
-
export const toSessionTokenPayload = (domain) => ({
|
|
1467
|
-
access_token: domain.accessToken,
|
|
1468
|
-
refresh_token: domain.refreshToken,
|
|
1469
|
-
expires_at: domain.expiresAt,
|
|
1470
|
-
token_type: domain.tokenType,
|
|
1471
|
-
session_id: domain.sessionId,
|
|
1472
|
-
identifier_id: domain.identifierId
|
|
1473
|
-
});
|
|
1474
|
-
|
|
1475
|
-
export const toUserDetails = (payload) => ({
|
|
1476
|
-
id: toUserIdOrThrow(payload.id),
|
|
1477
|
-
role: payload.role,
|
|
1478
|
-
accountStatus: payload.account_status,
|
|
1479
|
-
accountStatusOnRestore: payload.account_status_on_restore,
|
|
1480
|
-
authorityLevel: payload.authority_level,
|
|
1481
|
-
permissionCodes: payload.permission_codes ? payload.permission_codes.map(val => toPermissionCodeOrThrow(val)) : [],
|
|
1482
|
-
isTotpEnabled: payload.is_totp_enabled,
|
|
1483
|
-
lastLoginAt: payload.last_login_at,
|
|
1484
|
-
lastActiveAt: payload.last_active_at,
|
|
1485
|
-
createdAt: payload.created_at,
|
|
1486
|
-
updatedAt: payload.updated_at,
|
|
1487
|
-
scheduledPermanentDeletionAt: payload.scheduled_permanent_deletion_at,
|
|
1488
|
-
lockoutType: payload.account_lockout_type,
|
|
1489
|
-
temporaryLockoutUntil: payload.temporary_lockout_until
|
|
1490
|
-
});
|
|
1491
|
-
|
|
1492
|
-
export const toUserDetailsPayload = (domain) => ({
|
|
1493
|
-
id: domain.id,
|
|
1494
|
-
role: domain.role,
|
|
1495
|
-
account_status: domain.accountStatus,
|
|
1496
|
-
account_status_on_restore: domain.accountStatusOnRestore,
|
|
1497
|
-
authority_level: domain.authorityLevel,
|
|
1498
|
-
permission_codes: domain.permissionCodes,
|
|
1499
|
-
is_totp_enabled: domain.isTotpEnabled,
|
|
1500
|
-
last_login_at: domain.lastLoginAt,
|
|
1501
|
-
last_active_at: domain.lastActiveAt,
|
|
1502
|
-
created_at: domain.createdAt,
|
|
1503
|
-
updated_at: domain.updatedAt,
|
|
1504
|
-
scheduled_permanent_deletion_at: domain.scheduledPermanentDeletionAt,
|
|
1505
|
-
account_lockout_type: domain.lockoutType,
|
|
1506
|
-
temporary_lockout_until: domain.temporaryLockoutUntil
|
|
1507
|
-
});
|
|
1508
|
-
|
|
1509
1514
|
export const toUserPublic = (payload) => ({
|
|
1510
1515
|
id: toUserIdOrThrow(payload.id),
|
|
1511
1516
|
role: payload.role,
|