academe-kit 0.12.0 → 0.12.1
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.cjs.map +1 -1
- package/dist/index.d.ts +120 -91
- package/dist/index.esm.js.map +1 -1
- package/dist/types/services/ChallengeService.d.ts +2 -0
- package/dist/types/services/QuizService.d.ts +10 -10
- package/dist/types/services/StepService.d.ts +6 -6
- package/dist/types/types/academe-api.d.ts +102 -75
- package/package.json +2 -2
|
@@ -397,6 +397,7 @@ export declare function createChallengeService(apiClient: AcademeApiClient): {
|
|
|
397
397
|
tutorialTitle?: string;
|
|
398
398
|
tutorialDescription?: string;
|
|
399
399
|
tutorialVideoUrl?: string;
|
|
400
|
+
redirectUrl?: string;
|
|
400
401
|
isActive?: boolean;
|
|
401
402
|
};
|
|
402
403
|
};
|
|
@@ -431,6 +432,7 @@ export declare function createChallengeService(apiClient: AcademeApiClient): {
|
|
|
431
432
|
tutorialTitle?: string;
|
|
432
433
|
tutorialDescription?: string;
|
|
433
434
|
tutorialVideoUrl?: string;
|
|
435
|
+
redirectUrl?: string;
|
|
434
436
|
isActive?: boolean;
|
|
435
437
|
};
|
|
436
438
|
}, `${string}/${string}`>>;
|
|
@@ -161,12 +161,12 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
|
|
|
161
161
|
"application/json": {
|
|
162
162
|
status?: string;
|
|
163
163
|
data?: {
|
|
164
|
-
question_text
|
|
165
|
-
question_type
|
|
166
|
-
points
|
|
167
|
-
options
|
|
168
|
-
text
|
|
169
|
-
is_correct
|
|
164
|
+
question_text?: string;
|
|
165
|
+
question_type?: "multiple_choice" | "true_false";
|
|
166
|
+
points?: number;
|
|
167
|
+
options?: {
|
|
168
|
+
text?: string;
|
|
169
|
+
is_correct?: boolean;
|
|
170
170
|
}[];
|
|
171
171
|
}[];
|
|
172
172
|
};
|
|
@@ -494,8 +494,8 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
|
|
|
494
494
|
type: "multiple_choice" | "true_false" | "open";
|
|
495
495
|
points?: number;
|
|
496
496
|
options?: {
|
|
497
|
-
text
|
|
498
|
-
is_correct
|
|
497
|
+
text?: string;
|
|
498
|
+
is_correct?: boolean;
|
|
499
499
|
}[];
|
|
500
500
|
}[];
|
|
501
501
|
};
|
|
@@ -525,8 +525,8 @@ export declare function createQuizService(apiClient: AcademeApiClient): {
|
|
|
525
525
|
type: "multiple_choice" | "true_false" | "open";
|
|
526
526
|
points?: number;
|
|
527
527
|
options?: {
|
|
528
|
-
text
|
|
529
|
-
is_correct
|
|
528
|
+
text?: string;
|
|
529
|
+
is_correct?: boolean;
|
|
530
530
|
}[];
|
|
531
531
|
}[];
|
|
532
532
|
};
|
|
@@ -10,7 +10,7 @@ export declare function createStepService(apiClient: AcademeApiClient): {
|
|
|
10
10
|
getAll(params?: GetStepsParams): Promise<import("openapi-fetch").FetchResponse<{
|
|
11
11
|
parameters: {
|
|
12
12
|
query?: {
|
|
13
|
-
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
|
|
13
|
+
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
|
|
14
14
|
isActive?: boolean;
|
|
15
15
|
};
|
|
16
16
|
header?: never;
|
|
@@ -36,7 +36,7 @@ export declare function createStepService(apiClient: AcademeApiClient): {
|
|
|
36
36
|
}, {
|
|
37
37
|
params: {
|
|
38
38
|
query: {
|
|
39
|
-
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
|
|
39
|
+
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
|
|
40
40
|
isActive?: boolean;
|
|
41
41
|
} | undefined;
|
|
42
42
|
};
|
|
@@ -94,7 +94,7 @@ export declare function createStepService(apiClient: AcademeApiClient): {
|
|
|
94
94
|
name: string;
|
|
95
95
|
color: string;
|
|
96
96
|
icon: string;
|
|
97
|
-
type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
|
|
97
|
+
type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
|
|
98
98
|
isActive?: boolean;
|
|
99
99
|
};
|
|
100
100
|
};
|
|
@@ -120,7 +120,7 @@ export declare function createStepService(apiClient: AcademeApiClient): {
|
|
|
120
120
|
name: string;
|
|
121
121
|
color: string;
|
|
122
122
|
icon: string;
|
|
123
|
-
type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
|
|
123
|
+
type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
|
|
124
124
|
isActive?: boolean;
|
|
125
125
|
};
|
|
126
126
|
}, `${string}/${string}`>>;
|
|
@@ -142,7 +142,7 @@ export declare function createStepService(apiClient: AcademeApiClient): {
|
|
|
142
142
|
name?: string;
|
|
143
143
|
color?: string;
|
|
144
144
|
icon?: string;
|
|
145
|
-
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
|
|
145
|
+
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
|
|
146
146
|
isActive?: boolean;
|
|
147
147
|
};
|
|
148
148
|
};
|
|
@@ -174,7 +174,7 @@ export declare function createStepService(apiClient: AcademeApiClient): {
|
|
|
174
174
|
name?: string;
|
|
175
175
|
color?: string;
|
|
176
176
|
icon?: string;
|
|
177
|
-
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
|
|
177
|
+
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
|
|
178
178
|
isActive?: boolean;
|
|
179
179
|
};
|
|
180
180
|
}, `${string}/${string}`>>;
|
|
@@ -2335,6 +2335,7 @@ export interface paths {
|
|
|
2335
2335
|
* Add a step to the challenge
|
|
2336
2336
|
* @description Polymorphic validation:
|
|
2337
2337
|
* - When step.type=tutorial, tutorialVideoUrl is required
|
|
2338
|
+
* - When step.type=redirect, redirectUrl is required
|
|
2338
2339
|
* - The course of a step is determined by the parent challenge's courseId.
|
|
2339
2340
|
* Optionally, courseModuleId pinpoints a specific module within that course.
|
|
2340
2341
|
* - tutorial fields are optional on any step type.
|
|
@@ -2365,6 +2366,8 @@ export interface paths {
|
|
|
2365
2366
|
tutorialTitle?: string;
|
|
2366
2367
|
tutorialDescription?: string;
|
|
2367
2368
|
tutorialVideoUrl?: string;
|
|
2369
|
+
/** @description Required when parent step type=redirect */
|
|
2370
|
+
redirectUrl?: string;
|
|
2368
2371
|
/** @default true */
|
|
2369
2372
|
isActive?: boolean;
|
|
2370
2373
|
};
|
|
@@ -9637,6 +9640,69 @@ export interface paths {
|
|
|
9637
9640
|
};
|
|
9638
9641
|
trace?: never;
|
|
9639
9642
|
};
|
|
9643
|
+
"/quiz-questions/bulk": {
|
|
9644
|
+
parameters: {
|
|
9645
|
+
query?: never;
|
|
9646
|
+
header?: never;
|
|
9647
|
+
path?: never;
|
|
9648
|
+
cookie?: never;
|
|
9649
|
+
};
|
|
9650
|
+
get?: never;
|
|
9651
|
+
put?: never;
|
|
9652
|
+
/**
|
|
9653
|
+
* Bulk create quiz questions
|
|
9654
|
+
* @description Cria várias perguntas (com suas respostas) de uma vez para um quiz. A ordem é atribuída sequencialmente a partir da última pergunta existente.
|
|
9655
|
+
*/
|
|
9656
|
+
post: {
|
|
9657
|
+
parameters: {
|
|
9658
|
+
query?: never;
|
|
9659
|
+
header?: never;
|
|
9660
|
+
path?: never;
|
|
9661
|
+
cookie?: never;
|
|
9662
|
+
};
|
|
9663
|
+
requestBody: {
|
|
9664
|
+
content: {
|
|
9665
|
+
"application/json": {
|
|
9666
|
+
/** Format: uuid */
|
|
9667
|
+
quizId: string;
|
|
9668
|
+
questions: {
|
|
9669
|
+
text: string;
|
|
9670
|
+
/** @enum {string} */
|
|
9671
|
+
type: "multiple_choice" | "true_false" | "open";
|
|
9672
|
+
points?: number;
|
|
9673
|
+
options?: {
|
|
9674
|
+
text?: string;
|
|
9675
|
+
is_correct?: boolean;
|
|
9676
|
+
}[];
|
|
9677
|
+
}[];
|
|
9678
|
+
};
|
|
9679
|
+
};
|
|
9680
|
+
};
|
|
9681
|
+
responses: {
|
|
9682
|
+
/** @description Perguntas criadas */
|
|
9683
|
+
201: {
|
|
9684
|
+
headers: {
|
|
9685
|
+
[name: string]: unknown;
|
|
9686
|
+
};
|
|
9687
|
+
content: {
|
|
9688
|
+
"application/json": {
|
|
9689
|
+
/** @example success */
|
|
9690
|
+
status?: string;
|
|
9691
|
+
data?: components["schemas"]["QuizQuestion"][];
|
|
9692
|
+
};
|
|
9693
|
+
};
|
|
9694
|
+
};
|
|
9695
|
+
400: components["responses"]["BadRequest"];
|
|
9696
|
+
401: components["responses"]["Unauthorized"];
|
|
9697
|
+
500: components["responses"]["ServerError"];
|
|
9698
|
+
};
|
|
9699
|
+
};
|
|
9700
|
+
delete?: never;
|
|
9701
|
+
options?: never;
|
|
9702
|
+
head?: never;
|
|
9703
|
+
patch?: never;
|
|
9704
|
+
trace?: never;
|
|
9705
|
+
};
|
|
9640
9706
|
"/quiz-questions": {
|
|
9641
9707
|
parameters: {
|
|
9642
9708
|
query?: never;
|
|
@@ -9731,67 +9797,6 @@ export interface paths {
|
|
|
9731
9797
|
patch?: never;
|
|
9732
9798
|
trace?: never;
|
|
9733
9799
|
};
|
|
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
|
-
};
|
|
9795
9800
|
"/quiz-questions/{id}": {
|
|
9796
9801
|
parameters: {
|
|
9797
9802
|
query?: never;
|
|
@@ -10013,7 +10018,7 @@ export interface paths {
|
|
|
10013
10018
|
};
|
|
10014
10019
|
/**
|
|
10015
10020
|
* 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.
|
|
10021
|
+
* @description Retrieve a paginated list of quizzes, each enriched with the course, module and category it belongs to. The relation is resolved on the server (Course.quizId / CourseModule.quizId), so consumers don't need to load every course to build the link map. `context` is null for standalone quizzes.
|
|
10017
10022
|
*/
|
|
10018
10023
|
get: {
|
|
10019
10024
|
parameters: {
|
|
@@ -10049,16 +10054,20 @@ export interface paths {
|
|
|
10049
10054
|
data?: (components["schemas"]["Quiz"] & {
|
|
10050
10055
|
context?: {
|
|
10051
10056
|
course?: {
|
|
10057
|
+
/** Format: uuid */
|
|
10052
10058
|
id?: string;
|
|
10053
10059
|
title?: string;
|
|
10054
10060
|
} | null;
|
|
10055
10061
|
module?: {
|
|
10062
|
+
/** Format: uuid */
|
|
10056
10063
|
id?: string;
|
|
10057
10064
|
title?: string;
|
|
10058
10065
|
} | null;
|
|
10059
10066
|
category?: {
|
|
10067
|
+
/** Format: uuid */
|
|
10060
10068
|
id?: string;
|
|
10061
10069
|
name?: string;
|
|
10070
|
+
/** @example #44bd32 */
|
|
10062
10071
|
color?: string | null;
|
|
10063
10072
|
} | null;
|
|
10064
10073
|
} | null;
|
|
@@ -10090,7 +10099,7 @@ export interface paths {
|
|
|
10090
10099
|
put?: never;
|
|
10091
10100
|
/**
|
|
10092
10101
|
* Generate quiz questions with AI
|
|
10093
|
-
* @description Gera perguntas a partir de um texto base
|
|
10102
|
+
* @description Gera perguntas de quiz a partir de um texto base usando IA (OpenRouter). NÃO persiste nada — apenas devolve as perguntas geradas para revisão no frontend. A chave da IA vive apenas no servidor.
|
|
10094
10103
|
*/
|
|
10095
10104
|
post: {
|
|
10096
10105
|
parameters: {
|
|
@@ -10102,16 +10111,23 @@ export interface paths {
|
|
|
10102
10111
|
requestBody: {
|
|
10103
10112
|
content: {
|
|
10104
10113
|
"application/json": {
|
|
10114
|
+
/** @description Texto base para gerar as perguntas */
|
|
10105
10115
|
text: string;
|
|
10106
10116
|
numQuestions: number;
|
|
10117
|
+
/**
|
|
10118
|
+
* @default normal
|
|
10119
|
+
* @enum {string}
|
|
10120
|
+
*/
|
|
10107
10121
|
difficulty?: "facil" | "normal" | "dificil";
|
|
10122
|
+
/** @description Textos de perguntas já existentes (para não repetir) */
|
|
10108
10123
|
existingQuestions?: string[];
|
|
10124
|
+
/** @description Modelo de IA a usar (OpenRouter); default do servidor quando omitido */
|
|
10109
10125
|
model?: string;
|
|
10110
10126
|
};
|
|
10111
10127
|
};
|
|
10112
10128
|
};
|
|
10113
10129
|
responses: {
|
|
10114
|
-
/** @description
|
|
10130
|
+
/** @description Perguntas geradas */
|
|
10115
10131
|
200: {
|
|
10116
10132
|
headers: {
|
|
10117
10133
|
[name: string]: unknown;
|
|
@@ -10121,12 +10137,13 @@ export interface paths {
|
|
|
10121
10137
|
/** @example success */
|
|
10122
10138
|
status?: string;
|
|
10123
10139
|
data?: {
|
|
10124
|
-
question_text
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10140
|
+
question_text?: string;
|
|
10141
|
+
/** @enum {string} */
|
|
10142
|
+
question_type?: "multiple_choice" | "true_false";
|
|
10143
|
+
points?: number;
|
|
10144
|
+
options?: {
|
|
10145
|
+
text?: string;
|
|
10146
|
+
is_correct?: boolean;
|
|
10130
10147
|
}[];
|
|
10131
10148
|
}[];
|
|
10132
10149
|
};
|
|
@@ -11828,7 +11845,7 @@ export interface paths {
|
|
|
11828
11845
|
parameters: {
|
|
11829
11846
|
query?: {
|
|
11830
11847
|
/** @description Filter by step type */
|
|
11831
|
-
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
|
|
11848
|
+
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
|
|
11832
11849
|
/** @description Filter by active status */
|
|
11833
11850
|
isActive?: boolean;
|
|
11834
11851
|
};
|
|
@@ -11877,7 +11894,7 @@ export interface paths {
|
|
|
11877
11894
|
/** @example play-circle */
|
|
11878
11895
|
icon: string;
|
|
11879
11896
|
/** @enum {string} */
|
|
11880
|
-
type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
|
|
11897
|
+
type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
|
|
11881
11898
|
/** @default true */
|
|
11882
11899
|
isActive?: boolean;
|
|
11883
11900
|
};
|
|
@@ -12004,7 +12021,7 @@ export interface paths {
|
|
|
12004
12021
|
color?: string;
|
|
12005
12022
|
icon?: string;
|
|
12006
12023
|
/** @enum {string} */
|
|
12007
|
-
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
|
|
12024
|
+
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
|
|
12008
12025
|
isActive?: boolean;
|
|
12009
12026
|
};
|
|
12010
12027
|
};
|
|
@@ -15629,6 +15646,11 @@ export interface components {
|
|
|
15629
15646
|
id?: string;
|
|
15630
15647
|
/** @example Essential Skills */
|
|
15631
15648
|
name?: string;
|
|
15649
|
+
/**
|
|
15650
|
+
* @description Hex color code for backoffice display. Null when not set.
|
|
15651
|
+
* @example #44bd32
|
|
15652
|
+
*/
|
|
15653
|
+
color?: string | null;
|
|
15632
15654
|
/** Format: date-time */
|
|
15633
15655
|
createdAt?: string;
|
|
15634
15656
|
/** Format: date-time */
|
|
@@ -15900,7 +15922,7 @@ export interface components {
|
|
|
15900
15922
|
/** @example play-circle */
|
|
15901
15923
|
icon?: string;
|
|
15902
15924
|
/** @enum {string} */
|
|
15903
|
-
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
|
|
15925
|
+
type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate" | "redirect";
|
|
15904
15926
|
/** @example true */
|
|
15905
15927
|
isActive?: boolean;
|
|
15906
15928
|
/** Format: date-time */
|
|
@@ -15998,6 +16020,8 @@ export interface components {
|
|
|
15998
16020
|
tutorialDescription?: string | null;
|
|
15999
16021
|
/** @description Obrigatório quando step type=tutorial */
|
|
16000
16022
|
tutorialVideoUrl?: string | null;
|
|
16023
|
+
/** @description Obrigatório quando step type=redirect. URL para onde o aluno é redirecionado ao clicar na etapa. */
|
|
16024
|
+
redirectUrl?: string | null;
|
|
16001
16025
|
isActive?: boolean;
|
|
16002
16026
|
/** Format: date-time */
|
|
16003
16027
|
createdAt?: string;
|
|
@@ -16127,7 +16151,10 @@ export interface components {
|
|
|
16127
16151
|
* @example Introdução a IA
|
|
16128
16152
|
*/
|
|
16129
16153
|
courseModuleName?: string | null;
|
|
16130
|
-
/**
|
|
16154
|
+
/**
|
|
16155
|
+
* @description URL de redirecionamento desta etapa (apenas quando type=redirect)
|
|
16156
|
+
* @example https://exemplo.com/atividade
|
|
16157
|
+
*/
|
|
16131
16158
|
redirectUrl?: string | null;
|
|
16132
16159
|
};
|
|
16133
16160
|
/** @description Desafio da jornada com suas etapas e status computados */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "academe-kit",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
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",
|
|
@@ -99,4 +99,4 @@
|
|
|
99
99
|
"tailwind-merge": "^3.3.1",
|
|
100
100
|
"tailwindcss-animate": "^1.0.7"
|
|
101
101
|
}
|
|
102
|
-
}
|
|
102
|
+
}
|