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.cjs
CHANGED
|
@@ -6550,6 +6550,26 @@ function createVitrineService(apiClient) {
|
|
|
6550
6550
|
};
|
|
6551
6551
|
}
|
|
6552
6552
|
|
|
6553
|
+
function createWatchlistService(apiClient) {
|
|
6554
|
+
return {
|
|
6555
|
+
/** Itens da "Minha lista" + contagem. */
|
|
6556
|
+
async getMine() {
|
|
6557
|
+
const res = await apiClient.GET("/me/watchlist");
|
|
6558
|
+
return (res.data?.data ?? { items: [], count: 0 });
|
|
6559
|
+
},
|
|
6560
|
+
/** Adiciona um conteúdo (idempotente). */
|
|
6561
|
+
async add(type, id) {
|
|
6562
|
+
await apiClient.PUT("/me/watchlist", { body: { type, id } });
|
|
6563
|
+
},
|
|
6564
|
+
/** Remove um conteúdo pelo alvo. */
|
|
6565
|
+
async remove(type, id) {
|
|
6566
|
+
await apiClient.DELETE("/me/watchlist/{type}/{id}", {
|
|
6567
|
+
params: { path: { type, id } },
|
|
6568
|
+
});
|
|
6569
|
+
},
|
|
6570
|
+
};
|
|
6571
|
+
}
|
|
6572
|
+
|
|
6553
6573
|
function createAcademeApiClient(baseUrl) {
|
|
6554
6574
|
return createClient({ baseUrl });
|
|
6555
6575
|
}
|
|
@@ -6578,6 +6598,7 @@ function createAcademeServices(apiClient) {
|
|
|
6578
6598
|
submission: createSubmissionService(apiClient),
|
|
6579
6599
|
userProgress: createUserProgressService(apiClient),
|
|
6580
6600
|
vitrine: createVitrineService(apiClient),
|
|
6601
|
+
watchlist: createWatchlistService(apiClient),
|
|
6581
6602
|
};
|
|
6582
6603
|
}
|
|
6583
6604
|
|