academe-kit 0.2.0 → 0.2.2

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.ts CHANGED
@@ -3513,6 +3513,69 @@ interface paths {
3513
3513
  };
3514
3514
  trace?: never;
3515
3515
  };
3516
+ "/institutions/{institutionId}/users": {
3517
+ parameters: {
3518
+ query?: never;
3519
+ header?: never;
3520
+ path?: never;
3521
+ cookie?: never;
3522
+ };
3523
+ /**
3524
+ * List all users from an institution
3525
+ * @description Retrieve a paginated list of all users registered in an institution with advanced filtering options
3526
+ */
3527
+ get: {
3528
+ parameters: {
3529
+ query?: {
3530
+ /** @description Filter by classroom (institution_classroom_id) */
3531
+ classroomId?: string;
3532
+ /** @description Filter by student status (true = students only, false = non-students only) */
3533
+ isStudent?: boolean;
3534
+ /** @description Filter by user active status */
3535
+ isActive?: boolean;
3536
+ /** @description Filter users with certificates (true) or without (false) */
3537
+ hasCertificates?: boolean;
3538
+ /** @description Filter users with guardian (true) or without (false) */
3539
+ hasGuardian?: boolean;
3540
+ /** @description Search by email, first name, last name, or full name (case-insensitive) */
3541
+ search?: string;
3542
+ /** @description Page number */
3543
+ page?: number;
3544
+ /** @description Items per page */
3545
+ limit?: number;
3546
+ };
3547
+ header?: never;
3548
+ path: {
3549
+ /** @description Institution ID */
3550
+ institutionId: string;
3551
+ };
3552
+ cookie?: never;
3553
+ };
3554
+ requestBody?: never;
3555
+ responses: {
3556
+ /** @description List of users from the institution */
3557
+ 200: {
3558
+ headers: {
3559
+ [name: string]: unknown;
3560
+ };
3561
+ content: {
3562
+ "application/json": components["schemas"]["InstitutionUserListResponse"];
3563
+ };
3564
+ };
3565
+ 400: components["responses"]["BadRequest"];
3566
+ 401: components["responses"]["Unauthorized"];
3567
+ 404: components["responses"]["NotFound"];
3568
+ 500: components["responses"]["ServerError"];
3569
+ };
3570
+ };
3571
+ put?: never;
3572
+ post?: never;
3573
+ delete?: never;
3574
+ options?: never;
3575
+ head?: never;
3576
+ patch?: never;
3577
+ trace?: never;
3578
+ };
3516
3579
  "/organizations": {
3517
3580
  parameters: {
3518
3581
  query?: never;
@@ -5896,6 +5959,115 @@ interface components {
5896
5959
  updatedAt?: string;
5897
5960
  guardian?: components["schemas"]["Guardian"];
5898
5961
  };
5962
+ /** @description User with institution registration details (returned by GET /institutions/{institutionId}/users) */
5963
+ InstitutionUser: {
5964
+ /**
5965
+ * Format: uuid
5966
+ * @description Keycloak User ID
5967
+ */
5968
+ id?: string;
5969
+ /** @example John */
5970
+ firstName?: string;
5971
+ /** @example Doe */
5972
+ lastName?: string;
5973
+ /**
5974
+ * Format: email
5975
+ * @example john.doe@example.com
5976
+ */
5977
+ email?: string;
5978
+ /** @example +5511999999999 */
5979
+ phone?: string | null;
5980
+ /** @example 12345678901 */
5981
+ document?: string | null;
5982
+ /** @enum {string|null} */
5983
+ gender?: "male" | "female" | "other" | null;
5984
+ /**
5985
+ * @description Indicates if the user is active
5986
+ * @example true
5987
+ */
5988
+ isActive?: boolean;
5989
+ /** Format: date-time */
5990
+ birthdate?: string | null;
5991
+ /** Format: date-time */
5992
+ createdAt?: string;
5993
+ /** Format: date-time */
5994
+ updatedAt?: string;
5995
+ /**
5996
+ * @description Number of certificates the user has
5997
+ * @example 5
5998
+ */
5999
+ certificatesCount?: number;
6000
+ /** @description User's guardian associations */
6001
+ userGuardians?: {
6002
+ /** Format: uuid */
6003
+ id?: string;
6004
+ guardian?: {
6005
+ /** Format: uuid */
6006
+ id?: string;
6007
+ /** @example Maria Silva */
6008
+ name?: string;
6009
+ /**
6010
+ * Format: email
6011
+ * @example maria@example.com
6012
+ */
6013
+ email?: string;
6014
+ /** @example +5511999999999 */
6015
+ phone?: string | null;
6016
+ };
6017
+ }[];
6018
+ /** @description User's registration info in the institution */
6019
+ institutionRegistration?: {
6020
+ /** Format: uuid */
6021
+ id?: string;
6022
+ /**
6023
+ * @description Indicates if the user is registered as a student
6024
+ * @example true
6025
+ */
6026
+ isStudent?: boolean;
6027
+ /**
6028
+ * @description Indicates if the registration is active
6029
+ * @example true
6030
+ */
6031
+ isActive?: boolean;
6032
+ /** @description Classroom assignment details */
6033
+ institutionClassroom?: {
6034
+ /** Format: uuid */
6035
+ id?: string;
6036
+ classroom?: {
6037
+ /** Format: uuid */
6038
+ id?: string;
6039
+ /** @example 9º Ano A */
6040
+ name?: string;
6041
+ /** @description Grade level information */
6042
+ serie?: {
6043
+ /** Format: uuid */
6044
+ id?: string;
6045
+ /**
6046
+ * @description Grade level value (1-12)
6047
+ * @example 9
6048
+ */
6049
+ value?: number;
6050
+ } | null;
6051
+ /** @description Shift information (morning, afternoon, night) */
6052
+ shift?: {
6053
+ /** Format: uuid */
6054
+ id?: string;
6055
+ /**
6056
+ * @example manhã
6057
+ * @enum {string}
6058
+ */
6059
+ name?: "manhã" | "tarde" | "noite";
6060
+ } | null;
6061
+ } | null;
6062
+ } | null;
6063
+ };
6064
+ };
6065
+ InstitutionUserListResponse: {
6066
+ /** @example success */
6067
+ status?: string;
6068
+ data?: components["schemas"]["InstitutionUser"][];
6069
+ meta?: components["schemas"]["PaginationMeta"];
6070
+ };
5899
6071
  InstitutionRegistration: {
5900
6072
  /** Format: uuid */
5901
6073
  id?: string;
@@ -6818,6 +6990,7 @@ type User = components['schemas']['User'];
6818
6990
  type Institution = components['schemas']['Institution'];
6819
6991
  type Classroom = components['schemas']['Classroom'];
6820
6992
  type InstitutionClassroom = components['schemas']['InstitutionClassroom'];
6993
+ type InstitutionUser = components['schemas']['InstitutionUser'];
6821
6994
  type Organization = components['schemas']['Organization'];
6822
6995
  type Serie = components['schemas']['Serie'];
6823
6996
  type Shift = components['schemas']['Shift'];
@@ -6825,12 +6998,13 @@ type Shift = components['schemas']['Shift'];
6825
6998
  type index_d_Classroom = Classroom;
6826
6999
  type index_d_Institution = Institution;
6827
7000
  type index_d_InstitutionClassroom = InstitutionClassroom;
7001
+ type index_d_InstitutionUser = InstitutionUser;
6828
7002
  type index_d_Organization = Organization;
6829
7003
  type index_d_Serie = Serie;
6830
7004
  type index_d_Shift = Shift;
6831
7005
  type index_d_User = User;
6832
7006
  declare namespace index_d {
6833
- export type { index_d_Classroom as Classroom, index_d_Institution as Institution, index_d_InstitutionClassroom as InstitutionClassroom, index_d_Organization as Organization, index_d_Serie as Serie, index_d_Shift as Shift, index_d_User as User };
7007
+ export type { index_d_Classroom as Classroom, index_d_Institution as Institution, index_d_InstitutionClassroom as InstitutionClassroom, index_d_InstitutionUser as InstitutionUser, index_d_Organization as Organization, index_d_Serie as Serie, index_d_Shift as Shift, index_d_User as User };
6834
7008
  }
6835
7009
 
6836
7010
  type CreateUserBody = {
@@ -7730,6 +7904,65 @@ declare function createInstitutionService(apiClient: AcademeApiClient): {
7730
7904
  };
7731
7905
  };
7732
7906
  }, `${string}/${string}`>>;
7907
+ getUsers(institutionId: string, options?: {
7908
+ classroomId?: string;
7909
+ isStudent?: boolean;
7910
+ isActive?: boolean;
7911
+ hasCertificates?: boolean;
7912
+ hasGuardian?: boolean;
7913
+ search?: string;
7914
+ page?: number;
7915
+ limit?: number;
7916
+ }): Promise<openapi_fetch.FetchResponse<{
7917
+ parameters: {
7918
+ query?: {
7919
+ classroomId?: string;
7920
+ isStudent?: boolean;
7921
+ isActive?: boolean;
7922
+ hasCertificates?: boolean;
7923
+ hasGuardian?: boolean;
7924
+ search?: string;
7925
+ page?: number;
7926
+ limit?: number;
7927
+ };
7928
+ header?: never;
7929
+ path: {
7930
+ institutionId: string;
7931
+ };
7932
+ cookie?: never;
7933
+ };
7934
+ requestBody?: never;
7935
+ responses: {
7936
+ 200: {
7937
+ headers: {
7938
+ [name: string]: unknown;
7939
+ };
7940
+ content: {
7941
+ "application/json": components["schemas"]["InstitutionUserListResponse"];
7942
+ };
7943
+ };
7944
+ 400: components["responses"]["BadRequest"];
7945
+ 401: components["responses"]["Unauthorized"];
7946
+ 404: components["responses"]["NotFound"];
7947
+ 500: components["responses"]["ServerError"];
7948
+ };
7949
+ }, {
7950
+ params: {
7951
+ path: {
7952
+ institutionId: string;
7953
+ };
7954
+ query: {
7955
+ classroomId?: string;
7956
+ isStudent?: boolean;
7957
+ isActive?: boolean;
7958
+ hasCertificates?: boolean;
7959
+ hasGuardian?: boolean;
7960
+ search?: string;
7961
+ page?: number;
7962
+ limit?: number;
7963
+ } | undefined;
7964
+ };
7965
+ }, `${string}/${string}`>>;
7733
7966
  getRegistrations(institutionId: string): Promise<openapi_fetch.FetchResponse<{
7734
7967
  parameters: {
7735
7968
  query?: never;
package/dist/index.esm.js CHANGED
@@ -2839,6 +2839,15 @@ function createInstitutionService(apiClient) {
2839
2839
  params: { path: { institutionId, classroomId } },
2840
2840
  });
2841
2841
  },
2842
+ // Institution Users (list all users with filters)
2843
+ getUsers(institutionId, options) {
2844
+ return apiClient.GET('/institutions/{institutionId}/users', {
2845
+ params: {
2846
+ path: { institutionId },
2847
+ query: options,
2848
+ },
2849
+ });
2850
+ },
2842
2851
  // Institution Registrations (Users in Institution)
2843
2852
  getRegistrations(institutionId) {
2844
2853
  return apiClient.GET('/institutions/{institutionId}/registrations', {