@vue-skuilder/db 0.1.14 → 0.1.15
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/impl/static/index.d.mts +2 -1
- package/dist/impl/static/index.d.ts +2 -1
- package/dist/impl/static/index.js +10 -3
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +10 -3
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/impl/static/StaticDataLayerProvider.ts +1 -1
- package/src/impl/static/coursesDB.ts +15 -2
|
@@ -174,7 +174,8 @@ declare class StaticCourseDB implements CourseDBInterface {
|
|
|
174
174
|
|
|
175
175
|
declare class StaticCoursesDB implements CoursesDBInterface {
|
|
176
176
|
private manifests;
|
|
177
|
-
|
|
177
|
+
private dependencyNameToCourseId?;
|
|
178
|
+
constructor(manifests: Record<string, StaticCourseManifest>, dependencyNameToCourseId?: Map<string, string> | undefined);
|
|
178
179
|
getCourseConfig(courseId: string): Promise<CourseConfig>;
|
|
179
180
|
getCourseList(): Promise<CourseConfig[]>;
|
|
180
181
|
disambiguateCourse(_courseId: string, _disambiguator: string): Promise<void>;
|
|
@@ -174,7 +174,8 @@ declare class StaticCourseDB implements CourseDBInterface {
|
|
|
174
174
|
|
|
175
175
|
declare class StaticCoursesDB implements CoursesDBInterface {
|
|
176
176
|
private manifests;
|
|
177
|
-
|
|
177
|
+
private dependencyNameToCourseId?;
|
|
178
|
+
constructor(manifests: Record<string, StaticCourseManifest>, dependencyNameToCourseId?: Map<string, string> | undefined);
|
|
178
179
|
getCourseConfig(courseId: string): Promise<CourseConfig>;
|
|
179
180
|
getCourseList(): Promise<CourseConfig[]>;
|
|
180
181
|
disambiguateCourse(_courseId: string, _disambiguator: string): Promise<void>;
|
|
@@ -2634,11 +2634,18 @@ var init_coursesDB = __esm({
|
|
|
2634
2634
|
"use strict";
|
|
2635
2635
|
init_logger();
|
|
2636
2636
|
StaticCoursesDB = class {
|
|
2637
|
-
constructor(manifests) {
|
|
2637
|
+
constructor(manifests, dependencyNameToCourseId) {
|
|
2638
2638
|
this.manifests = manifests;
|
|
2639
|
+
this.dependencyNameToCourseId = dependencyNameToCourseId;
|
|
2639
2640
|
}
|
|
2640
2641
|
async getCourseConfig(courseId) {
|
|
2641
|
-
|
|
2642
|
+
let manifest = this.manifests[courseId];
|
|
2643
|
+
if (!manifest && this.dependencyNameToCourseId) {
|
|
2644
|
+
const mappedCourseId = this.dependencyNameToCourseId.get(courseId);
|
|
2645
|
+
if (mappedCourseId) {
|
|
2646
|
+
manifest = this.manifests[mappedCourseId];
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2642
2649
|
if (!manifest) {
|
|
2643
2650
|
logger.warn(`Course manifest for ${courseId} not found`);
|
|
2644
2651
|
throw new Error(`Course ${courseId} not found`);
|
|
@@ -2812,7 +2819,7 @@ var init_StaticDataLayerProvider = __esm({
|
|
|
2812
2819
|
return new StaticCourseDB(actualCourseId, unpacker, this.getUserDB(), manifest);
|
|
2813
2820
|
}
|
|
2814
2821
|
getCoursesDB() {
|
|
2815
|
-
return new StaticCoursesDB(this.manifests);
|
|
2822
|
+
return new StaticCoursesDB(this.manifests, this.dependencyNameToCourseId);
|
|
2816
2823
|
}
|
|
2817
2824
|
async getClassroomDB(_classId, _type) {
|
|
2818
2825
|
throw new Error("Classrooms not supported in static mode");
|