Merge branch 'inbox' of https://github.com/spaceninjaserver/SpaceNinjaServer into inbox
This commit is contained in:
		
						commit
						08eb2b122b
					
				@ -1,6 +1,6 @@
 | 
				
			|||||||
import { RequestHandler } from "express";
 | 
					import { RequestHandler } from "express";
 | 
				
			||||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
					import { getAccountForRequest } from "@/src/services/loginService";
 | 
				
			||||||
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
 | 
					import { Inventory, TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
				
			||||||
import { config } from "@/src/services/configService";
 | 
					import { config } from "@/src/services/configService";
 | 
				
			||||||
import allDialogue from "@/static/fixed_responses/allDialogue.json";
 | 
					import allDialogue from "@/static/fixed_responses/allDialogue.json";
 | 
				
			||||||
import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
 | 
					import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
 | 
				
			||||||
@ -51,6 +51,13 @@ export const inventoryController: RequestHandler = async (request, response) =>
 | 
				
			|||||||
        await inventory.save();
 | 
					        await inventory.save();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response.json(await getInventoryResponse(inventory, "xpBasedLevelCapDisabled" in request.query));
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const getInventoryResponse = async (
 | 
				
			||||||
 | 
					    inventory: TInventoryDatabaseDocument,
 | 
				
			||||||
 | 
					    xpBasedLevelCapDisabled: boolean
 | 
				
			||||||
 | 
					): Promise<IInventoryClient> => {
 | 
				
			||||||
    const inventoryWithLoadOutPresets = await inventory.populate<{ LoadOutPresets: ILoadoutDatabase }>(
 | 
					    const inventoryWithLoadOutPresets = await inventory.populate<{ LoadOutPresets: ILoadoutDatabase }>(
 | 
				
			||||||
        "LoadOutPresets"
 | 
					        "LoadOutPresets"
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
@ -175,7 +182,7 @@ export const inventoryController: RequestHandler = async (request, response) =>
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) {
 | 
					    if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) {
 | 
				
			||||||
        inventoryResponse.PlayerLevel = config.spoofMasteryRank;
 | 
					        inventoryResponse.PlayerLevel = config.spoofMasteryRank;
 | 
				
			||||||
        if (!("xpBasedLevelCapDisabled" in request.query)) {
 | 
					        if (!xpBasedLevelCapDisabled) {
 | 
				
			||||||
            // This client has not been patched to accept any mastery rank, need to fake the XP.
 | 
					            // This client has not been patched to accept any mastery rank, need to fake the XP.
 | 
				
			||||||
            inventoryResponse.XPInfo = [];
 | 
					            inventoryResponse.XPInfo = [];
 | 
				
			||||||
            let numFrames = getExpRequiredForMr(Math.min(config.spoofMasteryRank, 5030)) / 6000;
 | 
					            let numFrames = getExpRequiredForMr(Math.min(config.spoofMasteryRank, 5030)) / 6000;
 | 
				
			||||||
@ -252,7 +259,7 @@ export const inventoryController: RequestHandler = async (request, response) =>
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    inventoryResponse.LastInventorySync = toOid(new Types.ObjectId());
 | 
					    inventoryResponse.LastInventorySync = toOid(new Types.ObjectId());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    response.json(inventoryResponse);
 | 
					    return inventoryResponse;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const addString = (arr: string[], str: string): void => {
 | 
					const addString = (arr: string[], str: string): void => {
 | 
				
			||||||
 | 
				
			|||||||
@ -8,6 +8,7 @@ import {
 | 
				
			|||||||
    calculateFinalCredits
 | 
					    calculateFinalCredits
 | 
				
			||||||
} from "@/src/services/missionInventoryUpdateService";
 | 
					} from "@/src/services/missionInventoryUpdateService";
 | 
				
			||||||
import { getInventory } from "@/src/services/inventoryService";
 | 
					import { getInventory } from "@/src/services/inventoryService";
 | 
				
			||||||
 | 
					import { getInventoryResponse } from "./inventoryController";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
**** INPUT ****
 | 
					**** INPUT ****
 | 
				
			||||||
@ -58,9 +59,12 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
 | 
				
			|||||||
    const inventoryUpdates = addMissionInventoryUpdates(inventory, missionReport);
 | 
					    const inventoryUpdates = addMissionInventoryUpdates(inventory, missionReport);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (missionReport.MissionStatus !== "GS_SUCCESS") {
 | 
					    if (missionReport.MissionStatus !== "GS_SUCCESS") {
 | 
				
			||||||
        const InventoryJson = JSON.stringify((await inventory.save()).toJSON());
 | 
					        await inventory.save();
 | 
				
			||||||
 | 
					        const inventoryResponse = await getInventoryResponse(inventory, true);
 | 
				
			||||||
        res.json({ InventoryJson, MissionRewards: [] });
 | 
					        res.json({
 | 
				
			||||||
 | 
					            InventoryJson: JSON.stringify(inventoryResponse),
 | 
				
			||||||
 | 
					            MissionRewards: []
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    const missionRewardsResults = await addMissionRewards(inventory, missionReport);
 | 
					    const missionRewardsResults = await addMissionRewards(inventory, missionReport);
 | 
				
			||||||
@ -76,11 +80,12 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
 | 
				
			|||||||
        rngRewardCredits: inventoryChanges.RegularCredits as number
 | 
					        rngRewardCredits: inventoryChanges.RegularCredits as number
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const InventoryJson = JSON.stringify((await inventory.save()).toJSON());
 | 
					    await inventory.save();
 | 
				
			||||||
 | 
					    const inventoryResponse = await getInventoryResponse(inventory, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //TODO: figure out when to send inventory. it is needed for many cases.
 | 
					    //TODO: figure out when to send inventory. it is needed for many cases.
 | 
				
			||||||
    res.json({
 | 
					    res.json({
 | 
				
			||||||
        InventoryJson,
 | 
					        InventoryJson: JSON.stringify(inventoryResponse),
 | 
				
			||||||
        InventoryChanges: inventoryChanges,
 | 
					        InventoryChanges: inventoryChanges,
 | 
				
			||||||
        MissionRewards,
 | 
					        MissionRewards,
 | 
				
			||||||
        ...credits,
 | 
					        ...credits,
 | 
				
			||||||
 | 
				
			|||||||
@ -51,10 +51,14 @@ import {
 | 
				
			|||||||
    ICompletedDialogue,
 | 
					    ICompletedDialogue,
 | 
				
			||||||
    IDialogueClient,
 | 
					    IDialogueClient,
 | 
				
			||||||
    IUpgradeDatabase,
 | 
					    IUpgradeDatabase,
 | 
				
			||||||
    ICrewShipDatabase,
 | 
					 | 
				
			||||||
    ICrewShipMemberDatabase,
 | 
					    ICrewShipMemberDatabase,
 | 
				
			||||||
    ICrewShipMemberClient,
 | 
					    ICrewShipMemberClient,
 | 
				
			||||||
    IMailboxClient
 | 
					    IMailboxClient
 | 
				
			||||||
 | 
					    TEquipmentKey,
 | 
				
			||||||
 | 
					    equipmentKeys,
 | 
				
			||||||
 | 
					    IKubrowPetDetailsDatabase,
 | 
				
			||||||
 | 
					    ITraits,
 | 
				
			||||||
 | 
					    IKubrowPetDetailsClient
 | 
				
			||||||
} from "../../types/inventoryTypes/inventoryTypes";
 | 
					} from "../../types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
import { IOid } from "../../types/commonTypes";
 | 
					import { IOid } from "../../types/commonTypes";
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
@ -224,55 +228,6 @@ ArchonCrystalUpgradeSchema.set("toJSON", {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const EquipmentSchema = new Schema<IEquipmentDatabase>(
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        ItemType: String,
 | 
					 | 
				
			||||||
        Configs: [ItemConfigSchema],
 | 
					 | 
				
			||||||
        UpgradeVer: Number,
 | 
					 | 
				
			||||||
        XP: Number,
 | 
					 | 
				
			||||||
        Features: Number,
 | 
					 | 
				
			||||||
        Polarized: Number,
 | 
					 | 
				
			||||||
        Polarity: [polaritySchema],
 | 
					 | 
				
			||||||
        FocusLens: String,
 | 
					 | 
				
			||||||
        ModSlotPurchases: Number,
 | 
					 | 
				
			||||||
        CustomizationSlotPurchases: Number,
 | 
					 | 
				
			||||||
        UpgradeType: String,
 | 
					 | 
				
			||||||
        UpgradeFingerprint: String,
 | 
					 | 
				
			||||||
        ItemName: String,
 | 
					 | 
				
			||||||
        InfestationDate: Date,
 | 
					 | 
				
			||||||
        InfestationDays: Number,
 | 
					 | 
				
			||||||
        InfestationType: String,
 | 
					 | 
				
			||||||
        ModularParts: { type: [String], default: undefined },
 | 
					 | 
				
			||||||
        UnlockLevel: Number,
 | 
					 | 
				
			||||||
        Expiry: Date,
 | 
					 | 
				
			||||||
        SkillTree: String,
 | 
					 | 
				
			||||||
        OffensiveUpgrade: String,
 | 
					 | 
				
			||||||
        DefensiveUpgrade: String,
 | 
					 | 
				
			||||||
        UpgradesExpiry: Date,
 | 
					 | 
				
			||||||
        ArchonCrystalUpgrades: { type: [ArchonCrystalUpgradeSchema], default: undefined }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    { id: false }
 | 
					 | 
				
			||||||
);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
EquipmentSchema.virtual("ItemId").get(function () {
 | 
					 | 
				
			||||||
    return { $oid: this._id.toString() } satisfies IOid;
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
EquipmentSchema.set("toJSON", {
 | 
					 | 
				
			||||||
    virtuals: true,
 | 
					 | 
				
			||||||
    transform(_document, returnedObject) {
 | 
					 | 
				
			||||||
        delete returnedObject._id;
 | 
					 | 
				
			||||||
        delete returnedObject.__v;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        const db = returnedObject as IEquipmentDatabase;
 | 
					 | 
				
			||||||
        const client = returnedObject as IEquipmentClient;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (db.InfestationDate) {
 | 
					 | 
				
			||||||
            client.InfestationDate = toMongoDate(db.InfestationDate);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const boosterSchema = new Schema<IBooster>(
 | 
					const boosterSchema = new Schema<IBooster>(
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        ExpiryDate: Number,
 | 
					        ExpiryDate: Number,
 | 
				
			||||||
@ -502,31 +457,6 @@ const helminthResourceSchema = new Schema<IHelminthResource>(
 | 
				
			|||||||
    { _id: false }
 | 
					    { _id: false }
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const infestedFoundrySchema = new Schema<IInfestedFoundryDatabase>(
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        Name: String,
 | 
					 | 
				
			||||||
        Resources: { type: [helminthResourceSchema], default: undefined },
 | 
					 | 
				
			||||||
        Slots: Number,
 | 
					 | 
				
			||||||
        XP: Number,
 | 
					 | 
				
			||||||
        ConsumedSuits: { type: [consumedSchuitsSchema], default: undefined },
 | 
					 | 
				
			||||||
        InvigorationIndex: Number,
 | 
					 | 
				
			||||||
        InvigorationSuitOfferings: { type: [String], default: undefined },
 | 
					 | 
				
			||||||
        InvigorationsApplied: Number,
 | 
					 | 
				
			||||||
        LastConsumedSuit: { type: EquipmentSchema, default: undefined },
 | 
					 | 
				
			||||||
        AbilityOverrideUnlockCooldown: Date
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    { _id: false }
 | 
					 | 
				
			||||||
);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
infestedFoundrySchema.set("toJSON", {
 | 
					 | 
				
			||||||
    transform(_doc, ret, _options) {
 | 
					 | 
				
			||||||
        if (ret.AbilityOverrideUnlockCooldown) {
 | 
					 | 
				
			||||||
            // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
 | 
					 | 
				
			||||||
            ret.AbilityOverrideUnlockCooldown = toMongoDate(ret.AbilityOverrideUnlockCooldown);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const questProgressSchema = new Schema<IQuestStage>({
 | 
					const questProgressSchema = new Schema<IQuestStage>({
 | 
				
			||||||
    c: Number,
 | 
					    c: Number,
 | 
				
			||||||
    i: Boolean,
 | 
					    i: Boolean,
 | 
				
			||||||
@ -712,26 +642,6 @@ const crewShipMembersSchema = new Schema<ICrewShipMembersDatabase>(
 | 
				
			|||||||
    { _id: false }
 | 
					    { _id: false }
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const crewShipSchema = new Schema<ICrewShipDatabase>({
 | 
					 | 
				
			||||||
    ItemType: { type: String, required: true },
 | 
					 | 
				
			||||||
    Configs: { type: [ItemConfigSchema], default: [] },
 | 
					 | 
				
			||||||
    Weapon: { type: crewShipWeaponSchema, default: undefined },
 | 
					 | 
				
			||||||
    Customization: { type: crewShipCustomizationSchema, default: undefined },
 | 
					 | 
				
			||||||
    ItemName: { type: String, default: "" },
 | 
					 | 
				
			||||||
    RailjackImage: { type: FlavourItemSchema, default: undefined },
 | 
					 | 
				
			||||||
    CrewMembers: { type: crewShipMembersSchema, default: undefined }
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
crewShipSchema.virtual("ItemId").get(function () {
 | 
					 | 
				
			||||||
    return { $oid: this._id.toString() };
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
crewShipSchema.set("toJSON", {
 | 
					 | 
				
			||||||
    virtuals: true,
 | 
					 | 
				
			||||||
    transform(_doc, ret, _options) {
 | 
					 | 
				
			||||||
        delete ret._id;
 | 
					 | 
				
			||||||
        delete ret.__v;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const dialogueGiftSchema = new Schema<IDialogueGift>(
 | 
					const dialogueGiftSchema = new Schema<IDialogueGift>(
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Item: String,
 | 
					        Item: String,
 | 
				
			||||||
@ -786,6 +696,134 @@ const dialogueHistorySchema = new Schema<IDialogueHistoryDatabase>(
 | 
				
			|||||||
    { _id: false }
 | 
					    { _id: false }
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const traitsSchema = new Schema<ITraits>(
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        BaseColor: String,
 | 
				
			||||||
 | 
					        SecondaryColor: String,
 | 
				
			||||||
 | 
					        TertiaryColor: String,
 | 
				
			||||||
 | 
					        AccentColor: String,
 | 
				
			||||||
 | 
					        EyeColor: String,
 | 
				
			||||||
 | 
					        FurPattern: String,
 | 
				
			||||||
 | 
					        Personality: String,
 | 
				
			||||||
 | 
					        BodyType: String,
 | 
				
			||||||
 | 
					        Head: { type: String, required: false },
 | 
				
			||||||
 | 
					        Tail: { type: String, required: false }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    { _id: false }
 | 
				
			||||||
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const detailsSchema = new Schema<IKubrowPetDetailsDatabase>(
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        Name: String,
 | 
				
			||||||
 | 
					        IsPuppy: Boolean,
 | 
				
			||||||
 | 
					        HasCollar: Boolean,
 | 
				
			||||||
 | 
					        PrintsRemaining: Number,
 | 
				
			||||||
 | 
					        Status: String,
 | 
				
			||||||
 | 
					        HatchDate: Date,
 | 
				
			||||||
 | 
					        DominantTraits: traitsSchema,
 | 
				
			||||||
 | 
					        RecessiveTraits: traitsSchema,
 | 
				
			||||||
 | 
					        IsMale: Boolean,
 | 
				
			||||||
 | 
					        Size: Number
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    { _id: false }
 | 
				
			||||||
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					detailsSchema.set("toJSON", {
 | 
				
			||||||
 | 
					    transform(_doc, returnedObject) {
 | 
				
			||||||
 | 
					        delete returnedObject.__v;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        const db = returnedObject as IKubrowPetDetailsDatabase;
 | 
				
			||||||
 | 
					        const client = returnedObject as IKubrowPetDetailsClient;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        client.HatchDate = toMongoDate(db.HatchDate);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const EquipmentSchema = new Schema<IEquipmentDatabase>(
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        ItemType: String,
 | 
				
			||||||
 | 
					        Configs: [ItemConfigSchema],
 | 
				
			||||||
 | 
					        UpgradeVer: { type: Number, default: 101 },
 | 
				
			||||||
 | 
					        XP: { type: Number, default: 0 },
 | 
				
			||||||
 | 
					        Features: Number,
 | 
				
			||||||
 | 
					        Polarized: Number,
 | 
				
			||||||
 | 
					        Polarity: [polaritySchema],
 | 
				
			||||||
 | 
					        FocusLens: String,
 | 
				
			||||||
 | 
					        ModSlotPurchases: Number,
 | 
				
			||||||
 | 
					        CustomizationSlotPurchases: Number,
 | 
				
			||||||
 | 
					        UpgradeType: String,
 | 
				
			||||||
 | 
					        UpgradeFingerprint: String,
 | 
				
			||||||
 | 
					        ItemName: String,
 | 
				
			||||||
 | 
					        InfestationDate: Date,
 | 
				
			||||||
 | 
					        InfestationDays: Number,
 | 
				
			||||||
 | 
					        InfestationType: String,
 | 
				
			||||||
 | 
					        ModularParts: { type: [String], default: undefined },
 | 
				
			||||||
 | 
					        UnlockLevel: Number,
 | 
				
			||||||
 | 
					        Expiry: Date,
 | 
				
			||||||
 | 
					        SkillTree: String,
 | 
				
			||||||
 | 
					        OffensiveUpgrade: String,
 | 
				
			||||||
 | 
					        DefensiveUpgrade: String,
 | 
				
			||||||
 | 
					        UpgradesExpiry: Date,
 | 
				
			||||||
 | 
					        ArchonCrystalUpgrades: { type: [ArchonCrystalUpgradeSchema], default: undefined },
 | 
				
			||||||
 | 
					        Weapon: crewShipWeaponSchema,
 | 
				
			||||||
 | 
					        Customization: crewShipCustomizationSchema,
 | 
				
			||||||
 | 
					        RailjackImage: FlavourItemSchema,
 | 
				
			||||||
 | 
					        CrewMembers: crewShipMembersSchema,
 | 
				
			||||||
 | 
					        Details: detailsSchema
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    { id: false }
 | 
				
			||||||
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EquipmentSchema.virtual("ItemId").get(function () {
 | 
				
			||||||
 | 
					    return { $oid: this._id.toString() } satisfies IOid;
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EquipmentSchema.set("toJSON", {
 | 
				
			||||||
 | 
					    virtuals: true,
 | 
				
			||||||
 | 
					    transform(_document, returnedObject) {
 | 
				
			||||||
 | 
					        delete returnedObject._id;
 | 
				
			||||||
 | 
					        delete returnedObject.__v;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        const db = returnedObject as IEquipmentDatabase;
 | 
				
			||||||
 | 
					        const client = returnedObject as IEquipmentClient;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (db.InfestationDate) {
 | 
				
			||||||
 | 
					            client.InfestationDate = toMongoDate(db.InfestationDate);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const equipmentFields: Record<string, { type: (typeof EquipmentSchema)[] }> = {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					equipmentKeys.forEach(key => {
 | 
				
			||||||
 | 
					    equipmentFields[key] = { type: [EquipmentSchema] };
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const infestedFoundrySchema = new Schema<IInfestedFoundryDatabase>(
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        Name: String,
 | 
				
			||||||
 | 
					        Resources: { type: [helminthResourceSchema], default: undefined },
 | 
				
			||||||
 | 
					        Slots: Number,
 | 
				
			||||||
 | 
					        XP: Number,
 | 
				
			||||||
 | 
					        ConsumedSuits: { type: [consumedSchuitsSchema], default: undefined },
 | 
				
			||||||
 | 
					        InvigorationIndex: Number,
 | 
				
			||||||
 | 
					        InvigorationSuitOfferings: { type: [String], default: undefined },
 | 
				
			||||||
 | 
					        InvigorationsApplied: Number,
 | 
				
			||||||
 | 
					        LastConsumedSuit: { type: EquipmentSchema, default: undefined },
 | 
				
			||||||
 | 
					        AbilityOverrideUnlockCooldown: Date
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    { _id: false }
 | 
				
			||||||
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					infestedFoundrySchema.set("toJSON", {
 | 
				
			||||||
 | 
					    transform(_doc, ret, _options) {
 | 
				
			||||||
 | 
					        if (ret.AbilityOverrideUnlockCooldown) {
 | 
				
			||||||
 | 
					            // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
 | 
				
			||||||
 | 
					            ret.AbilityOverrideUnlockCooldown = toMongoDate(ret.AbilityOverrideUnlockCooldown);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
					const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        accountOwnerId: Schema.Types.ObjectId,
 | 
					        accountOwnerId: Schema.Types.ObjectId,
 | 
				
			||||||
@ -818,6 +856,8 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			|||||||
        MechBin: { type: slotsBinSchema, default: { Slots: 4 } },
 | 
					        MechBin: { type: slotsBinSchema, default: { Slots: 4 } },
 | 
				
			||||||
        CrewMemberBin: { type: slotsBinSchema, default: { Slots: 3 } },
 | 
					        CrewMemberBin: { type: slotsBinSchema, default: { Slots: 3 } },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ...equipmentFields,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //How many trades do you have left
 | 
					        //How many trades do you have left
 | 
				
			||||||
        TradesRemaining: { type: Number, default: 0 },
 | 
					        TradesRemaining: { type: Number, default: 0 },
 | 
				
			||||||
        //How many Gift do you have left*(gift spends the trade)
 | 
					        //How many Gift do you have left*(gift spends the trade)
 | 
				
			||||||
@ -867,29 +907,10 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			|||||||
        //Upgrade Mods\Riven\Arcane Example:"UpgradeFingerprint"+"ItemType"+""
 | 
					        //Upgrade Mods\Riven\Arcane Example:"UpgradeFingerprint"+"ItemType"+""
 | 
				
			||||||
        Upgrades: [upgradeSchema],
 | 
					        Upgrades: [upgradeSchema],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Warframe
 | 
					 | 
				
			||||||
        Suits: [EquipmentSchema],
 | 
					 | 
				
			||||||
        //Primary    Weapon
 | 
					 | 
				
			||||||
        LongGuns: [EquipmentSchema],
 | 
					 | 
				
			||||||
        //Secondary  Weapon
 | 
					 | 
				
			||||||
        Pistols: [EquipmentSchema],
 | 
					 | 
				
			||||||
        //Melee      Weapon
 | 
					 | 
				
			||||||
        Melee: [EquipmentSchema],
 | 
					 | 
				
			||||||
        //Ability Weapon like Ultimate Mech\Excalibur\Ivara etc
 | 
					 | 
				
			||||||
        SpecialItems: [EquipmentSchema],
 | 
					 | 
				
			||||||
        //The Mandachord(Octavia) is a step sequencer
 | 
					        //The Mandachord(Octavia) is a step sequencer
 | 
				
			||||||
        StepSequencers: [StepSequencersSchema],
 | 
					        StepSequencers: [StepSequencersSchema],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Sentinel(like Helios or modular)
 | 
					 | 
				
			||||||
        Sentinels: [EquipmentSchema],
 | 
					 | 
				
			||||||
        //Any /Sentinels/SentinelWeapons/ (like warframe weapon)
 | 
					 | 
				
			||||||
        SentinelWeapons: [EquipmentSchema],
 | 
					 | 
				
			||||||
        //Modular Pets
 | 
					 | 
				
			||||||
        MoaPets: [EquipmentSchema],
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        KubrowPetEggs: [Schema.Types.Mixed],
 | 
					        KubrowPetEggs: [Schema.Types.Mixed],
 | 
				
			||||||
        //Like PowerSuit Cat\Kubrow or etc Pets
 | 
					 | 
				
			||||||
        KubrowPets: [EquipmentSchema],
 | 
					 | 
				
			||||||
        //Prints   Cat(3 Prints)\Kubrow(2 Prints) Pets
 | 
					        //Prints   Cat(3 Prints)\Kubrow(2 Prints) Pets
 | 
				
			||||||
        KubrowPetPrints: [Schema.Types.Mixed],
 | 
					        KubrowPetPrints: [Schema.Types.Mixed],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -902,42 +923,26 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			|||||||
        EquippedInstrument: String,
 | 
					        EquippedInstrument: String,
 | 
				
			||||||
        ReceivedStartingGear: Boolean,
 | 
					        ReceivedStartingGear: Boolean,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //to use add SummonItem to Consumables+EquippedGear
 | 
					 | 
				
			||||||
        //Archwing need Suits+Melee+Guns
 | 
					 | 
				
			||||||
        SpaceSuits: [EquipmentSchema],
 | 
					 | 
				
			||||||
        SpaceMelee: [EquipmentSchema],
 | 
					 | 
				
			||||||
        SpaceGuns: [EquipmentSchema],
 | 
					 | 
				
			||||||
        ArchwingEnabled: Boolean,
 | 
					        ArchwingEnabled: Boolean,
 | 
				
			||||||
        //Mech need Suits+SpaceGuns+SpecialItem
 | 
					 | 
				
			||||||
        MechSuits: [EquipmentSchema],
 | 
					 | 
				
			||||||
        ///Restoratives/HoverboardSummon (like Suit)
 | 
					 | 
				
			||||||
        Hoverboards: [EquipmentSchema],
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Use Operator\Drifter
 | 
					        //Use Operator\Drifter
 | 
				
			||||||
        UseAdultOperatorLoadout: Boolean,
 | 
					        UseAdultOperatorLoadout: Boolean,
 | 
				
			||||||
        //Operator\Drifter Weapon
 | 
					 | 
				
			||||||
        OperatorAmps: [EquipmentSchema],
 | 
					 | 
				
			||||||
        //Operator
 | 
					        //Operator
 | 
				
			||||||
        OperatorLoadOuts: [operatorConfigSchema],
 | 
					        OperatorLoadOuts: [operatorConfigSchema],
 | 
				
			||||||
        //Drifter
 | 
					        //Drifter
 | 
				
			||||||
        AdultOperatorLoadOuts: [operatorConfigSchema],
 | 
					        AdultOperatorLoadOuts: [operatorConfigSchema],
 | 
				
			||||||
        DrifterMelee: [EquipmentSchema],
 | 
					        // Kahl
 | 
				
			||||||
        DrifterGuns: [EquipmentSchema],
 | 
					        KahlLoadOuts: [operatorConfigSchema],
 | 
				
			||||||
        //ErsatzHorsePowerSuit
 | 
					 | 
				
			||||||
        Horses: [EquipmentSchema],
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //LandingCraft like Liset
 | 
					        //LandingCraft like Liset
 | 
				
			||||||
        Ships: { type: [Schema.Types.ObjectId], ref: "Ships" },
 | 
					        Ships: { type: [Schema.Types.ObjectId], ref: "Ships" },
 | 
				
			||||||
        // /Lotus/Types/Items/ShipDecos/
 | 
					        // /Lotus/Types/Items/ShipDecos/
 | 
				
			||||||
        ShipDecorations: [typeCountSchema],
 | 
					        ShipDecorations: [typeCountSchema],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //RailJack Setting(Mods,Skin,Weapon,etc)
 | 
					 | 
				
			||||||
        CrewShipHarnesses: [EquipmentSchema],
 | 
					 | 
				
			||||||
        //Railjack/Components(https://warframe.fandom.com/wiki/Railjack/Components)
 | 
					        //Railjack/Components(https://warframe.fandom.com/wiki/Railjack/Components)
 | 
				
			||||||
        CrewShipRawSalvage: [Schema.Types.Mixed],
 | 
					        CrewShipRawSalvage: [Schema.Types.Mixed],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Default RailJack
 | 
					        //Default RailJack
 | 
				
			||||||
        CrewShips: [crewShipSchema],
 | 
					 | 
				
			||||||
        CrewShipAmmo: [typeCountSchema],
 | 
					        CrewShipAmmo: [typeCountSchema],
 | 
				
			||||||
        CrewShipWeapons: [Schema.Types.Mixed],
 | 
					        CrewShipWeapons: [Schema.Types.Mixed],
 | 
				
			||||||
        CrewShipWeaponSkins: [Schema.Types.Mixed],
 | 
					        CrewShipWeaponSkins: [Schema.Types.Mixed],
 | 
				
			||||||
@ -959,9 +964,6 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			|||||||
        //Cosmetics like profile glyphs\Kavasa Prime Kubrow Collar\Game Theme etc
 | 
					        //Cosmetics like profile glyphs\Kavasa Prime Kubrow Collar\Game Theme etc
 | 
				
			||||||
        FlavourItems: [FlavourItemSchema],
 | 
					        FlavourItems: [FlavourItemSchema],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Lunaro Weapon
 | 
					 | 
				
			||||||
        Scoops: [EquipmentSchema],
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //Mastery Rank*(Need item XPInfo to rank up)
 | 
					        //Mastery Rank*(Need item XPInfo to rank up)
 | 
				
			||||||
        PlayerLevel: { type: Number, default: 0 },
 | 
					        PlayerLevel: { type: Number, default: 0 },
 | 
				
			||||||
        //Item Mastery Rank exp
 | 
					        //Item Mastery Rank exp
 | 
				
			||||||
@ -1072,11 +1074,6 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			|||||||
        //https://warframe.fandom.com/wiki/Invasion
 | 
					        //https://warframe.fandom.com/wiki/Invasion
 | 
				
			||||||
        InvasionChainProgress: [Schema.Types.Mixed],
 | 
					        InvasionChainProgress: [Schema.Types.Mixed],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //https://warframe.fandom.com/wiki/Parazon
 | 
					 | 
				
			||||||
        DataKnives: [EquipmentSchema],
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        Motorcycles: [EquipmentSchema],
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //CorpusLich or GrineerLich
 | 
					        //CorpusLich or GrineerLich
 | 
				
			||||||
        NemesisAbandonedRewards: [String],
 | 
					        NemesisAbandonedRewards: [String],
 | 
				
			||||||
        //CorpusLich\KuvaLich
 | 
					        //CorpusLich\KuvaLich
 | 
				
			||||||
@ -1113,7 +1110,6 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			|||||||
        //Unknown and system
 | 
					        //Unknown and system
 | 
				
			||||||
        DuviriInfo: DuviriInfoSchema,
 | 
					        DuviriInfo: DuviriInfoSchema,
 | 
				
			||||||
        Mailbox: MailboxSchema,
 | 
					        Mailbox: MailboxSchema,
 | 
				
			||||||
        KahlLoadOuts: [Schema.Types.Mixed],
 | 
					 | 
				
			||||||
        HandlerPoints: Number,
 | 
					        HandlerPoints: Number,
 | 
				
			||||||
        ChallengesFixVersion: Number,
 | 
					        ChallengesFixVersion: Number,
 | 
				
			||||||
        PlayedParkourTutorial: Boolean,
 | 
					        PlayedParkourTutorial: Boolean,
 | 
				
			||||||
@ -1172,37 +1168,17 @@ inventorySchema.set("toJSON", {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// type overwrites for subdocuments/subdocument arrays
 | 
					// type overwrites for subdocuments/subdocument arrays
 | 
				
			||||||
export type InventoryDocumentProps = {
 | 
					export type InventoryDocumentProps = {
 | 
				
			||||||
    Suits: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    LongGuns: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    Pistols: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    Melee: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    OperatorAmps: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    FlavourItems: Types.DocumentArray<IFlavourItem>;
 | 
					    FlavourItems: Types.DocumentArray<IFlavourItem>;
 | 
				
			||||||
    RawUpgrades: Types.DocumentArray<IRawUpgrade>;
 | 
					    RawUpgrades: Types.DocumentArray<IRawUpgrade>;
 | 
				
			||||||
    Upgrades: Types.DocumentArray<IUpgradeDatabase>;
 | 
					    Upgrades: Types.DocumentArray<IUpgradeDatabase>;
 | 
				
			||||||
    MiscItems: Types.DocumentArray<IMiscItem>;
 | 
					    MiscItems: Types.DocumentArray<IMiscItem>;
 | 
				
			||||||
    Boosters: Types.DocumentArray<IBooster>;
 | 
					    Boosters: Types.DocumentArray<IBooster>;
 | 
				
			||||||
    OperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
 | 
					    OperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
 | 
				
			||||||
    SpecialItems: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    AdultOperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
 | 
					    AdultOperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
 | 
				
			||||||
    MechSuits: Types.DocumentArray<IEquipmentDatabase>;
 | 
					    KahlLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
 | 
				
			||||||
    Scoops: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    DataKnives: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    Motorcycles: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    DrifterMelee: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    Sentinels: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    Horses: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    PendingRecipes: Types.DocumentArray<IPendingRecipeDatabase>;
 | 
					    PendingRecipes: Types.DocumentArray<IPendingRecipeDatabase>;
 | 
				
			||||||
    SpaceSuits: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    SpaceGuns: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    SpaceMelee: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    SentinelWeapons: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    Hoverboards: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    MoaPets: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
    WeaponSkins: Types.DocumentArray<IWeaponSkinDatabase>;
 | 
					    WeaponSkins: Types.DocumentArray<IWeaponSkinDatabase>;
 | 
				
			||||||
    CrewShips: Types.DocumentArray<ICrewShipDatabase>;
 | 
					} & { [K in TEquipmentKey]: Types.DocumentArray<IEquipmentDatabase> };
 | 
				
			||||||
    CrewShipHarnesses: Types.DocumentArray<IEquipmentDatabase>;
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// eslint-disable-next-line @typescript-eslint/ban-types
 | 
					// eslint-disable-next-line @typescript-eslint/ban-types
 | 
				
			||||||
type InventoryModelType = Model<IInventoryDatabase, {}, InventoryDocumentProps>;
 | 
					type InventoryModelType = Model<IInventoryDatabase, {}, InventoryDocumentProps>;
 | 
				
			||||||
 | 
				
			|||||||
@ -31,6 +31,7 @@ import { getShipController } from "@/src/controllers/api/getShipController";
 | 
				
			|||||||
import { getVendorInfoController } from "@/src/controllers/api/getVendorInfoController";
 | 
					import { getVendorInfoController } from "@/src/controllers/api/getVendorInfoController";
 | 
				
			||||||
import { getVoidProjectionRewardsController } from "@/src/controllers/api/getVoidProjectionRewardsController";
 | 
					import { getVoidProjectionRewardsController } from "@/src/controllers/api/getVoidProjectionRewardsController";
 | 
				
			||||||
import { gildWeaponController } from "@/src/controllers/api/gildWeaponController";
 | 
					import { gildWeaponController } from "@/src/controllers/api/gildWeaponController";
 | 
				
			||||||
 | 
					import { giveKeyChainTriggeredItemsController } from "@/src/controllers/api/giveKeyChainTriggeredItemsController";
 | 
				
			||||||
import { guildTechController } from "../controllers/api/guildTechController";
 | 
					import { guildTechController } from "../controllers/api/guildTechController";
 | 
				
			||||||
import { hostSessionController } from "@/src/controllers/api/hostSessionController";
 | 
					import { hostSessionController } from "@/src/controllers/api/hostSessionController";
 | 
				
			||||||
import { hubController } from "@/src/controllers/api/hubController";
 | 
					import { hubController } from "@/src/controllers/api/hubController";
 | 
				
			||||||
@ -74,13 +75,12 @@ import { syndicateSacrificeController } from "../controllers/api/syndicateSacrif
 | 
				
			|||||||
import { syndicateStandingBonusController } from "../controllers/api/syndicateStandingBonusController";
 | 
					import { syndicateStandingBonusController } from "../controllers/api/syndicateStandingBonusController";
 | 
				
			||||||
import { tauntHistoryController } from "@/src/controllers/api/tauntHistoryController";
 | 
					import { tauntHistoryController } from "@/src/controllers/api/tauntHistoryController";
 | 
				
			||||||
import { trainingResultController } from "@/src/controllers/api/trainingResultController";
 | 
					import { trainingResultController } from "@/src/controllers/api/trainingResultController";
 | 
				
			||||||
 | 
					import { unlockShipFeatureController } from "@/src/controllers/api/unlockShipFeatureController";
 | 
				
			||||||
import { updateChallengeProgressController } from "@/src/controllers/api/updateChallengeProgressController";
 | 
					import { updateChallengeProgressController } from "@/src/controllers/api/updateChallengeProgressController";
 | 
				
			||||||
 | 
					import { updateQuestController } from "@/src/controllers/api/updateQuestController";
 | 
				
			||||||
import { updateSessionGetController, updateSessionPostController } from "@/src/controllers/api/updateSessionController";
 | 
					import { updateSessionGetController, updateSessionPostController } from "@/src/controllers/api/updateSessionController";
 | 
				
			||||||
import { updateThemeController } from "../controllers/api/updateThemeController";
 | 
					import { updateThemeController } from "../controllers/api/updateThemeController";
 | 
				
			||||||
import { upgradesController } from "@/src/controllers/api/upgradesController";
 | 
					import { upgradesController } from "@/src/controllers/api/upgradesController";
 | 
				
			||||||
import { updateQuestController } from "@/src/controllers/api/updateQuestController";
 | 
					 | 
				
			||||||
import { giveKeyChainTriggeredItemsController } from "@/src/controllers/api/giveKeyChainTriggeredItemsController";
 | 
					 | 
				
			||||||
import { unlockShipFeatureController } from "@/src/controllers/api/unlockShipFeatureController";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
const apiRouter = express.Router();
 | 
					const apiRouter = express.Router();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -8,8 +8,6 @@ import {
 | 
				
			|||||||
import { IMongoDate } from "../types/commonTypes";
 | 
					import { IMongoDate } from "../types/commonTypes";
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
    equipmentKeys,
 | 
					    equipmentKeys,
 | 
				
			||||||
    ICrewShipClient,
 | 
					 | 
				
			||||||
    ICrewShipDatabase,
 | 
					 | 
				
			||||||
    ICrewShipMemberClient,
 | 
					    ICrewShipMemberClient,
 | 
				
			||||||
    ICrewShipMemberDatabase,
 | 
					    ICrewShipMemberDatabase,
 | 
				
			||||||
    ICrewShipMembersClient,
 | 
					    ICrewShipMembersClient,
 | 
				
			||||||
@ -21,6 +19,8 @@ import {
 | 
				
			|||||||
    IInfestedFoundryClient,
 | 
					    IInfestedFoundryClient,
 | 
				
			||||||
    IInfestedFoundryDatabase,
 | 
					    IInfestedFoundryDatabase,
 | 
				
			||||||
    IInventoryClient,
 | 
					    IInventoryClient,
 | 
				
			||||||
 | 
					    IKubrowPetDetailsClient,
 | 
				
			||||||
 | 
					    IKubrowPetDetailsDatabase,
 | 
				
			||||||
    ILoadoutConfigClient,
 | 
					    ILoadoutConfigClient,
 | 
				
			||||||
    ILoadOutPresets,
 | 
					    ILoadOutPresets,
 | 
				
			||||||
    ISlots,
 | 
					    ISlots,
 | 
				
			||||||
@ -47,7 +47,16 @@ const convertEquipment = (client: IEquipmentClient): IEquipmentDatabase => {
 | 
				
			|||||||
        _id: new Types.ObjectId(ItemId.$oid),
 | 
					        _id: new Types.ObjectId(ItemId.$oid),
 | 
				
			||||||
        InfestationDate: convertOptionalDate(client.InfestationDate),
 | 
					        InfestationDate: convertOptionalDate(client.InfestationDate),
 | 
				
			||||||
        Expiry: convertOptionalDate(client.Expiry),
 | 
					        Expiry: convertOptionalDate(client.Expiry),
 | 
				
			||||||
        UpgradesExpiry: convertOptionalDate(client.UpgradesExpiry)
 | 
					        UpgradesExpiry: convertOptionalDate(client.UpgradesExpiry),
 | 
				
			||||||
 | 
					        CrewMembers: client.CrewMembers ? convertCrewShipMembers(client.CrewMembers) : undefined,
 | 
				
			||||||
 | 
					        Details: client.Details ? convertKubrowDetails(client.Details) : undefined,
 | 
				
			||||||
 | 
					        Configs: client.Configs
 | 
				
			||||||
 | 
					            ? client.Configs.map(obj =>
 | 
				
			||||||
 | 
					                  Object.fromEntries(
 | 
				
			||||||
 | 
					                      Object.entries(obj).filter(([_, value]) => !Array.isArray(value) || value.length > 0)
 | 
				
			||||||
 | 
					                  )
 | 
				
			||||||
 | 
					              )
 | 
				
			||||||
 | 
					            : []
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -102,15 +111,6 @@ const convertCrewShipMembers = (client: ICrewShipMembersClient): ICrewShipMember
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const convertCrewShip = (client: ICrewShipClient): ICrewShipDatabase => {
 | 
					 | 
				
			||||||
    const { ItemId, ...rest } = client;
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
        ...rest,
 | 
					 | 
				
			||||||
        _id: new Types.ObjectId(ItemId.$oid),
 | 
					 | 
				
			||||||
        CrewMembers: client.CrewMembers ? convertCrewShipMembers(client.CrewMembers) : undefined
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const convertInfestedFoundry = (client: IInfestedFoundryClient): IInfestedFoundryDatabase => {
 | 
					const convertInfestedFoundry = (client: IInfestedFoundryClient): IInfestedFoundryDatabase => {
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
        ...client,
 | 
					        ...client,
 | 
				
			||||||
@ -136,6 +136,13 @@ const convertDialogueHistory = (client: IDialogueHistoryClient): IDialogueHistor
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const convertKubrowDetails = (client: IKubrowPetDetailsClient): IKubrowPetDetailsDatabase => {
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					        ...client,
 | 
				
			||||||
 | 
					        HatchDate: convertDate(client.HatchDate)
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<IInventoryClient>): void => {
 | 
					export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<IInventoryClient>): void => {
 | 
				
			||||||
    for (const key of equipmentKeys) {
 | 
					    for (const key of equipmentKeys) {
 | 
				
			||||||
        if (client[key] !== undefined) {
 | 
					        if (client[key] !== undefined) {
 | 
				
			||||||
@ -159,7 +166,7 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
 | 
				
			|||||||
            });
 | 
					            });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    for (const key of ["OperatorLoadOuts", "AdultOperatorLoadOuts"] as const) {
 | 
					    for (const key of ["AdultOperatorLoadOuts", "OperatorLoadOuts", "KahlLoadOuts"] as const) {
 | 
				
			||||||
        if (client[key] !== undefined) {
 | 
					        if (client[key] !== undefined) {
 | 
				
			||||||
            replaceArray<IOperatorConfigDatabase>(db[key], client[key].map(convertOperatorConfig));
 | 
					            replaceArray<IOperatorConfigDatabase>(db[key], client[key].map(convertOperatorConfig));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -222,9 +229,6 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
 | 
				
			|||||||
    if (client.FocusUpgrades !== undefined) {
 | 
					    if (client.FocusUpgrades !== undefined) {
 | 
				
			||||||
        db.FocusUpgrades = client.FocusUpgrades;
 | 
					        db.FocusUpgrades = client.FocusUpgrades;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (client.CrewShips !== undefined) {
 | 
					 | 
				
			||||||
        replaceArray<ICrewShipDatabase>(db.CrewShips, client.CrewShips.map(convertCrewShip));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if (client.InfestedFoundry !== undefined) {
 | 
					    if (client.InfestedFoundry !== undefined) {
 | 
				
			||||||
        db.InfestedFoundry = convertInfestedFoundry(client.InfestedFoundry);
 | 
					        db.InfestedFoundry = convertInfestedFoundry(client.InfestedFoundry);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -29,7 +29,7 @@ import {
 | 
				
			|||||||
    IUpdateChallengeProgressRequest
 | 
					    IUpdateChallengeProgressRequest
 | 
				
			||||||
} from "../types/requestTypes";
 | 
					} from "../types/requestTypes";
 | 
				
			||||||
import { logger } from "@/src/utils/logger";
 | 
					import { logger } from "@/src/utils/logger";
 | 
				
			||||||
import { getWeaponType, getExalted, getKeyChainItems } from "@/src/services/itemDataService";
 | 
					import { getExalted, getKeyChainItems } from "@/src/services/itemDataService";
 | 
				
			||||||
import { IEquipmentClient, IItemConfig } from "../types/inventoryTypes/commonInventoryTypes";
 | 
					import { IEquipmentClient, IItemConfig } from "../types/inventoryTypes/commonInventoryTypes";
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
    ExportArcanes,
 | 
					    ExportArcanes,
 | 
				
			||||||
@ -40,6 +40,7 @@ import {
 | 
				
			|||||||
    ExportResources,
 | 
					    ExportResources,
 | 
				
			||||||
    ExportSentinels,
 | 
					    ExportSentinels,
 | 
				
			||||||
    ExportUpgrades,
 | 
					    ExportUpgrades,
 | 
				
			||||||
 | 
					    ExportWeapons,
 | 
				
			||||||
    TStandingLimitBin
 | 
					    TStandingLimitBin
 | 
				
			||||||
} from "warframe-public-export-plus";
 | 
					} from "warframe-public-export-plus";
 | 
				
			||||||
import { createShip } from "./shipService";
 | 
					import { createShip } from "./shipService";
 | 
				
			||||||
@ -288,6 +289,20 @@ export const addItem = async (
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    if (typeName in ExportWeapons) {
 | 
				
			||||||
 | 
					        const weapon = ExportWeapons[typeName];
 | 
				
			||||||
 | 
					        // Many non-weapon items are "Pistols" in Public Export, so some duck typing is needed.
 | 
				
			||||||
 | 
					        if (weapon.totalDamage != 0) {
 | 
				
			||||||
 | 
					            const inventoryChanges = addEquipment(inventory, weapon.productCategory, typeName);
 | 
				
			||||||
 | 
					            updateSlots(inventory, InventorySlot.WEAPONS, 0, 1);
 | 
				
			||||||
 | 
					            return {
 | 
				
			||||||
 | 
					                InventoryChanges: {
 | 
				
			||||||
 | 
					                    ...inventoryChanges,
 | 
				
			||||||
 | 
					                    WeaponBin: { count: 1, platinum: 0, Slots: -1 }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    if (typeName in creditBundles) {
 | 
					    if (typeName in creditBundles) {
 | 
				
			||||||
        const creditsTotal = creditBundles[typeName] * quantity;
 | 
					        const creditsTotal = creditBundles[typeName] * quantity;
 | 
				
			||||||
        inventory.RegularCredits += creditsTotal;
 | 
					        inventory.RegularCredits += creditsTotal;
 | 
				
			||||||
@ -355,17 +370,6 @@ export const addItem = async (
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        case "Weapons": {
 | 
					 | 
				
			||||||
            const weaponType = getWeaponType(typeName);
 | 
					 | 
				
			||||||
            const inventoryChanges = addEquipment(inventory, weaponType, typeName);
 | 
					 | 
				
			||||||
            updateSlots(inventory, InventorySlot.WEAPONS, 0, 1);
 | 
					 | 
				
			||||||
            return {
 | 
					 | 
				
			||||||
                InventoryChanges: {
 | 
					 | 
				
			||||||
                    ...inventoryChanges,
 | 
					 | 
				
			||||||
                    WeaponBin: { count: 1, platinum: 0, Slots: -1 }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        case "Upgrades": {
 | 
					        case "Upgrades": {
 | 
				
			||||||
            // Needed to add Traumatic Peculiar
 | 
					            // Needed to add Traumatic Peculiar
 | 
				
			||||||
            const changes = [
 | 
					            const changes = [
 | 
				
			||||||
@ -917,6 +921,30 @@ export const addFusionTreasures = (
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const addFocusXpIncreases = (inventory: TInventoryDatabaseDocument, focusXpPlus: number[] | undefined): void => {
 | 
				
			||||||
 | 
					    enum FocusType {
 | 
				
			||||||
 | 
					        AP_UNIVERSAL,
 | 
				
			||||||
 | 
					        AP_ATTACK,
 | 
				
			||||||
 | 
					        AP_DEFENSE,
 | 
				
			||||||
 | 
					        AP_TACTIC,
 | 
				
			||||||
 | 
					        AP_POWER,
 | 
				
			||||||
 | 
					        AP_PRECEPT,
 | 
				
			||||||
 | 
					        AP_FUSION,
 | 
				
			||||||
 | 
					        AP_WARD,
 | 
				
			||||||
 | 
					        AP_UMBRA,
 | 
				
			||||||
 | 
					        AP_ANY
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (focusXpPlus) {
 | 
				
			||||||
 | 
					        inventory.FocusXP ??= { AP_ATTACK: 0, AP_DEFENSE: 0, AP_TACTIC: 0, AP_POWER: 0, AP_WARD: 0 };
 | 
				
			||||||
 | 
					        inventory.FocusXP.AP_ATTACK += focusXpPlus[FocusType.AP_ATTACK];
 | 
				
			||||||
 | 
					        inventory.FocusXP.AP_DEFENSE += focusXpPlus[FocusType.AP_DEFENSE];
 | 
				
			||||||
 | 
					        inventory.FocusXP.AP_TACTIC += focusXpPlus[FocusType.AP_TACTIC];
 | 
				
			||||||
 | 
					        inventory.FocusXP.AP_POWER += focusXpPlus[FocusType.AP_POWER];
 | 
				
			||||||
 | 
					        inventory.FocusXP.AP_WARD += focusXpPlus[FocusType.AP_WARD];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const updateChallengeProgress = async (
 | 
					export const updateChallengeProgress = async (
 | 
				
			||||||
    challenges: IUpdateChallengeProgressRequest,
 | 
					    challenges: IUpdateChallengeProgressRequest,
 | 
				
			||||||
    accountId: string
 | 
					    accountId: string
 | 
				
			||||||
 | 
				
			|||||||
@ -44,21 +44,6 @@ export type WeaponTypeInternal =
 | 
				
			|||||||
    | "OperatorAmps"
 | 
					    | "OperatorAmps"
 | 
				
			||||||
    | "SpecialItems";
 | 
					    | "SpecialItems";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const getWeaponType = (weaponName: string): WeaponTypeInternal => {
 | 
					 | 
				
			||||||
    const weaponInfo = ExportWeapons[weaponName];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (!weaponInfo) {
 | 
					 | 
				
			||||||
        throw new Error(`unknown weapon ${weaponName}`);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Many non-weapon items are "Pistols" in Public Export, so some duck typing is needed.
 | 
					 | 
				
			||||||
    if (weaponInfo.totalDamage == 0) {
 | 
					 | 
				
			||||||
        throw new Error(`${weaponName} doesn't quack like a weapon`);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return weaponInfo.productCategory;
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export const getRecipe = (uniqueName: string): IRecipe | undefined => {
 | 
					export const getRecipe = (uniqueName: string): IRecipe | undefined => {
 | 
				
			||||||
    return ExportRecipes[uniqueName];
 | 
					    return ExportRecipes[uniqueName];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
@ -2,10 +2,11 @@ import { ExportRegions, ExportRewards, IReward } from "warframe-public-export-pl
 | 
				
			|||||||
import { IMissionInventoryUpdateRequest, IRewardInfo } from "../types/requestTypes";
 | 
					import { IMissionInventoryUpdateRequest, IRewardInfo } from "../types/requestTypes";
 | 
				
			||||||
import { logger } from "@/src/utils/logger";
 | 
					import { logger } from "@/src/utils/logger";
 | 
				
			||||||
import { IRngResult, getRandomReward } from "@/src/services/rngService";
 | 
					import { IRngResult, getRandomReward } from "@/src/services/rngService";
 | 
				
			||||||
import { IInventoryDatabase } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
					import { equipmentKeys, IInventoryDatabase, TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
    addChallenges,
 | 
					    addChallenges,
 | 
				
			||||||
    addConsumables,
 | 
					    addConsumables,
 | 
				
			||||||
 | 
					    addFocusXpIncreases,
 | 
				
			||||||
    addFusionTreasures,
 | 
					    addFusionTreasures,
 | 
				
			||||||
    addGearExpByCategory,
 | 
					    addGearExpByCategory,
 | 
				
			||||||
    addItem,
 | 
					    addItem,
 | 
				
			||||||
@ -22,6 +23,7 @@ import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
				
			|||||||
import { getLevelKeyRewards, getNode } from "@/src/services/itemDataService";
 | 
					import { getLevelKeyRewards, getNode } from "@/src/services/itemDataService";
 | 
				
			||||||
import { InventoryDocumentProps, TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
					import { InventoryDocumentProps, TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
				
			||||||
import { getEntriesUnsafe } from "@/src/utils/ts-utils";
 | 
					import { getEntriesUnsafe } from "@/src/utils/ts-utils";
 | 
				
			||||||
 | 
					import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const getRotations = (rotationCount: number): number[] => {
 | 
					const getRotations = (rotationCount: number): number[] => {
 | 
				
			||||||
    if (rotationCount === 0) return [0];
 | 
					    if (rotationCount === 0) return [0];
 | 
				
			||||||
@ -144,23 +146,16 @@ export const addMissionInventoryUpdates = (
 | 
				
			|||||||
                inventoryChanges.FusionPoints = fusionPoints;
 | 
					                inventoryChanges.FusionPoints = fusionPoints;
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // Equipment XP updates
 | 
					            case "FocusXpIncreases": {
 | 
				
			||||||
            case "Suits":
 | 
					                addFocusXpIncreases(inventory, value);
 | 
				
			||||||
            case "LongGuns":
 | 
					 | 
				
			||||||
            case "Pistols":
 | 
					 | 
				
			||||||
            case "Melee":
 | 
					 | 
				
			||||||
            case "SpecialItems":
 | 
					 | 
				
			||||||
            case "Sentinels":
 | 
					 | 
				
			||||||
            case "SentinelWeapons":
 | 
					 | 
				
			||||||
            case "SpaceSuits":
 | 
					 | 
				
			||||||
            case "SpaceGuns":
 | 
					 | 
				
			||||||
            case "SpaceMelee":
 | 
					 | 
				
			||||||
            case "Hoverboards":
 | 
					 | 
				
			||||||
            case "OperatorAmps":
 | 
					 | 
				
			||||||
            case "MoaPets":
 | 
					 | 
				
			||||||
                addGearExpByCategory(inventory, value, key);
 | 
					 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            default:
 | 
					            default:
 | 
				
			||||||
 | 
					                // Equipment XP updates
 | 
				
			||||||
 | 
					                if (equipmentKeys.includes(key as TEquipmentKey)) {
 | 
				
			||||||
 | 
					                    addGearExpByCategory(inventory, value as IEquipmentClient[], key as TEquipmentKey);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
            // if (
 | 
					            // if (
 | 
				
			||||||
            //     (ignoredInventoryUpdateKeys as readonly string[]).includes(key) ||
 | 
					            //     (ignoredInventoryUpdateKeys as readonly string[]).includes(key) ||
 | 
				
			||||||
            //     knownUnhandledKeys.includes(key)
 | 
					            //     knownUnhandledKeys.includes(key)
 | 
				
			||||||
 | 
				
			|||||||
@ -12,6 +12,7 @@ import { IOid } from "@/src/types/commonTypes";
 | 
				
			|||||||
import { Types } from "mongoose";
 | 
					import { Types } from "mongoose";
 | 
				
			||||||
import { isEmptyObject } from "@/src/helpers/general";
 | 
					import { isEmptyObject } from "@/src/helpers/general";
 | 
				
			||||||
import { logger } from "@/src/utils/logger";
 | 
					import { logger } from "@/src/utils/logger";
 | 
				
			||||||
 | 
					import { equipmentKeys, TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//TODO: setup default items on account creation or like originally in giveStartingItems.php
 | 
					//TODO: setup default items on account creation or like originally in giveStartingItems.php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -36,8 +37,9 @@ export const handleInventoryItemConfigChange = async (
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        // non-empty is a change in loadout(or suit...)
 | 
					        // non-empty is a change in loadout(or suit...)
 | 
				
			||||||
        switch (equipmentName) {
 | 
					        switch (equipmentName) {
 | 
				
			||||||
 | 
					            case "AdultOperatorLoadOuts":
 | 
				
			||||||
            case "OperatorLoadOuts":
 | 
					            case "OperatorLoadOuts":
 | 
				
			||||||
            case "AdultOperatorLoadOuts": {
 | 
					            case "KahlLoadOuts": {
 | 
				
			||||||
                const operatorConfig = equipment as IOperatorConfigEntry;
 | 
					                const operatorConfig = equipment as IOperatorConfigEntry;
 | 
				
			||||||
                const operatorLoadout = inventory[equipmentName];
 | 
					                const operatorLoadout = inventory[equipmentName];
 | 
				
			||||||
                logger.debug(`operator loadout received ${equipmentName} `, operatorConfig);
 | 
					                logger.debug(`operator loadout received ${equipmentName} `, operatorConfig);
 | 
				
			||||||
@ -124,45 +126,6 @@ export const handleInventoryItemConfigChange = async (
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            case "LongGuns":
 | 
					 | 
				
			||||||
            case "Pistols":
 | 
					 | 
				
			||||||
            case "Suits":
 | 
					 | 
				
			||||||
            case "Melee":
 | 
					 | 
				
			||||||
            case "Scoops":
 | 
					 | 
				
			||||||
            case "DataKnives":
 | 
					 | 
				
			||||||
            case "DrifterMelee":
 | 
					 | 
				
			||||||
            case "Sentinels":
 | 
					 | 
				
			||||||
            case "Horses":
 | 
					 | 
				
			||||||
            case "OperatorAmps":
 | 
					 | 
				
			||||||
            case "SentinelWeapons":
 | 
					 | 
				
			||||||
            case "KubrowPets":
 | 
					 | 
				
			||||||
            case "SpaceSuits":
 | 
					 | 
				
			||||||
            case "SpaceGuns":
 | 
					 | 
				
			||||||
            case "SpaceMelee":
 | 
					 | 
				
			||||||
            case "SpecialItems":
 | 
					 | 
				
			||||||
            case "MoaPets":
 | 
					 | 
				
			||||||
            case "Hoverboards":
 | 
					 | 
				
			||||||
            case "MechSuits":
 | 
					 | 
				
			||||||
            case "CrewShipHarnesses":
 | 
					 | 
				
			||||||
            case "CrewShips":
 | 
					 | 
				
			||||||
            case "Motorcycles": {
 | 
					 | 
				
			||||||
                logger.debug(`general Item config saved of type ${equipmentName}`, { config: equipment });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                const itemEntries = equipment as IItemEntry;
 | 
					 | 
				
			||||||
                for (const [itemId, itemConfigEntries] of Object.entries(itemEntries)) {
 | 
					 | 
				
			||||||
                    const inventoryItem = inventory[equipmentName].find(item => item._id?.toString() === itemId);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    if (!inventoryItem) {
 | 
					 | 
				
			||||||
                        throw new Error(`inventory item ${equipmentName} not found with id ${itemId}`);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    //config ids are 0,1,2 can there be a 3?
 | 
					 | 
				
			||||||
                    for (const [configId, config] of Object.entries(itemConfigEntries)) {
 | 
					 | 
				
			||||||
                        inventoryItem.Configs[parseInt(configId)] = config;
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            case "CurrentLoadOutIds": {
 | 
					            case "CurrentLoadOutIds": {
 | 
				
			||||||
                const loadoutIds = equipment as IOid[]; // TODO: Check for more than just an array of oids, I think i remember one instance
 | 
					                const loadoutIds = equipment as IOid[]; // TODO: Check for more than just an array of oids, I think i remember one instance
 | 
				
			||||||
                inventory.CurrentLoadOutIds = loadoutIds;
 | 
					                inventory.CurrentLoadOutIds = loadoutIds;
 | 
				
			||||||
@ -178,11 +141,30 @@ export const handleInventoryItemConfigChange = async (
 | 
				
			|||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            default: {
 | 
					            default: {
 | 
				
			||||||
                logger.warn(`loadout category not implemented, changes may be lost: ${equipmentName}`, {
 | 
					                if (equipmentKeys.includes(equipmentName as TEquipmentKey) && equipmentName != "ValidNewLoadoutId") {
 | 
				
			||||||
                    config: equipment
 | 
					                    logger.debug(`general Item config saved of type ${equipmentName}`, {
 | 
				
			||||||
                });
 | 
					                        config: equipment
 | 
				
			||||||
 | 
					                    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    const itemEntries = equipment as IItemEntry;
 | 
				
			||||||
 | 
					                    for (const [itemId, itemConfigEntries] of Object.entries(itemEntries)) {
 | 
				
			||||||
 | 
					                        const inventoryItem = inventory[equipmentName].find(item => item._id?.toString() === itemId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        if (!inventoryItem) {
 | 
				
			||||||
 | 
					                            throw new Error(`inventory item ${equipmentName} not found with id ${itemId}`);
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        for (const [configId, config] of Object.entries(itemConfigEntries)) {
 | 
				
			||||||
 | 
					                            inventoryItem.Configs[parseInt(configId)] = config;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                    logger.warn(`loadout category not implemented, changes may be lost: ${equipmentName}`, {
 | 
				
			||||||
 | 
					                        config: equipment
 | 
				
			||||||
 | 
					                    });
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            //case "KahlLoadOuts": not sure yet how to handle kahl: it is not sent in inventory
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    await inventory.save();
 | 
					    await inventory.save();
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,14 @@
 | 
				
			|||||||
import { IMongoDate, IOid } from "@/src/types/commonTypes";
 | 
					import { IMongoDate, IOid } from "@/src/types/commonTypes";
 | 
				
			||||||
import { Types } from "mongoose";
 | 
					import { Types } from "mongoose";
 | 
				
			||||||
 | 
					import {
 | 
				
			||||||
 | 
					    ICrewShipCustomization,
 | 
				
			||||||
 | 
					    ICrewShipMembersClient,
 | 
				
			||||||
 | 
					    ICrewShipMembersDatabase,
 | 
				
			||||||
 | 
					    ICrewShipWeapon,
 | 
				
			||||||
 | 
					    IFlavourItem,
 | 
				
			||||||
 | 
					    IKubrowPetDetailsClient,
 | 
				
			||||||
 | 
					    IKubrowPetDetailsDatabase
 | 
				
			||||||
 | 
					} from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IPolarity {
 | 
					export interface IPolarity {
 | 
				
			||||||
    Slot: number;
 | 
					    Slot: number;
 | 
				
			||||||
@ -79,11 +88,16 @@ export interface IEquipmentSelection {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IEquipmentClient
 | 
					export interface IEquipmentClient
 | 
				
			||||||
    extends Omit<IEquipmentDatabase, "_id" | "InfestationDate" | "Expiry" | "UpgradesExpiry"> {
 | 
					    extends Omit<
 | 
				
			||||||
 | 
					        IEquipmentDatabase,
 | 
				
			||||||
 | 
					        "_id" | "InfestationDate" | "Expiry" | "UpgradesExpiry" | "CrewMembers" | "Details"
 | 
				
			||||||
 | 
					    > {
 | 
				
			||||||
    ItemId: IOid;
 | 
					    ItemId: IOid;
 | 
				
			||||||
    InfestationDate?: IMongoDate;
 | 
					    InfestationDate?: IMongoDate;
 | 
				
			||||||
    Expiry?: IMongoDate;
 | 
					    Expiry?: IMongoDate;
 | 
				
			||||||
    UpgradesExpiry?: IMongoDate;
 | 
					    UpgradesExpiry?: IMongoDate;
 | 
				
			||||||
 | 
					    CrewMembers?: ICrewShipMembersClient;
 | 
				
			||||||
 | 
					    Details?: IKubrowPetDetailsClient;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export enum EquipmentFeatures {
 | 
					export enum EquipmentFeatures {
 | 
				
			||||||
@ -120,6 +134,11 @@ export interface IEquipmentDatabase {
 | 
				
			|||||||
    DefensiveUpgrade?: string;
 | 
					    DefensiveUpgrade?: string;
 | 
				
			||||||
    UpgradesExpiry?: Date;
 | 
					    UpgradesExpiry?: Date;
 | 
				
			||||||
    ArchonCrystalUpgrades?: IArchonCrystalUpgrade[];
 | 
					    ArchonCrystalUpgrades?: IArchonCrystalUpgrade[];
 | 
				
			||||||
 | 
					    Weapon?: ICrewShipWeapon;
 | 
				
			||||||
 | 
					    Customization?: ICrewShipCustomization;
 | 
				
			||||||
 | 
					    RailjackImage?: IFlavourItem;
 | 
				
			||||||
 | 
					    CrewMembers?: ICrewShipMembersDatabase;
 | 
				
			||||||
 | 
					    Details?: IKubrowPetDetailsDatabase;
 | 
				
			||||||
    _id: Types.ObjectId;
 | 
					    _id: Types.ObjectId;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -28,9 +28,9 @@ export interface IInventoryDatabase
 | 
				
			|||||||
        | "Upgrades"
 | 
					        | "Upgrades"
 | 
				
			||||||
        | "CrewShipSalvagedWeaponSkins"
 | 
					        | "CrewShipSalvagedWeaponSkins"
 | 
				
			||||||
        | "CrewShipWeaponSkins"
 | 
					        | "CrewShipWeaponSkins"
 | 
				
			||||||
        | "OperatorLoadOuts"
 | 
					 | 
				
			||||||
        | "AdultOperatorLoadOuts"
 | 
					        | "AdultOperatorLoadOuts"
 | 
				
			||||||
        | "CrewShips"
 | 
					        | "OperatorLoadOuts"
 | 
				
			||||||
 | 
					        | "KahlLoadOuts"
 | 
				
			||||||
        | "InfestedFoundry"
 | 
					        | "InfestedFoundry"
 | 
				
			||||||
        | "DialogueHistory"
 | 
					        | "DialogueHistory"
 | 
				
			||||||
        | TEquipmentKey
 | 
					        | TEquipmentKey
 | 
				
			||||||
@ -49,9 +49,9 @@ export interface IInventoryDatabase
 | 
				
			|||||||
    Upgrades: IUpgradeDatabase[];
 | 
					    Upgrades: IUpgradeDatabase[];
 | 
				
			||||||
    CrewShipSalvagedWeaponSkins: IUpgradeDatabase[];
 | 
					    CrewShipSalvagedWeaponSkins: IUpgradeDatabase[];
 | 
				
			||||||
    CrewShipWeaponSkins: IUpgradeDatabase[];
 | 
					    CrewShipWeaponSkins: IUpgradeDatabase[];
 | 
				
			||||||
    OperatorLoadOuts: IOperatorConfigDatabase[];
 | 
					 | 
				
			||||||
    AdultOperatorLoadOuts: IOperatorConfigDatabase[];
 | 
					    AdultOperatorLoadOuts: IOperatorConfigDatabase[];
 | 
				
			||||||
    CrewShips: ICrewShipDatabase[];
 | 
					    OperatorLoadOuts: IOperatorConfigDatabase[];
 | 
				
			||||||
 | 
					    KahlLoadOuts: IOperatorConfigDatabase[];
 | 
				
			||||||
    InfestedFoundry?: IInfestedFoundryDatabase;
 | 
					    InfestedFoundry?: IInfestedFoundryDatabase;
 | 
				
			||||||
    DialogueHistory?: IDialogueHistoryDatabase;
 | 
					    DialogueHistory?: IDialogueHistoryDatabase;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -68,6 +68,16 @@ export interface IInventoryDatabase
 | 
				
			|||||||
    Hoverboards: IEquipmentDatabase[];
 | 
					    Hoverboards: IEquipmentDatabase[];
 | 
				
			||||||
    OperatorAmps: IEquipmentDatabase[];
 | 
					    OperatorAmps: IEquipmentDatabase[];
 | 
				
			||||||
    MoaPets: IEquipmentDatabase[];
 | 
					    MoaPets: IEquipmentDatabase[];
 | 
				
			||||||
 | 
					    Scoops: IEquipmentDatabase[];
 | 
				
			||||||
 | 
					    Horses: IEquipmentDatabase[];
 | 
				
			||||||
 | 
					    DrifterGuns: IEquipmentDatabase[];
 | 
				
			||||||
 | 
					    DrifterMelee: IEquipmentDatabase[];
 | 
				
			||||||
 | 
					    Motorcycles: IEquipmentDatabase[];
 | 
				
			||||||
 | 
					    CrewShips: IEquipmentDatabase[];
 | 
				
			||||||
 | 
					    DataKnives: IEquipmentDatabase[];
 | 
				
			||||||
 | 
					    MechSuits: IEquipmentDatabase[];
 | 
				
			||||||
 | 
					    CrewShipHarnesses: IEquipmentDatabase[];
 | 
				
			||||||
 | 
					    KubrowPets: IEquipmentDatabase[];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IQuestKeyDatabase {
 | 
					export interface IQuestKeyDatabase {
 | 
				
			||||||
@ -97,7 +107,17 @@ export const equipmentKeys = [
 | 
				
			|||||||
    "SpaceMelee",
 | 
					    "SpaceMelee",
 | 
				
			||||||
    "Hoverboards",
 | 
					    "Hoverboards",
 | 
				
			||||||
    "OperatorAmps",
 | 
					    "OperatorAmps",
 | 
				
			||||||
    "MoaPets"
 | 
					    "MoaPets",
 | 
				
			||||||
 | 
					    "Scoops",
 | 
				
			||||||
 | 
					    "Horses",
 | 
				
			||||||
 | 
					    "DrifterGuns",
 | 
				
			||||||
 | 
					    "DrifterMelee",
 | 
				
			||||||
 | 
					    "Motorcycles",
 | 
				
			||||||
 | 
					    "CrewShips",
 | 
				
			||||||
 | 
					    "DataKnives",
 | 
				
			||||||
 | 
					    "MechSuits",
 | 
				
			||||||
 | 
					    "CrewShipHarnesses",
 | 
				
			||||||
 | 
					    "KubrowPets"
 | 
				
			||||||
] as const;
 | 
					] as const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export type TEquipmentKey = (typeof equipmentKeys)[number];
 | 
					export type TEquipmentKey = (typeof equipmentKeys)[number];
 | 
				
			||||||
@ -171,13 +191,22 @@ export interface IInventoryClient extends IDailyAffiliations {
 | 
				
			|||||||
    Hoverboards: IEquipmentClient[];
 | 
					    Hoverboards: IEquipmentClient[];
 | 
				
			||||||
    OperatorAmps: IEquipmentClient[];
 | 
					    OperatorAmps: IEquipmentClient[];
 | 
				
			||||||
    MoaPets: IEquipmentClient[];
 | 
					    MoaPets: IEquipmentClient[];
 | 
				
			||||||
 | 
					    Scoops: IEquipmentClient[];
 | 
				
			||||||
 | 
					    Horses: IEquipmentClient[];
 | 
				
			||||||
 | 
					    DrifterGuns: IEquipmentClient[];
 | 
				
			||||||
 | 
					    DrifterMelee: IEquipmentClient[];
 | 
				
			||||||
 | 
					    Motorcycles: IEquipmentClient[];
 | 
				
			||||||
 | 
					    CrewShips: IEquipmentClient[];
 | 
				
			||||||
 | 
					    DataKnives: IEquipmentClient[];
 | 
				
			||||||
 | 
					    MechSuits: IEquipmentClient[];
 | 
				
			||||||
 | 
					    CrewShipHarnesses: IEquipmentClient[];
 | 
				
			||||||
 | 
					    KubrowPets: IEquipmentClient[];
 | 
				
			||||||
 | 
					    AdultOperatorLoadOuts: IOperatorConfigClient[];
 | 
				
			||||||
 | 
					    OperatorLoadOuts: IOperatorConfigClient[];
 | 
				
			||||||
 | 
					    KahlLoadOuts: IOperatorConfigClient[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Horses: IEquipmentDatabase[];
 | 
					 | 
				
			||||||
    DrifterMelee: IEquipmentDatabase[];
 | 
					 | 
				
			||||||
    DrifterGuns: IEquipmentDatabase[];
 | 
					 | 
				
			||||||
    DuviriInfo: IDuviriInfo;
 | 
					    DuviriInfo: IDuviriInfo;
 | 
				
			||||||
    Mailbox?: IMailboxClient;
 | 
					    Mailbox?: IMailboxClient;
 | 
				
			||||||
    KahlLoadOuts: IEquipmentDatabase[];
 | 
					 | 
				
			||||||
    SubscribedToEmails: number;
 | 
					    SubscribedToEmails: number;
 | 
				
			||||||
    Created: IMongoDate;
 | 
					    Created: IMongoDate;
 | 
				
			||||||
    RewardSeed: number;
 | 
					    RewardSeed: number;
 | 
				
			||||||
@ -212,7 +241,6 @@ export interface IInventoryClient extends IDailyAffiliations {
 | 
				
			|||||||
    QuestKeys: IQuestKeyClient[];
 | 
					    QuestKeys: IQuestKeyClient[];
 | 
				
			||||||
    ActiveQuest: string;
 | 
					    ActiveQuest: string;
 | 
				
			||||||
    FlavourItems: IFlavourItem[];
 | 
					    FlavourItems: IFlavourItem[];
 | 
				
			||||||
    Scoops: IEquipmentDatabase[];
 | 
					 | 
				
			||||||
    LoadOutPresets: ILoadOutPresets;
 | 
					    LoadOutPresets: ILoadOutPresets;
 | 
				
			||||||
    CurrentLoadOutIds: IOid[]; //TODO: we store it in the database using this representation as well :/
 | 
					    CurrentLoadOutIds: IOid[]; //TODO: we store it in the database using this representation as well :/
 | 
				
			||||||
    Missions: IMission[];
 | 
					    Missions: IMission[];
 | 
				
			||||||
@ -267,7 +295,6 @@ export interface IInventoryClient extends IDailyAffiliations {
 | 
				
			|||||||
    Drones: IDrone[];
 | 
					    Drones: IDrone[];
 | 
				
			||||||
    StepSequencers: IStepSequencer[];
 | 
					    StepSequencers: IStepSequencer[];
 | 
				
			||||||
    ActiveAvatarImageType: string;
 | 
					    ActiveAvatarImageType: string;
 | 
				
			||||||
    KubrowPets: IEquipmentDatabase[];
 | 
					 | 
				
			||||||
    ShipDecorations: IConsumable[];
 | 
					    ShipDecorations: IConsumable[];
 | 
				
			||||||
    DiscoveredMarkers: IDiscoveredMarker[];
 | 
					    DiscoveredMarkers: IDiscoveredMarker[];
 | 
				
			||||||
    CompletedJobs: ICompletedJob[];
 | 
					    CompletedJobs: ICompletedJob[];
 | 
				
			||||||
@ -284,7 +311,6 @@ export interface IInventoryClient extends IDailyAffiliations {
 | 
				
			|||||||
    BountyScore: number;
 | 
					    BountyScore: number;
 | 
				
			||||||
    ChallengeInstanceStates: IChallengeInstanceState[];
 | 
					    ChallengeInstanceStates: IChallengeInstanceState[];
 | 
				
			||||||
    LoginMilestoneRewards: string[];
 | 
					    LoginMilestoneRewards: string[];
 | 
				
			||||||
    OperatorLoadOuts: IOperatorConfigClient[];
 | 
					 | 
				
			||||||
    RecentVendorPurchases: Array<number | string>;
 | 
					    RecentVendorPurchases: Array<number | string>;
 | 
				
			||||||
    NodeIntrosCompleted: string[];
 | 
					    NodeIntrosCompleted: string[];
 | 
				
			||||||
    GuildId?: IOid;
 | 
					    GuildId?: IOid;
 | 
				
			||||||
@ -292,13 +318,10 @@ export interface IInventoryClient extends IDailyAffiliations {
 | 
				
			|||||||
    SeasonChallengeHistory: ISeasonChallenge[];
 | 
					    SeasonChallengeHistory: ISeasonChallenge[];
 | 
				
			||||||
    EquippedInstrument?: string;
 | 
					    EquippedInstrument?: string;
 | 
				
			||||||
    InvasionChainProgress: IInvasionChainProgress[];
 | 
					    InvasionChainProgress: IInvasionChainProgress[];
 | 
				
			||||||
    DataKnives: IEquipmentDatabase[];
 | 
					 | 
				
			||||||
    Motorcycles: IEquipmentDatabase[];
 | 
					 | 
				
			||||||
    NemesisHistory: INemesisHistory[];
 | 
					    NemesisHistory: INemesisHistory[];
 | 
				
			||||||
    LastNemesisAllySpawnTime?: IMongoDate;
 | 
					    LastNemesisAllySpawnTime?: IMongoDate;
 | 
				
			||||||
    Settings: ISettings;
 | 
					    Settings: ISettings;
 | 
				
			||||||
    PersonalTechProjects: IPersonalTechProject[];
 | 
					    PersonalTechProjects: IPersonalTechProject[];
 | 
				
			||||||
    CrewShips: ICrewShipClient[];
 | 
					 | 
				
			||||||
    PlayerSkills: IPlayerSkills;
 | 
					    PlayerSkills: IPlayerSkills;
 | 
				
			||||||
    CrewShipAmmo: IConsumable[];
 | 
					    CrewShipAmmo: IConsumable[];
 | 
				
			||||||
    CrewShipSalvagedWeaponSkins: IUpgradeClient[];
 | 
					    CrewShipSalvagedWeaponSkins: IUpgradeClient[];
 | 
				
			||||||
@ -308,13 +331,10 @@ export interface IInventoryClient extends IDailyAffiliations {
 | 
				
			|||||||
    TradeBannedUntil?: IMongoDate;
 | 
					    TradeBannedUntil?: IMongoDate;
 | 
				
			||||||
    PlayedParkourTutorial: boolean;
 | 
					    PlayedParkourTutorial: boolean;
 | 
				
			||||||
    SubscribedToEmailsPersonalized: number;
 | 
					    SubscribedToEmailsPersonalized: number;
 | 
				
			||||||
    MechSuits: IEquipmentDatabase[];
 | 
					 | 
				
			||||||
    InfestedFoundry?: IInfestedFoundryClient;
 | 
					    InfestedFoundry?: IInfestedFoundryClient;
 | 
				
			||||||
    BlessingCooldown: IMongoDate;
 | 
					    BlessingCooldown: IMongoDate;
 | 
				
			||||||
    CrewShipHarnesses: IEquipmentDatabase[];
 | 
					 | 
				
			||||||
    CrewShipRawSalvage: IConsumable[];
 | 
					    CrewShipRawSalvage: IConsumable[];
 | 
				
			||||||
    CrewMembers: ICrewMember[];
 | 
					    CrewMembers: ICrewMember[];
 | 
				
			||||||
    AdultOperatorLoadOuts: IOperatorConfigClient[];
 | 
					 | 
				
			||||||
    LotusCustomization: ILotusCustomization;
 | 
					    LotusCustomization: ILotusCustomization;
 | 
				
			||||||
    UseAdultOperatorLoadout?: boolean;
 | 
					    UseAdultOperatorLoadout?: boolean;
 | 
				
			||||||
    NemesisAbandonedRewards: string[];
 | 
					    NemesisAbandonedRewards: string[];
 | 
				
			||||||
@ -458,22 +478,6 @@ export interface IUpgradeDatabase extends Omit<IUpgradeClient, "ItemId"> {
 | 
				
			|||||||
    _id: Types.ObjectId;
 | 
					    _id: Types.ObjectId;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface ICrewShipClient {
 | 
					 | 
				
			||||||
    ItemType: string;
 | 
					 | 
				
			||||||
    Configs: IItemConfig[];
 | 
					 | 
				
			||||||
    Weapon?: ICrewShipWeapon;
 | 
					 | 
				
			||||||
    Customization?: ICrewShipCustomization;
 | 
					 | 
				
			||||||
    ItemName: string;
 | 
					 | 
				
			||||||
    RailjackImage?: IFlavourItem;
 | 
					 | 
				
			||||||
    CrewMembers?: ICrewShipMembersClient;
 | 
					 | 
				
			||||||
    ItemId: IOid;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export interface ICrewShipDatabase extends Omit<ICrewShipClient, "CrewMembers" | "ItemId"> {
 | 
					 | 
				
			||||||
    CrewMembers?: ICrewShipMembersDatabase;
 | 
					 | 
				
			||||||
    _id: Types.ObjectId;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export interface ICrewShipMembersClient {
 | 
					export interface ICrewShipMembersClient {
 | 
				
			||||||
    SLOT_A?: ICrewShipMemberClient;
 | 
					    SLOT_A?: ICrewShipMemberClient;
 | 
				
			||||||
    SLOT_B?: ICrewShipMemberClient;
 | 
					    SLOT_B?: ICrewShipMemberClient;
 | 
				
			||||||
@ -647,19 +651,23 @@ export enum KubrowPetPrintItemType {
 | 
				
			|||||||
    LotusTypesGameKubrowPetImprintedTraitPrint = "/Lotus/Types/Game/KubrowPet/ImprintedTraitPrint"
 | 
					    LotusTypesGameKubrowPetImprintedTraitPrint = "/Lotus/Types/Game/KubrowPet/ImprintedTraitPrint"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IDetails {
 | 
					export interface IKubrowPetDetailsDatabase {
 | 
				
			||||||
    Name: string;
 | 
					    Name: string;
 | 
				
			||||||
    IsPuppy: boolean;
 | 
					    IsPuppy: boolean;
 | 
				
			||||||
    HasCollar: boolean;
 | 
					    HasCollar: boolean;
 | 
				
			||||||
    PrintsRemaining: number;
 | 
					    PrintsRemaining: number;
 | 
				
			||||||
    Status: Status;
 | 
					    Status: Status;
 | 
				
			||||||
    HatchDate: IMongoDate;
 | 
					    HatchDate: Date;
 | 
				
			||||||
    DominantTraits: ITraits;
 | 
					    DominantTraits: ITraits;
 | 
				
			||||||
    RecessiveTraits: ITraits;
 | 
					    RecessiveTraits: ITraits;
 | 
				
			||||||
    IsMale: boolean;
 | 
					    IsMale: boolean;
 | 
				
			||||||
    Size: number;
 | 
					    Size: number;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export interface IKubrowPetDetailsClient extends Omit<IKubrowPetDetailsDatabase, "HatchDate"> {
 | 
				
			||||||
 | 
					    HatchDate: IMongoDate;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export enum Status {
 | 
					export enum Status {
 | 
				
			||||||
    StatusAvailable = "STATUS_AVAILABLE",
 | 
					    StatusAvailable = "STATUS_AVAILABLE",
 | 
				
			||||||
    StatusStasis = "STATUS_STASIS"
 | 
					    StatusStasis = "STATUS_STASIS"
 | 
				
			||||||
 | 
				
			|||||||
@ -39,19 +39,6 @@ export type IMissionInventoryUpdateRequest = {
 | 
				
			|||||||
    GoalTag: string;
 | 
					    GoalTag: string;
 | 
				
			||||||
    LevelKeyName: string;
 | 
					    LevelKeyName: string;
 | 
				
			||||||
    ActiveBoosters?: IBooster[];
 | 
					    ActiveBoosters?: IBooster[];
 | 
				
			||||||
    Suits?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    LongGuns?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    Pistols?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    Melee?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    SpecialItems?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    Sentinels?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    SentinelWeapons?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    SpaceSuits?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    SpaceGuns?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    SpaceMelee?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    Hoverboards?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    OperatorAmps?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    MoaPets?: IEquipmentClient[];
 | 
					 | 
				
			||||||
    FusionBundles?: ITypeCount[];
 | 
					    FusionBundles?: ITypeCount[];
 | 
				
			||||||
    RawUpgrades?: IRawUpgrade[];
 | 
					    RawUpgrades?: IRawUpgrade[];
 | 
				
			||||||
    MiscItems?: ITypeCount[];
 | 
					    MiscItems?: ITypeCount[];
 | 
				
			||||||
@ -85,6 +72,9 @@ export type IMissionInventoryUpdateRequest = {
 | 
				
			|||||||
    FpsMax: number;
 | 
					    FpsMax: number;
 | 
				
			||||||
    FpsSamples: number;
 | 
					    FpsSamples: number;
 | 
				
			||||||
    EvolutionProgress?: IEvolutionProgress[];
 | 
					    EvolutionProgress?: IEvolutionProgress[];
 | 
				
			||||||
 | 
					    FocusXpIncreases?: number[];
 | 
				
			||||||
 | 
					} & {
 | 
				
			||||||
 | 
					    [K in TEquipmentKey]?: IEquipmentClient[];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IRewardInfo {
 | 
					export interface IRewardInfo {
 | 
				
			||||||
 | 
				
			|||||||
@ -27,9 +27,9 @@ export interface ISaveLoadoutRequest {
 | 
				
			|||||||
    Horses: IItemEntry;
 | 
					    Horses: IItemEntry;
 | 
				
			||||||
    DrifterMelee: IItemEntry;
 | 
					    DrifterMelee: IItemEntry;
 | 
				
			||||||
    UpgradeVer: number;
 | 
					    UpgradeVer: number;
 | 
				
			||||||
    OperatorLoadOuts: IOperatorConfigEntry;
 | 
					 | 
				
			||||||
    AdultOperatorLoadOuts: IOperatorConfigEntry;
 | 
					    AdultOperatorLoadOuts: IOperatorConfigEntry;
 | 
				
			||||||
    KahlLoadOuts: IItemEntry;
 | 
					    OperatorLoadOuts: IOperatorConfigEntry;
 | 
				
			||||||
 | 
					    KahlLoadOuts: IOperatorConfigEntry;
 | 
				
			||||||
    CrewShips: IItemEntry;
 | 
					    CrewShips: IItemEntry;
 | 
				
			||||||
    CurrentLoadOutIds: IOid[];
 | 
					    CurrentLoadOutIds: IOid[];
 | 
				
			||||||
    ValidNewLoadoutId: string;
 | 
					    ValidNewLoadoutId: string;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user