@aneuhold/core-ts-db-lib 1.0.121 → 2.0.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/LICENSE +21 -0
- package/README.md +48 -5
- package/lib/documents/BaseDocument.d.ts +1 -1
- package/lib/documents/BaseDocument.d.ts.map +1 -1
- package/lib/documents/BaseDocument.js +4 -6
- package/lib/documents/BaseDocument.js.map +1 -0
- package/lib/documents/BaseDocument.ts +9 -0
- package/lib/documents/BaseDocumentWithType.d.ts +1 -1
- package/lib/documents/BaseDocumentWithType.d.ts.map +1 -1
- package/lib/documents/BaseDocumentWithType.js +3 -8
- package/lib/documents/BaseDocumentWithType.js.map +1 -0
- package/lib/documents/BaseDocumentWithType.ts +5 -0
- package/lib/documents/common/ApiKey.d.ts +5 -4
- package/lib/documents/common/ApiKey.d.ts.map +1 -1
- package/lib/documents/common/ApiKey.js +10 -17
- package/lib/documents/common/ApiKey.js.map +1 -0
- package/lib/documents/common/ApiKey.ts +40 -0
- package/lib/documents/common/User.d.ts +2 -2
- package/lib/documents/common/User.d.ts.map +1 -1
- package/lib/documents/common/User.js +8 -15
- package/lib/documents/common/User.js.map +1 -0
- package/lib/documents/common/User.ts +63 -0
- package/lib/documents/dashboard/NonogramKatanaItem.d.ts +4 -4
- package/lib/documents/dashboard/NonogramKatanaItem.d.ts.map +1 -1
- package/lib/documents/dashboard/NonogramKatanaItem.js +4 -11
- package/lib/documents/dashboard/NonogramKatanaItem.js.map +1 -0
- package/lib/documents/dashboard/NonogramKatanaItem.ts +53 -0
- package/lib/documents/dashboard/NonogramKatanaUpgrade.d.ts +5 -5
- package/lib/documents/dashboard/NonogramKatanaUpgrade.d.ts.map +1 -1
- package/lib/documents/dashboard/NonogramKatanaUpgrade.js +4 -11
- package/lib/documents/dashboard/NonogramKatanaUpgrade.js.map +1 -0
- package/lib/documents/dashboard/NonogramKatanaUpgrade.ts +50 -0
- package/lib/documents/dashboard/Task.d.ts +7 -7
- package/lib/documents/dashboard/Task.d.ts.map +1 -1
- package/lib/documents/dashboard/Task.js +10 -17
- package/lib/documents/dashboard/Task.js.map +1 -0
- package/lib/documents/dashboard/Task.ts +173 -0
- package/lib/documents/dashboard/UserConfig.d.ts +6 -6
- package/lib/documents/dashboard/UserConfig.d.ts.map +1 -1
- package/lib/documents/dashboard/UserConfig.js +12 -19
- package/lib/documents/dashboard/UserConfig.js.map +1 -0
- package/lib/documents/dashboard/UserConfig.ts +110 -0
- package/lib/embedded-types/dashboard/nonogramKatanaItem/ItemName.d.ts.map +1 -1
- package/lib/embedded-types/dashboard/nonogramKatanaItem/ItemName.js +2 -3
- package/lib/embedded-types/dashboard/nonogramKatanaItem/ItemName.js.map +1 -0
- package/lib/embedded-types/dashboard/nonogramKatanaItem/ItemName.ts +97 -0
- package/lib/embedded-types/dashboard/nonogramKatanaUpgrade/UpgradeName.d.ts.map +1 -1
- package/lib/embedded-types/dashboard/nonogramKatanaUpgrade/UpgradeName.js +2 -3
- package/lib/embedded-types/dashboard/nonogramKatanaUpgrade/UpgradeName.js.map +1 -0
- package/lib/embedded-types/dashboard/nonogramKatanaUpgrade/UpgradeName.ts +263 -0
- package/lib/embedded-types/dashboard/task/FilterSettings.d.ts +2 -2
- package/lib/embedded-types/dashboard/task/FilterSettings.d.ts.map +1 -1
- package/lib/embedded-types/dashboard/task/FilterSettings.js +3 -6
- package/lib/embedded-types/dashboard/task/FilterSettings.js.map +1 -0
- package/lib/embedded-types/dashboard/task/FilterSettings.ts +100 -0
- package/lib/embedded-types/dashboard/task/RecurrenceInfo.d.ts +1 -1
- package/lib/embedded-types/dashboard/task/RecurrenceInfo.d.ts.map +1 -1
- package/lib/embedded-types/dashboard/task/RecurrenceInfo.js +8 -11
- package/lib/embedded-types/dashboard/task/RecurrenceInfo.js.map +1 -0
- package/lib/embedded-types/dashboard/task/RecurrenceInfo.ts +100 -0
- package/lib/embedded-types/dashboard/task/SortSettings.d.ts +2 -2
- package/lib/embedded-types/dashboard/task/SortSettings.d.ts.map +1 -1
- package/lib/embedded-types/dashboard/task/SortSettings.js +7 -11
- package/lib/embedded-types/dashboard/task/SortSettings.js.map +1 -0
- package/lib/embedded-types/dashboard/task/SortSettings.ts +89 -0
- package/lib/embedded-types/dashboard/userConfig/Tags.d.ts.map +1 -1
- package/lib/embedded-types/dashboard/userConfig/Tags.js +2 -2
- package/lib/embedded-types/dashboard/userConfig/Tags.js.map +1 -0
- package/lib/embedded-types/dashboard/userConfig/Tags.ts +9 -0
- package/lib/index.d.ts +20 -20
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +19 -71
- package/lib/index.js.map +1 -0
- package/lib/index.ts +103 -0
- package/lib/schemas/required-refs/RequiredUserId.d.ts +1 -1
- package/lib/schemas/required-refs/RequiredUserId.d.ts.map +1 -1
- package/lib/schemas/required-refs/RequiredUserId.js +3 -8
- package/lib/schemas/required-refs/RequiredUserId.js.map +1 -0
- package/lib/schemas/required-refs/RequiredUserId.ts +9 -0
- package/lib/schemas/type-guards/commonTypeGuards.d.ts.map +1 -1
- package/lib/schemas/type-guards/commonTypeGuards.js +6 -12
- package/lib/schemas/type-guards/commonTypeGuards.js.map +1 -0
- package/lib/schemas/type-guards/commonTypeGuards.ts +29 -0
- package/lib/schemas/validators/DocumentValidator.d.ts +1 -1
- package/lib/schemas/validators/DocumentValidator.d.ts.map +1 -1
- package/lib/schemas/validators/DocumentValidator.js +2 -2
- package/lib/schemas/validators/DocumentValidator.js.map +1 -0
- package/lib/schemas/validators/DocumentValidator.ts +5 -0
- package/lib/schemas/validators/ValidateUtil.d.ts.map +1 -1
- package/lib/schemas/validators/ValidateUtil.js +8 -10
- package/lib/schemas/validators/ValidateUtil.js.map +1 -0
- package/lib/schemas/validators/ValidateUtil.spec.ts +75 -0
- package/lib/schemas/validators/ValidateUtil.ts +193 -0
- package/lib/services/DocumentService.d.ts +1 -1
- package/lib/services/DocumentService.d.ts.map +1 -1
- package/lib/services/DocumentService.js +4 -6
- package/lib/services/DocumentService.js.map +1 -0
- package/lib/services/DocumentService.spec.ts +28 -0
- package/lib/services/DocumentService.ts +18 -0
- package/lib/services/dashboard/Task/TaskFilterService.d.ts +2 -2
- package/lib/services/dashboard/Task/TaskFilterService.d.ts.map +1 -1
- package/lib/services/dashboard/Task/TaskFilterService.js +2 -4
- package/lib/services/dashboard/Task/TaskFilterService.js.map +1 -0
- package/lib/services/dashboard/Task/TaskFilterService.ts +105 -0
- package/lib/services/dashboard/Task/TaskRecurrenceService.d.ts +2 -2
- package/lib/services/dashboard/Task/TaskRecurrenceService.d.ts.map +1 -1
- package/lib/services/dashboard/Task/TaskRecurrenceService.js +21 -23
- package/lib/services/dashboard/Task/TaskRecurrenceService.js.map +1 -0
- package/lib/services/dashboard/Task/TaskRecurrenceService.ts +172 -0
- package/lib/services/dashboard/Task/TaskService.d.ts +5 -5
- package/lib/services/dashboard/Task/TaskService.d.ts.map +1 -1
- package/lib/services/dashboard/Task/TaskService.js +13 -18
- package/lib/services/dashboard/Task/TaskService.js.map +1 -0
- package/lib/services/dashboard/Task/TaskService.spec.ts +653 -0
- package/lib/services/dashboard/Task/TaskService.ts +189 -0
- package/lib/services/dashboard/Task/TaskSortService.d.ts +3 -3
- package/lib/services/dashboard/Task/TaskSortService.d.ts.map +1 -1
- package/lib/services/dashboard/Task/TaskSortService.js +6 -8
- package/lib/services/dashboard/Task/TaskSortService.js.map +1 -0
- package/lib/services/dashboard/Task/TaskSortService.ts +229 -0
- package/package.json +35 -28
- package/lib/schemas/validators/ValidateUtil.spec.d.ts +0 -2
- package/lib/schemas/validators/ValidateUtil.spec.d.ts.map +0 -1
- package/lib/schemas/validators/ValidateUtil.spec.js +0 -64
- package/lib/services/DocumentService.spec.d.ts +0 -2
- package/lib/services/DocumentService.spec.d.ts.map +0 -1
- package/lib/services/DocumentService.spec.js +0 -30
- package/lib/services/dashboard/Task/TaskService.spec.d.ts +0 -2
- package/lib/services/dashboard/Task/TaskService.spec.d.ts.map +0 -1
- package/lib/services/dashboard/Task/TaskService.spec.js +0 -508
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [2024] [Anton G Neuhold Jr]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,20 +1,63 @@
|
|
|
1
1
|
# Personal Core Database Library
|
|
2
2
|
|
|
3
|
-
](https://jsr.io/@aneuhold/core-ts-db-lib)
|
|
4
|
+
[](https://www.npmjs.com/package/@aneuhold/core-ts-db-lib)
|
|
4
5
|
|
|
5
6
|
This is used to export types used in various places for database interactions in personal projects.
|
|
6
7
|
|
|
7
|
-
##
|
|
8
|
+
## 📦 Installation
|
|
9
|
+
|
|
10
|
+
To add to a repo, follow the instructions below for your environment:
|
|
11
|
+
|
|
12
|
+
### For Node using NPM
|
|
13
|
+
|
|
14
|
+
Run `yarn add @aneuhold/core-ts-db-lib`
|
|
15
|
+
|
|
16
|
+
### For Node using JSR
|
|
17
|
+
|
|
18
|
+
The below instructions still allow for things like Renovate to work, and normal commands with yarn such as `yarn up`.
|
|
19
|
+
|
|
20
|
+
1. Add the required JSR configuration to a `.yarnrc.yml` file if not there already:
|
|
21
|
+
```yml
|
|
22
|
+
npmScopes:
|
|
23
|
+
jsr:
|
|
24
|
+
npmRegistryServer: 'https://npm.jsr.io'
|
|
25
|
+
```
|
|
26
|
+
1. Add the package with `yarn add @jsr/aneuhold__core-ts-db-lib`
|
|
27
|
+
|
|
28
|
+
### For Deno
|
|
29
|
+
|
|
30
|
+
Run `deno add jsr:@aneuhold/core-ts-db-lib`
|
|
31
|
+
|
|
32
|
+
## 🟢 Usage
|
|
33
|
+
|
|
34
|
+
Pull in one of the services and use it like so:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { DocumentService } from '@aneuhold/core-ts-db-lib';
|
|
38
|
+
// If using Node with JSR
|
|
39
|
+
// import { DocumentService } from '@jsr/aneuhold__core-ts-db-lib';
|
|
40
|
+
|
|
41
|
+
export default function deepCopy() {
|
|
42
|
+
DocumentService.deepCopy({ someProperty: 'someString' });
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
[See full documentation on usage at JSR!](https://jsr.io/@aneuhold/core-ts-db-lib/doc)
|
|
47
|
+
|
|
48
|
+
## 🛠️ Development
|
|
49
|
+
|
|
50
|
+
### Document structure
|
|
8
51
|
|
|
9
52
|
Project-specific documents can be held in a single collection. So those should inherit from the `BaseDocumentWithType` class.
|
|
10
53
|
|
|
11
54
|
When different document types are held under a specific collection, they should get their own folder.
|
|
12
55
|
|
|
13
|
-
|
|
56
|
+
### Guidelines
|
|
14
57
|
|
|
15
|
-
|
|
58
|
+
> Note that documents cannot have really special types or classes with functions. For example `Set` cannot be used.
|
|
16
59
|
|
|
17
|
-
|
|
60
|
+
### Updating an existing document
|
|
18
61
|
|
|
19
62
|
If a property is being moved or a new required property is added, then take the
|
|
20
63
|
following steps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDocument.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"BaseDocument.d.ts","sourceRoot":"./src/","sources":["documents/BaseDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,YAAa,YAAW,QAAQ;IAC5D,GAAG,EAAE,QAAQ,CAAkB;CAChC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const bson_1 = require("bson");
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
4
2
|
/**
|
|
5
3
|
* A base document which other types that will be stored in a document DB can
|
|
6
4
|
* inherit from.
|
|
7
5
|
*/
|
|
8
|
-
class BaseDocument {
|
|
9
|
-
_id = new
|
|
6
|
+
export default class BaseDocument {
|
|
7
|
+
_id = new ObjectId();
|
|
10
8
|
}
|
|
11
|
-
|
|
9
|
+
//# sourceMappingURL=BaseDocument.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseDocument.js","sourceRoot":"./src/","sources":["documents/BaseDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAgB,YAAY;IACxC,GAAG,GAAa,IAAI,QAAQ,EAAE,CAAC;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDocumentWithType.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"BaseDocumentWithType.d.ts","sourceRoot":"./src/","sources":["documents/BaseDocumentWithType.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,oBAAqB,SAAQ,YAAY;IACrE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const BaseDocument_1 = __importDefault(require("./BaseDocument"));
|
|
7
|
-
class BaseDocumentWithType extends BaseDocument_1.default {
|
|
1
|
+
import BaseDocument from './BaseDocument.js';
|
|
2
|
+
export default class BaseDocumentWithType extends BaseDocument {
|
|
8
3
|
}
|
|
9
|
-
|
|
4
|
+
//# sourceMappingURL=BaseDocumentWithType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseDocumentWithType.js","sourceRoot":"./src/","sources":["documents/BaseDocumentWithType.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAgB,oBAAqB,SAAQ,YAAY;CAEtE"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ObjectId } from 'bson';
|
|
2
|
-
import
|
|
3
|
-
import RequiredUserId from '../../schemas/required-refs/RequiredUserId';
|
|
4
|
-
import { DocumentValidator } from '../../schemas/validators/DocumentValidator';
|
|
2
|
+
import { UUID } from 'crypto';
|
|
3
|
+
import RequiredUserId from '../../schemas/required-refs/RequiredUserId.js';
|
|
4
|
+
import { DocumentValidator } from '../../schemas/validators/DocumentValidator.js';
|
|
5
|
+
import BaseDocument from '../BaseDocument.js';
|
|
5
6
|
export declare const validateApiKey: DocumentValidator<ApiKey>;
|
|
6
7
|
/**
|
|
7
8
|
* A document containing an API key for a particular user. This is stored
|
|
@@ -11,7 +12,7 @@ export default class ApiKey extends BaseDocument implements RequiredUserId {
|
|
|
11
12
|
/**
|
|
12
13
|
* The API key for the user. This is indexed in the DB.
|
|
13
14
|
*/
|
|
14
|
-
key:
|
|
15
|
+
key: UUID;
|
|
15
16
|
/**
|
|
16
17
|
* The user ID that this key is for. This field is indexed in the database.
|
|
17
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiKey.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"ApiKey.d.ts","sourceRoot":"./src/","sources":["documents/common/ApiKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAe,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,cAAc,MAAM,+CAA+C,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,MAAM,CAQpD,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,YAAa,YAAW,cAAc;IACxE;;OAEG;IACH,GAAG,EAAE,IAAI,CAAuB;IAEhC;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC;IAEjB;;OAEG;gBACS,MAAM,EAAE,QAAQ;CAI7B"}
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.validateApiKey = void 0;
|
|
7
|
-
const bson_1 = require("bson");
|
|
8
|
-
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
-
const BaseDocument_1 = __importDefault(require("../BaseDocument"));
|
|
10
|
-
const ValidateUtil_1 = __importDefault(require("../../schemas/validators/ValidateUtil"));
|
|
11
|
-
const validateApiKey = (apiKey) => {
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
2
|
+
import crypto from 'crypto';
|
|
3
|
+
import Validate from '../../schemas/validators/ValidateUtil.js';
|
|
4
|
+
import BaseDocument from '../BaseDocument.js';
|
|
5
|
+
export const validateApiKey = (apiKey) => {
|
|
12
6
|
const errors = [];
|
|
13
|
-
const exampleApiKey = new ApiKey(new
|
|
14
|
-
const validate = new
|
|
7
|
+
const exampleApiKey = new ApiKey(new ObjectId());
|
|
8
|
+
const validate = new Validate(apiKey, errors);
|
|
15
9
|
validate.string('key', exampleApiKey.key);
|
|
16
10
|
return { updatedDoc: apiKey, errors };
|
|
17
11
|
};
|
|
18
|
-
exports.validateApiKey = validateApiKey;
|
|
19
12
|
/**
|
|
20
13
|
* A document containing an API key for a particular user. This is stored
|
|
21
14
|
* separately from the {@link User} document to enhance security a bit.
|
|
22
15
|
*/
|
|
23
|
-
class ApiKey extends
|
|
16
|
+
export default class ApiKey extends BaseDocument {
|
|
24
17
|
/**
|
|
25
18
|
* The API key for the user. This is indexed in the DB.
|
|
26
19
|
*/
|
|
27
|
-
key =
|
|
20
|
+
key = crypto.randomUUID();
|
|
28
21
|
/**
|
|
29
22
|
* The user ID that this key is for. This field is indexed in the database.
|
|
30
23
|
*/
|
|
@@ -37,4 +30,4 @@ class ApiKey extends BaseDocument_1.default {
|
|
|
37
30
|
this.userId = userId;
|
|
38
31
|
}
|
|
39
32
|
}
|
|
40
|
-
|
|
33
|
+
//# sourceMappingURL=ApiKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiKey.js","sourceRoot":"./src/","sources":["documents/common/ApiKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,MAAgB,MAAM,QAAQ,CAAC;AAGtC,OAAO,QAAQ,MAAM,0CAA0C,CAAC;AAChE,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C,MAAM,CAAC,MAAM,cAAc,GAA8B,CAAC,MAAc,EAAE,EAAE;IAC1E,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9C,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,YAAY;IAC9C;;OAEG;IACH,GAAG,GAAS,MAAM,CAAC,UAAU,EAAE,CAAC;IAEhC;;OAEG;IACH,MAAM,CAAW;IAEjB;;OAEG;IACH,YAAY,MAAgB;QAC1B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
2
|
+
import crypto, { UUID } from 'crypto';
|
|
3
|
+
import RequiredUserId from '../../schemas/required-refs/RequiredUserId.js';
|
|
4
|
+
import { DocumentValidator } from '../../schemas/validators/DocumentValidator.js';
|
|
5
|
+
import Validate from '../../schemas/validators/ValidateUtil.js';
|
|
6
|
+
import BaseDocument from '../BaseDocument.js';
|
|
7
|
+
|
|
8
|
+
export const validateApiKey: DocumentValidator<ApiKey> = (apiKey: ApiKey) => {
|
|
9
|
+
const errors: string[] = [];
|
|
10
|
+
const exampleApiKey = new ApiKey(new ObjectId());
|
|
11
|
+
const validate = new Validate(apiKey, errors);
|
|
12
|
+
|
|
13
|
+
validate.string('key', exampleApiKey.key);
|
|
14
|
+
|
|
15
|
+
return { updatedDoc: apiKey, errors };
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A document containing an API key for a particular user. This is stored
|
|
20
|
+
* separately from the {@link User} document to enhance security a bit.
|
|
21
|
+
*/
|
|
22
|
+
export default class ApiKey extends BaseDocument implements RequiredUserId {
|
|
23
|
+
/**
|
|
24
|
+
* The API key for the user. This is indexed in the DB.
|
|
25
|
+
*/
|
|
26
|
+
key: UUID = crypto.randomUUID();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The user ID that this key is for. This field is indexed in the database.
|
|
30
|
+
*/
|
|
31
|
+
userId: ObjectId;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new {@link ApiKey} for the provided user.
|
|
35
|
+
*/
|
|
36
|
+
constructor(userId: ObjectId) {
|
|
37
|
+
super();
|
|
38
|
+
this.userId = userId;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ObjectId } from 'bson';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { DocumentValidator } from '../../schemas/validators/DocumentValidator.js';
|
|
3
|
+
import BaseDocument from '../BaseDocument.js';
|
|
4
4
|
/**
|
|
5
5
|
* A User CTO which can be used to reference a User with only the necessary
|
|
6
6
|
* information.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"User.d.ts","sourceRoot":"./src/","sources":["documents/common/User.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,QAAQ,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,IAAI,CAkBhD,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IAC5C,GAAG,EAAE,QAAQ,CAAkB;IAE/B,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE;QACJ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAM;IAEP,aAAa;;MAEX;IAEF;;OAEG;gBACS,QAAQ,EAAE,MAAM;CAI7B"}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateUser = void 0;
|
|
7
|
-
const bson_1 = require("bson");
|
|
8
|
-
const BaseDocument_1 = __importDefault(require("../BaseDocument"));
|
|
9
|
-
const ValidateUtil_1 = __importDefault(require("../../schemas/validators/ValidateUtil"));
|
|
10
|
-
const validateUser = (user) => {
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
2
|
+
import Validate from '../../schemas/validators/ValidateUtil.js';
|
|
3
|
+
import BaseDocument from '../BaseDocument.js';
|
|
4
|
+
export const validateUser = (user) => {
|
|
11
5
|
const errors = [];
|
|
12
|
-
const validate = new
|
|
6
|
+
const validate = new Validate(user, errors);
|
|
13
7
|
const exampleUser = new User('example');
|
|
14
8
|
validate.string('userName', 'UsernameUnknown');
|
|
15
9
|
validate.optionalString('password');
|
|
@@ -21,14 +15,13 @@ const validateUser = (user) => {
|
|
|
21
15
|
validate.boolean('projectAccess.dashboard', exampleUser.projectAccess.dashboard);
|
|
22
16
|
return { updatedDoc: user, errors };
|
|
23
17
|
};
|
|
24
|
-
exports.validateUser = validateUser;
|
|
25
18
|
/**
|
|
26
19
|
* A standard user of all personal projects. This should be linked to from
|
|
27
20
|
* other documents that need to reference a user, instead of cluttering the
|
|
28
21
|
* key user information.
|
|
29
22
|
*/
|
|
30
|
-
class User extends
|
|
31
|
-
_id = new
|
|
23
|
+
export default class User extends BaseDocument {
|
|
24
|
+
_id = new ObjectId();
|
|
32
25
|
userName;
|
|
33
26
|
email;
|
|
34
27
|
auth = {};
|
|
@@ -43,4 +36,4 @@ class User extends BaseDocument_1.default {
|
|
|
43
36
|
this.userName = userName;
|
|
44
37
|
}
|
|
45
38
|
}
|
|
46
|
-
|
|
39
|
+
//# sourceMappingURL=User.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"./src/","sources":["documents/common/User.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,QAAQ,MAAM,0CAA0C,CAAC;AAChE,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAW9C,MAAM,CAAC,MAAM,YAAY,GAA4B,CAAC,IAAI,EAAE,EAAE;IAC5D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;IAExC,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;IAC/C,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IACpC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1C,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IACzC,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IAC5D,QAAQ,CAAC,OAAO,CACd,yBAAyB,EACzB,WAAW,CAAC,aAAa,CAAC,SAAS,CACpC,CAAC;IAEF,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IAC5C,GAAG,GAAa,IAAI,QAAQ,EAAE,CAAC;IAE/B,QAAQ,CAAS;IAEjB,KAAK,CAAU;IAEf,IAAI,GAGA,EAAE,CAAC;IAEP,aAAa,GAAG;QACd,SAAS,EAAE,IAAI;KAChB,CAAC;IAEF;;OAEG;IACH,YAAY,QAAgB;QAC1B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
2
|
+
import { DocumentValidator } from '../../schemas/validators/DocumentValidator.js';
|
|
3
|
+
import Validate from '../../schemas/validators/ValidateUtil.js';
|
|
4
|
+
import BaseDocument from '../BaseDocument.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A User CTO which can be used to reference a User with only the necessary
|
|
8
|
+
* information.
|
|
9
|
+
*/
|
|
10
|
+
export type UserCTO = {
|
|
11
|
+
_id: ObjectId;
|
|
12
|
+
userName: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const validateUser: DocumentValidator<User> = (user) => {
|
|
16
|
+
const errors: string[] = [];
|
|
17
|
+
const validate = new Validate(user, errors);
|
|
18
|
+
const exampleUser = new User('example');
|
|
19
|
+
|
|
20
|
+
validate.string('userName', 'UsernameUnknown');
|
|
21
|
+
validate.optionalString('password');
|
|
22
|
+
validate.optionalString('email');
|
|
23
|
+
validate.object('auth', exampleUser.auth);
|
|
24
|
+
validate.optionalString('auth.password');
|
|
25
|
+
validate.optionalString('auth.googleId');
|
|
26
|
+
validate.object('projectAccess', exampleUser.projectAccess);
|
|
27
|
+
validate.boolean(
|
|
28
|
+
'projectAccess.dashboard',
|
|
29
|
+
exampleUser.projectAccess.dashboard
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return { updatedDoc: user, errors };
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A standard user of all personal projects. This should be linked to from
|
|
37
|
+
* other documents that need to reference a user, instead of cluttering the
|
|
38
|
+
* key user information.
|
|
39
|
+
*/
|
|
40
|
+
export default class User extends BaseDocument {
|
|
41
|
+
_id: ObjectId = new ObjectId();
|
|
42
|
+
|
|
43
|
+
userName: string;
|
|
44
|
+
|
|
45
|
+
email?: string;
|
|
46
|
+
|
|
47
|
+
auth: {
|
|
48
|
+
password?: string;
|
|
49
|
+
googleId?: string;
|
|
50
|
+
} = {};
|
|
51
|
+
|
|
52
|
+
projectAccess = {
|
|
53
|
+
dashboard: true
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Constructs a new {@link User} with default values.
|
|
58
|
+
*/
|
|
59
|
+
constructor(userName: string) {
|
|
60
|
+
super();
|
|
61
|
+
this.userName = userName;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ObjectId } from 'bson';
|
|
2
|
-
import RequiredUserId from '../../schemas/required-refs/RequiredUserId';
|
|
3
|
-
import BaseDocumentWithType from '../BaseDocumentWithType';
|
|
4
|
-
import NonogramKatanaItemName from '../../embedded-types/dashboard/nonogramKatanaItem/ItemName';
|
|
5
|
-
import { DocumentValidator } from '../../schemas/validators/DocumentValidator';
|
|
2
|
+
import RequiredUserId from '../../schemas/required-refs/RequiredUserId.js';
|
|
3
|
+
import BaseDocumentWithType from '../BaseDocumentWithType.js';
|
|
4
|
+
import NonogramKatanaItemName from '../../embedded-types/dashboard/nonogramKatanaItem/ItemName.js';
|
|
5
|
+
import { DocumentValidator } from '../../schemas/validators/DocumentValidator.js';
|
|
6
6
|
export declare const validateNonogramKatanaItem: DocumentValidator<NonogramKatanaItem>;
|
|
7
7
|
/**
|
|
8
8
|
* An item in the Nonogram Katana game.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonogramKatanaItem.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"NonogramKatanaItem.d.ts","sourceRoot":"./src/","sources":["documents/dashboard/NonogramKatanaItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,cAAc,MAAM,+CAA+C,CAAC;AAC3E,OAAO,oBAAoB,MAAM,4BAA4B,CAAC;AAC9D,OAAO,sBAAsB,MAAM,+DAA+D,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,eAAO,MAAM,0BAA0B,EAAE,iBAAiB,CACxD,kBAAkB,CAOnB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,kBACnB,SAAQ,oBACR,YAAW,cAAc;IAEzB,MAAM,CAAC,OAAO,SAAwB;IAEtC,OAAO,SAA8B;IAErC;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC;IAEjB,QAAQ,EAAE,sBAAsB,CAAC;IAEjC,aAAa,EAAE,MAAM,CAAK;IAE1B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAK;gBAET,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,sBAAsB;CAKhE"}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateNonogramKatanaItem = void 0;
|
|
7
|
-
const BaseDocumentWithType_1 = __importDefault(require("../BaseDocumentWithType"));
|
|
8
|
-
const validateNonogramKatanaItem = (item) => {
|
|
1
|
+
import BaseDocumentWithType from '../BaseDocumentWithType.js';
|
|
2
|
+
export const validateNonogramKatanaItem = (item) => {
|
|
9
3
|
const errors = [];
|
|
10
4
|
// No validation at the moment.
|
|
11
5
|
return { updatedDoc: item, errors };
|
|
12
6
|
};
|
|
13
|
-
exports.validateNonogramKatanaItem = validateNonogramKatanaItem;
|
|
14
7
|
/**
|
|
15
8
|
* An item in the Nonogram Katana game.
|
|
16
9
|
*/
|
|
17
|
-
class NonogramKatanaItem extends
|
|
10
|
+
export default class NonogramKatanaItem extends BaseDocumentWithType {
|
|
18
11
|
static docType = 'nonogramKatanaItem';
|
|
19
12
|
docType = NonogramKatanaItem.docType;
|
|
20
13
|
/**
|
|
@@ -36,4 +29,4 @@ class NonogramKatanaItem extends BaseDocumentWithType_1.default {
|
|
|
36
29
|
this.itemName = itemName;
|
|
37
30
|
}
|
|
38
31
|
}
|
|
39
|
-
|
|
32
|
+
//# sourceMappingURL=NonogramKatanaItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NonogramKatanaItem.js","sourceRoot":"./src/","sources":["documents/dashboard/NonogramKatanaItem.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,4BAA4B,CAAC;AAI9D,MAAM,CAAC,MAAM,0BAA0B,GAEnC,CAAC,IAAwB,EAAE,EAAE;IAC/B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,+BAA+B;IAE/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,kBACnB,SAAQ,oBAAoB;IAG5B,MAAM,CAAC,OAAO,GAAG,oBAAoB,CAAC;IAEtC,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC;IAErC;;OAEG;IACH,MAAM,CAAW;IAEjB,QAAQ,CAAyB;IAEjC,aAAa,GAAW,CAAC,CAAC;IAE1B,UAAU,CAAU;IAEpB,UAAU,CAAU;IAEpB,UAAU,CAAU;IAEpB;;OAEG;IACH,QAAQ,GAAW,CAAC,CAAC;IAErB,YAAY,OAAiB,EAAE,QAAgC;QAC7D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
2
|
+
import RequiredUserId from '../../schemas/required-refs/RequiredUserId.js';
|
|
3
|
+
import BaseDocumentWithType from '../BaseDocumentWithType.js';
|
|
4
|
+
import NonogramKatanaItemName from '../../embedded-types/dashboard/nonogramKatanaItem/ItemName.js';
|
|
5
|
+
import { DocumentValidator } from '../../schemas/validators/DocumentValidator.js';
|
|
6
|
+
|
|
7
|
+
export const validateNonogramKatanaItem: DocumentValidator<
|
|
8
|
+
NonogramKatanaItem
|
|
9
|
+
> = (item: NonogramKatanaItem) => {
|
|
10
|
+
const errors: string[] = [];
|
|
11
|
+
|
|
12
|
+
// No validation at the moment.
|
|
13
|
+
|
|
14
|
+
return { updatedDoc: item, errors };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An item in the Nonogram Katana game.
|
|
19
|
+
*/
|
|
20
|
+
export default class NonogramKatanaItem
|
|
21
|
+
extends BaseDocumentWithType
|
|
22
|
+
implements RequiredUserId
|
|
23
|
+
{
|
|
24
|
+
static docType = 'nonogramKatanaItem';
|
|
25
|
+
|
|
26
|
+
docType = NonogramKatanaItem.docType;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The owner of this Nonogram Katana item.
|
|
30
|
+
*/
|
|
31
|
+
userId: ObjectId;
|
|
32
|
+
|
|
33
|
+
itemName: NonogramKatanaItemName;
|
|
34
|
+
|
|
35
|
+
currentAmount: number = 0;
|
|
36
|
+
|
|
37
|
+
storageCap?: number;
|
|
38
|
+
|
|
39
|
+
minDesired?: number;
|
|
40
|
+
|
|
41
|
+
maxDesired?: number;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Priority, where the higher the number, the higher up the list it is.
|
|
45
|
+
*/
|
|
46
|
+
priority: number = 0;
|
|
47
|
+
|
|
48
|
+
constructor(ownerId: ObjectId, itemName: NonogramKatanaItemName) {
|
|
49
|
+
super();
|
|
50
|
+
this.userId = ownerId;
|
|
51
|
+
this.itemName = itemName;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ObjectId } from 'bson';
|
|
2
|
-
import RequiredUserId from '../../schemas/required-refs/RequiredUserId';
|
|
3
|
-
import BaseDocumentWithType from '../BaseDocumentWithType';
|
|
4
|
-
import NonogramKatanaItemName from '../../embedded-types/dashboard/nonogramKatanaItem/ItemName';
|
|
5
|
-
import NonogramKatanaUpgradeName from '../../embedded-types/dashboard/nonogramKatanaUpgrade/UpgradeName';
|
|
6
|
-
import { DocumentValidator } from '../../schemas/validators/DocumentValidator';
|
|
2
|
+
import RequiredUserId from '../../schemas/required-refs/RequiredUserId.js';
|
|
3
|
+
import BaseDocumentWithType from '../BaseDocumentWithType.js';
|
|
4
|
+
import NonogramKatanaItemName from '../../embedded-types/dashboard/nonogramKatanaItem/ItemName.js';
|
|
5
|
+
import NonogramKatanaUpgradeName from '../../embedded-types/dashboard/nonogramKatanaUpgrade/UpgradeName.js';
|
|
6
|
+
import { DocumentValidator } from '../../schemas/validators/DocumentValidator.js';
|
|
7
7
|
export declare const validateNonogramKatanaUpgrade: DocumentValidator<NonogramKatanaUpgrade>;
|
|
8
8
|
/**
|
|
9
9
|
* An upgrade in the Nonogram Katana game.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonogramKatanaUpgrade.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"NonogramKatanaUpgrade.d.ts","sourceRoot":"./src/","sources":["documents/dashboard/NonogramKatanaUpgrade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,cAAc,MAAM,+CAA+C,CAAC;AAC3E,OAAO,oBAAoB,MAAM,4BAA4B,CAAC;AAC9D,OAAO,sBAAsB,MAAM,+DAA+D,CAAC;AACnG,OAAO,yBAAyB,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,eAAO,MAAM,6BAA6B,EAAE,iBAAiB,CAC3D,qBAAqB,CAOtB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,qBACnB,SAAQ,oBACR,YAAW,cAAc;IAEzB,MAAM,CAAC,OAAO,SAA2B;IAEzC,OAAO,SAAiC;IAExC;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC;IAEjB,WAAW,EAAE,yBAAyB,CAAC;IAEvC,SAAS,EAAE,OAAO,CAAS;IAE3B,kBAAkB,EAAE;SAAG,GAAG,IAAI,sBAAsB,CAAC,CAAC,EAAE,MAAM;KAAE,CAAM;IAEtE;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAK;gBAET,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB;CAKtE"}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateNonogramKatanaUpgrade = void 0;
|
|
7
|
-
const BaseDocumentWithType_1 = __importDefault(require("../BaseDocumentWithType"));
|
|
8
|
-
const validateNonogramKatanaUpgrade = (upgrade) => {
|
|
1
|
+
import BaseDocumentWithType from '../BaseDocumentWithType.js';
|
|
2
|
+
export const validateNonogramKatanaUpgrade = (upgrade) => {
|
|
9
3
|
const errors = [];
|
|
10
4
|
// No validation at the moment.
|
|
11
5
|
return { updatedDoc: upgrade, errors };
|
|
12
6
|
};
|
|
13
|
-
exports.validateNonogramKatanaUpgrade = validateNonogramKatanaUpgrade;
|
|
14
7
|
/**
|
|
15
8
|
* An upgrade in the Nonogram Katana game.
|
|
16
9
|
*/
|
|
17
|
-
class NonogramKatanaUpgrade extends
|
|
10
|
+
export default class NonogramKatanaUpgrade extends BaseDocumentWithType {
|
|
18
11
|
static docType = 'nonogramKatanaUpgrade';
|
|
19
12
|
docType = NonogramKatanaUpgrade.docType;
|
|
20
13
|
/**
|
|
@@ -34,4 +27,4 @@ class NonogramKatanaUpgrade extends BaseDocumentWithType_1.default {
|
|
|
34
27
|
this.upgradeName = upgradeName;
|
|
35
28
|
}
|
|
36
29
|
}
|
|
37
|
-
|
|
30
|
+
//# sourceMappingURL=NonogramKatanaUpgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NonogramKatanaUpgrade.js","sourceRoot":"./src/","sources":["documents/dashboard/NonogramKatanaUpgrade.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,4BAA4B,CAAC;AAK9D,MAAM,CAAC,MAAM,6BAA6B,GAEtC,CAAC,OAA8B,EAAE,EAAE;IACrC,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,+BAA+B;IAE/B,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACzC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,qBACnB,SAAQ,oBAAoB;IAG5B,MAAM,CAAC,OAAO,GAAG,uBAAuB,CAAC;IAEzC,OAAO,GAAG,qBAAqB,CAAC,OAAO,CAAC;IAExC;;OAEG;IACH,MAAM,CAAW;IAEjB,WAAW,CAA4B;IAEvC,SAAS,GAAY,KAAK,CAAC;IAE3B,kBAAkB,GAAiD,EAAE,CAAC;IAEtE;;OAEG;IACH,QAAQ,GAAW,CAAC,CAAC;IAErB,YAAY,OAAiB,EAAE,WAAsC;QACnE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC"}
|