Inventory Infrastructure and Example for Suits #10
@ -11,7 +11,6 @@
|
||||
"node": true
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/no-misused-promises": "off",
|
||||
"prettier/prettier": "error",
|
||||
"@typescript-eslint/semi": ["error"],
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
|
12
config.json
@ -1,7 +1,9 @@
|
||||
{
|
||||
"autoCreateAccount": true,
|
||||
"buildLabel": "2023.05.25.13.39/oZkc-RIme5c1CCltUfg2gQ",
|
||||
"matchmakingBuildId": "4920386201513015989",
|
||||
"version": "33.0.14",
|
||||
"worldSeed": "GWvLyHiw7/Qr/60056xmAmDrn0Y9et2S3BYlLSkLDNBMtumSr3KxWV8He5Jz72yYq3tsY+cd53QeTf+bb54+llGTbYiQF+64BtiLWMVhWP1IUaP4SxWHXojlpQC13op/udHI1whc+8zrxEzzZmv/QlpvigAAbjBDtwu97Df0vgn+YrOKi4G3OhgIkTRocAAzD1P/BGbT8gaKE01H8rXl3+Gq6jCA1O1v800SL6DwKOgMsXVvWp7g2n/tPxJe/j9bmu4XFG0bSa5y5hikLKxvntA/5ut+iogv4MyMBe+TydVxjPqNbkKnby5l4KAL+3inpuPraeg4jcNMt0AwKG8NIQ=="
|
||||
"autoCreateAccount": true,
|
||||
"buildLabel": "2023.05.25.13.39/oZkc-RIme5c1CCltUfg2gQ",
|
||||
"matchmakingBuildId": "4920386201513015989",
|
||||
"version": "33.0.14",
|
||||
"worldSeed": "GWvLyHiw7/Qr/60056xmAmDrn0Y9et2S3BYlLSkLDNBMtumSr3KxWV8He5Jz72yYq3tsY+cd53QeTf+bb54+llGTbYiQF+64BtiLWMVhWP1IUaP4SxWHXojlpQC13op/udHI1whc+8zrxEzzZmv/QlpvigAAbjBDtwu97Df0vgn+YrOKi4G3OhgIkTRocAAzD1P/BGbT8gaKE01H8rXl3+Gq6jCA1O1v800SL6DwKOgMsXVvWp7g2n/tPxJe/j9bmu4XFG0bSa5y5hikLKxvntA/5ut+iogv4MyMBe+TydVxjPqNbkKnby5l4KAL+3inpuPraeg4jcNMt0AwKG8NIQ==",
|
||||
"skipStoryModeChoice": true,
|
||||
"skipTutorial": true
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { RequestHandler } from "express";
|
||||
|
||||
const deleteSessionController: RequestHandler = (_req, res) => {
|
||||
res.json({ sessionId: { $oid: "64768f104722f795300c9fc0" }, rewardSeed: 5867309943877621023 });
|
||||
res.sendStatus(200);
|
||||
};
|
||||
|
||||
export { deleteSessionController };
|
||||
|
@ -1,11 +1,29 @@
|
||||
|
||||
import inventory from "@/static/fixed_responses/inventory.json";
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
import { toInventoryResponse } from "@/src/helpers/inventoryHelpers";
|
||||
![]() isnt disabled globally now? isnt disabled globally now?
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() no idea it shouldn't be no idea it shouldn't be
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() then remove the one from .eslintrc then remove the one from .eslintrc
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() I agree with you that it is stupid to have the line in every file that has an async handler. But I don't like to globally disable a warning. Ill turn the .eslintrc back on I agree with you that it is stupid to have the line in every file that has an async handler.
But I don't like to globally disable a warning. Ill turn the .eslintrc back on
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
import { Inventory } from "@/src/models/inventoryModel";
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
import { Request, RequestHandler, Response } from "express";
|
||||
|
||||
const inventoryController: RequestHandler = (request: Request, response: Response) => {
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
console.log(request.query);
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
const inventoryController: RequestHandler = async (request: Request, response: Response) => {
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
const accountId = request.query.accountId;
|
||||
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
if (!accountId) {
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
response.status(400).json({ error: "accountId was not provided" });
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
return;
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
}
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
console.log(accountId);
|
||||
response.json(inventory);
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
![]() remove log remove log
|
||||
if (!inventory) {
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
response.status(400).json({ error: "inventory was undefined" });
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
return;
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
}
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
const inventoryJSON = inventory.toJSON();
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
const inventoreResponse = toInventoryResponse(inventoryJSON);
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
response.json(inventoreResponse);
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
||||
};
|
||||
|
||||
export { inventoryController };
|
||||
|
||||
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() i dont think the comment is necessary
i dont think the comment is necessary
```suggestion
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
```
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() check if inventory is undefined before trying check if inventory is undefined before trying `toJson()`
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() it is important, because it is not present in the original response. it is important, because it is not present in the original response.
![]() ?. checks for undefined! ?. checks for undefined!
![]() ?. checks for undefined! ?. checks for undefined!
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious. this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() that's why you check before so you dont two undefined checks that's why you check before so you dont two undefined checks
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory. it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
![]() good suggestion! good suggestion!
![]() good suggestion! good suggestion!
![]() I understand now what you mean I understand now what you mean
![]() I understand now what you mean I understand now what you mean
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
![]() should that belong then inside inventoryModel.ts? should that belong then inside inventoryModel.ts?
|
@ -13,11 +13,8 @@ const loginController: RequestHandler = async (request, response) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument
|
||||
const body = JSON.parse(request.body); // parse octet stream of json data to json object
|
||||
const loginRequest = toLoginRequest(body);
|
||||
// console.log(body);
|
||||
//console.log(String.fromCharCode.apiRouterly(null, req.body));
|
||||
|
||||
const account = await Account.findOne({ email: loginRequest.email }); //{ _id: 0, __v: 0 }
|
||||
console.log("findone", account);
|
||||
|
||||
if (!account && config.autoCreateAccount) {
|
||||
try {
|
||||
@ -32,7 +29,8 @@ const loginController: RequestHandler = async (request, response) => {
|
||||
ConsentNeeded: false,
|
||||
TrackedSettings: []
|
||||
});
|
||||
console.log("CREATED ACCOUNT", newAccount);
|
||||
console.log("creating new account");
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { email, password, ...databaseAccount } = newAccount;
|
||||
const newLoginResponse: ILoginResponse = {
|
||||
...databaseAccount,
|
||||
@ -47,7 +45,6 @@ const loginController: RequestHandler = async (request, response) => {
|
||||
MatchmakingBuildId: config.matchmakingBuildId
|
||||
};
|
||||
|
||||
console.log(newLoginResponse);
|
||||
response.json(newLoginResponse);
|
||||
return;
|
||||
} catch (error: unknown) {
|
||||
@ -77,7 +74,6 @@ const loginController: RequestHandler = async (request, response) => {
|
||||
MatchmakingBuildId: config.matchmakingBuildId
|
||||
};
|
||||
|
||||
console.log("login response", newLoginResponse);
|
||||
response.json(newLoginResponse);
|
||||
};
|
||||
|
||||
|
9
src/helpers/inventoryHelpers.ts
Normal file
@ -0,0 +1,9 @@
|
||||
![]() use non-relative import use non-relative import
![]() use non-relative import use non-relative import
|
||||
import { IInventoryDatabase, IInventoryResponse } from "@/src/types/inventoryTypes";
|
||||
![]() use non-relative import use non-relative import
|
||||
|
||||
![]() use non-relative import use non-relative import
|
||||
const toInventoryResponse = (inventoryDatabase: IInventoryDatabase): IInventoryResponse => {
|
||||
![]() use non-relative import use non-relative import
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
![]() use non-relative import use non-relative import
|
||||
const { accountOwnerId, ...inventoreResponse } = inventoryDatabase;
|
||||
![]() use non-relative import use non-relative import
|
||||
return inventoreResponse;
|
||||
![]() use non-relative import use non-relative import
|
||||
};
|
||||
![]() use non-relative import use non-relative import
|
||||
|
||||
![]() use non-relative import use non-relative import
|
||||
export { toInventoryResponse };
|
||||
![]() use non-relative import use non-relative import
|
258
src/models/inventoryModel.ts
Normal file
@ -0,0 +1,258 @@
|
||||
import { Document, Schema, model } from "mongoose";
|
||||
import { IInventoryDatabase, IInventoryResponse, ISuitDatabase, ISuitDocument, Oid } from "../types/inventoryTypes";
|
||||
![]() use non-relative import use non-relative import
|
||||
|
||||
const polaritySchema = new Schema({
|
||||
Slot: Number,
|
||||
Value: String
|
||||
});
|
||||
|
||||
const abilityOverrideSchema = new Schema({
|
||||
Ability: String,
|
||||
Index: Number
|
||||
});
|
||||
|
||||
const colorSchema = new Schema({
|
||||
t0: Number,
|
||||
t1: Number,
|
||||
t2: Number,
|
||||
t3: Number,
|
||||
en: Number,
|
||||
e1: Number,
|
||||
m0: Number,
|
||||
m1: Number
|
||||
});
|
||||
|
||||
const suitConfigSchema = new Schema({
|
||||
Skins: [String],
|
||||
pricol: colorSchema,
|
||||
attcol: colorSchema,
|
||||
eyecol: colorSchema,
|
||||
sigcol: colorSchema,
|
||||
Upgrades: [String],
|
||||
Songs: [
|
||||
{
|
||||
m: String,
|
||||
b: String,
|
||||
p: String,
|
||||
s: String
|
||||
}
|
||||
],
|
||||
Name: String,
|
||||
AbilityOverride: abilityOverrideSchema,
|
||||
PvpUpgrades: [String],
|
||||
ugly: Boolean
|
||||
});
|
||||
|
||||
suitConfigSchema.set("toJSON", {
|
||||
transform(_document, returnedObject) {
|
||||
delete returnedObject._id;
|
||||
delete returnedObject.__v;
|
||||
}
|
||||
});
|
||||
|
||||
const suitSchema = new Schema({
|
||||
ItemType: String,
|
||||
Configs: [suitConfigSchema],
|
||||
UpgradeVer: Number,
|
||||
XP: Number,
|
||||
InfestationDate: Date,
|
||||
Features: Number,
|
||||
Polarity: [polaritySchema],
|
||||
Polarized: Number,
|
||||
ModSlotPurchases: Number,
|
||||
FocusLens: String,
|
||||
UnlockLevel: Number
|
||||
});
|
||||
|
||||
suitSchema.set("toJSON", {
|
||||
transform(_document, returnedObject: ISuitDocument) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
||||
returnedObject.ItemId = { $oid: returnedObject._id.toString() } satisfies Oid;
|
||||
delete returnedObject._id;
|
||||
delete returnedObject.__v;
|
||||
}
|
||||
});
|
||||
|
||||
const inventorySchema = new Schema({
|
||||
accountOwnerId: Schema.Types.ObjectId,
|
||||
SubscribedToEmails: Number,
|
||||
Created: Schema.Types.Mixed,
|
||||
RewardSeed: Number,
|
||||
RegularCredits: Number,
|
||||
PremiumCredits: Number,
|
||||
PremiumCreditsFree: Number,
|
||||
FusionPoints: Number,
|
||||
SuitBin: Schema.Types.Mixed,
|
||||
WeaponBin: Schema.Types.Mixed,
|
||||
SentinelBin: Schema.Types.Mixed,
|
||||
SpaceSuitBin: Schema.Types.Mixed,
|
||||
SpaceWeaponBin: Schema.Types.Mixed,
|
||||
PvpBonusLoadoutBin: Schema.Types.Mixed,
|
||||
PveBonusLoadoutBin: Schema.Types.Mixed,
|
||||
RandomModBin: Schema.Types.Mixed,
|
||||
TradesRemaining: Number,
|
||||
DailyAffiliation: Number,
|
||||
DailyAffiliationPvp: Number,
|
||||
DailyAffiliationLibrary: Number,
|
||||
DailyFocus: Number,
|
||||
GiftsRemaining: Number,
|
||||
HandlerPoints: Number,
|
||||
MiscItems: [Schema.Types.Mixed],
|
||||
ChallengesFixVersion: Number,
|
||||
ChallengeProgress: [Schema.Types.Mixed],
|
||||
RawUpgrades: [Schema.Types.Mixed],
|
||||
ReceivedStartingGear: Boolean,
|
||||
Suits: [suitSchema],
|
||||
LongGuns: [Schema.Types.Mixed],
|
||||
Pistols: [Schema.Types.Mixed],
|
||||
Melee: [Schema.Types.Mixed],
|
||||
Ships: [Schema.Types.Mixed],
|
||||
QuestKeys: [Schema.Types.Mixed],
|
||||
FlavourItems: [Schema.Types.Mixed],
|
||||
Scoops: [Schema.Types.Mixed],
|
||||
TrainingRetriesLeft: Number,
|
||||
LoadOutPresets: Schema.Types.Mixed,
|
||||
CurrentLoadOutIds: [Schema.Types.Mixed],
|
||||
Missions: [Schema.Types.Mixed],
|
||||
RandomUpgradesIdentified: Number,
|
||||
LastRegionPlayed: String,
|
||||
XPInfo: [Schema.Types.Mixed],
|
||||
Recipes: [Schema.Types.Mixed],
|
||||
WeaponSkins: [Schema.Types.Mixed],
|
||||
PendingRecipes: [Schema.Types.Mixed],
|
||||
TrainingDate: Schema.Types.Mixed,
|
||||
PlayerLevel: Number,
|
||||
Upgrades: [Schema.Types.Mixed],
|
||||
EquippedGear: [String],
|
||||
DeathMarks: [String],
|
||||
FusionTreasures: [Schema.Types.Mixed],
|
||||
WebFlags: Schema.Types.Mixed,
|
||||
CompletedAlerts: [String],
|
||||
Consumables: [Schema.Types.Mixed],
|
||||
LevelKeys: [Schema.Types.Mixed],
|
||||
TauntHistory: [Schema.Types.Mixed],
|
||||
StoryModeChoice: String,
|
||||
PeriodicMissionCompletions: [Schema.Types.Mixed],
|
||||
KubrowPetEggs: [Schema.Types.Mixed],
|
||||
LoreFragmentScans: [Schema.Types.Mixed],
|
||||
EquippedEmotes: [String],
|
||||
PendingTrades: [Schema.Types.Mixed],
|
||||
Boosters: [Schema.Types.Mixed],
|
||||
ActiveDojoColorResearch: String,
|
||||
SentientSpawnChanceBoosters: Schema.Types.Mixed,
|
||||
Affiliations: [Schema.Types.Mixed],
|
||||
QualifyingInvasions: [Schema.Types.Mixed],
|
||||
FactionScores: [Number],
|
||||
SpaceSuits: [Schema.Types.Mixed],
|
||||
SpaceMelee: [Schema.Types.Mixed],
|
||||
SpaceGuns: [Schema.Types.Mixed],
|
||||
ArchwingEnabled: Boolean,
|
||||
PendingSpectreLoadouts: [Schema.Types.Mixed],
|
||||
SpectreLoadouts: [Schema.Types.Mixed],
|
||||
SentinelWeapons: [Schema.Types.Mixed],
|
||||
Sentinels: [Schema.Types.Mixed],
|
||||
EmailItems: [Schema.Types.Mixed],
|
||||
CompletedSyndicates: [String],
|
||||
FocusXP: Schema.Types.Mixed,
|
||||
Wishlist: [String],
|
||||
Alignment: Schema.Types.Mixed,
|
||||
CompletedSorties: [String],
|
||||
LastSortieReward: [Schema.Types.Mixed],
|
||||
Drones: [Schema.Types.Mixed],
|
||||
StepSequencers: [Schema.Types.Mixed],
|
||||
ActiveAvatarImageType: String,
|
||||
KubrowPets: [Schema.Types.Mixed],
|
||||
ShipDecorations: [Schema.Types.Mixed],
|
||||
OperatorAmpBin: Schema.Types.Mixed,
|
||||
DailyAffiliationCetus: Number,
|
||||
DailyAffiliationQuills: Number,
|
||||
DiscoveredMarkers: [Schema.Types.Mixed],
|
||||
CompletedJobs: [Schema.Types.Mixed],
|
||||
FocusAbility: String,
|
||||
FocusUpgrades: [Schema.Types.Mixed],
|
||||
OperatorAmps: [Schema.Types.Mixed],
|
||||
HasContributedToDojo: Boolean,
|
||||
HWIDProtectEnabled: Boolean,
|
||||
KubrowPetPrints: [Schema.Types.Mixed],
|
||||
AlignmentReplay: Schema.Types.Mixed,
|
||||
PersonalGoalProgress: [Schema.Types.Mixed],
|
||||
DailyAffiliationSolaris: Number,
|
||||
SpecialItems: [Schema.Types.Mixed],
|
||||
ThemeStyle: String,
|
||||
ThemeBackground: String,
|
||||
ThemeSounds: String,
|
||||
BountyScore: Number,
|
||||
ChallengeInstanceStates: [Schema.Types.Mixed],
|
||||
LoginMilestoneRewards: [String],
|
||||
OperatorLoadOuts: [Schema.Types.Mixed],
|
||||
DailyAffiliationVentkids: Number,
|
||||
DailyAffiliationVox: Number,
|
||||
RecentVendorPurchases: [Schema.Types.Mixed],
|
||||
Hoverboards: [Schema.Types.Mixed],
|
||||
NodeIntrosCompleted: [String],
|
||||
CompletedJobChains: [Schema.Types.Mixed],
|
||||
SeasonChallengeHistory: [Schema.Types.Mixed],
|
||||
MoaPets: [Schema.Types.Mixed],
|
||||
EquippedInstrument: String,
|
||||
InvasionChainProgress: [Schema.Types.Mixed],
|
||||
DataKnives: [Schema.Types.Mixed],
|
||||
NemesisHistory: [Schema.Types.Mixed],
|
||||
LastNemesisAllySpawnTime: Schema.Types.Mixed,
|
||||
Settings: Schema.Types.Mixed,
|
||||
PersonalTechProjects: [Schema.Types.Mixed],
|
||||
CrewShips: [Schema.Types.Mixed],
|
||||
CrewShipSalvageBin: Schema.Types.Mixed,
|
||||
PlayerSkills: Schema.Types.Mixed,
|
||||
CrewShipAmmo: [Schema.Types.Mixed],
|
||||
CrewShipSalvagedWeaponSkins: [Schema.Types.Mixed],
|
||||
CrewShipWeapons: [Schema.Types.Mixed],
|
||||
CrewShipSalvagedWeapons: [Schema.Types.Mixed],
|
||||
CrewShipWeaponSkins: [Schema.Types.Mixed],
|
||||
TradeBannedUntil: Schema.Types.Mixed,
|
||||
PlayedParkourTutorial: Boolean,
|
||||
SubscribedToEmailsPersonalized: Number,
|
||||
MechBin: Schema.Types.Mixed,
|
||||
DailyAffiliationEntrati: Number,
|
||||
DailyAffiliationNecraloid: Number,
|
||||
MechSuits: [Schema.Types.Mixed],
|
||||
InfestedFoundry: Schema.Types.Mixed,
|
||||
BlessingCooldown: Schema.Types.Mixed,
|
||||
CrewMemberBin: Schema.Types.Mixed,
|
||||
CrewShipHarnesses: [Schema.Types.Mixed],
|
||||
CrewShipRawSalvage: [Schema.Types.Mixed],
|
||||
CrewMembers: [Schema.Types.Mixed],
|
||||
AdultOperatorLoadOuts: [Schema.Types.Mixed],
|
||||
LotusCustomization: Schema.Types.Mixed,
|
||||
UseAdultOperatorLoadout: Boolean,
|
||||
DailyAffiliationZariman: Number,
|
||||
NemesisAbandonedRewards: [String],
|
||||
DailyAffiliationKahl: Number,
|
||||
LastInventorySync: Schema.Types.Mixed,
|
||||
NextRefill: Schema.Types.Mixed,
|
||||
ActiveLandscapeTraps: [Schema.Types.Mixed],
|
||||
EvolutionProgress: [Schema.Types.Mixed],
|
||||
RepVotes: [Schema.Types.Mixed],
|
||||
LeagueTickets: [Schema.Types.Mixed],
|
||||
Quests: [Schema.Types.Mixed],
|
||||
Robotics: [Schema.Types.Mixed],
|
||||
UsedDailyDeals: [Schema.Types.Mixed],
|
||||
LibraryPersonalProgress: [Schema.Types.Mixed],
|
||||
CollectibleSeries: [Schema.Types.Mixed],
|
||||
LibraryAvailableDailyTaskInfo: Schema.Types.Mixed,
|
||||
HasResetAccount: Boolean,
|
||||
PendingCoupon: Schema.Types.Mixed,
|
||||
Harvestable: Boolean,
|
||||
DeathSquadable: Boolean
|
||||
});
|
||||
|
||||
inventorySchema.set("toJSON", {
|
||||
transform(_document, returnedObject: ISuitDocument) {
|
||||
delete returnedObject._id;
|
||||
delete returnedObject.__v;
|
||||
}
|
||||
});
|
||||
|
||||
const Suit = model<ISuitDatabase>("Suit", suitSchema);
|
||||
const Inventory = model<IInventoryDatabase>("Inventory", inventorySchema);
|
||||
|
||||
export { Inventory, Suit };
|
25
src/services/inventoryService.ts
Normal file
@ -0,0 +1,25 @@
|
||||
![]() use non-relative import use non-relative import
![]() use non-relative import use non-relative import
![]() done done
![]() done done
|
||||
import { Inventory } from "@/src/models/inventoryModel";
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
import new_inventory from "@/static/fixed_responses/postTutorialInventory.json";
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
import config from "@/config.json";
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
import { Types } from "mongoose";
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
const createInventory = async (accountOwnerId: Types.ObjectId) => {
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
try {
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
const inventory = new Inventory({ ...new_inventory, accountOwnerId: accountOwnerId });
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
if (config.skipStoryModeChoice) {
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
inventory.StoryModeChoice = "WARFRAME";
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
}
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
if (config.skipTutorial) {
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
inventory.PlayedParkourTutorial = true;
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
inventory.ReceivedStartingGear = true;
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
}
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
await inventory.save();
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
} catch (error) {
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
if (error instanceof Error) {
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
throw new Error(`error creating inventory" ${error.message}`);
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
}
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
throw new Error("error creating inventory that is not of instance Error");
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
}
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
};
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
||||
export { createInventory };
|
||||
![]() use non-relative import use non-relative import
![]() done done
|
@ -1,4 +1,5 @@
|
||||
import { Account } from "@/src/models/loginModel";
|
||||
import { createInventory } from "@/src/services/inventoryService";
|
||||
import { IDatabaseAccount } from "@/src/types/loginTypes";
|
||||
|
||||
const isCorrectPassword = (requestPassword: string, databasePassword: string): boolean => {
|
||||
@ -6,10 +7,10 @@ const isCorrectPassword = (requestPassword: string, databasePassword: string): b
|
||||
};
|
||||
|
||||
const createAccount = async (accountData: IDatabaseAccount) => {
|
||||
console.log("test", accountData);
|
||||
const account = new Account(accountData);
|
||||
try {
|
||||
await account.save();
|
||||
await createInventory(account._id);
|
||||
return account.toJSON();
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
|
1232
src/types/inventoryTypes.ts
Normal file
@ -1,5 +1,5 @@
|
||||
{
|
||||
"ShipOwnerId": "removed",
|
||||
"ShipOwnerId": "647bce8a1caba352f90b6a09",
|
||||
"Ship": {
|
||||
"Rooms": [
|
||||
{ "Name": "AlchemyRoom", "MaxCapacity": 1600 },
|
||||
@ -9,7 +9,15 @@
|
||||
{ "Name": "OutsideRoom", "MaxCapacity": 1600 },
|
||||
{ "Name": "PersonalQuartersRoom", "MaxCapacity": 1600 }
|
||||
],
|
||||
"ContentUrlSignature": "removed"
|
||||
"ContentUrlSignature": "removed",
|
||||
"Features": [
|
||||
"/Lotus/Types/Items/ShipFeatureItems/EarthNavigationFeatureItem",
|
||||
"/Lotus/Types/Items/ShipFeatureItems/ArsenalFeatureItem",
|
||||
"/Lotus/Types/Items/ShipFeatureItems/SocialMenuFeatureItem",
|
||||
"/Lotus/Types/Items/ShipFeatureItems/ModsFeatureItem",
|
||||
"/Lotus/Types/Items/ShipFeatureItems/FoundryFeatureItem",
|
||||
"/Lotus/Types/Items/ShipFeatureItems/MercuryNavigationFeatureItem"
|
||||
]
|
||||
},
|
||||
"Apartment": {
|
||||
"Rooms": [
|
||||
|
121
static/fixed_responses/new_inventory.json
Normal file
@ -0,0 +1,121 @@
|
||||
{
|
||||
"SubscribedToEmails": 0,
|
||||
"Created": { "$date": { "$numberLong": "1685829131" } },
|
||||
"SubscribedToEmailsPersonalized": 0,
|
||||
"RewardSeed": -5604904486637265640,
|
||||
"CrewMemberBin": { "Slots": 3 },
|
||||
"CrewShipSalvageBin": { "Slots": 8 },
|
||||
"DrifterMelee": [{ "ItemType": "/Lotus/Types/Friendly/PlayerControllable/Weapons/DuviriDualSwords", "ItemId": { "$oid": "647bb619e15fa43f0ee4b1b1" } }],
|
||||
"FusionPoints": 0,
|
||||
"MechBin": { "Slots": 4 },
|
||||
"OperatorAmpBin": { "Slots": 8 },
|
||||
"PveBonusLoadoutBin": { "Slots": 0 },
|
||||
"PvpBonusLoadoutBin": { "Slots": 0 },
|
||||
"RandomModBin": { "Slots": 15 },
|
||||
"RegularCredits": 0,
|
||||
"SentinelBin": { "Slots": 10 },
|
||||
"SpaceSuitBin": { "Slots": 4 },
|
||||
"SpaceWeaponBin": { "Slots": 4 },
|
||||
"SuitBin": { "Slots": 2 },
|
||||
"WeaponBin": { "Slots": 8 },
|
||||
"LastInventorySync": { "$oid": "647bb5d79f963c9d24668257" },
|
||||
"NextRefill": { "$date": { "$numberLong": "1685829131" } },
|
||||
"ActiveLandscapeTraps": [],
|
||||
"ChallengeProgress": [],
|
||||
"CrewMembers": [],
|
||||
"CrewShips": [],
|
||||
"CrewShipHarnesses": [],
|
||||
"CrewShipSalvagedWeapons": [],
|
||||
"CrewShipSalvagedWeaponSkins": [],
|
||||
"CrewShipWeapons": [],
|
||||
"CrewShipWeaponSkins": [],
|
||||
"DataKnives": [],
|
||||
"DrifterGuns": [],
|
||||
"Drones": [],
|
||||
"Horses": [],
|
||||
"Hoverboards": [],
|
||||
"KubrowPets": [],
|
||||
"KubrowPetEggs": [],
|
||||
"KubrowPetPrints": [],
|
||||
"LongGuns": [],
|
||||
"MechSuits": [],
|
||||
"Melee": [],
|
||||
"MoaPets": [],
|
||||
"OperatorAmps": [],
|
||||
"OperatorLoadOuts": [],
|
||||
"AdultOperatorLoadOuts": [],
|
||||
"KahlLoadOuts": [],
|
||||
"PendingRecipes": [],
|
||||
"PersonalGoalProgress": [],
|
||||
"PersonalTechProjects": [],
|
||||
"Pistols": [],
|
||||
"QualifyingInvasions": [],
|
||||
"RepVotes": [],
|
||||
"Scoops": [],
|
||||
"Sentinels": [],
|
||||
"SentinelWeapons": [],
|
||||
"Ships": [],
|
||||
"SpaceGuns": [],
|
||||
"SpaceMelee": [],
|
||||
"SpaceSuits": [],
|
||||
"SpecialItems": [],
|
||||
"StepSequencers": [],
|
||||
"Suits": [],
|
||||
"Upgrades": [],
|
||||
"WeaponSkins": [],
|
||||
"Boosters": [],
|
||||
"Consumables": [],
|
||||
"EmailItems": [],
|
||||
"FlavourItems": [],
|
||||
"FocusUpgrades": [],
|
||||
"FusionTreasures": [],
|
||||
"LeagueTickets": [],
|
||||
"LevelKeys": [],
|
||||
"LoreFragmentScans": [],
|
||||
"MiscItems": [],
|
||||
"PendingSpectreLoadouts": [],
|
||||
"Quests": [],
|
||||
"QuestKeys": [],
|
||||
"RawUpgrades": [],
|
||||
"Recipes": [],
|
||||
"Robotics": [],
|
||||
"ShipDecorations": [],
|
||||
"SpectreLoadouts": [],
|
||||
"XPInfo": [],
|
||||
"CrewShipAmmo": [],
|
||||
"CrewShipRawSalvage": [],
|
||||
"EvolutionProgress": [],
|
||||
"Missions": [],
|
||||
"TauntHistory": [],
|
||||
"CompletedSyndicates": [],
|
||||
"UsedDailyDeals": [],
|
||||
"DailyAffiliation": 16000,
|
||||
"DailyAffiliationPvp": 16000,
|
||||
"DailyAffiliationLibrary": 16000,
|
||||
"DailyAffiliationCetus": 16000,
|
||||
"DailyAffiliationQuills": 16000,
|
||||
"DailyAffiliationSolaris": 16000,
|
||||
"DailyAffiliationVentkids": 16000,
|
||||
"DailyAffiliationVox": 16000,
|
||||
"DailyAffiliationEntrati": 16000,
|
||||
"DailyAffiliationNecraloid": 16000,
|
||||
"DailyAffiliationZariman": 16000,
|
||||
"DailyAffiliationKahl": 16000,
|
||||
"DailyFocus": 250000,
|
||||
"GiftsRemaining": 8,
|
||||
"LibraryAvailableDailyTaskInfo": {
|
||||
"EnemyTypes": ["/Lotus/Types/Enemies/Orokin/OrokinBladeSawmanAvatar"],
|
||||
"EnemyLocTag": "/Lotus/Language/Game/OrokinBladeSawman",
|
||||
"EnemyIcon": "/Lotus/Interface/Icons/Npcs/Orokin/OrokinBladeSawman.png",
|
||||
"ScansRequired": 4,
|
||||
"RewardStoreItem": "/Lotus/StoreItems/Upgrades/Mods/FusionBundles/UncommonFusionBundle",
|
||||
"RewardQuantity": 10,
|
||||
"RewardStanding": 10000
|
||||
},
|
||||
"DuviriInfo": { "Seed": 5898912197983600352, "NumCompletions": 0 },
|
||||
"TradesRemaining": 0,
|
||||
"HasContributedToDojo": false,
|
||||
"HasResetAccount": false,
|
||||
"PendingCoupon": { "Expiry": { "$date": { "$numberLong": "0" } }, "Discount": 0 },
|
||||
"PremiumCreditsFree": 0
|
||||
}
|
145
static/fixed_responses/postTutorialInventory.json
Normal file
@ -0,0 +1,145 @@
|
||||
{
|
||||
"SubscribedToEmails": 0,
|
||||
"Created": { "$date": { "$numberLong": "1685829131" } },
|
||||
"SubscribedToEmailsPersonalized": 0,
|
||||
"RewardSeed": -5604904486637265640,
|
||||
"CrewMemberBin": { "Slots": 3 },
|
||||
"CrewShipSalvageBin": { "Slots": 8 },
|
||||
"DrifterMelee": [{ "ItemType": "/Lotus/Types/Friendly/PlayerControllable/Weapons/DuviriDualSwords", "ItemId": { "$oid": "647bd268c547fe5b2909e715" } }],
|
||||
"FusionPoints": 0,
|
||||
"MechBin": { "Slots": 4 },
|
||||
"OperatorAmpBin": { "Slots": 8 },
|
||||
"PveBonusLoadoutBin": { "Slots": 0 },
|
||||
"PvpBonusLoadoutBin": { "Slots": 0 },
|
||||
"RandomModBin": { "Slots": 15 },
|
||||
"RegularCredits": 3000,
|
||||
"SentinelBin": { "Slots": 10 },
|
||||
"SpaceSuitBin": { "Slots": 4 },
|
||||
"SpaceWeaponBin": { "Slots": 4 },
|
||||
"SuitBin": { "Slots": 1 },
|
||||
"WeaponBin": { "Slots": 5 },
|
||||
"DailyAffiliation": 16000,
|
||||
"DailyAffiliationCetus": 16000,
|
||||
"DailyAffiliationEntrati": 16000,
|
||||
"DailyAffiliationKahl": 16000,
|
||||
"DailyAffiliationLibrary": 16000,
|
||||
"DailyAffiliationNecraloid": 16000,
|
||||
"DailyAffiliationPvp": 16000,
|
||||
"DailyAffiliationQuills": 16000,
|
||||
"DailyAffiliationSolaris": 16000,
|
||||
"DailyAffiliationVentkids": 16000,
|
||||
"DailyAffiliationVox": 16000,
|
||||
"DailyAffiliationZariman": 16000,
|
||||
"DailyFocus": 250000,
|
||||
"DuviriInfo": { "Seed": 5898912197983600352, "NumCompletions": 0 },
|
||||
"GiftsRemaining": 8,
|
||||
"TradesRemaining": 0,
|
||||
"Recipes": [{ "ItemCount": 1, "ItemType": "/Lotus/Types/Recipes/Weapons/BoltonfaBlueprint" }],
|
||||
"SeasonChallengeHistory": [
|
||||
{ "challenge": "SeasonDailySolveCiphers", "id": "001000220000000000000308" },
|
||||
{ "challenge": "SeasonDailyVisitFeaturedDojo", "id": "001000230000000000000316" },
|
||||
{ "challenge": "SeasonDailyKillEnemiesWithRadiation", "id": "001000230000000000000317" },
|
||||
{ "challenge": "SeasonWeeklyCompleteSortie", "id": "001000230000000000000309" },
|
||||
{ "challenge": "SeasonWeeklyVenusBounties", "id": "001000230000000000000310" },
|
||||
{ "challenge": "SeasonWeeklyZarimanBountyHunter", "id": "001000230000000000000311" },
|
||||
{ "challenge": "SeasonWeeklyCatchRarePlainsFish", "id": "001000230000000000000312" },
|
||||
{ "challenge": "SeasonWeeklyKillArchgunEnemies", "id": "001000230000000000000313" },
|
||||
{ "challenge": "SeasonWeeklyHardKillSilverGroveSpecters", "id": "001000230000000000000314" },
|
||||
{ "challenge": "SeasonWeeklyHardKillRopalolyst", "id": "001000230000000000000315" }
|
||||
],
|
||||
"StoryModeChoice": "WARFRAME",
|
||||
"ChallengeProgress": [{ "Progress": 2, "Name": "EMGetKills" }],
|
||||
"ChallengesFixVersion": 6,
|
||||
"ActiveQuest": "/Lotus/Types/Keys/VorsPrize/VorsPrizeQuestKeyChain",
|
||||
"Consumables": [{ "ItemCount": 1, "ItemType": "/Lotus/Types/Restoratives/LisetAutoHack" }],
|
||||
"DataKnives": [{ "ItemType": "/Lotus/Weapons/Tenno/HackingDevices/TnHackingDevice/TnHackingDeviceWeapon", "XP": 450000, "ItemId": { "$oid": "647bd274f22fc794a2cd3d33" } }],
|
||||
"FlavourItems": [
|
||||
{ "ItemType": "/Lotus/Types/StoreItems/AvatarImages/AvatarImageItem1" },
|
||||
{ "ItemType": "/Lotus/Types/StoreItems/AvatarImages/AvatarImageItem2" },
|
||||
{ "ItemType": "/Lotus/Types/StoreItems/AvatarImages/AvatarImageItem3" },
|
||||
{ "ItemType": "/Lotus/Types/StoreItems/AvatarImages/AvatarImageItem4" }
|
||||
],
|
||||
"LongGuns": [{ "ItemType": "/Lotus/Weapons/MK1Series/MK1Paris", "XP": 0, "Configs": [{}, {}, {}], "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
|
||||
"Melee": [{ "ItemType": "/Lotus/Weapons/Tenno/Melee/LongSword/LongSword", "XP": 0, "Configs": [{}, {}, {}], "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
|
||||
"Pistols": [{ "ItemType": "/Lotus/Weapons/MK1Series/MK1Kunai", "XP": 0, "Configs": [{}, {}, {}], "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
|
||||
"PlayedParkourTutorial": true,
|
||||
"PremiumCreditsFree": 50,
|
||||
"QuestKeys": [{ "ItemType": "/Lotus/Types/Keys/VorsPrize/VorsPrizeQuestKeyChain" }],
|
||||
"RawUpgrades": [{ "ItemCount": 1, "LastAdded": { "$oid": "6450f9bfe0714a4d6703f05f" }, "ItemType": "/Lotus/Upgrades/Mods/Warframe/AvatarShieldMaxMod" }],
|
||||
"ReceivedStartingGear": true,
|
||||
"Scoops": [{ "ItemType": "/Lotus/Weapons/Tenno/Speedball/SpeedballWeaponTest", "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
|
||||
"Ships": [{ "ItemType": "/Lotus/Types/Items/Ships/DefaultShip", "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
|
||||
"Suits": [{ "ItemType": "/Lotus/Powersuits/Volt/Volt", "XP": 0, "Configs": [{}, {}, {}], "UpgradeVer": 101, "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
|
||||
"TrainingRetriesLeft": 0,
|
||||
"WeaponSkins": [{ "ItemType": "/Lotus/Upgrades/Skins/Volt/VoltHelmet", "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
|
||||
"LastInventorySync": { "$oid": "647bd27cf856530b4f3bf343" },
|
||||
"NextRefill": { "$date": { "$numberLong": "1685829131" } },
|
||||
"ActiveLandscapeTraps": [],
|
||||
"CrewMembers": [],
|
||||
"CrewShips": [],
|
||||
"CrewShipHarnesses": [],
|
||||
"CrewShipSalvagedWeapons": [],
|
||||
"CrewShipSalvagedWeaponSkins": [],
|
||||
"CrewShipWeapons": [],
|
||||
"CrewShipWeaponSkins": [],
|
||||
"DrifterGuns": [],
|
||||
"Drones": [],
|
||||
"Horses": [],
|
||||
"Hoverboards": [],
|
||||
"KubrowPets": [],
|
||||
"KubrowPetEggs": [],
|
||||
"KubrowPetPrints": [],
|
||||
"MechSuits": [],
|
||||
"MoaPets": [],
|
||||
"OperatorAmps": [],
|
||||
"OperatorLoadOuts": [],
|
||||
"AdultOperatorLoadOuts": [],
|
||||
"KahlLoadOuts": [],
|
||||
"PendingRecipes": [],
|
||||
"PersonalGoalProgress": [],
|
||||
"PersonalTechProjects": [],
|
||||
"QualifyingInvasions": [],
|
||||
"RepVotes": [],
|
||||
"Sentinels": [],
|
||||
"SentinelWeapons": [],
|
||||
"SpaceGuns": [],
|
||||
"SpaceMelee": [],
|
||||
"SpaceSuits": [],
|
||||
"SpecialItems": [],
|
||||
"StepSequencers": [],
|
||||
"Upgrades": [],
|
||||
"Boosters": [],
|
||||
"EmailItems": [],
|
||||
"FocusUpgrades": [],
|
||||
"FusionTreasures": [],
|
||||
"LeagueTickets": [],
|
||||
"LevelKeys": [],
|
||||
"LoreFragmentScans": [],
|
||||
"MiscItems": [],
|
||||
"PendingSpectreLoadouts": [],
|
||||
"Quests": [],
|
||||
"Robotics": [],
|
||||
"ShipDecorations": [],
|
||||
"SpectreLoadouts": [],
|
||||
"XPInfo": [],
|
||||
"CrewShipAmmo": [],
|
||||
"CrewShipRawSalvage": [],
|
||||
"EvolutionProgress": [],
|
||||
"Missions": [],
|
||||
"TauntHistory": [],
|
||||
"CompletedSyndicates": [],
|
||||
"UsedDailyDeals": [],
|
||||
"LibraryAvailableDailyTaskInfo": {
|
||||
"EnemyTypes": ["/Lotus/Types/Enemies/Orokin/OrokinBladeSawmanAvatar"],
|
||||
"EnemyLocTag": "/Lotus/Language/Game/OrokinBladeSawman",
|
||||
"EnemyIcon": "/Lotus/Interface/Icons/Npcs/Orokin/OrokinBladeSawman.png",
|
||||
"ScansRequired": 4,
|
||||
"RewardStoreItem": "/Lotus/StoreItems/Upgrades/Mods/FusionBundles/UncommonFusionBundle",
|
||||
"RewardQuantity": 10,
|
||||
"RewardStanding": 10000
|
||||
},
|
||||
"HasContributedToDojo": false,
|
||||
"HasResetAccount": false,
|
||||
"PendingCoupon": { "Expiry": { "$date": { "$numberLong": "0" } }, "Discount": 0 },
|
||||
"PremiumCredits": 50
|
||||
}
|
i dont think the comment is necessary
i dont think the comment is necessary
check if inventory is undefined before trying
toJson()
check if inventory is undefined before trying
toJson()
it is important, because it is not present in the original response.
it is important, because it is not present in the original response.
?. checks for undefined!
?. checks for undefined!
this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
that's why you check before so you dont two undefined checks
that's why you check before so you dont two undefined checks
it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
good suggestion!
good suggestion!
I understand now what you mean
I understand now what you mean
should that belong then inside inventoryModel.ts?
should that belong then inside inventoryModel.ts?