@vue-skuilder/db 0.1.29 → 0.1.30
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/{contentSource-DfBbaLA-.d.cts → contentSource-B7nXusjk.d.cts} +19 -4
- package/dist/{contentSource-BmnmvH8C.d.ts → contentSource-ygoFw9oV.d.ts} +19 -4
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +14 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +13 -6
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-BeRXVMs5.d.cts → dataLayerProvider-BW7HvkMt.d.cts} +1 -1
- package/dist/{dataLayerProvider-CG9GfaAY.d.ts → dataLayerProvider-BfXUVDuG.d.ts} +1 -1
- package/dist/impl/couch/index.d.cts +2 -2
- package/dist/impl/couch/index.d.ts +2 -2
- package/dist/impl/couch/index.js +12 -6
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +12 -6
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +2 -2
- package/dist/impl/static/index.d.ts +2 -2
- package/dist/impl/static/index.js +12 -6
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +12 -6
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -6
- package/dist/index.mjs.map +1 -1
- package/docs/navigators-architecture.md +64 -5
- package/package.json +3 -3
- package/src/core/navigators/index.ts +43 -10
|
@@ -742,10 +742,15 @@ type NavigatorConstructor = new (user: UserDBInterface, course: CourseDBInterfac
|
|
|
742
742
|
* Call this to make a navigator available for instantiation by
|
|
743
743
|
* ContentNavigator.create() without relying on dynamic imports.
|
|
744
744
|
*
|
|
745
|
-
*
|
|
745
|
+
* Passing a `role` is optional for built-in navigators (whose roles are in
|
|
746
|
+
* the hardcoded `NavigatorRoles` record), but **required** for consumer-
|
|
747
|
+
* defined navigators that need to participate in pipeline assembly.
|
|
748
|
+
*
|
|
749
|
+
* @param implementingClass - The class name (e.g., 'elo', 'letterGatingFilter')
|
|
746
750
|
* @param constructor - The navigator class constructor
|
|
751
|
+
* @param role - Optional pipeline role (GENERATOR or FILTER)
|
|
747
752
|
*/
|
|
748
|
-
declare function registerNavigator(implementingClass: string, constructor: NavigatorConstructor): void;
|
|
753
|
+
declare function registerNavigator(implementingClass: string, constructor: NavigatorConstructor, role?: NavigatorRole): void;
|
|
749
754
|
/**
|
|
750
755
|
* Get a navigator constructor from the registry.
|
|
751
756
|
*
|
|
@@ -760,6 +765,13 @@ declare function getRegisteredNavigator(implementingClass: string): NavigatorCon
|
|
|
760
765
|
* @returns true if registered, false otherwise
|
|
761
766
|
*/
|
|
762
767
|
declare function hasRegisteredNavigator(implementingClass: string): boolean;
|
|
768
|
+
/**
|
|
769
|
+
* Get the registered role for a navigator, if one was provided at registration.
|
|
770
|
+
*
|
|
771
|
+
* @param implementingClass - The class name to look up
|
|
772
|
+
* @returns The role, or undefined if not registered or no role was specified
|
|
773
|
+
*/
|
|
774
|
+
declare function getRegisteredNavigatorRole(implementingClass: string): NavigatorRole | undefined;
|
|
763
775
|
/**
|
|
764
776
|
* Get all registered navigator names.
|
|
765
777
|
* Useful for debugging and testing.
|
|
@@ -925,7 +937,10 @@ declare function isGenerator(impl: string): boolean;
|
|
|
925
937
|
/**
|
|
926
938
|
* Check if a navigator implementation is a filter.
|
|
927
939
|
*
|
|
928
|
-
*
|
|
940
|
+
* Checks the built-in NavigatorRoles enum first, then falls back to the
|
|
941
|
+
* navigator registry for consumer-registered navigators.
|
|
942
|
+
*
|
|
943
|
+
* @param impl - Navigator implementation name (e.g., 'elo', 'letterGatingFilter')
|
|
929
944
|
* @returns true if the navigator is a filter, false otherwise
|
|
930
945
|
*/
|
|
931
946
|
declare function isFilter(impl: string): boolean;
|
|
@@ -1084,4 +1099,4 @@ interface StudyContentSource {
|
|
|
1084
1099
|
}
|
|
1085
1100
|
declare function getStudySource(source: ContentSourceID, user: UserDBInterface): Promise<StudyContentSource>;
|
|
1086
1101
|
|
|
1087
|
-
export {
|
|
1102
|
+
export { NavigatorRoles as $, type AdminDBInterface as A, type UsrCrsDataInterface as B, type CourseDBInterface as C, type DataLayerResult as D, type ClassroomRegistrationDesignation as E, type ClassroomRegistration as F, type ClassroomRegistrationDoc as G, type SessionTrackingData as H, type UserConfig as I, type ActivityRecord as J, type CourseRegistration as K, type UserOutcomeRecord as L, registerNavigator as M, type NavigatorConstructor as N, getRegisteredNavigator as O, hasRegisteredNavigator as P, getRegisteredNavigatorRole as Q, getRegisteredNavigatorNames as R, type StudySessionItem as S, type TeacherClassroomDBInterface as T, type UserDBInterface as U, initializeNavigatorRegistry as V, type WeightedCard as W, type StrategyContribution as X, getCardOrigin as Y, Navigators as Z, NavigatorRole as _, type UserDBReader as a, isGenerator as a0, isFilter as a1, type LearnableWeight as a2, type OrchestrationContext as a3, computeDeviation as a4, computeSpread as a5, computeEffectiveWeight as a6, createOrchestrationContext as a7, type DocumentUpdater as a8, newInterval as a9, type CoursesDBInterface as b, type ClassroomDBInterface as c, type CourseInfo as d, type ContentNavigationStrategyData as e, ContentNavigator as f, type AssignedContent as g, type StudyContentSource as h, type StudentClassroomDBInterface as i, type ScheduledCard as j, type StudySessionFailedItem as k, type StudySessionFailedNewItem as l, type StudySessionFailedReviewItem as m, type StudySessionNewItem as n, type StudySessionReviewItem as o, isReview as p, type ContentSourceID as q, getStudySource as r, type CourseRegistrationDoc as s, type AssignedTag as t, type AssignedCourse as u, type AssignedCard as v, type UserDBWriter as w, type UserDBAuthenticator as x, type UserCourseSettings as y, type UserCourseSetting as z };
|
|
@@ -742,10 +742,15 @@ type NavigatorConstructor = new (user: UserDBInterface, course: CourseDBInterfac
|
|
|
742
742
|
* Call this to make a navigator available for instantiation by
|
|
743
743
|
* ContentNavigator.create() without relying on dynamic imports.
|
|
744
744
|
*
|
|
745
|
-
*
|
|
745
|
+
* Passing a `role` is optional for built-in navigators (whose roles are in
|
|
746
|
+
* the hardcoded `NavigatorRoles` record), but **required** for consumer-
|
|
747
|
+
* defined navigators that need to participate in pipeline assembly.
|
|
748
|
+
*
|
|
749
|
+
* @param implementingClass - The class name (e.g., 'elo', 'letterGatingFilter')
|
|
746
750
|
* @param constructor - The navigator class constructor
|
|
751
|
+
* @param role - Optional pipeline role (GENERATOR or FILTER)
|
|
747
752
|
*/
|
|
748
|
-
declare function registerNavigator(implementingClass: string, constructor: NavigatorConstructor): void;
|
|
753
|
+
declare function registerNavigator(implementingClass: string, constructor: NavigatorConstructor, role?: NavigatorRole): void;
|
|
749
754
|
/**
|
|
750
755
|
* Get a navigator constructor from the registry.
|
|
751
756
|
*
|
|
@@ -760,6 +765,13 @@ declare function getRegisteredNavigator(implementingClass: string): NavigatorCon
|
|
|
760
765
|
* @returns true if registered, false otherwise
|
|
761
766
|
*/
|
|
762
767
|
declare function hasRegisteredNavigator(implementingClass: string): boolean;
|
|
768
|
+
/**
|
|
769
|
+
* Get the registered role for a navigator, if one was provided at registration.
|
|
770
|
+
*
|
|
771
|
+
* @param implementingClass - The class name to look up
|
|
772
|
+
* @returns The role, or undefined if not registered or no role was specified
|
|
773
|
+
*/
|
|
774
|
+
declare function getRegisteredNavigatorRole(implementingClass: string): NavigatorRole | undefined;
|
|
763
775
|
/**
|
|
764
776
|
* Get all registered navigator names.
|
|
765
777
|
* Useful for debugging and testing.
|
|
@@ -925,7 +937,10 @@ declare function isGenerator(impl: string): boolean;
|
|
|
925
937
|
/**
|
|
926
938
|
* Check if a navigator implementation is a filter.
|
|
927
939
|
*
|
|
928
|
-
*
|
|
940
|
+
* Checks the built-in NavigatorRoles enum first, then falls back to the
|
|
941
|
+
* navigator registry for consumer-registered navigators.
|
|
942
|
+
*
|
|
943
|
+
* @param impl - Navigator implementation name (e.g., 'elo', 'letterGatingFilter')
|
|
929
944
|
* @returns true if the navigator is a filter, false otherwise
|
|
930
945
|
*/
|
|
931
946
|
declare function isFilter(impl: string): boolean;
|
|
@@ -1084,4 +1099,4 @@ interface StudyContentSource {
|
|
|
1084
1099
|
}
|
|
1085
1100
|
declare function getStudySource(source: ContentSourceID, user: UserDBInterface): Promise<StudyContentSource>;
|
|
1086
1101
|
|
|
1087
|
-
export {
|
|
1102
|
+
export { NavigatorRoles as $, type AdminDBInterface as A, type UsrCrsDataInterface as B, type CourseDBInterface as C, type DataLayerResult as D, type ClassroomRegistrationDesignation as E, type ClassroomRegistration as F, type ClassroomRegistrationDoc as G, type SessionTrackingData as H, type UserConfig as I, type ActivityRecord as J, type CourseRegistration as K, type UserOutcomeRecord as L, registerNavigator as M, type NavigatorConstructor as N, getRegisteredNavigator as O, hasRegisteredNavigator as P, getRegisteredNavigatorRole as Q, getRegisteredNavigatorNames as R, type StudySessionItem as S, type TeacherClassroomDBInterface as T, type UserDBInterface as U, initializeNavigatorRegistry as V, type WeightedCard as W, type StrategyContribution as X, getCardOrigin as Y, Navigators as Z, NavigatorRole as _, type UserDBReader as a, isGenerator as a0, isFilter as a1, type LearnableWeight as a2, type OrchestrationContext as a3, computeDeviation as a4, computeSpread as a5, computeEffectiveWeight as a6, createOrchestrationContext as a7, type DocumentUpdater as a8, newInterval as a9, type CoursesDBInterface as b, type ClassroomDBInterface as c, type CourseInfo as d, type ContentNavigationStrategyData as e, ContentNavigator as f, type AssignedContent as g, type StudyContentSource as h, type StudentClassroomDBInterface as i, type ScheduledCard as j, type StudySessionFailedItem as k, type StudySessionFailedNewItem as l, type StudySessionFailedReviewItem as m, type StudySessionNewItem as n, type StudySessionReviewItem as o, isReview as p, type ContentSourceID as q, getStudySource as r, type CourseRegistrationDoc as s, type AssignedTag as t, type AssignedCourse as u, type AssignedCard as v, type UserDBWriter as w, type UserDBAuthenticator as x, type UserCourseSettings as y, type UserCourseSetting as z };
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { J as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, G as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, K as CourseRegistration, s as CourseRegistrationDoc, b as CoursesDBInterface, N as NavigatorConstructor,
|
|
3
|
-
export { D as DataLayerProvider } from '../dataLayerProvider-
|
|
1
|
+
import { a2 as LearnableWeight, L as UserOutcomeRecord, a3 as OrchestrationContext, W as WeightedCard, U as UserDBInterface, C as CourseDBInterface, X as StrategyContribution } from '../contentSource-B7nXusjk.cjs';
|
|
2
|
+
export { J as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, G as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, K as CourseRegistration, s as CourseRegistrationDoc, b as CoursesDBInterface, N as NavigatorConstructor, _ as NavigatorRole, $ as NavigatorRoles, Z as Navigators, j as ScheduledCard, H as SessionTrackingData, i as StudentClassroomDBInterface, h as StudyContentSource, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, S as StudySessionItem, n as StudySessionNewItem, o as StudySessionReviewItem, T as TeacherClassroomDBInterface, I as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, B as UsrCrsDataInterface, a4 as computeDeviation, a6 as computeEffectiveWeight, a5 as computeSpread, a7 as createOrchestrationContext, Y as getCardOrigin, O as getRegisteredNavigator, R as getRegisteredNavigatorNames, Q as getRegisteredNavigatorRole, r as getStudySource, P as hasRegisteredNavigator, V as initializeNavigatorRegistry, a1 as isFilter, a0 as isGenerator, p as isReview, M as registerNavigator } from '../contentSource-B7nXusjk.cjs';
|
|
3
|
+
export { D as DataLayerProvider } from '../dataLayerProvider-BW7HvkMt.cjs';
|
|
4
4
|
import { D as DocType, i as QuestionRecord, b as DocTypePrefixes, C as CardHistory, c as CardRecord } from '../types-legacy-JXDxinpU.cjs';
|
|
5
5
|
export { d as CardData, e as CourseListData, g as DataShapeData, f as DisplayableData, F as Field, G as GuestUsername, Q as QualifiedCardID, h as QuestionData, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from '../types-legacy-JXDxinpU.cjs';
|
|
6
6
|
import { DataShape, ParsedCard } from '@vue-skuilder/common';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { J as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, G as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, K as CourseRegistration, s as CourseRegistrationDoc, b as CoursesDBInterface, N as NavigatorConstructor,
|
|
3
|
-
export { D as DataLayerProvider } from '../dataLayerProvider-
|
|
1
|
+
import { a2 as LearnableWeight, L as UserOutcomeRecord, a3 as OrchestrationContext, W as WeightedCard, U as UserDBInterface, C as CourseDBInterface, X as StrategyContribution } from '../contentSource-ygoFw9oV.js';
|
|
2
|
+
export { J as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, G as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, K as CourseRegistration, s as CourseRegistrationDoc, b as CoursesDBInterface, N as NavigatorConstructor, _ as NavigatorRole, $ as NavigatorRoles, Z as Navigators, j as ScheduledCard, H as SessionTrackingData, i as StudentClassroomDBInterface, h as StudyContentSource, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, S as StudySessionItem, n as StudySessionNewItem, o as StudySessionReviewItem, T as TeacherClassroomDBInterface, I as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, B as UsrCrsDataInterface, a4 as computeDeviation, a6 as computeEffectiveWeight, a5 as computeSpread, a7 as createOrchestrationContext, Y as getCardOrigin, O as getRegisteredNavigator, R as getRegisteredNavigatorNames, Q as getRegisteredNavigatorRole, r as getStudySource, P as hasRegisteredNavigator, V as initializeNavigatorRegistry, a1 as isFilter, a0 as isGenerator, p as isReview, M as registerNavigator } from '../contentSource-ygoFw9oV.js';
|
|
3
|
+
export { D as DataLayerProvider } from '../dataLayerProvider-BfXUVDuG.js';
|
|
4
4
|
import { D as DocType, i as QuestionRecord, b as DocTypePrefixes, C as CardHistory, c as CardRecord } from '../types-legacy-JXDxinpU.js';
|
|
5
5
|
export { d as CardData, e as CourseListData, g as DataShapeData, f as DisplayableData, F as Field, G as GuestUsername, Q as QualifiedCardID, h as QuestionData, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from '../types-legacy-JXDxinpU.js';
|
|
6
6
|
import { DataShape, ParsedCard } from '@vue-skuilder/common';
|
package/dist/core/index.js
CHANGED
|
@@ -3180,6 +3180,7 @@ __export(navigators_exports, {
|
|
|
3180
3180
|
getCardOrigin: () => getCardOrigin,
|
|
3181
3181
|
getRegisteredNavigator: () => getRegisteredNavigator,
|
|
3182
3182
|
getRegisteredNavigatorNames: () => getRegisteredNavigatorNames,
|
|
3183
|
+
getRegisteredNavigatorRole: () => getRegisteredNavigatorRole,
|
|
3183
3184
|
hasRegisteredNavigator: () => hasRegisteredNavigator,
|
|
3184
3185
|
initializeNavigatorRegistry: () => initializeNavigatorRegistry,
|
|
3185
3186
|
isFilter: () => isFilter,
|
|
@@ -3188,16 +3189,19 @@ __export(navigators_exports, {
|
|
|
3188
3189
|
pipelineDebugAPI: () => pipelineDebugAPI,
|
|
3189
3190
|
registerNavigator: () => registerNavigator
|
|
3190
3191
|
});
|
|
3191
|
-
function registerNavigator(implementingClass, constructor) {
|
|
3192
|
-
navigatorRegistry.set(implementingClass, constructor);
|
|
3193
|
-
logger.debug(`[NavigatorRegistry] Registered: ${implementingClass}`);
|
|
3192
|
+
function registerNavigator(implementingClass, constructor, role) {
|
|
3193
|
+
navigatorRegistry.set(implementingClass, { constructor, role });
|
|
3194
|
+
logger.debug(`[NavigatorRegistry] Registered: ${implementingClass}${role ? ` (${role})` : ""}`);
|
|
3194
3195
|
}
|
|
3195
3196
|
function getRegisteredNavigator(implementingClass) {
|
|
3196
|
-
return navigatorRegistry.get(implementingClass);
|
|
3197
|
+
return navigatorRegistry.get(implementingClass)?.constructor;
|
|
3197
3198
|
}
|
|
3198
3199
|
function hasRegisteredNavigator(implementingClass) {
|
|
3199
3200
|
return navigatorRegistry.has(implementingClass);
|
|
3200
3201
|
}
|
|
3202
|
+
function getRegisteredNavigatorRole(implementingClass) {
|
|
3203
|
+
return navigatorRegistry.get(implementingClass)?.role;
|
|
3204
|
+
}
|
|
3201
3205
|
function getRegisteredNavigatorNames() {
|
|
3202
3206
|
return Array.from(navigatorRegistry.keys());
|
|
3203
3207
|
}
|
|
@@ -3243,10 +3247,12 @@ function getCardOrigin(card) {
|
|
|
3243
3247
|
return "new";
|
|
3244
3248
|
}
|
|
3245
3249
|
function isGenerator(impl) {
|
|
3246
|
-
|
|
3250
|
+
if (NavigatorRoles[impl] === "generator" /* GENERATOR */) return true;
|
|
3251
|
+
return getRegisteredNavigatorRole(impl) === "generator" /* GENERATOR */;
|
|
3247
3252
|
}
|
|
3248
3253
|
function isFilter(impl) {
|
|
3249
|
-
|
|
3254
|
+
if (NavigatorRoles[impl] === "filter" /* FILTER */) return true;
|
|
3255
|
+
return getRegisteredNavigatorRole(impl) === "filter" /* FILTER */;
|
|
3250
3256
|
}
|
|
3251
3257
|
var navigatorRegistry, Navigators, NavigatorRole, NavigatorRoles, ContentNavigator;
|
|
3252
3258
|
var init_navigators = __esm({
|
|
@@ -6159,6 +6165,7 @@ __export(core_exports, {
|
|
|
6159
6165
|
getDefaultLearnableWeight: () => getDefaultLearnableWeight,
|
|
6160
6166
|
getRegisteredNavigator: () => getRegisteredNavigator,
|
|
6161
6167
|
getRegisteredNavigatorNames: () => getRegisteredNavigatorNames,
|
|
6168
|
+
getRegisteredNavigatorRole: () => getRegisteredNavigatorRole,
|
|
6162
6169
|
getStudySource: () => getStudySource,
|
|
6163
6170
|
hasRegisteredNavigator: () => hasRegisteredNavigator,
|
|
6164
6171
|
importParsedCards: () => importParsedCards,
|
|
@@ -6223,6 +6230,7 @@ init_core();
|
|
|
6223
6230
|
getDefaultLearnableWeight,
|
|
6224
6231
|
getRegisteredNavigator,
|
|
6225
6232
|
getRegisteredNavigatorNames,
|
|
6233
|
+
getRegisteredNavigatorRole,
|
|
6226
6234
|
getStudySource,
|
|
6227
6235
|
hasRegisteredNavigator,
|
|
6228
6236
|
importParsedCards,
|