@aneuhold/core-ts-db-lib 1.0.5 → 1.0.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/lib/documents/BaseDocumentWithUserId.d.ts +10 -0
- package/lib/documents/BaseDocumentWithUserId.d.ts.map +1 -0
- package/lib/documents/BaseDocumentWithUserId.js +13 -0
- package/lib/documents/common/ApiKey.d.ts +2 -1
- package/lib/documents/common/ApiKey.d.ts.map +1 -1
- package/lib/documents/dashboard/UserConfig.d.ts +12 -1
- package/lib/documents/dashboard/UserConfig.d.ts.map +1 -1
- package/lib/documents/dashboard/UserConfig.js +13 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
2
|
+
import BaseDocument from './BaseDocument';
|
|
3
|
+
/**
|
|
4
|
+
* A base document type that has a user ID associated with it. This is useful
|
|
5
|
+
* for filtering on all documents that a user has access to.
|
|
6
|
+
*/
|
|
7
|
+
export default abstract class BaseDocumentWithUserId extends BaseDocument {
|
|
8
|
+
abstract userId: ObjectId;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=BaseDocumentWithUserId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseDocumentWithUserId.d.ts","sourceRoot":"","sources":["../../src/documents/BaseDocumentWithUserId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,sBAAuB,SAAQ,YAAY;IACvE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const BaseDocument_1 = __importDefault(require("./BaseDocument"));
|
|
7
|
+
/**
|
|
8
|
+
* A base document type that has a user ID associated with it. This is useful
|
|
9
|
+
* for filtering on all documents that a user has access to.
|
|
10
|
+
*/
|
|
11
|
+
class BaseDocumentWithUserId extends BaseDocument_1.default {
|
|
12
|
+
}
|
|
13
|
+
exports.default = BaseDocumentWithUserId;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ObjectId } from 'bson';
|
|
2
2
|
import BaseDocument from '../BaseDocument';
|
|
3
|
+
import BaseDocumentWithUserId from '../BaseDocumentWithUserId';
|
|
3
4
|
/**
|
|
4
5
|
* A document containing an API key for a particular user. This is stored
|
|
5
6
|
* separately from the {@link User} document to enhance security a bit.
|
|
6
7
|
*/
|
|
7
|
-
export default class ApiKey extends BaseDocument {
|
|
8
|
+
export default class ApiKey extends BaseDocument implements BaseDocumentWithUserId {
|
|
8
9
|
/**
|
|
9
10
|
* The API key for the user. This is indexed in the DB.
|
|
10
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiKey.d.ts","sourceRoot":"","sources":["../../../src/documents/common/ApiKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,YAAY,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ApiKey.d.ts","sourceRoot":"","sources":["../../../src/documents/common/ApiKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,MACnB,SAAQ,YACR,YAAW,sBAAsB;IAEjC;;OAEG;IACH,GAAG,sDAAuB;IAE1B;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC;IAEjB;;OAEG;gBACS,MAAM,EAAE,QAAQ;CAI7B"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
1
2
|
import BaseDocumentWithType from '../BaseDocumentWithType';
|
|
2
|
-
|
|
3
|
+
import BaseDocumentWithUserId from '../BaseDocumentWithUserId';
|
|
4
|
+
export default class DashboardUserConfig extends BaseDocumentWithType implements BaseDocumentWithUserId {
|
|
5
|
+
static docType: string;
|
|
3
6
|
docType: string;
|
|
7
|
+
/**
|
|
8
|
+
* The owner of this config.
|
|
9
|
+
*/
|
|
10
|
+
userId: ObjectId;
|
|
11
|
+
/**
|
|
12
|
+
* Whether or not to enable dev mode for the user.
|
|
13
|
+
*/
|
|
4
14
|
enableDevMode: boolean;
|
|
15
|
+
constructor(ownerId: ObjectId);
|
|
5
16
|
}
|
|
6
17
|
//# sourceMappingURL=UserConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserConfig.d.ts","sourceRoot":"","sources":["../../../src/documents/dashboard/UserConfig.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"UserConfig.d.ts","sourceRoot":"","sources":["../../../src/documents/dashboard/UserConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,mBACnB,SAAQ,oBACR,YAAW,sBAAsB;IAEjC,MAAM,CAAC,OAAO,SAAgB;IAE9B,OAAO,SAA+B;IAEtC;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC;IAEjB;;OAEG;IACH,aAAa,UAAS;gBAEV,OAAO,EAAE,QAAQ;CAI9B"}
|
|
@@ -5,7 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const BaseDocumentWithType_1 = __importDefault(require("../BaseDocumentWithType"));
|
|
7
7
|
class DashboardUserConfig extends BaseDocumentWithType_1.default {
|
|
8
|
-
docType = 'userConfig';
|
|
8
|
+
static docType = 'userConfig';
|
|
9
|
+
docType = DashboardUserConfig.docType;
|
|
10
|
+
/**
|
|
11
|
+
* The owner of this config.
|
|
12
|
+
*/
|
|
13
|
+
userId;
|
|
14
|
+
/**
|
|
15
|
+
* Whether or not to enable dev mode for the user.
|
|
16
|
+
*/
|
|
9
17
|
enableDevMode = false;
|
|
18
|
+
constructor(ownerId) {
|
|
19
|
+
super();
|
|
20
|
+
this.userId = ownerId;
|
|
21
|
+
}
|
|
10
22
|
}
|
|
11
23
|
exports.default = DashboardUserConfig;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import BaseDocument from './documents/BaseDocument';
|
|
2
2
|
import BaseDocumentWithType from './documents/BaseDocumentWithType';
|
|
3
|
+
import BaseDocumentWithUserId from './documents/BaseDocumentWithUserId';
|
|
3
4
|
import ApiKey from './documents/common/ApiKey';
|
|
4
5
|
import User from './documents/common/User';
|
|
5
6
|
import DashboardUserConfig from './documents/dashboard/UserConfig';
|
|
6
|
-
export { User, ApiKey, DashboardUserConfig, BaseDocument, BaseDocumentWithType };
|
|
7
|
+
export { User, ApiKey, DashboardUserConfig, BaseDocument, BaseDocumentWithType, BaseDocumentWithUserId };
|
|
7
8
|
export type {};
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,IAAI,MAAM,yBAAyB,CAAC;AAC3C,OAAO,mBAAmB,MAAM,kCAAkC,CAAC;AAGnE,OAAO,EACL,IAAI,EACJ,MAAM,EACN,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,sBAAsB,MAAM,oCAAoC,CAAC;AACxE,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,IAAI,MAAM,yBAAyB,CAAC;AAC3C,OAAO,mBAAmB,MAAM,kCAAkC,CAAC;AAGnE,OAAO,EACL,IAAI,EACJ,MAAM,EACN,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACvB,CAAC;AAGF,YAAY,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -3,11 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BaseDocumentWithType = exports.BaseDocument = exports.DashboardUserConfig = exports.ApiKey = exports.User = void 0;
|
|
6
|
+
exports.BaseDocumentWithUserId = exports.BaseDocumentWithType = exports.BaseDocument = exports.DashboardUserConfig = exports.ApiKey = exports.User = void 0;
|
|
7
7
|
const BaseDocument_1 = __importDefault(require("./documents/BaseDocument"));
|
|
8
8
|
exports.BaseDocument = BaseDocument_1.default;
|
|
9
9
|
const BaseDocumentWithType_1 = __importDefault(require("./documents/BaseDocumentWithType"));
|
|
10
10
|
exports.BaseDocumentWithType = BaseDocumentWithType_1.default;
|
|
11
|
+
const BaseDocumentWithUserId_1 = __importDefault(require("./documents/BaseDocumentWithUserId"));
|
|
12
|
+
exports.BaseDocumentWithUserId = BaseDocumentWithUserId_1.default;
|
|
11
13
|
const ApiKey_1 = __importDefault(require("./documents/common/ApiKey"));
|
|
12
14
|
exports.ApiKey = ApiKey_1.default;
|
|
13
15
|
const User_1 = __importDefault(require("./documents/common/User"));
|