@vue-skuilder/db 0.1.11-7 → 0.1.11
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 +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +212 -50
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +212 -50
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-DqtNroSh.d.ts → dataLayerProvider-VieuAAkV.d.mts} +8 -1
- package/dist/{dataLayerProvider-BInqI_RF.d.mts → dataLayerProvider-juuqUHOP.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 +229 -63
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +228 -62
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.mts +13 -6
- package/dist/impl/static/index.d.ts +13 -6
- package/dist/impl/static/index.js +142 -46
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +142 -46
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/{index-CLL31bEy.d.ts → index-CWY6yhkV.d.ts} +1 -1
- package/dist/{index-CUNnL38E.d.mts → index-DZyxHCcf.d.mts} +1 -1
- package/dist/index.d.mts +28 -20
- package/dist/index.d.ts +28 -20
- package/dist/index.js +374 -108
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +378 -108
- 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-DC-ckZug.d.mts → types-Che4wTwA.d.mts} +1 -1
- package/dist/{types-BefDGkKa.d.ts → types-DtoI27Xh.d.ts} +1 -1
- package/dist/{types-legacy-Birv-Jx6.d.mts → types-legacy-B8ahaCbj.d.mts} +5 -1
- package/dist/{types-legacy-Birv-Jx6.d.ts → types-legacy-B8ahaCbj.d.ts} +5 -1
- package/dist/{userDB-C33Hzjgn.d.mts → userDB-B7zTQ123.d.ts} +88 -55
- package/dist/{userDB-DusL7OXe.d.ts → userDB-DJ8HMw83.d.mts} +88 -55
- 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/index.ts +1 -1
- package/src/core/types/types-legacy.ts +5 -0
- package/src/impl/common/BaseUserDB.ts +45 -3
- 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 +130 -11
- 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 +51 -33
- package/src/impl/static/StaticDataLayerProvider.ts +11 -0
- package/src/impl/static/courseDB.ts +47 -8
- package/src/pouch/index.ts +2 -0
- package/src/study/SessionController.ts +168 -51
- package/src/study/SpacedRepetition.ts +1 -1
- package/tsup.config.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-
|
|
1
|
+
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-DtoI27Xh.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Abstraction for file system operations needed by the migrator.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-
|
|
1
|
+
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-Che4wTwA.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Abstraction for file system operations needed by the migrator.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { D as DataLayerProvider } from './dataLayerProvider-
|
|
4
|
-
import { C as CardRecord } from './types-legacy-
|
|
5
|
-
export { b as CardData,
|
|
1
|
+
import { k as StudySessionItem, i as StudyContentSource } from './userDB-DJ8HMw83.mjs';
|
|
2
|
+
export { G as ActivityRecord, A as AdminDBInterface, t as AssignedCard, h as AssignedContent, s as AssignedCourse, r as AssignedTag, c as ClassroomDBInterface, B as ClassroomRegistration, z as ClassroomRegistrationDesignation, E as ClassroomRegistrationDoc, p as ContentSourceID, C as CourseDBInterface, d as CourseInfo, H as CourseRegistration, I as CourseRegistrationDoc, b as CoursesDBInterface, J as DocumentUpdater, g as ScheduledCard, j as StudentClassroomDBInterface, l as StudySessionFailedItem, m as StudySessionFailedNewItem, n as StudySessionFailedReviewItem, S as StudySessionNewItem, f as StudySessionReviewItem, T as TeacherClassroomDBInterface, F as UserConfig, x as UserCourseSetting, w as UserCourseSettings, v as UserDBAuthenticator, U as UserDBInterface, a as UserDBReader, u as UserDBWriter, y as UsrCrsDataInterface, q as getStudySource, o as isReview, K as newInterval } from './userDB-DJ8HMw83.mjs';
|
|
3
|
+
import { D as DataLayerProvider } from './dataLayerProvider-VieuAAkV.mjs';
|
|
4
|
+
import { C as CardRecord } from './types-legacy-B8ahaCbj.mjs';
|
|
5
|
+
export { b as CardData, h as CardHistory, c as CourseListData, e as DataShapeData, d as DisplayableData, D as DocType, g as DocTypePrefixes, F as Field, G as GuestUsername, Q as QualifiedCardID, f as QuestionData, i as QuestionRecord, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from './types-legacy-B8ahaCbj.mjs';
|
|
6
6
|
import { Loggable } from './core/index.mjs';
|
|
7
7
|
export { BulkCardProcessorConfig, ContentNavigator, ImportResult, Navigators, areQuestionRecords, docIsDeleted, getCardHistoryID, importParsedCards, isQuestionRecord, parseCardHistoryID, validateProcessorConfig } from './core/index.mjs';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import { ViewData } from '@vue-skuilder/common';
|
|
9
|
+
import { S as StaticCourseManifest } from './types-Che4wTwA.mjs';
|
|
10
|
+
export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-Che4wTwA.mjs';
|
|
11
|
+
import { F as FileSystemAdapter } from './index-DZyxHCcf.mjs';
|
|
12
|
+
export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-DZyxHCcf.mjs';
|
|
13
13
|
import 'moment';
|
|
14
14
|
|
|
15
15
|
interface MigrationOptions {
|
|
@@ -203,20 +203,25 @@ interface StudySessionRecord {
|
|
|
203
203
|
item: StudySessionItem;
|
|
204
204
|
records: CardRecord[];
|
|
205
205
|
}
|
|
206
|
-
|
|
206
|
+
interface HydratedCard<TView = unknown> {
|
|
207
|
+
item: StudySessionItem;
|
|
208
|
+
view: TView;
|
|
209
|
+
data: ViewData[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare class SessionController<TView = unknown> extends Loggable {
|
|
207
213
|
_className: string;
|
|
208
214
|
private sources;
|
|
215
|
+
private dataLayer;
|
|
216
|
+
private getViewComponent;
|
|
209
217
|
private _sessionRecord;
|
|
210
218
|
set sessionRecord(r: StudySessionRecord[]);
|
|
211
219
|
private reviewQ;
|
|
212
220
|
private newQ;
|
|
213
221
|
private failedQ;
|
|
222
|
+
private hydratedQ;
|
|
214
223
|
private _currentCard;
|
|
215
|
-
|
|
216
|
-
* Indicates whether the session has been initialized - eg, the
|
|
217
|
-
* queues have been populated.
|
|
218
|
-
*/
|
|
219
|
-
private _isInitialized;
|
|
224
|
+
private hydration_in_progress;
|
|
220
225
|
private startTime;
|
|
221
226
|
private endTime;
|
|
222
227
|
private _secondsRemaining;
|
|
@@ -227,7 +232,7 @@ declare class SessionController extends Loggable {
|
|
|
227
232
|
/**
|
|
228
233
|
*
|
|
229
234
|
*/
|
|
230
|
-
constructor(sources: StudyContentSource[], time: number);
|
|
235
|
+
constructor(sources: StudyContentSource[], time: number, dataLayer: DataLayerProvider, getViewComponent: (viewId: string) => TView);
|
|
231
236
|
private tick;
|
|
232
237
|
/**
|
|
233
238
|
* Returns a rough, erring toward conservative, guess at
|
|
@@ -249,9 +254,12 @@ declare class SessionController extends Loggable {
|
|
|
249
254
|
reportString(): string;
|
|
250
255
|
private getScheduledReviews;
|
|
251
256
|
private getNewCards;
|
|
252
|
-
private
|
|
253
|
-
nextCard(action?: 'dismiss-success' | 'dismiss-failed' | 'marked-failed' | 'dismiss-error'):
|
|
257
|
+
private _selectNextItemToHydrate;
|
|
258
|
+
nextCard(action?: 'dismiss-success' | 'dismiss-failed' | 'marked-failed' | 'dismiss-error'): Promise<HydratedCard<TView> | null>;
|
|
254
259
|
private dismissCurrentCard;
|
|
260
|
+
private hasAvailableCards;
|
|
261
|
+
private nextHydratedCard;
|
|
262
|
+
private _fillHydratedQueue;
|
|
255
263
|
}
|
|
256
264
|
|
|
257
265
|
interface CourseLookupDoc {
|
|
@@ -333,4 +341,4 @@ declare function getDataLayer(): DataLayerProvider;
|
|
|
333
341
|
*/
|
|
334
342
|
declare function _resetDataLayer(): Promise<void>;
|
|
335
343
|
|
|
336
|
-
export { type AggregatedDocument, type AttachmentUploadResult, CardRecord, CourseLookup, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, FileSystemAdapter, Loggable, type MigrationOptions, type MigrationResult, NOT_SET, type RestoreProgress, SessionController, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, type StudySessionRecord, type ValidationIssue, type ValidationResult, _resetDataLayer, ensureAppDataDirectory, getAppDataDirectory, getDataLayer, getDbPath, getLogFilePath, initializeDataDirectory, initializeDataLayer, initializeTuiLogging, logger, showUserError, showUserMessage, validateMigration, validateStaticCourse };
|
|
344
|
+
export { type AggregatedDocument, type AttachmentUploadResult, CardRecord, CourseLookup, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, FileSystemAdapter, type HydratedCard, Loggable, type MigrationOptions, type MigrationResult, NOT_SET, type RestoreProgress, SessionController, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, type StudySessionRecord, type ValidationIssue, type ValidationResult, _resetDataLayer, ensureAppDataDirectory, getAppDataDirectory, getDataLayer, getDbPath, getLogFilePath, initializeDataDirectory, initializeDataLayer, initializeTuiLogging, logger, showUserError, showUserMessage, validateMigration, validateStaticCourse };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { D as DataLayerProvider } from './dataLayerProvider-
|
|
4
|
-
import { C as CardRecord } from './types-legacy-
|
|
5
|
-
export { b as CardData,
|
|
1
|
+
import { k as StudySessionItem, i as StudyContentSource } from './userDB-B7zTQ123.js';
|
|
2
|
+
export { G as ActivityRecord, A as AdminDBInterface, t as AssignedCard, h as AssignedContent, s as AssignedCourse, r as AssignedTag, c as ClassroomDBInterface, B as ClassroomRegistration, z as ClassroomRegistrationDesignation, E as ClassroomRegistrationDoc, p as ContentSourceID, C as CourseDBInterface, d as CourseInfo, H as CourseRegistration, I as CourseRegistrationDoc, b as CoursesDBInterface, J as DocumentUpdater, g as ScheduledCard, j as StudentClassroomDBInterface, l as StudySessionFailedItem, m as StudySessionFailedNewItem, n as StudySessionFailedReviewItem, S as StudySessionNewItem, f as StudySessionReviewItem, T as TeacherClassroomDBInterface, F as UserConfig, x as UserCourseSetting, w as UserCourseSettings, v as UserDBAuthenticator, U as UserDBInterface, a as UserDBReader, u as UserDBWriter, y as UsrCrsDataInterface, q as getStudySource, o as isReview, K as newInterval } from './userDB-B7zTQ123.js';
|
|
3
|
+
import { D as DataLayerProvider } from './dataLayerProvider-juuqUHOP.js';
|
|
4
|
+
import { C as CardRecord } from './types-legacy-B8ahaCbj.js';
|
|
5
|
+
export { b as CardData, h as CardHistory, c as CourseListData, e as DataShapeData, d as DisplayableData, D as DocType, g as DocTypePrefixes, F as Field, G as GuestUsername, Q as QualifiedCardID, f as QuestionData, i as QuestionRecord, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from './types-legacy-B8ahaCbj.js';
|
|
6
6
|
import { Loggable } from './core/index.js';
|
|
7
7
|
export { BulkCardProcessorConfig, ContentNavigator, ImportResult, Navigators, areQuestionRecords, docIsDeleted, getCardHistoryID, importParsedCards, isQuestionRecord, parseCardHistoryID, validateProcessorConfig } from './core/index.js';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import { ViewData } from '@vue-skuilder/common';
|
|
9
|
+
import { S as StaticCourseManifest } from './types-DtoI27Xh.js';
|
|
10
|
+
export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-DtoI27Xh.js';
|
|
11
|
+
import { F as FileSystemAdapter } from './index-CWY6yhkV.js';
|
|
12
|
+
export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-CWY6yhkV.js';
|
|
13
13
|
import 'moment';
|
|
14
14
|
|
|
15
15
|
interface MigrationOptions {
|
|
@@ -203,20 +203,25 @@ interface StudySessionRecord {
|
|
|
203
203
|
item: StudySessionItem;
|
|
204
204
|
records: CardRecord[];
|
|
205
205
|
}
|
|
206
|
-
|
|
206
|
+
interface HydratedCard<TView = unknown> {
|
|
207
|
+
item: StudySessionItem;
|
|
208
|
+
view: TView;
|
|
209
|
+
data: ViewData[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare class SessionController<TView = unknown> extends Loggable {
|
|
207
213
|
_className: string;
|
|
208
214
|
private sources;
|
|
215
|
+
private dataLayer;
|
|
216
|
+
private getViewComponent;
|
|
209
217
|
private _sessionRecord;
|
|
210
218
|
set sessionRecord(r: StudySessionRecord[]);
|
|
211
219
|
private reviewQ;
|
|
212
220
|
private newQ;
|
|
213
221
|
private failedQ;
|
|
222
|
+
private hydratedQ;
|
|
214
223
|
private _currentCard;
|
|
215
|
-
|
|
216
|
-
* Indicates whether the session has been initialized - eg, the
|
|
217
|
-
* queues have been populated.
|
|
218
|
-
*/
|
|
219
|
-
private _isInitialized;
|
|
224
|
+
private hydration_in_progress;
|
|
220
225
|
private startTime;
|
|
221
226
|
private endTime;
|
|
222
227
|
private _secondsRemaining;
|
|
@@ -227,7 +232,7 @@ declare class SessionController extends Loggable {
|
|
|
227
232
|
/**
|
|
228
233
|
*
|
|
229
234
|
*/
|
|
230
|
-
constructor(sources: StudyContentSource[], time: number);
|
|
235
|
+
constructor(sources: StudyContentSource[], time: number, dataLayer: DataLayerProvider, getViewComponent: (viewId: string) => TView);
|
|
231
236
|
private tick;
|
|
232
237
|
/**
|
|
233
238
|
* Returns a rough, erring toward conservative, guess at
|
|
@@ -249,9 +254,12 @@ declare class SessionController extends Loggable {
|
|
|
249
254
|
reportString(): string;
|
|
250
255
|
private getScheduledReviews;
|
|
251
256
|
private getNewCards;
|
|
252
|
-
private
|
|
253
|
-
nextCard(action?: 'dismiss-success' | 'dismiss-failed' | 'marked-failed' | 'dismiss-error'):
|
|
257
|
+
private _selectNextItemToHydrate;
|
|
258
|
+
nextCard(action?: 'dismiss-success' | 'dismiss-failed' | 'marked-failed' | 'dismiss-error'): Promise<HydratedCard<TView> | null>;
|
|
254
259
|
private dismissCurrentCard;
|
|
260
|
+
private hasAvailableCards;
|
|
261
|
+
private nextHydratedCard;
|
|
262
|
+
private _fillHydratedQueue;
|
|
255
263
|
}
|
|
256
264
|
|
|
257
265
|
interface CourseLookupDoc {
|
|
@@ -333,4 +341,4 @@ declare function getDataLayer(): DataLayerProvider;
|
|
|
333
341
|
*/
|
|
334
342
|
declare function _resetDataLayer(): Promise<void>;
|
|
335
343
|
|
|
336
|
-
export { type AggregatedDocument, type AttachmentUploadResult, CardRecord, CourseLookup, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, FileSystemAdapter, Loggable, type MigrationOptions, type MigrationResult, NOT_SET, type RestoreProgress, SessionController, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, type StudySessionRecord, type ValidationIssue, type ValidationResult, _resetDataLayer, ensureAppDataDirectory, getAppDataDirectory, getDataLayer, getDbPath, getLogFilePath, initializeDataDirectory, initializeDataLayer, initializeTuiLogging, logger, showUserError, showUserMessage, validateMigration, validateStaticCourse };
|
|
344
|
+
export { type AggregatedDocument, type AttachmentUploadResult, CardRecord, CourseLookup, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, FileSystemAdapter, type HydratedCard, Loggable, type MigrationOptions, type MigrationResult, NOT_SET, type RestoreProgress, SessionController, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, type StudySessionRecord, type ValidationIssue, type ValidationResult, _resetDataLayer, ensureAppDataDirectory, getAppDataDirectory, getDataLayer, getDbPath, getLogFilePath, initializeDataDirectory, initializeDataLayer, initializeTuiLogging, logger, showUserError, showUserMessage, validateMigration, validateStaticCourse };
|