@unchainedshop/core-users 4.6.0 → 4.6.1
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.
|
@@ -55,6 +55,8 @@ export interface UserQuery {
|
|
|
55
55
|
tags?: string[];
|
|
56
56
|
userIds?: string[];
|
|
57
57
|
username?: string;
|
|
58
|
+
usernames?: string[];
|
|
59
|
+
emails?: string[];
|
|
58
60
|
web3Verified?: boolean;
|
|
59
61
|
}
|
|
60
62
|
export declare const UsersCollection: (db: mongodb.Db) => Promise<mongodb.Collection<User>>;
|
|
@@ -3,7 +3,7 @@ import { type User, type UserQuery, type Email, type UserLastLogin, type UserPro
|
|
|
3
3
|
import { type SortOption } from '@unchainedshop/utils';
|
|
4
4
|
import { type UserRegistrationData, type UserSettingsOptions } from '../users-settings.ts';
|
|
5
5
|
export declare const removeConfidentialServiceHashes: (rawUser: User) => User;
|
|
6
|
-
export declare const buildFindSelector: ({ includeGuests, includeDeleted, queryString, emailVerified, lastLogin, tags, userIds, username, web3Verified, }: UserQuery) => mongodb.Filter<User>;
|
|
6
|
+
export declare const buildFindSelector: ({ includeGuests, includeDeleted, queryString, emailVerified, lastLogin, tags, userIds, username, usernames, emails, web3Verified, }: UserQuery) => mongodb.Filter<User>;
|
|
7
7
|
export declare const configureUsersModule: (moduleInput: ModuleInput<UserSettingsOptions>) => Promise<{
|
|
8
8
|
webAuthn: {
|
|
9
9
|
findMDSMetadataForAAGUID: (aaguid: string) => Promise<{
|
|
@@ -31,7 +31,7 @@ export const removeConfidentialServiceHashes = (rawUser) => {
|
|
|
31
31
|
delete user?.services;
|
|
32
32
|
return user;
|
|
33
33
|
};
|
|
34
|
-
export const buildFindSelector = ({ includeGuests, includeDeleted, queryString, emailVerified, lastLogin, tags, userIds, username, web3Verified, }) => {
|
|
34
|
+
export const buildFindSelector = ({ includeGuests, includeDeleted, queryString, emailVerified, lastLogin, tags, userIds, username, usernames, emails, web3Verified, }) => {
|
|
35
35
|
const selector = {};
|
|
36
36
|
if (!includeDeleted)
|
|
37
37
|
selector.deleted = null;
|
|
@@ -43,6 +43,16 @@ export const buildFindSelector = ({ includeGuests, includeDeleted, queryString,
|
|
|
43
43
|
if (username) {
|
|
44
44
|
selector.username = insensitiveTrimmedRegexOperator(username);
|
|
45
45
|
}
|
|
46
|
+
if (usernames?.length) {
|
|
47
|
+
selector.username = {
|
|
48
|
+
$in: usernames.map((u) => insensitiveTrimmedRegexOperator(u)),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
if (emails?.length) {
|
|
52
|
+
selector['emails.address'] = {
|
|
53
|
+
$in: emails.map((e) => insensitiveTrimmedRegexOperator(e)),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
46
56
|
if (emailVerified === true) {
|
|
47
57
|
selector['emails.verified'] = true;
|
|
48
58
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-users",
|
|
3
3
|
"description": "User management module for the Unchained Engine with authentication support",
|
|
4
|
-
"version": "4.6.
|
|
4
|
+
"version": "4.6.1",
|
|
5
5
|
"main": "lib/users-index.js",
|
|
6
6
|
"types": "lib/users-index.d.ts",
|
|
7
7
|
"type": "module",
|