This commit is contained in:
2026-08-03 13:58:20 +09:00
parent ab40abf5b3
commit def692a28b
8 changed files with 609 additions and 59 deletions
+57
View File
@@ -28,7 +28,19 @@ export type CurriculumWeek = {
requiresSourceSubmission: boolean;
};
modules?: CurriculumModule[];
environmentProfiles?: CurriculumEnvironmentProfile[];
visualizationPlatforms?: CurriculumVisualizationPlatform[];
mapKeys?: string[];
};
export type CurriculumMap = {
key: string;
platformKey: 'NAV2';
name: string;
description: string;
worldFile: string;
viewerModel: 'turtlebot3_world' | 'turtlebot3_house';
custom?: boolean;
};
export type CurriculumModule = {
@@ -39,9 +51,18 @@ export type CurriculumModule = {
folderName: string;
templateRepositoryUrl?: string | null;
dockerImage?: string | null;
defaultParameters?: string[];
enabled?: boolean;
};
export type CurriculumEnvironmentProfile = {
id: string;
platformKey: string;
profileType: string;
name: string;
config?: Record<string, unknown>;
};
export type CurriculumReference = {
id: string;
kind?: string;
@@ -85,6 +106,7 @@ export type InstructorCurriculumResponse = {
} | null;
tagOptions?: CurriculumTagOption[];
visualizationPlatforms?: CurriculumVisualizationPlatform[];
mapOptions?: CurriculumMap[];
};
const LMS_API_BASE_URL = (import.meta.env.VITE_API_BASE_URL ?? 'https://workspace.autonomystudio.net/lms-api/api').replace(/\/+$/, '');
@@ -139,7 +161,21 @@ export async function updateInstructorCurriculum(
description?: string;
}>;
disabledModuleIds?: string[];
moduleDefaultParameters?: Array<{
moduleId: string;
parameters: string[];
}>;
environmentModuleSets?: Array<{
platformKey: string;
moduleIds: string[];
modules?: Array<{
id: string;
defaultParameters: string[];
dockerImage?: string | null;
}>;
}>;
visualizationPlatformKeys?: string[];
mapKeys?: string[];
},
): Promise<InstructorCurriculumResponse> {
const response = await fetch(`${LMS_API_BASE_URL}/instructor/curriculum`, {
@@ -163,6 +199,27 @@ export async function updateInstructorCurriculum(
return response.json() as Promise<InstructorCurriculumResponse>;
}
export async function createInstructorCurriculumMap(
accessToken: string,
input: { courseId?: string | null; name: string; description?: string },
): Promise<CurriculumMap> {
const response = await fetch(`${LMS_API_BASE_URL}/instructor/curriculum/maps`, {
method: 'POST',
headers: {
Authorization: `Bearer ${accessToken}`,
'content-type': 'application/json',
},
body: JSON.stringify(input),
});
if (!response.ok) {
const payload = await response.json().catch((): null => null);
throw new Error(payload && typeof payload === 'object' && 'message' in payload
? String(payload.message)
: `학습 맵을 등록하지 못했습니다. (${response.status})`);
}
return response.json() as Promise<CurriculumMap>;
}
export async function deleteInstructorCurriculumWeek(
accessToken: string,
week: number,
+20
View File
@@ -99,6 +99,11 @@ export type InstructorPlatformsResponse = {
agents: TeachingAgent[];
};
export type InstructorPlatformRegistrationResponse = {
code: string;
expiresAt: string | null;
};
const LMS_API_BASE_URL = (import.meta.env.VITE_API_BASE_URL ?? 'https://workspace.autonomystudio.net/lms-api/api').replace(/\/+$/, '');
export async function listInstructorPlatforms(accessToken: string): Promise<InstructorPlatformsResponse> {
@@ -158,6 +163,21 @@ export async function createInstructorPlatform(
return response.json() as Promise<InstructorPlatformsResponse>;
}
export async function issueInstructorPlatformRegistration(
accessToken: string,
): Promise<InstructorPlatformRegistrationResponse> {
const response = await fetch(`${LMS_API_BASE_URL}/instructor/platform-registration-code`, {
method: 'POST',
headers: {
Authorization: `Bearer ${accessToken}`,
'content-type': 'application/json',
},
});
if (!response.ok) throw new Error(await platformErrorMessage(response, '등록 키를 발급하지 못했습니다.'));
return response.json() as Promise<InstructorPlatformRegistrationResponse>;
}
export async function updateInstructorPlatform(
accessToken: string,
platformId: string,