@vue-skuilder/db 0.1.4 → 0.1.5
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/SyncStrategy-DnJRj-Xp.d.mts +74 -0
- package/dist/SyncStrategy-DnJRj-Xp.d.ts +74 -0
- package/dist/core/index.d.mts +90 -2
- package/dist/core/index.d.ts +90 -2
- package/dist/core/index.js +798 -650
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +769 -621
- package/dist/core/index.mjs.map +1 -1
- package/dist/dataLayerProvider-B8wquRiB.d.mts +37 -0
- package/dist/dataLayerProvider-DRjMZMaf.d.ts +37 -0
- package/dist/impl/couch/index.d.mts +292 -0
- package/dist/impl/couch/index.d.ts +292 -0
- package/dist/impl/couch/index.js +8522 -0
- package/dist/impl/couch/index.js.map +1 -0
- package/dist/impl/couch/index.mjs +8474 -0
- package/dist/impl/couch/index.mjs.map +1 -0
- package/dist/impl/static/index.d.mts +204 -0
- package/dist/impl/static/index.d.ts +204 -0
- package/dist/impl/static/index.js +8499 -0
- package/dist/impl/static/index.js.map +1 -0
- package/dist/impl/static/index.mjs +8488 -0
- package/dist/impl/static/index.mjs.map +1 -0
- package/dist/index.d.mts +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +3280 -2108
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3290 -2118
- package/dist/index.mjs.map +1 -1
- package/dist/types-B0GJsjOr.d.ts +47 -0
- package/dist/types-DIgj8pP7.d.mts +47 -0
- package/dist/types-legacy-CTsJvvxI.d.mts +137 -0
- package/dist/types-legacy-CTsJvvxI.d.ts +137 -0
- package/dist/{index-QMtzQI65.d.mts → userDB-C5dcuRZs.d.ts} +3 -251
- package/dist/{index-QMtzQI65.d.ts → userDB-ZSwOXiYN.d.mts} +3 -251
- package/dist/util/packer/index.d.mts +25 -0
- package/dist/util/packer/index.d.ts +25 -0
- package/dist/util/packer/index.js +307 -0
- package/dist/util/packer/index.js.map +1 -0
- package/dist/util/packer/index.mjs +280 -0
- package/dist/util/packer/index.mjs.map +1 -0
- package/package.json +12 -2
- package/src/core/interfaces/contentSource.ts +8 -6
- package/src/core/interfaces/userDB.ts +2 -2
- package/src/factory.ts +10 -7
- package/src/impl/{pouch/userDB.ts → common/BaseUserDB.ts} +225 -260
- package/src/impl/common/SyncStrategy.ts +90 -0
- package/src/impl/common/index.ts +23 -0
- package/src/impl/common/types.ts +50 -0
- package/src/impl/common/userDBHelpers.ts +144 -0
- package/src/impl/couch/CouchDBSyncStrategy.ts +209 -0
- package/src/impl/{pouch → couch}/PouchDataLayerProvider.ts +12 -7
- package/src/impl/{pouch → couch}/adminDB.ts +3 -3
- package/src/impl/{pouch → couch}/auth.ts +2 -2
- package/src/impl/{pouch → couch}/classroomDB.ts +6 -6
- package/src/impl/{pouch → couch}/courseAPI.ts +28 -5
- package/src/impl/{pouch → couch}/courseDB.ts +24 -10
- package/src/impl/{pouch → couch}/courseLookupDB.ts +1 -1
- package/src/impl/{pouch → couch}/index.ts +27 -20
- package/src/impl/{pouch → couch}/updateQueue.ts +5 -1
- package/src/impl/{pouch → couch}/user-course-relDB.ts +6 -1
- package/src/impl/static/NoOpSyncStrategy.ts +70 -0
- package/src/impl/static/StaticDataLayerProvider.ts +89 -0
- package/src/impl/static/StaticDataUnpacker.ts +376 -0
- package/src/impl/static/courseDB.ts +257 -0
- package/src/impl/static/coursesDB.ts +37 -0
- package/src/impl/static/index.ts +8 -0
- package/src/impl/static/userDB.ts +179 -0
- package/src/index.ts +1 -1
- package/src/study/SessionController.ts +4 -4
- package/src/study/SpacedRepetition.ts +3 -3
- package/src/study/getCardDataShape.ts +2 -2
- package/src/util/index.ts +1 -0
- package/src/util/packer/CouchDBToStaticPacker.ts +349 -0
- package/src/util/packer/index.ts +4 -0
- package/src/util/packer/types.ts +52 -0
- package/tsconfig.json +7 -10
- package/tsup.config.ts +5 -3
- /package/src/impl/{pouch → couch}/clientCache.ts +0 -0
- /package/src/impl/{pouch → couch}/pouchdb-setup.ts +0 -0
- /package/src/impl/{pouch → couch}/types.ts +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { S as StudySessionItem,
|
|
2
|
-
export {
|
|
1
|
+
import { S as StudySessionItem, c as StudyContentSource } from './userDB-ZSwOXiYN.mjs';
|
|
2
|
+
export { y as ActivityRecord, A as AdminDBInterface, h as AssignedCard, e as AssignedContent, g as AssignedCourse, f as AssignedTag, b as ClassroomDBInterface, v as ClassroomRegistration, u as ClassroomRegistrationDesignation, w as ClassroomRegistrationDoc, o as ContentSourceID, C as CourseDBInterface, q as CourseInfo, z as CourseRegistration, B as CourseRegistrationDoc, a as CoursesDBInterface, E as DocumentUpdater, D as ScheduledCard, d as StudentClassroomDBInterface, i as StudySessionFailedItem, j as StudySessionFailedNewItem, k as StudySessionFailedReviewItem, l as StudySessionNewItem, m as StudySessionReviewItem, T as TeacherClassroomDBInterface, x as UserConfig, s as UserCourseSetting, r as UserCourseSettings, U as UserDBInterface, t as UsrCrsDataInterface, p as getStudySource, n as isReview, F as newInterval } from './userDB-ZSwOXiYN.mjs';
|
|
3
|
+
import { D as DataLayerProvider } from './dataLayerProvider-B8wquRiB.mjs';
|
|
4
|
+
import { C as CardRecord } from './types-legacy-CTsJvvxI.mjs';
|
|
5
|
+
export { b as CardData, g as CardHistory, c as CourseListData, e as DataShapeData, d as DisplayableData, D as DocType, F as Field, G as GuestUsername, Q as QuestionData, h as QuestionRecord, S as SkuilderCourseData, T as Tag, a as TagStub, f as cardHistoryPrefix, l as log } from './types-legacy-CTsJvvxI.mjs';
|
|
6
|
+
import { Loggable } from './core/index.mjs';
|
|
7
|
+
export { BulkCardProcessorConfig, ContentNavigator, ImportResult, Navigators, areQuestionRecords, docIsDeleted, getCardHistoryID, importParsedCards, isQuestionRecord, parseCardHistoryID, validateProcessorConfig } from './core/index.mjs';
|
|
8
|
+
import { S as StaticCourseManifest } from './types-DIgj8pP7.mjs';
|
|
9
|
+
export { C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-DIgj8pP7.mjs';
|
|
10
|
+
export { CouchDBToStaticPacker } from './util/packer/index.mjs';
|
|
3
11
|
import '@vue-skuilder/common';
|
|
4
12
|
import 'moment';
|
|
5
13
|
|
|
@@ -105,10 +113,11 @@ interface DBEnv {
|
|
|
105
113
|
}
|
|
106
114
|
declare const ENV: DBEnv;
|
|
107
115
|
interface DataLayerConfig {
|
|
108
|
-
type: '
|
|
116
|
+
type: 'couch' | 'static';
|
|
109
117
|
options: {
|
|
110
118
|
staticContentPath?: string;
|
|
111
119
|
localStoragePrefix?: string;
|
|
120
|
+
manifests?: Record<string, StaticCourseManifest>;
|
|
112
121
|
COUCHDB_SERVER_URL?: string;
|
|
113
122
|
COUCHDB_SERVER_PROTOCOL?: string;
|
|
114
123
|
COUCHDB_USERNAME?: string;
|
|
@@ -130,4 +139,4 @@ declare function getDataLayer(): DataLayerProvider;
|
|
|
130
139
|
*/
|
|
131
140
|
declare function _resetDataLayer(): Promise<void>;
|
|
132
141
|
|
|
133
|
-
export { CardRecord, CourseLookup, type DataLayerConfig, DataLayerProvider, ENV, Loggable, SessionController, StudyContentSource, StudySessionItem, type StudySessionRecord, _resetDataLayer, getDataLayer, initializeDataLayer };
|
|
142
|
+
export { CardRecord, CourseLookup, type DataLayerConfig, DataLayerProvider, ENV, Loggable, SessionController, StaticCourseManifest, StudyContentSource, StudySessionItem, type StudySessionRecord, _resetDataLayer, getDataLayer, initializeDataLayer };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { S as StudySessionItem,
|
|
2
|
-
export {
|
|
1
|
+
import { S as StudySessionItem, c as StudyContentSource } from './userDB-C5dcuRZs.js';
|
|
2
|
+
export { y as ActivityRecord, A as AdminDBInterface, h as AssignedCard, e as AssignedContent, g as AssignedCourse, f as AssignedTag, b as ClassroomDBInterface, v as ClassroomRegistration, u as ClassroomRegistrationDesignation, w as ClassroomRegistrationDoc, o as ContentSourceID, C as CourseDBInterface, q as CourseInfo, z as CourseRegistration, B as CourseRegistrationDoc, a as CoursesDBInterface, E as DocumentUpdater, D as ScheduledCard, d as StudentClassroomDBInterface, i as StudySessionFailedItem, j as StudySessionFailedNewItem, k as StudySessionFailedReviewItem, l as StudySessionNewItem, m as StudySessionReviewItem, T as TeacherClassroomDBInterface, x as UserConfig, s as UserCourseSetting, r as UserCourseSettings, U as UserDBInterface, t as UsrCrsDataInterface, p as getStudySource, n as isReview, F as newInterval } from './userDB-C5dcuRZs.js';
|
|
3
|
+
import { D as DataLayerProvider } from './dataLayerProvider-DRjMZMaf.js';
|
|
4
|
+
import { C as CardRecord } from './types-legacy-CTsJvvxI.js';
|
|
5
|
+
export { b as CardData, g as CardHistory, c as CourseListData, e as DataShapeData, d as DisplayableData, D as DocType, F as Field, G as GuestUsername, Q as QuestionData, h as QuestionRecord, S as SkuilderCourseData, T as Tag, a as TagStub, f as cardHistoryPrefix, l as log } from './types-legacy-CTsJvvxI.js';
|
|
6
|
+
import { Loggable } from './core/index.js';
|
|
7
|
+
export { BulkCardProcessorConfig, ContentNavigator, ImportResult, Navigators, areQuestionRecords, docIsDeleted, getCardHistoryID, importParsedCards, isQuestionRecord, parseCardHistoryID, validateProcessorConfig } from './core/index.js';
|
|
8
|
+
import { S as StaticCourseManifest } from './types-B0GJsjOr.js';
|
|
9
|
+
export { C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-B0GJsjOr.js';
|
|
10
|
+
export { CouchDBToStaticPacker } from './util/packer/index.js';
|
|
3
11
|
import '@vue-skuilder/common';
|
|
4
12
|
import 'moment';
|
|
5
13
|
|
|
@@ -105,10 +113,11 @@ interface DBEnv {
|
|
|
105
113
|
}
|
|
106
114
|
declare const ENV: DBEnv;
|
|
107
115
|
interface DataLayerConfig {
|
|
108
|
-
type: '
|
|
116
|
+
type: 'couch' | 'static';
|
|
109
117
|
options: {
|
|
110
118
|
staticContentPath?: string;
|
|
111
119
|
localStoragePrefix?: string;
|
|
120
|
+
manifests?: Record<string, StaticCourseManifest>;
|
|
112
121
|
COUCHDB_SERVER_URL?: string;
|
|
113
122
|
COUCHDB_SERVER_PROTOCOL?: string;
|
|
114
123
|
COUCHDB_USERNAME?: string;
|
|
@@ -130,4 +139,4 @@ declare function getDataLayer(): DataLayerProvider;
|
|
|
130
139
|
*/
|
|
131
140
|
declare function _resetDataLayer(): Promise<void>;
|
|
132
141
|
|
|
133
|
-
export { CardRecord, CourseLookup, type DataLayerConfig, DataLayerProvider, ENV, Loggable, SessionController, StudyContentSource, StudySessionItem, type StudySessionRecord, _resetDataLayer, getDataLayer, initializeDataLayer };
|
|
142
|
+
export { CardRecord, CourseLookup, type DataLayerConfig, DataLayerProvider, ENV, Loggable, SessionController, StaticCourseManifest, StudyContentSource, StudySessionItem, type StudySessionRecord, _resetDataLayer, getDataLayer, initializeDataLayer };
|