academe-kit 0.13.0 → 0.14.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 +21 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.esm.js +21 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/services/WatchlistService.d.ts +29 -0
- package/dist/types/services/index.d.ts +3 -0
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export type { ChallengeUserQuizAttempt, ChallengeUserQuizAttemptsResponse, } fro
|
|
|
22
22
|
export type { JourneyStepView, JourneyChallengeView, JourneyView, } from "./services/UserProgressService";
|
|
23
23
|
export type { AccessibleSerie, ClassroomSummary, UserEnrollment, } from "./services/userService";
|
|
24
24
|
export type { VitrineHome, VitrinePlaylist, VitrineCard, VitrineCardKind, VitrinePlaylistSource, VitrineCardOrientation, } from "./services/VitrineService";
|
|
25
|
+
export type { WatchlistItem, WatchlistResponse, WatchlistType, } from "./services/WatchlistService";
|
|
25
26
|
export { cn } from "./lib/utils";
|
|
26
27
|
import "./index.css";
|
|
27
28
|
import "./styles/globals.css";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AcademeApiClient } from "./index";
|
|
2
|
+
/**
|
|
3
|
+
* "Minha lista" (watchlist) do aluno. Consome `/me/watchlist` do api-academe-v2.
|
|
4
|
+
* Endpoint ainda NÃO no OpenAPI gerado → cast + tipos à mão (padrão do repo).
|
|
5
|
+
*/
|
|
6
|
+
export type WatchlistType = "course" | "module" | "lesson";
|
|
7
|
+
export interface WatchlistItem {
|
|
8
|
+
/** id da linha (para remover pela tela). */
|
|
9
|
+
id: string;
|
|
10
|
+
type: WatchlistType;
|
|
11
|
+
/** id do conteúdo (curso/módulo/aula). */
|
|
12
|
+
contentId: string;
|
|
13
|
+
courseId: string | null;
|
|
14
|
+
title: string;
|
|
15
|
+
coverUrl: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface WatchlistResponse {
|
|
18
|
+
items: WatchlistItem[];
|
|
19
|
+
count: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function createWatchlistService(apiClient: AcademeApiClient): {
|
|
22
|
+
/** Itens da "Minha lista" + contagem. */
|
|
23
|
+
getMine(): Promise<WatchlistResponse>;
|
|
24
|
+
/** Adiciona um conteúdo (idempotente). */
|
|
25
|
+
add(type: WatchlistType, id: string): Promise<void>;
|
|
26
|
+
/** Remove um conteúdo pelo alvo. */
|
|
27
|
+
remove(type: WatchlistType, id: string): Promise<void>;
|
|
28
|
+
};
|
|
29
|
+
export type WatchlistService = ReturnType<typeof createWatchlistService>;
|
|
@@ -23,6 +23,7 @@ import { type StepService } from './StepService';
|
|
|
23
23
|
import { type SubmissionService } from './SubmissionService';
|
|
24
24
|
import { type UserProgressService } from './UserProgressService';
|
|
25
25
|
import { type VitrineService } from './VitrineService';
|
|
26
|
+
import { type WatchlistService } from './WatchlistService';
|
|
26
27
|
export type AcademeApiClient = ReturnType<typeof createClient<paths>>;
|
|
27
28
|
export declare function createAcademeApiClient(baseUrl: string): AcademeApiClient;
|
|
28
29
|
export interface AcademeServices {
|
|
@@ -49,6 +50,7 @@ export interface AcademeServices {
|
|
|
49
50
|
submission: SubmissionService;
|
|
50
51
|
userProgress: UserProgressService;
|
|
51
52
|
vitrine: VitrineService;
|
|
53
|
+
watchlist: WatchlistService;
|
|
52
54
|
}
|
|
53
55
|
export declare function createAcademeServices(apiClient: AcademeApiClient): AcademeServices;
|
|
54
56
|
export { createUserService, type UserService } from "./userService";
|
|
@@ -73,3 +75,4 @@ export { createStepService, type StepService } from './StepService';
|
|
|
73
75
|
export { createSubmissionService, type SubmissionService } from './SubmissionService';
|
|
74
76
|
export { createUserProgressService, type UserProgressService } from './UserProgressService';
|
|
75
77
|
export { createVitrineService, type VitrineService } from './VitrineService';
|
|
78
|
+
export { createWatchlistService, type WatchlistService } from './WatchlistService';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "academe-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.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",
|