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/index.d.ts
CHANGED
|
@@ -28020,6 +28020,35 @@ declare function createVitrineService(apiClient: AcademeApiClient): {
|
|
|
28020
28020
|
};
|
|
28021
28021
|
type VitrineService = ReturnType<typeof createVitrineService>;
|
|
28022
28022
|
|
|
28023
|
+
/**
|
|
28024
|
+
* "Minha lista" (watchlist) do aluno. Consome `/me/watchlist` do api-academe-v2.
|
|
28025
|
+
* Endpoint ainda NÃO no OpenAPI gerado → cast + tipos à mão (padrão do repo).
|
|
28026
|
+
*/
|
|
28027
|
+
type WatchlistType = "course" | "module" | "lesson";
|
|
28028
|
+
interface WatchlistItem {
|
|
28029
|
+
/** id da linha (para remover pela tela). */
|
|
28030
|
+
id: string;
|
|
28031
|
+
type: WatchlistType;
|
|
28032
|
+
/** id do conteúdo (curso/módulo/aula). */
|
|
28033
|
+
contentId: string;
|
|
28034
|
+
courseId: string | null;
|
|
28035
|
+
title: string;
|
|
28036
|
+
coverUrl: string | null;
|
|
28037
|
+
}
|
|
28038
|
+
interface WatchlistResponse {
|
|
28039
|
+
items: WatchlistItem[];
|
|
28040
|
+
count: number;
|
|
28041
|
+
}
|
|
28042
|
+
declare function createWatchlistService(apiClient: AcademeApiClient): {
|
|
28043
|
+
/** Itens da "Minha lista" + contagem. */
|
|
28044
|
+
getMine(): Promise<WatchlistResponse>;
|
|
28045
|
+
/** Adiciona um conteúdo (idempotente). */
|
|
28046
|
+
add(type: WatchlistType, id: string): Promise<void>;
|
|
28047
|
+
/** Remove um conteúdo pelo alvo. */
|
|
28048
|
+
remove(type: WatchlistType, id: string): Promise<void>;
|
|
28049
|
+
};
|
|
28050
|
+
type WatchlistService = ReturnType<typeof createWatchlistService>;
|
|
28051
|
+
|
|
28023
28052
|
type AcademeApiClient = ReturnType<typeof openapi_fetch__default<paths>>;
|
|
28024
28053
|
declare function createAcademeApiClient(baseUrl: string): AcademeApiClient;
|
|
28025
28054
|
interface AcademeServices {
|
|
@@ -28046,6 +28075,7 @@ interface AcademeServices {
|
|
|
28046
28075
|
submission: SubmissionService;
|
|
28047
28076
|
userProgress: UserProgressService;
|
|
28048
28077
|
vitrine: VitrineService;
|
|
28078
|
+
watchlist: WatchlistService;
|
|
28049
28079
|
}
|
|
28050
28080
|
|
|
28051
28081
|
type AcademeKeycloakContextProps = {
|
|
@@ -28142,4 +28172,4 @@ declare enum NINA_ROLES {
|
|
|
28142
28172
|
}
|
|
28143
28173
|
|
|
28144
28174
|
export { AcademeAuthProvider, AcademeLoading, BACKOFFICE_ROLES, Button, CosmicDecor, CosmicStarsCanvas, DASHBOARD_ROLES, GLOBAL_ROLES, JourneyCrystalPin, JourneyStep, LogoA, MIKE_ROLES, NINA_ROLES, ProtectedApp, ProtectedComponent, ProtectedRouter, STREAMING_ROLES, Spinner, WIDGET_ROLES, academeApi_d as apiTypes, cn, createAcademeApiClient, index_d as types, useAcademeAuth, useProtectedAppColors };
|
|
28145
|
-
export type { AcademeApiClient, AcademeKeycloakContextProps, AcademeLoadingColors, AcademeLoadingProps, AcademeLoadingTheme, AcademeServices, AcademeUser, AccessibleSerie, ButtonProps, ChallengeUserQuizAttempt, ChallengeUserQuizAttemptsResponse, ClassroomSummary, CosmicDecorProps, CosmicDecorVariant, CosmicPlanet, CosmicStarsCanvasProps, FrameKind, JourneyChallengeView, JourneyCrystalPinProps, JourneyStepProps, JourneyStepSize, JourneyStepType, JourneyStepView, JourneyView, KeycloakUser, LogoAProps, RequiredClientRoles, SecurityContextType, SecurityProviderProps, UserEnrollment, VitrineCard, VitrineCardKind, VitrineCardOrientation, VitrineHome, VitrinePlaylist, VitrinePlaylistSource };
|
|
28175
|
+
export type { AcademeApiClient, AcademeKeycloakContextProps, AcademeLoadingColors, AcademeLoadingProps, AcademeLoadingTheme, AcademeServices, AcademeUser, AccessibleSerie, ButtonProps, ChallengeUserQuizAttempt, ChallengeUserQuizAttemptsResponse, ClassroomSummary, CosmicDecorProps, CosmicDecorVariant, CosmicPlanet, CosmicStarsCanvasProps, FrameKind, JourneyChallengeView, JourneyCrystalPinProps, JourneyStepProps, JourneyStepSize, JourneyStepType, JourneyStepView, JourneyView, KeycloakUser, LogoAProps, RequiredClientRoles, SecurityContextType, SecurityProviderProps, UserEnrollment, VitrineCard, VitrineCardKind, VitrineCardOrientation, VitrineHome, VitrinePlaylist, VitrinePlaylistSource, WatchlistItem, WatchlistResponse, WatchlistType };
|
package/dist/index.esm.js
CHANGED
|
@@ -6548,6 +6548,26 @@ function createVitrineService(apiClient) {
|
|
|
6548
6548
|
};
|
|
6549
6549
|
}
|
|
6550
6550
|
|
|
6551
|
+
function createWatchlistService(apiClient) {
|
|
6552
|
+
return {
|
|
6553
|
+
/** Itens da "Minha lista" + contagem. */
|
|
6554
|
+
async getMine() {
|
|
6555
|
+
const res = await apiClient.GET("/me/watchlist");
|
|
6556
|
+
return (res.data?.data ?? { items: [], count: 0 });
|
|
6557
|
+
},
|
|
6558
|
+
/** Adiciona um conteúdo (idempotente). */
|
|
6559
|
+
async add(type, id) {
|
|
6560
|
+
await apiClient.PUT("/me/watchlist", { body: { type, id } });
|
|
6561
|
+
},
|
|
6562
|
+
/** Remove um conteúdo pelo alvo. */
|
|
6563
|
+
async remove(type, id) {
|
|
6564
|
+
await apiClient.DELETE("/me/watchlist/{type}/{id}", {
|
|
6565
|
+
params: { path: { type, id } },
|
|
6566
|
+
});
|
|
6567
|
+
},
|
|
6568
|
+
};
|
|
6569
|
+
}
|
|
6570
|
+
|
|
6551
6571
|
function createAcademeApiClient(baseUrl) {
|
|
6552
6572
|
return createClient({ baseUrl });
|
|
6553
6573
|
}
|
|
@@ -6576,6 +6596,7 @@ function createAcademeServices(apiClient) {
|
|
|
6576
6596
|
submission: createSubmissionService(apiClient),
|
|
6577
6597
|
userProgress: createUserProgressService(apiClient),
|
|
6578
6598
|
vitrine: createVitrineService(apiClient),
|
|
6599
|
+
watchlist: createWatchlistService(apiClient),
|
|
6579
6600
|
};
|
|
6580
6601
|
}
|
|
6581
6602
|
|