Interfazhost
UsersService
Cuentas del dominio (READ_USERS, riesgo alto: lo aprueba el administrador). SOLO LECTURA y solo de ESTA instancia.
Paginado por cursor (estable ante altas): repite con nextCursor hasta que sea null. Cuota: 120 consultas/min por extension; 30 por ejecucion.
Firma
export interface UsersService {
list(args?: { limit?: number; cursor?: string; search?: string; }): Promise<{ users: DomainUser[]; nextCursor: string | null; }>;
get(idOrEmail: string | { id: string; } | { email: string; }): Promise<{ user: DomainUser | null; }>;
}Miembros (2)
| Nombre | Tipo | Descripción |
|---|---|---|
| list | list(args?: { limit?: number; cursor?: string; search?: string; }): Promise<{ users: DomainUser[]; nextCursor: string | null; }> | READ_USERS. limit 1..100 (def. 50); search 1..100 caracteres sobre correo o nombre; cursor opaco de la pagina anterior. |
| get | get(idOrEmail: string | { id: string; } | { email: string; }): Promise<{ user: DomainUser | null; }> | READ_USERS. Una cadena (con "@" = correo, si no id) o { id } / { email }. |
Ejemplos
let cursor = null;
do {
const page = await ctx.services.users.list({ limit: 100, cursor: cursor ?? undefined });
for (const u of page.users) { // u.id, u.email, u.name, u.createdAt
}
cursor = page.nextCursor;
} while (cursor);
const ana = (await ctx.services.users.get("ana@acme.com")).user; // null si no existeUsado en / Referenciado por
Referencia a
Fuente: bloomx-extensions/_shared/sdk/ctx.d.ts:454 · ctx.d.ts