@aneuhold/core-ts-db-lib 1.0.1
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/README.md +3 -0
- package/lib/documents/BaseDocument.d.ts +9 -0
- package/lib/documents/BaseDocument.d.ts.map +1 -0
- package/lib/documents/BaseDocument.js +2 -0
- package/lib/documents/common/User.d.ts +20 -0
- package/lib/documents/common/User.d.ts.map +1 -0
- package/lib/documents/common/User.js +21 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +8 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ObjectId, Document } from 'bson';
|
|
2
|
+
/**
|
|
3
|
+
* A base document which other types that will be stored in a document DB can
|
|
4
|
+
* inherit from.
|
|
5
|
+
*/
|
|
6
|
+
export default interface BaseDocument extends Document {
|
|
7
|
+
_id: ObjectId;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=BaseDocument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseDocument.d.ts","sourceRoot":"","sources":["../../src/documents/BaseDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,OAAO,WAAW,YAAa,SAAQ,QAAQ;IACpD,GAAG,EAAE,QAAQ,CAAC;CACf"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
2
|
+
import BaseDocument from '../BaseDocument';
|
|
3
|
+
/**
|
|
4
|
+
* A standard user of all personal projects. This should be linked to from
|
|
5
|
+
* other documents that need to reference a user, instead of cluttering the
|
|
6
|
+
* key user information.
|
|
7
|
+
*/
|
|
8
|
+
export default class User implements BaseDocument {
|
|
9
|
+
_id: ObjectId;
|
|
10
|
+
userName: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
auth: {
|
|
13
|
+
googleId?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Constructs a new {@link User} with default values.
|
|
17
|
+
*/
|
|
18
|
+
constructor(userName: string);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=User.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../../src/documents/common/User.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,YAAW,YAAY;IAC/C,GAAG,WAAkB;IAErB,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE;QACJ,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAM;IAEP;;OAEG;gBACS,QAAQ,EAAE,MAAM;CAG7B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const bson_1 = require("bson");
|
|
4
|
+
/**
|
|
5
|
+
* A standard user of all personal projects. This should be linked to from
|
|
6
|
+
* other documents that need to reference a user, instead of cluttering the
|
|
7
|
+
* key user information.
|
|
8
|
+
*/
|
|
9
|
+
class User {
|
|
10
|
+
_id = new bson_1.ObjectId();
|
|
11
|
+
userName;
|
|
12
|
+
email;
|
|
13
|
+
auth = {};
|
|
14
|
+
/**
|
|
15
|
+
* Constructs a new {@link User} with default values.
|
|
16
|
+
*/
|
|
17
|
+
constructor(userName) {
|
|
18
|
+
this.userName = userName;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = User;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,IAAI,MAAM,yBAAyB,CAAC;AAG3C,OAAO,EAAE,IAAI,EAAE,CAAC;AAGhB,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
exports.User = void 0;
|
|
7
|
+
const User_1 = __importDefault(require("./documents/common/User"));
|
|
8
|
+
exports.User = User_1.default;
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aneuhold/core-ts-db-lib",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A core database library used for personal projects",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"author": "Anton G Neuhold Jr <agneuhold@gmail.com>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/aneuhold/core-ts-db-lib.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/aneuhold/core-ts-db-lib/issues"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/aneuhold/core-ts-db-lib#readme",
|
|
17
|
+
"files": [
|
|
18
|
+
"lib/**/*"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"Scripting",
|
|
22
|
+
"Node.js"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"pushpub": "npm run build && npm version patch && git push && npm publish --access public",
|
|
26
|
+
"build": "tsc",
|
|
27
|
+
"watch": "tsc -w",
|
|
28
|
+
"link:local": "cd lib && yarn link",
|
|
29
|
+
"unlink:local": "cd lib && yarn unlink",
|
|
30
|
+
"upgrade:all": "yarn upgrade --latest",
|
|
31
|
+
"test": "jest"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"bson": "^6.2.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/jest": "^29.5.8",
|
|
38
|
+
"@types/node": "^20.10.4",
|
|
39
|
+
"@types/node-fetch": "^2.6.9",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
|
41
|
+
"@typescript-eslint/parser": "^6.14.0",
|
|
42
|
+
"eslint": "^8.35.0",
|
|
43
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
44
|
+
"eslint-config-prettier": "^9.1.0",
|
|
45
|
+
"eslint-plugin-import": "^2.22.1",
|
|
46
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
47
|
+
"jest": "^29.7.0",
|
|
48
|
+
"prettier": "^3.1.1",
|
|
49
|
+
"ts-jest": "^29.1.1",
|
|
50
|
+
"ts-node": "^10.2.1",
|
|
51
|
+
"typescript": "^5.3.3"
|
|
52
|
+
}
|
|
53
|
+
}
|