@vue-skuilder/db 0.2.14 → 0.2.16

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.
Files changed (36) hide show
  1. package/dist/{contentSource-C-0t0y0V.d.ts → contentSource-B1p-vdz7.d.ts} +7 -0
  2. package/dist/{contentSource-jSkcOt2s.d.cts → contentSource-Brz42x7n.d.cts} +7 -0
  3. package/dist/core/index.d.cts +3 -3
  4. package/dist/core/index.d.ts +3 -3
  5. package/dist/core/index.js +6 -3
  6. package/dist/core/index.js.map +1 -1
  7. package/dist/core/index.mjs +6 -3
  8. package/dist/core/index.mjs.map +1 -1
  9. package/dist/{dataLayerProvider-BB0oi9T0.d.ts → dataLayerProvider-BWayUIoK.d.ts} +1 -1
  10. package/dist/{dataLayerProvider-BDClIrFC.d.cts → dataLayerProvider-CpwpT1rM.d.cts} +1 -1
  11. package/dist/impl/couch/index.d.cts +2 -2
  12. package/dist/impl/couch/index.d.ts +2 -2
  13. package/dist/impl/couch/index.js +6 -3
  14. package/dist/impl/couch/index.js.map +1 -1
  15. package/dist/impl/couch/index.mjs +6 -3
  16. package/dist/impl/couch/index.mjs.map +1 -1
  17. package/dist/impl/static/index.d.cts +2 -2
  18. package/dist/impl/static/index.d.ts +2 -2
  19. package/dist/impl/static/index.js +6 -3
  20. package/dist/impl/static/index.js.map +1 -1
  21. package/dist/impl/static/index.mjs +6 -3
  22. package/dist/impl/static/index.mjs.map +1 -1
  23. package/dist/index.d.cts +41 -5
  24. package/dist/index.d.ts +41 -5
  25. package/dist/index.js +18 -4
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +13 -4
  28. package/dist/index.mjs.map +1 -1
  29. package/package.json +3 -3
  30. package/src/core/interfaces/userDB.ts +8 -0
  31. package/src/impl/common/BaseUserDB.ts +2 -2
  32. package/src/impl/common/userDBHelpers.ts +14 -1
  33. package/src/index.ts +6 -0
  34. package/src/study/SessionOverlay.ts +16 -3
  35. package/src/study/index.ts +4 -0
  36. package/src/study/services/CardHydrationService.ts +9 -1
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { U as UserDBInterface, s as CourseRegistrationDoc, S as StudySessionItem, W as WeightedCard, R as ReplanHints, h as StudyContentSource, G as GeneratorResult, C as CourseDBInterface } from './contentSource-jSkcOt2s.cjs';
2
- export { K as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, a4 as CardGenerator, a6 as CardGeneratorFactory, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, H as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, L as CourseRegistration, b as CoursesDBInterface, ad as DocumentUpdater, a5 as GeneratorContext, a7 as LearnableWeight, N as NavigatorConstructor, a0 as NavigatorRole, a1 as NavigatorRoles, $ as Navigators, a8 as OrchestrationContext, j as ScheduledCard, I as SessionTrackingData, Z as StrategyContribution, i as StudentClassroomDBInterface, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, n as StudySessionNewItem, o as StudySessionReviewItem, T as TeacherClassroomDBInterface, J as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, M as UserOutcomeRecord, B as UsrCrsDataInterface, a9 as computeDeviation, ab as computeEffectiveWeight, aa as computeSpread, ac as createOrchestrationContext, _ as getCardOrigin, P as getRegisteredNavigator, X as getRegisteredNavigatorNames, V as getRegisteredNavigatorRole, r as getStudySource, Q as hasRegisteredNavigator, Y as initializeNavigatorRegistry, a3 as isFilter, a2 as isGenerator, p as isReview, ae as newInterval, O as registerNavigator } from './contentSource-jSkcOt2s.cjs';
3
- import { D as DataLayerProvider } from './dataLayerProvider-BDClIrFC.cjs';
1
+ import { U as UserDBInterface, s as CourseRegistrationDoc, S as StudySessionItem, W as WeightedCard, R as ReplanHints, h as StudyContentSource, G as GeneratorResult, C as CourseDBInterface } from './contentSource-Brz42x7n.cjs';
2
+ export { K as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, a4 as CardGenerator, a6 as CardGeneratorFactory, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, H as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, L as CourseRegistration, b as CoursesDBInterface, ad as DocumentUpdater, a5 as GeneratorContext, a7 as LearnableWeight, N as NavigatorConstructor, a0 as NavigatorRole, a1 as NavigatorRoles, $ as Navigators, a8 as OrchestrationContext, j as ScheduledCard, I as SessionTrackingData, Z as StrategyContribution, i as StudentClassroomDBInterface, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, n as StudySessionNewItem, o as StudySessionReviewItem, T as TeacherClassroomDBInterface, J as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, M as UserOutcomeRecord, B as UsrCrsDataInterface, a9 as computeDeviation, ab as computeEffectiveWeight, aa as computeSpread, ac as createOrchestrationContext, _ as getCardOrigin, P as getRegisteredNavigator, X as getRegisteredNavigatorNames, V as getRegisteredNavigatorRole, r as getStudySource, Q as hasRegisteredNavigator, Y as initializeNavigatorRegistry, a3 as isFilter, a2 as isGenerator, p as isReview, ae as newInterval, O as registerNavigator } from './contentSource-Brz42x7n.cjs';
3
+ import { D as DataLayerProvider } from './dataLayerProvider-CpwpT1rM.cjs';
4
4
  import { C as CardHistory, c as CardRecord, d as QuestionRecord } from './types-legacy-4tlwHnXo.cjs';
5
5
  export { e as CardData, f as CourseListData, h as DataShapeData, g as DisplayableData, D as DocType, b as DocTypePrefixes, F as Field, G as GuestUsername, Q as QualifiedCardID, i as QuestionData, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from './types-legacy-4tlwHnXo.cjs';
6
6
  import { SrsBacklogDebug, Loggable } from './core/index.cjs';
@@ -10,7 +10,7 @@ import { S as StaticCourseManifest } from './types-BFUa1pa3.cjs';
10
10
  export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-BFUa1pa3.cjs';
11
11
  import { F as FileSystemAdapter } from './index-k9NFHpS1.cjs';
12
12
  export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-k9NFHpS1.cjs';
13
- import 'moment';
13
+ import moment from 'moment';
14
14
 
15
15
  /**
16
16
  * Service responsible for ELO rating calculations and updates.
@@ -368,6 +368,30 @@ interface SessionDebugSnapshot {
368
368
  /** Every card the learner has interacted with this session, draw order. */
369
369
  drawnCards: SessionDrawnCardDebug[];
370
370
  }
371
+ /** The narrow surface the overlay needs from a SessionController. */
372
+ interface SessionDebugTarget {
373
+ getDebugSnapshot(): SessionDebugSnapshot;
374
+ }
375
+ /**
376
+ * The live-session surface available to out-of-tree callers through the
377
+ * active-controller registry: the debug snapshot, plus the small set of
378
+ * user-facing session controls a view may need without holding a ref into
379
+ * the `<StudySession>` component's internals (e.g. wiring a timer's
380
+ * add-time button from a composable). Keep this narrow — it is not a
381
+ * general escape hatch to `SessionController`.
382
+ */
383
+ interface ActiveSessionHandle extends SessionDebugTarget {
384
+ /** Extend the session clock by `seconds`. */
385
+ addTime(seconds: number): void;
386
+ }
387
+ /** Called by SessionController's constructor. Pass `null` to deregister. */
388
+ declare function registerActiveController(controller: ActiveSessionHandle | null): void;
389
+ declare function getActiveController(): ActiveSessionHandle | null;
390
+ /**
391
+ * Toggle the pinned overlay on/off. No-ops (with a console hint) when there is
392
+ * no DOM, so it is safe to call from any host environment.
393
+ */
394
+ declare function toggleSessionOverlay(): void;
371
395
 
372
396
  /**
373
397
  * Options for requesting a mid-session replan.
@@ -1466,6 +1490,18 @@ declare function getDataLayer(): DataLayerProvider;
1466
1490
  */
1467
1491
  declare function _resetDataLayer(): Promise<void>;
1468
1492
 
1493
+ declare const REVIEW_TIME_FORMAT: string;
1494
+ /**
1495
+ * Build a ScheduledCard `_id` for the given review time.
1496
+ *
1497
+ * The id suffix is not a mere uniquifier: `getReviewstoDate` PARSES the id
1498
+ * (with {@link REVIEW_TIME_FORMAT}) to decide due-ness, so the id is the
1499
+ * datum. Anything that writes or rewrites scheduled-card docs (scheduling,
1500
+ * user-state snapshot rebasing) must construct ids through this helper —
1501
+ * a hand-rolled formatter will get moment's `kk` token (01-24 hours) wrong.
1502
+ */
1503
+ declare function makeScheduledCardId(reviewTime: string | Date | moment.Moment): string;
1504
+
1469
1505
  type UserAccountStatus = 'pending_verification' | 'verified' | 'suspended';
1470
1506
  interface Entitlement {
1471
1507
  status: 'trial' | 'paid';
@@ -1485,4 +1521,4 @@ interface CouchDbUserDoc extends PouchDB.Authentication.User {
1485
1521
  entitlements: UserEntitlements;
1486
1522
  }
1487
1523
 
1488
- export { type AggregatedDocument, type AttachmentUploadResult, CardHistory, type CardPresentation, CardRecord, type CouchDbUserDoc, CourseDBInterface, CourseLookup, CourseRegistrationDoc, type CustomQuestionsData, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, GeneratorResult, Loggable, type MigrationOptions, type MigrationResult, type MixerCardInfo, type MixerRunReport, NOT_SET, type OutcomeObserver, type ProcessedDataShape, type ProcessedQuestionData, QuestionRecord, type QueueSnapshot, QuotaRoundRobinMixer, ReplanHints, type ReplanOptions, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, type SessionControls, type SessionOutcome, type SessionRunReport, type SourceBatch, type SourceMixer, type SourceSelectionBreakdown, type SourceSummary, SrsBacklogDebug, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, type StudySessionRecord, TagFilteredContentSource, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, WeightedCard, _resetDataLayer, captureMixerRun, clearStaleSessionDebugState, endSessionTracking, ensureAppDataDirectory, getAppDataDirectory, getDataLayer, getDbPath, initializeDataDirectory, initializeDataLayer, isDataShapeRegistered, isDataShapeSchemaAvailable, isQuestionTypeRegistered, mixerDebugAPI, mountMixerDebugger, mountSessionDebugger, processCustomQuestionsData, recordCardPresentation, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, sessionDebugAPI, snapshotQueues, startSessionTracking, validateMigration, validateStaticCourse };
1524
+ export { type ActiveSessionHandle, type AggregatedDocument, type AttachmentUploadResult, CardHistory, type CardPresentation, CardRecord, type CouchDbUserDoc, CourseDBInterface, CourseLookup, CourseRegistrationDoc, type CustomQuestionsData, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, GeneratorResult, Loggable, type MigrationOptions, type MigrationResult, type MixerCardInfo, type MixerRunReport, NOT_SET, type OutcomeObserver, type ProcessedDataShape, type ProcessedQuestionData, QuestionRecord, type QueueSnapshot, QuotaRoundRobinMixer, REVIEW_TIME_FORMAT, ReplanHints, type ReplanOptions, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, type SessionControls, type SessionDebugSnapshot, type SessionDebugTarget, type SessionDrawnCardDebug, type SessionOutcome, type SessionQueueDebug, type SessionQueueItemDebug, type SessionRunReport, type SourceBatch, type SourceMixer, type SourceSelectionBreakdown, type SourceSummary, SrsBacklogDebug, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, type StudySessionRecord, TagFilteredContentSource, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, WeightedCard, _resetDataLayer, captureMixerRun, clearStaleSessionDebugState, endSessionTracking, ensureAppDataDirectory, getActiveController, getAppDataDirectory, getDataLayer, getDbPath, initializeDataDirectory, initializeDataLayer, isDataShapeRegistered, isDataShapeSchemaAvailable, isQuestionTypeRegistered, makeScheduledCardId, mixerDebugAPI, mountMixerDebugger, mountSessionDebugger, processCustomQuestionsData, recordCardPresentation, registerActiveController, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, sessionDebugAPI, snapshotQueues, startSessionTracking, toggleSessionOverlay, validateMigration, validateStaticCourse };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { U as UserDBInterface, s as CourseRegistrationDoc, S as StudySessionItem, W as WeightedCard, R as ReplanHints, h as StudyContentSource, G as GeneratorResult, C as CourseDBInterface } from './contentSource-C-0t0y0V.js';
2
- export { K as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, a4 as CardGenerator, a6 as CardGeneratorFactory, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, H as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, L as CourseRegistration, b as CoursesDBInterface, ad as DocumentUpdater, a5 as GeneratorContext, a7 as LearnableWeight, N as NavigatorConstructor, a0 as NavigatorRole, a1 as NavigatorRoles, $ as Navigators, a8 as OrchestrationContext, j as ScheduledCard, I as SessionTrackingData, Z as StrategyContribution, i as StudentClassroomDBInterface, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, n as StudySessionNewItem, o as StudySessionReviewItem, T as TeacherClassroomDBInterface, J as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, M as UserOutcomeRecord, B as UsrCrsDataInterface, a9 as computeDeviation, ab as computeEffectiveWeight, aa as computeSpread, ac as createOrchestrationContext, _ as getCardOrigin, P as getRegisteredNavigator, X as getRegisteredNavigatorNames, V as getRegisteredNavigatorRole, r as getStudySource, Q as hasRegisteredNavigator, Y as initializeNavigatorRegistry, a3 as isFilter, a2 as isGenerator, p as isReview, ae as newInterval, O as registerNavigator } from './contentSource-C-0t0y0V.js';
3
- import { D as DataLayerProvider } from './dataLayerProvider-BB0oi9T0.js';
1
+ import { U as UserDBInterface, s as CourseRegistrationDoc, S as StudySessionItem, W as WeightedCard, R as ReplanHints, h as StudyContentSource, G as GeneratorResult, C as CourseDBInterface } from './contentSource-B1p-vdz7.js';
2
+ export { K as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, a4 as CardGenerator, a6 as CardGeneratorFactory, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, H as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, L as CourseRegistration, b as CoursesDBInterface, ad as DocumentUpdater, a5 as GeneratorContext, a7 as LearnableWeight, N as NavigatorConstructor, a0 as NavigatorRole, a1 as NavigatorRoles, $ as Navigators, a8 as OrchestrationContext, j as ScheduledCard, I as SessionTrackingData, Z as StrategyContribution, i as StudentClassroomDBInterface, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, n as StudySessionNewItem, o as StudySessionReviewItem, T as TeacherClassroomDBInterface, J as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, M as UserOutcomeRecord, B as UsrCrsDataInterface, a9 as computeDeviation, ab as computeEffectiveWeight, aa as computeSpread, ac as createOrchestrationContext, _ as getCardOrigin, P as getRegisteredNavigator, X as getRegisteredNavigatorNames, V as getRegisteredNavigatorRole, r as getStudySource, Q as hasRegisteredNavigator, Y as initializeNavigatorRegistry, a3 as isFilter, a2 as isGenerator, p as isReview, ae as newInterval, O as registerNavigator } from './contentSource-B1p-vdz7.js';
3
+ import { D as DataLayerProvider } from './dataLayerProvider-BWayUIoK.js';
4
4
  import { C as CardHistory, c as CardRecord, d as QuestionRecord } from './types-legacy-4tlwHnXo.js';
5
5
  export { e as CardData, f as CourseListData, h as DataShapeData, g as DisplayableData, D as DocType, b as DocTypePrefixes, F as Field, G as GuestUsername, Q as QualifiedCardID, i as QuestionData, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from './types-legacy-4tlwHnXo.js';
6
6
  import { SrsBacklogDebug, Loggable } from './core/index.js';
@@ -10,7 +10,7 @@ import { S as StaticCourseManifest } from './types-CHgpWQAY.js';
10
10
  export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-CHgpWQAY.js';
11
11
  import { F as FileSystemAdapter } from './index-BLLT5BYE.js';
12
12
  export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-BLLT5BYE.js';
13
- import 'moment';
13
+ import moment from 'moment';
14
14
 
15
15
  /**
16
16
  * Service responsible for ELO rating calculations and updates.
@@ -368,6 +368,30 @@ interface SessionDebugSnapshot {
368
368
  /** Every card the learner has interacted with this session, draw order. */
369
369
  drawnCards: SessionDrawnCardDebug[];
370
370
  }
371
+ /** The narrow surface the overlay needs from a SessionController. */
372
+ interface SessionDebugTarget {
373
+ getDebugSnapshot(): SessionDebugSnapshot;
374
+ }
375
+ /**
376
+ * The live-session surface available to out-of-tree callers through the
377
+ * active-controller registry: the debug snapshot, plus the small set of
378
+ * user-facing session controls a view may need without holding a ref into
379
+ * the `<StudySession>` component's internals (e.g. wiring a timer's
380
+ * add-time button from a composable). Keep this narrow — it is not a
381
+ * general escape hatch to `SessionController`.
382
+ */
383
+ interface ActiveSessionHandle extends SessionDebugTarget {
384
+ /** Extend the session clock by `seconds`. */
385
+ addTime(seconds: number): void;
386
+ }
387
+ /** Called by SessionController's constructor. Pass `null` to deregister. */
388
+ declare function registerActiveController(controller: ActiveSessionHandle | null): void;
389
+ declare function getActiveController(): ActiveSessionHandle | null;
390
+ /**
391
+ * Toggle the pinned overlay on/off. No-ops (with a console hint) when there is
392
+ * no DOM, so it is safe to call from any host environment.
393
+ */
394
+ declare function toggleSessionOverlay(): void;
371
395
 
372
396
  /**
373
397
  * Options for requesting a mid-session replan.
@@ -1466,6 +1490,18 @@ declare function getDataLayer(): DataLayerProvider;
1466
1490
  */
1467
1491
  declare function _resetDataLayer(): Promise<void>;
1468
1492
 
1493
+ declare const REVIEW_TIME_FORMAT: string;
1494
+ /**
1495
+ * Build a ScheduledCard `_id` for the given review time.
1496
+ *
1497
+ * The id suffix is not a mere uniquifier: `getReviewstoDate` PARSES the id
1498
+ * (with {@link REVIEW_TIME_FORMAT}) to decide due-ness, so the id is the
1499
+ * datum. Anything that writes or rewrites scheduled-card docs (scheduling,
1500
+ * user-state snapshot rebasing) must construct ids through this helper —
1501
+ * a hand-rolled formatter will get moment's `kk` token (01-24 hours) wrong.
1502
+ */
1503
+ declare function makeScheduledCardId(reviewTime: string | Date | moment.Moment): string;
1504
+
1469
1505
  type UserAccountStatus = 'pending_verification' | 'verified' | 'suspended';
1470
1506
  interface Entitlement {
1471
1507
  status: 'trial' | 'paid';
@@ -1485,4 +1521,4 @@ interface CouchDbUserDoc extends PouchDB.Authentication.User {
1485
1521
  entitlements: UserEntitlements;
1486
1522
  }
1487
1523
 
1488
- export { type AggregatedDocument, type AttachmentUploadResult, CardHistory, type CardPresentation, CardRecord, type CouchDbUserDoc, CourseDBInterface, CourseLookup, CourseRegistrationDoc, type CustomQuestionsData, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, GeneratorResult, Loggable, type MigrationOptions, type MigrationResult, type MixerCardInfo, type MixerRunReport, NOT_SET, type OutcomeObserver, type ProcessedDataShape, type ProcessedQuestionData, QuestionRecord, type QueueSnapshot, QuotaRoundRobinMixer, ReplanHints, type ReplanOptions, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, type SessionControls, type SessionOutcome, type SessionRunReport, type SourceBatch, type SourceMixer, type SourceSelectionBreakdown, type SourceSummary, SrsBacklogDebug, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, type StudySessionRecord, TagFilteredContentSource, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, WeightedCard, _resetDataLayer, captureMixerRun, clearStaleSessionDebugState, endSessionTracking, ensureAppDataDirectory, getAppDataDirectory, getDataLayer, getDbPath, initializeDataDirectory, initializeDataLayer, isDataShapeRegistered, isDataShapeSchemaAvailable, isQuestionTypeRegistered, mixerDebugAPI, mountMixerDebugger, mountSessionDebugger, processCustomQuestionsData, recordCardPresentation, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, sessionDebugAPI, snapshotQueues, startSessionTracking, validateMigration, validateStaticCourse };
1524
+ export { type ActiveSessionHandle, type AggregatedDocument, type AttachmentUploadResult, CardHistory, type CardPresentation, CardRecord, type CouchDbUserDoc, CourseDBInterface, CourseLookup, CourseRegistrationDoc, type CustomQuestionsData, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, GeneratorResult, Loggable, type MigrationOptions, type MigrationResult, type MixerCardInfo, type MixerRunReport, NOT_SET, type OutcomeObserver, type ProcessedDataShape, type ProcessedQuestionData, QuestionRecord, type QueueSnapshot, QuotaRoundRobinMixer, REVIEW_TIME_FORMAT, ReplanHints, type ReplanOptions, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, type SessionControls, type SessionDebugSnapshot, type SessionDebugTarget, type SessionDrawnCardDebug, type SessionOutcome, type SessionQueueDebug, type SessionQueueItemDebug, type SessionRunReport, type SourceBatch, type SourceMixer, type SourceSelectionBreakdown, type SourceSummary, SrsBacklogDebug, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, type StudySessionRecord, TagFilteredContentSource, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, WeightedCard, _resetDataLayer, captureMixerRun, clearStaleSessionDebugState, endSessionTracking, ensureAppDataDirectory, getActiveController, getAppDataDirectory, getDataLayer, getDbPath, initializeDataDirectory, initializeDataLayer, isDataShapeRegistered, isDataShapeSchemaAvailable, isQuestionTypeRegistered, makeScheduledCardId, mixerDebugAPI, mountMixerDebugger, mountSessionDebugger, processCustomQuestionsData, recordCardPresentation, registerActiveController, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, sessionDebugAPI, snapshotQueues, startSessionTracking, toggleSessionOverlay, validateMigration, validateStaticCourse };
package/dist/index.js CHANGED
@@ -243,6 +243,9 @@ var init_dataDirectory = __esm({
243
243
  });
244
244
 
245
245
  // src/impl/common/userDBHelpers.ts
246
+ function makeScheduledCardId(reviewTime) {
247
+ return DocTypePrefixes["SCHEDULED_CARD" /* SCHEDULED_CARD */] + import_moment.default.utc(reviewTime).format(REVIEW_TIME_FORMAT);
248
+ }
246
249
  function hexEncode(str) {
247
250
  let hex;
248
251
  let returnStr = "";
@@ -298,7 +301,7 @@ function scheduleCardReviewLocal(userDB, review) {
298
301
  const now = import_moment.default.utc();
299
302
  logger.info(`Scheduling for review in: ${review.time.diff(now, "h") / 24} days`);
300
303
  void userDB.put({
301
- _id: DocTypePrefixes["SCHEDULED_CARD" /* SCHEDULED_CARD */] + review.time.format(REVIEW_TIME_FORMAT),
304
+ _id: makeScheduledCardId(review.time),
302
305
  cardId: review.card_id,
303
306
  reviewTime: review.time.toISOString(),
304
307
  courseId: review.course_id,
@@ -8008,9 +8011,9 @@ Currently logged-in as ${this._username}.`
8008
8011
  }
8009
8012
  }).map((r) => r.doc);
8010
8013
  }
8011
- async getReviewsForcast(daysCount) {
8014
+ async getReviewsForcast(daysCount, course_id) {
8012
8015
  const time = import_moment6.default.utc().add(daysCount, "days");
8013
- return this.getReviewstoDate(time);
8016
+ return this.getReviewstoDate(time, course_id);
8014
8017
  }
8015
8018
  async getPendingReviews(course_id) {
8016
8019
  const now = import_moment6.default.utc();
@@ -10577,6 +10580,7 @@ __export(index_exports, {
10577
10580
  NavigatorRoles: () => NavigatorRoles,
10578
10581
  Navigators: () => Navigators,
10579
10582
  QuotaRoundRobinMixer: () => QuotaRoundRobinMixer,
10583
+ REVIEW_TIME_FORMAT: () => REVIEW_TIME_FORMAT,
10580
10584
  SessionController: () => SessionController,
10581
10585
  StaticToCouchDBMigrator: () => StaticToCouchDBMigrator,
10582
10586
  TagFilteredContentSource: () => TagFilteredContentSource,
@@ -10597,6 +10601,7 @@ __export(index_exports, {
10597
10601
  docIsDeleted: () => docIsDeleted,
10598
10602
  endSessionTracking: () => endSessionTracking,
10599
10603
  ensureAppDataDirectory: () => ensureAppDataDirectory,
10604
+ getActiveController: () => getActiveController,
10600
10605
  getActivePipeline: () => getActivePipeline,
10601
10606
  getAppDataDirectory: () => getAppDataDirectory,
10602
10607
  getCardHistoryID: () => getCardHistoryID,
@@ -10622,6 +10627,7 @@ __export(index_exports, {
10622
10627
  isQuestionTypeRegistered: () => isQuestionTypeRegistered,
10623
10628
  isReview: () => isReview,
10624
10629
  log: () => log,
10630
+ makeScheduledCardId: () => makeScheduledCardId,
10625
10631
  mixerDebugAPI: () => mixerDebugAPI,
10626
10632
  mountMixerDebugger: () => mountMixerDebugger,
10627
10633
  mountPipelineDebugger: () => mountPipelineDebugger,
@@ -10633,6 +10639,7 @@ __export(index_exports, {
10633
10639
  processCustomQuestionsData: () => processCustomQuestionsData,
10634
10640
  recordCardPresentation: () => recordCardPresentation,
10635
10641
  recordUserOutcome: () => recordUserOutcome,
10642
+ registerActiveController: () => registerActiveController,
10636
10643
  registerBlanksCard: () => registerBlanksCard,
10637
10644
  registerCustomQuestionTypes: () => registerCustomQuestionTypes,
10638
10645
  registerDataShape: () => registerDataShape,
@@ -10647,6 +10654,7 @@ __export(index_exports, {
10647
10654
  sessionDebugAPI: () => sessionDebugAPI,
10648
10655
  snapshotQueues: () => snapshotQueues,
10649
10656
  startSessionTracking: () => startSessionTracking,
10657
+ toggleSessionOverlay: () => toggleSessionOverlay,
10650
10658
  updateLearningState: () => updateLearningState,
10651
10659
  updateStrategyWeight: () => updateStrategyWeight,
10652
10660
  userDBDebugAPI: () => userDBDebugAPI,
@@ -11651,7 +11659,7 @@ var CardHydrationService = class {
11651
11659
  }
11652
11660
  const data = dataDocs.map(import_common25.displayableDataToViewData).reverse();
11653
11661
  this.hydratedCards.set(item.cardID, {
11654
- item,
11662
+ item: { ...item, elo: (0, import_common25.toCourseElo)(cardData.elo).global.score },
11655
11663
  view,
11656
11664
  data,
11657
11665
  tags: tagsByCard.get(item.cardID) ?? []
@@ -15269,6 +15277,7 @@ init_TagFilteredContentSource();
15269
15277
 
15270
15278
  // src/index.ts
15271
15279
  init_factory();
15280
+ init_userDBHelpers();
15272
15281
  // Annotate the CommonJS export names for ESM import in node:
15273
15282
  0 && (module.exports = {
15274
15283
  ContentNavigator,
@@ -15287,6 +15296,7 @@ init_factory();
15287
15296
  NavigatorRoles,
15288
15297
  Navigators,
15289
15298
  QuotaRoundRobinMixer,
15299
+ REVIEW_TIME_FORMAT,
15290
15300
  SessionController,
15291
15301
  StaticToCouchDBMigrator,
15292
15302
  TagFilteredContentSource,
@@ -15307,6 +15317,7 @@ init_factory();
15307
15317
  docIsDeleted,
15308
15318
  endSessionTracking,
15309
15319
  ensureAppDataDirectory,
15320
+ getActiveController,
15310
15321
  getActivePipeline,
15311
15322
  getAppDataDirectory,
15312
15323
  getCardHistoryID,
@@ -15332,6 +15343,7 @@ init_factory();
15332
15343
  isQuestionTypeRegistered,
15333
15344
  isReview,
15334
15345
  log,
15346
+ makeScheduledCardId,
15335
15347
  mixerDebugAPI,
15336
15348
  mountMixerDebugger,
15337
15349
  mountPipelineDebugger,
@@ -15343,6 +15355,7 @@ init_factory();
15343
15355
  processCustomQuestionsData,
15344
15356
  recordCardPresentation,
15345
15357
  recordUserOutcome,
15358
+ registerActiveController,
15346
15359
  registerBlanksCard,
15347
15360
  registerCustomQuestionTypes,
15348
15361
  registerDataShape,
@@ -15357,6 +15370,7 @@ init_factory();
15357
15370
  sessionDebugAPI,
15358
15371
  snapshotQueues,
15359
15372
  startSessionTracking,
15373
+ toggleSessionOverlay,
15360
15374
  updateLearningState,
15361
15375
  updateStrategyWeight,
15362
15376
  userDBDebugAPI,