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.
package/dist/index.d.ts CHANGED
@@ -72,7 +72,7 @@ declare function CosmicStarsCanvas({ containerRef }: CosmicStarsCanvasProps): re
72
72
  type FrameKind = 'sphere' | 'pentagon' | 'hexagonWings' | 'circleLaurel' | 'hexagonRibbon' | 'shieldWings' | 'pentagonCrown';
73
73
 
74
74
  type JourneyStepSize = 'sm' | 'md';
75
- type JourneyStepType = 'challenge' | 'course' | 'tutorial' | 'publication' | 'evaluation' | 'certificate';
75
+ type JourneyStepType = 'challenge' | 'course' | 'tutorial' | 'publication' | 'evaluation' | 'certificate' | 'redirect';
76
76
  interface JourneyStepProps {
77
77
  color?: string;
78
78
  stepType?: JourneyStepType;
@@ -9899,6 +9899,67 @@ interface paths {
9899
9899
  patch?: never;
9900
9900
  trace?: never;
9901
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
+ };
9902
9963
  "/quiz-questions/{id}": {
9903
9964
  parameters: {
9904
9965
  query?: never;
@@ -10111,6 +10172,145 @@ interface paths {
10111
10172
  patch?: never;
10112
10173
  trace?: never;
10113
10174
  };
10175
+ "/quiz/with-context": {
10176
+ parameters: {
10177
+ query?: never;
10178
+ header?: never;
10179
+ path?: never;
10180
+ cookie?: never;
10181
+ };
10182
+ /**
10183
+ * List quizzes with course/module/category context
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.
10185
+ */
10186
+ get: {
10187
+ parameters: {
10188
+ query?: {
10189
+ /** @description Filter by quiz title */
10190
+ title?: string;
10191
+ /** @description Filter by active status */
10192
+ isActive?: boolean;
10193
+ /** @description Filter by creator user ID */
10194
+ createdBy?: string;
10195
+ /** @description Search in title */
10196
+ search?: string;
10197
+ /** @description Page number */
10198
+ page?: number;
10199
+ /** @description Items per page */
10200
+ limit?: number;
10201
+ };
10202
+ header?: never;
10203
+ path?: never;
10204
+ cookie?: never;
10205
+ };
10206
+ requestBody?: never;
10207
+ responses: {
10208
+ /** @description List of quizzes with context */
10209
+ 200: {
10210
+ headers: {
10211
+ [name: string]: unknown;
10212
+ };
10213
+ content: {
10214
+ "application/json": {
10215
+ /** @example success */
10216
+ status?: string;
10217
+ data?: (components["schemas"]["Quiz"] & {
10218
+ context?: {
10219
+ course?: {
10220
+ id?: string;
10221
+ title?: string;
10222
+ } | null;
10223
+ module?: {
10224
+ id?: string;
10225
+ title?: string;
10226
+ } | null;
10227
+ category?: {
10228
+ id?: string;
10229
+ name?: string;
10230
+ color?: string | null;
10231
+ } | null;
10232
+ } | null;
10233
+ })[];
10234
+ meta?: components["schemas"]["PaginationMeta"];
10235
+ };
10236
+ };
10237
+ };
10238
+ 401: components["responses"]["Unauthorized"];
10239
+ 500: components["responses"]["ServerError"];
10240
+ };
10241
+ };
10242
+ put?: never;
10243
+ post?: never;
10244
+ delete?: never;
10245
+ options?: never;
10246
+ head?: never;
10247
+ patch?: never;
10248
+ trace?: never;
10249
+ };
10250
+ "/quiz/generate-questions": {
10251
+ parameters: {
10252
+ query?: never;
10253
+ header?: never;
10254
+ path?: never;
10255
+ cookie?: never;
10256
+ };
10257
+ get?: never;
10258
+ put?: never;
10259
+ /**
10260
+ * Generate quiz questions with AI
10261
+ * @description Gera perguntas a partir de um texto base via IA. Não persiste — apenas devolve.
10262
+ */
10263
+ post: {
10264
+ parameters: {
10265
+ query?: never;
10266
+ header?: never;
10267
+ path?: never;
10268
+ cookie?: never;
10269
+ };
10270
+ requestBody: {
10271
+ content: {
10272
+ "application/json": {
10273
+ text: string;
10274
+ numQuestions: number;
10275
+ difficulty?: "facil" | "normal" | "dificil";
10276
+ existingQuestions?: string[];
10277
+ model?: string;
10278
+ };
10279
+ };
10280
+ };
10281
+ responses: {
10282
+ /** @description Generated questions */
10283
+ 200: {
10284
+ headers: {
10285
+ [name: string]: unknown;
10286
+ };
10287
+ content: {
10288
+ "application/json": {
10289
+ /** @example success */
10290
+ status?: string;
10291
+ data?: {
10292
+ question_text: string;
10293
+ question_type: "multiple_choice" | "true_false";
10294
+ points: number;
10295
+ options: {
10296
+ text: string;
10297
+ is_correct: boolean;
10298
+ }[];
10299
+ }[];
10300
+ };
10301
+ };
10302
+ };
10303
+ 400: components["responses"]["BadRequest"];
10304
+ 401: components["responses"]["Unauthorized"];
10305
+ 500: components["responses"]["ServerError"];
10306
+ };
10307
+ };
10308
+ delete?: never;
10309
+ options?: never;
10310
+ head?: never;
10311
+ patch?: never;
10312
+ trace?: never;
10313
+ };
10114
10314
  "/quiz/{id}": {
10115
10315
  parameters: {
10116
10316
  query?: never;
@@ -16063,7 +16263,7 @@ interface components {
16063
16263
  * @example course
16064
16264
  * @enum {string}
16065
16265
  */
16066
- type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
16266
+ type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
16067
16267
  /**
16068
16268
  * @description Cor hex do step catalog
16069
16269
  * @example #8030D8
@@ -16095,6 +16295,8 @@ interface components {
16095
16295
  * @example Introdução a IA
16096
16296
  */
16097
16297
  courseModuleName?: string | null;
16298
+ /** @description URL de redirecionamento desta etapa (apenas quando type=redirect) */
16299
+ redirectUrl?: string | null;
16098
16300
  };
16099
16301
  /** @description Desafio da jornada com suas etapas e status computados */
16100
16302
  JourneyChallengeView: {
@@ -22867,6 +23069,9 @@ type GetQuizzesParams = {
22867
23069
  page?: number;
22868
23070
  limit?: number;
22869
23071
  };
23072
+ type GetQuizzesWithContextParams = paths['/quiz/with-context']['get']['parameters']['query'];
23073
+ type GenerateQuizQuestionsBody = paths['/quiz/generate-questions']['post']['requestBody']['content']['application/json'];
23074
+ type BulkCreateQuizQuestionsBody = paths['/quiz-questions/bulk']['post']['requestBody']['content']['application/json'];
22870
23075
  type GetQuizQuestionsParams = paths['/quiz-questions']['get']['parameters']['query'];
22871
23076
  type GetQuizQuestionAnswersParams = paths['/quiz-question-answers']['get']['parameters']['query'];
22872
23077
  type GetQuizAttemptsParams = paths['/quiz-attempts']['get']['parameters']['query'];
@@ -22912,6 +23117,125 @@ declare function createQuizService(apiClient: AcademeApiClient): {
22912
23117
  query: GetQuizzesParams | undefined;
22913
23118
  };
22914
23119
  }, `${string}/${string}`>>;
23120
+ /**
23121
+ * List quizzes enriched with their course/module/category context.
23122
+ * Tailored for the backoffice listing.
23123
+ */
23124
+ getAllWithContext(params?: GetQuizzesWithContextParams): Promise<openapi_fetch.FetchResponse<{
23125
+ parameters: {
23126
+ query?: {
23127
+ title?: string;
23128
+ isActive?: boolean;
23129
+ createdBy?: string;
23130
+ search?: string;
23131
+ page?: number;
23132
+ limit?: number;
23133
+ };
23134
+ header?: never;
23135
+ path?: never;
23136
+ cookie?: never;
23137
+ };
23138
+ requestBody?: never;
23139
+ responses: {
23140
+ 200: {
23141
+ headers: {
23142
+ [name: string]: unknown;
23143
+ };
23144
+ content: {
23145
+ "application/json": {
23146
+ status?: string;
23147
+ data?: (components["schemas"]["Quiz"] & {
23148
+ context?: {
23149
+ course?: {
23150
+ id?: string;
23151
+ title?: string;
23152
+ } | null;
23153
+ module?: {
23154
+ id?: string;
23155
+ title?: string;
23156
+ } | null;
23157
+ category?: {
23158
+ id?: string;
23159
+ name?: string;
23160
+ color?: string | null;
23161
+ } | null;
23162
+ } | null;
23163
+ })[];
23164
+ meta?: components["schemas"]["PaginationMeta"];
23165
+ };
23166
+ };
23167
+ };
23168
+ 401: components["responses"]["Unauthorized"];
23169
+ 500: components["responses"]["ServerError"];
23170
+ };
23171
+ }, {
23172
+ params: {
23173
+ query: {
23174
+ title?: string;
23175
+ isActive?: boolean;
23176
+ createdBy?: string;
23177
+ search?: string;
23178
+ page?: number;
23179
+ limit?: number;
23180
+ } | undefined;
23181
+ };
23182
+ }, `${string}/${string}`>>;
23183
+ /**
23184
+ * Generate quiz questions from a base text using AI.
23185
+ * The OpenRouter key lives only on the server — this just calls the
23186
+ * authenticated backend endpoint.
23187
+ */
23188
+ generateQuestions(body: GenerateQuizQuestionsBody): Promise<openapi_fetch.FetchResponse<{
23189
+ parameters: {
23190
+ query?: never;
23191
+ header?: never;
23192
+ path?: never;
23193
+ cookie?: never;
23194
+ };
23195
+ requestBody: {
23196
+ content: {
23197
+ "application/json": {
23198
+ text: string;
23199
+ numQuestions: number;
23200
+ difficulty?: "facil" | "normal" | "dificil";
23201
+ existingQuestions?: string[];
23202
+ model?: string;
23203
+ };
23204
+ };
23205
+ };
23206
+ responses: {
23207
+ 200: {
23208
+ headers: {
23209
+ [name: string]: unknown;
23210
+ };
23211
+ content: {
23212
+ "application/json": {
23213
+ status?: string;
23214
+ data?: {
23215
+ question_text: string;
23216
+ question_type: "multiple_choice" | "true_false";
23217
+ points: number;
23218
+ options: {
23219
+ text: string;
23220
+ is_correct: boolean;
23221
+ }[];
23222
+ }[];
23223
+ };
23224
+ };
23225
+ };
23226
+ 400: components["responses"]["BadRequest"];
23227
+ 401: components["responses"]["Unauthorized"];
23228
+ 500: components["responses"]["ServerError"];
23229
+ };
23230
+ }, {
23231
+ body: {
23232
+ text: string;
23233
+ numQuestions: number;
23234
+ difficulty?: "facil" | "normal" | "dificil";
23235
+ existingQuestions?: string[];
23236
+ model?: string;
23237
+ };
23238
+ }, `${string}/${string}`>>;
22915
23239
  /**
22916
23240
  * Get quiz by ID
22917
23241
  */
@@ -23202,6 +23526,62 @@ declare function createQuizService(apiClient: AcademeApiClient): {
23202
23526
  points?: number;
23203
23527
  };
23204
23528
  }, `${string}/${string}`>>;
23529
+ /**
23530
+ * Bulk create quiz questions (with their answers) for a quiz.
23531
+ */
23532
+ bulkCreateQuestions(body: BulkCreateQuizQuestionsBody): Promise<openapi_fetch.FetchResponse<{
23533
+ parameters: {
23534
+ query?: never;
23535
+ header?: never;
23536
+ path?: never;
23537
+ cookie?: never;
23538
+ };
23539
+ requestBody: {
23540
+ content: {
23541
+ "application/json": {
23542
+ quizId: string;
23543
+ questions: {
23544
+ text: string;
23545
+ type: "multiple_choice" | "true_false" | "open";
23546
+ points?: number;
23547
+ options?: {
23548
+ text: string;
23549
+ is_correct: boolean;
23550
+ }[];
23551
+ }[];
23552
+ };
23553
+ };
23554
+ };
23555
+ responses: {
23556
+ 201: {
23557
+ headers: {
23558
+ [name: string]: unknown;
23559
+ };
23560
+ content: {
23561
+ "application/json": {
23562
+ status?: string;
23563
+ data?: components["schemas"]["QuizQuestion"][];
23564
+ };
23565
+ };
23566
+ };
23567
+ 400: components["responses"]["BadRequest"];
23568
+ 401: components["responses"]["Unauthorized"];
23569
+ 500: components["responses"]["ServerError"];
23570
+ };
23571
+ }, {
23572
+ body: {
23573
+ quizId: string;
23574
+ questions: {
23575
+ text: string;
23576
+ type: "multiple_choice" | "true_false" | "open";
23577
+ points?: number;
23578
+ options?: {
23579
+ text: string;
23580
+ is_correct: boolean;
23581
+ }[];
23582
+ }[];
23583
+ };
23584
+ }, `${string}/${string}`>>;
23205
23585
  /**
23206
23586
  * Update quiz question
23207
23587
  */
package/dist/index.esm.js CHANGED
@@ -5381,6 +5381,27 @@ function createQuizService(apiClient) {
5381
5381
  },
5382
5382
  });
5383
5383
  },
5384
+ /**
5385
+ * List quizzes enriched with their course/module/category context.
5386
+ * Tailored for the backoffice listing.
5387
+ */
5388
+ getAllWithContext(params) {
5389
+ return apiClient.GET('/quiz/with-context', {
5390
+ params: {
5391
+ query: params,
5392
+ },
5393
+ });
5394
+ },
5395
+ /**
5396
+ * Generate quiz questions from a base text using AI.
5397
+ * The OpenRouter key lives only on the server — this just calls the
5398
+ * authenticated backend endpoint.
5399
+ */
5400
+ generateQuestions(body) {
5401
+ return apiClient.POST('/quiz/generate-questions', {
5402
+ body,
5403
+ });
5404
+ },
5384
5405
  /**
5385
5406
  * Get quiz by ID
5386
5407
  */
@@ -5443,6 +5464,14 @@ function createQuizService(apiClient) {
5443
5464
  body: data,
5444
5465
  });
5445
5466
  },
5467
+ /**
5468
+ * Bulk create quiz questions (with their answers) for a quiz.
5469
+ */
5470
+ bulkCreateQuestions(body) {
5471
+ return apiClient.POST('/quiz-questions/bulk', {
5472
+ body,
5473
+ });
5474
+ },
5446
5475
  /**
5447
5476
  * Update quiz question
5448
5477
  */
@@ -10710,6 +10739,7 @@ const STEP_TYPE_TO_THEME = {
10710
10739
  publication: 'orange',
10711
10740
  evaluation: 'gold',
10712
10741
  certificate: 'green',
10742
+ redirect: 'blue',
10713
10743
  };
10714
10744
  // Espelha a página de journey do app: todo step é uma esfera 3D, diferenciada
10715
10745
  // apenas por cor (STEP_TYPE_TO_THEME) e ícone. Os frames de polígono seguem
@@ -10721,6 +10751,7 @@ const STEP_TYPE_TO_FRAME = {
10721
10751
  publication: 'sphere',
10722
10752
  evaluation: 'sphere',
10723
10753
  certificate: 'sphere',
10754
+ redirect: 'sphere',
10724
10755
  };
10725
10756
  const INACTIVE_THEME = {
10726
10757
  shadow: '#0a0a0a',