academe-kit 0.11.5 → 0.11.7

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.
@@ -2875,6 +2875,94 @@ export interface paths {
2875
2875
  patch?: never;
2876
2876
  trace?: never;
2877
2877
  };
2878
+ "/challenges/{id}/participants": {
2879
+ parameters: {
2880
+ query?: never;
2881
+ header?: never;
2882
+ path?: never;
2883
+ cookie?: never;
2884
+ };
2885
+ /**
2886
+ * List the students taking part in this challenge
2887
+ * @description Returns the roster of students for the challenge along with each
2888
+ * student's status, derived from `submissions` (latest attempt) and
2889
+ * `user_challenge_progress` (whether any step was started).
2890
+ *
2891
+ * The roster is built from `institution_registration` rows of the given
2892
+ * institution, filtered by the challenge's serie. `institutionId` and
2893
+ * `serieId` may be supplied via query to provide the viewing context —
2894
+ * useful for global template challenges (`institution_id IS NULL`) shown
2895
+ * via fallback in the pedagogical portal. They default to the
2896
+ * challenge's own institution/serie when omitted.
2897
+ *
2898
+ * Status values: `novo` (not started), `andamento` (started a step, no
2899
+ * submission), `entregue` (submitted | ai_evaluated), `aprovado`
2900
+ * (approved), `rejeitado` (rejected).
2901
+ */
2902
+ get: {
2903
+ parameters: {
2904
+ query?: {
2905
+ /** @description Viewing institution. Defaults to the challenge's institution. */
2906
+ institutionId?: string;
2907
+ /** @description Serie filter. Defaults to the challenge's serie. */
2908
+ serieId?: string;
2909
+ };
2910
+ header?: never;
2911
+ path: {
2912
+ /** @description Resource ID */
2913
+ id: components["parameters"]["id"];
2914
+ };
2915
+ cookie?: never;
2916
+ };
2917
+ requestBody?: never;
2918
+ responses: {
2919
+ /** @description Roster of participants with derived status */
2920
+ 200: {
2921
+ headers: {
2922
+ [name: string]: unknown;
2923
+ };
2924
+ content: {
2925
+ "application/json": {
2926
+ /** @example success */
2927
+ status?: string;
2928
+ data?: {
2929
+ totalStudents?: number;
2930
+ classrooms?: {
2931
+ /** Format: uuid */
2932
+ id?: string;
2933
+ name?: string;
2934
+ count?: number;
2935
+ }[];
2936
+ participants?: {
2937
+ /** Format: uuid */
2938
+ userId?: string;
2939
+ name?: string;
2940
+ email?: string | null;
2941
+ avatarUrl?: string | null;
2942
+ /** Format: uuid */
2943
+ classroomId?: string | null;
2944
+ classroomName?: string | null;
2945
+ /** @enum {string} */
2946
+ status?: "novo" | "andamento" | "entregue" | "aprovado" | "rejeitado";
2947
+ /** Format: uuid */
2948
+ submissionId?: string | null;
2949
+ }[];
2950
+ };
2951
+ };
2952
+ };
2953
+ };
2954
+ 401: components["responses"]["Unauthorized"];
2955
+ 404: components["responses"]["NotFound"];
2956
+ };
2957
+ };
2958
+ put?: never;
2959
+ post?: never;
2960
+ delete?: never;
2961
+ options?: never;
2962
+ head?: never;
2963
+ patch?: never;
2964
+ trace?: never;
2965
+ };
2878
2966
  "/classrooms": {
2879
2967
  parameters: {
2880
2968
  query?: never;
@@ -9643,6 +9731,67 @@ export interface paths {
9643
9731
  patch?: never;
9644
9732
  trace?: never;
9645
9733
  };
9734
+ "/quiz-questions/bulk": {
9735
+ parameters: {
9736
+ query?: never;
9737
+ header?: never;
9738
+ path?: never;
9739
+ cookie?: never;
9740
+ };
9741
+ get?: never;
9742
+ put?: never;
9743
+ /**
9744
+ * Bulk create quiz questions
9745
+ * @description Cria várias perguntas (com respostas) de uma vez para um quiz.
9746
+ */
9747
+ post: {
9748
+ parameters: {
9749
+ query?: never;
9750
+ header?: never;
9751
+ path?: never;
9752
+ cookie?: never;
9753
+ };
9754
+ requestBody: {
9755
+ content: {
9756
+ "application/json": {
9757
+ quizId: string;
9758
+ questions: {
9759
+ text: string;
9760
+ type: "multiple_choice" | "true_false" | "open";
9761
+ points?: number;
9762
+ options?: {
9763
+ text: string;
9764
+ is_correct: boolean;
9765
+ }[];
9766
+ }[];
9767
+ };
9768
+ };
9769
+ };
9770
+ responses: {
9771
+ /** @description Questions created */
9772
+ 201: {
9773
+ headers: {
9774
+ [name: string]: unknown;
9775
+ };
9776
+ content: {
9777
+ "application/json": {
9778
+ /** @example success */
9779
+ status?: string;
9780
+ data?: components["schemas"]["QuizQuestion"][];
9781
+ };
9782
+ };
9783
+ };
9784
+ 400: components["responses"]["BadRequest"];
9785
+ 401: components["responses"]["Unauthorized"];
9786
+ 500: components["responses"]["ServerError"];
9787
+ };
9788
+ };
9789
+ delete?: never;
9790
+ options?: never;
9791
+ head?: never;
9792
+ patch?: never;
9793
+ trace?: never;
9794
+ };
9646
9795
  "/quiz-questions/{id}": {
9647
9796
  parameters: {
9648
9797
  query?: never;
@@ -9855,6 +10004,145 @@ export interface paths {
9855
10004
  patch?: never;
9856
10005
  trace?: never;
9857
10006
  };
10007
+ "/quiz/with-context": {
10008
+ parameters: {
10009
+ query?: never;
10010
+ header?: never;
10011
+ path?: never;
10012
+ cookie?: never;
10013
+ };
10014
+ /**
10015
+ * List quizzes with course/module/category context
10016
+ * @description Retrieve a paginated list of quizzes, each enriched with the course, module and category it belongs to. `context` is null for standalone quizzes.
10017
+ */
10018
+ get: {
10019
+ parameters: {
10020
+ query?: {
10021
+ /** @description Filter by quiz title */
10022
+ title?: string;
10023
+ /** @description Filter by active status */
10024
+ isActive?: boolean;
10025
+ /** @description Filter by creator user ID */
10026
+ createdBy?: string;
10027
+ /** @description Search in title */
10028
+ search?: string;
10029
+ /** @description Page number */
10030
+ page?: number;
10031
+ /** @description Items per page */
10032
+ limit?: number;
10033
+ };
10034
+ header?: never;
10035
+ path?: never;
10036
+ cookie?: never;
10037
+ };
10038
+ requestBody?: never;
10039
+ responses: {
10040
+ /** @description List of quizzes with context */
10041
+ 200: {
10042
+ headers: {
10043
+ [name: string]: unknown;
10044
+ };
10045
+ content: {
10046
+ "application/json": {
10047
+ /** @example success */
10048
+ status?: string;
10049
+ data?: (components["schemas"]["Quiz"] & {
10050
+ context?: {
10051
+ course?: {
10052
+ id?: string;
10053
+ title?: string;
10054
+ } | null;
10055
+ module?: {
10056
+ id?: string;
10057
+ title?: string;
10058
+ } | null;
10059
+ category?: {
10060
+ id?: string;
10061
+ name?: string;
10062
+ color?: string | null;
10063
+ } | null;
10064
+ } | null;
10065
+ })[];
10066
+ meta?: components["schemas"]["PaginationMeta"];
10067
+ };
10068
+ };
10069
+ };
10070
+ 401: components["responses"]["Unauthorized"];
10071
+ 500: components["responses"]["ServerError"];
10072
+ };
10073
+ };
10074
+ put?: never;
10075
+ post?: never;
10076
+ delete?: never;
10077
+ options?: never;
10078
+ head?: never;
10079
+ patch?: never;
10080
+ trace?: never;
10081
+ };
10082
+ "/quiz/generate-questions": {
10083
+ parameters: {
10084
+ query?: never;
10085
+ header?: never;
10086
+ path?: never;
10087
+ cookie?: never;
10088
+ };
10089
+ get?: never;
10090
+ put?: never;
10091
+ /**
10092
+ * Generate quiz questions with AI
10093
+ * @description Gera perguntas a partir de um texto base via IA. Não persiste — apenas devolve.
10094
+ */
10095
+ post: {
10096
+ parameters: {
10097
+ query?: never;
10098
+ header?: never;
10099
+ path?: never;
10100
+ cookie?: never;
10101
+ };
10102
+ requestBody: {
10103
+ content: {
10104
+ "application/json": {
10105
+ text: string;
10106
+ numQuestions: number;
10107
+ difficulty?: "facil" | "normal" | "dificil";
10108
+ existingQuestions?: string[];
10109
+ model?: string;
10110
+ };
10111
+ };
10112
+ };
10113
+ responses: {
10114
+ /** @description Generated questions */
10115
+ 200: {
10116
+ headers: {
10117
+ [name: string]: unknown;
10118
+ };
10119
+ content: {
10120
+ "application/json": {
10121
+ /** @example success */
10122
+ status?: string;
10123
+ data?: {
10124
+ question_text: string;
10125
+ question_type: "multiple_choice" | "true_false";
10126
+ points: number;
10127
+ options: {
10128
+ text: string;
10129
+ is_correct: boolean;
10130
+ }[];
10131
+ }[];
10132
+ };
10133
+ };
10134
+ };
10135
+ 400: components["responses"]["BadRequest"];
10136
+ 401: components["responses"]["Unauthorized"];
10137
+ 500: components["responses"]["ServerError"];
10138
+ };
10139
+ };
10140
+ delete?: never;
10141
+ options?: never;
10142
+ head?: never;
10143
+ patch?: never;
10144
+ trace?: never;
10145
+ };
9858
10146
  "/quiz/{id}": {
9859
10147
  parameters: {
9860
10148
  query?: never;
@@ -11822,6 +12110,12 @@ export interface paths {
11822
12110
  * - Cannot create after status=approved
11823
12111
  * - Cannot exceed challenge.maxSubmissionsAttempts
11824
12112
  * - attempt_number is computed server-side with a row lock (FOR UPDATE)
12113
+ *
12114
+ * When `items` is provided, the submission and its files/links are persisted
12115
+ * in the SAME transaction (atomic) and AI evaluation is dispatched after commit.
12116
+ * Each item must have exactly ONE of fileId or url, and must match the
12117
+ * challenge.submissionType (file types require fileId; links require url).
12118
+ * This is the preferred path for clients (no separate POST /submissions/{id}/files).
11825
12119
  */
11826
12120
  post: {
11827
12121
  parameters: {
@@ -11846,6 +12140,17 @@ export interface paths {
11846
12140
  */
11847
12141
  groupId?: string;
11848
12142
  description?: string;
12143
+ /**
12144
+ * @description Submission delivery. When present, files/links are stored atomically
12145
+ * with the submission and AI evaluation is dispatched after commit.
12146
+ */
12147
+ items?: {
12148
+ /** Format: uuid */
12149
+ fileId?: string | null;
12150
+ /** Format: uri */
12151
+ url?: string | null;
12152
+ index?: number;
12153
+ }[];
11849
12154
  };
11850
12155
  };
11851
12156
  };
@@ -11860,6 +12165,45 @@ export interface paths {
11860
12165
  /** @example success */
11861
12166
  status?: string;
11862
12167
  data?: components["schemas"]["Submission"];
12168
+ /**
12169
+ * @description Journey side-effects of the submission. On the FIRST attempt the
12170
+ * publication step is completed and the user advances; `advance`
12171
+ * carries the resulting tick so the client can animate the journey.
12172
+ * `advance` is null on re-submissions (attempt > 1) or if the advance
12173
+ * step failed (non-fatal — the submission is still created).
12174
+ */
12175
+ meta?: {
12176
+ advance?: {
12177
+ /** @enum {string} */
12178
+ action?: "started" | "completed" | "finished";
12179
+ /** Format: uuid */
12180
+ challengeId?: string;
12181
+ currentStep?: {
12182
+ /** Format: uuid */
12183
+ id?: string;
12184
+ index?: number;
12185
+ name?: string;
12186
+ /** Format: date-time */
12187
+ startedAt?: string | null;
12188
+ /** Format: date-time */
12189
+ completedAt?: string | null;
12190
+ } | null;
12191
+ nextStep?: {
12192
+ /** Format: uuid */
12193
+ id?: string;
12194
+ index?: number;
12195
+ name?: string;
12196
+ /** Format: date-time */
12197
+ startedAt?: string | null;
12198
+ } | null;
12199
+ autoCompletedSteps?: {
12200
+ /** Format: uuid */
12201
+ id?: string;
12202
+ index?: number;
12203
+ name?: string;
12204
+ }[];
12205
+ } | null;
12206
+ };
11863
12207
  };
11864
12208
  };
11865
12209
  };
@@ -11923,6 +12267,79 @@ export interface paths {
11923
12267
  patch?: never;
11924
12268
  trace?: never;
11925
12269
  };
12270
+ "/submissions/{id}/classroom-rank": {
12271
+ parameters: {
12272
+ query?: never;
12273
+ header?: never;
12274
+ path?: never;
12275
+ cookie?: never;
12276
+ };
12277
+ /**
12278
+ * Ordem de entrega do aluno na turma para o desafio desta submissão
12279
+ * @description Retorna a posição do aluno entre os colegas de turma (institution_classroom
12280
+ * via membership) a entregar o desafio, ordenando pela PRIMEIRA entrega de cada
12281
+ * aluno (MIN(submitted_at)). Usado pelo app do aluno como incentivo a entregar
12282
+ * cedo ("Você foi o Nº de X da turma a entregar"). Quando o aluno não tem turma
12283
+ * na instituição, retorna order=0 e classSize=0 e o cliente esconde o card.
12284
+ */
12285
+ get: {
12286
+ parameters: {
12287
+ query?: never;
12288
+ header?: never;
12289
+ path: {
12290
+ /** @description Resource ID */
12291
+ id: components["parameters"]["id"];
12292
+ };
12293
+ cookie?: never;
12294
+ };
12295
+ requestBody?: never;
12296
+ responses: {
12297
+ /** @description Posição na turma */
12298
+ 200: {
12299
+ headers: {
12300
+ [name: string]: unknown;
12301
+ };
12302
+ content: {
12303
+ "application/json": {
12304
+ /** @example success */
12305
+ status?: string;
12306
+ data?: {
12307
+ /**
12308
+ * @description Posição do aluno (1-based) entre os que entregaram; 0 quando sem turma
12309
+ * @example 3
12310
+ */
12311
+ order?: number;
12312
+ /**
12313
+ * @description Total de alunos da turma (independente de terem entregado)
12314
+ * @example 28
12315
+ */
12316
+ classSize?: number;
12317
+ /**
12318
+ * @description Quantos alunos da turma já entregaram o desafio
12319
+ * @example 12
12320
+ */
12321
+ submittedCount?: number;
12322
+ /**
12323
+ * @description true quando order está entre 1 e 3
12324
+ * @example true
12325
+ */
12326
+ earlyBird?: boolean;
12327
+ };
12328
+ };
12329
+ };
12330
+ };
12331
+ 401: components["responses"]["Unauthorized"];
12332
+ 404: components["responses"]["NotFound"];
12333
+ };
12334
+ };
12335
+ put?: never;
12336
+ post?: never;
12337
+ delete?: never;
12338
+ options?: never;
12339
+ head?: never;
12340
+ patch?: never;
12341
+ trace?: never;
12342
+ };
11926
12343
  "/submissions/{id}/files": {
11927
12344
  parameters: {
11928
12345
  query?: never;
@@ -12504,6 +12921,12 @@ export interface paths {
12504
12921
  * Útil para pré-visualização administrativa ou quando o aluno pertence a múltiplas séries.
12505
12922
  */
12506
12923
  serieId?: string;
12924
+ /**
12925
+ * @description Escola atual (contexto de instituição do app). Opcional — se omitido, usa a 1ª
12926
+ * matrícula. A jornada é por escola: filtra os challenges e resolve a turma/série
12927
+ * default a partir da membership do usuário NESTA instituição.
12928
+ */
12929
+ institutionId?: string;
12507
12930
  /**
12508
12931
  * @description [Admin] Quando presente, retorna a jornada do usuário-alvo em vez da do
12509
12932
  * autenticado. Usado pelo backoffice para visualizar a jornada de um aluno.
@@ -13401,6 +13824,97 @@ export interface paths {
13401
13824
  patch?: never;
13402
13825
  trace?: never;
13403
13826
  };
13827
+ "/users/me/classrooms": {
13828
+ parameters: {
13829
+ query?: never;
13830
+ header?: never;
13831
+ path?: never;
13832
+ cookie?: never;
13833
+ };
13834
+ /**
13835
+ * Turmas e séries do usuário autenticado
13836
+ * @description Contexto de matrícula do aluno: TODAS as suas turmas (com série, turno e
13837
+ * instituição), a escola ATUAL e a lista DEDUPLICADA de séries dessa escola.
13838
+ *
13839
+ * Fonte única para o app: `classrooms` alimenta a listagem de turmas no
13840
+ * perfil; `currentInstitutionId` é a escola atual (o app mostra uma escola
13841
+ * por vez); `series` traz APENAS as séries da escola atual (deduplicada e
13842
+ * ordenada por nível/valor) — alimenta o seletor da jornada, que também é
13843
+ * por escola. O botão só aparece com 2+ séries na escola atual.
13844
+ */
13845
+ get: {
13846
+ parameters: {
13847
+ query?: never;
13848
+ header?: never;
13849
+ path?: never;
13850
+ cookie?: never;
13851
+ };
13852
+ requestBody?: never;
13853
+ responses: {
13854
+ /** @description Turmas + séries acessíveis */
13855
+ 200: {
13856
+ headers: {
13857
+ [name: string]: unknown;
13858
+ };
13859
+ content: {
13860
+ "application/json": {
13861
+ /** @example success */
13862
+ status?: string;
13863
+ data?: {
13864
+ /**
13865
+ * Format: uuid
13866
+ * @description Escola atual (a da matrícula). As séries são desta escola.
13867
+ */
13868
+ currentInstitutionId?: string | null;
13869
+ classrooms?: {
13870
+ /** Format: uuid */
13871
+ institutionClassroomId?: string;
13872
+ /** Format: uuid */
13873
+ classroomId?: string;
13874
+ /** @example 6º A */
13875
+ classroomName?: string;
13876
+ /** @example manhã */
13877
+ shiftName?: string | null;
13878
+ /** Format: uuid */
13879
+ institutionId?: string;
13880
+ /** @example Escola Modelo */
13881
+ institutionName?: string | null;
13882
+ serie?: {
13883
+ /** Format: uuid */
13884
+ serieId?: string;
13885
+ /** @example 6 */
13886
+ serieValue?: number;
13887
+ /** @example 6º ANO */
13888
+ serieLabel?: string;
13889
+ /** @enum {string} */
13890
+ level?: "fundamental" | "medio";
13891
+ } | null;
13892
+ }[];
13893
+ series?: {
13894
+ /** Format: uuid */
13895
+ serieId?: string;
13896
+ /** @example 6 */
13897
+ serieValue?: number;
13898
+ /** @example 6º ANO */
13899
+ serieLabel?: string;
13900
+ /** @enum {string} */
13901
+ level?: "fundamental" | "medio";
13902
+ }[];
13903
+ };
13904
+ };
13905
+ };
13906
+ };
13907
+ 401: components["responses"]["Unauthorized"];
13908
+ };
13909
+ };
13910
+ put?: never;
13911
+ post?: never;
13912
+ delete?: never;
13913
+ options?: never;
13914
+ head?: never;
13915
+ patch?: never;
13916
+ trace?: never;
13917
+ };
13404
13918
  "/users/me/push-tokens": {
13405
13919
  parameters: {
13406
13920
  query?: never;
@@ -15013,6 +15527,8 @@ export interface components {
15013
15527
  certificateTemplate?: components["schemas"]["CertificateTemplate"];
15014
15528
  /** @description Course information related to the certificate (extracted from Quiz or CertificateTemplate) */
15015
15529
  course?: components["schemas"]["CourseSimplified"];
15530
+ /** @description Course module information related to the certificate (resolved from the quiz the student took). Null when the certificate came from a template course. */
15531
+ module?: components["schemas"]["ModuleSimplified"];
15016
15532
  };
15017
15533
  /** @description Simplified course information included in certificate responses */
15018
15534
  CourseSimplified: {
@@ -15032,6 +15548,26 @@ export interface components {
15032
15548
  */
15033
15549
  description?: string | null;
15034
15550
  };
15551
+ /** @description Simplified course module information included in certificate responses */
15552
+ ModuleSimplified: {
15553
+ /**
15554
+ * Format: uuid
15555
+ * @description Course module ID
15556
+ */
15557
+ id?: string;
15558
+ /**
15559
+ * @description Course module title
15560
+ * @example Variables and Data Types
15561
+ */
15562
+ title?: string;
15563
+ /** @description Course module description */
15564
+ description?: string | null;
15565
+ /**
15566
+ * @description Course module workload in hours
15567
+ * @example 40
15568
+ */
15569
+ duration?: number | null;
15570
+ };
15035
15571
  /** @description Simplified quiz information included in course and module responses */
15036
15572
  QuizSimplified: {
15037
15573
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "academe-kit",
3
- "version": "0.11.5",
3
+ "version": "0.11.7",
4
4
  "type": "module",
5
5
  "description": "Official React SDK for Academe ecosystem - Authentication, protected routes, API services, and UI components for educational management applications",
6
6
  "main": "dist/index.cjs",