academe-kit 0.14.0 → 0.16.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 CHANGED
@@ -4585,6 +4585,16 @@ function createUserService(apiClient) {
4585
4585
  body,
4586
4586
  });
4587
4587
  },
4588
+ /**
4589
+ * Consulta o status de uma criação assíncrona de usuário, a partir do
4590
+ * requestId devolvido pelo POST /users. Traz o `username` (login) gerado
4591
+ * pelo worker — útil quando o usuário foi criado sem email.
4592
+ */
4593
+ getUserCreationRequest(requestId) {
4594
+ return apiClient.GET("/user-creation-requests/{requestId}", {
4595
+ params: { path: { requestId } },
4596
+ });
4597
+ },
4588
4598
  /**
4589
4599
  * Update user information
4590
4600
  */
@@ -6405,6 +6415,7 @@ function createSubmissionService(apiClient) {
6405
6415
  * Moves status from submitted → ai_evaluated.
6406
6416
  */
6407
6417
  aiEvaluate(submissionId, data) {
6418
+ // Path não tipado no OpenAPI (ver AiEvaluationBody) → cast, padrão do kit.
6408
6419
  return apiClient.POST("/submissions/{id}/ai-evaluation", {
6409
6420
  params: { path: { id: submissionId } },
6410
6421
  body: data,
@@ -6570,6 +6581,92 @@ function createWatchlistService(apiClient) {
6570
6581
  };
6571
6582
  }
6572
6583
 
6584
+ function createChallengeGroupService(apiClient) {
6585
+ // Paths novos ainda não tipados no schema gerado — cast (ver docstring acima).
6586
+ const GET = apiClient.GET;
6587
+ const POST = apiClient.POST;
6588
+ const DELETE = apiClient.DELETE;
6589
+ return {
6590
+ // ----- Grupos ---------------------------------------------------------
6591
+ /** Lista os grupos de um desafio (com membros). */
6592
+ listGroups(challengeId) {
6593
+ return GET("/challenge-groups", {
6594
+ params: { query: { challengeId } },
6595
+ });
6596
+ },
6597
+ /** Detalha um grupo (com desafio e membros). */
6598
+ getGroup(groupId) {
6599
+ return GET("/challenge-groups/{id}", {
6600
+ params: { path: { id: groupId } },
6601
+ });
6602
+ },
6603
+ /** Cria um grupo. Com `joinAsMember`, o criador entra como líder. */
6604
+ createGroup(body) {
6605
+ return POST("/challenge-groups", { body });
6606
+ },
6607
+ /** Lista membros de um grupo. */
6608
+ listMembers(groupId) {
6609
+ return GET("/challenge-groups/{id}/members", {
6610
+ params: { path: { id: groupId } },
6611
+ });
6612
+ },
6613
+ /** Remove um membro do grupo (sair/expulsar). */
6614
+ removeMember(groupId, userId) {
6615
+ return DELETE("/challenge-groups/{id}/members/{userId}", {
6616
+ params: { path: { id: groupId, userId } },
6617
+ });
6618
+ },
6619
+ /** Remove o grupo. */
6620
+ deleteGroup(groupId) {
6621
+ return DELETE("/challenge-groups/{id}", {
6622
+ params: { path: { id: groupId } },
6623
+ });
6624
+ },
6625
+ // ----- Colegas elegíveis ---------------------------------------------
6626
+ /**
6627
+ * Colegas de turma elegíveis para convidar (mesma turma do aluno, anotados
6628
+ * com `membership`: free | in_group | invited).
6629
+ */
6630
+ getEligibleClassmates(challengeId, institutionId) {
6631
+ return GET("/challenges/{id}/eligible-classmates", {
6632
+ params: {
6633
+ path: { id: challengeId },
6634
+ query: institutionId ? { institutionId } : {},
6635
+ },
6636
+ });
6637
+ },
6638
+ // ----- Convites -------------------------------------------------------
6639
+ /** Meus convites (recebidos por padrão), opcionalmente filtrados por status. */
6640
+ listInvites(params) {
6641
+ return GET("/challenge-group-invites", {
6642
+ params: { query: params ?? {} },
6643
+ });
6644
+ },
6645
+ /** Convida um colega para um grupo. */
6646
+ createInvite(body) {
6647
+ return POST("/challenge-group-invites", { body });
6648
+ },
6649
+ /** Aceita um convite recebido (cria a membership no backend). */
6650
+ acceptInvite(inviteId) {
6651
+ return POST("/challenge-group-invites/{id}/accept", {
6652
+ params: { path: { id: inviteId } },
6653
+ });
6654
+ },
6655
+ /** Recusa um convite recebido. */
6656
+ declineInvite(inviteId) {
6657
+ return POST("/challenge-group-invites/{id}/decline", {
6658
+ params: { path: { id: inviteId } },
6659
+ });
6660
+ },
6661
+ /** Cancela um convite pendente que EU enviei. */
6662
+ cancelInvite(inviteId) {
6663
+ return DELETE("/challenge-group-invites/{id}", {
6664
+ params: { path: { id: inviteId } },
6665
+ });
6666
+ },
6667
+ };
6668
+ }
6669
+
6573
6670
  function createAcademeApiClient(baseUrl) {
6574
6671
  return createClient({ baseUrl });
6575
6672
  }
@@ -6599,6 +6696,7 @@ function createAcademeServices(apiClient) {
6599
6696
  userProgress: createUserProgressService(apiClient),
6600
6697
  vitrine: createVitrineService(apiClient),
6601
6698
  watchlist: createWatchlistService(apiClient),
6699
+ challengeGroup: createChallengeGroupService(apiClient),
6602
6700
  };
6603
6701
  }
6604
6702