@vue-skuilder/db 0.1.11-9 → 0.1.12
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/core/index.d.mts +7 -6
- package/dist/core/index.d.ts +7 -6
- package/dist/core/index.js +358 -87
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +358 -87
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-DqtNroSh.d.ts → dataLayerProvider-BiP3kWix.d.mts} +8 -1
- package/dist/{dataLayerProvider-BInqI_RF.d.mts → dataLayerProvider-DSdeyRT3.d.ts} +8 -1
- package/dist/impl/couch/index.d.mts +19 -7
- package/dist/impl/couch/index.d.ts +19 -7
- package/dist/impl/couch/index.js +375 -100
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +374 -99
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.mts +23 -8
- package/dist/impl/static/index.d.ts +23 -8
- package/dist/impl/static/index.js +289 -85
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +289 -85
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/{index-CUNnL38E.d.mts → index-Bmll7Xse.d.mts} +1 -1
- package/dist/{index-CLL31bEy.d.ts → index-CD8BZz2k.d.ts} +1 -1
- package/dist/index.d.mts +123 -20
- package/dist/index.d.ts +123 -20
- package/dist/index.js +1133 -343
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1137 -343
- package/dist/index.mjs.map +1 -1
- package/dist/pouch/index.d.mts +1 -0
- package/dist/pouch/index.d.ts +1 -0
- package/dist/pouch/index.js +49 -0
- package/dist/pouch/index.js.map +1 -0
- package/dist/pouch/index.mjs +16 -0
- package/dist/pouch/index.mjs.map +1 -0
- package/dist/{types-BefDGkKa.d.ts → types-CewsN87z.d.ts} +1 -1
- package/dist/{types-DC-ckZug.d.mts → types-Dbp5DaRR.d.mts} +1 -1
- package/dist/{types-legacy-Birv-Jx6.d.mts → types-legacy-6ettoclI.d.mts} +17 -2
- package/dist/{types-legacy-Birv-Jx6.d.ts → types-legacy-6ettoclI.d.ts} +17 -2
- package/dist/{userDB-DusL7OXe.d.ts → userDB-C4yyAnpp.d.mts} +89 -56
- package/dist/{userDB-C33Hzjgn.d.mts → userDB-CD6s6ZCp.d.ts} +89 -56
- package/dist/util/packer/index.d.mts +3 -3
- package/dist/util/packer/index.d.ts +3 -3
- package/package.json +3 -3
- package/src/core/interfaces/contentSource.ts +3 -2
- package/src/core/interfaces/courseDB.ts +26 -3
- package/src/core/interfaces/dataLayerProvider.ts +9 -1
- package/src/core/interfaces/userDB.ts +80 -64
- package/src/core/navigators/elo.ts +10 -7
- package/src/core/navigators/hardcodedOrder.ts +64 -0
- package/src/core/navigators/index.ts +2 -1
- package/src/core/types/contentNavigationStrategy.ts +2 -1
- package/src/core/types/types-legacy.ts +7 -2
- package/src/impl/common/BaseUserDB.ts +60 -14
- package/src/impl/couch/CouchDBSyncStrategy.ts +2 -2
- package/src/impl/couch/PouchDataLayerProvider.ts +21 -0
- package/src/impl/couch/adminDB.ts +2 -2
- package/src/impl/couch/auth.ts +13 -4
- package/src/impl/couch/classroomDB.ts +10 -12
- package/src/impl/couch/courseAPI.ts +2 -2
- package/src/impl/couch/courseDB.ts +204 -38
- package/src/impl/couch/courseLookupDB.ts +4 -3
- package/src/impl/couch/index.ts +36 -4
- package/src/impl/couch/pouchdb-setup.ts +3 -3
- package/src/impl/couch/updateQueue.ts +59 -36
- package/src/impl/static/StaticDataLayerProvider.ts +68 -17
- package/src/impl/static/courseDB.ts +64 -20
- package/src/impl/static/coursesDB.ts +10 -6
- package/src/pouch/index.ts +2 -0
- package/src/study/ItemQueue.ts +58 -0
- package/src/study/SessionController.ts +182 -111
- package/src/study/SpacedRepetition.ts +1 -1
- package/src/study/services/CardHydrationService.ts +153 -0
- package/src/study/services/EloService.ts +85 -0
- package/src/study/services/ResponseProcessor.ts +224 -0
- package/src/study/services/SrsService.ts +44 -0
- package/tsup.config.ts +1 -0
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import { U as UserDBInterface, C as CourseDBInterface,
|
|
2
|
-
import { D as DataLayerProvider } from '../../dataLayerProvider-
|
|
3
|
-
import { S as StaticCourseManifest } from '../../types-
|
|
1
|
+
import { U as UserDBInterface, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface, a as UserDBReader, d as CourseInfo, S as StudySessionNewItem, D as DataLayerResult, e as ContentNavigationStrategyData, f as StudySessionReviewItem, g as ScheduledCard } from '../../userDB-C4yyAnpp.mjs';
|
|
2
|
+
import { D as DataLayerProvider } from '../../dataLayerProvider-BiP3kWix.mjs';
|
|
3
|
+
import { S as StaticCourseManifest } from '../../types-Dbp5DaRR.mjs';
|
|
4
4
|
import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
|
|
5
|
-
import { S as SkuilderCourseData, T as TagStub, a as Tag } from '../../types-legacy-
|
|
5
|
+
import { S as SkuilderCourseData, Q as QualifiedCardID, T as TagStub, a as Tag } from '../../types-legacy-6ettoclI.mjs';
|
|
6
6
|
import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.mjs';
|
|
7
7
|
import 'moment';
|
|
8
8
|
|
|
9
|
+
interface SkuilderManifest {
|
|
10
|
+
name?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
dependencies?: Record<string, string>;
|
|
14
|
+
}
|
|
9
15
|
interface StaticDataLayerConfig {
|
|
10
|
-
staticContentPath: string;
|
|
11
16
|
localStoragePrefix?: string;
|
|
12
|
-
|
|
17
|
+
rootManifest: SkuilderManifest;
|
|
18
|
+
rootManifestUrl: string;
|
|
13
19
|
}
|
|
14
20
|
declare class StaticDataLayerProvider implements DataLayerProvider {
|
|
15
21
|
private config;
|
|
16
22
|
private initialized;
|
|
17
23
|
private courseUnpackers;
|
|
24
|
+
private manifests;
|
|
18
25
|
constructor(config: Partial<StaticDataLayerConfig>);
|
|
26
|
+
private resolveCourseDependencies;
|
|
19
27
|
initialize(): Promise<void>;
|
|
20
28
|
teardown(): Promise<void>;
|
|
21
29
|
getUserDB(): UserDBInterface;
|
|
@@ -23,6 +31,7 @@ declare class StaticDataLayerProvider implements DataLayerProvider {
|
|
|
23
31
|
getCoursesDB(): CoursesDBInterface;
|
|
24
32
|
getClassroomDB(_classId: string, _type: 'student' | 'teacher'): Promise<ClassroomDBInterface>;
|
|
25
33
|
getAdminDB(): AdminDBInterface;
|
|
34
|
+
createUserReaderForUser(targetUsername: string): Promise<UserDBReader>;
|
|
26
35
|
isReadOnly(): boolean;
|
|
27
36
|
}
|
|
28
37
|
|
|
@@ -118,14 +127,18 @@ declare class StaticCourseDB implements CourseDBInterface {
|
|
|
118
127
|
getCourseInfo(): Promise<CourseInfo>;
|
|
119
128
|
getCourseDoc<T extends SkuilderCourseData>(id: string, _options?: PouchDB.Core.GetOptions): Promise<T>;
|
|
120
129
|
getCourseDocs<T extends SkuilderCourseData>(ids: string[], _options?: PouchDB.Core.AllDocsOptions): Promise<PouchDB.Core.AllDocsWithKeysResponse<{} & T>>;
|
|
121
|
-
getCardsByELO(elo: number, limit?: number): Promise<
|
|
130
|
+
getCardsByELO(elo: number, limit?: number): Promise<{
|
|
131
|
+
courseID: string;
|
|
132
|
+
cardID: string;
|
|
133
|
+
elo?: number;
|
|
134
|
+
}[]>;
|
|
122
135
|
getCardEloData(cardIds: string[]): Promise<CourseElo[]>;
|
|
123
136
|
updateCardElo(cardId: string, _elo: CourseElo): Promise<PouchDB.Core.Response>;
|
|
124
137
|
getNewCards(limit?: number): Promise<StudySessionNewItem[]>;
|
|
125
138
|
getCardsCenteredAtELO(options: {
|
|
126
139
|
limit: number;
|
|
127
140
|
elo: 'user' | 'random' | number;
|
|
128
|
-
}, filter?: (id:
|
|
141
|
+
}, filter?: (id: QualifiedCardID) => boolean): Promise<StudySessionNewItem[]>;
|
|
129
142
|
getAppliedTags(cardId: string): Promise<PouchDB.Query.Response<TagStub>>;
|
|
130
143
|
addTagToCard(_cardId: string, _tagId: string): Promise<PouchDB.Core.Response>;
|
|
131
144
|
removeTagFromCard(_cardId: string, _tagId: string): Promise<PouchDB.Core.Response>;
|
|
@@ -154,6 +167,8 @@ declare class StaticCourseDB implements CourseDBInterface {
|
|
|
154
167
|
* Internal helper method for static attachment serving
|
|
155
168
|
*/
|
|
156
169
|
getAttachmentBlob(docId: string, attachmentName: string): Promise<Blob | Buffer | null>;
|
|
170
|
+
searchCards(_query: string): Promise<any[]>;
|
|
171
|
+
find(_request: PouchDB.Find.FindRequest<any>): Promise<PouchDB.Find.FindResponse<any>>;
|
|
157
172
|
}
|
|
158
173
|
|
|
159
174
|
declare class StaticCoursesDB implements CoursesDBInterface {
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import { U as UserDBInterface, C as CourseDBInterface,
|
|
2
|
-
import { D as DataLayerProvider } from '../../dataLayerProvider-
|
|
3
|
-
import { S as StaticCourseManifest } from '../../types-
|
|
1
|
+
import { U as UserDBInterface, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface, a as UserDBReader, d as CourseInfo, S as StudySessionNewItem, D as DataLayerResult, e as ContentNavigationStrategyData, f as StudySessionReviewItem, g as ScheduledCard } from '../../userDB-CD6s6ZCp.js';
|
|
2
|
+
import { D as DataLayerProvider } from '../../dataLayerProvider-DSdeyRT3.js';
|
|
3
|
+
import { S as StaticCourseManifest } from '../../types-CewsN87z.js';
|
|
4
4
|
import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
|
|
5
|
-
import { S as SkuilderCourseData, T as TagStub, a as Tag } from '../../types-legacy-
|
|
5
|
+
import { S as SkuilderCourseData, Q as QualifiedCardID, T as TagStub, a as Tag } from '../../types-legacy-6ettoclI.js';
|
|
6
6
|
import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.js';
|
|
7
7
|
import 'moment';
|
|
8
8
|
|
|
9
|
+
interface SkuilderManifest {
|
|
10
|
+
name?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
dependencies?: Record<string, string>;
|
|
14
|
+
}
|
|
9
15
|
interface StaticDataLayerConfig {
|
|
10
|
-
staticContentPath: string;
|
|
11
16
|
localStoragePrefix?: string;
|
|
12
|
-
|
|
17
|
+
rootManifest: SkuilderManifest;
|
|
18
|
+
rootManifestUrl: string;
|
|
13
19
|
}
|
|
14
20
|
declare class StaticDataLayerProvider implements DataLayerProvider {
|
|
15
21
|
private config;
|
|
16
22
|
private initialized;
|
|
17
23
|
private courseUnpackers;
|
|
24
|
+
private manifests;
|
|
18
25
|
constructor(config: Partial<StaticDataLayerConfig>);
|
|
26
|
+
private resolveCourseDependencies;
|
|
19
27
|
initialize(): Promise<void>;
|
|
20
28
|
teardown(): Promise<void>;
|
|
21
29
|
getUserDB(): UserDBInterface;
|
|
@@ -23,6 +31,7 @@ declare class StaticDataLayerProvider implements DataLayerProvider {
|
|
|
23
31
|
getCoursesDB(): CoursesDBInterface;
|
|
24
32
|
getClassroomDB(_classId: string, _type: 'student' | 'teacher'): Promise<ClassroomDBInterface>;
|
|
25
33
|
getAdminDB(): AdminDBInterface;
|
|
34
|
+
createUserReaderForUser(targetUsername: string): Promise<UserDBReader>;
|
|
26
35
|
isReadOnly(): boolean;
|
|
27
36
|
}
|
|
28
37
|
|
|
@@ -118,14 +127,18 @@ declare class StaticCourseDB implements CourseDBInterface {
|
|
|
118
127
|
getCourseInfo(): Promise<CourseInfo>;
|
|
119
128
|
getCourseDoc<T extends SkuilderCourseData>(id: string, _options?: PouchDB.Core.GetOptions): Promise<T>;
|
|
120
129
|
getCourseDocs<T extends SkuilderCourseData>(ids: string[], _options?: PouchDB.Core.AllDocsOptions): Promise<PouchDB.Core.AllDocsWithKeysResponse<{} & T>>;
|
|
121
|
-
getCardsByELO(elo: number, limit?: number): Promise<
|
|
130
|
+
getCardsByELO(elo: number, limit?: number): Promise<{
|
|
131
|
+
courseID: string;
|
|
132
|
+
cardID: string;
|
|
133
|
+
elo?: number;
|
|
134
|
+
}[]>;
|
|
122
135
|
getCardEloData(cardIds: string[]): Promise<CourseElo[]>;
|
|
123
136
|
updateCardElo(cardId: string, _elo: CourseElo): Promise<PouchDB.Core.Response>;
|
|
124
137
|
getNewCards(limit?: number): Promise<StudySessionNewItem[]>;
|
|
125
138
|
getCardsCenteredAtELO(options: {
|
|
126
139
|
limit: number;
|
|
127
140
|
elo: 'user' | 'random' | number;
|
|
128
|
-
}, filter?: (id:
|
|
141
|
+
}, filter?: (id: QualifiedCardID) => boolean): Promise<StudySessionNewItem[]>;
|
|
129
142
|
getAppliedTags(cardId: string): Promise<PouchDB.Query.Response<TagStub>>;
|
|
130
143
|
addTagToCard(_cardId: string, _tagId: string): Promise<PouchDB.Core.Response>;
|
|
131
144
|
removeTagFromCard(_cardId: string, _tagId: string): Promise<PouchDB.Core.Response>;
|
|
@@ -154,6 +167,8 @@ declare class StaticCourseDB implements CourseDBInterface {
|
|
|
154
167
|
* Internal helper method for static attachment serving
|
|
155
168
|
*/
|
|
156
169
|
getAttachmentBlob(docId: string, attachmentName: string): Promise<Blob | Buffer | null>;
|
|
170
|
+
searchCards(_query: string): Promise<any[]>;
|
|
171
|
+
find(_request: PouchDB.Find.FindRequest<any>): Promise<PouchDB.Find.FindResponse<any>>;
|
|
157
172
|
}
|
|
158
173
|
|
|
159
174
|
declare class StaticCoursesDB implements CoursesDBInterface {
|