@meridianjs/user 0.1.10 → 0.1.12
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/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +10 -0
- package/dist/index.mjs +10 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -18,6 +18,11 @@ declare class UserModuleService extends UserModuleService_base {
|
|
|
18
18
|
* Bypasses UPDATE_RESERVED to clear deleted_at directly via the repository.
|
|
19
19
|
*/
|
|
20
20
|
restoreUser(userId: string, data?: Record<string, unknown>): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* Fetch multiple users by ID in a single query.
|
|
23
|
+
* Returns a Map keyed by user ID for O(1) lookup.
|
|
24
|
+
*/
|
|
25
|
+
listUsersByIds(ids: string[]): Promise<Map<string, any>>;
|
|
21
26
|
/** Return the total number of registered users. */
|
|
22
27
|
countUsers(): Promise<number>;
|
|
23
28
|
/** Store a new session record when a token is issued. */
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,11 @@ declare class UserModuleService extends UserModuleService_base {
|
|
|
18
18
|
* Bypasses UPDATE_RESERVED to clear deleted_at directly via the repository.
|
|
19
19
|
*/
|
|
20
20
|
restoreUser(userId: string, data?: Record<string, unknown>): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* Fetch multiple users by ID in a single query.
|
|
23
|
+
* Returns a Map keyed by user ID for O(1) lookup.
|
|
24
|
+
*/
|
|
25
|
+
listUsersByIds(ids: string[]): Promise<Map<string, any>>;
|
|
21
26
|
/** Return the total number of registered users. */
|
|
22
27
|
countUsers(): Promise<number>;
|
|
23
28
|
/** Store a new session record when a token is issued. */
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,16 @@ var UserModuleService = class extends (0, import_framework_utils4.MeridianServic
|
|
|
124
124
|
await repo.flush();
|
|
125
125
|
return user;
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Fetch multiple users by ID in a single query.
|
|
129
|
+
* Returns a Map keyed by user ID for O(1) lookup.
|
|
130
|
+
*/
|
|
131
|
+
async listUsersByIds(ids) {
|
|
132
|
+
if (!ids.length) return /* @__PURE__ */ new Map();
|
|
133
|
+
const userRepository = this.container.resolve("userRepository");
|
|
134
|
+
const users = await userRepository.find({ id: { $in: ids } });
|
|
135
|
+
return new Map(users.map((u) => [u.id, u]));
|
|
136
|
+
}
|
|
127
137
|
/** Return the total number of registered users. */
|
|
128
138
|
async countUsers() {
|
|
129
139
|
const userRepository = this.container.resolve("userRepository");
|
package/dist/index.mjs
CHANGED
|
@@ -98,6 +98,16 @@ var UserModuleService = class extends MeridianService({ User: user_default, Team
|
|
|
98
98
|
await repo.flush();
|
|
99
99
|
return user;
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Fetch multiple users by ID in a single query.
|
|
103
|
+
* Returns a Map keyed by user ID for O(1) lookup.
|
|
104
|
+
*/
|
|
105
|
+
async listUsersByIds(ids) {
|
|
106
|
+
if (!ids.length) return /* @__PURE__ */ new Map();
|
|
107
|
+
const userRepository = this.container.resolve("userRepository");
|
|
108
|
+
const users = await userRepository.find({ id: { $in: ids } });
|
|
109
|
+
return new Map(users.map((u) => [u.id, u]));
|
|
110
|
+
}
|
|
101
111
|
/** Return the total number of registered users. */
|
|
102
112
|
async countUsers() {
|
|
103
113
|
const userRepository = this.container.resolve("userRepository");
|