academe-kit 0.12.1 → 0.13.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.
package/dist/index.d.ts CHANGED
@@ -2503,7 +2503,6 @@ interface paths {
2503
2503
  * Add a step to the challenge
2504
2504
  * @description Polymorphic validation:
2505
2505
  * - When step.type=tutorial, tutorialVideoUrl is required
2506
- * - When step.type=redirect, redirectUrl is required
2507
2506
  * - The course of a step is determined by the parent challenge's courseId.
2508
2507
  * Optionally, courseModuleId pinpoints a specific module within that course.
2509
2508
  * - tutorial fields are optional on any step type.
@@ -2534,8 +2533,6 @@ interface paths {
2534
2533
  tutorialTitle?: string;
2535
2534
  tutorialDescription?: string;
2536
2535
  tutorialVideoUrl?: string;
2537
- /** @description Required when parent step type=redirect */
2538
- redirectUrl?: string;
2539
2536
  /** @default true */
2540
2537
  isActive?: boolean;
2541
2538
  };
@@ -9808,69 +9805,6 @@ interface paths {
9808
9805
  };
9809
9806
  trace?: never;
9810
9807
  };
9811
- "/quiz-questions/bulk": {
9812
- parameters: {
9813
- query?: never;
9814
- header?: never;
9815
- path?: never;
9816
- cookie?: never;
9817
- };
9818
- get?: never;
9819
- put?: never;
9820
- /**
9821
- * Bulk create quiz questions
9822
- * @description Cria várias perguntas (com suas respostas) de uma vez para um quiz. A ordem é atribuída sequencialmente a partir da última pergunta existente.
9823
- */
9824
- post: {
9825
- parameters: {
9826
- query?: never;
9827
- header?: never;
9828
- path?: never;
9829
- cookie?: never;
9830
- };
9831
- requestBody: {
9832
- content: {
9833
- "application/json": {
9834
- /** Format: uuid */
9835
- quizId: string;
9836
- questions: {
9837
- text: string;
9838
- /** @enum {string} */
9839
- type: "multiple_choice" | "true_false" | "open";
9840
- points?: number;
9841
- options?: {
9842
- text?: string;
9843
- is_correct?: boolean;
9844
- }[];
9845
- }[];
9846
- };
9847
- };
9848
- };
9849
- responses: {
9850
- /** @description Perguntas criadas */
9851
- 201: {
9852
- headers: {
9853
- [name: string]: unknown;
9854
- };
9855
- content: {
9856
- "application/json": {
9857
- /** @example success */
9858
- status?: string;
9859
- data?: components["schemas"]["QuizQuestion"][];
9860
- };
9861
- };
9862
- };
9863
- 400: components["responses"]["BadRequest"];
9864
- 401: components["responses"]["Unauthorized"];
9865
- 500: components["responses"]["ServerError"];
9866
- };
9867
- };
9868
- delete?: never;
9869
- options?: never;
9870
- head?: never;
9871
- patch?: never;
9872
- trace?: never;
9873
- };
9874
9808
  "/quiz-questions": {
9875
9809
  parameters: {
9876
9810
  query?: never;
@@ -9965,6 +9899,67 @@ interface paths {
9965
9899
  patch?: never;
9966
9900
  trace?: never;
9967
9901
  };
9902
+ "/quiz-questions/bulk": {
9903
+ parameters: {
9904
+ query?: never;
9905
+ header?: never;
9906
+ path?: never;
9907
+ cookie?: never;
9908
+ };
9909
+ get?: never;
9910
+ put?: never;
9911
+ /**
9912
+ * Bulk create quiz questions
9913
+ * @description Cria várias perguntas (com respostas) de uma vez para um quiz.
9914
+ */
9915
+ post: {
9916
+ parameters: {
9917
+ query?: never;
9918
+ header?: never;
9919
+ path?: never;
9920
+ cookie?: never;
9921
+ };
9922
+ requestBody: {
9923
+ content: {
9924
+ "application/json": {
9925
+ quizId: string;
9926
+ questions: {
9927
+ text: string;
9928
+ type: "multiple_choice" | "true_false" | "open";
9929
+ points?: number;
9930
+ options?: {
9931
+ text: string;
9932
+ is_correct: boolean;
9933
+ }[];
9934
+ }[];
9935
+ };
9936
+ };
9937
+ };
9938
+ responses: {
9939
+ /** @description Questions created */
9940
+ 201: {
9941
+ headers: {
9942
+ [name: string]: unknown;
9943
+ };
9944
+ content: {
9945
+ "application/json": {
9946
+ /** @example success */
9947
+ status?: string;
9948
+ data?: components["schemas"]["QuizQuestion"][];
9949
+ };
9950
+ };
9951
+ };
9952
+ 400: components["responses"]["BadRequest"];
9953
+ 401: components["responses"]["Unauthorized"];
9954
+ 500: components["responses"]["ServerError"];
9955
+ };
9956
+ };
9957
+ delete?: never;
9958
+ options?: never;
9959
+ head?: never;
9960
+ patch?: never;
9961
+ trace?: never;
9962
+ };
9968
9963
  "/quiz-questions/{id}": {
9969
9964
  parameters: {
9970
9965
  query?: never;
@@ -10186,7 +10181,7 @@ interface paths {
10186
10181
  };
10187
10182
  /**
10188
10183
  * List quizzes with course/module/category context
10189
- * @description Retrieve a paginated list of quizzes, each enriched with the course, module and category it belongs to. The relation is resolved on the server (Course.quizId / CourseModule.quizId), so consumers don't need to load every course to build the link map. `context` is null for standalone quizzes.
10184
+ * @description Retrieve a paginated list of quizzes, each enriched with the course, module and category it belongs to. `context` is null for standalone quizzes.
10190
10185
  */
10191
10186
  get: {
10192
10187
  parameters: {
@@ -10222,20 +10217,16 @@ interface paths {
10222
10217
  data?: (components["schemas"]["Quiz"] & {
10223
10218
  context?: {
10224
10219
  course?: {
10225
- /** Format: uuid */
10226
10220
  id?: string;
10227
10221
  title?: string;
10228
10222
  } | null;
10229
10223
  module?: {
10230
- /** Format: uuid */
10231
10224
  id?: string;
10232
10225
  title?: string;
10233
10226
  } | null;
10234
10227
  category?: {
10235
- /** Format: uuid */
10236
10228
  id?: string;
10237
10229
  name?: string;
10238
- /** @example #44bd32 */
10239
10230
  color?: string | null;
10240
10231
  } | null;
10241
10232
  } | null;
@@ -10267,7 +10258,7 @@ interface paths {
10267
10258
  put?: never;
10268
10259
  /**
10269
10260
  * Generate quiz questions with AI
10270
- * @description Gera perguntas de quiz a partir de um texto base usando IA (OpenRouter). NÃO persiste nada — apenas devolve as perguntas geradas para revisão no frontend. A chave da IA vive apenas no servidor.
10261
+ * @description Gera perguntas a partir de um texto base via IA. Não persiste — apenas devolve.
10271
10262
  */
10272
10263
  post: {
10273
10264
  parameters: {
@@ -10279,23 +10270,16 @@ interface paths {
10279
10270
  requestBody: {
10280
10271
  content: {
10281
10272
  "application/json": {
10282
- /** @description Texto base para gerar as perguntas */
10283
10273
  text: string;
10284
10274
  numQuestions: number;
10285
- /**
10286
- * @default normal
10287
- * @enum {string}
10288
- */
10289
10275
  difficulty?: "facil" | "normal" | "dificil";
10290
- /** @description Textos de perguntas já existentes (para não repetir) */
10291
10276
  existingQuestions?: string[];
10292
- /** @description Modelo de IA a usar (OpenRouter); default do servidor quando omitido */
10293
10277
  model?: string;
10294
10278
  };
10295
10279
  };
10296
10280
  };
10297
10281
  responses: {
10298
- /** @description Perguntas geradas */
10282
+ /** @description Generated questions */
10299
10283
  200: {
10300
10284
  headers: {
10301
10285
  [name: string]: unknown;
@@ -10305,13 +10289,12 @@ interface paths {
10305
10289
  /** @example success */
10306
10290
  status?: string;
10307
10291
  data?: {
10308
- question_text?: string;
10309
- /** @enum {string} */
10310
- question_type?: "multiple_choice" | "true_false";
10311
- points?: number;
10312
- options?: {
10313
- text?: string;
10314
- is_correct?: boolean;
10292
+ question_text: string;
10293
+ question_type: "multiple_choice" | "true_false";
10294
+ points: number;
10295
+ options: {
10296
+ text: string;
10297
+ is_correct: boolean;
10315
10298
  }[];
10316
10299
  }[];
10317
10300
  };
@@ -12013,7 +11996,7 @@ interface paths {
12013
11996
  parameters: {
12014
11997
  query?: {
12015
11998
  /** @description Filter by step type */
12016
- type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
11999
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
12017
12000
  /** @description Filter by active status */
12018
12001
  isActive?: boolean;
12019
12002
  };
@@ -12062,7 +12045,7 @@ interface paths {
12062
12045
  /** @example play-circle */
12063
12046
  icon: string;
12064
12047
  /** @enum {string} */
12065
- type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
12048
+ type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
12066
12049
  /** @default true */
12067
12050
  isActive?: boolean;
12068
12051
  };
@@ -12189,7 +12172,7 @@ interface paths {
12189
12172
  color?: string;
12190
12173
  icon?: string;
12191
12174
  /** @enum {string} */
12192
- type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
12175
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
12193
12176
  isActive?: boolean;
12194
12177
  };
12195
12178
  };
@@ -15814,11 +15797,6 @@ interface components {
15814
15797
  id?: string;
15815
15798
  /** @example Essential Skills */
15816
15799
  name?: string;
15817
- /**
15818
- * @description Hex color code for backoffice display. Null when not set.
15819
- * @example #44bd32
15820
- */
15821
- color?: string | null;
15822
15800
  /** Format: date-time */
15823
15801
  createdAt?: string;
15824
15802
  /** Format: date-time */
@@ -16090,7 +16068,7 @@ interface components {
16090
16068
  /** @example play-circle */
16091
16069
  icon?: string;
16092
16070
  /** @enum {string} */
16093
- type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
16071
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
16094
16072
  /** @example true */
16095
16073
  isActive?: boolean;
16096
16074
  /** Format: date-time */
@@ -16188,8 +16166,6 @@ interface components {
16188
16166
  tutorialDescription?: string | null;
16189
16167
  /** @description Obrigatório quando step type=tutorial */
16190
16168
  tutorialVideoUrl?: string | null;
16191
- /** @description Obrigatório quando step type=redirect. URL para onde o aluno é redirecionado ao clicar na etapa. */
16192
- redirectUrl?: string | null;
16193
16169
  isActive?: boolean;
16194
16170
  /** Format: date-time */
16195
16171
  createdAt?: string;
@@ -16319,10 +16295,7 @@ interface components {
16319
16295
  * @example Introdução a IA
16320
16296
  */
16321
16297
  courseModuleName?: string | null;
16322
- /**
16323
- * @description URL de redirecionamento desta etapa (apenas quando type=redirect)
16324
- * @example https://exemplo.com/atividade
16325
- */
16298
+ /** @description URL de redirecionamento desta etapa (apenas quando type=redirect) */
16326
16299
  redirectUrl?: string | null;
16327
16300
  };
16328
16301
  /** @description Desafio da jornada com suas etapas e status computados */
@@ -18274,6 +18247,30 @@ type GetUsersParams = {
18274
18247
  page?: number;
18275
18248
  limit?: number;
18276
18249
  };
18250
+ /** Série acessível ao aluno (item do seletor de séries da jornada). */
18251
+ type AccessibleSerie = {
18252
+ serieId: string;
18253
+ serieValue: number;
18254
+ serieLabel: string;
18255
+ level: "fundamental" | "medio";
18256
+ };
18257
+ /** Turma do aluno (resumo) — para a listagem de turmas no perfil. */
18258
+ type ClassroomSummary = {
18259
+ institutionClassroomId: string;
18260
+ classroomId: string;
18261
+ classroomName: string;
18262
+ shiftName: string | null;
18263
+ serie: AccessibleSerie | null;
18264
+ institutionId: string;
18265
+ institutionName: string | null;
18266
+ };
18267
+ /** Contexto de matrícula do usuário: turmas + escola atual + séries distintas. */
18268
+ type UserEnrollment = {
18269
+ classrooms: ClassroomSummary[];
18270
+ /** Escola atual resolvida pelo backend (1ª matrícula) — tem turma. */
18271
+ currentInstitutionId: string | null;
18272
+ series: AccessibleSerie[];
18273
+ };
18277
18274
  declare function createUserService(apiClient: AcademeApiClient): {
18278
18275
  /**
18279
18276
  * Get current authenticated user
@@ -18325,6 +18322,13 @@ declare function createUserService(apiClient: AcademeApiClient): {
18325
18322
  500: components["responses"]["ServerError"];
18326
18323
  };
18327
18324
  }> | undefined, `${string}/${string}`>>;
18325
+ /**
18326
+ * Contexto de matrícula do usuário: turmas (para o perfil) + séries
18327
+ * distintas (para o seletor de séries da jornada) + escola atual. Fonte
18328
+ * única, deduplicada e ordenada no backend. Normaliza os campos opcionais do
18329
+ * OpenAPI. Espelha o app-academe (user.service.getMyEnrollment).
18330
+ */
18331
+ getMyEnrollment(): Promise<UserEnrollment>;
18328
18332
  /**
18329
18333
  * List all users with optional filters
18330
18334
  */
@@ -23239,12 +23243,12 @@ declare function createQuizService(apiClient: AcademeApiClient): {
23239
23243
  "application/json": {
23240
23244
  status?: string;
23241
23245
  data?: {
23242
- question_text?: string;
23243
- question_type?: "multiple_choice" | "true_false";
23244
- points?: number;
23245
- options?: {
23246
- text?: string;
23247
- is_correct?: boolean;
23246
+ question_text: string;
23247
+ question_type: "multiple_choice" | "true_false";
23248
+ points: number;
23249
+ options: {
23250
+ text: string;
23251
+ is_correct: boolean;
23248
23252
  }[];
23249
23253
  }[];
23250
23254
  };
@@ -23572,8 +23576,8 @@ declare function createQuizService(apiClient: AcademeApiClient): {
23572
23576
  type: "multiple_choice" | "true_false" | "open";
23573
23577
  points?: number;
23574
23578
  options?: {
23575
- text?: string;
23576
- is_correct?: boolean;
23579
+ text: string;
23580
+ is_correct: boolean;
23577
23581
  }[];
23578
23582
  }[];
23579
23583
  };
@@ -23603,8 +23607,8 @@ declare function createQuizService(apiClient: AcademeApiClient): {
23603
23607
  type: "multiple_choice" | "true_false" | "open";
23604
23608
  points?: number;
23605
23609
  options?: {
23606
- text?: string;
23607
- is_correct?: boolean;
23610
+ text: string;
23611
+ is_correct: boolean;
23608
23612
  }[];
23609
23613
  }[];
23610
23614
  };
@@ -26666,7 +26670,6 @@ declare function createChallengeService(apiClient: AcademeApiClient): {
26666
26670
  tutorialTitle?: string;
26667
26671
  tutorialDescription?: string;
26668
26672
  tutorialVideoUrl?: string;
26669
- redirectUrl?: string;
26670
26673
  isActive?: boolean;
26671
26674
  };
26672
26675
  };
@@ -26701,7 +26704,6 @@ declare function createChallengeService(apiClient: AcademeApiClient): {
26701
26704
  tutorialTitle?: string;
26702
26705
  tutorialDescription?: string;
26703
26706
  tutorialVideoUrl?: string;
26704
- redirectUrl?: string;
26705
26707
  isActive?: boolean;
26706
26708
  };
26707
26709
  }, `${string}/${string}`>>;
@@ -27065,7 +27067,7 @@ declare function createStepService(apiClient: AcademeApiClient): {
27065
27067
  getAll(params?: GetStepsParams): Promise<openapi_fetch.FetchResponse<{
27066
27068
  parameters: {
27067
27069
  query?: {
27068
- type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
27070
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
27069
27071
  isActive?: boolean;
27070
27072
  };
27071
27073
  header?: never;
@@ -27091,7 +27093,7 @@ declare function createStepService(apiClient: AcademeApiClient): {
27091
27093
  }, {
27092
27094
  params: {
27093
27095
  query: {
27094
- type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
27096
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
27095
27097
  isActive?: boolean;
27096
27098
  } | undefined;
27097
27099
  };
@@ -27149,7 +27151,7 @@ declare function createStepService(apiClient: AcademeApiClient): {
27149
27151
  name: string;
27150
27152
  color: string;
27151
27153
  icon: string;
27152
- type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
27154
+ type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
27153
27155
  isActive?: boolean;
27154
27156
  };
27155
27157
  };
@@ -27175,7 +27177,7 @@ declare function createStepService(apiClient: AcademeApiClient): {
27175
27177
  name: string;
27176
27178
  color: string;
27177
27179
  icon: string;
27178
- type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
27180
+ type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
27179
27181
  isActive?: boolean;
27180
27182
  };
27181
27183
  }, `${string}/${string}`>>;
@@ -27197,7 +27199,7 @@ declare function createStepService(apiClient: AcademeApiClient): {
27197
27199
  name?: string;
27198
27200
  color?: string;
27199
27201
  icon?: string;
27200
- type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
27202
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
27201
27203
  isActive?: boolean;
27202
27204
  };
27203
27205
  };
@@ -27229,7 +27231,7 @@ declare function createStepService(apiClient: AcademeApiClient): {
27229
27231
  name?: string;
27230
27232
  color?: string;
27231
27233
  icon?: string;
27232
- type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
27234
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
27233
27235
  isActive?: boolean;
27234
27236
  };
27235
27237
  }, `${string}/${string}`>>;
@@ -27673,8 +27675,15 @@ declare function createUserProgressService(apiClient: AcademeApiClient): {
27673
27675
  * `userId` é [Admin]: quando informado, retorna a jornada do usuário-alvo
27674
27676
  * (ex.: backoffice visualizando a jornada de um aluno); omitido = jornada
27675
27677
  * do próprio usuário autenticado.
27678
+ *
27679
+ * `institutionId` é a escola ATUAL: a jornada é POR ESCOLA (o usuário pode
27680
+ * estar em várias). Omitido = 1ª matrícula resolvida no backend.
27681
+ *
27682
+ * ⚠️ Ordem dos parâmetros: `institutionId` foi adicionado como 3º parâmetro
27683
+ * (após `userId`) para NÃO quebrar chamadas posicionais existentes — o
27684
+ * backoffice chama `getJourney(undefined, userId)`.
27676
27685
  */
27677
- getJourney(serieId?: string, userId?: string): Promise<JourneyView>;
27686
+ getJourney(serieId?: string, userId?: string, institutionId?: string): Promise<JourneyView>;
27678
27687
  /**
27679
27688
  * Visão step-by-step do progresso do usuário em um desafio. Cada step traz
27680
27689
  * `myStartedAt`, `myCompletedAt` e (em desafios em grupo) os agregados do
@@ -27960,6 +27969,57 @@ declare function createUserProgressService(apiClient: AcademeApiClient): {
27960
27969
  };
27961
27970
  type UserProgressService = ReturnType<typeof createUserProgressService>;
27962
27971
 
27972
+ /**
27973
+ * Vitrine (Home) do aluno — rails/playlists estilo Netflix.
27974
+ * Consome `GET /vitrine/home` do api-academe-v2.
27975
+ *
27976
+ * ⚠️ O endpoint ainda NÃO está no OpenAPI gerado (`academe-api.ts`), então os
27977
+ * tipos abaixo são MANTIDOS À MÃO e a chamada usa cast — mesmo padrão de
27978
+ * `InstitutionService.setUserClassrooms`. Quando o backend expuser o schema,
27979
+ * regenerar os tipos e apertar.
27980
+ */
27981
+ type VitrineCardKind = "course" | "module" | "lesson" | "playlist";
27982
+ type VitrinePlaylistSource = "curated" | "continue_watching" | "trending" | "watchlist" | "recent" | "continue_playlist";
27983
+ type VitrineCardOrientation = "horizontal" | "vertical" | "square" | "fullImage";
27984
+ interface VitrineCard {
27985
+ kind: VitrineCardKind;
27986
+ id: string;
27987
+ courseId?: string | null;
27988
+ title: string;
27989
+ subtitle?: string | null;
27990
+ coverUrl?: string | null;
27991
+ durationSeconds?: number | null;
27992
+ progressPct?: number | null;
27993
+ courseTitle?: string | null;
27994
+ lessonLabel?: string | null;
27995
+ rank?: number | null;
27996
+ }
27997
+ interface VitrinePlaylist {
27998
+ id: string;
27999
+ title: string;
28000
+ subtitle: string | null;
28001
+ source: VitrinePlaylistSource;
28002
+ variant: "common" | "featured";
28003
+ cardOrientation: VitrineCardOrientation;
28004
+ itemsPerViewDesktop: number;
28005
+ itemsPerViewMobile: number;
28006
+ autoplay: boolean;
28007
+ style: Record<string, unknown>;
28008
+ items: VitrineCard[];
28009
+ }
28010
+ interface VitrineHome {
28011
+ institutionId: string | null;
28012
+ playlists: VitrinePlaylist[];
28013
+ }
28014
+ declare function createVitrineService(apiClient: AcademeApiClient): {
28015
+ /**
28016
+ * Home do aluno para a escola atual. `institutionId` omitido = 1ª matrícula
28017
+ * (o backend resolve). Recarregar ao trocar de escola no app.
28018
+ */
28019
+ getHome(institutionId?: string): Promise<VitrineHome>;
28020
+ };
28021
+ type VitrineService = ReturnType<typeof createVitrineService>;
28022
+
27963
28023
  type AcademeApiClient = ReturnType<typeof openapi_fetch__default<paths>>;
27964
28024
  declare function createAcademeApiClient(baseUrl: string): AcademeApiClient;
27965
28025
  interface AcademeServices {
@@ -27985,6 +28045,7 @@ interface AcademeServices {
27985
28045
  step: StepService;
27986
28046
  submission: SubmissionService;
27987
28047
  userProgress: UserProgressService;
28048
+ vitrine: VitrineService;
27988
28049
  }
27989
28050
 
27990
28051
  type AcademeKeycloakContextProps = {
@@ -28081,4 +28142,4 @@ declare enum NINA_ROLES {
28081
28142
  }
28082
28143
 
28083
28144
  export { AcademeAuthProvider, AcademeLoading, BACKOFFICE_ROLES, Button, CosmicDecor, CosmicStarsCanvas, DASHBOARD_ROLES, GLOBAL_ROLES, JourneyCrystalPin, JourneyStep, LogoA, MIKE_ROLES, NINA_ROLES, ProtectedApp, ProtectedComponent, ProtectedRouter, STREAMING_ROLES, Spinner, WIDGET_ROLES, academeApi_d as apiTypes, cn, createAcademeApiClient, index_d as types, useAcademeAuth, useProtectedAppColors };
28084
- export type { AcademeApiClient, AcademeKeycloakContextProps, AcademeLoadingColors, AcademeLoadingProps, AcademeLoadingTheme, AcademeServices, AcademeUser, ButtonProps, ChallengeUserQuizAttempt, ChallengeUserQuizAttemptsResponse, CosmicDecorProps, CosmicDecorVariant, CosmicPlanet, CosmicStarsCanvasProps, FrameKind, JourneyChallengeView, JourneyCrystalPinProps, JourneyStepProps, JourneyStepSize, JourneyStepType, JourneyStepView, JourneyView, KeycloakUser, LogoAProps, RequiredClientRoles, SecurityContextType, SecurityProviderProps };
28145
+ export type { AcademeApiClient, AcademeKeycloakContextProps, AcademeLoadingColors, AcademeLoadingProps, AcademeLoadingTheme, AcademeServices, AcademeUser, AccessibleSerie, ButtonProps, ChallengeUserQuizAttempt, ChallengeUserQuizAttemptsResponse, ClassroomSummary, CosmicDecorProps, CosmicDecorVariant, CosmicPlanet, CosmicStarsCanvasProps, FrameKind, JourneyChallengeView, JourneyCrystalPinProps, JourneyStepProps, JourneyStepSize, JourneyStepType, JourneyStepView, JourneyView, KeycloakUser, LogoAProps, RequiredClientRoles, SecurityContextType, SecurityProviderProps, UserEnrollment, VitrineCard, VitrineCardKind, VitrineCardOrientation, VitrineHome, VitrinePlaylist, VitrinePlaylistSource };
package/dist/index.esm.js CHANGED
@@ -4513,6 +4513,14 @@ function removeTrailingSlash(url) {
4513
4513
  return url;
4514
4514
  }
4515
4515
 
4516
+ const normalizeSerie = (s) => s?.serieId
4517
+ ? {
4518
+ serieId: s.serieId,
4519
+ serieValue: s.serieValue ?? 0,
4520
+ serieLabel: s.serieLabel ?? `${s.serieValue ?? ""}º ANO`,
4521
+ level: s.level ?? "fundamental",
4522
+ }
4523
+ : null;
4516
4524
  function createUserService(apiClient) {
4517
4525
  return {
4518
4526
  /**
@@ -4521,6 +4529,31 @@ function createUserService(apiClient) {
4521
4529
  getMe() {
4522
4530
  return apiClient.GET("/users/me");
4523
4531
  },
4532
+ /**
4533
+ * Contexto de matrícula do usuário: turmas (para o perfil) + séries
4534
+ * distintas (para o seletor de séries da jornada) + escola atual. Fonte
4535
+ * única, deduplicada e ordenada no backend. Normaliza os campos opcionais do
4536
+ * OpenAPI. Espelha o app-academe (user.service.getMyEnrollment).
4537
+ */
4538
+ async getMyEnrollment() {
4539
+ const res = await apiClient.GET("/users/me/classrooms");
4540
+ const data = res.data?.data;
4541
+ return {
4542
+ currentInstitutionId: data?.currentInstitutionId ?? null,
4543
+ classrooms: (data?.classrooms ?? []).map((c) => ({
4544
+ institutionClassroomId: c.institutionClassroomId ?? "",
4545
+ classroomId: c.classroomId ?? "",
4546
+ classroomName: c.classroomName ?? "",
4547
+ shiftName: c.shiftName ?? null,
4548
+ serie: normalizeSerie(c.serie ?? {}),
4549
+ institutionId: c.institutionId ?? "",
4550
+ institutionName: c.institutionName ?? null,
4551
+ })),
4552
+ series: (data?.series ?? [])
4553
+ .map((s) => normalizeSerie(s))
4554
+ .filter((s) => s !== null),
4555
+ };
4556
+ },
4524
4557
  /**
4525
4558
  * List all users with optional filters
4526
4559
  */
@@ -6402,15 +6435,26 @@ function createUserProgressService(apiClient) {
6402
6435
  * `userId` é [Admin]: quando informado, retorna a jornada do usuário-alvo
6403
6436
  * (ex.: backoffice visualizando a jornada de um aluno); omitido = jornada
6404
6437
  * do próprio usuário autenticado.
6438
+ *
6439
+ * `institutionId` é a escola ATUAL: a jornada é POR ESCOLA (o usuário pode
6440
+ * estar em várias). Omitido = 1ª matrícula resolvida no backend.
6441
+ *
6442
+ * ⚠️ Ordem dos parâmetros: `institutionId` foi adicionado como 3º parâmetro
6443
+ * (após `userId`) para NÃO quebrar chamadas posicionais existentes — o
6444
+ * backoffice chama `getJourney(undefined, userId)`.
6405
6445
  */
6406
- async getJourney(serieId, userId) {
6446
+ async getJourney(serieId, userId, institutionId) {
6407
6447
  const query = {};
6408
6448
  if (serieId)
6409
6449
  query.serieId = serieId;
6410
6450
  if (userId)
6411
6451
  query.userId = userId;
6452
+ if (institutionId)
6453
+ query.institutionId = institutionId;
6412
6454
  const res = await apiClient.GET("/user-challenge-progress/journey", {
6413
- params: { query: Object.keys(query).length > 0 ? query : undefined },
6455
+ params: {
6456
+ query: (Object.keys(query).length > 0 ? query : undefined),
6457
+ },
6414
6458
  });
6415
6459
  return res.data.data;
6416
6460
  },
@@ -6487,6 +6531,23 @@ function createUserProgressService(apiClient) {
6487
6531
  };
6488
6532
  }
6489
6533
 
6534
+ function createVitrineService(apiClient) {
6535
+ return {
6536
+ /**
6537
+ * Home do aluno para a escola atual. `institutionId` omitido = 1ª matrícula
6538
+ * (o backend resolve). Recarregar ao trocar de escola no app.
6539
+ */
6540
+ async getHome(institutionId) {
6541
+ const res = await apiClient.GET("/vitrine/home", {
6542
+ params: {
6543
+ query: institutionId ? { institutionId } : undefined,
6544
+ },
6545
+ });
6546
+ return (res.data?.data ?? { institutionId: null, playlists: [] });
6547
+ },
6548
+ };
6549
+ }
6550
+
6490
6551
  function createAcademeApiClient(baseUrl) {
6491
6552
  return createClient({ baseUrl });
6492
6553
  }
@@ -6514,6 +6575,7 @@ function createAcademeServices(apiClient) {
6514
6575
  step: createStepService(apiClient),
6515
6576
  submission: createSubmissionService(apiClient),
6516
6577
  userProgress: createUserProgressService(apiClient),
6578
+ vitrine: createVitrineService(apiClient),
6517
6579
  };
6518
6580
  }
6519
6581