@vue-skuilder/db 0.1.5 → 0.1.7
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 +43 -0
- package/dist/core/index.d.mts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +2130 -7527
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +2136 -7554
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-B8wquRiB.d.mts → dataLayerProvider-6stCgDME.d.ts} +5 -1
- package/dist/{dataLayerProvider-DRjMZMaf.d.ts → dataLayerProvider-BbW9EnZK.d.mts} +5 -1
- package/dist/impl/couch/index.d.mts +6 -6
- package/dist/impl/couch/index.d.ts +6 -6
- package/dist/impl/couch/index.js +2040 -7420
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +2046 -7447
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.mts +38 -54
- package/dist/impl/static/index.d.ts +38 -54
- package/dist/impl/static/index.js +812 -6206
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +799 -6213
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.mts +244 -8
- package/dist/index.d.ts +244 -8
- package/dist/index.js +4885 -8853
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4485 -8487
- package/dist/index.mjs.map +1 -1
- package/dist/{types-B0GJsjOr.d.ts → types-BvzcRAys.d.ts} +14 -3
- package/dist/{types-DIgj8pP7.d.mts → types-CQQ80R5N.d.mts} +14 -3
- package/dist/{types-legacy-CTsJvvxI.d.mts → types-legacy-CtrmkOLu.d.mts} +3 -1
- package/dist/{types-legacy-CTsJvvxI.d.ts → types-legacy-CtrmkOLu.d.ts} +3 -1
- package/dist/{userDB-ZSwOXiYN.d.mts → userDB-7fM4tpgr.d.mts} +10 -3
- package/dist/{userDB-C5dcuRZs.d.ts → userDB-DUY63VMN.d.ts} +10 -3
- package/dist/util/packer/index.d.mts +43 -3
- package/dist/util/packer/index.d.ts +43 -3
- package/dist/util/packer/index.js +241 -36
- package/dist/util/packer/index.js.map +1 -1
- package/dist/util/packer/index.mjs +241 -36
- package/dist/util/packer/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/core/interfaces/courseDB.ts +1 -1
- package/src/core/interfaces/dataLayerProvider.ts +5 -0
- package/src/core/interfaces/userDB.ts +5 -0
- package/src/core/types/types-legacy.ts +2 -0
- package/src/factory.ts +25 -0
- package/src/impl/common/BaseUserDB.ts +87 -6
- package/src/impl/common/userDBHelpers.ts +11 -1
- package/src/impl/couch/PouchDataLayerProvider.ts +4 -0
- package/src/impl/couch/courseAPI.ts +31 -16
- package/src/impl/couch/courseDB.ts +8 -7
- package/src/impl/couch/courseLookupDB.ts +24 -0
- package/src/impl/static/StaticDataLayerProvider.ts +4 -0
- package/src/impl/static/StaticDataUnpacker.ts +175 -2
- package/src/impl/static/courseDB.ts +18 -0
- package/src/impl/static/index.ts +0 -1
- package/src/util/dataDirectory.test.ts +53 -0
- package/src/util/dataDirectory.ts +52 -0
- package/src/util/index.ts +3 -0
- package/src/util/migrator/FileSystemAdapter.ts +59 -0
- package/src/util/migrator/StaticToCouchDBMigrator.ts +707 -0
- package/src/util/migrator/index.ts +18 -0
- package/src/util/migrator/types.ts +84 -0
- package/src/util/migrator/validation.ts +517 -0
- package/src/util/packer/CouchDBToStaticPacker.ts +320 -49
- package/src/util/packer/types.ts +13 -1
- package/src/util/tuiLogger.ts +139 -0
- package/src/impl/static/userDB.ts +0 -179
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @vue-skuilder/db Package
|
|
2
|
+
|
|
3
|
+
Database abstraction layer providing unified interfaces for CouchDB/PouchDB and static data providers.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
- Build: `yarn workspace @vue-skuilder/db build`
|
|
7
|
+
- Dev (watch): `yarn workspace @vue-skuilder/db dev`
|
|
8
|
+
- Lint: `yarn workspace @vue-skuilder/db lint:fix`
|
|
9
|
+
- Type check: `tsc --noEmit` (no dedicated script)
|
|
10
|
+
|
|
11
|
+
## Build System
|
|
12
|
+
Uses **tsup** for dual CommonJS/ESM output:
|
|
13
|
+
- **ESM**: `dist/index.mjs` (primary)
|
|
14
|
+
- **CommonJS**: `dist/index.js` (Jest compatibility)
|
|
15
|
+
- **Types**: `dist/index.d.ts`
|
|
16
|
+
|
|
17
|
+
## Package Exports
|
|
18
|
+
Multiple entry points for different use cases:
|
|
19
|
+
- **Main**: Core interfaces and factory
|
|
20
|
+
- **Core**: Core types and interfaces only
|
|
21
|
+
- **Pouch**: PouchDB implementation
|
|
22
|
+
- **Packer**: Static data packing utilities
|
|
23
|
+
- **Static**: Static data provider implementation
|
|
24
|
+
|
|
25
|
+
## Dependencies
|
|
26
|
+
- `@vue-skuilder/common` - Shared types and utilities
|
|
27
|
+
- `pouchdb` - Client-side database
|
|
28
|
+
- `pouchdb-find` - Query plugin
|
|
29
|
+
- `@nilock2/pouchdb-authentication` - Auth plugin
|
|
30
|
+
|
|
31
|
+
## Architecture
|
|
32
|
+
- **Interfaces**: Abstract DB layer contracts (`core/interfaces/`)
|
|
33
|
+
- **Implementations**:
|
|
34
|
+
- CouchDB/PouchDB provider (`impl/couch/`)
|
|
35
|
+
- Static data provider (`impl/static/`)
|
|
36
|
+
- **Study System**: Spaced repetition logic (`study/`)
|
|
37
|
+
- **Utilities**: Logging, packing tools (`util/`)
|
|
38
|
+
|
|
39
|
+
## Key Features
|
|
40
|
+
- **Provider Pattern**: Switchable backend implementations
|
|
41
|
+
- **Dual Export**: Works in both Node.js and browser environments
|
|
42
|
+
- **Type Safety**: Full TypeScript coverage with strict mode
|
|
43
|
+
- **Sync Strategy**: Configurable online/offline data synchronization
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { D as DataLayerProvider } from '../dataLayerProvider-
|
|
4
|
-
import { g as CardHistory, C as CardRecord, h as QuestionRecord } from '../types-legacy-
|
|
5
|
-
export { b as CardData, c as CourseListData, e as DataShapeData, d as DisplayableData, D as DocType, F as Field, G as GuestUsername, Q as QuestionData, S as SkuilderCourseData,
|
|
1
|
+
import { h as StudyContentSource, U as UserDBInterface, C as CourseDBInterface, d as ContentNavigationStrategyData, e as StudySessionReviewItem, f as ScheduledCard, S as StudySessionNewItem } from '../userDB-7fM4tpgr.mjs';
|
|
2
|
+
export { B as ActivityRecord, A as AdminDBInterface, s as AssignedCard, g as AssignedContent, r as AssignedCourse, q as AssignedTag, b as ClassroomDBInterface, x as ClassroomRegistration, w as ClassroomRegistrationDesignation, y as ClassroomRegistrationDoc, o as ContentSourceID, c as CourseInfo, E as CourseRegistration, F as CourseRegistrationDoc, a as CoursesDBInterface, i as StudentClassroomDBInterface, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, j as StudySessionItem, T as TeacherClassroomDBInterface, z as UserConfig, u as UserCourseSetting, t as UserCourseSettings, v as UsrCrsDataInterface, p as getStudySource, n as isReview } from '../userDB-7fM4tpgr.mjs';
|
|
3
|
+
export { D as DataLayerProvider } from '../dataLayerProvider-BbW9EnZK.mjs';
|
|
4
|
+
import { g as CardHistory, C as CardRecord, h as QuestionRecord } from '../types-legacy-CtrmkOLu.mjs';
|
|
5
|
+
export { b as CardData, c as CourseListData, e as DataShapeData, d as DisplayableData, D as DocType, F as Field, G as GuestUsername, Q as QuestionData, S as SkuilderCourseData, a as Tag, T as TagStub, f as cardHistoryPrefix, l as log } from '../types-legacy-CtrmkOLu.mjs';
|
|
6
6
|
import { DataShape, ParsedCard } from '@vue-skuilder/common';
|
|
7
7
|
import 'moment';
|
|
8
8
|
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { D as DataLayerProvider } from '../dataLayerProvider-
|
|
4
|
-
import { g as CardHistory, C as CardRecord, h as QuestionRecord } from '../types-legacy-
|
|
5
|
-
export { b as CardData, c as CourseListData, e as DataShapeData, d as DisplayableData, D as DocType, F as Field, G as GuestUsername, Q as QuestionData, S as SkuilderCourseData,
|
|
1
|
+
import { h as StudyContentSource, U as UserDBInterface, C as CourseDBInterface, d as ContentNavigationStrategyData, e as StudySessionReviewItem, f as ScheduledCard, S as StudySessionNewItem } from '../userDB-DUY63VMN.js';
|
|
2
|
+
export { B as ActivityRecord, A as AdminDBInterface, s as AssignedCard, g as AssignedContent, r as AssignedCourse, q as AssignedTag, b as ClassroomDBInterface, x as ClassroomRegistration, w as ClassroomRegistrationDesignation, y as ClassroomRegistrationDoc, o as ContentSourceID, c as CourseInfo, E as CourseRegistration, F as CourseRegistrationDoc, a as CoursesDBInterface, i as StudentClassroomDBInterface, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, j as StudySessionItem, T as TeacherClassroomDBInterface, z as UserConfig, u as UserCourseSetting, t as UserCourseSettings, v as UsrCrsDataInterface, p as getStudySource, n as isReview } from '../userDB-DUY63VMN.js';
|
|
3
|
+
export { D as DataLayerProvider } from '../dataLayerProvider-6stCgDME.js';
|
|
4
|
+
import { g as CardHistory, C as CardRecord, h as QuestionRecord } from '../types-legacy-CtrmkOLu.js';
|
|
5
|
+
export { b as CardData, c as CourseListData, e as DataShapeData, d as DisplayableData, D as DocType, F as Field, G as GuestUsername, Q as QuestionData, S as SkuilderCourseData, a as Tag, T as TagStub, f as cardHistoryPrefix, l as log } from '../types-legacy-CtrmkOLu.js';
|
|
6
6
|
import { DataShape, ParsedCard } from '@vue-skuilder/common';
|
|
7
7
|
import 'moment';
|
|
8
8
|
|