academe-kit 0.14.0 → 0.15.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.cjs +88 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5030 -2957
- package/dist/index.esm.js +88 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/services/ChallengeGroupService.d.ts +124 -0
- 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/services/SubmissionService.d.ts +2 -64
- package/dist/types/services/UserProgressService.d.ts +17 -2
- package/dist/types/services/index.d.ts +3 -0
- package/dist/types/types/academe-api.d.ts +4664 -2670
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -6405,6 +6405,7 @@ function createSubmissionService(apiClient) {
|
|
|
6405
6405
|
* Moves status from submitted → ai_evaluated.
|
|
6406
6406
|
*/
|
|
6407
6407
|
aiEvaluate(submissionId, data) {
|
|
6408
|
+
// Path não tipado no OpenAPI (ver AiEvaluationBody) → cast, padrão do kit.
|
|
6408
6409
|
return apiClient.POST("/submissions/{id}/ai-evaluation", {
|
|
6409
6410
|
params: { path: { id: submissionId } },
|
|
6410
6411
|
body: data,
|
|
@@ -6570,6 +6571,92 @@ function createWatchlistService(apiClient) {
|
|
|
6570
6571
|
};
|
|
6571
6572
|
}
|
|
6572
6573
|
|
|
6574
|
+
function createChallengeGroupService(apiClient) {
|
|
6575
|
+
// Paths novos ainda não tipados no schema gerado — cast (ver docstring acima).
|
|
6576
|
+
const GET = apiClient.GET;
|
|
6577
|
+
const POST = apiClient.POST;
|
|
6578
|
+
const DELETE = apiClient.DELETE;
|
|
6579
|
+
return {
|
|
6580
|
+
// ----- Grupos ---------------------------------------------------------
|
|
6581
|
+
/** Lista os grupos de um desafio (com membros). */
|
|
6582
|
+
listGroups(challengeId) {
|
|
6583
|
+
return GET("/challenge-groups", {
|
|
6584
|
+
params: { query: { challengeId } },
|
|
6585
|
+
});
|
|
6586
|
+
},
|
|
6587
|
+
/** Detalha um grupo (com desafio e membros). */
|
|
6588
|
+
getGroup(groupId) {
|
|
6589
|
+
return GET("/challenge-groups/{id}", {
|
|
6590
|
+
params: { path: { id: groupId } },
|
|
6591
|
+
});
|
|
6592
|
+
},
|
|
6593
|
+
/** Cria um grupo. Com `joinAsMember`, o criador entra como líder. */
|
|
6594
|
+
createGroup(body) {
|
|
6595
|
+
return POST("/challenge-groups", { body });
|
|
6596
|
+
},
|
|
6597
|
+
/** Lista membros de um grupo. */
|
|
6598
|
+
listMembers(groupId) {
|
|
6599
|
+
return GET("/challenge-groups/{id}/members", {
|
|
6600
|
+
params: { path: { id: groupId } },
|
|
6601
|
+
});
|
|
6602
|
+
},
|
|
6603
|
+
/** Remove um membro do grupo (sair/expulsar). */
|
|
6604
|
+
removeMember(groupId, userId) {
|
|
6605
|
+
return DELETE("/challenge-groups/{id}/members/{userId}", {
|
|
6606
|
+
params: { path: { id: groupId, userId } },
|
|
6607
|
+
});
|
|
6608
|
+
},
|
|
6609
|
+
/** Remove o grupo. */
|
|
6610
|
+
deleteGroup(groupId) {
|
|
6611
|
+
return DELETE("/challenge-groups/{id}", {
|
|
6612
|
+
params: { path: { id: groupId } },
|
|
6613
|
+
});
|
|
6614
|
+
},
|
|
6615
|
+
// ----- Colegas elegíveis ---------------------------------------------
|
|
6616
|
+
/**
|
|
6617
|
+
* Colegas de turma elegíveis para convidar (mesma turma do aluno, anotados
|
|
6618
|
+
* com `membership`: free | in_group | invited).
|
|
6619
|
+
*/
|
|
6620
|
+
getEligibleClassmates(challengeId, institutionId) {
|
|
6621
|
+
return GET("/challenges/{id}/eligible-classmates", {
|
|
6622
|
+
params: {
|
|
6623
|
+
path: { id: challengeId },
|
|
6624
|
+
query: institutionId ? { institutionId } : {},
|
|
6625
|
+
},
|
|
6626
|
+
});
|
|
6627
|
+
},
|
|
6628
|
+
// ----- Convites -------------------------------------------------------
|
|
6629
|
+
/** Meus convites (recebidos por padrão), opcionalmente filtrados por status. */
|
|
6630
|
+
listInvites(params) {
|
|
6631
|
+
return GET("/challenge-group-invites", {
|
|
6632
|
+
params: { query: params ?? {} },
|
|
6633
|
+
});
|
|
6634
|
+
},
|
|
6635
|
+
/** Convida um colega para um grupo. */
|
|
6636
|
+
createInvite(body) {
|
|
6637
|
+
return POST("/challenge-group-invites", { body });
|
|
6638
|
+
},
|
|
6639
|
+
/** Aceita um convite recebido (cria a membership no backend). */
|
|
6640
|
+
acceptInvite(inviteId) {
|
|
6641
|
+
return POST("/challenge-group-invites/{id}/accept", {
|
|
6642
|
+
params: { path: { id: inviteId } },
|
|
6643
|
+
});
|
|
6644
|
+
},
|
|
6645
|
+
/** Recusa um convite recebido. */
|
|
6646
|
+
declineInvite(inviteId) {
|
|
6647
|
+
return POST("/challenge-group-invites/{id}/decline", {
|
|
6648
|
+
params: { path: { id: inviteId } },
|
|
6649
|
+
});
|
|
6650
|
+
},
|
|
6651
|
+
/** Cancela um convite pendente que EU enviei. */
|
|
6652
|
+
cancelInvite(inviteId) {
|
|
6653
|
+
return DELETE("/challenge-group-invites/{id}", {
|
|
6654
|
+
params: { path: { id: inviteId } },
|
|
6655
|
+
});
|
|
6656
|
+
},
|
|
6657
|
+
};
|
|
6658
|
+
}
|
|
6659
|
+
|
|
6573
6660
|
function createAcademeApiClient(baseUrl) {
|
|
6574
6661
|
return createClient({ baseUrl });
|
|
6575
6662
|
}
|
|
@@ -6599,6 +6686,7 @@ function createAcademeServices(apiClient) {
|
|
|
6599
6686
|
userProgress: createUserProgressService(apiClient),
|
|
6600
6687
|
vitrine: createVitrineService(apiClient),
|
|
6601
6688
|
watchlist: createWatchlistService(apiClient),
|
|
6689
|
+
challengeGroup: createChallengeGroupService(apiClient),
|
|
6602
6690
|
};
|
|
6603
6691
|
}
|
|
6604
6692
|
|