Initial transfer from ADO (#13)

This commit is contained in:
Laurent Nguyen
2020-06-05 04:04:15 +02:00
committed by GitHub
parent ab3486bd05
commit e9d3160b57
34 changed files with 827 additions and 526 deletions

View File

@@ -8,17 +8,22 @@ export class JunoUtils {
public static async getLikedNotebooks(authorizationToken: string): Promise<DataModels.LikedNotebooksJunoResponse> {
//TODO: Add Get method once juno has it implemented
return {
likedNotebooksContent: await JunoUtils.getOfficialSampleNotebooks(),
likedNotebooksContent: [],
userMetadata: {
likedNotebooks: []
}
};
}
public static async getOfficialSampleNotebooks(): Promise<DataModels.GitHubInfoJunoResponse[]> {
public static async getOfficialSampleNotebooks(
authorizationToken: string
): Promise<DataModels.GitHubInfoJunoResponse[]> {
try {
const response = await window.fetch(config.JUNO_ENDPOINT + "/api/galleries/notebooks", {
method: "GET"
const response = await window.fetch(config.JUNO_ENDPOINT + "/api/notebooks/galleries", {
method: "GET",
headers: {
authorization: authorizationToken
}
});
if (!response.ok) {
throw new Error("Status code:" + response.status);
@@ -35,14 +40,16 @@ export class JunoUtils {
): Promise<DataModels.UserMetadata> {
return undefined;
//TODO: add userMetadata updation code
// TODO: Make sure to throw error if failed
}
public static async updateNotebookMetadata(
authorizationToken: string,
userMetadata: DataModels.NotebookMetadata
notebookMetadata: DataModels.NotebookMetadata
): Promise<DataModels.NotebookMetadata> {
return undefined;
//TODO: add notebookMetadata updation code
// TODO: Make sure to throw error if failed
}
public static toPinnedRepo(item: RepoListItem): IPinnedRepo {