academe-kit 0.9.7 → 0.9.8

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.
@@ -9,7 +9,6 @@ export interface UpdateChallengeStepBody {
9
9
  name?: string;
10
10
  description?: string;
11
11
  index?: number;
12
- courseId?: string;
13
12
  courseModuleId?: string;
14
13
  tutorialTitle?: string;
15
14
  tutorialDescription?: string;
@@ -41,6 +40,7 @@ export declare function createChallengeService(apiClient: AcademeApiClient): {
41
40
  isActive?: boolean;
42
41
  templatesOnly?: boolean;
43
42
  search?: string;
43
+ include?: "steps";
44
44
  page?: import("../types/academe-api").components["parameters"]["page"];
45
45
  limit?: import("../types/academe-api").components["parameters"]["limit"];
46
46
  };
@@ -73,6 +73,7 @@ export declare function createChallengeService(apiClient: AcademeApiClient): {
73
73
  isActive?: boolean;
74
74
  templatesOnly?: boolean;
75
75
  search?: string;
76
+ include?: "steps";
76
77
  page?: import("../types/academe-api").components["parameters"]["page"];
77
78
  limit?: import("../types/academe-api").components["parameters"]["limit"];
78
79
  } | undefined;
@@ -137,6 +138,7 @@ export declare function createChallengeService(apiClient: AcademeApiClient): {
137
138
  isGroup?: boolean;
138
139
  maxGroupMembers?: number;
139
140
  isInviteOnly?: boolean;
141
+ courseId: string;
140
142
  institutionId?: string | null;
141
143
  serieId?: string;
142
144
  index?: number;
@@ -175,6 +177,7 @@ export declare function createChallengeService(apiClient: AcademeApiClient): {
175
177
  isGroup?: boolean;
176
178
  maxGroupMembers?: number;
177
179
  isInviteOnly?: boolean;
180
+ courseId: string;
178
181
  institutionId?: string | null;
179
182
  serieId?: string;
180
183
  index?: number;
@@ -208,6 +211,7 @@ export declare function createChallengeService(apiClient: AcademeApiClient): {
208
211
  isGroup?: boolean;
209
212
  maxGroupMembers?: number;
210
213
  isInviteOnly?: boolean;
214
+ courseId?: string;
211
215
  serieId?: string;
212
216
  index?: number;
213
217
  submissionType?: "images" | "videos" | "audio" | "files" | "links";
@@ -248,6 +252,7 @@ export declare function createChallengeService(apiClient: AcademeApiClient): {
248
252
  isGroup?: boolean;
249
253
  maxGroupMembers?: number;
250
254
  isInviteOnly?: boolean;
255
+ courseId?: string;
251
256
  serieId?: string;
252
257
  index?: number;
253
258
  submissionType?: "images" | "videos" | "audio" | "files" | "links";
@@ -353,7 +358,6 @@ export declare function createChallengeService(apiClient: AcademeApiClient): {
353
358
  name: string;
354
359
  description?: string;
355
360
  index: number;
356
- courseId?: string;
357
361
  courseModuleId?: string;
358
362
  tutorialTitle?: string;
359
363
  tutorialDescription?: string;
@@ -388,7 +392,6 @@ export declare function createChallengeService(apiClient: AcademeApiClient): {
388
392
  name: string;
389
393
  description?: string;
390
394
  index: number;
391
- courseId?: string;
392
395
  courseModuleId?: string;
393
396
  tutorialTitle?: string;
394
397
  tutorialDescription?: string;
@@ -240,6 +240,7 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
240
240
  search?: string;
241
241
  page?: number;
242
242
  limit?: number;
243
+ randomize?: boolean;
243
244
  };
244
245
  header?: never;
245
246
  path?: never;
@@ -270,6 +271,7 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
270
271
  search?: string;
271
272
  page?: number;
272
273
  limit?: number;
274
+ randomize?: boolean;
273
275
  } | undefined;
274
276
  };
275
277
  }, `${string}/${string}`>>;
@@ -2019,6 +2019,12 @@ export interface paths {
2019
2019
  templatesOnly?: boolean;
2020
2020
  /** @description Search by title */
2021
2021
  search?: string;
2022
+ /**
2023
+ * @description Comma-separated list of extra relations to load. Currently supported:
2024
+ * `steps` — embeds each challenge's `steps` (with their catalog `step`).
2025
+ * Opt-in to avoid penalizing list views that don't need them.
2026
+ */
2027
+ include?: "steps";
2022
2028
  /** @description Page number */
2023
2029
  page?: components["parameters"]["page"];
2024
2030
  /** @description Items per page */
@@ -2073,6 +2079,11 @@ export interface paths {
2073
2079
  maxGroupMembers?: number;
2074
2080
  /** @default false */
2075
2081
  isInviteOnly?: boolean;
2082
+ /**
2083
+ * Format: uuid
2084
+ * @description Curso ao qual o desafio está associado (agrupa a jornada no dashboard)
2085
+ */
2086
+ courseId: string;
2076
2087
  /** Format: uuid */
2077
2088
  institutionId?: string | null;
2078
2089
  /** Format: uuid */
@@ -2215,6 +2226,8 @@ export interface paths {
2215
2226
  maxGroupMembers?: number;
2216
2227
  isInviteOnly?: boolean;
2217
2228
  /** Format: uuid */
2229
+ courseId?: string;
2230
+ /** Format: uuid */
2218
2231
  serieId?: string;
2219
2232
  index?: number;
2220
2233
  /** @enum {string} */
@@ -2321,9 +2334,10 @@ export interface paths {
2321
2334
  /**
2322
2335
  * Add a step to the challenge
2323
2336
  * @description Polymorphic validation:
2324
- * - When step.type=course, courseId is required
2325
2337
  * - When step.type=tutorial, tutorialVideoUrl is required
2326
- * - Other types must not have these specialized fields
2338
+ * - The course of a step is determined by the parent challenge's courseId.
2339
+ * Optionally, courseModuleId pinpoints a specific module within that course.
2340
+ * - tutorial fields are optional on any step type.
2327
2341
  */
2328
2342
  post: {
2329
2343
  parameters: {
@@ -2347,8 +2361,6 @@ export interface paths {
2347
2361
  description?: string;
2348
2362
  index: number;
2349
2363
  /** Format: uuid */
2350
- courseId?: string;
2351
- /** Format: uuid */
2352
2364
  courseModuleId?: string;
2353
2365
  tutorialTitle?: string;
2354
2366
  tutorialDescription?: string;
@@ -9476,6 +9488,8 @@ export interface paths {
9476
9488
  page?: number;
9477
9489
  /** @description Items per page */
9478
9490
  limit?: number;
9491
+ /** @description When true, returns questions in random order with shuffled answer alternatives. Each request reshuffles independently. */
9492
+ randomize?: boolean;
9479
9493
  };
9480
9494
  header?: never;
9481
9495
  path?: never;
@@ -10529,6 +10543,76 @@ export interface paths {
10529
10543
  patch?: never;
10530
10544
  trace?: never;
10531
10545
  };
10546
+ "/reports/encourage-dashboard/{id}": {
10547
+ parameters: {
10548
+ query?: never;
10549
+ header?: never;
10550
+ path?: never;
10551
+ cookie?: never;
10552
+ };
10553
+ /**
10554
+ * Payload completo da nova tela /new-dashboard
10555
+ * @description Retorna o dashboard agregado por instituição: overview, KPIs,
10556
+ * licenças (apenas tipo aluno), jornada (cursos deduplicados),
10557
+ * submissões, desempenho por turma, top 10 alunos (por certificados,
10558
+ * desempate por nota) e top 10 professores (por avaliações).
10559
+ */
10560
+ get: {
10561
+ parameters: {
10562
+ query?: never;
10563
+ header?: never;
10564
+ path: {
10565
+ /** @description ID da instituição */
10566
+ id: string;
10567
+ };
10568
+ cookie?: never;
10569
+ };
10570
+ requestBody?: never;
10571
+ responses: {
10572
+ /** @description Payload completo do encourage dashboard */
10573
+ 200: {
10574
+ headers: {
10575
+ [name: string]: unknown;
10576
+ };
10577
+ content: {
10578
+ "application/json": {
10579
+ /** @example success */
10580
+ status?: string;
10581
+ data?: components["schemas"]["EncourageDashboardResponse"];
10582
+ };
10583
+ };
10584
+ };
10585
+ /** @description institutionId inválido */
10586
+ 400: {
10587
+ headers: {
10588
+ [name: string]: unknown;
10589
+ };
10590
+ content?: never;
10591
+ };
10592
+ /** @description Não autenticado */
10593
+ 401: {
10594
+ headers: {
10595
+ [name: string]: unknown;
10596
+ };
10597
+ content?: never;
10598
+ };
10599
+ /** @description Erro interno */
10600
+ 500: {
10601
+ headers: {
10602
+ [name: string]: unknown;
10603
+ };
10604
+ content?: never;
10605
+ };
10606
+ };
10607
+ };
10608
+ put?: never;
10609
+ post?: never;
10610
+ delete?: never;
10611
+ options?: never;
10612
+ head?: never;
10613
+ patch?: never;
10614
+ trace?: never;
10615
+ };
10532
10616
  "/roles": {
10533
10617
  parameters: {
10534
10618
  query?: never;
@@ -12197,6 +12281,86 @@ export interface paths {
12197
12281
  patch?: never;
12198
12282
  trace?: never;
12199
12283
  };
12284
+ "/user-challenge-progress/challenges/{id}/advance": {
12285
+ parameters: {
12286
+ query?: never;
12287
+ header?: never;
12288
+ path?: never;
12289
+ cookie?: never;
12290
+ };
12291
+ get?: never;
12292
+ put?: never;
12293
+ /**
12294
+ * Advance one tick in the user's journey on a challenge
12295
+ * @description Unified journey advancement, agnostic of step type. Each call performs ONE action:
12296
+ *
12297
+ * 1. Resolves the current step = first active step (by index) not yet completed by the user.
12298
+ * 2. If no progress row exists for that step → creates one (action='started').
12299
+ * 3. If progress row exists with completed_at IS NULL → sets completed_at (action='completed').
12300
+ * 4. If all steps are completed → no-op (action='finished').
12301
+ *
12302
+ * Web and mobile clients must use this endpoint regardless of the step type
12303
+ * (challenge, course, tutorial, publication, evaluation, certificate).
12304
+ */
12305
+ post: {
12306
+ parameters: {
12307
+ query?: never;
12308
+ header?: never;
12309
+ path: {
12310
+ /** @description Resource ID */
12311
+ id: components["parameters"]["id"];
12312
+ };
12313
+ cookie?: never;
12314
+ };
12315
+ requestBody?: never;
12316
+ responses: {
12317
+ /** @description Tick result */
12318
+ 200: {
12319
+ headers: {
12320
+ [name: string]: unknown;
12321
+ };
12322
+ content: {
12323
+ "application/json": {
12324
+ /** @example success */
12325
+ status?: string;
12326
+ data?: {
12327
+ /** @enum {string} */
12328
+ action?: "started" | "completed" | "finished";
12329
+ /** Format: uuid */
12330
+ challengeId?: string;
12331
+ currentStep?: {
12332
+ /** Format: uuid */
12333
+ id?: string;
12334
+ index?: number;
12335
+ name?: string;
12336
+ /** Format: date-time */
12337
+ startedAt?: string | null;
12338
+ /** Format: date-time */
12339
+ completedAt?: string | null;
12340
+ } | null;
12341
+ /** @description Next step in the journey. When action='completed', this step is also auto-started on the same call (startedAt populated). */
12342
+ nextStep?: {
12343
+ /** Format: uuid */
12344
+ id?: string;
12345
+ index?: number;
12346
+ name?: string;
12347
+ /** Format: date-time */
12348
+ startedAt?: string | null;
12349
+ } | null;
12350
+ };
12351
+ };
12352
+ };
12353
+ };
12354
+ 401: components["responses"]["Unauthorized"];
12355
+ 404: components["responses"]["NotFound"];
12356
+ };
12357
+ };
12358
+ delete?: never;
12359
+ options?: never;
12360
+ head?: never;
12361
+ patch?: never;
12362
+ trace?: never;
12363
+ };
12200
12364
  "/user-challenge-progress/steps/{stepId}/start": {
12201
12365
  parameters: {
12202
12366
  query?: never;
@@ -12207,9 +12371,12 @@ export interface paths {
12207
12371
  get?: never;
12208
12372
  put?: never;
12209
12373
  /**
12210
- * Start a challenge step (idempotent)
12211
- * @description Creates a user_challenge_progress row. If one already exists for this user/step,
12374
+ * [Internal/Admin] Force-start a specific challenge step (idempotent)
12375
+ * @description Creates a user_challenge_progress row for the given step. If one already exists,
12212
12376
  * returns the existing row (idempotent).
12377
+ *
12378
+ * Client apps (web/mobile) should use POST /user-challenge-progress/challenges/{id}/advance
12379
+ * instead. This endpoint is retained for internal/admin tooling that needs to force a state.
12213
12380
  */
12214
12381
  post: {
12215
12382
  parameters: {
@@ -12256,8 +12423,12 @@ export interface paths {
12256
12423
  get?: never;
12257
12424
  put?: never;
12258
12425
  /**
12259
- * Mark step as completed
12260
- * @description Sets completed_at on the user's progress row. Idempotent (no-op if already completed)
12426
+ * [Internal/Admin] Force-complete a specific challenge step
12427
+ * @description Sets completed_at on the user's progress row for the given step. Idempotent
12428
+ * (no-op if already completed).
12429
+ *
12430
+ * Client apps (web/mobile) should use POST /user-challenge-progress/challenges/{id}/advance
12431
+ * instead. This endpoint is retained for internal/admin tooling that needs to force a state.
12261
12432
  */
12262
12433
  post: {
12263
12434
  parameters: {
@@ -14819,6 +14990,11 @@ export interface components {
14819
14990
  maxGroupMembers?: number;
14820
14991
  /** @example false */
14821
14992
  isInviteOnly?: boolean;
14993
+ /**
14994
+ * Format: uuid
14995
+ * @description Curso ao qual o desafio está associado (agrupa a jornada no dashboard)
14996
+ */
14997
+ courseId?: string;
14822
14998
  /**
14823
14999
  * Format: uuid
14824
15000
  * @description Null para template global
@@ -14854,6 +15030,8 @@ export interface components {
14854
15030
  createdAt?: string;
14855
15031
  /** Format: date-time */
14856
15032
  updatedAt?: string;
15033
+ /** @description Populado quando `include=steps` é informado no GET /challenges, ou via GET /challenges/{id} */
15034
+ steps?: components["schemas"]["ChallengeStep"][];
14857
15035
  };
14858
15036
  ChallengeMedia: {
14859
15037
  /** Format: uuid */
@@ -14882,10 +15060,8 @@ export interface components {
14882
15060
  index?: number;
14883
15061
  /**
14884
15062
  * Format: uuid
14885
- * @description Obrigatório quando step type=course
15063
+ * @description Opcional. Quando step type=course, aponta para o módulo específico do curso do challenge.
14886
15064
  */
14887
- courseId?: string | null;
14888
- /** Format: uuid */
14889
15065
  courseModuleId?: string | null;
14890
15066
  tutorialTitle?: string | null;
14891
15067
  tutorialDescription?: string | null;
@@ -14896,6 +15072,8 @@ export interface components {
14896
15072
  createdAt?: string;
14897
15073
  /** Format: date-time */
14898
15074
  updatedAt?: string;
15075
+ /** @description Catálogo do step (cor, ícone, tipo). Populado junto com o relation `steps.step`. */
15076
+ step?: components["schemas"]["Step"];
14899
15077
  };
14900
15078
  /** @description Item do checklist descritivo de entrega */
14901
15079
  ChallengeDeliveryStep: {
@@ -15905,6 +16083,121 @@ export interface components {
15905
16083
  totalStudents?: number;
15906
16084
  year?: number;
15907
16085
  };
16086
+ EncourageActivePeriod: {
16087
+ /** Format: uuid */
16088
+ id?: string;
16089
+ /** Format: date-time */
16090
+ start?: string;
16091
+ /** Format: date-time */
16092
+ end?: string;
16093
+ /** @example Bimestre */
16094
+ label?: string;
16095
+ /** @example 4 */
16096
+ periodsPerYear?: number;
16097
+ };
16098
+ EncourageOverview: {
16099
+ userFirstName?: string;
16100
+ institutionName?: string;
16101
+ activePeriod?: components["schemas"]["EncourageActivePeriod"];
16102
+ /** Format: float */
16103
+ globalProgressPct?: number;
16104
+ };
16105
+ EncourageKpis: {
16106
+ totalStudents?: number;
16107
+ /** Format: float */
16108
+ totalStudentsDeltaPct?: number;
16109
+ completedProjects?: number;
16110
+ /** Format: float */
16111
+ completedProjectsDeltaPct?: number;
16112
+ /** Format: float */
16113
+ engagementRatePct?: number;
16114
+ /** Format: float */
16115
+ engagementRateDeltaPct?: number;
16116
+ neverLoggedIn?: number;
16117
+ neverLoggedInDelta?: number;
16118
+ };
16119
+ /** @description Licenças do tipo aluno (seats.group_id → group.type = 'student') */
16120
+ EncourageLicenses: {
16121
+ used?: number;
16122
+ total?: number;
16123
+ /** Format: float */
16124
+ pct?: number;
16125
+ available?: number;
16126
+ };
16127
+ EncourageJourneyCourse: {
16128
+ /** Format: uuid */
16129
+ courseId?: string;
16130
+ title?: string;
16131
+ /** Format: date-time */
16132
+ dueDate?: string;
16133
+ /** Format: float */
16134
+ progressPct?: number;
16135
+ challengesCount?: number;
16136
+ color?: string;
16137
+ };
16138
+ EncourageJourney: {
16139
+ totalCourses?: number;
16140
+ /** Format: float */
16141
+ averageProgressPct?: number;
16142
+ /** @enum {string} */
16143
+ periodKind?: "semester" | "trimester" | "bimester";
16144
+ courses?: components["schemas"]["EncourageJourneyCourse"][];
16145
+ };
16146
+ EncourageSubmissions: {
16147
+ total?: number;
16148
+ evaluated?: number;
16149
+ awaitingTeacher?: number;
16150
+ awaitingAi?: number;
16151
+ };
16152
+ EncourageClassPerformance: {
16153
+ /** Format: uuid */
16154
+ classroomId?: string;
16155
+ /** @example 2º A — Médio */
16156
+ name?: string;
16157
+ /** @example Manhã */
16158
+ meta?: string;
16159
+ /** @description Total de alunos cadastrados na turma */
16160
+ studentsCount?: number;
16161
+ /** @description Alunos que submeteram pelo menos 1 challenge do período ativo */
16162
+ submittedCount?: number;
16163
+ /** Format: float */
16164
+ progressPct?: number;
16165
+ /** @enum {string} */
16166
+ level?: "high" | "medium" | "low";
16167
+ };
16168
+ EncourageTopStudent: {
16169
+ /** Format: uuid */
16170
+ userId?: string;
16171
+ rank?: number;
16172
+ name?: string;
16173
+ initials?: string;
16174
+ avatarColor?: string;
16175
+ certificates?: number;
16176
+ /** Format: float */
16177
+ averageScore?: number;
16178
+ };
16179
+ EncourageTopTeacher: {
16180
+ /** Format: uuid */
16181
+ userId?: string;
16182
+ rank?: number;
16183
+ name?: string;
16184
+ initials?: string;
16185
+ avatarColor?: string;
16186
+ evaluationsCount?: number;
16187
+ averageEvaluationSeconds?: number;
16188
+ /** Format: float */
16189
+ averageScore?: number;
16190
+ };
16191
+ EncourageDashboardResponse: {
16192
+ overview?: components["schemas"]["EncourageOverview"];
16193
+ kpis?: components["schemas"]["EncourageKpis"];
16194
+ licenses?: components["schemas"]["EncourageLicenses"];
16195
+ journey?: components["schemas"]["EncourageJourney"];
16196
+ submissions?: components["schemas"]["EncourageSubmissions"];
16197
+ classes?: components["schemas"]["EncourageClassPerformance"][];
16198
+ topStudents?: components["schemas"]["EncourageTopStudent"][];
16199
+ topTeachers?: components["schemas"]["EncourageTopTeacher"][];
16200
+ };
15908
16201
  UserCreationRequest: {
15909
16202
  /**
15910
16203
  * Format: uuid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "academe-kit",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
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",