chore: npm audit fix #579
							
								
								
									
										54
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										54
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@ -235,9 +235,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/@mongodb-js/saslprep": {
 | 
					    "node_modules/@mongodb-js/saslprep": {
 | 
				
			||||||
      "version": "1.1.7",
 | 
					      "version": "1.1.9",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.7.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz",
 | 
				
			||||||
      "integrity": "sha512-dCHW/oEX0KJ4NjDULBo3JiOaK5+6axtpBbS+ao2ZInoAL9/YRQLhXzSNAFz7hP4nzLkIqsfYAK/PDE3+XHny0Q==",
 | 
					      "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==",
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "sparse-bitfield": "^3.0.3"
 | 
					        "sparse-bitfield": "^3.0.3"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@ -980,9 +980,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/bson": {
 | 
					    "node_modules/bson": {
 | 
				
			||||||
      "version": "6.8.0",
 | 
					      "version": "6.10.1",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.1.tgz",
 | 
				
			||||||
      "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==",
 | 
					      "integrity": "sha512-P92xmHDQjSKPLHqFxefqMxASNq/aWJMEZugpCjf+AF/pgcUpMMQCg7t7+ewko0/u8AapvF3luf/FoehddEK+sA==",
 | 
				
			||||||
      "engines": {
 | 
					      "engines": {
 | 
				
			||||||
        "node": ">=16.20.1"
 | 
					        "node": ">=16.20.1"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@ -1174,9 +1174,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/cookie": {
 | 
					    "node_modules/cookie": {
 | 
				
			||||||
      "version": "0.6.0",
 | 
					      "version": "0.7.1",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
 | 
				
			||||||
      "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
 | 
					      "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
 | 
				
			||||||
      "engines": {
 | 
					      "engines": {
 | 
				
			||||||
        "node": ">= 0.6"
 | 
					        "node": ">= 0.6"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@ -1219,9 +1219,9 @@
 | 
				
			|||||||
      "dev": true
 | 
					      "dev": true
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/cross-spawn": {
 | 
					    "node_modules/cross-spawn": {
 | 
				
			||||||
      "version": "7.0.3",
 | 
					      "version": "7.0.6",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
 | 
				
			||||||
      "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
 | 
					      "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
 | 
				
			||||||
      "dev": true,
 | 
					      "dev": true,
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "path-key": "^3.1.0",
 | 
					        "path-key": "^3.1.0",
 | 
				
			||||||
@ -1592,15 +1592,15 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/express": {
 | 
					    "node_modules/express": {
 | 
				
			||||||
      "version": "5.0.0",
 | 
					      "version": "5.0.1",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/express/-/express-5.0.0.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/express/-/express-5.0.1.tgz",
 | 
				
			||||||
      "integrity": "sha512-V4UkHQc+B7ldh1YC84HCXHwf60M4BOMvp9rkvTUWCK5apqDC1Esnbid4wm6nFyVuDy8XMfETsJw5lsIGBWyo0A==",
 | 
					      "integrity": "sha512-ORF7g6qGnD+YtUG9yx4DFoqCShNMmUKiXuT5oWMHiOvt/4WFbHC6yCwQMTSBMno7AqntNCAzzcnnjowRkTL9eQ==",
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "accepts": "^2.0.0",
 | 
					        "accepts": "^2.0.0",
 | 
				
			||||||
        "body-parser": "^2.0.1",
 | 
					        "body-parser": "^2.0.1",
 | 
				
			||||||
        "content-disposition": "^1.0.0",
 | 
					        "content-disposition": "^1.0.0",
 | 
				
			||||||
        "content-type": "~1.0.4",
 | 
					        "content-type": "~1.0.4",
 | 
				
			||||||
        "cookie": "0.6.0",
 | 
					        "cookie": "0.7.1",
 | 
				
			||||||
        "cookie-signature": "^1.2.1",
 | 
					        "cookie-signature": "^1.2.1",
 | 
				
			||||||
        "debug": "4.3.6",
 | 
					        "debug": "4.3.6",
 | 
				
			||||||
        "depd": "2.0.0",
 | 
					        "depd": "2.0.0",
 | 
				
			||||||
@ -2453,12 +2453,12 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/mongodb": {
 | 
					    "node_modules/mongodb": {
 | 
				
			||||||
      "version": "6.6.2",
 | 
					      "version": "6.12.0",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.6.2.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.12.0.tgz",
 | 
				
			||||||
      "integrity": "sha512-ZF9Ugo2JCG/GfR7DEb4ypfyJJyiKbg5qBYKRintebj8+DNS33CyGMkWbrS9lara+u+h+yEOGSRiLhFO/g1s1aw==",
 | 
					      "integrity": "sha512-RM7AHlvYfS7jv7+BXund/kR64DryVI+cHbVAy9P61fnb1RcWZqOW1/Wj2YhqMCx+MuYhqTRGv7AwHBzmsCKBfA==",
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "@mongodb-js/saslprep": "^1.1.5",
 | 
					        "@mongodb-js/saslprep": "^1.1.9",
 | 
				
			||||||
        "bson": "^6.7.0",
 | 
					        "bson": "^6.10.1",
 | 
				
			||||||
        "mongodb-connection-string-url": "^3.0.0"
 | 
					        "mongodb-connection-string-url": "^3.0.0"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "engines": {
 | 
					      "engines": {
 | 
				
			||||||
@ -2466,7 +2466,7 @@
 | 
				
			|||||||
      },
 | 
					      },
 | 
				
			||||||
      "peerDependencies": {
 | 
					      "peerDependencies": {
 | 
				
			||||||
        "@aws-sdk/credential-providers": "^3.188.0",
 | 
					        "@aws-sdk/credential-providers": "^3.188.0",
 | 
				
			||||||
        "@mongodb-js/zstd": "^1.1.0",
 | 
					        "@mongodb-js/zstd": "^1.1.0 || ^2.0.0",
 | 
				
			||||||
        "gcp-metadata": "^5.2.0",
 | 
					        "gcp-metadata": "^5.2.0",
 | 
				
			||||||
        "kerberos": "^2.0.1",
 | 
					        "kerberos": "^2.0.1",
 | 
				
			||||||
        "mongodb-client-encryption": ">=6.0.0 <7",
 | 
					        "mongodb-client-encryption": ">=6.0.0 <7",
 | 
				
			||||||
@ -2507,13 +2507,13 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/mongoose": {
 | 
					    "node_modules/mongoose": {
 | 
				
			||||||
      "version": "8.4.5",
 | 
					      "version": "8.9.0",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.4.5.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.9.0.tgz",
 | 
				
			||||||
      "integrity": "sha512-E5KjBThxST2uFSKKXuiMa9H9Zx4DLTSLuxodAnIzJRixNwc1ARTlJUK1m0a80EB+ZKGP4QNTasyUYRG9DUSHOA==",
 | 
					      "integrity": "sha512-b58zY3PLNBcoz6ZXFckr0leJcVVBMAOBvD+7Bj2ZjghAwntXmNnqwlDixTKQU3UYoQIGTv+AQx/0ThsvaeVrCA==",
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "bson": "^6.7.0",
 | 
					        "bson": "^6.10.1",
 | 
				
			||||||
        "kareem": "2.6.3",
 | 
					        "kareem": "2.6.3",
 | 
				
			||||||
        "mongodb": "6.6.2",
 | 
					        "mongodb": "~6.12.0",
 | 
				
			||||||
        "mpath": "0.9.0",
 | 
					        "mpath": "0.9.0",
 | 
				
			||||||
        "mquery": "5.0.0",
 | 
					        "mquery": "5.0.0",
 | 
				
			||||||
        "ms": "2.1.3",
 | 
					        "ms": "2.1.3",
 | 
				
			||||||
 | 
				
			|||||||
@ -6,7 +6,7 @@ import { config } from "@/src/services/configService";
 | 
				
			|||||||
import allDialogue from "@/static/fixed_responses/allDialogue.json";
 | 
					import allDialogue from "@/static/fixed_responses/allDialogue.json";
 | 
				
			||||||
import allMissions from "@/static/fixed_responses/allMissions.json";
 | 
					import allMissions from "@/static/fixed_responses/allMissions.json";
 | 
				
			||||||
import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
 | 
					import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
 | 
				
			||||||
import { IInventoryDatabase, IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
					import { IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
import { IPolarity, ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
					import { IPolarity, ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
				
			||||||
import { ExportCustoms, ExportFlavour, ExportKeys, ExportResources } from "warframe-public-export-plus";
 | 
					import { ExportCustoms, ExportFlavour, ExportKeys, ExportResources } from "warframe-public-export-plus";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -30,7 +30,7 @@ const inventoryController: RequestHandler = async (request, response) => {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //TODO: make a function that converts from database representation to client
 | 
					    //TODO: make a function that converts from database representation to client
 | 
				
			||||||
    const inventoryJSON: IInventoryDatabase = inventory.toJSON();
 | 
					    const inventoryJSON = inventory.toJSON();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const inventoryResponse = toInventoryResponse(inventoryJSON);
 | 
					    const inventoryResponse = toInventoryResponse(inventoryJSON);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,9 @@
 | 
				
			|||||||
import { IOid } from "@/src/types/commonTypes";
 | 
					import { IOid } from "@/src/types/commonTypes";
 | 
				
			||||||
import { IInventoryDatabase, IInventoryResponse } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
					import { IInventoryResponse } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
import { Types } from "mongoose";
 | 
					import { Types } from "mongoose";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//TODO: this needs to be addressed: a schema's toJSON is responsible for changing Oid and Date to their corresponding Response versions __id to "ItemId":{"$oid":"6450f720bc562ebf030222d4"}, and a Date to "date":{"$date":{"$numberLong":"unix timestamp"})
 | 
					//TODO: this needs to be addressed: a schema's toJSON is responsible for changing Oid and Date to their corresponding Response versions __id to "ItemId":{"$oid":"6450f720bc562ebf030222d4"}, and a Date to "date":{"$date":{"$numberLong":"unix timestamp"})
 | 
				
			||||||
export const toInventoryResponse = (inventoryDatabase: IInventoryDatabase): IInventoryResponse => {
 | 
					export const toInventoryResponse = (inventoryDatabase: { accountOwnerId: Types.ObjectId }): IInventoryResponse => {
 | 
				
			||||||
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | 
					    // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | 
				
			||||||
    const { accountOwnerId, ...inventoryResponse } = inventoryDatabase;
 | 
					    const { accountOwnerId, ...inventoryResponse } = inventoryDatabase;
 | 
				
			||||||
    return inventoryResponse as unknown as IInventoryResponse;
 | 
					    return inventoryResponse as unknown as IInventoryResponse;
 | 
				
			||||||
 | 
				
			|||||||
@ -369,7 +369,7 @@ export const addPowerSuit = async (powersuitName: string, accountId: string): Pr
 | 
				
			|||||||
    const inventory = await getInventory(accountId);
 | 
					    const inventory = await getInventory(accountId);
 | 
				
			||||||
    const suitIndex = inventory.Suits.push({ ItemType: powersuitName, Configs: [], UpgradeVer: 101, XP: 0 });
 | 
					    const suitIndex = inventory.Suits.push({ ItemType: powersuitName, Configs: [], UpgradeVer: 101, XP: 0 });
 | 
				
			||||||
    const changedInventory = await inventory.save();
 | 
					    const changedInventory = await inventory.save();
 | 
				
			||||||
    return changedInventory.Suits[suitIndex - 1].toJSON();
 | 
					    return changedInventory.Suits[suitIndex - 1].toJSON() as object as IEquipmentClient;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						
							
	
	
	
	
	
	
	
	 | 
				|||||||
 | 
					
 | 
				
			||||||
export const addMechSuit = async (mechsuitName: string, accountId: string) => {
 | 
					export const addMechSuit = async (mechsuitName: string, accountId: string) => {
 | 
				
			||||||
@ -527,7 +527,7 @@ export const addEquipment = async (
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const changedInventory = await inventory.save();
 | 
					    const changedInventory = await inventory.save();
 | 
				
			||||||
    return changedInventory[category][index - 1].toJSON();
 | 
					    return changedInventory[category][index - 1].toJSON() as object as IEquipmentClient;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const addCustomization = async (customizatonName: string, accountId: string): Promise<IFlavourItem> => {
 | 
					export const addCustomization = async (customizatonName: string, accountId: string): Promise<IFlavourItem> => {
 | 
				
			||||||
@ -541,7 +541,7 @@ export const addSkin = async (typeName: string, accountId: string): Promise<IWea
 | 
				
			|||||||
    const inventory = await getInventory(accountId);
 | 
					    const inventory = await getInventory(accountId);
 | 
				
			||||||
    const index = inventory.WeaponSkins.push({ ItemType: typeName }) - 1;
 | 
					    const index = inventory.WeaponSkins.push({ ItemType: typeName }) - 1;
 | 
				
			||||||
    const changedInventory = await inventory.save();
 | 
					    const changedInventory = await inventory.save();
 | 
				
			||||||
    return changedInventory.WeaponSkins[index].toJSON();
 | 
					    return changedInventory.WeaponSkins[index].toJSON() as object as IWeaponSkinClient;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const addGearExpByCategory = (
 | 
					const addGearExpByCategory = (
 | 
				
			||||||
 | 
				
			|||||||
@ -1,12 +1,13 @@
 | 
				
			|||||||
import { Schema, Types } from "mongoose";
 | 
					import { Schema, Types } from "mongoose";
 | 
				
			||||||
import { IOid } from "@/src/types/commonTypes";
 | 
					import { IOid } from "@/src/types/commonTypes";
 | 
				
			||||||
import { IColor } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
					import { IColor } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
				
			||||||
 | 
					import { ILoadoutClient } from "./saveLoadoutTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IGetShipResponse {
 | 
					export interface IGetShipResponse {
 | 
				
			||||||
    ShipOwnerId: string;
 | 
					    ShipOwnerId: string;
 | 
				
			||||||
    Ship: IShip;
 | 
					    Ship: IShip;
 | 
				
			||||||
    Apartment: IApartment;
 | 
					    Apartment: IApartment;
 | 
				
			||||||
    LoadOutInventory: { LoadOutPresets: Types.ObjectId };
 | 
					    LoadOutInventory: { LoadOutPresets: ILoadoutClient };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IShipAttachments {
 | 
					export interface IShipAttachments {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	
🛠️ Refactor suggestion
Simplify the type assertion chain
The double type assertion
as object as IEquipmentClientis unnecessarily verbose. SincetoJSON()already returns an object, you can directly assert toIEquipmentClient.📝 Committable suggestion
Kill yourself
@Sainan, understood. If there's anything else I can assist you with, please let me know.