academe-kit 0.16.0 → 0.17.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.
@@ -21,6 +21,7 @@ type GetQuizzesParams = {
21
21
  type GetQuizzesWithContextParams = paths['/quiz/with-context']['get']['parameters']['query'];
22
22
  type GenerateQuizQuestionsBody = paths['/quiz/generate-questions']['post']['requestBody']['content']['application/json'];
23
23
  type BulkCreateQuizQuestionsBody = paths['/quiz-questions/bulk']['post']['requestBody']['content']['application/json'];
24
+ type GenerateQuizExplanationsBody = NonNullable<paths['/quiz-questions/{id}/generate-explanations']['post']['requestBody']>['content']['application/json'];
24
25
  type GetQuizQuestionsParams = paths['/quiz-questions']['get']['parameters']['query'];
25
26
  type GetQuizQuestionAnswersParams = paths['/quiz-question-answers']['get']['parameters']['query'];
26
27
  type GetQuizAttemptsParams = paths['/quiz-attempts']['get']['parameters']['query'];
@@ -167,6 +168,7 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
167
168
  options?: {
168
169
  text?: string;
169
170
  is_correct?: boolean;
171
+ explanation?: string;
170
172
  }[];
171
173
  }[];
172
174
  };
@@ -496,6 +498,7 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
496
498
  options?: {
497
499
  text?: string;
498
500
  is_correct?: boolean;
501
+ explanation?: string;
499
502
  }[];
500
503
  }[];
501
504
  };
@@ -527,10 +530,60 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
527
530
  options?: {
528
531
  text?: string;
529
532
  is_correct?: boolean;
533
+ explanation?: string;
530
534
  }[];
531
535
  }[];
532
536
  };
533
537
  }, `${string}/${string}`>>;
538
+ /**
539
+ * Generate the explanation of every answer of an existing question, with AI.
540
+ *
541
+ * Backfill das perguntas criadas antes de a explicação existir. Sobrescreve
542
+ * o que houver — confirme com o usuário antes de chamar.
543
+ */
544
+ generateQuestionExplanations(id: string, body?: GenerateQuizExplanationsBody): Promise<import("openapi-fetch").FetchResponse<{
545
+ parameters: {
546
+ query?: never;
547
+ header?: never;
548
+ path: {
549
+ id: string;
550
+ };
551
+ cookie?: never;
552
+ };
553
+ requestBody?: {
554
+ content: {
555
+ "application/json": {
556
+ model?: string;
557
+ };
558
+ };
559
+ };
560
+ responses: {
561
+ 200: {
562
+ headers: {
563
+ [name: string]: unknown;
564
+ };
565
+ content: {
566
+ "application/json": {
567
+ status?: string;
568
+ data?: components["schemas"]["QuizQuestion"];
569
+ };
570
+ };
571
+ };
572
+ 400: components["responses"]["BadRequest"];
573
+ 401: components["responses"]["Unauthorized"];
574
+ 404: components["responses"]["NotFound"];
575
+ 500: components["responses"]["ServerError"];
576
+ };
577
+ }, {
578
+ params: {
579
+ path: {
580
+ id: string;
581
+ };
582
+ };
583
+ body: {
584
+ model?: string;
585
+ };
586
+ }, `${string}/${string}`>>;
534
587
  /**
535
588
  * Update quiz question
536
589
  */
@@ -728,6 +781,7 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
728
781
  questionId: string;
729
782
  answer: string;
730
783
  isCorrect: boolean;
784
+ explanation?: string;
731
785
  };
732
786
  }, `${string}/${string}`>>;
733
787
  /**
@@ -773,6 +827,7 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
773
827
  body: {
774
828
  answer?: string;
775
829
  isCorrect?: boolean;
830
+ explanation?: string;
776
831
  };
777
832
  }, `${string}/${string}`>>;
778
833
  /**
@@ -11411,6 +11411,62 @@ export interface paths {
11411
11411
  };
11412
11412
  trace?: never;
11413
11413
  };
11414
+ "/quiz-questions/{id}/generate-explanations": {
11415
+ parameters: {
11416
+ query?: never;
11417
+ header?: never;
11418
+ path?: never;
11419
+ cookie?: never;
11420
+ };
11421
+ get?: never;
11422
+ put?: never;
11423
+ /**
11424
+ * Generate answer explanations with AI
11425
+ * @description Preenche via IA a explicação de cada alternativa de uma pergunta que já existe — o backfill dos quizzes criados antes da feature. Sobrescreve as explicações existentes; o backoffice confirma antes de chamar.
11426
+ */
11427
+ post: {
11428
+ parameters: {
11429
+ query?: never;
11430
+ header?: never;
11431
+ path: {
11432
+ id: string;
11433
+ };
11434
+ cookie?: never;
11435
+ };
11436
+ requestBody?: {
11437
+ content: {
11438
+ "application/json": {
11439
+ /** @description Modelo OpenRouter a usar. Omitido, usa o padrão do servidor. */
11440
+ model?: string;
11441
+ };
11442
+ };
11443
+ };
11444
+ responses: {
11445
+ /** @description Pergunta com as alternativas atualizadas */
11446
+ 200: {
11447
+ headers: {
11448
+ [name: string]: unknown;
11449
+ };
11450
+ content: {
11451
+ "application/json": {
11452
+ /** @example success */
11453
+ status?: string;
11454
+ data?: components["schemas"]["QuizQuestion"];
11455
+ };
11456
+ };
11457
+ };
11458
+ 400: components["responses"]["BadRequest"];
11459
+ 401: components["responses"]["Unauthorized"];
11460
+ 404: components["responses"]["NotFound"];
11461
+ 500: components["responses"]["ServerError"];
11462
+ };
11463
+ };
11464
+ delete?: never;
11465
+ options?: never;
11466
+ head?: never;
11467
+ patch?: never;
11468
+ trace?: never;
11469
+ };
11414
11470
  "/quiz-questions/bulk": {
11415
11471
  parameters: {
11416
11472
  query?: never;
@@ -11444,6 +11500,8 @@ export interface paths {
11444
11500
  options?: {
11445
11501
  text?: string;
11446
11502
  is_correct?: boolean;
11503
+ /** @description Resumo revelado ao aluno ao confirmar a resposta. */
11504
+ explanation?: string;
11447
11505
  }[];
11448
11506
  }[];
11449
11507
  };
@@ -11915,6 +11973,8 @@ export interface paths {
11915
11973
  options?: {
11916
11974
  text?: string;
11917
11975
  is_correct?: boolean;
11976
+ /** @description Resumo revelado ao aluno ao confirmar a resposta. String vazia quando a IA não produziu. */
11977
+ explanation?: string;
11918
11978
  }[];
11919
11979
  }[];
11920
11980
  };
@@ -20288,6 +20348,11 @@ export interface components {
20288
20348
  answer?: string;
20289
20349
  /** @example true */
20290
20350
  isCorrect?: boolean;
20351
+ /**
20352
+ * @description Resumo revelado ao aluno ao confirmar a resposta. Na alternativa correta explica o conceito; nas incorretas, o erro que a opção representa. NULL nas perguntas anteriores à feature.
20353
+ * @example O 'S' significa 'Secure' e indica que o protocolo utiliza SSL/TLS.
20354
+ */
20355
+ explanation?: string | null;
20291
20356
  /** Format: date-time */
20292
20357
  createdAt?: string;
20293
20358
  /** Format: date-time */
@@ -20300,10 +20365,14 @@ export interface components {
20300
20365
  answer: string;
20301
20366
  /** @example true */
20302
20367
  isCorrect: boolean;
20368
+ /** @description Resumo revelado ao aluno ao confirmar a resposta. String vazia limpa. */
20369
+ explanation?: string;
20303
20370
  };
20304
20371
  UpdateQuizQuestionAnswerDto: {
20305
20372
  answer?: string;
20306
20373
  isCorrect?: boolean;
20374
+ /** @description Resumo revelado ao aluno ao confirmar a resposta. String vazia limpa. */
20375
+ explanation?: string;
20307
20376
  };
20308
20377
  QuizAttempt: {
20309
20378
  /** Format: uuid */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "academe-kit",
3
- "version": "0.16.0",
3
+ "version": "0.17.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",