@mudrichenkoevgeny/shared-foundation 0.0.51 → 0.0.52
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 +62 -62
- package/index.js +93 -93
- package/index.mjs +93 -93
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1011,19 +1011,7 @@ readonly MANAGEMENT: 'MANAGEMENT';
|
|
|
1011
1011
|
}
|
|
1012
1012
|
export const confirmationKeySchema: z.ZodType<ConfirmationKey>;
|
|
1013
1013
|
|
|
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 {
|
|
1014
|
+
export interface ClientDeviceInfo {
|
|
1027
1015
|
readonly deviceId: ClientDeviceId | null;
|
|
1028
1016
|
readonly deviceName: string | null;
|
|
1029
1017
|
readonly clientType: ClientType | null;
|
|
@@ -1035,6 +1023,18 @@ readonly operationSystemVersion: string | null;
|
|
|
1035
1023
|
export declare const toClientDeviceInfo: (payload: ClientDeviceInfoPayload) => ClientDeviceInfo;
|
|
1036
1024
|
export declare const toClientDeviceInfoPayload: (domain: ClientDeviceInfo) => ClientDeviceInfoPayload;
|
|
1037
1025
|
|
|
1026
|
+
export interface ClientInfo {
|
|
1027
|
+
readonly deviceInfo: ClientDeviceInfo;
|
|
1028
|
+
readonly userAgent: string | null;
|
|
1029
|
+
readonly ipAddress: string | null;
|
|
1030
|
+
readonly host: string | null;
|
|
1031
|
+
readonly origin: string | null;
|
|
1032
|
+
readonly apiVersion: string | null;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
export declare const toClientInfo: (payload: ClientInfoPayload) => ClientInfo;
|
|
1036
|
+
export declare const toClientInfoPayload: (domain: ClientInfo) => ClientInfoPayload;
|
|
1037
|
+
|
|
1038
1038
|
export interface AccountLockoutPolicy {
|
|
1039
1039
|
readonly maxFailedPasswordAttempts: number;
|
|
1040
1040
|
readonly maxFailedOtpAttempts: number;
|
|
@@ -1165,6 +1165,14 @@ readonly minSupportedAppVersions: Record<string, string>;
|
|
|
1165
1165
|
export declare const toOpenGlobalSettings: (payload: OpenGlobalSettingsPayload) => OpenGlobalSettings;
|
|
1166
1166
|
export declare const toOpenGlobalSettingsPayload: (domain: OpenGlobalSettings) => OpenGlobalSettingsPayload;
|
|
1167
1167
|
|
|
1168
|
+
export interface AuditEventMetadata {
|
|
1169
|
+
readonly key: AuditMetadataKey;
|
|
1170
|
+
readonly value: string;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
export declare const toAuditEventMetadata: (payload: AuditEventMetadataPayload, metadataKeyParser: CompositeAuditMetadataKeyParser) => AuditEventMetadata;
|
|
1174
|
+
export declare const toAuditEventMetadataPayload: (domain: AuditEventMetadata) => AuditEventMetadataPayload;
|
|
1175
|
+
|
|
1168
1176
|
export interface AuditEvent {
|
|
1169
1177
|
readonly id: AuditEventId;
|
|
1170
1178
|
readonly actorId: UserId | null;
|
|
@@ -1183,13 +1191,37 @@ readonly createdAt: Instant;
|
|
|
1183
1191
|
export declare const toAuditEvent: (payload: AuditEventPayload, actionTypeParser: CompositeAuditActionTypeParser, resourceTypeParser: CompositeAuditResourceTypeParser, metadataKeyParser: CompositeAuditMetadataKeyParser) => AuditEvent;
|
|
1184
1192
|
export declare const toAuditEventPayload: (domain: AuditEvent) => AuditEventPayload;
|
|
1185
1193
|
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
readonly
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1194
|
+
export interface SessionToken {
|
|
1195
|
+
readonly accessToken: AccessToken;
|
|
1196
|
+
readonly refreshToken: RefreshToken;
|
|
1197
|
+
readonly expiresAt: Instant;
|
|
1198
|
+
readonly tokenType: string;
|
|
1199
|
+
readonly sessionId: UserSessionId;
|
|
1200
|
+
readonly identifierId: UserIdentifierId;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
export declare const toSessionToken: (payload: SessionTokenPayload) => SessionToken;
|
|
1204
|
+
export declare const toSessionTokenPayload: (domain: SessionToken) => SessionTokenPayload;
|
|
1205
|
+
|
|
1206
|
+
export interface UserDetails {
|
|
1207
|
+
readonly id: UserId;
|
|
1208
|
+
readonly role: UserRole;
|
|
1209
|
+
readonly accountStatus: UserAccountStatus;
|
|
1210
|
+
readonly accountStatusOnRestore: UserAccountStatus | null;
|
|
1211
|
+
readonly authorityLevel: number;
|
|
1212
|
+
readonly permissionCodes: PermissionCode[];
|
|
1213
|
+
readonly isTotpEnabled: boolean;
|
|
1214
|
+
readonly lastLoginAt: Instant | null;
|
|
1215
|
+
readonly lastActiveAt: Instant | null;
|
|
1216
|
+
readonly createdAt: Instant;
|
|
1217
|
+
readonly updatedAt: Instant | null;
|
|
1218
|
+
readonly scheduledPermanentDeletionAt: Instant | null;
|
|
1219
|
+
readonly lockoutType: AccountLockoutType;
|
|
1220
|
+
readonly temporaryLockoutUntil: Instant | null;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
export declare const toUserDetails: (payload: UserDetailsPayload) => UserDetails;
|
|
1224
|
+
export declare const toUserDetailsPayload: (domain: UserDetails) => UserDetailsPayload;
|
|
1193
1225
|
|
|
1194
1226
|
export interface AuthData {
|
|
1195
1227
|
readonly userDetails: UserDetails;
|
|
@@ -1207,6 +1239,16 @@ readonly secondary: UserAuthProvider[];
|
|
|
1207
1239
|
export declare const toAvailableAuthProviders: (payload: AvailableAuthProvidersPayload) => AvailableAuthProviders;
|
|
1208
1240
|
export declare const toAvailableAuthProvidersPayload: (domain: AvailableAuthProviders) => AvailableAuthProvidersPayload;
|
|
1209
1241
|
|
|
1242
|
+
export interface EmailRestrictionPolicy {
|
|
1243
|
+
readonly isBlacklistEnabled: boolean;
|
|
1244
|
+
readonly blacklist: string[];
|
|
1245
|
+
readonly isWhitelistEnabled: boolean;
|
|
1246
|
+
readonly whitelist: string[];
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
export declare const toEmailRestrictionPolicy: (payload: EmailRestrictionPolicyPayload) => EmailRestrictionPolicy;
|
|
1250
|
+
export declare const toEmailRestrictionPolicyPayload: (domain: EmailRestrictionPolicy) => EmailRestrictionPolicyPayload;
|
|
1251
|
+
|
|
1210
1252
|
export interface ManagementAuthSettings {
|
|
1211
1253
|
readonly availableAuthProviders: AvailableAuthProviders;
|
|
1212
1254
|
readonly maxTotalIdentifiers: number;
|
|
@@ -1257,16 +1299,6 @@ readonly openAuthSettings: OpenAuthSettings;
|
|
|
1257
1299
|
export declare const toOpenUserConfiguration: (payload: OpenUserConfigurationPayload) => OpenUserConfiguration;
|
|
1258
1300
|
export declare const toOpenUserConfigurationPayload: (domain: OpenUserConfiguration) => OpenUserConfigurationPayload;
|
|
1259
1301
|
|
|
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
1302
|
export interface UserIdentifier {
|
|
1271
1303
|
readonly id: UserIdentifierId;
|
|
1272
1304
|
readonly userId: UserId;
|
|
@@ -1311,38 +1343,6 @@ readonly updatedAt: Instant | null;
|
|
|
1311
1343
|
export declare const toUserSession: (payload: UserSessionPayload) => UserSession;
|
|
1312
1344
|
export declare const toUserSessionPayload: (domain: UserSession) => UserSessionPayload;
|
|
1313
1345
|
|
|
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
1346
|
export interface UserPublic {
|
|
1347
1347
|
readonly id: UserId;
|
|
1348
1348
|
readonly role: UserRole;
|
package/index.js
CHANGED
|
@@ -1011,23 +1011,7 @@ export const UserPermissionCode = {
|
|
|
1011
1011
|
|
|
1012
1012
|
};
|
|
1013
1013
|
|
|
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) => ({
|
|
1014
|
+
export const toClientDeviceInfo = (payload) => ({
|
|
1031
1015
|
deviceId: payload.device_id ? toClientDeviceIdOrThrow(payload.device_id) : null,
|
|
1032
1016
|
deviceName: payload.device_name,
|
|
1033
1017
|
clientType: payload.client_type,
|
|
@@ -1045,6 +1029,22 @@ app_version: domain.appVersion,
|
|
|
1045
1029
|
operation_system_version: domain.operationSystemVersion
|
|
1046
1030
|
});
|
|
1047
1031
|
|
|
1032
|
+
export const toClientInfo = (payload) => ({
|
|
1033
|
+
deviceInfo: toClientDeviceInfo(payload.client_device_info),
|
|
1034
|
+
userAgent: payload.user_agent,
|
|
1035
|
+
ipAddress: payload.ip_address,
|
|
1036
|
+
host: null,
|
|
1037
|
+
origin: null,
|
|
1038
|
+
apiVersion: payload.api_version
|
|
1039
|
+
});
|
|
1040
|
+
|
|
1041
|
+
export const toClientInfoPayload = (domain) => ({
|
|
1042
|
+
client_device_info: toClientDeviceInfoPayload(domain.deviceInfo),
|
|
1043
|
+
user_agent: domain.userAgent,
|
|
1044
|
+
ip_address: domain.ipAddress,
|
|
1045
|
+
api_version: domain.apiVersion
|
|
1046
|
+
});
|
|
1047
|
+
|
|
1048
1048
|
export const toAccountLockoutPolicy = (payload) => ({
|
|
1049
1049
|
maxFailedPasswordAttempts: payload.max_failed_password_attempts,
|
|
1050
1050
|
maxFailedOtpAttempts: payload.max_failed_otp_attempts,
|
|
@@ -1233,6 +1233,18 @@ contact_support_email: domain.contactSupportEmail,
|
|
|
1233
1233
|
min_supported_app_versions: domain.minSupportedAppVersions
|
|
1234
1234
|
});
|
|
1235
1235
|
|
|
1236
|
+
export const toAuditEventMetadata = (payload, metadataKeyParser) => ({
|
|
1237
|
+
key: metadataKeyParser.fromValueOrThrow(payload.key),
|
|
1238
|
+
value: payload.value,
|
|
1239
|
+
valueSensitivity: payload.valueSensitivity
|
|
1240
|
+
});
|
|
1241
|
+
|
|
1242
|
+
export const toAuditEventMetadataPayload = (domain) => ({
|
|
1243
|
+
key: domain.key,
|
|
1244
|
+
value: domain.value,
|
|
1245
|
+
valueSensitivity: domain.valueSensitivity
|
|
1246
|
+
});
|
|
1247
|
+
|
|
1236
1248
|
export const toAuditEvent = (payload, actionTypeParser, resourceTypeParser, metadataKeyParser) => ({
|
|
1237
1249
|
id: toAuditEventIdOrThrow(payload.id),
|
|
1238
1250
|
actorId: payload.actorId,
|
|
@@ -1262,17 +1274,57 @@ export const toAuditEventPayload = (domain) => ({
|
|
|
1262
1274
|
createdAt: domain.createdAt
|
|
1263
1275
|
});
|
|
1264
1276
|
|
|
1265
|
-
export const
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1277
|
+
export const toSessionToken = (payload) => ({
|
|
1278
|
+
accessToken: payload.access_token,
|
|
1279
|
+
refreshToken: payload.refresh_token,
|
|
1280
|
+
expiresAt: payload.expires_at,
|
|
1281
|
+
tokenType: payload.token_type,
|
|
1282
|
+
sessionId: toUserSessionIdOrThrow(payload.session_id),
|
|
1283
|
+
identifierId: toUserIdentifierIdOrThrow(payload.identifier_id)
|
|
1284
|
+
});
|
|
1285
|
+
|
|
1286
|
+
export const toSessionTokenPayload = (domain) => ({
|
|
1287
|
+
access_token: domain.accessToken,
|
|
1288
|
+
refresh_token: domain.refreshToken,
|
|
1289
|
+
expires_at: domain.expiresAt,
|
|
1290
|
+
token_type: domain.tokenType,
|
|
1291
|
+
session_id: domain.sessionId,
|
|
1292
|
+
identifier_id: domain.identifierId
|
|
1293
|
+
});
|
|
1270
1294
|
|
|
1271
|
-
export const
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1295
|
+
export const toUserDetails = (payload) => ({
|
|
1296
|
+
id: toUserIdOrThrow(payload.id),
|
|
1297
|
+
role: payload.role,
|
|
1298
|
+
accountStatus: payload.account_status,
|
|
1299
|
+
accountStatusOnRestore: payload.account_status_on_restore,
|
|
1300
|
+
authorityLevel: payload.authority_level,
|
|
1301
|
+
permissionCodes: payload.permission_codes ? payload.permission_codes.map(val => toPermissionCodeOrThrow(val)) : [],
|
|
1302
|
+
isTotpEnabled: payload.is_totp_enabled,
|
|
1303
|
+
lastLoginAt: payload.last_login_at,
|
|
1304
|
+
lastActiveAt: payload.last_active_at,
|
|
1305
|
+
createdAt: payload.created_at,
|
|
1306
|
+
updatedAt: payload.updated_at,
|
|
1307
|
+
scheduledPermanentDeletionAt: payload.scheduled_permanent_deletion_at,
|
|
1308
|
+
lockoutType: payload.account_lockout_type,
|
|
1309
|
+
temporaryLockoutUntil: payload.temporary_lockout_until
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1312
|
+
export const toUserDetailsPayload = (domain) => ({
|
|
1313
|
+
id: domain.id,
|
|
1314
|
+
role: domain.role,
|
|
1315
|
+
account_status: domain.accountStatus,
|
|
1316
|
+
account_status_on_restore: domain.accountStatusOnRestore,
|
|
1317
|
+
authority_level: domain.authorityLevel,
|
|
1318
|
+
permission_codes: domain.permissionCodes,
|
|
1319
|
+
is_totp_enabled: domain.isTotpEnabled,
|
|
1320
|
+
last_login_at: domain.lastLoginAt,
|
|
1321
|
+
last_active_at: domain.lastActiveAt,
|
|
1322
|
+
created_at: domain.createdAt,
|
|
1323
|
+
updated_at: domain.updatedAt,
|
|
1324
|
+
scheduled_permanent_deletion_at: domain.scheduledPermanentDeletionAt,
|
|
1325
|
+
account_lockout_type: domain.lockoutType,
|
|
1326
|
+
temporary_lockout_until: domain.temporaryLockoutUntil
|
|
1327
|
+
});
|
|
1276
1328
|
|
|
1277
1329
|
export const toAuthData = (payload) => ({
|
|
1278
1330
|
userDetails: toUserDetails(payload.user),
|
|
@@ -1294,6 +1346,20 @@ secondary: payload.secondary
|
|
|
1294
1346
|
secondary: domain.secondary
|
|
1295
1347
|
});
|
|
1296
1348
|
|
|
1349
|
+
export const toEmailRestrictionPolicy = (payload) => ({
|
|
1350
|
+
isBlacklistEnabled: payload.is_blacklist_enabled,
|
|
1351
|
+
blacklist: payload.blacklist,
|
|
1352
|
+
isWhitelistEnabled: payload.is_whitelist_enabled,
|
|
1353
|
+
whitelist: payload.whitelist
|
|
1354
|
+
});
|
|
1355
|
+
|
|
1356
|
+
export const toEmailRestrictionPolicyPayload = (domain) => ({
|
|
1357
|
+
is_blacklist_enabled: domain.isBlacklistEnabled,
|
|
1358
|
+
blacklist: domain.blacklist,
|
|
1359
|
+
is_whitelist_enabled: domain.isWhitelistEnabled,
|
|
1360
|
+
whitelist: domain.whitelist
|
|
1361
|
+
});
|
|
1362
|
+
|
|
1297
1363
|
export const toManagementAuthSettings = (payload) => ({
|
|
1298
1364
|
availableAuthProviders: toAvailableAuthProviders(payload.available_auth_providers),
|
|
1299
1365
|
maxTotalIdentifiers: payload.max_total_identifiers,
|
|
@@ -1370,20 +1436,6 @@ open_security_settings: toOpenSecuritySettingsPayload(domain.openSecuritySetting
|
|
|
1370
1436
|
open_auth_settings: toOpenAuthSettingsPayload(domain.openAuthSettings)
|
|
1371
1437
|
});
|
|
1372
1438
|
|
|
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
1439
|
export const toUserIdentifier = (payload) => ({
|
|
1388
1440
|
id: toUserIdentifierIdOrThrow(payload.id),
|
|
1389
1441
|
userId: toUserIdOrThrow(payload.user_id),
|
|
@@ -1454,58 +1506,6 @@ created_at: domain.createdAt,
|
|
|
1454
1506
|
updated_at: domain.updatedAt
|
|
1455
1507
|
});
|
|
1456
1508
|
|
|
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
1509
|
export const toUserPublic = (payload) => ({
|
|
1510
1510
|
id: toUserIdOrThrow(payload.id),
|
|
1511
1511
|
role: payload.role,
|
package/index.mjs
CHANGED
|
@@ -1011,23 +1011,7 @@ export const UserPermissionCode = {
|
|
|
1011
1011
|
|
|
1012
1012
|
};
|
|
1013
1013
|
|
|
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) => ({
|
|
1014
|
+
export const toClientDeviceInfo = (payload) => ({
|
|
1031
1015
|
deviceId: payload.device_id ? toClientDeviceIdOrThrow(payload.device_id) : null,
|
|
1032
1016
|
deviceName: payload.device_name,
|
|
1033
1017
|
clientType: payload.client_type,
|
|
@@ -1045,6 +1029,22 @@ app_version: domain.appVersion,
|
|
|
1045
1029
|
operation_system_version: domain.operationSystemVersion
|
|
1046
1030
|
});
|
|
1047
1031
|
|
|
1032
|
+
export const toClientInfo = (payload) => ({
|
|
1033
|
+
deviceInfo: toClientDeviceInfo(payload.client_device_info),
|
|
1034
|
+
userAgent: payload.user_agent,
|
|
1035
|
+
ipAddress: payload.ip_address,
|
|
1036
|
+
host: null,
|
|
1037
|
+
origin: null,
|
|
1038
|
+
apiVersion: payload.api_version
|
|
1039
|
+
});
|
|
1040
|
+
|
|
1041
|
+
export const toClientInfoPayload = (domain) => ({
|
|
1042
|
+
client_device_info: toClientDeviceInfoPayload(domain.deviceInfo),
|
|
1043
|
+
user_agent: domain.userAgent,
|
|
1044
|
+
ip_address: domain.ipAddress,
|
|
1045
|
+
api_version: domain.apiVersion
|
|
1046
|
+
});
|
|
1047
|
+
|
|
1048
1048
|
export const toAccountLockoutPolicy = (payload) => ({
|
|
1049
1049
|
maxFailedPasswordAttempts: payload.max_failed_password_attempts,
|
|
1050
1050
|
maxFailedOtpAttempts: payload.max_failed_otp_attempts,
|
|
@@ -1233,6 +1233,18 @@ contact_support_email: domain.contactSupportEmail,
|
|
|
1233
1233
|
min_supported_app_versions: domain.minSupportedAppVersions
|
|
1234
1234
|
});
|
|
1235
1235
|
|
|
1236
|
+
export const toAuditEventMetadata = (payload, metadataKeyParser) => ({
|
|
1237
|
+
key: metadataKeyParser.fromValueOrThrow(payload.key),
|
|
1238
|
+
value: payload.value,
|
|
1239
|
+
valueSensitivity: payload.valueSensitivity
|
|
1240
|
+
});
|
|
1241
|
+
|
|
1242
|
+
export const toAuditEventMetadataPayload = (domain) => ({
|
|
1243
|
+
key: domain.key,
|
|
1244
|
+
value: domain.value,
|
|
1245
|
+
valueSensitivity: domain.valueSensitivity
|
|
1246
|
+
});
|
|
1247
|
+
|
|
1236
1248
|
export const toAuditEvent = (payload, actionTypeParser, resourceTypeParser, metadataKeyParser) => ({
|
|
1237
1249
|
id: toAuditEventIdOrThrow(payload.id),
|
|
1238
1250
|
actorId: payload.actorId,
|
|
@@ -1262,17 +1274,57 @@ export const toAuditEventPayload = (domain) => ({
|
|
|
1262
1274
|
createdAt: domain.createdAt
|
|
1263
1275
|
});
|
|
1264
1276
|
|
|
1265
|
-
export const
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1277
|
+
export const toSessionToken = (payload) => ({
|
|
1278
|
+
accessToken: payload.access_token,
|
|
1279
|
+
refreshToken: payload.refresh_token,
|
|
1280
|
+
expiresAt: payload.expires_at,
|
|
1281
|
+
tokenType: payload.token_type,
|
|
1282
|
+
sessionId: toUserSessionIdOrThrow(payload.session_id),
|
|
1283
|
+
identifierId: toUserIdentifierIdOrThrow(payload.identifier_id)
|
|
1284
|
+
});
|
|
1285
|
+
|
|
1286
|
+
export const toSessionTokenPayload = (domain) => ({
|
|
1287
|
+
access_token: domain.accessToken,
|
|
1288
|
+
refresh_token: domain.refreshToken,
|
|
1289
|
+
expires_at: domain.expiresAt,
|
|
1290
|
+
token_type: domain.tokenType,
|
|
1291
|
+
session_id: domain.sessionId,
|
|
1292
|
+
identifier_id: domain.identifierId
|
|
1293
|
+
});
|
|
1270
1294
|
|
|
1271
|
-
export const
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1295
|
+
export const toUserDetails = (payload) => ({
|
|
1296
|
+
id: toUserIdOrThrow(payload.id),
|
|
1297
|
+
role: payload.role,
|
|
1298
|
+
accountStatus: payload.account_status,
|
|
1299
|
+
accountStatusOnRestore: payload.account_status_on_restore,
|
|
1300
|
+
authorityLevel: payload.authority_level,
|
|
1301
|
+
permissionCodes: payload.permission_codes ? payload.permission_codes.map(val => toPermissionCodeOrThrow(val)) : [],
|
|
1302
|
+
isTotpEnabled: payload.is_totp_enabled,
|
|
1303
|
+
lastLoginAt: payload.last_login_at,
|
|
1304
|
+
lastActiveAt: payload.last_active_at,
|
|
1305
|
+
createdAt: payload.created_at,
|
|
1306
|
+
updatedAt: payload.updated_at,
|
|
1307
|
+
scheduledPermanentDeletionAt: payload.scheduled_permanent_deletion_at,
|
|
1308
|
+
lockoutType: payload.account_lockout_type,
|
|
1309
|
+
temporaryLockoutUntil: payload.temporary_lockout_until
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1312
|
+
export const toUserDetailsPayload = (domain) => ({
|
|
1313
|
+
id: domain.id,
|
|
1314
|
+
role: domain.role,
|
|
1315
|
+
account_status: domain.accountStatus,
|
|
1316
|
+
account_status_on_restore: domain.accountStatusOnRestore,
|
|
1317
|
+
authority_level: domain.authorityLevel,
|
|
1318
|
+
permission_codes: domain.permissionCodes,
|
|
1319
|
+
is_totp_enabled: domain.isTotpEnabled,
|
|
1320
|
+
last_login_at: domain.lastLoginAt,
|
|
1321
|
+
last_active_at: domain.lastActiveAt,
|
|
1322
|
+
created_at: domain.createdAt,
|
|
1323
|
+
updated_at: domain.updatedAt,
|
|
1324
|
+
scheduled_permanent_deletion_at: domain.scheduledPermanentDeletionAt,
|
|
1325
|
+
account_lockout_type: domain.lockoutType,
|
|
1326
|
+
temporary_lockout_until: domain.temporaryLockoutUntil
|
|
1327
|
+
});
|
|
1276
1328
|
|
|
1277
1329
|
export const toAuthData = (payload) => ({
|
|
1278
1330
|
userDetails: toUserDetails(payload.user),
|
|
@@ -1294,6 +1346,20 @@ secondary: payload.secondary
|
|
|
1294
1346
|
secondary: domain.secondary
|
|
1295
1347
|
});
|
|
1296
1348
|
|
|
1349
|
+
export const toEmailRestrictionPolicy = (payload) => ({
|
|
1350
|
+
isBlacklistEnabled: payload.is_blacklist_enabled,
|
|
1351
|
+
blacklist: payload.blacklist,
|
|
1352
|
+
isWhitelistEnabled: payload.is_whitelist_enabled,
|
|
1353
|
+
whitelist: payload.whitelist
|
|
1354
|
+
});
|
|
1355
|
+
|
|
1356
|
+
export const toEmailRestrictionPolicyPayload = (domain) => ({
|
|
1357
|
+
is_blacklist_enabled: domain.isBlacklistEnabled,
|
|
1358
|
+
blacklist: domain.blacklist,
|
|
1359
|
+
is_whitelist_enabled: domain.isWhitelistEnabled,
|
|
1360
|
+
whitelist: domain.whitelist
|
|
1361
|
+
});
|
|
1362
|
+
|
|
1297
1363
|
export const toManagementAuthSettings = (payload) => ({
|
|
1298
1364
|
availableAuthProviders: toAvailableAuthProviders(payload.available_auth_providers),
|
|
1299
1365
|
maxTotalIdentifiers: payload.max_total_identifiers,
|
|
@@ -1370,20 +1436,6 @@ open_security_settings: toOpenSecuritySettingsPayload(domain.openSecuritySetting
|
|
|
1370
1436
|
open_auth_settings: toOpenAuthSettingsPayload(domain.openAuthSettings)
|
|
1371
1437
|
});
|
|
1372
1438
|
|
|
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
1439
|
export const toUserIdentifier = (payload) => ({
|
|
1388
1440
|
id: toUserIdentifierIdOrThrow(payload.id),
|
|
1389
1441
|
userId: toUserIdOrThrow(payload.user_id),
|
|
@@ -1454,58 +1506,6 @@ created_at: domain.createdAt,
|
|
|
1454
1506
|
updated_at: domain.updatedAt
|
|
1455
1507
|
});
|
|
1456
1508
|
|
|
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
1509
|
export const toUserPublic = (payload) => ({
|
|
1510
1510
|
id: toUserIdOrThrow(payload.id),
|
|
1511
1511
|
role: payload.role,
|