academe-kit 0.10.2 → 0.11.0

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.
@@ -17,6 +17,7 @@ export type { AcademeKeycloakContextProps, SecurityProviderProps, KeycloakUser,
17
17
  export { createAcademeApiClient } from "./services";
18
18
  export type { AcademeApiClient, AcademeServices } from "./services";
19
19
  export type { ChallengeUserQuizAttempt, ChallengeUserQuizAttemptsResponse, } from "./services/ChallengeService";
20
+ export type { JourneyStepView, JourneyChallengeView, JourneyView, } from "./services/UserProgressService";
20
21
  export { cn } from "./lib/utils";
21
22
  import "./index.css";
22
23
  import "./styles/globals.css";
@@ -23,7 +23,6 @@ export declare function createSubmissionService(apiClient: AcademeApiClient): {
23
23
  serieId?: string;
24
24
  status?: "submitted" | "ai_evaluated" | "approved" | "rejected";
25
25
  search?: string;
26
- periodId?: string;
27
26
  page?: import("../types/academe-api").components["parameters"]["page"];
28
27
  limit?: import("../types/academe-api").components["parameters"]["limit"];
29
28
  };
@@ -40,13 +39,7 @@ export declare function createSubmissionService(apiClient: AcademeApiClient): {
40
39
  content: {
41
40
  "application/json": {
42
41
  status?: string;
43
- data?: (import("../types/academe-api").components["schemas"]["Submission"] & {
44
- period?: {
45
- id?: string;
46
- index?: number;
47
- label?: string;
48
- } | null;
49
- })[];
42
+ data?: import("../types/academe-api").components["schemas"]["Submission"][];
50
43
  meta?: import("../types/academe-api").components["schemas"]["PaginationMeta"] & {
51
44
  statusCounts?: {
52
45
  submitted?: number;
@@ -54,12 +47,6 @@ export declare function createSubmissionService(apiClient: AcademeApiClient): {
54
47
  approved?: number;
55
48
  rejected?: number;
56
49
  };
57
- periods?: {
58
- id?: string;
59
- index?: number;
60
- label?: string;
61
- isCurrent?: boolean;
62
- }[];
63
50
  };
64
51
  };
65
52
  };
@@ -77,7 +64,6 @@ export declare function createSubmissionService(apiClient: AcademeApiClient): {
77
64
  serieId?: string;
78
65
  status?: "submitted" | "ai_evaluated" | "approved" | "rejected";
79
66
  search?: string;
80
- periodId?: string;
81
67
  page?: import("../types/academe-api").components["parameters"]["page"];
82
68
  limit?: import("../types/academe-api").components["parameters"]["limit"];
83
69
  } | undefined;
@@ -12,8 +12,12 @@ export declare function createUserProgressService(apiClient: AcademeApiClient):
12
12
  /**
13
13
  * Jornada pré-computada do usuário (status, progress, color, icon,
14
14
  * isUpcoming, série) — base de renderização direta da tela de jornada.
15
+ *
16
+ * `userId` é [Admin]: quando informado, retorna a jornada do usuário-alvo
17
+ * (ex.: backoffice visualizando a jornada de um aluno); omitido = jornada
18
+ * do próprio usuário autenticado.
15
19
  */
16
- getJourney(serieId?: string): Promise<JourneyView>;
20
+ getJourney(serieId?: string, userId?: string): Promise<JourneyView>;
17
21
  /**
18
22
  * Visão step-by-step do progresso do usuário em um desafio. Cada step traz
19
23
  * `myStartedAt`, `myCompletedAt` e (em desafios em grupo) os agregados do
@@ -235,5 +239,66 @@ export declare function createUserProgressService(apiClient: AcademeApiClient):
235
239
  };
236
240
  };
237
241
  }, `${string}/${string}`>>;
242
+ /**
243
+ * [Admin] Conclui de uma vez TODAS as etapas ativas de um desafio para um
244
+ * usuário-alvo, criando a linha de progresso quando não existir. Idempotente
245
+ * — etapas já concluídas não são alteradas.
246
+ *
247
+ * Diferente de `advance` (que avança um tick por vez para o usuário
248
+ * autenticado), aqui o desafio inteiro é concluído de uma vez para o usuário
249
+ * identificado no path. Em desafios em grupo, apenas o progresso do
250
+ * usuário-alvo é concluído; os demais membros não são afetados.
251
+ */
252
+ completeAllForUser(challengeId: string, userId: string): Promise<import("openapi-fetch").FetchResponse<{
253
+ parameters: {
254
+ query?: never;
255
+ header?: never;
256
+ path: {
257
+ id: string;
258
+ userId: string;
259
+ };
260
+ cookie?: never;
261
+ };
262
+ requestBody?: never;
263
+ responses: {
264
+ 200: {
265
+ headers: {
266
+ [name: string]: unknown;
267
+ };
268
+ content: {
269
+ "application/json": {
270
+ status?: string;
271
+ data?: {
272
+ challengeId?: string;
273
+ userId?: string;
274
+ total?: number;
275
+ completedSteps?: {
276
+ id?: string;
277
+ index?: number;
278
+ name?: string;
279
+ completedAt?: string | null;
280
+ }[];
281
+ };
282
+ };
283
+ };
284
+ };
285
+ 401: components["responses"]["Unauthorized"];
286
+ 404: {
287
+ headers: {
288
+ [name: string]: unknown;
289
+ };
290
+ content: {
291
+ "application/json": components["schemas"]["Error"];
292
+ };
293
+ };
294
+ };
295
+ }, {
296
+ params: {
297
+ path: {
298
+ id: string;
299
+ userId: string;
300
+ };
301
+ };
302
+ }, `${string}/${string}`>>;
238
303
  };
239
304
  export type UserProgressService = ReturnType<typeof createUserProgressService>;
@@ -10719,7 +10719,7 @@ export interface paths {
10719
10719
  get: {
10720
10720
  parameters: {
10721
10721
  query?: {
10722
- /** @description UUID do educational_model_period, OU a string literal `"all"` para considerar todos os bimestres. Omitido = corrente. */
10722
+ /** @description UUID do educational_model_period, OU a string literal `"all"` para considerar todos os bimestres do ano letivo. Omitido = corrente. */
10723
10723
  periodId?: string;
10724
10724
  /** @description Quando presente, restringe o cálculo a UM challenge específico dentro do recorte temporal. */
10725
10725
  challengeId?: string;
@@ -10746,18 +10746,21 @@ export interface paths {
10746
10746
  };
10747
10747
  };
10748
10748
  };
10749
+ /** @description institutionId inválido ou querystring inválida */
10749
10750
  400: {
10750
10751
  headers: {
10751
10752
  [name: string]: unknown;
10752
10753
  };
10753
10754
  content?: never;
10754
10755
  };
10756
+ /** @description Não autenticado */
10755
10757
  401: {
10756
10758
  headers: {
10757
10759
  [name: string]: unknown;
10758
10760
  };
10759
10761
  content?: never;
10760
10762
  };
10763
+ /** @description Erro interno */
10761
10764
  500: {
10762
10765
  headers: {
10763
10766
  [name: string]: unknown;
@@ -11758,13 +11761,13 @@ export interface paths {
11758
11761
  userId?: string;
11759
11762
  groupId?: string;
11760
11763
  institutionId?: string;
11764
+ /** @description Filtra por turma (institution_classroom) do aluno na instituição */
11761
11765
  institutionClassroomId?: string;
11766
+ /** @description Filtra por série (serie) da turma do aluno na instituição */
11762
11767
  serieId?: string;
11763
11768
  status?: "submitted" | "ai_evaluated" | "approved" | "rejected";
11764
- /** @description Busca por nome ou e-mail do aluno */
11769
+ /** @description Busca por nome ou e-mail do aluno (submissão) */
11765
11770
  search?: string;
11766
- /** @description UUID de um educational_model_period. Recorta as submissões cuja data de envio (submittedAt) cai no intervalo [start, end] do período. Omitido = todos os períodos. */
11767
- periodId?: string;
11768
11771
  /** @description Page number */
11769
11772
  page?: components["parameters"]["page"];
11770
11773
  /** @description Items per page */
@@ -11785,16 +11788,7 @@ export interface paths {
11785
11788
  "application/json": {
11786
11789
  /** @example success */
11787
11790
  status?: string;
11788
- data?: (components["schemas"]["Submission"] & {
11789
- /** @description Período letivo cujo intervalo contém a data de envio (submittedAt). Null quando a escola não tem períodos ou o envio caiu fora de qualquer período. */
11790
- period?: {
11791
- id?: string;
11792
- /** @description 0-based (0 = 1º período) */
11793
- index?: number;
11794
- /** @example 1º Bimestre */
11795
- label?: string;
11796
- } | null;
11797
- })[];
11791
+ data?: components["schemas"]["Submission"][];
11798
11792
  meta?: components["schemas"]["PaginationMeta"] & {
11799
11793
  /**
11800
11794
  * @description Contagem por status, ignorando o filtro `status`. Útil para
@@ -11810,14 +11804,6 @@ export interface paths {
11810
11804
  /** @example 2 */
11811
11805
  rejected?: number;
11812
11806
  };
11813
- /** @description Períodos letivos da escola (ORDER BY start ASC) para o dropdown de filtro. */
11814
- periods?: {
11815
- id?: string;
11816
- index?: number;
11817
- /** @example 1º Bimestre */
11818
- label?: string;
11819
- isCurrent?: boolean;
11820
- }[];
11821
11807
  };
11822
11808
  };
11823
11809
  };
@@ -12518,6 +12504,11 @@ export interface paths {
12518
12504
  * Útil para pré-visualização administrativa ou quando o aluno pertence a múltiplas séries.
12519
12505
  */
12520
12506
  serieId?: string;
12507
+ /**
12508
+ * @description [Admin] Quando presente, retorna a jornada do usuário-alvo em vez da do
12509
+ * autenticado. Usado pelo backoffice para visualizar a jornada de um aluno.
12510
+ */
12511
+ userId?: string;
12521
12512
  };
12522
12513
  header?: never;
12523
12514
  path?: never;
@@ -12909,6 +12900,86 @@ export interface paths {
12909
12900
  patch?: never;
12910
12901
  trace?: never;
12911
12902
  };
12903
+ "/user-challenge-progress/challenges/{id}/users/{userId}/complete-all": {
12904
+ parameters: {
12905
+ query?: never;
12906
+ header?: never;
12907
+ path?: never;
12908
+ cookie?: never;
12909
+ };
12910
+ get?: never;
12911
+ put?: never;
12912
+ /**
12913
+ * [Admin] Force-complete ALL steps of a challenge for a target user
12914
+ * @description Marks every active step (challenges_steps) of the challenge as completed for the
12915
+ * given target user, creating the user_challenge_progress row when it does not exist.
12916
+ * Idempotent: steps already completed are left untouched.
12917
+ *
12918
+ * Unlike POST /challenges/{id}/advance (which advances one tick at a time for the
12919
+ * authenticated user), this endpoint completes the whole challenge at once for the
12920
+ * user identified in the path. For group challenges, only the target user's progress
12921
+ * is completed — other group members are not affected.
12922
+ */
12923
+ post: {
12924
+ parameters: {
12925
+ query?: never;
12926
+ header?: never;
12927
+ path: {
12928
+ /** @description ID of the challenge */
12929
+ id: string;
12930
+ /** @description ID of the target user whose progress will be completed */
12931
+ userId: string;
12932
+ };
12933
+ cookie?: never;
12934
+ };
12935
+ requestBody?: never;
12936
+ responses: {
12937
+ /** @description All steps completed for the target user */
12938
+ 200: {
12939
+ headers: {
12940
+ [name: string]: unknown;
12941
+ };
12942
+ content: {
12943
+ "application/json": {
12944
+ /** @example success */
12945
+ status?: string;
12946
+ data?: {
12947
+ /** Format: uuid */
12948
+ challengeId?: string;
12949
+ /** Format: uuid */
12950
+ userId?: string;
12951
+ /** @description Number of active steps in the challenge */
12952
+ total?: number;
12953
+ completedSteps?: {
12954
+ /** Format: uuid */
12955
+ id?: string;
12956
+ index?: number;
12957
+ name?: string;
12958
+ /** Format: date-time */
12959
+ completedAt?: string | null;
12960
+ }[];
12961
+ };
12962
+ };
12963
+ };
12964
+ };
12965
+ 401: components["responses"]["Unauthorized"];
12966
+ /** @description Challenge not found or has no active steps */
12967
+ 404: {
12968
+ headers: {
12969
+ [name: string]: unknown;
12970
+ };
12971
+ content: {
12972
+ "application/json": components["schemas"]["Error"];
12973
+ };
12974
+ };
12975
+ };
12976
+ };
12977
+ delete?: never;
12978
+ options?: never;
12979
+ head?: never;
12980
+ patch?: never;
12981
+ trace?: never;
12982
+ };
12912
12983
  "/user-creation-requests": {
12913
12984
  parameters: {
12914
12985
  query?: never;
@@ -14754,10 +14825,10 @@ export interface components {
14754
14825
  maxStudents: number;
14755
14826
  /** @example true */
14756
14827
  isActive: boolean;
14757
- /** Format: uri */
14758
- logoUrl?: string | null;
14759
- /** Format: uri */
14760
- capaUrl?: string | null;
14828
+ /** Format: uuid */
14829
+ logoFileId?: string | null;
14830
+ /** Format: uuid */
14831
+ capaFileId?: string | null;
14761
14832
  /** Format: uuid */
14762
14833
  addressId?: string | null;
14763
14834
  /** Format: uuid */
@@ -14766,8 +14837,8 @@ export interface components {
14766
14837
  createdAt: string;
14767
14838
  /** Format: date-time */
14768
14839
  updatedAt: string;
14769
- organization?: components["schemas"]["Organization"] | null;
14770
- address?: components["schemas"]["Address"] | null;
14840
+ organization?: components["schemas"]["Organization"];
14841
+ address?: components["schemas"]["Address"];
14771
14842
  institutionReward?: Record<string, never> | null;
14772
14843
  };
14773
14844
  Organization: {
@@ -16568,30 +16639,6 @@ export interface components {
16568
16639
  /** @description Última submissão por (aluno, challenge do bimestre corrente) ainda SEM teacher_score */
16569
16640
  awaitingTeacher?: number;
16570
16641
  };
16571
- StudentsJourneyStatusSummary: {
16572
- /** @description Alunos sem step concluído nos challenges do recorte */
16573
- notStarted?: number;
16574
- /** @description Tem step concluído mas sem submissão */
16575
- inJourney?: number;
16576
- /** @description Submissão pendente de avaliação (teacher_score nulo) */
16577
- inReview?: number;
16578
- /** @description Submissão já avaliada (teacher_score preenchido) */
16579
- completed?: number;
16580
- };
16581
- StudentsJourneyStatusScope: {
16582
- /** @description UUID do bimestre alvo; null quando allPeriods */
16583
- periodId?: string | null;
16584
- /** @description UUID do challenge alvo; null quando todos do recorte */
16585
- challengeId?: string | null;
16586
- /** @description Quantidade de challenges no recorte */
16587
- challengesCount?: number;
16588
- /** @description Total de alunos ativos da escola — fecha com a soma dos 4 status */
16589
- totalStudents?: number;
16590
- };
16591
- StudentsJourneyStatusResponse: {
16592
- summary?: components["schemas"]["StudentsJourneyStatusSummary"];
16593
- scope?: components["schemas"]["StudentsJourneyStatusScope"];
16594
- };
16595
16642
  EncourageClassPerformance: {
16596
16643
  /** Format: uuid */
16597
16644
  classroomId?: string;
@@ -16641,6 +16688,36 @@ export interface components {
16641
16688
  topStudents?: components["schemas"]["EncourageTopStudent"][];
16642
16689
  topTeachers?: components["schemas"]["EncourageTopTeacher"][];
16643
16690
  };
16691
+ StudentsJourneyStatusSummary: {
16692
+ /** @description Alunos sem step concluído nos challenges do recorte */
16693
+ notStarted?: number;
16694
+ /** @description Tem step concluído mas sem submissão */
16695
+ inJourney?: number;
16696
+ /** @description Submissão pendente de avaliação (teacher_score nulo) */
16697
+ inReview?: number;
16698
+ /** @description Submissão já avaliada (teacher_score preenchido) */
16699
+ completed?: number;
16700
+ };
16701
+ StudentsJourneyStatusScope: {
16702
+ /**
16703
+ * Format: uuid
16704
+ * @description UUID do bimestre alvo; null quando allPeriods
16705
+ */
16706
+ periodId?: string | null;
16707
+ /**
16708
+ * Format: uuid
16709
+ * @description UUID do challenge alvo; null quando todos do recorte
16710
+ */
16711
+ challengeId?: string | null;
16712
+ /** @description Quantidade de challenges no recorte */
16713
+ challengesCount?: number;
16714
+ /** @description Total de alunos ativos da escola — fecha com a soma dos 4 status */
16715
+ totalStudents?: number;
16716
+ };
16717
+ StudentsJourneyStatusResponse: {
16718
+ summary?: components["schemas"]["StudentsJourneyStatusSummary"];
16719
+ scope?: components["schemas"]["StudentsJourneyStatusScope"];
16720
+ };
16644
16721
  UserCreationRequest: {
16645
16722
  /**
16646
16723
  * Format: uuid
@@ -16715,15 +16792,15 @@ export interface components {
16715
16792
  */
16716
16793
  isActive: boolean;
16717
16794
  /**
16718
- * Format: uri
16719
- * @example https://example.com/logo.png
16795
+ * Format: uuid
16796
+ * @description ID do storage_file usado como logo
16720
16797
  */
16721
- logoUrl?: string;
16798
+ logoFileId?: string;
16722
16799
  /**
16723
- * Format: uri
16724
- * @example https://example.com/capa.png
16800
+ * Format: uuid
16801
+ * @description ID do storage_file usado como capa/banner
16725
16802
  */
16726
- capaUrl?: string;
16803
+ capaFileId?: string;
16727
16804
  /** Format: uuid */
16728
16805
  addressId?: string;
16729
16806
  /** Format: uuid */
@@ -16748,15 +16825,15 @@ export interface components {
16748
16825
  /** @example true */
16749
16826
  isActive?: boolean;
16750
16827
  /**
16751
- * Format: uri
16752
- * @example https://example.com/logo.png
16828
+ * Format: uuid
16829
+ * @description ID do storage_file usado como logo
16753
16830
  */
16754
- logoUrl?: string;
16831
+ logoFileId?: string;
16755
16832
  /**
16756
- * Format: uri
16757
- * @example https://example.com/capa.png
16833
+ * Format: uuid
16834
+ * @description ID do storage_file usado como capa/banner
16758
16835
  */
16759
- capaUrl?: string;
16836
+ capaFileId?: string;
16760
16837
  /** Format: uuid */
16761
16838
  addressId?: string;
16762
16839
  /** Format: uuid */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "academe-kit",
3
- "version": "0.10.2",
3
+ "version": "0.11.0",
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",