remove instances of HydratedDocument<IInventoryDatabase>
Some checks failed
Build / build (22) (push) Failing after 40s
Build / build (20) (push) Failing after 1m16s
Build / build (18) (push) Failing after 1m12s
Build / build (18) (pull_request) Failing after 43s
Build / build (20) (pull_request) Failing after 1m14s
Build / build (22) (pull_request) Failing after 1m16s
Some checks failed
Build / build (22) (push) Failing after 40s
Build / build (20) (push) Failing after 1m16s
Build / build (18) (push) Failing after 1m12s
Build / build (18) (pull_request) Failing after 43s
Build / build (20) (pull_request) Failing after 1m14s
Build / build (22) (pull_request) Failing after 1m16s
This commit is contained in:
parent
0a8f2b9559
commit
067b524af1
@ -1,10 +1,6 @@
|
|||||||
import {
|
import { Inventory, TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
Inventory,
|
|
||||||
InventoryDocumentProps,
|
|
||||||
TInventoryDatabaseDocument
|
|
||||||
} from "@/src/models/inventoryModels/inventoryModel";
|
|
||||||
import { config } from "@/src/services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { HydratedDocument, Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { SlotNames, IInventoryChanges, IBinChanges, slotNames } from "@/src/types/purchaseTypes";
|
import { SlotNames, IInventoryChanges, IBinChanges, slotNames } from "@/src/types/purchaseTypes";
|
||||||
import {
|
import {
|
||||||
IChallengeProgress,
|
IChallengeProgress,
|
||||||
@ -19,7 +15,6 @@ import {
|
|||||||
TEquipmentKey,
|
TEquipmentKey,
|
||||||
IFusionTreasure,
|
IFusionTreasure,
|
||||||
IDailyAffiliations,
|
IDailyAffiliations,
|
||||||
IInventoryDatabase,
|
|
||||||
IKubrowPetEggDatabase,
|
IKubrowPetEggDatabase,
|
||||||
IKubrowPetEggClient,
|
IKubrowPetEggClient,
|
||||||
ILibraryDailyTaskInfo,
|
ILibraryDailyTaskInfo,
|
||||||
@ -129,7 +124,7 @@ const awakeningRewards = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const addStartingGear = async (
|
export const addStartingGear = async (
|
||||||
inventory: HydratedDocument<IInventoryDatabase, InventoryDocumentProps>,
|
inventory: TInventoryDatabaseDocument,
|
||||||
startingGear: TPartialStartingGear | undefined = undefined
|
startingGear: TPartialStartingGear | undefined = undefined
|
||||||
): Promise<IInventoryChanges> => {
|
): Promise<IInventoryChanges> => {
|
||||||
const { LongGuns, Pistols, Suits, Melee } = startingGear || {
|
const { LongGuns, Pistols, Suits, Melee } = startingGear || {
|
||||||
@ -1375,7 +1370,7 @@ export const addBooster = (ItemType: string, time: number, inventory: TInventory
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const updateSyndicate = (
|
export const updateSyndicate = (
|
||||||
inventory: HydratedDocument<IInventoryDatabase, InventoryDocumentProps>,
|
inventory: TInventoryDatabaseDocument,
|
||||||
syndicateUpdate: IMissionInventoryUpdateRequest["AffiliationChanges"]
|
syndicateUpdate: IMissionInventoryUpdateRequest["AffiliationChanges"]
|
||||||
): void => {
|
): void => {
|
||||||
syndicateUpdate?.forEach(affiliation => {
|
syndicateUpdate?.forEach(affiliation => {
|
||||||
|
@ -32,10 +32,10 @@ import {
|
|||||||
updateSyndicate
|
updateSyndicate
|
||||||
} from "@/src/services/inventoryService";
|
} from "@/src/services/inventoryService";
|
||||||
import { updateQuestKey } from "@/src/services/questService";
|
import { updateQuestKey } from "@/src/services/questService";
|
||||||
import { HydratedDocument, Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { getLevelKeyRewards, toStoreItem } from "@/src/services/itemDataService";
|
import { getLevelKeyRewards, toStoreItem } from "@/src/services/itemDataService";
|
||||||
import { InventoryDocumentProps, TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
import { 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";
|
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { handleStoreItemAcquisition } from "./purchaseService";
|
import { handleStoreItemAcquisition } from "./purchaseService";
|
||||||
@ -73,7 +73,7 @@ const getRandomRewardByChance = (pool: IReward[]): IRngResult | undefined => {
|
|||||||
//const knownUnhandledKeys: readonly string[] = ["test"] as const; // for unimplemented but important keys
|
//const knownUnhandledKeys: readonly string[] = ["test"] as const; // for unimplemented but important keys
|
||||||
|
|
||||||
export const addMissionInventoryUpdates = async (
|
export const addMissionInventoryUpdates = async (
|
||||||
inventory: HydratedDocument<IInventoryDatabase, InventoryDocumentProps>,
|
inventory: TInventoryDatabaseDocument,
|
||||||
inventoryUpdates: IMissionInventoryUpdateRequest
|
inventoryUpdates: IMissionInventoryUpdateRequest
|
||||||
): Promise<IInventoryChanges> => {
|
): Promise<IInventoryChanges> => {
|
||||||
const inventoryChanges: IInventoryChanges = {};
|
const inventoryChanges: IInventoryChanges = {};
|
||||||
@ -661,7 +661,7 @@ interface IMissionCredits {
|
|||||||
//creditBonus is not entirely accurate.
|
//creditBonus is not entirely accurate.
|
||||||
//TODO: consider ActiveBoosters
|
//TODO: consider ActiveBoosters
|
||||||
export const addCredits = (
|
export const addCredits = (
|
||||||
inventory: HydratedDocument<IInventoryDatabase>,
|
inventory: TInventoryDatabaseDocument,
|
||||||
{
|
{
|
||||||
missionDropCredits,
|
missionDropCredits,
|
||||||
missionCompletionCredits,
|
missionCompletionCredits,
|
||||||
|
@ -9,14 +9,9 @@ import {
|
|||||||
getLevelKeyRewards,
|
getLevelKeyRewards,
|
||||||
getQuestCompletionItems
|
getQuestCompletionItems
|
||||||
} from "@/src/services/itemDataService";
|
} from "@/src/services/itemDataService";
|
||||||
import {
|
import { IQuestKeyClient, IQuestKeyDatabase, IQuestStage } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
IInventoryDatabase,
|
|
||||||
IQuestKeyClient,
|
|
||||||
IQuestKeyDatabase,
|
|
||||||
IQuestStage
|
|
||||||
} from "@/src/types/inventoryTypes/inventoryTypes";
|
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { HydratedDocument, Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { ExportKeys } from "warframe-public-export-plus";
|
import { ExportKeys } from "warframe-public-export-plus";
|
||||||
import { addFixedLevelRewards } from "./missionInventoryUpdateService";
|
import { addFixedLevelRewards } from "./missionInventoryUpdateService";
|
||||||
import { IInventoryChanges } from "../types/purchaseTypes";
|
import { IInventoryChanges } from "../types/purchaseTypes";
|
||||||
@ -31,7 +26,7 @@ export interface IUpdateQuestRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const updateQuestKey = async (
|
export const updateQuestKey = async (
|
||||||
inventory: HydratedDocument<IInventoryDatabase>,
|
inventory: TInventoryDatabaseDocument,
|
||||||
questKeyUpdate: IUpdateQuestRequest["QuestKeys"]
|
questKeyUpdate: IUpdateQuestRequest["QuestKeys"]
|
||||||
): Promise<IInventoryChanges> => {
|
): Promise<IInventoryChanges> => {
|
||||||
if (questKeyUpdate.length > 1) {
|
if (questKeyUpdate.length > 1) {
|
||||||
@ -45,7 +40,7 @@ export const updateQuestKey = async (
|
|||||||
throw new Error(`quest key ${questKeyUpdate[0].ItemType} not found`);
|
throw new Error(`quest key ${questKeyUpdate[0].ItemType} not found`);
|
||||||
}
|
}
|
||||||
|
|
||||||
inventory.QuestKeys[questKeyIndex] = questKeyUpdate[0];
|
inventory.QuestKeys[questKeyIndex].overwrite(questKeyUpdate[0]);
|
||||||
|
|
||||||
let inventoryChanges: IInventoryChanges = {};
|
let inventoryChanges: IInventoryChanges = {};
|
||||||
if (questKeyUpdate[0].Completed) {
|
if (questKeyUpdate[0].Completed) {
|
||||||
@ -57,12 +52,12 @@ export const updateQuestKey = async (
|
|||||||
logger.debug(`quest completion items`, questCompletionItems);
|
logger.debug(`quest completion items`, questCompletionItems);
|
||||||
|
|
||||||
if (questCompletionItems) {
|
if (questCompletionItems) {
|
||||||
inventoryChanges = await addItems(inventory as TInventoryDatabaseDocument, questCompletionItems);
|
inventoryChanges = await addItems(inventory, questCompletionItems);
|
||||||
}
|
}
|
||||||
inventory.ActiveQuest = "";
|
inventory.ActiveQuest = "";
|
||||||
|
|
||||||
if (questKeyUpdate[0].ItemType == "/Lotus/Types/Keys/NewWarQuest/NewWarQuestKeyChain") {
|
if (questKeyUpdate[0].ItemType == "/Lotus/Types/Keys/NewWarQuest/NewWarQuestKeyChain") {
|
||||||
setupKahlSyndicate(inventory as TInventoryDatabaseDocument);
|
setupKahlSyndicate(inventory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return inventoryChanges;
|
return inventoryChanges;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user