@vue-skuilder/db 0.1.18 → 0.1.21
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/CLAUDE.md +2 -2
- package/dist/{classroomDB-BgfrVb8d.d.ts → contentSource-BP9hznNV.d.ts} +220 -197
- package/dist/{classroomDB-CTOenngH.d.cts → contentSource-DsJadoBU.d.cts} +220 -197
- package/dist/core/index.d.cts +80 -6
- package/dist/core/index.d.ts +80 -6
- package/dist/core/index.js +735 -1560
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +708 -1539
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-D6PoCwS6.d.cts → dataLayerProvider-CHYrQ5pB.d.cts} +1 -1
- package/dist/{dataLayerProvider-CZxC9GtB.d.ts → dataLayerProvider-MDTxXq2l.d.ts} +1 -1
- package/dist/impl/couch/index.d.cts +8 -23
- package/dist/impl/couch/index.d.ts +8 -23
- package/dist/impl/couch/index.js +723 -1578
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +692 -1552
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +25 -8
- package/dist/impl/static/index.d.ts +25 -8
- package/dist/impl/static/index.js +700 -1400
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +688 -1393
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/{index-D-Fa4Smt.d.cts → index-B_j6u5E4.d.cts} +1 -1
- package/dist/{index-CD8BZz2k.d.ts → index-Dj0SEgk3.d.ts} +1 -1
- package/dist/index.d.cts +71 -63
- package/dist/index.d.ts +71 -63
- package/dist/index.js +1162 -1996
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1124 -1955
- package/dist/index.mjs.map +1 -1
- package/dist/pouch/index.js +3 -0
- package/dist/pouch/index.js.map +1 -1
- package/dist/pouch/index.mjs +3 -0
- package/dist/pouch/index.mjs.map +1 -1
- package/dist/{types-CzPDLAK6.d.cts → types-Bn0itutr.d.cts} +1 -1
- package/dist/{types-CewsN87z.d.ts → types-DQaXnuoc.d.ts} +1 -1
- package/dist/{types-legacy-6ettoclI.d.cts → types-legacy-DDY4N-Uq.d.cts} +3 -1
- package/dist/{types-legacy-6ettoclI.d.ts → types-legacy-DDY4N-Uq.d.ts} +3 -1
- package/dist/util/packer/index.d.cts +3 -3
- package/dist/util/packer/index.d.ts +3 -3
- package/docs/navigators-architecture.md +115 -17
- package/package.json +4 -4
- package/src/core/index.ts +1 -0
- package/src/core/interfaces/classroomDB.ts +5 -13
- package/src/core/interfaces/contentSource.ts +6 -66
- package/src/core/interfaces/courseDB.ts +15 -7
- package/src/core/interfaces/userDB.ts +32 -0
- package/src/core/navigators/Pipeline.ts +136 -52
- package/src/core/navigators/PipelineAssembler.ts +1 -1
- package/src/core/navigators/defaults.ts +84 -0
- package/src/core/navigators/{hierarchyDefinition.ts → filters/hierarchyDefinition.ts} +15 -29
- package/src/core/navigators/filters/index.ts +3 -0
- package/src/core/navigators/filters/inferredPreferenceStub.ts +107 -0
- package/src/core/navigators/{interferenceMitigator.ts → filters/interferenceMitigator.ts} +11 -37
- package/src/core/navigators/{relativePriority.ts → filters/relativePriority.ts} +12 -38
- package/src/core/navigators/filters/userGoalStub.ts +136 -0
- package/src/core/navigators/filters/userTagPreference.ts +217 -0
- package/src/core/navigators/{CompositeGenerator.ts → generators/CompositeGenerator.ts} +15 -64
- package/src/core/navigators/{elo.ts → generators/elo.ts} +13 -63
- package/src/core/navigators/{srs.ts → generators/srs.ts} +11 -40
- package/src/core/navigators/generators/types.ts +1 -1
- package/src/core/navigators/index.ts +95 -91
- package/src/core/types/strategyState.ts +84 -0
- package/src/core/types/types-legacy.ts +2 -0
- package/src/impl/common/BaseUserDB.ts +74 -7
- package/src/impl/couch/adminDB.ts +1 -2
- package/src/impl/couch/classroomDB.ts +100 -103
- package/src/impl/couch/courseDB.ts +35 -91
- package/src/impl/couch/pouchdb-setup.ts +7 -0
- package/src/impl/static/StaticDataUnpacker.ts +50 -1
- package/src/impl/static/courseDB.ts +87 -37
- package/src/study/SessionController.ts +122 -202
- package/src/study/SourceMixer.ts +65 -0
- package/src/study/TagFilteredContentSource.ts +49 -92
- package/src/study/index.ts +1 -0
- package/src/study/services/CardHydrationService.ts +165 -81
- package/src/util/dataDirectory.ts +1 -1
- package/src/util/index.ts +0 -1
- package/tests/core/navigators/CompositeGenerator.test.ts +44 -168
- package/tests/core/navigators/Pipeline.test.ts +6 -72
- package/tests/core/navigators/PipelineAssembler.test.ts +8 -58
- package/tests/core/navigators/navigators.test.ts +118 -151
- package/docs/todo-pipeline-optimization.md +0 -117
- package/docs/todo-strategy-state-storage.md +0 -278
- package/src/core/navigators/hardcodedOrder.ts +0 -163
- package/src/util/tuiLogger.ts +0 -139
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './
|
|
1
|
+
import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './contentSource-DsJadoBU.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Main factory interface for data access
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './
|
|
1
|
+
import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './contentSource-BP9hznNV.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Main factory interface for data access
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TagStub, a as Tag, S as SkuilderCourseData, Q as QualifiedCardID } from '../../types-legacy-
|
|
1
|
+
import { T as TagStub, a as Tag, S as SkuilderCourseData, Q as QualifiedCardID } from '../../types-legacy-DDY4N-Uq.cjs';
|
|
2
2
|
import { Moment } from 'moment';
|
|
3
|
-
import { A as AdminDBInterface,
|
|
4
|
-
export { q as ContentSourceID,
|
|
3
|
+
import { A as AdminDBInterface, g as AssignedContent, h as StudyContentSource, i as StudentClassroomDBInterface, U as UserDBInterface, W as WeightedCard, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, S as StudySessionItem, j as ScheduledCard } from '../../contentSource-DsJadoBU.cjs';
|
|
4
|
+
export { q as ContentSourceID, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, n as StudySessionNewItem, o as StudySessionReviewItem, r as getStudySource, p as isReview } from '../../contentSource-DsJadoBU.cjs';
|
|
5
5
|
import * as _vue_skuilder_common from '@vue-skuilder/common';
|
|
6
6
|
import { ClassroomConfig, DataShape, CourseElo, CourseConfig as CourseConfig$1 } from '@vue-skuilder/common';
|
|
7
7
|
import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.cjs';
|
|
@@ -86,14 +86,11 @@ declare class StudentClassroomDB extends ClassroomDBBase implements StudyContent
|
|
|
86
86
|
init(): Promise<void>;
|
|
87
87
|
static factory(classID: string, user: UserDBInterface): Promise<StudentClassroomDB>;
|
|
88
88
|
setChangeFcn(f: (value: unknown) => object): void;
|
|
89
|
-
getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
|
|
90
|
-
getNewCards(): Promise<StudySessionNewItem[]>;
|
|
91
89
|
/**
|
|
92
90
|
* Get cards with suitability scores for presentation.
|
|
93
91
|
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* support pluggable navigation strategies.
|
|
92
|
+
* Gathers new cards from assigned content (courses, tags, cards) and
|
|
93
|
+
* pending reviews scheduled for this classroom. Assigns score=1.0 to all.
|
|
97
94
|
*
|
|
98
95
|
* @param limit - Maximum number of cards to return
|
|
99
96
|
* @returns Cards sorted by score descending (all scores = 1.0)
|
|
@@ -150,7 +147,7 @@ declare class CoursesDB implements CoursesDBInterface {
|
|
|
150
147
|
getCourseConfig(courseId: string): Promise<CourseConfig$1>;
|
|
151
148
|
disambiguateCourse(courseId: string, disambiguator: string): Promise<void>;
|
|
152
149
|
}
|
|
153
|
-
declare class CourseDB implements
|
|
150
|
+
declare class CourseDB implements CourseDBInterface {
|
|
154
151
|
private db;
|
|
155
152
|
private id;
|
|
156
153
|
private _getCurrentUser;
|
|
@@ -191,6 +188,7 @@ declare class CourseDB implements StudyContentSource, CourseDBInterface {
|
|
|
191
188
|
updateCourseConfig(cfg: CourseConfig$1): Promise<PouchDB.Core.Response>;
|
|
192
189
|
updateCardElo(cardId: string, elo: CourseElo): Promise<PouchDB.Core.Response>;
|
|
193
190
|
getAppliedTags(cardId: string): Promise<PouchDB.Query.Response<TagStub>>;
|
|
191
|
+
getAppliedTagsBatch(cardIds: string[]): Promise<Map<string, string[]>>;
|
|
194
192
|
addTagToCard(cardId: string, tagId: string, updateELO?: boolean): Promise<PouchDB.Core.Response>;
|
|
195
193
|
removeTagFromCard(cardId: string, tagId: string): Promise<PouchDB.Core.Response>;
|
|
196
194
|
createTag(name: string, author: string): Promise<PouchDB.Core.Response>;
|
|
@@ -216,19 +214,6 @@ declare class CourseDB implements StudyContentSource, CourseDBInterface {
|
|
|
216
214
|
* @returns Instantiated ContentNavigator ready for use
|
|
217
215
|
*/
|
|
218
216
|
createNavigator(user: UserDBInterface): Promise<ContentNavigator>;
|
|
219
|
-
private makeDefaultEloStrategy;
|
|
220
|
-
private makeDefaultSrsStrategy;
|
|
221
|
-
/**
|
|
222
|
-
* Creates the default navigation pipeline for courses with no configured strategies.
|
|
223
|
-
*
|
|
224
|
-
* Default: Pipeline(Composite(ELO, SRS), [eloDistanceFilter])
|
|
225
|
-
* - ELO generator: scores new cards by skill proximity
|
|
226
|
-
* - SRS generator: scores reviews by overdueness and interval recency
|
|
227
|
-
* - ELO distance filter: penalizes cards far from user's current level
|
|
228
|
-
*/
|
|
229
|
-
private createDefaultPipeline;
|
|
230
|
-
getNewCards(limit?: number): Promise<StudySessionNewItem[]>;
|
|
231
|
-
getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
|
|
232
217
|
/**
|
|
233
218
|
* Get cards with suitability scores for presentation.
|
|
234
219
|
*
|
|
@@ -346,4 +331,4 @@ declare function getStartAndEndKeys(key: string): {
|
|
|
346
331
|
endkey: string;
|
|
347
332
|
};
|
|
348
333
|
|
|
349
|
-
export { AdminDB, CLASSROOM_CONFIG, ClassroomLookupDB, type ClassroomMessage, CouchDBSyncStrategy, CourseDB, CoursesDB, REVIEW_TIME_FORMAT, StudentClassroomDB, StudyContentSource, StudySessionItem,
|
|
334
|
+
export { AdminDB, CLASSROOM_CONFIG, ClassroomLookupDB, type ClassroomMessage, CouchDBSyncStrategy, CourseDB, CoursesDB, REVIEW_TIME_FORMAT, StudentClassroomDB, StudyContentSource, StudySessionItem, TeacherClassroomDB, addNote55, addTagToCard, createPouchDBConfig, createTag, deleteTag, filterAllDocsByPrefix, getAncestorTagIDs, getAppliedTags, getChildTagStubs, getClassroomConfig, getClassroomDB, getCouchUserDB, getCourseDB, getCourseDataShapes, getCourseDoc, getCourseDocs, getCourseQuestionTypes, getCourseTagStubs, getCredentialledCourseConfig, getCredentialledDataShapes, getLatestVersion, getRandomCards, getStartAndEndKeys, getTag, getTagID, hexEncode, localUserDB, removeTagFromCard, scheduleCardReview, updateCardElo, updateCredentialledCourseConfig, updateGuestAccountExpirationDate, updateTag, usernameIsAvailable };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TagStub, a as Tag, S as SkuilderCourseData, Q as QualifiedCardID } from '../../types-legacy-
|
|
1
|
+
import { T as TagStub, a as Tag, S as SkuilderCourseData, Q as QualifiedCardID } from '../../types-legacy-DDY4N-Uq.js';
|
|
2
2
|
import { Moment } from 'moment';
|
|
3
|
-
import { A as AdminDBInterface,
|
|
4
|
-
export { q as ContentSourceID,
|
|
3
|
+
import { A as AdminDBInterface, g as AssignedContent, h as StudyContentSource, i as StudentClassroomDBInterface, U as UserDBInterface, W as WeightedCard, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, S as StudySessionItem, j as ScheduledCard } from '../../contentSource-BP9hznNV.js';
|
|
4
|
+
export { q as ContentSourceID, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, n as StudySessionNewItem, o as StudySessionReviewItem, r as getStudySource, p as isReview } from '../../contentSource-BP9hznNV.js';
|
|
5
5
|
import * as _vue_skuilder_common from '@vue-skuilder/common';
|
|
6
6
|
import { ClassroomConfig, DataShape, CourseElo, CourseConfig as CourseConfig$1 } from '@vue-skuilder/common';
|
|
7
7
|
import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.js';
|
|
@@ -86,14 +86,11 @@ declare class StudentClassroomDB extends ClassroomDBBase implements StudyContent
|
|
|
86
86
|
init(): Promise<void>;
|
|
87
87
|
static factory(classID: string, user: UserDBInterface): Promise<StudentClassroomDB>;
|
|
88
88
|
setChangeFcn(f: (value: unknown) => object): void;
|
|
89
|
-
getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
|
|
90
|
-
getNewCards(): Promise<StudySessionNewItem[]>;
|
|
91
89
|
/**
|
|
92
90
|
* Get cards with suitability scores for presentation.
|
|
93
91
|
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* support pluggable navigation strategies.
|
|
92
|
+
* Gathers new cards from assigned content (courses, tags, cards) and
|
|
93
|
+
* pending reviews scheduled for this classroom. Assigns score=1.0 to all.
|
|
97
94
|
*
|
|
98
95
|
* @param limit - Maximum number of cards to return
|
|
99
96
|
* @returns Cards sorted by score descending (all scores = 1.0)
|
|
@@ -150,7 +147,7 @@ declare class CoursesDB implements CoursesDBInterface {
|
|
|
150
147
|
getCourseConfig(courseId: string): Promise<CourseConfig$1>;
|
|
151
148
|
disambiguateCourse(courseId: string, disambiguator: string): Promise<void>;
|
|
152
149
|
}
|
|
153
|
-
declare class CourseDB implements
|
|
150
|
+
declare class CourseDB implements CourseDBInterface {
|
|
154
151
|
private db;
|
|
155
152
|
private id;
|
|
156
153
|
private _getCurrentUser;
|
|
@@ -191,6 +188,7 @@ declare class CourseDB implements StudyContentSource, CourseDBInterface {
|
|
|
191
188
|
updateCourseConfig(cfg: CourseConfig$1): Promise<PouchDB.Core.Response>;
|
|
192
189
|
updateCardElo(cardId: string, elo: CourseElo): Promise<PouchDB.Core.Response>;
|
|
193
190
|
getAppliedTags(cardId: string): Promise<PouchDB.Query.Response<TagStub>>;
|
|
191
|
+
getAppliedTagsBatch(cardIds: string[]): Promise<Map<string, string[]>>;
|
|
194
192
|
addTagToCard(cardId: string, tagId: string, updateELO?: boolean): Promise<PouchDB.Core.Response>;
|
|
195
193
|
removeTagFromCard(cardId: string, tagId: string): Promise<PouchDB.Core.Response>;
|
|
196
194
|
createTag(name: string, author: string): Promise<PouchDB.Core.Response>;
|
|
@@ -216,19 +214,6 @@ declare class CourseDB implements StudyContentSource, CourseDBInterface {
|
|
|
216
214
|
* @returns Instantiated ContentNavigator ready for use
|
|
217
215
|
*/
|
|
218
216
|
createNavigator(user: UserDBInterface): Promise<ContentNavigator>;
|
|
219
|
-
private makeDefaultEloStrategy;
|
|
220
|
-
private makeDefaultSrsStrategy;
|
|
221
|
-
/**
|
|
222
|
-
* Creates the default navigation pipeline for courses with no configured strategies.
|
|
223
|
-
*
|
|
224
|
-
* Default: Pipeline(Composite(ELO, SRS), [eloDistanceFilter])
|
|
225
|
-
* - ELO generator: scores new cards by skill proximity
|
|
226
|
-
* - SRS generator: scores reviews by overdueness and interval recency
|
|
227
|
-
* - ELO distance filter: penalizes cards far from user's current level
|
|
228
|
-
*/
|
|
229
|
-
private createDefaultPipeline;
|
|
230
|
-
getNewCards(limit?: number): Promise<StudySessionNewItem[]>;
|
|
231
|
-
getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
|
|
232
217
|
/**
|
|
233
218
|
* Get cards with suitability scores for presentation.
|
|
234
219
|
*
|
|
@@ -346,4 +331,4 @@ declare function getStartAndEndKeys(key: string): {
|
|
|
346
331
|
endkey: string;
|
|
347
332
|
};
|
|
348
333
|
|
|
349
|
-
export { AdminDB, CLASSROOM_CONFIG, ClassroomLookupDB, type ClassroomMessage, CouchDBSyncStrategy, CourseDB, CoursesDB, REVIEW_TIME_FORMAT, StudentClassroomDB, StudyContentSource, StudySessionItem,
|
|
334
|
+
export { AdminDB, CLASSROOM_CONFIG, ClassroomLookupDB, type ClassroomMessage, CouchDBSyncStrategy, CourseDB, CoursesDB, REVIEW_TIME_FORMAT, StudentClassroomDB, StudyContentSource, StudySessionItem, TeacherClassroomDB, addNote55, addTagToCard, createPouchDBConfig, createTag, deleteTag, filterAllDocsByPrefix, getAncestorTagIDs, getAppliedTags, getChildTagStubs, getClassroomConfig, getClassroomDB, getCouchUserDB, getCourseDB, getCourseDataShapes, getCourseDoc, getCourseDocs, getCourseQuestionTypes, getCourseTagStubs, getCredentialledCourseConfig, getCredentialledDataShapes, getLatestVersion, getRandomCards, getStartAndEndKeys, getTag, getTagID, hexEncode, localUserDB, removeTagFromCard, scheduleCardReview, updateCardElo, updateCredentialledCourseConfig, updateGuestAccountExpirationDate, updateTag, usernameIsAvailable };
|