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.
package/dist/index.d.ts CHANGED
@@ -2109,6 +2109,12 @@ interface paths {
2109
2109
  templatesOnly?: boolean;
2110
2110
  /** @description Search by title */
2111
2111
  search?: string;
2112
+ /**
2113
+ * @description Comma-separated list of extra relations to load. Currently supported:
2114
+ * `steps` — embeds each challenge's `steps` (with their catalog `step`).
2115
+ * Opt-in to avoid penalizing list views that don't need them.
2116
+ */
2117
+ include?: "steps";
2112
2118
  /** @description Page number */
2113
2119
  page?: components["parameters"]["page"];
2114
2120
  /** @description Items per page */
@@ -2163,6 +2169,11 @@ interface paths {
2163
2169
  maxGroupMembers?: number;
2164
2170
  /** @default false */
2165
2171
  isInviteOnly?: boolean;
2172
+ /**
2173
+ * Format: uuid
2174
+ * @description Curso ao qual o desafio está associado (agrupa a jornada no dashboard)
2175
+ */
2176
+ courseId: string;
2166
2177
  /** Format: uuid */
2167
2178
  institutionId?: string | null;
2168
2179
  /** Format: uuid */
@@ -2305,6 +2316,8 @@ interface paths {
2305
2316
  maxGroupMembers?: number;
2306
2317
  isInviteOnly?: boolean;
2307
2318
  /** Format: uuid */
2319
+ courseId?: string;
2320
+ /** Format: uuid */
2308
2321
  serieId?: string;
2309
2322
  index?: number;
2310
2323
  /** @enum {string} */
@@ -2411,9 +2424,10 @@ interface paths {
2411
2424
  /**
2412
2425
  * Add a step to the challenge
2413
2426
  * @description Polymorphic validation:
2414
- * - When step.type=course, courseId is required
2415
2427
  * - When step.type=tutorial, tutorialVideoUrl is required
2416
- * - Other types must not have these specialized fields
2428
+ * - The course of a step is determined by the parent challenge's courseId.
2429
+ * Optionally, courseModuleId pinpoints a specific module within that course.
2430
+ * - tutorial fields are optional on any step type.
2417
2431
  */
2418
2432
  post: {
2419
2433
  parameters: {
@@ -2437,8 +2451,6 @@ interface paths {
2437
2451
  description?: string;
2438
2452
  index: number;
2439
2453
  /** Format: uuid */
2440
- courseId?: string;
2441
- /** Format: uuid */
2442
2454
  courseModuleId?: string;
2443
2455
  tutorialTitle?: string;
2444
2456
  tutorialDescription?: string;
@@ -9566,6 +9578,8 @@ interface paths {
9566
9578
  page?: number;
9567
9579
  /** @description Items per page */
9568
9580
  limit?: number;
9581
+ /** @description When true, returns questions in random order with shuffled answer alternatives. Each request reshuffles independently. */
9582
+ randomize?: boolean;
9569
9583
  };
9570
9584
  header?: never;
9571
9585
  path?: never;
@@ -10619,6 +10633,76 @@ interface paths {
10619
10633
  patch?: never;
10620
10634
  trace?: never;
10621
10635
  };
10636
+ "/reports/encourage-dashboard/{id}": {
10637
+ parameters: {
10638
+ query?: never;
10639
+ header?: never;
10640
+ path?: never;
10641
+ cookie?: never;
10642
+ };
10643
+ /**
10644
+ * Payload completo da nova tela /new-dashboard
10645
+ * @description Retorna o dashboard agregado por instituição: overview, KPIs,
10646
+ * licenças (apenas tipo aluno), jornada (cursos deduplicados),
10647
+ * submissões, desempenho por turma, top 10 alunos (por certificados,
10648
+ * desempate por nota) e top 10 professores (por avaliações).
10649
+ */
10650
+ get: {
10651
+ parameters: {
10652
+ query?: never;
10653
+ header?: never;
10654
+ path: {
10655
+ /** @description ID da instituição */
10656
+ id: string;
10657
+ };
10658
+ cookie?: never;
10659
+ };
10660
+ requestBody?: never;
10661
+ responses: {
10662
+ /** @description Payload completo do encourage dashboard */
10663
+ 200: {
10664
+ headers: {
10665
+ [name: string]: unknown;
10666
+ };
10667
+ content: {
10668
+ "application/json": {
10669
+ /** @example success */
10670
+ status?: string;
10671
+ data?: components["schemas"]["EncourageDashboardResponse"];
10672
+ };
10673
+ };
10674
+ };
10675
+ /** @description institutionId inválido */
10676
+ 400: {
10677
+ headers: {
10678
+ [name: string]: unknown;
10679
+ };
10680
+ content?: never;
10681
+ };
10682
+ /** @description Não autenticado */
10683
+ 401: {
10684
+ headers: {
10685
+ [name: string]: unknown;
10686
+ };
10687
+ content?: never;
10688
+ };
10689
+ /** @description Erro interno */
10690
+ 500: {
10691
+ headers: {
10692
+ [name: string]: unknown;
10693
+ };
10694
+ content?: never;
10695
+ };
10696
+ };
10697
+ };
10698
+ put?: never;
10699
+ post?: never;
10700
+ delete?: never;
10701
+ options?: never;
10702
+ head?: never;
10703
+ patch?: never;
10704
+ trace?: never;
10705
+ };
10622
10706
  "/roles": {
10623
10707
  parameters: {
10624
10708
  query?: never;
@@ -12287,6 +12371,86 @@ interface paths {
12287
12371
  patch?: never;
12288
12372
  trace?: never;
12289
12373
  };
12374
+ "/user-challenge-progress/challenges/{id}/advance": {
12375
+ parameters: {
12376
+ query?: never;
12377
+ header?: never;
12378
+ path?: never;
12379
+ cookie?: never;
12380
+ };
12381
+ get?: never;
12382
+ put?: never;
12383
+ /**
12384
+ * Advance one tick in the user's journey on a challenge
12385
+ * @description Unified journey advancement, agnostic of step type. Each call performs ONE action:
12386
+ *
12387
+ * 1. Resolves the current step = first active step (by index) not yet completed by the user.
12388
+ * 2. If no progress row exists for that step → creates one (action='started').
12389
+ * 3. If progress row exists with completed_at IS NULL → sets completed_at (action='completed').
12390
+ * 4. If all steps are completed → no-op (action='finished').
12391
+ *
12392
+ * Web and mobile clients must use this endpoint regardless of the step type
12393
+ * (challenge, course, tutorial, publication, evaluation, certificate).
12394
+ */
12395
+ post: {
12396
+ parameters: {
12397
+ query?: never;
12398
+ header?: never;
12399
+ path: {
12400
+ /** @description Resource ID */
12401
+ id: components["parameters"]["id"];
12402
+ };
12403
+ cookie?: never;
12404
+ };
12405
+ requestBody?: never;
12406
+ responses: {
12407
+ /** @description Tick result */
12408
+ 200: {
12409
+ headers: {
12410
+ [name: string]: unknown;
12411
+ };
12412
+ content: {
12413
+ "application/json": {
12414
+ /** @example success */
12415
+ status?: string;
12416
+ data?: {
12417
+ /** @enum {string} */
12418
+ action?: "started" | "completed" | "finished";
12419
+ /** Format: uuid */
12420
+ challengeId?: string;
12421
+ currentStep?: {
12422
+ /** Format: uuid */
12423
+ id?: string;
12424
+ index?: number;
12425
+ name?: string;
12426
+ /** Format: date-time */
12427
+ startedAt?: string | null;
12428
+ /** Format: date-time */
12429
+ completedAt?: string | null;
12430
+ } | null;
12431
+ /** @description Next step in the journey. When action='completed', this step is also auto-started on the same call (startedAt populated). */
12432
+ nextStep?: {
12433
+ /** Format: uuid */
12434
+ id?: string;
12435
+ index?: number;
12436
+ name?: string;
12437
+ /** Format: date-time */
12438
+ startedAt?: string | null;
12439
+ } | null;
12440
+ };
12441
+ };
12442
+ };
12443
+ };
12444
+ 401: components["responses"]["Unauthorized"];
12445
+ 404: components["responses"]["NotFound"];
12446
+ };
12447
+ };
12448
+ delete?: never;
12449
+ options?: never;
12450
+ head?: never;
12451
+ patch?: never;
12452
+ trace?: never;
12453
+ };
12290
12454
  "/user-challenge-progress/steps/{stepId}/start": {
12291
12455
  parameters: {
12292
12456
  query?: never;
@@ -12297,9 +12461,12 @@ interface paths {
12297
12461
  get?: never;
12298
12462
  put?: never;
12299
12463
  /**
12300
- * Start a challenge step (idempotent)
12301
- * @description Creates a user_challenge_progress row. If one already exists for this user/step,
12464
+ * [Internal/Admin] Force-start a specific challenge step (idempotent)
12465
+ * @description Creates a user_challenge_progress row for the given step. If one already exists,
12302
12466
  * returns the existing row (idempotent).
12467
+ *
12468
+ * Client apps (web/mobile) should use POST /user-challenge-progress/challenges/{id}/advance
12469
+ * instead. This endpoint is retained for internal/admin tooling that needs to force a state.
12303
12470
  */
12304
12471
  post: {
12305
12472
  parameters: {
@@ -12346,8 +12513,12 @@ interface paths {
12346
12513
  get?: never;
12347
12514
  put?: never;
12348
12515
  /**
12349
- * Mark step as completed
12350
- * @description Sets completed_at on the user's progress row. Idempotent (no-op if already completed)
12516
+ * [Internal/Admin] Force-complete a specific challenge step
12517
+ * @description Sets completed_at on the user's progress row for the given step. Idempotent
12518
+ * (no-op if already completed).
12519
+ *
12520
+ * Client apps (web/mobile) should use POST /user-challenge-progress/challenges/{id}/advance
12521
+ * instead. This endpoint is retained for internal/admin tooling that needs to force a state.
12351
12522
  */
12352
12523
  post: {
12353
12524
  parameters: {
@@ -14909,6 +15080,11 @@ interface components {
14909
15080
  maxGroupMembers?: number;
14910
15081
  /** @example false */
14911
15082
  isInviteOnly?: boolean;
15083
+ /**
15084
+ * Format: uuid
15085
+ * @description Curso ao qual o desafio está associado (agrupa a jornada no dashboard)
15086
+ */
15087
+ courseId?: string;
14912
15088
  /**
14913
15089
  * Format: uuid
14914
15090
  * @description Null para template global
@@ -14944,6 +15120,8 @@ interface components {
14944
15120
  createdAt?: string;
14945
15121
  /** Format: date-time */
14946
15122
  updatedAt?: string;
15123
+ /** @description Populado quando `include=steps` é informado no GET /challenges, ou via GET /challenges/{id} */
15124
+ steps?: components["schemas"]["ChallengeStep"][];
14947
15125
  };
14948
15126
  ChallengeMedia: {
14949
15127
  /** Format: uuid */
@@ -14972,10 +15150,8 @@ interface components {
14972
15150
  index?: number;
14973
15151
  /**
14974
15152
  * Format: uuid
14975
- * @description Obrigatório quando step type=course
15153
+ * @description Opcional. Quando step type=course, aponta para o módulo específico do curso do challenge.
14976
15154
  */
14977
- courseId?: string | null;
14978
- /** Format: uuid */
14979
15155
  courseModuleId?: string | null;
14980
15156
  tutorialTitle?: string | null;
14981
15157
  tutorialDescription?: string | null;
@@ -14986,6 +15162,8 @@ interface components {
14986
15162
  createdAt?: string;
14987
15163
  /** Format: date-time */
14988
15164
  updatedAt?: string;
15165
+ /** @description Catálogo do step (cor, ícone, tipo). Populado junto com o relation `steps.step`. */
15166
+ step?: components["schemas"]["Step"];
14989
15167
  };
14990
15168
  /** @description Item do checklist descritivo de entrega */
14991
15169
  ChallengeDeliveryStep: {
@@ -15995,6 +16173,121 @@ interface components {
15995
16173
  totalStudents?: number;
15996
16174
  year?: number;
15997
16175
  };
16176
+ EncourageActivePeriod: {
16177
+ /** Format: uuid */
16178
+ id?: string;
16179
+ /** Format: date-time */
16180
+ start?: string;
16181
+ /** Format: date-time */
16182
+ end?: string;
16183
+ /** @example Bimestre */
16184
+ label?: string;
16185
+ /** @example 4 */
16186
+ periodsPerYear?: number;
16187
+ };
16188
+ EncourageOverview: {
16189
+ userFirstName?: string;
16190
+ institutionName?: string;
16191
+ activePeriod?: components["schemas"]["EncourageActivePeriod"];
16192
+ /** Format: float */
16193
+ globalProgressPct?: number;
16194
+ };
16195
+ EncourageKpis: {
16196
+ totalStudents?: number;
16197
+ /** Format: float */
16198
+ totalStudentsDeltaPct?: number;
16199
+ completedProjects?: number;
16200
+ /** Format: float */
16201
+ completedProjectsDeltaPct?: number;
16202
+ /** Format: float */
16203
+ engagementRatePct?: number;
16204
+ /** Format: float */
16205
+ engagementRateDeltaPct?: number;
16206
+ neverLoggedIn?: number;
16207
+ neverLoggedInDelta?: number;
16208
+ };
16209
+ /** @description Licenças do tipo aluno (seats.group_id → group.type = 'student') */
16210
+ EncourageLicenses: {
16211
+ used?: number;
16212
+ total?: number;
16213
+ /** Format: float */
16214
+ pct?: number;
16215
+ available?: number;
16216
+ };
16217
+ EncourageJourneyCourse: {
16218
+ /** Format: uuid */
16219
+ courseId?: string;
16220
+ title?: string;
16221
+ /** Format: date-time */
16222
+ dueDate?: string;
16223
+ /** Format: float */
16224
+ progressPct?: number;
16225
+ challengesCount?: number;
16226
+ color?: string;
16227
+ };
16228
+ EncourageJourney: {
16229
+ totalCourses?: number;
16230
+ /** Format: float */
16231
+ averageProgressPct?: number;
16232
+ /** @enum {string} */
16233
+ periodKind?: "semester" | "trimester" | "bimester";
16234
+ courses?: components["schemas"]["EncourageJourneyCourse"][];
16235
+ };
16236
+ EncourageSubmissions: {
16237
+ total?: number;
16238
+ evaluated?: number;
16239
+ awaitingTeacher?: number;
16240
+ awaitingAi?: number;
16241
+ };
16242
+ EncourageClassPerformance: {
16243
+ /** Format: uuid */
16244
+ classroomId?: string;
16245
+ /** @example 2º A — Médio */
16246
+ name?: string;
16247
+ /** @example Manhã */
16248
+ meta?: string;
16249
+ /** @description Total de alunos cadastrados na turma */
16250
+ studentsCount?: number;
16251
+ /** @description Alunos que submeteram pelo menos 1 challenge do período ativo */
16252
+ submittedCount?: number;
16253
+ /** Format: float */
16254
+ progressPct?: number;
16255
+ /** @enum {string} */
16256
+ level?: "high" | "medium" | "low";
16257
+ };
16258
+ EncourageTopStudent: {
16259
+ /** Format: uuid */
16260
+ userId?: string;
16261
+ rank?: number;
16262
+ name?: string;
16263
+ initials?: string;
16264
+ avatarColor?: string;
16265
+ certificates?: number;
16266
+ /** Format: float */
16267
+ averageScore?: number;
16268
+ };
16269
+ EncourageTopTeacher: {
16270
+ /** Format: uuid */
16271
+ userId?: string;
16272
+ rank?: number;
16273
+ name?: string;
16274
+ initials?: string;
16275
+ avatarColor?: string;
16276
+ evaluationsCount?: number;
16277
+ averageEvaluationSeconds?: number;
16278
+ /** Format: float */
16279
+ averageScore?: number;
16280
+ };
16281
+ EncourageDashboardResponse: {
16282
+ overview?: components["schemas"]["EncourageOverview"];
16283
+ kpis?: components["schemas"]["EncourageKpis"];
16284
+ licenses?: components["schemas"]["EncourageLicenses"];
16285
+ journey?: components["schemas"]["EncourageJourney"];
16286
+ submissions?: components["schemas"]["EncourageSubmissions"];
16287
+ classes?: components["schemas"]["EncourageClassPerformance"][];
16288
+ topStudents?: components["schemas"]["EncourageTopStudent"][];
16289
+ topTeachers?: components["schemas"]["EncourageTopTeacher"][];
16290
+ };
15998
16291
  UserCreationRequest: {
15999
16292
  /**
16000
16293
  * Format: uuid
@@ -21720,6 +22013,7 @@ declare function createQuizService(apiClient: AcademeApiClient): {
21720
22013
  search?: string;
21721
22014
  page?: number;
21722
22015
  limit?: number;
22016
+ randomize?: boolean;
21723
22017
  };
21724
22018
  header?: never;
21725
22019
  path?: never;
@@ -21750,6 +22044,7 @@ declare function createQuizService(apiClient: AcademeApiClient): {
21750
22044
  search?: string;
21751
22045
  page?: number;
21752
22046
  limit?: number;
22047
+ randomize?: boolean;
21753
22048
  } | undefined;
21754
22049
  };
21755
22050
  }, `${string}/${string}`>>;
@@ -24500,7 +24795,6 @@ interface UpdateChallengeStepBody {
24500
24795
  name?: string;
24501
24796
  description?: string;
24502
24797
  index?: number;
24503
- courseId?: string;
24504
24798
  courseModuleId?: string;
24505
24799
  tutorialTitle?: string;
24506
24800
  tutorialDescription?: string;
@@ -24532,6 +24826,7 @@ declare function createChallengeService(apiClient: AcademeApiClient): {
24532
24826
  isActive?: boolean;
24533
24827
  templatesOnly?: boolean;
24534
24828
  search?: string;
24829
+ include?: "steps";
24535
24830
  page?: components["parameters"]["page"];
24536
24831
  limit?: components["parameters"]["limit"];
24537
24832
  };
@@ -24564,6 +24859,7 @@ declare function createChallengeService(apiClient: AcademeApiClient): {
24564
24859
  isActive?: boolean;
24565
24860
  templatesOnly?: boolean;
24566
24861
  search?: string;
24862
+ include?: "steps";
24567
24863
  page?: components["parameters"]["page"];
24568
24864
  limit?: components["parameters"]["limit"];
24569
24865
  } | undefined;
@@ -24628,6 +24924,7 @@ declare function createChallengeService(apiClient: AcademeApiClient): {
24628
24924
  isGroup?: boolean;
24629
24925
  maxGroupMembers?: number;
24630
24926
  isInviteOnly?: boolean;
24927
+ courseId: string;
24631
24928
  institutionId?: string | null;
24632
24929
  serieId?: string;
24633
24930
  index?: number;
@@ -24666,6 +24963,7 @@ declare function createChallengeService(apiClient: AcademeApiClient): {
24666
24963
  isGroup?: boolean;
24667
24964
  maxGroupMembers?: number;
24668
24965
  isInviteOnly?: boolean;
24966
+ courseId: string;
24669
24967
  institutionId?: string | null;
24670
24968
  serieId?: string;
24671
24969
  index?: number;
@@ -24699,6 +24997,7 @@ declare function createChallengeService(apiClient: AcademeApiClient): {
24699
24997
  isGroup?: boolean;
24700
24998
  maxGroupMembers?: number;
24701
24999
  isInviteOnly?: boolean;
25000
+ courseId?: string;
24702
25001
  serieId?: string;
24703
25002
  index?: number;
24704
25003
  submissionType?: "images" | "videos" | "audio" | "files" | "links";
@@ -24739,6 +25038,7 @@ declare function createChallengeService(apiClient: AcademeApiClient): {
24739
25038
  isGroup?: boolean;
24740
25039
  maxGroupMembers?: number;
24741
25040
  isInviteOnly?: boolean;
25041
+ courseId?: string;
24742
25042
  serieId?: string;
24743
25043
  index?: number;
24744
25044
  submissionType?: "images" | "videos" | "audio" | "files" | "links";
@@ -24844,7 +25144,6 @@ declare function createChallengeService(apiClient: AcademeApiClient): {
24844
25144
  name: string;
24845
25145
  description?: string;
24846
25146
  index: number;
24847
- courseId?: string;
24848
25147
  courseModuleId?: string;
24849
25148
  tutorialTitle?: string;
24850
25149
  tutorialDescription?: string;
@@ -24879,7 +25178,6 @@ declare function createChallengeService(apiClient: AcademeApiClient): {
24879
25178
  name: string;
24880
25179
  description?: string;
24881
25180
  index: number;
24882
- courseId?: string;
24883
25181
  courseModuleId?: string;
24884
25182
  tutorialTitle?: string;
24885
25183
  tutorialDescription?: string;