academe-kit 0.2.0 → 0.2.3

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
@@ -2979,6 +2979,105 @@ interface paths {
2979
2979
  };
2980
2980
  trace?: never;
2981
2981
  };
2982
+ "/institutions/{institutionId}/groups/users": {
2983
+ parameters: {
2984
+ query?: never;
2985
+ header?: never;
2986
+ path?: never;
2987
+ cookie?: never;
2988
+ };
2989
+ /**
2990
+ * Get all users of all groups in an institution
2991
+ * @description Retrieve all users from all groups associated with a specific institution.
2992
+ * Returns a map where keys are group IDs and values are arrays of users in each group.
2993
+ * This is more efficient than calling /groups/{id}/users multiple times.
2994
+ */
2995
+ get: {
2996
+ parameters: {
2997
+ query?: never;
2998
+ header?: never;
2999
+ path: {
3000
+ /** @description Institution ID */
3001
+ institutionId: string;
3002
+ };
3003
+ cookie?: never;
3004
+ };
3005
+ requestBody?: never;
3006
+ responses: {
3007
+ /** @description Users grouped by group ID */
3008
+ 200: {
3009
+ headers: {
3010
+ [name: string]: unknown;
3011
+ };
3012
+ content: {
3013
+ /**
3014
+ * @example {
3015
+ * "status": "success",
3016
+ * "data": {
3017
+ * "group-uuid-1": [
3018
+ * {
3019
+ * "id": "user-uuid-1",
3020
+ * "firstName": "John",
3021
+ * "lastName": "Doe",
3022
+ * "email": "john@example.com",
3023
+ * "assignedAt": "2024-01-15T10:30:00Z"
3024
+ * },
3025
+ * {
3026
+ * "id": "user-uuid-2",
3027
+ * "firstName": "Jane",
3028
+ * "lastName": "Smith",
3029
+ * "email": "jane@example.com",
3030
+ * "assignedAt": "2024-01-16T14:20:00Z"
3031
+ * }
3032
+ * ],
3033
+ * "group-uuid-2": [
3034
+ * {
3035
+ * "id": "user-uuid-3",
3036
+ * "firstName": "Bob",
3037
+ * "lastName": "Wilson",
3038
+ * "email": "bob@example.com",
3039
+ * "assignedAt": "2024-01-17T09:15:00Z"
3040
+ * }
3041
+ * ]
3042
+ * }
3043
+ * }
3044
+ */
3045
+ "application/json": {
3046
+ /** @example success */
3047
+ status?: string;
3048
+ /** @description Map of group IDs to arrays of users */
3049
+ data?: {
3050
+ [key: string]: {
3051
+ /** Format: uuid */
3052
+ id?: string;
3053
+ firstName?: string;
3054
+ lastName?: string;
3055
+ email?: string;
3056
+ document?: string;
3057
+ phone?: string;
3058
+ isActive?: boolean;
3059
+ /** Format: date-time */
3060
+ assignedAt?: string;
3061
+ /** Format: uuid */
3062
+ assignedBy?: string;
3063
+ }[];
3064
+ };
3065
+ };
3066
+ };
3067
+ };
3068
+ 401: components["responses"]["Unauthorized"];
3069
+ 404: components["responses"]["NotFound"];
3070
+ 500: components["responses"]["ServerError"];
3071
+ };
3072
+ };
3073
+ put?: never;
3074
+ post?: never;
3075
+ delete?: never;
3076
+ options?: never;
3077
+ head?: never;
3078
+ patch?: never;
3079
+ trace?: never;
3080
+ };
2982
3081
  "/institutions/{institutionId}/registrations": {
2983
3082
  parameters: {
2984
3083
  query?: never;
@@ -3513,6 +3612,69 @@ interface paths {
3513
3612
  };
3514
3613
  trace?: never;
3515
3614
  };
3615
+ "/institutions/{institutionId}/users": {
3616
+ parameters: {
3617
+ query?: never;
3618
+ header?: never;
3619
+ path?: never;
3620
+ cookie?: never;
3621
+ };
3622
+ /**
3623
+ * List all users from an institution
3624
+ * @description Retrieve a paginated list of all users registered in an institution with advanced filtering options
3625
+ */
3626
+ get: {
3627
+ parameters: {
3628
+ query?: {
3629
+ /** @description Filter by classroom (institution_classroom_id) */
3630
+ classroomId?: string;
3631
+ /** @description Filter by student status (true = students only, false = non-students only) */
3632
+ isStudent?: boolean;
3633
+ /** @description Filter by user active status */
3634
+ isActive?: boolean;
3635
+ /** @description Filter users with certificates (true) or without (false) */
3636
+ hasCertificates?: boolean;
3637
+ /** @description Filter users with guardian (true) or without (false) */
3638
+ hasGuardian?: boolean;
3639
+ /** @description Search by email, first name, last name, or full name (case-insensitive) */
3640
+ search?: string;
3641
+ /** @description Page number */
3642
+ page?: number;
3643
+ /** @description Items per page */
3644
+ limit?: number;
3645
+ };
3646
+ header?: never;
3647
+ path: {
3648
+ /** @description Institution ID */
3649
+ institutionId: string;
3650
+ };
3651
+ cookie?: never;
3652
+ };
3653
+ requestBody?: never;
3654
+ responses: {
3655
+ /** @description List of users from the institution */
3656
+ 200: {
3657
+ headers: {
3658
+ [name: string]: unknown;
3659
+ };
3660
+ content: {
3661
+ "application/json": components["schemas"]["InstitutionUserListResponse"];
3662
+ };
3663
+ };
3664
+ 400: components["responses"]["BadRequest"];
3665
+ 401: components["responses"]["Unauthorized"];
3666
+ 404: components["responses"]["NotFound"];
3667
+ 500: components["responses"]["ServerError"];
3668
+ };
3669
+ };
3670
+ put?: never;
3671
+ post?: never;
3672
+ delete?: never;
3673
+ options?: never;
3674
+ head?: never;
3675
+ patch?: never;
3676
+ trace?: never;
3677
+ };
3516
3678
  "/organizations": {
3517
3679
  parameters: {
3518
3680
  query?: never;
@@ -4919,7 +5081,7 @@ interface paths {
4919
5081
  };
4920
5082
  /**
4921
5083
  * List all shifts
4922
- * @description Retrieve a list of all institution shifts (morning, afternoon, night)
5084
+ * @description Retrieve a list of all institution shifts (manhã, tarde, noite)
4923
5085
  */
4924
5086
  get: {
4925
5087
  parameters: {
@@ -5896,6 +6058,115 @@ interface components {
5896
6058
  updatedAt?: string;
5897
6059
  guardian?: components["schemas"]["Guardian"];
5898
6060
  };
6061
+ /** @description User with institution registration details (returned by GET /institutions/{institutionId}/users) */
6062
+ InstitutionUser: {
6063
+ /**
6064
+ * Format: uuid
6065
+ * @description Keycloak User ID
6066
+ */
6067
+ id?: string;
6068
+ /** @example John */
6069
+ firstName?: string;
6070
+ /** @example Doe */
6071
+ lastName?: string;
6072
+ /**
6073
+ * Format: email
6074
+ * @example john.doe@example.com
6075
+ */
6076
+ email?: string;
6077
+ /** @example +5511999999999 */
6078
+ phone?: string | null;
6079
+ /** @example 12345678901 */
6080
+ document?: string | null;
6081
+ /** @enum {string|null} */
6082
+ gender?: "male" | "female" | "other" | null;
6083
+ /**
6084
+ * @description Indicates if the user is active
6085
+ * @example true
6086
+ */
6087
+ isActive?: boolean;
6088
+ /** Format: date-time */
6089
+ birthdate?: string | null;
6090
+ /** Format: date-time */
6091
+ createdAt?: string;
6092
+ /** Format: date-time */
6093
+ updatedAt?: string;
6094
+ /**
6095
+ * @description Number of certificates the user has
6096
+ * @example 5
6097
+ */
6098
+ certificatesCount?: number;
6099
+ /** @description User's guardian associations */
6100
+ userGuardians?: {
6101
+ /** Format: uuid */
6102
+ id?: string;
6103
+ guardian?: {
6104
+ /** Format: uuid */
6105
+ id?: string;
6106
+ /** @example Maria Silva */
6107
+ name?: string;
6108
+ /**
6109
+ * Format: email
6110
+ * @example maria@example.com
6111
+ */
6112
+ email?: string;
6113
+ /** @example +5511999999999 */
6114
+ phone?: string | null;
6115
+ };
6116
+ }[];
6117
+ /** @description User's registration info in the institution */
6118
+ institutionRegistration?: {
6119
+ /** Format: uuid */
6120
+ id?: string;
6121
+ /**
6122
+ * @description Indicates if the user is registered as a student
6123
+ * @example true
6124
+ */
6125
+ isStudent?: boolean;
6126
+ /**
6127
+ * @description Indicates if the registration is active
6128
+ * @example true
6129
+ */
6130
+ isActive?: boolean;
6131
+ /** @description Classroom assignment details */
6132
+ institutionClassroom?: {
6133
+ /** Format: uuid */
6134
+ id?: string;
6135
+ classroom?: {
6136
+ /** Format: uuid */
6137
+ id?: string;
6138
+ /** @example 9º Ano A */
6139
+ name?: string;
6140
+ /** @description Grade level information */
6141
+ serie?: {
6142
+ /** Format: uuid */
6143
+ id?: string;
6144
+ /**
6145
+ * @description Grade level value (1-12)
6146
+ * @example 9
6147
+ */
6148
+ value?: number;
6149
+ } | null;
6150
+ /** @description Shift information (manhã, tarde, noite) */
6151
+ shift?: {
6152
+ /** Format: uuid */
6153
+ id?: string;
6154
+ /**
6155
+ * @example manhã
6156
+ * @enum {string}
6157
+ */
6158
+ name?: "manhã" | "tarde" | "noite";
6159
+ } | null;
6160
+ } | null;
6161
+ } | null;
6162
+ };
6163
+ };
6164
+ InstitutionUserListResponse: {
6165
+ /** @example success */
6166
+ status?: string;
6167
+ data?: components["schemas"]["InstitutionUser"][];
6168
+ meta?: components["schemas"]["PaginationMeta"];
6169
+ };
5899
6170
  InstitutionRegistration: {
5900
6171
  /** Format: uuid */
5901
6172
  id?: string;
@@ -6192,7 +6463,7 @@ interface components {
6192
6463
  createdAt?: string;
6193
6464
  /** Format: date-time */
6194
6465
  updatedAt?: string;
6195
- /** @description Shift information (morning, afternoon, night) */
6466
+ /** @description Shift information (manhã, tarde, noite) */
6196
6467
  shift?: components["schemas"]["Shift"];
6197
6468
  /** @description Serie/grade level information */
6198
6469
  serie?: components["schemas"]["Serie"];
@@ -6707,17 +6978,17 @@ interface components {
6707
6978
  };
6708
6979
  CreateShiftDto: {
6709
6980
  /**
6710
- * @example morning
6981
+ * @example manhã
6711
6982
  * @enum {string}
6712
6983
  */
6713
- name: "morning" | "afternoon" | "night";
6984
+ name: "manhã" | "tarde" | "noite";
6714
6985
  };
6715
6986
  UpdateShiftDto: {
6716
6987
  /**
6717
- * @example morning
6988
+ * @example manhã
6718
6989
  * @enum {string}
6719
6990
  */
6720
- name?: "morning" | "afternoon" | "night";
6991
+ name?: "manhã" | "tarde" | "noite";
6721
6992
  };
6722
6993
  AssignGuardianToUserDto: {
6723
6994
  /** Format: uuid */
@@ -6818,6 +7089,7 @@ type User = components['schemas']['User'];
6818
7089
  type Institution = components['schemas']['Institution'];
6819
7090
  type Classroom = components['schemas']['Classroom'];
6820
7091
  type InstitutionClassroom = components['schemas']['InstitutionClassroom'];
7092
+ type InstitutionUser = components['schemas']['InstitutionUser'];
6821
7093
  type Organization = components['schemas']['Organization'];
6822
7094
  type Serie = components['schemas']['Serie'];
6823
7095
  type Shift = components['schemas']['Shift'];
@@ -6825,12 +7097,13 @@ type Shift = components['schemas']['Shift'];
6825
7097
  type index_d_Classroom = Classroom;
6826
7098
  type index_d_Institution = Institution;
6827
7099
  type index_d_InstitutionClassroom = InstitutionClassroom;
7100
+ type index_d_InstitutionUser = InstitutionUser;
6828
7101
  type index_d_Organization = Organization;
6829
7102
  type index_d_Serie = Serie;
6830
7103
  type index_d_Shift = Shift;
6831
7104
  type index_d_User = User;
6832
7105
  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 };
7106
+ 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
7107
  }
6835
7108
 
6836
7109
  type CreateUserBody = {
@@ -7730,6 +8003,65 @@ declare function createInstitutionService(apiClient: AcademeApiClient): {
7730
8003
  };
7731
8004
  };
7732
8005
  }, `${string}/${string}`>>;
8006
+ getUsers(institutionId: string, options?: {
8007
+ classroomId?: string;
8008
+ isStudent?: boolean;
8009
+ isActive?: boolean;
8010
+ hasCertificates?: boolean;
8011
+ hasGuardian?: boolean;
8012
+ search?: string;
8013
+ page?: number;
8014
+ limit?: number;
8015
+ }): Promise<openapi_fetch.FetchResponse<{
8016
+ parameters: {
8017
+ query?: {
8018
+ classroomId?: string;
8019
+ isStudent?: boolean;
8020
+ isActive?: boolean;
8021
+ hasCertificates?: boolean;
8022
+ hasGuardian?: boolean;
8023
+ search?: string;
8024
+ page?: number;
8025
+ limit?: number;
8026
+ };
8027
+ header?: never;
8028
+ path: {
8029
+ institutionId: string;
8030
+ };
8031
+ cookie?: never;
8032
+ };
8033
+ requestBody?: never;
8034
+ responses: {
8035
+ 200: {
8036
+ headers: {
8037
+ [name: string]: unknown;
8038
+ };
8039
+ content: {
8040
+ "application/json": components["schemas"]["InstitutionUserListResponse"];
8041
+ };
8042
+ };
8043
+ 400: components["responses"]["BadRequest"];
8044
+ 401: components["responses"]["Unauthorized"];
8045
+ 404: components["responses"]["NotFound"];
8046
+ 500: components["responses"]["ServerError"];
8047
+ };
8048
+ }, {
8049
+ params: {
8050
+ path: {
8051
+ institutionId: string;
8052
+ };
8053
+ query: {
8054
+ classroomId?: string;
8055
+ isStudent?: boolean;
8056
+ isActive?: boolean;
8057
+ hasCertificates?: boolean;
8058
+ hasGuardian?: boolean;
8059
+ search?: string;
8060
+ page?: number;
8061
+ limit?: number;
8062
+ } | undefined;
8063
+ };
8064
+ }, `${string}/${string}`>>;
7733
8065
  getRegistrations(institutionId: string): Promise<openapi_fetch.FetchResponse<{
7734
8066
  parameters: {
7735
8067
  query?: never;
@@ -9392,7 +9724,7 @@ declare function createShiftService(apiClient: AcademeApiClient): {
9392
9724
  };
9393
9725
  }, {
9394
9726
  body: {
9395
- name: "morning" | "afternoon" | "night";
9727
+ name: "manh\u00E3" | "tarde" | "noite";
9396
9728
  };
9397
9729
  }, `${string}/${string}`>>;
9398
9730
  /**
@@ -9437,7 +9769,7 @@ declare function createShiftService(apiClient: AcademeApiClient): {
9437
9769
  };
9438
9770
  };
9439
9771
  body: {
9440
- name?: "morning" | "afternoon" | "night";
9772
+ name?: "manh\u00E3" | "tarde" | "noite";
9441
9773
  };
9442
9774
  }, `${string}/${string}`>>;
9443
9775
  /**
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', {