Skip to content

Commit 6ea3014

Browse files
authored
pouch cred config (#856)
- **bump: version 0.1.11-23** - **any > unknown** - **bump: version 0.1.11-24** - **suppress debug logs...** - **bump: version 0.1.11-25** - **bump** - **replace hard-coded cookie-based auth w/ dynamic...**
2 parents d5da341 + 3aa7a20 commit 6ea3014

File tree

19 files changed

+72
-40
lines changed

19 files changed

+72
-40
lines changed

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.11-22",
6+
"version": "0.1.11-25",
77
"type": "module",
88
"description": "CLI scaffolding tool for vue-skuilder projects",
99
"bin": {

packages/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.11-22",
6+
"version": "0.1.11-25",
77
"license": "MIT",
88
"main": "dist/index.js",
99
"module": "dist/index.esm.js",

packages/common-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.11-22",
6+
"version": "0.1.11-25",
77
"main": "./dist/common-ui.umd.js",
88
"module": "./dist/common-ui.es.js",
99
"types": "./dist/index.d.ts",

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.11-22",
6+
"version": "0.1.11-25",
77
"type": "module",
88
"main": "dist/index.js",
99
"module": "dist/index.mjs",

packages/common/src/logger.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/**
22
* Standard logger interface for vue-skuilder packages
3-
*
3+
*
44
* This interface enables dependency injection of logging functionality,
55
* allowing different runtime contexts to provide appropriate logger implementations:
66
* - Node.js contexts can use Winston
77
* - Browser contexts can use console wrappers
88
* - Test contexts can use mock loggers
99
*/
1010
export interface SkLogger {
11-
debug(message: string, ...args: any[]): void;
12-
info(message: string, ...args: any[]): void;
13-
warn(message: string, ...args: any[]): void;
14-
error(message: string, ...args: any[]): void;
11+
debug(message: string, ...args: unknown[]): void;
12+
info(message: string, ...args: unknown[]): void;
13+
warn(message: string, ...args: unknown[]): void;
14+
error(message: string, ...args: unknown[]): void;
1515
}
1616

1717
/**
@@ -29,8 +29,8 @@ export const noOpLogger: SkLogger = {
2929
* Uses console methods with appropriate ESLint suppressions
3030
*/
3131
export const consoleLogger: SkLogger = {
32-
debug: (message: string, ...args: any[]) => console.debug(message, ...args), // eslint-disable-line no-console
33-
info: (message: string, ...args: any[]) => console.info(message, ...args), // eslint-disable-line no-console
34-
warn: (message: string, ...args: any[]) => console.warn(message, ...args), // eslint-disable-line no-console
35-
error: (message: string, ...args: any[]) => console.error(message, ...args), // eslint-disable-line no-console
36-
};
32+
debug: (message: string, ...args: unknown[]) => console.debug(message, ...args), // eslint-disable-line no-console
33+
info: (message: string, ...args: unknown[]) => console.info(message, ...args), // eslint-disable-line no-console
34+
warn: (message: string, ...args: unknown[]) => console.warn(message, ...args), // eslint-disable-line no-console
35+
error: (message: string, ...args: unknown[]) => console.error(message, ...args), // eslint-disable-line no-console
36+
};

packages/courseware/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.11-22",
6+
"version": "0.1.11-25",
77
"type": "module",
88
"main": "./dist/index.cjs.js",
99
"module": "./dist/index.mjs",

packages/db/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.11-22",
6+
"version": "0.1.11-25",
77
"description": "Database layer for vue-skuilder",
88
"main": "dist/index.js",
99
"module": "dist/index.mjs",

packages/db/src/impl/couch/CouchDBSyncStrategy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { SyncStrategy } from '../common/SyncStrategy';
88
import type { AccountCreationResult, AuthenticationResult } from '../common/types';
99
import { getLocalUserDB, hexEncode, updateGuestAccountExpirationDate } from '../common';
1010
import pouch from './pouchdb-setup';
11-
import { pouchDBincludeCredentialsConfig } from './index';
11+
import { createPouchDBConfig } from './index';
1212
import { getLoggedInUsername } from './auth';
1313

1414
const log = (s: any) => {
@@ -207,7 +207,7 @@ export class CouchDBSyncStrategy implements SyncStrategy {
207207
// see: https://github.com/pouchdb-community/pouchdb-authentication/issues/239
208208
const ret = new pouch(
209209
ENV.COUCHDB_SERVER_PROTOCOL + '://' + ENV.COUCHDB_SERVER_URL + dbName,
210-
pouchDBincludeCredentialsConfig
210+
createPouchDBConfig()
211211
);
212212

213213
if (guestAccount) {

packages/db/src/impl/couch/adminDB.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pouch from './pouchdb-setup';
22
import { ENV } from '@db/factory';
33
import {
4-
pouchDBincludeCredentialsConfig,
4+
createPouchDBConfig,
55
getStartAndEndKeys,
66
getCredentialledCourseConfig,
77
updateCredentialledCourseConfig,
@@ -21,7 +21,7 @@ export class AdminDB implements AdminDBInterface {
2121
// if the user is not an admin
2222
this.usersDB = new pouch(
2323
ENV.COUCHDB_SERVER_PROTOCOL + '://' + ENV.COUCHDB_SERVER_URL + '_users',
24-
pouchDBincludeCredentialsConfig
24+
createPouchDBConfig()
2525
);
2626
}
2727

packages/db/src/impl/couch/classroomDB.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import pouch from './pouchdb-setup';
1111
import {
1212
getCourseDB,
1313
getStartAndEndKeys,
14-
pouchDBincludeCredentialsConfig,
14+
createPouchDBConfig,
1515
REVIEW_TIME_FORMAT,
1616
} from '.';
1717
import { CourseDB, getTag } from './courseDB';
@@ -97,7 +97,7 @@ export class StudentClassroomDB
9797
const dbName = `classdb-student-${this._id}`;
9898
this._db = new pouch(
9999
ENV.COUCHDB_SERVER_PROTOCOL + '://' + ENV.COUCHDB_SERVER_URL + dbName,
100-
pouchDBincludeCredentialsConfig
100+
createPouchDBConfig()
101101
);
102102
try {
103103
const cfg = await this._db.get<ClassroomConfig>(CLASSROOM_CONFIG);
@@ -209,11 +209,11 @@ export class TeacherClassroomDB extends ClassroomDBBase implements TeacherClassr
209209
const stuDbName = `classdb-student-${this._id}`;
210210
this._db = new pouch(
211211
ENV.COUCHDB_SERVER_PROTOCOL + '://' + ENV.COUCHDB_SERVER_URL + dbName,
212-
pouchDBincludeCredentialsConfig
212+
createPouchDBConfig()
213213
);
214214
this._stuDb = new pouch(
215215
ENV.COUCHDB_SERVER_PROTOCOL + '://' + ENV.COUCHDB_SERVER_URL + stuDbName,
216-
pouchDBincludeCredentialsConfig
216+
createPouchDBConfig()
217217
);
218218
try {
219219
return this._db
@@ -297,7 +297,7 @@ export function getClassroomDB(classID: string, version: 'student' | 'teacher'):
297297

298298
return new pouch(
299299
ENV.COUCHDB_SERVER_PROTOCOL + '://' + ENV.COUCHDB_SERVER_URL + dbName,
300-
pouchDBincludeCredentialsConfig
300+
createPouchDBConfig()
301301
);
302302
}
303303

0 commit comments

Comments
 (0)