@mudrichenkoevgeny/shared-foundation 0.0.50 → 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 +67 -67
- package/index.js +144 -130
- package/index.mjs +144 -130
- 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,8 +1165,16 @@ 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
|
-
|
|
1169
|
-
|
|
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
|
+
|
|
1176
|
+
export interface AuditEvent {
|
|
1177
|
+
readonly id: AuditEventId;
|
|
1170
1178
|
readonly actorId: UserId | null;
|
|
1171
1179
|
readonly actorType: AuditActorType;
|
|
1172
1180
|
readonly actorUserRole: UserRole | null;
|
|
@@ -1178,18 +1186,42 @@ readonly status: AuditStatus;
|
|
|
1178
1186
|
readonly metadata: AuditEventMetadata[];
|
|
1179
1187
|
readonly message: string | null;
|
|
1180
1188
|
readonly createdAt: Instant;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
export declare const toAuditEvent: (payload: AuditEventPayload, actionTypeParser: CompositeAuditActionTypeParser, resourceTypeParser: CompositeAuditResourceTypeParser, metadataKeyParser: CompositeAuditMetadataKeyParser) => AuditEvent;
|
|
1192
|
+
export declare const toAuditEventPayload: (domain: AuditEvent) => AuditEventPayload;
|
|
1193
|
+
|
|
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;
|
|
1181
1201
|
}
|
|
1182
1202
|
|
|
1183
|
-
export declare const
|
|
1184
|
-
export declare const
|
|
1203
|
+
export declare const toSessionToken: (payload: SessionTokenPayload) => SessionToken;
|
|
1204
|
+
export declare const toSessionTokenPayload: (domain: SessionToken) => SessionTokenPayload;
|
|
1185
1205
|
|
|
1186
|
-
export interface
|
|
1187
|
-
readonly
|
|
1188
|
-
readonly
|
|
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;
|
|
1189
1221
|
}
|
|
1190
1222
|
|
|
1191
|
-
export declare const
|
|
1192
|
-
export declare const
|
|
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;
|
|
@@ -1369,17 +1369,17 @@ export interface AuditResourceTypeParser {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
|
|
1371
1371
|
export declare class CompositeAuditActionTypeParser {
|
|
1372
|
-
constructor(auditActionTypes: Array<((value: string) => AuditActionType | null) | AuditActionTypeParser
|
|
1372
|
+
constructor(auditActionTypes: Array<((value: string) => AuditActionType | null) | AuditActionTypeParser | Record<string, string>>);
|
|
1373
1373
|
fromValueOrThrow(value: string): AuditActionType;
|
|
1374
1374
|
}
|
|
1375
1375
|
|
|
1376
1376
|
export declare class CompositeAuditMetadataKeyParser {
|
|
1377
|
-
constructor(metadataKeys: Array<((value: string) => AuditMetadataKey | null) | AuditMetadataKeyParser
|
|
1377
|
+
constructor(metadataKeys: Array<((value: string) => AuditMetadataKey | null) | AuditMetadataKeyParser | Record<string, string>>);
|
|
1378
1378
|
fromValueOrThrow(value: string): AuditMetadataKey;
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
1381
1381
|
export declare class CompositeAuditResourceTypeParser {
|
|
1382
|
-
constructor(auditResourceTypes: Array<((value: string) => AuditResourceType | null) | AuditResourceTypeParser
|
|
1382
|
+
constructor(auditResourceTypes: Array<((value: string) => AuditResourceType | null) | AuditResourceTypeParser | Record<string, string>>);
|
|
1383
1383
|
fromValueOrThrow(value: string): AuditResourceType;
|
|
1384
1384
|
}
|
|
1385
1385
|
|
package/index.js
CHANGED
|
@@ -295,11 +295,16 @@ export const refreshTokenHashSchema = z.string().transform((val, ctx) => {
|
|
|
295
295
|
|
|
296
296
|
fromValueOrThrow(value) {
|
|
297
297
|
for (const parse of this.auditActionTypes) {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
if (
|
|
302
|
-
|
|
298
|
+
if (typeof parse === 'function') {
|
|
299
|
+
const result = parse(value);
|
|
300
|
+
if (result !== null && result !== undefined) return result;
|
|
301
|
+
} else if (parse && typeof parse.parseOrNull === 'function') {
|
|
302
|
+
const result = parse.parseOrNull(value);
|
|
303
|
+
if (result !== null && result !== undefined) return result;
|
|
304
|
+
} else if (parse && typeof parse === 'object') {
|
|
305
|
+
// Support passing the enum object directly (e.g. UserAuditActionType)
|
|
306
|
+
const matchedValue = Object.values(parse).find(val => val === value);
|
|
307
|
+
if (matchedValue !== undefined) return matchedValue;
|
|
303
308
|
}
|
|
304
309
|
}
|
|
305
310
|
throw new Error("Unknown value of AuditActionType: '" + value + "'");
|
|
@@ -313,11 +318,15 @@ export class CompositeAuditMetadataKeyParser {
|
|
|
313
318
|
|
|
314
319
|
fromValueOrThrow(value) {
|
|
315
320
|
for (const parse of this.metadataKeys) {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (
|
|
320
|
-
|
|
321
|
+
if (typeof parse === 'function') {
|
|
322
|
+
const result = parse(value);
|
|
323
|
+
if (result !== null && result !== undefined) return result;
|
|
324
|
+
} else if (parse && typeof parse.parseOrNull === 'function') {
|
|
325
|
+
const result = parse.parseOrNull(value);
|
|
326
|
+
if (result !== null && result !== undefined) return result;
|
|
327
|
+
} else if (parse && typeof parse === 'object') {
|
|
328
|
+
const matchedValue = Object.values(parse).find(val => val === value);
|
|
329
|
+
if (matchedValue !== undefined) return matchedValue;
|
|
321
330
|
}
|
|
322
331
|
}
|
|
323
332
|
throw new Error("Unknown value of AuditMetadataKey: '" + value + "'");
|
|
@@ -331,11 +340,15 @@ export class CompositeAuditResourceTypeParser {
|
|
|
331
340
|
|
|
332
341
|
fromValueOrThrow(value) {
|
|
333
342
|
for (const parse of this.auditResourceTypes) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if (
|
|
338
|
-
|
|
343
|
+
if (typeof parse === 'function') {
|
|
344
|
+
const result = parse(value);
|
|
345
|
+
if (result !== null && result !== undefined) return result;
|
|
346
|
+
} else if (parse && typeof parse.parseOrNull === 'function') {
|
|
347
|
+
const result = parse.parseOrNull(value);
|
|
348
|
+
if (result !== null && result !== undefined) return result;
|
|
349
|
+
} else if (parse && typeof parse === 'object') {
|
|
350
|
+
const matchedValue = Object.values(parse).find(val => val === value);
|
|
351
|
+
if (matchedValue !== undefined) return matchedValue;
|
|
339
352
|
}
|
|
340
353
|
}
|
|
341
354
|
throw new Error("Unknown value of AuditResourceType: '" + value + "'");
|
|
@@ -998,23 +1011,7 @@ export const UserPermissionCode = {
|
|
|
998
1011
|
|
|
999
1012
|
};
|
|
1000
1013
|
|
|
1001
|
-
export const
|
|
1002
|
-
deviceInfo: toClientDeviceInfo(payload.client_device_info),
|
|
1003
|
-
userAgent: payload.user_agent,
|
|
1004
|
-
ipAddress: payload.ip_address,
|
|
1005
|
-
host: null,
|
|
1006
|
-
origin: null,
|
|
1007
|
-
apiVersion: payload.api_version
|
|
1008
|
-
});
|
|
1009
|
-
|
|
1010
|
-
export const toClientInfoPayload = (domain) => ({
|
|
1011
|
-
client_device_info: toClientDeviceInfoPayload(domain.deviceInfo),
|
|
1012
|
-
user_agent: domain.userAgent,
|
|
1013
|
-
ip_address: domain.ipAddress,
|
|
1014
|
-
api_version: domain.apiVersion
|
|
1015
|
-
});
|
|
1016
|
-
|
|
1017
|
-
export const toClientDeviceInfo = (payload) => ({
|
|
1014
|
+
export const toClientDeviceInfo = (payload) => ({
|
|
1018
1015
|
deviceId: payload.device_id ? toClientDeviceIdOrThrow(payload.device_id) : null,
|
|
1019
1016
|
deviceName: payload.device_name,
|
|
1020
1017
|
clientType: payload.client_type,
|
|
@@ -1032,6 +1029,22 @@ app_version: domain.appVersion,
|
|
|
1032
1029
|
operation_system_version: domain.operationSystemVersion
|
|
1033
1030
|
});
|
|
1034
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
|
+
|
|
1035
1048
|
export const toAccountLockoutPolicy = (payload) => ({
|
|
1036
1049
|
maxFailedPasswordAttempts: payload.max_failed_password_attempts,
|
|
1037
1050
|
maxFailedOtpAttempts: payload.max_failed_otp_attempts,
|
|
@@ -1220,44 +1233,97 @@ contact_support_email: domain.contactSupportEmail,
|
|
|
1220
1233
|
min_supported_app_versions: domain.minSupportedAppVersions
|
|
1221
1234
|
});
|
|
1222
1235
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
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
|
+
|
|
1248
|
+
export const toAuditEvent = (payload, actionTypeParser, resourceTypeParser, metadataKeyParser) => ({
|
|
1249
|
+
id: toAuditEventIdOrThrow(payload.id),
|
|
1250
|
+
actorId: payload.actorId,
|
|
1251
|
+
actorType: payload.actorType,
|
|
1252
|
+
actorUserRole: payload.actorUserRole,
|
|
1253
|
+
action: actionTypeParser.fromValueOrThrow(payload.action),
|
|
1254
|
+
resource: resourceTypeParser.fromValueOrThrow(payload.resource),
|
|
1255
|
+
resourceId: payload.resourceId,
|
|
1256
|
+
resourceValueSensitivity: 'non_sensitive',
|
|
1257
|
+
status: payload.status,
|
|
1258
|
+
metadata: payload.metadata ? payload.metadata.map(val => toAuditEventMetadata(val, metadataKeyParser)) : [],
|
|
1259
|
+
message: payload.message,
|
|
1260
|
+
createdAt: payload.createdAt
|
|
1261
|
+
});
|
|
1262
|
+
|
|
1263
|
+
export const toAuditEventPayload = (domain) => ({
|
|
1264
|
+
id: domain.id,
|
|
1265
|
+
actorId: domain.actorId,
|
|
1266
|
+
actorType: domain.actorType,
|
|
1267
|
+
actorUserRole: domain.actorUserRole,
|
|
1268
|
+
action: domain.action,
|
|
1269
|
+
resource: domain.resource,
|
|
1270
|
+
resourceId: domain.resourceId,
|
|
1271
|
+
status: domain.status,
|
|
1272
|
+
metadata: domain.metadata ? domain.metadata.map(val => toAuditEventMetadataPayload(val)) : [],
|
|
1273
|
+
message: domain.message,
|
|
1274
|
+
createdAt: domain.createdAt
|
|
1275
|
+
});
|
|
1276
|
+
|
|
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)
|
|
1236
1284
|
});
|
|
1237
1285
|
|
|
1238
|
-
export const
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
resource_id: domain.resourceId,
|
|
1246
|
-
status: domain.status,
|
|
1247
|
-
metadata: domain.metadata ? domain.metadata.map(val => toAuditEventMetadataPayload(val)) : [],
|
|
1248
|
-
message: domain.message,
|
|
1249
|
-
created_at: domain.createdAt
|
|
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
|
|
1250
1293
|
});
|
|
1251
1294
|
|
|
1252
|
-
export const
|
|
1253
|
-
|
|
1254
|
-
|
|
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
|
|
1255
1310
|
});
|
|
1256
1311
|
|
|
1257
|
-
export const
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
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
|
|
1261
1327
|
});
|
|
1262
1328
|
|
|
1263
1329
|
export const toAuthData = (payload) => ({
|
|
@@ -1280,6 +1346,20 @@ secondary: payload.secondary
|
|
|
1280
1346
|
secondary: domain.secondary
|
|
1281
1347
|
});
|
|
1282
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
|
+
|
|
1283
1363
|
export const toManagementAuthSettings = (payload) => ({
|
|
1284
1364
|
availableAuthProviders: toAvailableAuthProviders(payload.available_auth_providers),
|
|
1285
1365
|
maxTotalIdentifiers: payload.max_total_identifiers,
|
|
@@ -1356,20 +1436,6 @@ open_security_settings: toOpenSecuritySettingsPayload(domain.openSecuritySetting
|
|
|
1356
1436
|
open_auth_settings: toOpenAuthSettingsPayload(domain.openAuthSettings)
|
|
1357
1437
|
});
|
|
1358
1438
|
|
|
1359
|
-
export const toEmailRestrictionPolicy = (payload) => ({
|
|
1360
|
-
isBlacklistEnabled: payload.is_blacklist_enabled,
|
|
1361
|
-
blacklist: payload.blacklist,
|
|
1362
|
-
isWhitelistEnabled: payload.is_whitelist_enabled,
|
|
1363
|
-
whitelist: payload.whitelist
|
|
1364
|
-
});
|
|
1365
|
-
|
|
1366
|
-
export const toEmailRestrictionPolicyPayload = (domain) => ({
|
|
1367
|
-
is_blacklist_enabled: domain.isBlacklistEnabled,
|
|
1368
|
-
blacklist: domain.blacklist,
|
|
1369
|
-
is_whitelist_enabled: domain.isWhitelistEnabled,
|
|
1370
|
-
whitelist: domain.whitelist
|
|
1371
|
-
});
|
|
1372
|
-
|
|
1373
1439
|
export const toUserIdentifier = (payload) => ({
|
|
1374
1440
|
id: toUserIdentifierIdOrThrow(payload.id),
|
|
1375
1441
|
userId: toUserIdOrThrow(payload.user_id),
|
|
@@ -1440,58 +1506,6 @@ created_at: domain.createdAt,
|
|
|
1440
1506
|
updated_at: domain.updatedAt
|
|
1441
1507
|
});
|
|
1442
1508
|
|
|
1443
|
-
export const toSessionToken = (payload) => ({
|
|
1444
|
-
accessToken: payload.access_token,
|
|
1445
|
-
refreshToken: payload.refresh_token,
|
|
1446
|
-
expiresAt: payload.expires_at,
|
|
1447
|
-
tokenType: payload.token_type,
|
|
1448
|
-
sessionId: toUserSessionIdOrThrow(payload.session_id),
|
|
1449
|
-
identifierId: toUserIdentifierIdOrThrow(payload.identifier_id)
|
|
1450
|
-
});
|
|
1451
|
-
|
|
1452
|
-
export const toSessionTokenPayload = (domain) => ({
|
|
1453
|
-
access_token: domain.accessToken,
|
|
1454
|
-
refresh_token: domain.refreshToken,
|
|
1455
|
-
expires_at: domain.expiresAt,
|
|
1456
|
-
token_type: domain.tokenType,
|
|
1457
|
-
session_id: domain.sessionId,
|
|
1458
|
-
identifier_id: domain.identifierId
|
|
1459
|
-
});
|
|
1460
|
-
|
|
1461
|
-
export const toUserDetails = (payload) => ({
|
|
1462
|
-
id: toUserIdOrThrow(payload.id),
|
|
1463
|
-
role: payload.role,
|
|
1464
|
-
accountStatus: payload.account_status,
|
|
1465
|
-
accountStatusOnRestore: payload.account_status_on_restore,
|
|
1466
|
-
authorityLevel: payload.authority_level,
|
|
1467
|
-
permissionCodes: payload.permission_codes ? payload.permission_codes.map(val => toPermissionCodeOrThrow(val)) : [],
|
|
1468
|
-
isTotpEnabled: payload.is_totp_enabled,
|
|
1469
|
-
lastLoginAt: payload.last_login_at,
|
|
1470
|
-
lastActiveAt: payload.last_active_at,
|
|
1471
|
-
createdAt: payload.created_at,
|
|
1472
|
-
updatedAt: payload.updated_at,
|
|
1473
|
-
scheduledPermanentDeletionAt: payload.scheduled_permanent_deletion_at,
|
|
1474
|
-
lockoutType: payload.account_lockout_type,
|
|
1475
|
-
temporaryLockoutUntil: payload.temporary_lockout_until
|
|
1476
|
-
});
|
|
1477
|
-
|
|
1478
|
-
export const toUserDetailsPayload = (domain) => ({
|
|
1479
|
-
id: domain.id,
|
|
1480
|
-
role: domain.role,
|
|
1481
|
-
account_status: domain.accountStatus,
|
|
1482
|
-
account_status_on_restore: domain.accountStatusOnRestore,
|
|
1483
|
-
authority_level: domain.authorityLevel,
|
|
1484
|
-
permission_codes: domain.permissionCodes,
|
|
1485
|
-
is_totp_enabled: domain.isTotpEnabled,
|
|
1486
|
-
last_login_at: domain.lastLoginAt,
|
|
1487
|
-
last_active_at: domain.lastActiveAt,
|
|
1488
|
-
created_at: domain.createdAt,
|
|
1489
|
-
updated_at: domain.updatedAt,
|
|
1490
|
-
scheduled_permanent_deletion_at: domain.scheduledPermanentDeletionAt,
|
|
1491
|
-
account_lockout_type: domain.lockoutType,
|
|
1492
|
-
temporary_lockout_until: domain.temporaryLockoutUntil
|
|
1493
|
-
});
|
|
1494
|
-
|
|
1495
1509
|
export const toUserPublic = (payload) => ({
|
|
1496
1510
|
id: toUserIdOrThrow(payload.id),
|
|
1497
1511
|
role: payload.role,
|
package/index.mjs
CHANGED
|
@@ -295,11 +295,16 @@ export const refreshTokenHashSchema = z.string().transform((val, ctx) => {
|
|
|
295
295
|
|
|
296
296
|
fromValueOrThrow(value) {
|
|
297
297
|
for (const parse of this.auditActionTypes) {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
if (
|
|
302
|
-
|
|
298
|
+
if (typeof parse === 'function') {
|
|
299
|
+
const result = parse(value);
|
|
300
|
+
if (result !== null && result !== undefined) return result;
|
|
301
|
+
} else if (parse && typeof parse.parseOrNull === 'function') {
|
|
302
|
+
const result = parse.parseOrNull(value);
|
|
303
|
+
if (result !== null && result !== undefined) return result;
|
|
304
|
+
} else if (parse && typeof parse === 'object') {
|
|
305
|
+
// Support passing the enum object directly (e.g. UserAuditActionType)
|
|
306
|
+
const matchedValue = Object.values(parse).find(val => val === value);
|
|
307
|
+
if (matchedValue !== undefined) return matchedValue;
|
|
303
308
|
}
|
|
304
309
|
}
|
|
305
310
|
throw new Error("Unknown value of AuditActionType: '" + value + "'");
|
|
@@ -313,11 +318,15 @@ export class CompositeAuditMetadataKeyParser {
|
|
|
313
318
|
|
|
314
319
|
fromValueOrThrow(value) {
|
|
315
320
|
for (const parse of this.metadataKeys) {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (
|
|
320
|
-
|
|
321
|
+
if (typeof parse === 'function') {
|
|
322
|
+
const result = parse(value);
|
|
323
|
+
if (result !== null && result !== undefined) return result;
|
|
324
|
+
} else if (parse && typeof parse.parseOrNull === 'function') {
|
|
325
|
+
const result = parse.parseOrNull(value);
|
|
326
|
+
if (result !== null && result !== undefined) return result;
|
|
327
|
+
} else if (parse && typeof parse === 'object') {
|
|
328
|
+
const matchedValue = Object.values(parse).find(val => val === value);
|
|
329
|
+
if (matchedValue !== undefined) return matchedValue;
|
|
321
330
|
}
|
|
322
331
|
}
|
|
323
332
|
throw new Error("Unknown value of AuditMetadataKey: '" + value + "'");
|
|
@@ -331,11 +340,15 @@ export class CompositeAuditResourceTypeParser {
|
|
|
331
340
|
|
|
332
341
|
fromValueOrThrow(value) {
|
|
333
342
|
for (const parse of this.auditResourceTypes) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if (
|
|
338
|
-
|
|
343
|
+
if (typeof parse === 'function') {
|
|
344
|
+
const result = parse(value);
|
|
345
|
+
if (result !== null && result !== undefined) return result;
|
|
346
|
+
} else if (parse && typeof parse.parseOrNull === 'function') {
|
|
347
|
+
const result = parse.parseOrNull(value);
|
|
348
|
+
if (result !== null && result !== undefined) return result;
|
|
349
|
+
} else if (parse && typeof parse === 'object') {
|
|
350
|
+
const matchedValue = Object.values(parse).find(val => val === value);
|
|
351
|
+
if (matchedValue !== undefined) return matchedValue;
|
|
339
352
|
}
|
|
340
353
|
}
|
|
341
354
|
throw new Error("Unknown value of AuditResourceType: '" + value + "'");
|
|
@@ -998,23 +1011,7 @@ export const UserPermissionCode = {
|
|
|
998
1011
|
|
|
999
1012
|
};
|
|
1000
1013
|
|
|
1001
|
-
export const
|
|
1002
|
-
deviceInfo: toClientDeviceInfo(payload.client_device_info),
|
|
1003
|
-
userAgent: payload.user_agent,
|
|
1004
|
-
ipAddress: payload.ip_address,
|
|
1005
|
-
host: null,
|
|
1006
|
-
origin: null,
|
|
1007
|
-
apiVersion: payload.api_version
|
|
1008
|
-
});
|
|
1009
|
-
|
|
1010
|
-
export const toClientInfoPayload = (domain) => ({
|
|
1011
|
-
client_device_info: toClientDeviceInfoPayload(domain.deviceInfo),
|
|
1012
|
-
user_agent: domain.userAgent,
|
|
1013
|
-
ip_address: domain.ipAddress,
|
|
1014
|
-
api_version: domain.apiVersion
|
|
1015
|
-
});
|
|
1016
|
-
|
|
1017
|
-
export const toClientDeviceInfo = (payload) => ({
|
|
1014
|
+
export const toClientDeviceInfo = (payload) => ({
|
|
1018
1015
|
deviceId: payload.device_id ? toClientDeviceIdOrThrow(payload.device_id) : null,
|
|
1019
1016
|
deviceName: payload.device_name,
|
|
1020
1017
|
clientType: payload.client_type,
|
|
@@ -1032,6 +1029,22 @@ app_version: domain.appVersion,
|
|
|
1032
1029
|
operation_system_version: domain.operationSystemVersion
|
|
1033
1030
|
});
|
|
1034
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
|
+
|
|
1035
1048
|
export const toAccountLockoutPolicy = (payload) => ({
|
|
1036
1049
|
maxFailedPasswordAttempts: payload.max_failed_password_attempts,
|
|
1037
1050
|
maxFailedOtpAttempts: payload.max_failed_otp_attempts,
|
|
@@ -1220,44 +1233,97 @@ contact_support_email: domain.contactSupportEmail,
|
|
|
1220
1233
|
min_supported_app_versions: domain.minSupportedAppVersions
|
|
1221
1234
|
});
|
|
1222
1235
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
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
|
+
|
|
1248
|
+
export const toAuditEvent = (payload, actionTypeParser, resourceTypeParser, metadataKeyParser) => ({
|
|
1249
|
+
id: toAuditEventIdOrThrow(payload.id),
|
|
1250
|
+
actorId: payload.actorId,
|
|
1251
|
+
actorType: payload.actorType,
|
|
1252
|
+
actorUserRole: payload.actorUserRole,
|
|
1253
|
+
action: actionTypeParser.fromValueOrThrow(payload.action),
|
|
1254
|
+
resource: resourceTypeParser.fromValueOrThrow(payload.resource),
|
|
1255
|
+
resourceId: payload.resourceId,
|
|
1256
|
+
resourceValueSensitivity: 'non_sensitive',
|
|
1257
|
+
status: payload.status,
|
|
1258
|
+
metadata: payload.metadata ? payload.metadata.map(val => toAuditEventMetadata(val, metadataKeyParser)) : [],
|
|
1259
|
+
message: payload.message,
|
|
1260
|
+
createdAt: payload.createdAt
|
|
1261
|
+
});
|
|
1262
|
+
|
|
1263
|
+
export const toAuditEventPayload = (domain) => ({
|
|
1264
|
+
id: domain.id,
|
|
1265
|
+
actorId: domain.actorId,
|
|
1266
|
+
actorType: domain.actorType,
|
|
1267
|
+
actorUserRole: domain.actorUserRole,
|
|
1268
|
+
action: domain.action,
|
|
1269
|
+
resource: domain.resource,
|
|
1270
|
+
resourceId: domain.resourceId,
|
|
1271
|
+
status: domain.status,
|
|
1272
|
+
metadata: domain.metadata ? domain.metadata.map(val => toAuditEventMetadataPayload(val)) : [],
|
|
1273
|
+
message: domain.message,
|
|
1274
|
+
createdAt: domain.createdAt
|
|
1275
|
+
});
|
|
1276
|
+
|
|
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)
|
|
1236
1284
|
});
|
|
1237
1285
|
|
|
1238
|
-
export const
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
resource_id: domain.resourceId,
|
|
1246
|
-
status: domain.status,
|
|
1247
|
-
metadata: domain.metadata ? domain.metadata.map(val => toAuditEventMetadataPayload(val)) : [],
|
|
1248
|
-
message: domain.message,
|
|
1249
|
-
created_at: domain.createdAt
|
|
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
|
|
1250
1293
|
});
|
|
1251
1294
|
|
|
1252
|
-
export const
|
|
1253
|
-
|
|
1254
|
-
|
|
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
|
|
1255
1310
|
});
|
|
1256
1311
|
|
|
1257
|
-
export const
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
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
|
|
1261
1327
|
});
|
|
1262
1328
|
|
|
1263
1329
|
export const toAuthData = (payload) => ({
|
|
@@ -1280,6 +1346,20 @@ secondary: payload.secondary
|
|
|
1280
1346
|
secondary: domain.secondary
|
|
1281
1347
|
});
|
|
1282
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
|
+
|
|
1283
1363
|
export const toManagementAuthSettings = (payload) => ({
|
|
1284
1364
|
availableAuthProviders: toAvailableAuthProviders(payload.available_auth_providers),
|
|
1285
1365
|
maxTotalIdentifiers: payload.max_total_identifiers,
|
|
@@ -1356,20 +1436,6 @@ open_security_settings: toOpenSecuritySettingsPayload(domain.openSecuritySetting
|
|
|
1356
1436
|
open_auth_settings: toOpenAuthSettingsPayload(domain.openAuthSettings)
|
|
1357
1437
|
});
|
|
1358
1438
|
|
|
1359
|
-
export const toEmailRestrictionPolicy = (payload) => ({
|
|
1360
|
-
isBlacklistEnabled: payload.is_blacklist_enabled,
|
|
1361
|
-
blacklist: payload.blacklist,
|
|
1362
|
-
isWhitelistEnabled: payload.is_whitelist_enabled,
|
|
1363
|
-
whitelist: payload.whitelist
|
|
1364
|
-
});
|
|
1365
|
-
|
|
1366
|
-
export const toEmailRestrictionPolicyPayload = (domain) => ({
|
|
1367
|
-
is_blacklist_enabled: domain.isBlacklistEnabled,
|
|
1368
|
-
blacklist: domain.blacklist,
|
|
1369
|
-
is_whitelist_enabled: domain.isWhitelistEnabled,
|
|
1370
|
-
whitelist: domain.whitelist
|
|
1371
|
-
});
|
|
1372
|
-
|
|
1373
1439
|
export const toUserIdentifier = (payload) => ({
|
|
1374
1440
|
id: toUserIdentifierIdOrThrow(payload.id),
|
|
1375
1441
|
userId: toUserIdOrThrow(payload.user_id),
|
|
@@ -1440,58 +1506,6 @@ created_at: domain.createdAt,
|
|
|
1440
1506
|
updated_at: domain.updatedAt
|
|
1441
1507
|
});
|
|
1442
1508
|
|
|
1443
|
-
export const toSessionToken = (payload) => ({
|
|
1444
|
-
accessToken: payload.access_token,
|
|
1445
|
-
refreshToken: payload.refresh_token,
|
|
1446
|
-
expiresAt: payload.expires_at,
|
|
1447
|
-
tokenType: payload.token_type,
|
|
1448
|
-
sessionId: toUserSessionIdOrThrow(payload.session_id),
|
|
1449
|
-
identifierId: toUserIdentifierIdOrThrow(payload.identifier_id)
|
|
1450
|
-
});
|
|
1451
|
-
|
|
1452
|
-
export const toSessionTokenPayload = (domain) => ({
|
|
1453
|
-
access_token: domain.accessToken,
|
|
1454
|
-
refresh_token: domain.refreshToken,
|
|
1455
|
-
expires_at: domain.expiresAt,
|
|
1456
|
-
token_type: domain.tokenType,
|
|
1457
|
-
session_id: domain.sessionId,
|
|
1458
|
-
identifier_id: domain.identifierId
|
|
1459
|
-
});
|
|
1460
|
-
|
|
1461
|
-
export const toUserDetails = (payload) => ({
|
|
1462
|
-
id: toUserIdOrThrow(payload.id),
|
|
1463
|
-
role: payload.role,
|
|
1464
|
-
accountStatus: payload.account_status,
|
|
1465
|
-
accountStatusOnRestore: payload.account_status_on_restore,
|
|
1466
|
-
authorityLevel: payload.authority_level,
|
|
1467
|
-
permissionCodes: payload.permission_codes ? payload.permission_codes.map(val => toPermissionCodeOrThrow(val)) : [],
|
|
1468
|
-
isTotpEnabled: payload.is_totp_enabled,
|
|
1469
|
-
lastLoginAt: payload.last_login_at,
|
|
1470
|
-
lastActiveAt: payload.last_active_at,
|
|
1471
|
-
createdAt: payload.created_at,
|
|
1472
|
-
updatedAt: payload.updated_at,
|
|
1473
|
-
scheduledPermanentDeletionAt: payload.scheduled_permanent_deletion_at,
|
|
1474
|
-
lockoutType: payload.account_lockout_type,
|
|
1475
|
-
temporaryLockoutUntil: payload.temporary_lockout_until
|
|
1476
|
-
});
|
|
1477
|
-
|
|
1478
|
-
export const toUserDetailsPayload = (domain) => ({
|
|
1479
|
-
id: domain.id,
|
|
1480
|
-
role: domain.role,
|
|
1481
|
-
account_status: domain.accountStatus,
|
|
1482
|
-
account_status_on_restore: domain.accountStatusOnRestore,
|
|
1483
|
-
authority_level: domain.authorityLevel,
|
|
1484
|
-
permission_codes: domain.permissionCodes,
|
|
1485
|
-
is_totp_enabled: domain.isTotpEnabled,
|
|
1486
|
-
last_login_at: domain.lastLoginAt,
|
|
1487
|
-
last_active_at: domain.lastActiveAt,
|
|
1488
|
-
created_at: domain.createdAt,
|
|
1489
|
-
updated_at: domain.updatedAt,
|
|
1490
|
-
scheduled_permanent_deletion_at: domain.scheduledPermanentDeletionAt,
|
|
1491
|
-
account_lockout_type: domain.lockoutType,
|
|
1492
|
-
temporary_lockout_until: domain.temporaryLockoutUntil
|
|
1493
|
-
});
|
|
1494
|
-
|
|
1495
1509
|
export const toUserPublic = (payload) => ({
|
|
1496
1510
|
id: toUserIdOrThrow(payload.id),
|
|
1497
1511
|
role: payload.role,
|