@vue-skuilder/db 0.2.35 → 0.2.37

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 (263) hide show
  1. package/CLAUDE.md +15 -4
  2. package/build.entries.mjs +12 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +8 -0
  4. package/dist/{contentSource-BteiDpxH.d.ts → contentSource-D_E7JaxR.d.ts} +1 -1
  5. package/dist/core/UserDBDebugger.mjs +285 -0
  6. package/dist/core/UserDBDebugger.mjs.map +1 -0
  7. package/dist/core/bulkImport/cardProcessor.mjs +106 -0
  8. package/dist/core/bulkImport/cardProcessor.mjs.map +1 -0
  9. package/dist/core/{index.js → index.cjs} +6413 -7738
  10. package/dist/core/index.cjs.map +1 -0
  11. package/dist/core/index.d.ts +5 -5
  12. package/dist/core/index.mjs +20 -11368
  13. package/dist/core/interfaces/contentSource.mjs +20 -0
  14. package/dist/core/interfaces/contentSource.mjs.map +1 -0
  15. package/dist/core/navigators/Pipeline.mjs +723 -0
  16. package/dist/core/navigators/Pipeline.mjs.map +1 -0
  17. package/dist/core/navigators/PipelineAssembler.mjs +86 -0
  18. package/dist/core/navigators/PipelineAssembler.mjs.map +1 -0
  19. package/dist/core/navigators/PipelineDebugger.mjs +771 -0
  20. package/dist/core/navigators/PipelineDebugger.mjs.map +1 -0
  21. package/dist/core/navigators/SrsDebugger.mjs +34 -0
  22. package/dist/core/navigators/SrsDebugger.mjs.map +1 -0
  23. package/dist/core/navigators/StrategyPressureDebugger.mjs +19 -0
  24. package/dist/core/navigators/StrategyPressureDebugger.mjs.map +1 -0
  25. package/dist/core/navigators/defaults.mjs +96 -0
  26. package/dist/core/navigators/defaults.mjs.map +1 -0
  27. package/dist/core/navigators/diversityRerank.mjs +85 -0
  28. package/dist/core/navigators/diversityRerank.mjs.map +1 -0
  29. package/dist/core/navigators/filters/WeightedFilter.mjs +81 -0
  30. package/dist/core/navigators/filters/WeightedFilter.mjs.map +1 -0
  31. package/dist/core/navigators/filters/eloDistance.mjs +244 -0
  32. package/dist/core/navigators/filters/eloDistance.mjs.map +1 -0
  33. package/dist/core/navigators/filters/hierarchyDefinition.mjs +235 -0
  34. package/dist/core/navigators/filters/hierarchyDefinition.mjs.map +1 -0
  35. package/dist/core/navigators/filters/interferenceMitigator.mjs +201 -0
  36. package/dist/core/navigators/filters/interferenceMitigator.mjs.map +1 -0
  37. package/dist/core/navigators/filters/relativePriority.mjs +135 -0
  38. package/dist/core/navigators/filters/relativePriority.mjs.map +1 -0
  39. package/dist/core/navigators/filters/userTagPreference.mjs +101 -0
  40. package/dist/core/navigators/filters/userTagPreference.mjs.map +1 -0
  41. package/dist/core/navigators/generators/CompositeGenerator.mjs +203 -0
  42. package/dist/core/navigators/generators/CompositeGenerator.mjs.map +1 -0
  43. package/dist/core/navigators/generators/elo.mjs +77 -0
  44. package/dist/core/navigators/generators/elo.mjs.map +1 -0
  45. package/dist/core/navigators/generators/prescribed.mjs +694 -0
  46. package/dist/core/navigators/generators/prescribed.mjs.map +1 -0
  47. package/dist/core/navigators/generators/srs.mjs +158 -0
  48. package/dist/core/navigators/generators/srs.mjs.map +1 -0
  49. package/dist/core/navigators/index.mjs +345 -0
  50. package/dist/core/navigators/index.mjs.map +1 -0
  51. package/dist/core/navigators/pipelinePlan.mjs +109 -0
  52. package/dist/core/navigators/pipelinePlan.mjs.map +1 -0
  53. package/dist/core/navigators/regulators.mjs +128 -0
  54. package/dist/core/navigators/regulators.mjs.map +1 -0
  55. package/dist/core/orchestration/gradient.mjs +101 -0
  56. package/dist/core/orchestration/gradient.mjs.map +1 -0
  57. package/dist/core/orchestration/index.mjs +115 -0
  58. package/dist/core/orchestration/index.mjs.map +1 -0
  59. package/dist/core/orchestration/learning.mjs +140 -0
  60. package/dist/core/orchestration/learning.mjs.map +1 -0
  61. package/dist/core/orchestration/recording.mjs +64 -0
  62. package/dist/core/orchestration/recording.mjs.map +1 -0
  63. package/dist/core/orchestration/signal.mjs +40 -0
  64. package/dist/core/orchestration/signal.mjs.map +1 -0
  65. package/dist/core/types/contentNavigationStrategy.mjs +10 -0
  66. package/dist/core/types/contentNavigationStrategy.mjs.map +1 -0
  67. package/dist/core/types/hydration.mjs +13 -0
  68. package/dist/core/types/hydration.mjs.map +1 -0
  69. package/dist/core/types/strategyState.mjs +16 -0
  70. package/dist/core/types/strategyState.mjs.map +1 -0
  71. package/dist/core/types/studySession.mjs +14 -0
  72. package/dist/core/types/studySession.mjs.map +1 -0
  73. package/dist/core/types/types-legacy.mjs +44 -0
  74. package/dist/core/types/types-legacy.mjs.map +1 -0
  75. package/dist/core/util/index.mjs +31 -0
  76. package/dist/core/util/index.mjs.map +1 -0
  77. package/dist/core/versionStamps.mjs +46 -0
  78. package/dist/core/versionStamps.mjs.map +1 -0
  79. package/dist/courseConfigRegistration.mjs +306 -0
  80. package/dist/courseConfigRegistration.mjs.map +1 -0
  81. package/dist/{dataLayerProvider-C_QWzHf-.d.ts → dataLayerProvider-BDshhSp_.d.ts} +1 -1
  82. package/dist/diagnostics/dataset.mjs +118 -0
  83. package/dist/diagnostics/dataset.mjs.map +1 -0
  84. package/dist/diagnostics/derive.mjs +318 -0
  85. package/dist/diagnostics/derive.mjs.map +1 -0
  86. package/dist/diagnostics/{index.js → index.cjs} +1 -1
  87. package/dist/diagnostics/index.d.ts +3 -3
  88. package/dist/diagnostics/index.mjs +7 -1042
  89. package/dist/diagnostics/loader.mjs +151 -0
  90. package/dist/diagnostics/loader.mjs.map +1 -0
  91. package/dist/diagnostics/pipeline.mjs +161 -0
  92. package/dist/diagnostics/pipeline.mjs.map +1 -0
  93. package/dist/diagnostics/tagElo.mjs +177 -0
  94. package/dist/diagnostics/tagElo.mjs.map +1 -0
  95. package/dist/diagnostics/text.mjs +174 -0
  96. package/dist/diagnostics/text.mjs.map +1 -0
  97. package/dist/factory.mjs +70 -0
  98. package/dist/factory.mjs.map +1 -0
  99. package/dist/impl/common/BaseUserDB.mjs +1115 -0
  100. package/dist/impl/common/BaseUserDB.mjs.map +1 -0
  101. package/dist/impl/common/userDBHelpers.mjs +49 -0
  102. package/dist/impl/common/userDBHelpers.mjs.map +1 -0
  103. package/dist/impl/common/userDBKeys.mjs +45 -0
  104. package/dist/impl/common/userDBKeys.mjs.map +1 -0
  105. package/dist/impl/couch/CouchDBSyncStrategy.mjs +272 -0
  106. package/dist/impl/couch/CouchDBSyncStrategy.mjs.map +1 -0
  107. package/dist/impl/couch/CourseSyncService.mjs +320 -0
  108. package/dist/impl/couch/CourseSyncService.mjs.map +1 -0
  109. package/dist/impl/couch/PouchDataLayerProvider.mjs +89 -0
  110. package/dist/impl/couch/PouchDataLayerProvider.mjs.map +1 -0
  111. package/dist/impl/couch/adminDB.mjs +61 -0
  112. package/dist/impl/couch/adminDB.mjs.map +1 -0
  113. package/dist/impl/couch/auth.mjs +33 -0
  114. package/dist/impl/couch/auth.mjs.map +1 -0
  115. package/dist/impl/couch/classroomDB.mjs +227 -0
  116. package/dist/impl/couch/classroomDB.mjs.map +1 -0
  117. package/dist/impl/couch/clientCache.mjs +15 -0
  118. package/dist/impl/couch/clientCache.mjs.map +1 -0
  119. package/dist/impl/couch/courseAPI.mjs +197 -0
  120. package/dist/impl/couch/courseAPI.mjs.map +1 -0
  121. package/dist/impl/couch/courseDB.mjs +735 -0
  122. package/dist/impl/couch/courseDB.mjs.map +1 -0
  123. package/dist/impl/couch/courseLookupDB.mjs +94 -0
  124. package/dist/impl/couch/courseLookupDB.mjs.map +1 -0
  125. package/dist/impl/couch/{index.js → index.cjs} +7003 -10358
  126. package/dist/impl/couch/index.cjs.map +1 -0
  127. package/dist/impl/couch/index.d.ts +33 -5
  128. package/dist/impl/couch/index.mjs +152 -12147
  129. package/dist/impl/couch/index.mjs.map +1 -1
  130. package/dist/impl/couch/pouchdb-setup.mjs +15 -0
  131. package/dist/impl/couch/pouchdb-setup.mjs.map +1 -0
  132. package/dist/impl/couch/updateQueue.mjs +101 -0
  133. package/dist/impl/couch/updateQueue.mjs.map +1 -0
  134. package/dist/impl/couch/user-course-relDB.mjs +55 -0
  135. package/dist/impl/couch/user-course-relDB.mjs.map +1 -0
  136. package/dist/impl/static/NoOpSyncStrategy.mjs +49 -0
  137. package/dist/impl/static/NoOpSyncStrategy.mjs.map +1 -0
  138. package/dist/impl/static/StaticDataLayerProvider.mjs +94 -0
  139. package/dist/impl/static/StaticDataLayerProvider.mjs.map +1 -0
  140. package/dist/impl/static/StaticDataUnpacker.mjs +311 -0
  141. package/dist/impl/static/StaticDataUnpacker.mjs.map +1 -0
  142. package/dist/impl/static/courseDB.mjs +368 -0
  143. package/dist/impl/static/courseDB.mjs.map +1 -0
  144. package/dist/impl/static/coursesDB.mjs +38 -0
  145. package/dist/impl/static/coursesDB.mjs.map +1 -0
  146. package/dist/impl/static/{index.js → index.cjs} +2486 -5993
  147. package/dist/impl/static/index.cjs.map +1 -0
  148. package/dist/impl/static/index.d.ts +4 -4
  149. package/dist/impl/static/index.mjs +6 -10741
  150. package/dist/{index-C745YB_6.d.ts → index-BLDpFYG3.d.ts} +1 -1
  151. package/dist/{index.js → index.cjs} +14190 -14249
  152. package/dist/index.cjs.map +1 -0
  153. package/dist/index.d.ts +12 -23
  154. package/dist/index.mjs +38 -16937
  155. package/dist/pouch/{index.js → index.cjs} +5 -1
  156. package/dist/pouch/index.cjs.map +1 -0
  157. package/dist/pouch/index.mjs +2 -19
  158. package/dist/study/ItemQueue.mjs +95 -0
  159. package/dist/study/ItemQueue.mjs.map +1 -0
  160. package/dist/study/MixerDebugger.mjs +303 -0
  161. package/dist/study/MixerDebugger.mjs.map +1 -0
  162. package/dist/study/SessionController.mjs +1187 -0
  163. package/dist/study/SessionController.mjs.map +1 -0
  164. package/dist/study/SessionDebugger.mjs +271 -0
  165. package/dist/study/SessionDebugger.mjs.map +1 -0
  166. package/dist/study/SessionOverlay.mjs +407 -0
  167. package/dist/study/SessionOverlay.mjs.map +1 -0
  168. package/dist/study/SourceMixer.mjs +45 -0
  169. package/dist/study/SourceMixer.mjs.map +1 -0
  170. package/dist/study/SpacedRepetition.mjs +108 -0
  171. package/dist/study/SpacedRepetition.mjs.map +1 -0
  172. package/dist/study/TagFilteredContentSource.mjs +136 -0
  173. package/dist/study/TagFilteredContentSource.mjs.map +1 -0
  174. package/dist/study/services/CardHydrationService.mjs +172 -0
  175. package/dist/study/services/CardHydrationService.mjs.map +1 -0
  176. package/dist/study/services/EloService.mjs +217 -0
  177. package/dist/study/services/EloService.mjs.map +1 -0
  178. package/dist/study/services/ResponseProcessor.mjs +190 -0
  179. package/dist/study/services/ResponseProcessor.mjs.map +1 -0
  180. package/dist/study/services/SrsService.mjs +49 -0
  181. package/dist/study/services/SrsService.mjs.map +1 -0
  182. package/dist/study/services/tagRecent.mjs +65 -0
  183. package/dist/study/services/tagRecent.mjs.map +1 -0
  184. package/dist/{types-DF0JuPbs.d.ts → types-DChCz22D.d.ts} +1 -1
  185. package/dist/{types-legacy-DdVjg81H.d.cts → types-legacy-fT5Y1Wuy.d.ts} +1 -1
  186. package/dist/userDBKeys-ne1g4Xuq.d.ts +16 -0
  187. package/dist/util/Loggable.mjs +14 -0
  188. package/dist/util/Loggable.mjs.map +1 -0
  189. package/dist/util/dataDirectory.mjs +47 -0
  190. package/dist/util/dataDirectory.mjs.map +1 -0
  191. package/dist/util/logger.mjs +86 -0
  192. package/dist/util/logger.mjs.map +1 -0
  193. package/dist/util/migrator/FileSystemAdapter.mjs +18 -0
  194. package/dist/util/migrator/FileSystemAdapter.mjs.map +1 -0
  195. package/dist/util/migrator/StaticToCouchDBMigrator.mjs +428 -0
  196. package/dist/util/migrator/StaticToCouchDBMigrator.mjs.map +1 -0
  197. package/dist/util/migrator/types.mjs +11 -0
  198. package/dist/util/migrator/types.mjs.map +1 -0
  199. package/dist/util/migrator/validation.mjs +334 -0
  200. package/dist/util/migrator/validation.mjs.map +1 -0
  201. package/dist/util/packer/CouchDBToStaticPacker.mjs +438 -0
  202. package/dist/util/packer/CouchDBToStaticPacker.mjs.map +1 -0
  203. package/dist/util/packer/{index.js → index.cjs} +73 -9
  204. package/dist/util/packer/index.cjs.map +1 -0
  205. package/dist/util/packer/index.d.ts +3 -3
  206. package/dist/util/packer/index.mjs +2 -537
  207. package/eslint.config.mjs +9 -1
  208. package/package.json +25 -13
  209. package/rolldown.config.mjs +44 -0
  210. package/src/core/UserDBDebugger.ts +47 -46
  211. package/src/core/navigators/Pipeline.ts +10 -10
  212. package/src/core/navigators/PipelineDebugger.ts +55 -55
  213. package/src/core/navigators/filters/eloDistance.ts +1 -1
  214. package/src/core/navigators/generators/elo.ts +5 -1
  215. package/src/core/navigators/generators/prescribed.ts +42 -16
  216. package/src/core/navigators/index.ts +9 -3
  217. package/src/factory.ts +10 -1
  218. package/src/impl/common/BaseUserDB.ts +16 -5
  219. package/src/impl/common/index.ts +2 -0
  220. package/src/impl/common/userDBHelpers.ts +4 -58
  221. package/src/impl/common/userDBKeys.ts +64 -0
  222. package/src/impl/couch/CourseSyncService.ts +130 -20
  223. package/src/impl/couch/PouchDataLayerProvider.ts +14 -1
  224. package/src/impl/couch/courseAPI.ts +26 -12
  225. package/src/impl/couch/courseDB.ts +35 -15
  226. package/src/impl/couch/index.ts +18 -23
  227. package/src/impl/couch/pouchdb-setup.ts +8 -0
  228. package/src/index.ts +1 -1
  229. package/src/study/MixerDebugger.ts +46 -46
  230. package/src/study/SessionDebugger.ts +20 -20
  231. package/src/study/SessionOverlay.ts +4 -4
  232. package/src/util/logger.ts +112 -13
  233. package/tests/core/navigators/eloGenerator.test.ts +36 -0
  234. package/tests/impl/courseSync.test.ts +139 -0
  235. package/tsup.config.ts +24 -21
  236. package/dist/SyncStrategy-BXliog1m.d.cts +0 -116
  237. package/dist/classroomDB-DLTtLZct.d.cts +0 -86
  238. package/dist/contentSource-FQZcZopC.d.cts +0 -2007
  239. package/dist/core/index.d.cts +0 -521
  240. package/dist/core/index.js.map +0 -1
  241. package/dist/core/index.mjs.map +0 -1
  242. package/dist/dataLayerProvider-3y21KtF-.d.cts +0 -61
  243. package/dist/diagnostics/index.d.cts +0 -561
  244. package/dist/diagnostics/index.mjs.map +0 -1
  245. package/dist/impl/couch/index.d.cts +0 -620
  246. package/dist/impl/couch/index.js.map +0 -1
  247. package/dist/impl/static/index.d.cts +0 -232
  248. package/dist/impl/static/index.js.map +0 -1
  249. package/dist/impl/static/index.mjs.map +0 -1
  250. package/dist/index-BIum9Ue2.d.cts +0 -137
  251. package/dist/index.d.cts +0 -1663
  252. package/dist/index.js.map +0 -1
  253. package/dist/index.mjs.map +0 -1
  254. package/dist/pouch/index.d.cts +0 -1
  255. package/dist/pouch/index.js.map +0 -1
  256. package/dist/pouch/index.mjs.map +0 -1
  257. package/dist/types-BcWVH4ww.d.cts +0 -58
  258. package/dist/types-legacy-DdVjg81H.d.ts +0 -168
  259. package/dist/util/packer/index.d.cts +0 -5
  260. package/dist/util/packer/index.js.map +0 -1
  261. package/dist/util/packer/index.mjs.map +0 -1
  262. package/src/study/getCardDataShape.ts +0 -34
  263. /package/dist/diagnostics/{index.js.map → index.cjs.map} +0 -0
@@ -1,232 +0,0 @@
1
- import { C as ClassroomDBInterface, A as AdminDBInterface } from '../../classroomDB-DLTtLZct.cjs';
2
- import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, b as CourseInfo, S as StudySessionItem, D as DataLayerResult, c as ContentNavigationStrategyData, d as ContentNavigator, R as ReplanHints, G as GeneratorResult } from '../../contentSource-FQZcZopC.cjs';
3
- import { D as DataLayerProvider } from '../../dataLayerProvider-3y21KtF-.cjs';
4
- import { S as StaticCourseManifest } from '../../types-BcWVH4ww.cjs';
5
- import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
6
- import { S as SkuilderCourseData, Q as QualifiedCardID, T as TagStub, a as Tag } from '../../types-legacy-DdVjg81H.cjs';
7
- import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-BXliog1m.cjs';
8
- import 'moment';
9
-
10
- interface SkuilderManifest {
11
- name?: string;
12
- version?: string;
13
- description?: string;
14
- dependencies?: Record<string, string>;
15
- }
16
- interface StaticDataLayerConfig {
17
- localStoragePrefix?: string;
18
- rootManifest: SkuilderManifest;
19
- rootManifestUrl: string;
20
- }
21
- declare class StaticDataLayerProvider implements DataLayerProvider {
22
- private config;
23
- private initialized;
24
- private courseUnpackers;
25
- private manifests;
26
- private dependencyNameToCourseId;
27
- constructor(config: Partial<StaticDataLayerConfig>);
28
- private resolveCourseDependencies;
29
- initialize(): Promise<void>;
30
- teardown(): Promise<void>;
31
- getUserDB(): UserDBInterface;
32
- getCourseDB(courseId: string): CourseDBInterface;
33
- getCoursesDB(): CoursesDBInterface;
34
- getClassroomDB(_classId: string, _type: 'student' | 'teacher'): Promise<ClassroomDBInterface>;
35
- getAdminDB(): AdminDBInterface;
36
- isReadOnly(): boolean;
37
- }
38
-
39
- interface TagsIndex {
40
- byTag: Record<string, string[]>;
41
- byCard: Record<string, string[]>;
42
- }
43
- declare class StaticDataUnpacker {
44
- private manifest;
45
- private basePath;
46
- private documentCache;
47
- private chunkCache;
48
- private indexCache;
49
- constructor(manifest: StaticCourseManifest, basePath: string);
50
- /**
51
- * Get a document by ID, loading from appropriate chunk if needed
52
- */
53
- getDocument<T = any>(id: string): Promise<T>;
54
- /**
55
- * Get all documents with IDs starting with a specific prefix.
56
- *
57
- * This method loads the relevant chunk(s) and returns all matching documents.
58
- * Useful for querying documents by type (e.g., all NAVIGATION_STRATEGY documents).
59
- *
60
- * @param prefix - Document ID prefix to match (e.g., "NAVIGATION_STRATEGY")
61
- * @returns Array of all documents with IDs starting with the prefix
62
- */
63
- getAllDocumentsByPrefix(prefix: string): Promise<any[]>;
64
- /**
65
- * Query cards by ELO score, returning card IDs sorted by ELO
66
- */
67
- queryByElo(targetElo: number, limit?: number): Promise<string[]>;
68
- /**
69
- * Get all tag names mapped to their card arrays
70
- */
71
- getTagsIndex(): Promise<TagsIndex>;
72
- private getDocTypeFromId;
73
- /**
74
- * Find which chunk contains a specific document ID
75
- */
76
- private findChunkForDocument;
77
- /**
78
- * Verify that a document actually exists in a specific chunk by loading and checking it
79
- */
80
- private verifyDocumentInChunk;
81
- /**
82
- * Load a chunk file and cache its documents
83
- */
84
- private loadChunk;
85
- /**
86
- * Load an index file and cache it
87
- */
88
- private loadIndex;
89
- /**
90
- * Get a document by ID without hydration (raw document access)
91
- * Used internally to avoid recursion during attachment hydration
92
- */
93
- private getRawDocument;
94
- /**
95
- * Get attachment URL for a given document and attachment name
96
- */
97
- getAttachmentUrl(docId: string, attachmentName: string): string;
98
- /**
99
- * Load attachment data from the document and get the correct file path
100
- * Uses raw document access to avoid recursion with hydration
101
- */
102
- getAttachmentPath(docId: string, attachmentName: string): Promise<string | null>;
103
- /**
104
- * Load attachment as a blob (for browser) or buffer (for Node.js)
105
- */
106
- getAttachmentBlob(docId: string, attachmentName: string): Promise<Blob | Buffer | null>;
107
- /**
108
- * Hydrate document attachments by converting file paths to blob URLs
109
- */
110
- private hydrateAttachments;
111
- /**
112
- * Clear all caches (useful for testing or memory management)
113
- */
114
- clearCaches(): void;
115
- /**
116
- * Get cache statistics for debugging
117
- */
118
- getCacheStats(): {
119
- documents: number;
120
- chunks: number;
121
- indices: number;
122
- };
123
- /**
124
- * Check if a path is a local file path (vs URL)
125
- */
126
- private isLocalPath;
127
- }
128
-
129
- declare class StaticCourseDB implements CourseDBInterface {
130
- private courseId;
131
- private unpacker;
132
- private userDB;
133
- private manifest;
134
- constructor(courseId: string, unpacker: StaticDataUnpacker, userDB: UserDBInterface, manifest: StaticCourseManifest);
135
- getCourseID(): string;
136
- getCourseConfig(): Promise<CourseConfig>;
137
- updateCourseConfig(_cfg: CourseConfig): Promise<PouchDB.Core.Response>;
138
- getCourseInfo(): Promise<CourseInfo>;
139
- getCourseDoc<T extends SkuilderCourseData>(id: string, _options?: PouchDB.Core.GetOptions): Promise<T>;
140
- getCourseDocs<T extends SkuilderCourseData>(ids: string[], _options?: PouchDB.Core.AllDocsOptions): Promise<PouchDB.Core.AllDocsWithKeysResponse<{} & T>>;
141
- getCardsByELO(elo: number, limit?: number): Promise<{
142
- courseID: string;
143
- cardID: string;
144
- elo?: number;
145
- }[]>;
146
- getCardEloData(cardIds: string[]): Promise<CourseElo[]>;
147
- updateCardElo(cardId: string, _elo: CourseElo): Promise<PouchDB.Core.Response>;
148
- getCardsCenteredAtELO(options: {
149
- limit: number;
150
- elo: 'user' | 'random' | number;
151
- }, filter?: (id: QualifiedCardID) => boolean): Promise<StudySessionItem[]>;
152
- getAppliedTags(cardId: string): Promise<PouchDB.Query.Response<TagStub>>;
153
- getAppliedTagsBatch(cardIds: string[]): Promise<Map<string, string[]>>;
154
- getAllCardIds(): Promise<string[]>;
155
- addTagToCard(_cardId: string, _tagId: string): Promise<PouchDB.Core.Response>;
156
- removeTagFromCard(_cardId: string, _tagId: string): Promise<PouchDB.Core.Response>;
157
- createTag(_tagName: string): Promise<PouchDB.Core.Response>;
158
- getTag(tagName: string): Promise<Tag>;
159
- updateTag(_tag: Tag): Promise<PouchDB.Core.Response>;
160
- getCourseTagStubs(): Promise<PouchDB.Core.AllDocsResponse<Tag>>;
161
- addNote(_codeCourse: string, _shape: DataShape, _data: unknown, _author: string, _tags: string[], _uploads?: {
162
- [key: string]: PouchDB.Core.FullAttachment;
163
- }, _elo?: CourseElo): Promise<DataLayerResult>;
164
- removeCard(_cardId: string): Promise<PouchDB.Core.Response>;
165
- getInexperiencedCards(): Promise<any[]>;
166
- getNavigationStrategy(id: string): Promise<ContentNavigationStrategyData>;
167
- getAllNavigationStrategies(): Promise<ContentNavigationStrategyData[]>;
168
- addNavigationStrategy(_data: ContentNavigationStrategyData): Promise<void>;
169
- updateNavigationStrategy(_id: string, _data: ContentNavigationStrategyData): Promise<void>;
170
- /**
171
- * Create a ContentNavigator for this course.
172
- *
173
- * Loads navigation strategy documents from static data and uses PipelineAssembler
174
- * to build a Pipeline. Falls back to default pipeline if no strategies found.
175
- */
176
- createNavigator(user: UserDBInterface): Promise<ContentNavigator>;
177
- private _pendingHints;
178
- setEphemeralHints(hints: ReplanHints): void;
179
- /** Forward a presentation to the navigator (a new card restarts its intake clock). */
180
- notePresented(card: {
181
- cardId: string;
182
- courseId: string;
183
- status: string;
184
- }): void;
185
- getWeightedCards(limit: number): Promise<GeneratorResult>;
186
- /**
187
- * Get attachment URL for a document and attachment name
188
- * Internal helper method for static attachment serving
189
- */
190
- getAttachmentUrl(docId: string, attachmentName: string): string;
191
- /**
192
- * Load attachment as blob/buffer
193
- * Internal helper method for static attachment serving
194
- */
195
- getAttachmentBlob(docId: string, attachmentName: string): Promise<Blob | Buffer | null>;
196
- searchCards(_query: string): Promise<any[]>;
197
- find(_request: PouchDB.Find.FindRequest<any>): Promise<PouchDB.Find.FindResponse<any>>;
198
- }
199
-
200
- declare class StaticCoursesDB implements CoursesDBInterface {
201
- private manifests;
202
- private dependencyNameToCourseId?;
203
- constructor(manifests: Record<string, StaticCourseManifest>, dependencyNameToCourseId?: Map<string, string> | undefined);
204
- getCourseConfig(courseId: string): Promise<CourseConfig>;
205
- getCourseList(): Promise<CourseConfig[]>;
206
- disambiguateCourse(_courseId: string, _disambiguator: string): Promise<void>;
207
- }
208
-
209
- /**
210
- * Sync strategy for static deployments that provides no-op implementations
211
- * for remote operations. Uses only local storage with no remote synchronization.
212
- */
213
- declare class NoOpSyncStrategy implements SyncStrategy {
214
- private currentUsername;
215
- setupRemoteDB(username: string): PouchDB.Database;
216
- getWriteDB(username: string): PouchDB.Database;
217
- startSync(_localDB: PouchDB.Database, _remoteDB: PouchDB.Database): void;
218
- stopSync?(): void;
219
- canCreateAccount(): boolean;
220
- canAuthenticate(): boolean;
221
- createAccount(_username: string, _password: string): Promise<AccountCreationResult>;
222
- authenticate(_username: string, _password: string): Promise<AuthenticationResult>;
223
- logout(): Promise<AuthenticationResult>;
224
- getCurrentUsername(): Promise<string>;
225
- /**
226
- * Set the current username (for local account switching)
227
- * This method is specific to NoOpSyncStrategy and not part of the base interface
228
- */
229
- setCurrentUsername(username: string): void;
230
- }
231
-
232
- export { NoOpSyncStrategy, StaticCourseDB, StaticCoursesDB, StaticDataLayerProvider, StaticDataUnpacker };