@milobedini/shared-types 1.0.59 → 1.0.60
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/types.d.ts +54 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -412,3 +412,57 @@ export type AttemptDetailResponse = {
|
|
|
412
412
|
success: boolean;
|
|
413
413
|
attempt: AttemptDetailResponseItem;
|
|
414
414
|
};
|
|
415
|
+
export type MongoId = string;
|
|
416
|
+
export type TherapistPreview = Pick<User, '_id' | 'username' | 'email' | 'name'>;
|
|
417
|
+
export type UsersSort = `${string}:${'asc' | 'desc'}` | string;
|
|
418
|
+
export type UsersSortMulti = UsersSort | `${UsersSort},${UsersSort}` | `${UsersSort},${UsersSort},${string}`;
|
|
419
|
+
export type GetUsersQuery = {
|
|
420
|
+
page?: number;
|
|
421
|
+
limit?: number;
|
|
422
|
+
q?: string;
|
|
423
|
+
roles?: UserRole[] | string;
|
|
424
|
+
ids?: string[] | string;
|
|
425
|
+
isVerified?: boolean | string;
|
|
426
|
+
isVerifiedTherapist?: boolean | string;
|
|
427
|
+
hasTherapist?: boolean | string;
|
|
428
|
+
therapistId?: string;
|
|
429
|
+
createdFrom?: string;
|
|
430
|
+
createdTo?: string;
|
|
431
|
+
lastLoginFrom?: string;
|
|
432
|
+
lastLoginTo?: string;
|
|
433
|
+
sort?: UsersSortMulti;
|
|
434
|
+
select?: string[] | string;
|
|
435
|
+
};
|
|
436
|
+
export type UsersListItem = {
|
|
437
|
+
_id: MongoId;
|
|
438
|
+
username: string;
|
|
439
|
+
email: string;
|
|
440
|
+
name?: string;
|
|
441
|
+
roles: UserRole[];
|
|
442
|
+
isVerified?: boolean;
|
|
443
|
+
isVerifiedTherapist?: boolean;
|
|
444
|
+
therapist?: MongoId | null;
|
|
445
|
+
therapistInfo?: TherapistPreview | null;
|
|
446
|
+
patients?: MongoId[];
|
|
447
|
+
createdAt: string;
|
|
448
|
+
updatedAt: string;
|
|
449
|
+
lastLogin?: string;
|
|
450
|
+
};
|
|
451
|
+
export type FacetCount<T = string | boolean | null> = {
|
|
452
|
+
_id: T;
|
|
453
|
+
count: number;
|
|
454
|
+
};
|
|
455
|
+
export type UsersFacets = {
|
|
456
|
+
roles: FacetCount<UserRole>[];
|
|
457
|
+
isVerified: FacetCount<boolean>[];
|
|
458
|
+
isVerifiedTherapist: FacetCount<boolean>[];
|
|
459
|
+
hasTherapist: FacetCount<boolean>[];
|
|
460
|
+
};
|
|
461
|
+
export type GetUsersResponse = {
|
|
462
|
+
page: number;
|
|
463
|
+
limit: number;
|
|
464
|
+
total: number;
|
|
465
|
+
totalPages: number;
|
|
466
|
+
items: UsersListItem[];
|
|
467
|
+
facets: UsersFacets;
|
|
468
|
+
};
|