@vue-skuilder/db 0.1.6 → 0.1.8-0
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 → SyncStrategy-CyATpyLQ.d.mts} +6 -0
- package/dist/{SyncStrategy-DnJRj-Xp.d.ts → SyncStrategy-CyATpyLQ.d.ts} +6 -0
- package/dist/core/index.d.mts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +825 -762
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +812 -750
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-BZmLyBVw.d.mts → dataLayerProvider-BInqI_RF.d.mts} +1 -1
- package/dist/{dataLayerProvider-BuntXkCs.d.ts → dataLayerProvider-DqtNroSh.d.ts} +1 -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 +2261 -2081
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +2274 -2095
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.mts +8 -6
- package/dist/impl/static/index.d.ts +8 -6
- package/dist/impl/static/index.js +524 -1064
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +515 -1058
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index-CLL31bEy.d.ts +137 -0
- package/dist/index-CUNnL38E.d.mts +137 -0
- package/dist/index.d.mts +200 -9
- package/dist/index.d.ts +200 -9
- package/dist/index.js +4123 -2820
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4119 -2830
- package/dist/index.mjs.map +1 -1
- package/dist/{types-D6SnlHPm.d.ts → types-BefDGkKa.d.ts} +1 -1
- package/dist/{types-DPRvCrIk.d.mts → types-DC-ckZug.d.mts} +1 -1
- package/dist/{types-legacy-WPe8CtO-.d.mts → types-legacy-Birv-Jx6.d.mts} +2 -2
- package/dist/{types-legacy-WPe8CtO-.d.ts → types-legacy-Birv-Jx6.d.ts} +2 -2
- package/dist/{userDB-D9EuWTp1.d.ts → userDB-C33Hzjgn.d.mts} +11 -4
- package/dist/{userDB-31gsvxyd.d.mts → userDB-DusL7OXe.d.ts} +11 -4
- package/dist/util/packer/index.d.mts +3 -63
- package/dist/util/packer/index.d.ts +3 -63
- package/dist/util/packer/index.js +53 -1
- package/dist/util/packer/index.js.map +1 -1
- package/dist/util/packer/index.mjs +53 -1
- package/dist/util/packer/index.mjs.map +1 -1
- package/package.json +7 -4
- package/src/core/types/types-legacy.ts +13 -1
- package/src/core/types/user.ts +9 -2
- package/src/core/util/index.ts +5 -4
- package/src/factory.ts +25 -0
- package/src/impl/common/BaseUserDB.ts +62 -28
- package/src/impl/common/SyncStrategy.ts +7 -0
- package/src/impl/common/index.ts +0 -1
- package/src/impl/common/userDBHelpers.ts +15 -5
- package/src/impl/couch/CouchDBSyncStrategy.ts +10 -0
- package/src/impl/couch/courseAPI.ts +7 -6
- package/src/impl/couch/courseLookupDB.ts +24 -0
- package/src/impl/couch/index.ts +10 -5
- package/src/impl/couch/updateQueue.ts +12 -8
- package/src/impl/couch/user-course-relDB.ts +17 -27
- package/src/impl/static/NoOpSyncStrategy.ts +5 -0
- package/src/impl/static/StaticDataUnpacker.ts +18 -36
- package/src/impl/static/courseDB.ts +135 -17
- 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 +79 -0
- package/src/util/migrator/StaticToCouchDBMigrator.ts +713 -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 +92 -2
- package/src/util/tuiLogger.ts +139 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, b as ClassroomDBInterface, A as AdminDBInterface,
|
|
2
|
-
import { D as DataLayerProvider } from '../../dataLayerProvider-
|
|
3
|
-
import { S as StaticCourseManifest } from '../../types-
|
|
1
|
+
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, b as ClassroomDBInterface, A as AdminDBInterface, c as CourseInfo, S as StudySessionNewItem, D as DataLayerResult, d as ContentNavigationStrategyData, e as StudySessionReviewItem, f as ScheduledCard } from '../../userDB-C33Hzjgn.mjs';
|
|
2
|
+
import { D as DataLayerProvider } from '../../dataLayerProvider-BInqI_RF.mjs';
|
|
3
|
+
import { S as StaticCourseManifest } from '../../types-DC-ckZug.mjs';
|
|
4
4
|
import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
|
|
5
|
-
import { S as SkuilderCourseData,
|
|
6
|
-
import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-
|
|
5
|
+
import { S as SkuilderCourseData, T as TagStub, a as Tag } from '../../types-legacy-Birv-Jx6.mjs';
|
|
6
|
+
import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.mjs';
|
|
7
7
|
import 'moment';
|
|
8
8
|
|
|
9
9
|
interface StaticDataLayerConfig {
|
|
@@ -49,6 +49,7 @@ declare class StaticDataUnpacker {
|
|
|
49
49
|
* Get all tag names mapped to their card arrays
|
|
50
50
|
*/
|
|
51
51
|
getTagsIndex(): Promise<TagsIndex>;
|
|
52
|
+
private getDocTypeFromId;
|
|
52
53
|
/**
|
|
53
54
|
* Find which chunk contains a specific document ID
|
|
54
55
|
*/
|
|
@@ -125,7 +126,7 @@ declare class StaticCourseDB implements CourseDBInterface {
|
|
|
125
126
|
limit: number;
|
|
126
127
|
elo: 'user' | 'random' | number;
|
|
127
128
|
}, filter?: (id: string) => boolean): Promise<StudySessionNewItem[]>;
|
|
128
|
-
getAppliedTags(
|
|
129
|
+
getAppliedTags(cardId: string): Promise<PouchDB.Query.Response<TagStub>>;
|
|
129
130
|
addTagToCard(_cardId: string, _tagId: string): Promise<PouchDB.Core.Response>;
|
|
130
131
|
removeTagFromCard(_cardId: string, _tagId: string): Promise<PouchDB.Core.Response>;
|
|
131
132
|
createTag(_tagName: string): Promise<PouchDB.Core.Response>;
|
|
@@ -170,6 +171,7 @@ declare class StaticCoursesDB implements CoursesDBInterface {
|
|
|
170
171
|
declare class NoOpSyncStrategy implements SyncStrategy {
|
|
171
172
|
private currentUsername;
|
|
172
173
|
setupRemoteDB(username: string): PouchDB.Database;
|
|
174
|
+
getWriteDB(username: string): PouchDB.Database;
|
|
173
175
|
startSync(_localDB: PouchDB.Database, _remoteDB: PouchDB.Database): void;
|
|
174
176
|
stopSync?(): void;
|
|
175
177
|
canCreateAccount(): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, b as ClassroomDBInterface, A as AdminDBInterface,
|
|
2
|
-
import { D as DataLayerProvider } from '../../dataLayerProvider-
|
|
3
|
-
import { S as StaticCourseManifest } from '../../types-
|
|
1
|
+
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, b as ClassroomDBInterface, A as AdminDBInterface, c as CourseInfo, S as StudySessionNewItem, D as DataLayerResult, d as ContentNavigationStrategyData, e as StudySessionReviewItem, f as ScheduledCard } from '../../userDB-DusL7OXe.js';
|
|
2
|
+
import { D as DataLayerProvider } from '../../dataLayerProvider-DqtNroSh.js';
|
|
3
|
+
import { S as StaticCourseManifest } from '../../types-BefDGkKa.js';
|
|
4
4
|
import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
|
|
5
|
-
import { S as SkuilderCourseData,
|
|
6
|
-
import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-
|
|
5
|
+
import { S as SkuilderCourseData, T as TagStub, a as Tag } from '../../types-legacy-Birv-Jx6.js';
|
|
6
|
+
import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.js';
|
|
7
7
|
import 'moment';
|
|
8
8
|
|
|
9
9
|
interface StaticDataLayerConfig {
|
|
@@ -49,6 +49,7 @@ declare class StaticDataUnpacker {
|
|
|
49
49
|
* Get all tag names mapped to their card arrays
|
|
50
50
|
*/
|
|
51
51
|
getTagsIndex(): Promise<TagsIndex>;
|
|
52
|
+
private getDocTypeFromId;
|
|
52
53
|
/**
|
|
53
54
|
* Find which chunk contains a specific document ID
|
|
54
55
|
*/
|
|
@@ -125,7 +126,7 @@ declare class StaticCourseDB implements CourseDBInterface {
|
|
|
125
126
|
limit: number;
|
|
126
127
|
elo: 'user' | 'random' | number;
|
|
127
128
|
}, filter?: (id: string) => boolean): Promise<StudySessionNewItem[]>;
|
|
128
|
-
getAppliedTags(
|
|
129
|
+
getAppliedTags(cardId: string): Promise<PouchDB.Query.Response<TagStub>>;
|
|
129
130
|
addTagToCard(_cardId: string, _tagId: string): Promise<PouchDB.Core.Response>;
|
|
130
131
|
removeTagFromCard(_cardId: string, _tagId: string): Promise<PouchDB.Core.Response>;
|
|
131
132
|
createTag(_tagName: string): Promise<PouchDB.Core.Response>;
|
|
@@ -170,6 +171,7 @@ declare class StaticCoursesDB implements CoursesDBInterface {
|
|
|
170
171
|
declare class NoOpSyncStrategy implements SyncStrategy {
|
|
171
172
|
private currentUsername;
|
|
172
173
|
setupRemoteDB(username: string): PouchDB.Database;
|
|
174
|
+
getWriteDB(username: string): PouchDB.Database;
|
|
173
175
|
startSync(_localDB: PouchDB.Database, _remoteDB: PouchDB.Database): void;
|
|
174
176
|
stopSync?(): void;
|
|
175
177
|
canCreateAccount(): boolean;
|