academe-kit 0.11.6 → 0.12.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.
@@ -2,7 +2,7 @@ import { type ReactNode } from 'react';
2
2
  import './journey-step.css';
3
3
  import type { FrameKind } from './frames/types';
4
4
  export type JourneyStepSize = 'sm' | 'md';
5
- export type JourneyStepType = 'challenge' | 'course' | 'tutorial' | 'publication' | 'evaluation' | 'certificate';
5
+ export type JourneyStepType = 'challenge' | 'course' | 'tutorial' | 'publication' | 'evaluation' | 'certificate' | 'redirect';
6
6
  export interface JourneyStepProps {
7
7
  color?: string;
8
8
  stepType?: JourneyStepType;
@@ -18,6 +18,9 @@ type GetQuizzesParams = {
18
18
  page?: number;
19
19
  limit?: number;
20
20
  };
21
+ type GetQuizzesWithContextParams = paths['/quiz/with-context']['get']['parameters']['query'];
22
+ type GenerateQuizQuestionsBody = paths['/quiz/generate-questions']['post']['requestBody']['content']['application/json'];
23
+ type BulkCreateQuizQuestionsBody = paths['/quiz-questions/bulk']['post']['requestBody']['content']['application/json'];
21
24
  type GetQuizQuestionsParams = paths['/quiz-questions']['get']['parameters']['query'];
22
25
  type GetQuizQuestionAnswersParams = paths['/quiz-question-answers']['get']['parameters']['query'];
23
26
  type GetQuizAttemptsParams = paths['/quiz-attempts']['get']['parameters']['query'];
@@ -63,6 +66,125 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
63
66
  query: GetQuizzesParams | undefined;
64
67
  };
65
68
  }, `${string}/${string}`>>;
69
+ /**
70
+ * List quizzes enriched with their course/module/category context.
71
+ * Tailored for the backoffice listing.
72
+ */
73
+ getAllWithContext(params?: GetQuizzesWithContextParams): Promise<import("openapi-fetch").FetchResponse<{
74
+ parameters: {
75
+ query?: {
76
+ title?: string;
77
+ isActive?: boolean;
78
+ createdBy?: string;
79
+ search?: string;
80
+ page?: number;
81
+ limit?: number;
82
+ };
83
+ header?: never;
84
+ path?: never;
85
+ cookie?: never;
86
+ };
87
+ requestBody?: never;
88
+ responses: {
89
+ 200: {
90
+ headers: {
91
+ [name: string]: unknown;
92
+ };
93
+ content: {
94
+ "application/json": {
95
+ status?: string;
96
+ data?: (components["schemas"]["Quiz"] & {
97
+ context?: {
98
+ course?: {
99
+ id?: string;
100
+ title?: string;
101
+ } | null;
102
+ module?: {
103
+ id?: string;
104
+ title?: string;
105
+ } | null;
106
+ category?: {
107
+ id?: string;
108
+ name?: string;
109
+ color?: string | null;
110
+ } | null;
111
+ } | null;
112
+ })[];
113
+ meta?: components["schemas"]["PaginationMeta"];
114
+ };
115
+ };
116
+ };
117
+ 401: components["responses"]["Unauthorized"];
118
+ 500: components["responses"]["ServerError"];
119
+ };
120
+ }, {
121
+ params: {
122
+ query: {
123
+ title?: string;
124
+ isActive?: boolean;
125
+ createdBy?: string;
126
+ search?: string;
127
+ page?: number;
128
+ limit?: number;
129
+ } | undefined;
130
+ };
131
+ }, `${string}/${string}`>>;
132
+ /**
133
+ * Generate quiz questions from a base text using AI.
134
+ * The OpenRouter key lives only on the server — this just calls the
135
+ * authenticated backend endpoint.
136
+ */
137
+ generateQuestions(body: GenerateQuizQuestionsBody): Promise<import("openapi-fetch").FetchResponse<{
138
+ parameters: {
139
+ query?: never;
140
+ header?: never;
141
+ path?: never;
142
+ cookie?: never;
143
+ };
144
+ requestBody: {
145
+ content: {
146
+ "application/json": {
147
+ text: string;
148
+ numQuestions: number;
149
+ difficulty?: "facil" | "normal" | "dificil";
150
+ existingQuestions?: string[];
151
+ model?: string;
152
+ };
153
+ };
154
+ };
155
+ responses: {
156
+ 200: {
157
+ headers: {
158
+ [name: string]: unknown;
159
+ };
160
+ content: {
161
+ "application/json": {
162
+ status?: string;
163
+ data?: {
164
+ question_text: string;
165
+ question_type: "multiple_choice" | "true_false";
166
+ points: number;
167
+ options: {
168
+ text: string;
169
+ is_correct: boolean;
170
+ }[];
171
+ }[];
172
+ };
173
+ };
174
+ };
175
+ 400: components["responses"]["BadRequest"];
176
+ 401: components["responses"]["Unauthorized"];
177
+ 500: components["responses"]["ServerError"];
178
+ };
179
+ }, {
180
+ body: {
181
+ text: string;
182
+ numQuestions: number;
183
+ difficulty?: "facil" | "normal" | "dificil";
184
+ existingQuestions?: string[];
185
+ model?: string;
186
+ };
187
+ }, `${string}/${string}`>>;
66
188
  /**
67
189
  * Get quiz by ID
68
190
  */
@@ -353,6 +475,62 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
353
475
  points?: number;
354
476
  };
355
477
  }, `${string}/${string}`>>;
478
+ /**
479
+ * Bulk create quiz questions (with their answers) for a quiz.
480
+ */
481
+ bulkCreateQuestions(body: BulkCreateQuizQuestionsBody): Promise<import("openapi-fetch").FetchResponse<{
482
+ parameters: {
483
+ query?: never;
484
+ header?: never;
485
+ path?: never;
486
+ cookie?: never;
487
+ };
488
+ requestBody: {
489
+ content: {
490
+ "application/json": {
491
+ quizId: string;
492
+ questions: {
493
+ text: string;
494
+ type: "multiple_choice" | "true_false" | "open";
495
+ points?: number;
496
+ options?: {
497
+ text: string;
498
+ is_correct: boolean;
499
+ }[];
500
+ }[];
501
+ };
502
+ };
503
+ };
504
+ responses: {
505
+ 201: {
506
+ headers: {
507
+ [name: string]: unknown;
508
+ };
509
+ content: {
510
+ "application/json": {
511
+ status?: string;
512
+ data?: components["schemas"]["QuizQuestion"][];
513
+ };
514
+ };
515
+ };
516
+ 400: components["responses"]["BadRequest"];
517
+ 401: components["responses"]["Unauthorized"];
518
+ 500: components["responses"]["ServerError"];
519
+ };
520
+ }, {
521
+ body: {
522
+ quizId: string;
523
+ questions: {
524
+ text: string;
525
+ type: "multiple_choice" | "true_false" | "open";
526
+ points?: number;
527
+ options?: {
528
+ text: string;
529
+ is_correct: boolean;
530
+ }[];
531
+ }[];
532
+ };
533
+ }, `${string}/${string}`>>;
356
534
  /**
357
535
  * Update quiz question
358
536
  */
@@ -9731,6 +9731,67 @@ export interface paths {
9731
9731
  patch?: never;
9732
9732
  trace?: never;
9733
9733
  };
9734
+ "/quiz-questions/bulk": {
9735
+ parameters: {
9736
+ query?: never;
9737
+ header?: never;
9738
+ path?: never;
9739
+ cookie?: never;
9740
+ };
9741
+ get?: never;
9742
+ put?: never;
9743
+ /**
9744
+ * Bulk create quiz questions
9745
+ * @description Cria várias perguntas (com respostas) de uma vez para um quiz.
9746
+ */
9747
+ post: {
9748
+ parameters: {
9749
+ query?: never;
9750
+ header?: never;
9751
+ path?: never;
9752
+ cookie?: never;
9753
+ };
9754
+ requestBody: {
9755
+ content: {
9756
+ "application/json": {
9757
+ quizId: string;
9758
+ questions: {
9759
+ text: string;
9760
+ type: "multiple_choice" | "true_false" | "open";
9761
+ points?: number;
9762
+ options?: {
9763
+ text: string;
9764
+ is_correct: boolean;
9765
+ }[];
9766
+ }[];
9767
+ };
9768
+ };
9769
+ };
9770
+ responses: {
9771
+ /** @description Questions created */
9772
+ 201: {
9773
+ headers: {
9774
+ [name: string]: unknown;
9775
+ };
9776
+ content: {
9777
+ "application/json": {
9778
+ /** @example success */
9779
+ status?: string;
9780
+ data?: components["schemas"]["QuizQuestion"][];
9781
+ };
9782
+ };
9783
+ };
9784
+ 400: components["responses"]["BadRequest"];
9785
+ 401: components["responses"]["Unauthorized"];
9786
+ 500: components["responses"]["ServerError"];
9787
+ };
9788
+ };
9789
+ delete?: never;
9790
+ options?: never;
9791
+ head?: never;
9792
+ patch?: never;
9793
+ trace?: never;
9794
+ };
9734
9795
  "/quiz-questions/{id}": {
9735
9796
  parameters: {
9736
9797
  query?: never;
@@ -9943,6 +10004,145 @@ export interface paths {
9943
10004
  patch?: never;
9944
10005
  trace?: never;
9945
10006
  };
10007
+ "/quiz/with-context": {
10008
+ parameters: {
10009
+ query?: never;
10010
+ header?: never;
10011
+ path?: never;
10012
+ cookie?: never;
10013
+ };
10014
+ /**
10015
+ * List quizzes with course/module/category context
10016
+ * @description Retrieve a paginated list of quizzes, each enriched with the course, module and category it belongs to. `context` is null for standalone quizzes.
10017
+ */
10018
+ get: {
10019
+ parameters: {
10020
+ query?: {
10021
+ /** @description Filter by quiz title */
10022
+ title?: string;
10023
+ /** @description Filter by active status */
10024
+ isActive?: boolean;
10025
+ /** @description Filter by creator user ID */
10026
+ createdBy?: string;
10027
+ /** @description Search in title */
10028
+ search?: string;
10029
+ /** @description Page number */
10030
+ page?: number;
10031
+ /** @description Items per page */
10032
+ limit?: number;
10033
+ };
10034
+ header?: never;
10035
+ path?: never;
10036
+ cookie?: never;
10037
+ };
10038
+ requestBody?: never;
10039
+ responses: {
10040
+ /** @description List of quizzes with context */
10041
+ 200: {
10042
+ headers: {
10043
+ [name: string]: unknown;
10044
+ };
10045
+ content: {
10046
+ "application/json": {
10047
+ /** @example success */
10048
+ status?: string;
10049
+ data?: (components["schemas"]["Quiz"] & {
10050
+ context?: {
10051
+ course?: {
10052
+ id?: string;
10053
+ title?: string;
10054
+ } | null;
10055
+ module?: {
10056
+ id?: string;
10057
+ title?: string;
10058
+ } | null;
10059
+ category?: {
10060
+ id?: string;
10061
+ name?: string;
10062
+ color?: string | null;
10063
+ } | null;
10064
+ } | null;
10065
+ })[];
10066
+ meta?: components["schemas"]["PaginationMeta"];
10067
+ };
10068
+ };
10069
+ };
10070
+ 401: components["responses"]["Unauthorized"];
10071
+ 500: components["responses"]["ServerError"];
10072
+ };
10073
+ };
10074
+ put?: never;
10075
+ post?: never;
10076
+ delete?: never;
10077
+ options?: never;
10078
+ head?: never;
10079
+ patch?: never;
10080
+ trace?: never;
10081
+ };
10082
+ "/quiz/generate-questions": {
10083
+ parameters: {
10084
+ query?: never;
10085
+ header?: never;
10086
+ path?: never;
10087
+ cookie?: never;
10088
+ };
10089
+ get?: never;
10090
+ put?: never;
10091
+ /**
10092
+ * Generate quiz questions with AI
10093
+ * @description Gera perguntas a partir de um texto base via IA. Não persiste — apenas devolve.
10094
+ */
10095
+ post: {
10096
+ parameters: {
10097
+ query?: never;
10098
+ header?: never;
10099
+ path?: never;
10100
+ cookie?: never;
10101
+ };
10102
+ requestBody: {
10103
+ content: {
10104
+ "application/json": {
10105
+ text: string;
10106
+ numQuestions: number;
10107
+ difficulty?: "facil" | "normal" | "dificil";
10108
+ existingQuestions?: string[];
10109
+ model?: string;
10110
+ };
10111
+ };
10112
+ };
10113
+ responses: {
10114
+ /** @description Generated questions */
10115
+ 200: {
10116
+ headers: {
10117
+ [name: string]: unknown;
10118
+ };
10119
+ content: {
10120
+ "application/json": {
10121
+ /** @example success */
10122
+ status?: string;
10123
+ data?: {
10124
+ question_text: string;
10125
+ question_type: "multiple_choice" | "true_false";
10126
+ points: number;
10127
+ options: {
10128
+ text: string;
10129
+ is_correct: boolean;
10130
+ }[];
10131
+ }[];
10132
+ };
10133
+ };
10134
+ };
10135
+ 400: components["responses"]["BadRequest"];
10136
+ 401: components["responses"]["Unauthorized"];
10137
+ 500: components["responses"]["ServerError"];
10138
+ };
10139
+ };
10140
+ delete?: never;
10141
+ options?: never;
10142
+ head?: never;
10143
+ patch?: never;
10144
+ trace?: never;
10145
+ };
9946
10146
  "/quiz/{id}": {
9947
10147
  parameters: {
9948
10148
  query?: never;
@@ -15895,7 +16095,7 @@ export interface components {
15895
16095
  * @example course
15896
16096
  * @enum {string}
15897
16097
  */
15898
- type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
16098
+ type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
15899
16099
  /**
15900
16100
  * @description Cor hex do step catalog
15901
16101
  * @example #8030D8
@@ -15927,6 +16127,8 @@ export interface components {
15927
16127
  * @example Introdução a IA
15928
16128
  */
15929
16129
  courseModuleName?: string | null;
16130
+ /** @description URL de redirecionamento desta etapa (apenas quando type=redirect) */
16131
+ redirectUrl?: string | null;
15930
16132
  };
15931
16133
  /** @description Desafio da jornada com suas etapas e status computados */
15932
16134
  JourneyChallengeView: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "academe-kit",
3
- "version": "0.11.6",
3
+ "version": "0.12.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",