forked from OpenWF/SpaceNinjaServer
		
	Compare commits
	
		
			11 Commits
		
	
	
		
			999d6cb5fc
			...
			b0471fcc2d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| b0471fcc2d | |||
| d7a93463c0 | |||
| f6b73e58da | |||
| 28b8fb3e78 | |||
| 895e76b45e | |||
| 71d0c140ae | |||
| f06a3b8187 | |||
| ffcbbb480b | |||
| dfd1fb834b | |||
| 2c43d897c0 | |||
| 217eb1f61b | 
@ -13,6 +13,7 @@
 | 
			
		||||
        "node": true
 | 
			
		||||
    },
 | 
			
		||||
    "rules": {
 | 
			
		||||
        "@typescript-eslint/consistent-type-imports": "error",
 | 
			
		||||
        "@typescript-eslint/explicit-function-return-type": "error",
 | 
			
		||||
        "@typescript-eslint/restrict-template-expressions": "error",
 | 
			
		||||
        "@typescript-eslint/restrict-plus-operands": "error",
 | 
			
		||||
 | 
			
		||||
@ -13,37 +13,15 @@
 | 
			
		||||
  "skipTutorial": false,
 | 
			
		||||
  "skipAllDialogue": false,
 | 
			
		||||
  "unlockAllScans": false,
 | 
			
		||||
  "claimingBlueprintRefundsIngredients": false,
 | 
			
		||||
  "dontSubtractPurchaseCreditCost": false,
 | 
			
		||||
  "dontSubtractPurchasePlatinumCost": false,
 | 
			
		||||
  "dontSubtractPurchaseItemCost": false,
 | 
			
		||||
  "dontSubtractPurchaseStandingCost": false,
 | 
			
		||||
  "dontSubtractVoidTraces": false,
 | 
			
		||||
  "dontSubtractConsumables": false,
 | 
			
		||||
  "unlockAllShipFeatures": false,
 | 
			
		||||
  "unlockAllShipDecorations": false,
 | 
			
		||||
  "unlockAllFlavourItems": false,
 | 
			
		||||
  "unlockAllSkins": false,
 | 
			
		||||
  "unlockAllCapturaScenes": false,
 | 
			
		||||
  "universalPolarityEverywhere": false,
 | 
			
		||||
  "unlockDoubleCapacityPotatoesEverywhere": false,
 | 
			
		||||
  "unlockExilusEverywhere": false,
 | 
			
		||||
  "unlockArcanesEverywhere": false,
 | 
			
		||||
  "noDailyStandingLimits": false,
 | 
			
		||||
  "noDailyFocusLimit": false,
 | 
			
		||||
  "noArgonCrystalDecay": false,
 | 
			
		||||
  "noMasteryRankUpCooldown": false,
 | 
			
		||||
  "noVendorPurchaseLimits": false,
 | 
			
		||||
  "noDeathMarks": false,
 | 
			
		||||
  "noKimCooldowns": false,
 | 
			
		||||
  "fullyStockedVendors": false,
 | 
			
		||||
  "baroAlwaysAvailable": false,
 | 
			
		||||
  "baroFullyStocked": false,
 | 
			
		||||
  "syndicateMissionsRepeatable": false,
 | 
			
		||||
  "unlockAllProfitTakerStages": false,
 | 
			
		||||
  "instantFinishRivenChallenge": false,
 | 
			
		||||
  "instantResourceExtractorDrones": false,
 | 
			
		||||
  "noResourceExtractorDronesDamage": false,
 | 
			
		||||
  "skipClanKeyCrafting": false,
 | 
			
		||||
  "noDojoRoomBuildStage": false,
 | 
			
		||||
  "noDecoBuildStage": false,
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const abandonLibraryDailyTaskController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -9,7 +9,7 @@ import {
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const abortDojoComponentController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@ import { getDojoClient, getGuildForRequestEx, hasAccessToDojo, hasGuildPermissio
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const abortDojoComponentDestructionController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -8,13 +8,12 @@ import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { addMods, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getRandomElement } from "@/src/services/rngService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportUpgrades } from "warframe-public-export-plus";
 | 
			
		||||
import { config } from "@/src/services/configService";
 | 
			
		||||
 | 
			
		||||
export const activateRandomModController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
    const inventory = await getInventory(accountId, "RawUpgrades Upgrades instantFinishRivenChallenge");
 | 
			
		||||
    const request = getJSONfromString<IActiveRandomModRequest>(String(req.body));
 | 
			
		||||
    addMods(inventory, [
 | 
			
		||||
        {
 | 
			
		||||
@ -23,7 +22,7 @@ export const activateRandomModController: RequestHandler = async (req, res) => {
 | 
			
		||||
        }
 | 
			
		||||
    ]);
 | 
			
		||||
    const rivenType = getRandomElement(rivenRawToRealWeighted[request.ItemType])!;
 | 
			
		||||
    const fingerprint = config.instantFinishRivenChallenge
 | 
			
		||||
    const fingerprint = inventory.instantFinishRivenChallenge
 | 
			
		||||
        ? createUnveiledRivenFingerprint(ExportUpgrades[rivenType])
 | 
			
		||||
        : createVeiledRivenFingerprint(ExportUpgrades[rivenType]);
 | 
			
		||||
    const upgradeIndex =
 | 
			
		||||
 | 
			
		||||
@ -3,8 +3,8 @@ import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { Friendship } from "@/src/models/friendModel";
 | 
			
		||||
import { addAccountDataToFriendInfo, addInventoryDataToFriendInfo } from "@/src/services/friendService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IFriendInfo } from "@/src/types/friendTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IFriendInfo } from "@/src/types/friendTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const addFriendController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,8 @@ import { toOid } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { Account, Ignore } from "@/src/models/loginModel";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IFriendInfo } from "@/src/types/friendTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IFriendInfo } from "@/src/types/friendTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const addIgnoredUserController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -5,8 +5,8 @@ import { Account } from "@/src/models/loginModel";
 | 
			
		||||
import { addInventoryDataToFriendInfo, areFriendsOfFriends } from "@/src/services/friendService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IFriendInfo } from "@/src/types/friendTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IFriendInfo } from "@/src/types/friendTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const addPendingFriendController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const payload = getJSONfromString<IAddPendingFriendRequest>(String(req.body));
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,7 @@ import { getEffectiveAvatarImageType, getInventory } from "@/src/services/invent
 | 
			
		||||
import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportFlavour } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
export const addToAllianceController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -6,10 +6,11 @@ import { hasGuildPermission } from "@/src/services/guildService";
 | 
			
		||||
import { createMessage } from "@/src/services/inboxService";
 | 
			
		||||
import { getEffectiveAvatarImageType, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountForRequest, getAccountIdForRequest, getSuffixedName } from "@/src/services/loginService";
 | 
			
		||||
import { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import { GuildPermission, IGuildMemberClient } from "@/src/types/guildTypes";
 | 
			
		||||
import type { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import type { IGuildMemberClient } from "@/src/types/guildTypes";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportFlavour } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
export const addToGuildController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const adoptPetController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getPersonalRooms } from "@/src/services/personalRoomsService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const apartmentController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getInventory, addMods } from "@/src/services/inventoryService";
 | 
			
		||||
import { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import type { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
 | 
			
		||||
export const arcaneCommonController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { colorToShard, combineColors, shardToColor } from "@/src/helpers/shardHelper";
 | 
			
		||||
 | 
			
		||||
export const archonFusionController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -3,9 +3,10 @@ import { createVeiledRivenFingerprint, rivenRawToRealWeighted } from "@/src/help
 | 
			
		||||
import { addMiscItems, addMods, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getRandomElement, getRandomWeightedReward, getRandomWeightedRewardUc } from "@/src/services/rngService";
 | 
			
		||||
import { IUpgradeFromClient } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import { ExportBoosterPacks, ExportUpgrades, TRarity } from "warframe-public-export-plus";
 | 
			
		||||
import type { IUpgradeFromClient } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import type { TRarity } from "warframe-public-export-plus";
 | 
			
		||||
import { ExportBoosterPacks, ExportUpgrades } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
export const artifactTransmutationController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import { IInventoryClient, IUpgradeClient } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import type { IInventoryClient, IUpgradeClient } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { addMods, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
 | 
			
		||||
export const artifactsController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,7 @@ import { getGuildForRequestEx, hasGuildPermission } from "@/src/services/guildSe
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const cancelGuildAdvertisementController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,8 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getDojoClient, getGuildForRequestEx, hasAccessToDojo, hasGuildPermission } from "@/src/services/guildService";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { GuildPermission, IDojoComponentDatabase } from "@/src/types/guildTypes";
 | 
			
		||||
import type { IDojoComponentDatabase } from "@/src/types/guildTypes";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { Types } from "mongoose";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@ import { GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import { getGuildForRequest, hasGuildPermissionEx } from "@/src/services/guildService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const changeGuildRankController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const checkDailyMissionBonusController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const account = await getAccountForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,10 @@
 | 
			
		||||
//this is a controller for the claimCompletedRecipe route
 | 
			
		||||
//it will claim a recipe for the user
 | 
			
		||||
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { getRecipe } from "@/src/services/itemDataService";
 | 
			
		||||
import { IOid, IOidWithLegacySupport } from "@/src/types/commonTypes";
 | 
			
		||||
import type { IOid, IOidWithLegacySupport } from "@/src/types/commonTypes";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import {
 | 
			
		||||
@ -18,13 +18,14 @@ import {
 | 
			
		||||
    addPowerSuit,
 | 
			
		||||
    addEquipment
 | 
			
		||||
} from "@/src/services/inventoryService";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { InventorySlot, IPendingRecipeDatabase } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { IPendingRecipeDatabase } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { toOid2 } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import { IRecipe } from "warframe-public-export-plus";
 | 
			
		||||
import { config } from "@/src/services/configService";
 | 
			
		||||
import { EquipmentFeatures, IEquipmentClient, Status } from "@/src/types/equipmentTypes";
 | 
			
		||||
import type { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import type { IRecipe } from "warframe-public-export-plus";
 | 
			
		||||
import type { IEquipmentClient } from "@/src/types/equipmentTypes";
 | 
			
		||||
import { EquipmentFeatures, Status } from "@/src/types/equipmentTypes";
 | 
			
		||||
 | 
			
		||||
interface IClaimCompletedRecipeRequest {
 | 
			
		||||
    RecipeIds: IOid[];
 | 
			
		||||
@ -247,7 +248,7 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (
 | 
			
		||||
            config.claimingBlueprintRefundsIngredients &&
 | 
			
		||||
            inventory.claimingBlueprintRefundsIngredients &&
 | 
			
		||||
            recipe.secretIngredientAction != "SIA_CREATE_KUBROW" // Can't refund the egg
 | 
			
		||||
        ) {
 | 
			
		||||
            await refundRecipeIngredients(inventory, InventoryChanges, recipe, pendingRecipe);
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@ import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { combineInventoryChanges, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportChallenges } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
export const claimJunctionChallengeRewardController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import { addFusionPoints, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const claimLibraryDailyTaskRewardController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const clearDialogueHistoryController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
// example req.body: {"NewEpisodeReward":true,"crossPlaySetting":"ENABLED"}
 | 
			
		||||
export const clearNewEpisodeRewardController: RequestHandler = (_req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,8 @@ import { checkCalendarAutoAdvance, getCalendarProgress, getInventory } from "@/s
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
			
		||||
import { getWorldState } from "@/src/services/worldStateService";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
// GET request; query parameters: CompletedEventIdx=0&Iteration=4&Version=19&Season=CST_SUMMER
 | 
			
		||||
export const completeCalendarEventController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,10 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { addMiscItems, getInventory, updateCurrency } from "@/src/services/inventoryService";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { IVeiledRivenFingerprint } from "@/src/helpers/rivenHelper";
 | 
			
		||||
import type { IVeiledRivenFingerprint } from "@/src/helpers/rivenHelper";
 | 
			
		||||
 | 
			
		||||
export const completeRandomModChallengeController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import { Alliance, AllianceMember, Guild, GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import { getAllianceClient } from "@/src/services/guildService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const confirmAllianceInvitationController: RequestHandler = async (req, res) => {
 | 
			
		||||
    // Check requester is a warlord in their guild
 | 
			
		||||
 | 
			
		||||
@ -11,8 +11,8 @@ import {
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountForRequest, getAccountIdForRequest, getSuffixedName } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { Types } from "mongoose";
 | 
			
		||||
 | 
			
		||||
// GET request: A player accepting an invite they got in their inbox.
 | 
			
		||||
@ -95,7 +95,10 @@ export const confirmGuildInvitationPostController: RequestHandler = async (req,
 | 
			
		||||
        await GuildMember.deleteMany({ accountId: guildMember.accountId, status: 1 });
 | 
			
		||||
 | 
			
		||||
        // Update inventory of new member
 | 
			
		||||
        const inventory = await getInventory(guildMember.accountId.toString(), "GuildId LevelKeys Recipes");
 | 
			
		||||
        const inventory = await getInventory(
 | 
			
		||||
            guildMember.accountId.toString(),
 | 
			
		||||
            "GuildId LevelKeys Recipes skipClanKeyCrafting"
 | 
			
		||||
        );
 | 
			
		||||
        inventory.GuildId = new Types.ObjectId(req.query.clanId as string);
 | 
			
		||||
        giveClanKey(inventory);
 | 
			
		||||
        await inventory.save();
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@ import { Guild } from "@/src/models/guildModel";
 | 
			
		||||
import { checkClanAscensionHasRequiredContributors } from "@/src/services/guildService";
 | 
			
		||||
import { addFusionPoints, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { Types } from "mongoose";
 | 
			
		||||
 | 
			
		||||
export const contributeGuildClassController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,6 @@
 | 
			
		||||
import { GuildMember, TGuildDatabaseDocument } from "@/src/models/guildModel";
 | 
			
		||||
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import type { TGuildDatabaseDocument } from "@/src/models/guildModel";
 | 
			
		||||
import { GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import type { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import {
 | 
			
		||||
    addGuildMemberMiscItemContribution,
 | 
			
		||||
    getDojoClient,
 | 
			
		||||
@ -11,11 +12,12 @@ import {
 | 
			
		||||
} from "@/src/services/guildService";
 | 
			
		||||
import { addMiscItems, getInventory, updateCurrency } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IDojoContributable, IGuildMemberDatabase } from "@/src/types/guildTypes";
 | 
			
		||||
import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import { ExportDojoRecipes, IDojoBuild } from "warframe-public-export-plus";
 | 
			
		||||
import type { IDojoContributable, IGuildMemberDatabase } from "@/src/types/guildTypes";
 | 
			
		||||
import type { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import type { IDojoBuild } from "warframe-public-export-plus";
 | 
			
		||||
import { ExportDojoRecipes } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
interface IContributeToDojoComponentRequest {
 | 
			
		||||
    ComponentId: string;
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,5 @@
 | 
			
		||||
import {
 | 
			
		||||
    Alliance,
 | 
			
		||||
    Guild,
 | 
			
		||||
    GuildMember,
 | 
			
		||||
    TGuildDatabaseDocument,
 | 
			
		||||
    TGuildMemberDatabaseDocument
 | 
			
		||||
} from "@/src/models/guildModel";
 | 
			
		||||
import type { TGuildDatabaseDocument, TGuildMemberDatabaseDocument } from "@/src/models/guildModel";
 | 
			
		||||
import { Alliance, Guild, GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import {
 | 
			
		||||
    addGuildMemberMiscItemContribution,
 | 
			
		||||
    addGuildMemberShipDecoContribution,
 | 
			
		||||
@ -21,9 +16,9 @@ import {
 | 
			
		||||
    updateCurrency
 | 
			
		||||
} from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { ITypeCount } from "@/src/types/commonTypes";
 | 
			
		||||
import { IFusionTreasure, IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { ITypeCount } from "@/src/types/commonTypes";
 | 
			
		||||
import type { IFusionTreasure, IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const contributeToVaultController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@ import { getAllianceClient } from "@/src/services/guildService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const createAllianceController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,10 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { Guild, GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import { createUniqueClanName, getGuildClient, giveClanKey } from "@/src/services/guildService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
 | 
			
		||||
export const createGuildController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const account = await getAccountForRequest(req);
 | 
			
		||||
@ -27,7 +27,7 @@ export const createGuildController: RequestHandler = async (req, res) => {
 | 
			
		||||
        rank: 0
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys Recipes");
 | 
			
		||||
    const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys Recipes skipClanKeyCrafting");
 | 
			
		||||
    inventory.GuildId = guild._id;
 | 
			
		||||
    const inventoryChanges: IInventoryChanges = {};
 | 
			
		||||
    giveClanKey(inventory, inventoryChanges);
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import type { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { ICrewMemberClient } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { ICrewMemberClient } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { Types } from "mongoose";
 | 
			
		||||
 | 
			
		||||
export const crewMembersController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,11 @@
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { addMiscItems, freeUpSlot, getInventory, updateCurrency } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import { ICrewShipComponentFingerprint, InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import type { ICrewShipComponentFingerprint } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportCustoms, ExportDojoRecipes } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
export const crewShipFusionController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -5,14 +5,17 @@ import {
 | 
			
		||||
    addEquipment
 | 
			
		||||
} from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import { ICrewShipComponentFingerprint, IInnateDamageFingerprint } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import type {
 | 
			
		||||
    ICrewShipComponentFingerprint,
 | 
			
		||||
    IInnateDamageFingerprint
 | 
			
		||||
} from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { ExportCustoms, ExportRailjackWeapons, ExportUpgrades } from "warframe-public-export-plus";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { getRandomInt } from "@/src/services/rngService";
 | 
			
		||||
import { IFingerprintStat } from "@/src/helpers/rivenHelper";
 | 
			
		||||
import { IEquipmentDatabase } from "@/src/types/equipmentTypes";
 | 
			
		||||
import type { IFingerprintStat } from "@/src/helpers/rivenHelper";
 | 
			
		||||
import type { IEquipmentDatabase } from "@/src/types/equipmentTypes";
 | 
			
		||||
 | 
			
		||||
export const crewShipIdentifySalvageController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,7 @@ import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountForRequest, getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const customObstacleCourseLeaderboardController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const data = getJSONfromString<ICustomObstacleCourseLeaderboardRequest>(String(req.body));
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,8 @@
 | 
			
		||||
import { getGuildForRequest, hasGuildPermission } from "@/src/services/guildService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission, IGuildRank } from "@/src/types/guildTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IGuildRank } from "@/src/types/guildTypes";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const customizeGuildRanksController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import { AllianceMember, GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const declineAllianceInviteController: RequestHandler = async (req, res) => {
 | 
			
		||||
    // Check requester is a warlord in their guild
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import { GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const declineGuildInviteController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { deleteSession } from "@/src/managers/sessionManager";
 | 
			
		||||
 | 
			
		||||
const deleteSessionController: RequestHandler = (_req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@ import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const destroyDojoDecoController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,7 @@ import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { parallelForeach } from "@/src/utils/async-utils";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const divvyAllianceVaultController: RequestHandler = async (req, res) => {
 | 
			
		||||
    // Afaict, there's no way to put anything other than credits in the alliance vault (anymore?), so just no-op if this is not a request to divvy credits.
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,12 @@
 | 
			
		||||
import { GuildMember, TGuildDatabaseDocument } from "@/src/models/guildModel";
 | 
			
		||||
import type { TGuildDatabaseDocument } from "@/src/models/guildModel";
 | 
			
		||||
import { GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import { getDojoClient, getGuildForRequestEx, hasAccessToDojo, scaleRequiredCount } from "@/src/services/guildService";
 | 
			
		||||
import { getInventory, updateCurrency } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IDojoContributable } from "@/src/types/guildTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import { ExportDojoRecipes, IDojoBuild } from "warframe-public-export-plus";
 | 
			
		||||
import type { IDojoContributable } from "@/src/types/guildTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import type { IDojoBuild } from "warframe-public-export-plus";
 | 
			
		||||
import { ExportDojoRecipes } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
interface IDojoComponentRushRequest {
 | 
			
		||||
    DecoType?: string;
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
// Arbiter Dojo endpoints, not really used by us as we don't provide a ContentURL.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,13 +1,12 @@
 | 
			
		||||
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { config } from "@/src/services/configService";
 | 
			
		||||
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { fromStoreItem } from "@/src/services/itemDataService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getRandomInt, getRandomWeightedRewardUc } from "@/src/services/rngService";
 | 
			
		||||
import { IMongoDate, IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import { IDroneClient } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IMongoDate, IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import type { IDroneClient } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportDrones, ExportResources, ExportSystems } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
export const dronesController: RequestHandler = async (req, res) => {
 | 
			
		||||
@ -39,10 +38,13 @@ export const dronesController: RequestHandler = async (req, res) => {
 | 
			
		||||
            ActiveDrones: activeDrones
 | 
			
		||||
        });
 | 
			
		||||
    } else if ("droneId" in req.query && "systemIndex" in req.query) {
 | 
			
		||||
        const inventory = await getInventory(accountId, "Drones");
 | 
			
		||||
        const inventory = await getInventory(
 | 
			
		||||
            accountId,
 | 
			
		||||
            "Drones instantResourceExtractorDrones noResourceExtractorDronesDamage"
 | 
			
		||||
        );
 | 
			
		||||
        const drone = inventory.Drones.id(req.query.droneId as string)!;
 | 
			
		||||
        const droneMeta = ExportDrones[drone.ItemType];
 | 
			
		||||
        drone.DeployTime = config.instantResourceExtractorDrones ? new Date(0) : new Date();
 | 
			
		||||
        drone.DeployTime = inventory.instantResourceExtractorDrones ? new Date(0) : new Date();
 | 
			
		||||
        if (drone.RepairStart) {
 | 
			
		||||
            const repairMinutes = (Date.now() - drone.RepairStart.getTime()) / 60_000;
 | 
			
		||||
            const hpPerMinute = droneMeta.repairRate / 60;
 | 
			
		||||
@ -51,11 +53,11 @@ export const dronesController: RequestHandler = async (req, res) => {
 | 
			
		||||
        }
 | 
			
		||||
        drone.System = parseInt(req.query.systemIndex as string);
 | 
			
		||||
        const system = ExportSystems[drone.System - 1];
 | 
			
		||||
        drone.DamageTime = config.instantResourceExtractorDrones
 | 
			
		||||
        drone.DamageTime = inventory.instantResourceExtractorDrones
 | 
			
		||||
            ? new Date()
 | 
			
		||||
            : new Date(Date.now() + getRandomInt(3 * 3600 * 1000, 4 * 3600 * 1000));
 | 
			
		||||
        drone.PendingDamage =
 | 
			
		||||
            !config.noResourceExtractorDronesDamage && Math.random() < system.damageChance
 | 
			
		||||
            !inventory.noResourceExtractorDronesDamage && Math.random() < system.damageChance
 | 
			
		||||
                ? getRandomInt(system.droneDamage.minValue, system.droneDamage.maxValue)
 | 
			
		||||
                : 0;
 | 
			
		||||
        const resource = getRandomWeightedRewardUc(system.resources, droneMeta.probabilities)!;
 | 
			
		||||
 | 
			
		||||
@ -1,13 +1,14 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { combineInventoryChanges, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { IEndlessXpReward, IInventoryClient, TEndlessXpCategory } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IEndlessXpReward, IInventoryClient, TEndlessXpCategory } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { ExportRewards, ICountedStoreItem } from "warframe-public-export-plus";
 | 
			
		||||
import type { ICountedStoreItem } from "warframe-public-export-plus";
 | 
			
		||||
import { ExportRewards } from "warframe-public-export-plus";
 | 
			
		||||
import { getRandomElement } from "@/src/services/rngService";
 | 
			
		||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
 | 
			
		||||
export const endlessXpController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@ import { toMongoDate } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getInventory, updateEntratiVault } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const entratiLabConquestModeController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,9 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getRecipe, WeaponTypeInternal } from "@/src/services/itemDataService";
 | 
			
		||||
import type { WeaponTypeInternal } from "@/src/services/itemDataService";
 | 
			
		||||
import { getRecipe } from "@/src/services/itemDataService";
 | 
			
		||||
import { EquipmentFeatures } from "@/src/types/equipmentTypes";
 | 
			
		||||
 | 
			
		||||
export const evolveWeaponController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getSession } from "@/src/managers/sessionManager";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { IFindSessionRequest } from "@/src/types/session";
 | 
			
		||||
import type { IFindSessionRequest } from "@/src/types/session";
 | 
			
		||||
 | 
			
		||||
export const findSessionsController: RequestHandler = (_req, res) => {
 | 
			
		||||
    const req = JSON.parse(String(_req.body)) as IFindSessionRequest;
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { addMiscItems, addStanding, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportResources } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
export const fishmongerController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,8 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getInventory, addMiscItems, addEquipment, occupySlot } from "@/src/services/inventoryService";
 | 
			
		||||
import { IMiscItem, TFocusPolarity, TEquipmentKey, InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IMiscItem, TFocusPolarity, TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { ExportFocusUpgrades } from "warframe-public-export-plus";
 | 
			
		||||
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportResources } from "warframe-public-export-plus";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { addFusionTreasures, addMiscItems, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { parseFusionTreasure } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
 | 
			
		||||
interface IFusionTreasureRequest {
 | 
			
		||||
 | 
			
		||||
@ -4,11 +4,11 @@ import { addMiscItem, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { toStoreItem } from "@/src/services/itemDataService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { createGarden, getPersonalRooms } from "@/src/services/personalRoomsService";
 | 
			
		||||
import { IMongoDate } from "@/src/types/commonTypes";
 | 
			
		||||
import { IMissionReward } from "@/src/types/missionTypes";
 | 
			
		||||
import { IGardeningClient, IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IMongoDate } from "@/src/types/commonTypes";
 | 
			
		||||
import type { IMissionReward } from "@/src/types/missionTypes";
 | 
			
		||||
import type { IGardeningClient, IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { dict_en, ExportResources } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
export const gardeningController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { updateGeneric } from "@/src/services/inventoryService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { IGenericUpdate } from "@/src/types/genericUpdate";
 | 
			
		||||
import type { IGenericUpdate } from "@/src/types/genericUpdate";
 | 
			
		||||
 | 
			
		||||
// This endpoint used to be /api/genericUpdate.php, but sometime around the Jade Shadows update, it was changed to /api/updateNodeIntros.php.
 | 
			
		||||
// SpaceNinjaServer supports both endpoints right now.
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@ import { Alliance, Guild } from "@/src/models/guildModel";
 | 
			
		||||
import { getAllianceClient } from "@/src/services/guildService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const getAllianceController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
import { DailyDeal } from "@/src/models/worldStateModel";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const getDailyDealStockLevelsController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const dailyDeal = (await DailyDeal.findOne({ StoreItem: req.query.productName }, "AmountSold"))!;
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,8 @@ import { toOid } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { Friendship } from "@/src/models/friendModel";
 | 
			
		||||
import { addAccountDataToFriendInfo, addInventoryDataToFriendInfo } from "@/src/services/friendService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IFriendInfo } from "@/src/types/friendTypes";
 | 
			
		||||
import { Request, RequestHandler, Response } from "express";
 | 
			
		||||
import type { IFriendInfo } from "@/src/types/friendTypes";
 | 
			
		||||
import type { Request, RequestHandler, Response } from "express";
 | 
			
		||||
 | 
			
		||||
// POST with {} instead of GET as of 38.5.0
 | 
			
		||||
export const getFriendsController: RequestHandler = async (req: Request, res: Response) => {
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
import { GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IGuildMemberClient } from "@/src/types/guildTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IGuildMemberClient } from "@/src/types/guildTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const getGuildContributionsController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { Guild } from "@/src/models/guildModel";
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { Types } from "mongoose";
 | 
			
		||||
import { Guild } from "@/src/models/guildModel";
 | 
			
		||||
import { getDojoClient } from "@/src/services/guildService";
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { Guild } from "@/src/models/guildModel";
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,8 @@ import { toMongoDate } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { Guild } from "@/src/models/guildModel";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IMongoDate } from "@/src/types/commonTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IMongoDate } from "@/src/types/commonTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const getGuildLogController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
import { toOid } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { Account, Ignore } from "@/src/models/loginModel";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IFriendInfo } from "@/src/types/friendTypes";
 | 
			
		||||
import type { IFriendInfo } from "@/src/types/friendTypes";
 | 
			
		||||
import { parallelForeach } from "@/src/utils/async-utils";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const getIgnoredUsersController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { generateRewardSeed } from "@/src/services/rngService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const getNewRewardSeedController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { EPOCH, getSeasonChallengePools, getWorldState, pushWeeklyActs } from "@/src/services/worldStateService";
 | 
			
		||||
import { unixTimesInMs } from "@/src/constants/timeConstants";
 | 
			
		||||
import { ISeasonChallenge } from "@/src/types/worldStateTypes";
 | 
			
		||||
import type { ISeasonChallenge } from "@/src/types/worldStateTypes";
 | 
			
		||||
import { ExportChallenges } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
export const getPastWeeklyChallengesController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { config } from "@/src/services/configService";
 | 
			
		||||
import allShipFeatures from "@/static/fixed_responses/allShipFeatures.json";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { createGarden, getPersonalRooms } from "@/src/services/personalRoomsService";
 | 
			
		||||
import { IGetShipResponse, IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
 | 
			
		||||
import type { IGetShipResponse, IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
 | 
			
		||||
import { getLoadout } from "@/src/services/loadoutService";
 | 
			
		||||
import { toOid } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { applyStandingToVendorManifest, getVendorManifestByTypeName } from "@/src/services/serversideVendorsService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,8 @@ import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { crackRelic } from "@/src/helpers/relicHelper";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IVoidTearParticipantInfo } from "@/src/types/requestTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IVoidTearParticipantInfo } from "@/src/types/requestTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const getVoidProjectionRewardsController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -10,9 +10,10 @@ import {
 | 
			
		||||
} from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
 | 
			
		||||
import { handleDailyDealPurchase, handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
			
		||||
import { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import { IPurchaseParams, IPurchaseResponse, PurchaseSource } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import type { IPurchaseParams, IPurchaseResponse } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { PurchaseSource } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportBundles, ExportFlavour } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
const checkPurchaseParams = (params: IPurchaseParams): boolean => {
 | 
			
		||||
 | 
			
		||||
@ -1,13 +1,14 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { sendWsBroadcastTo } from "@/src/services/wsService";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import type { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import { ExportRecipes } from "warframe-public-export-plus";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { EquipmentFeatures, IEquipmentClient } from "@/src/types/equipmentTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { IEquipmentClient } from "@/src/types/equipmentTypes";
 | 
			
		||||
import { EquipmentFeatures } from "@/src/types/equipmentTypes";
 | 
			
		||||
 | 
			
		||||
interface IGildWeaponRequest {
 | 
			
		||||
    ItemName: string;
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { parseString } from "@/src/helpers/general";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { giveKeyChainItem } from "@/src/services/questService";
 | 
			
		||||
import { IKeyChainRequest } from "@/src/types/requestTypes";
 | 
			
		||||
import type { IKeyChainRequest } from "@/src/types/requestTypes";
 | 
			
		||||
 | 
			
		||||
export const giveKeyChainTriggeredItemsController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = parseString(req.query.accountId);
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { giveKeyChainMessage } from "@/src/services/questService";
 | 
			
		||||
import { IKeyChainRequest } from "@/src/types/requestTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IKeyChainRequest } from "@/src/types/requestTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const giveKeyChainTriggeredMessageController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { addItem, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const giveQuestKeyRewardController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { addLoreFragmentScans, addShipDecorations, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { ITypeCount } from "@/src/types/commonTypes";
 | 
			
		||||
import { ILoreFragmentScan } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { ITypeCount } from "@/src/types/commonTypes";
 | 
			
		||||
import type { ILoreFragmentScan } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const giveShipDecoAndLoreFragmentController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { addStartingGear, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { TPartialStartingGear } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { TPartialStartingGear } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const giveStartingGearController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import {
 | 
			
		||||
    addGuildMemberMiscItemContribution,
 | 
			
		||||
    getGuildForRequestEx,
 | 
			
		||||
@ -25,14 +25,16 @@ import {
 | 
			
		||||
    occupySlot,
 | 
			
		||||
    updateCurrency
 | 
			
		||||
} from "@/src/services/inventoryService";
 | 
			
		||||
import { IMiscItem, InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { config } from "@/src/services/configService";
 | 
			
		||||
import { GuildPermission, ITechProjectClient } from "@/src/types/guildTypes";
 | 
			
		||||
import type { ITechProjectClient } from "@/src/types/guildTypes";
 | 
			
		||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
			
		||||
import { GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import type { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
 | 
			
		||||
export const guildTechController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { createNewSession } from "@/src/managers/sessionManager";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { ISession } from "@/src/types/session";
 | 
			
		||||
import type { ISession } from "@/src/types/session";
 | 
			
		||||
import { JSONParse } from "json-with-bigint";
 | 
			
		||||
import { toOid2, version_compare } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@ import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { addBooster, getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getRandomInt } from "@/src/services/rngService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportBoosters } from "warframe-public-export-plus";
 | 
			
		||||
 | 
			
		||||
export const hubBlessingController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
const hubController: RequestHandler = (_req, res) => {
 | 
			
		||||
    res.json("hub 127.0.0.1:6952");
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
const hubInstancesController: RequestHandler = (_req, res) => {
 | 
			
		||||
    res.json("list 50 1 0 0 scenarios 0 0 0 0 0 0");
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { Inbox } from "@/src/models/inboxModel";
 | 
			
		||||
import {
 | 
			
		||||
    createMessage,
 | 
			
		||||
@ -20,7 +20,7 @@ import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { ExportFlavour } from "warframe-public-export-plus";
 | 
			
		||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
			
		||||
import { fromStoreItem, isStoreItem } from "@/src/services/itemDataService";
 | 
			
		||||
import { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import type { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
 | 
			
		||||
export const inboxController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const { deleteId, lastMessage: latestClientMessageId, messageId } = req.query;
 | 
			
		||||
 | 
			
		||||
@ -1,15 +1,15 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getInventory, addMiscItems, updateCurrency, addRecipes, freeUpSlot } from "@/src/services/inventoryService";
 | 
			
		||||
import { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import {
 | 
			
		||||
import type { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import type {
 | 
			
		||||
    IConsumedSuit,
 | 
			
		||||
    IHelminthFoodRecord,
 | 
			
		||||
    IInventoryClient,
 | 
			
		||||
    IMiscItem,
 | 
			
		||||
    InventorySlot
 | 
			
		||||
    IMiscItem
 | 
			
		||||
} from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { ExportMisc } from "warframe-public-export-plus";
 | 
			
		||||
import { getRecipe } from "@/src/services/itemDataService";
 | 
			
		||||
import { toMongoDate, version_compare } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
 | 
			
		||||
@ -1,19 +1,16 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { Inventory, TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import type { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import { config } from "@/src/services/configService";
 | 
			
		||||
import allDialogue from "@/static/fixed_responses/allDialogue.json";
 | 
			
		||||
import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
 | 
			
		||||
import { IInventoryClient, IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { IPolarity, ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import {
 | 
			
		||||
    eFaction,
 | 
			
		||||
    ExportCustoms,
 | 
			
		||||
    ExportFlavour,
 | 
			
		||||
    ExportResources,
 | 
			
		||||
    ExportVirtuals,
 | 
			
		||||
    ICountedItem
 | 
			
		||||
} from "warframe-public-export-plus";
 | 
			
		||||
import type { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
 | 
			
		||||
import type { IInventoryClient, IShipInventory } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import type { IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import { ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import type { ICountedItem } from "warframe-public-export-plus";
 | 
			
		||||
import { eFaction, ExportCustoms, ExportFlavour, ExportResources, ExportVirtuals } from "warframe-public-export-plus";
 | 
			
		||||
import { applyCheatsToInfestedFoundry, handleSubsumeCompletion } from "@/src/services/infestedFoundryService";
 | 
			
		||||
import {
 | 
			
		||||
    addEmailItem,
 | 
			
		||||
@ -30,7 +27,7 @@ import { addString, catBreadHash } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { Types } from "mongoose";
 | 
			
		||||
import { getNemesisManifest } from "@/src/helpers/nemesisHelpers";
 | 
			
		||||
import { getPersonalRooms } from "@/src/services/personalRoomsService";
 | 
			
		||||
import { IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
 | 
			
		||||
import type { IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
 | 
			
		||||
import { Ship } from "@/src/models/shipModel";
 | 
			
		||||
import { toLegacyOid, toOid, version_compare } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { Inbox } from "@/src/models/inboxModel";
 | 
			
		||||
@ -68,7 +65,7 @@ export const inventoryController: RequestHandler = async (request, response) =>
 | 
			
		||||
            const lastLoginDay = Math.trunc(inventory.NextRefill.getTime() / 86400000) - 1;
 | 
			
		||||
            const daysPassed = today - lastLoginDay;
 | 
			
		||||
 | 
			
		||||
            if (config.noArgonCrystalDecay) {
 | 
			
		||||
            if (inventory.noArgonCrystalDecay) {
 | 
			
		||||
                inventory.FoundToday = undefined;
 | 
			
		||||
            } else {
 | 
			
		||||
                for (let i = 0; i != daysPassed; ++i) {
 | 
			
		||||
@ -387,7 +384,7 @@ export const getInventoryResponse = async (
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (config.universalPolarityEverywhere) {
 | 
			
		||||
    if (inventory.universalPolarityEverywhere) {
 | 
			
		||||
        const Polarity: IPolarity[] = [];
 | 
			
		||||
        // 12 is needed for necramechs. 15 is needed for plexus/crewshipharness.
 | 
			
		||||
        for (let i = 0; i != 15; ++i) {
 | 
			
		||||
@ -405,7 +402,7 @@ export const getInventoryResponse = async (
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (config.unlockDoubleCapacityPotatoesEverywhere) {
 | 
			
		||||
    if (inventory.unlockDoubleCapacityPotatoesEverywhere) {
 | 
			
		||||
        for (const key of equipmentKeys) {
 | 
			
		||||
            if (key in inventoryResponse) {
 | 
			
		||||
                for (const equipment of inventoryResponse[key]) {
 | 
			
		||||
@ -416,7 +413,7 @@ export const getInventoryResponse = async (
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (config.unlockExilusEverywhere) {
 | 
			
		||||
    if (inventory.unlockExilusEverywhere) {
 | 
			
		||||
        for (const key of equipmentKeys) {
 | 
			
		||||
            if (key in inventoryResponse) {
 | 
			
		||||
                for (const equipment of inventoryResponse[key]) {
 | 
			
		||||
@ -427,7 +424,7 @@ export const getInventoryResponse = async (
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (config.unlockArcanesEverywhere) {
 | 
			
		||||
    if (inventory.unlockArcanesEverywhere) {
 | 
			
		||||
        for (const key of equipmentKeys) {
 | 
			
		||||
            if (key in inventoryResponse) {
 | 
			
		||||
                for (const equipment of inventoryResponse[key]) {
 | 
			
		||||
@ -438,14 +435,14 @@ export const getInventoryResponse = async (
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (config.noDailyStandingLimits) {
 | 
			
		||||
    if (inventory.noDailyStandingLimits) {
 | 
			
		||||
        const spoofedDailyAffiliation = Math.max(999_999, 16000 + inventoryResponse.PlayerLevel * 500);
 | 
			
		||||
        for (const key of allDailyAffiliationKeys) {
 | 
			
		||||
            inventoryResponse[key] = spoofedDailyAffiliation;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (config.noDailyFocusLimit) {
 | 
			
		||||
    if (inventory.noDailyFocusLimit) {
 | 
			
		||||
        inventoryResponse.DailyFocus = Math.max(999_999, 250000 + inventoryResponse.PlayerLevel * 5000);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getInventory, updateCurrency, updateSlots } from "@/src/services/inventoryService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { exhaustive } from "@/src/utils/ts-utils";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getSessionByID } from "@/src/managers/sessionManager";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,11 +1,11 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
import { config } from "@/src/services/configService";
 | 
			
		||||
import { buildConfig } from "@/src/services/buildConfigService";
 | 
			
		||||
 | 
			
		||||
import { Account } from "@/src/models/loginModel";
 | 
			
		||||
import { createAccount, createNonce, getUsernameFromEmail, isCorrectPassword } from "@/src/services/loginService";
 | 
			
		||||
import { IDatabaseAccountJson, ILoginRequest, ILoginResponse } from "@/src/types/loginTypes";
 | 
			
		||||
import type { IDatabaseAccountJson, ILoginRequest, ILoginResponse } from "@/src/types/loginTypes";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { version_compare } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { sendWsBroadcastTo } from "@/src/services/wsService";
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import type { ILoginRewardsReponse } from "@/src/services/loginRewardService";
 | 
			
		||||
import {
 | 
			
		||||
    claimLoginReward,
 | 
			
		||||
    getRandomLoginRewards,
 | 
			
		||||
    ILoginRewardsReponse,
 | 
			
		||||
    isLoginRewardAChoice,
 | 
			
		||||
    setAccountGotLoginRewardToday
 | 
			
		||||
} from "@/src/services/loginRewardService";
 | 
			
		||||
 | 
			
		||||
@ -7,9 +7,9 @@ import {
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
			
		||||
import { sendWsBroadcastTo } from "@/src/services/wsService";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const loginRewardsSelectionController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const account = await getAccountForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { Account } from "@/src/models/loginModel";
 | 
			
		||||
import { sendWsBroadcastTo } from "@/src/services/wsService";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
const marketRecommendationsController: RequestHandler = (_req, res) => {
 | 
			
		||||
    const data = Buffer.from([
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
const marketSearchRecommendationsController: RequestHandler = (_req, res) => {
 | 
			
		||||
    res.sendStatus(200);
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const maturePetController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
 | 
			
		||||
@ -1,12 +1,12 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { getAccountForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { IMissionInventoryUpdateRequest } from "@/src/types/requestTypes";
 | 
			
		||||
import type { IMissionInventoryUpdateRequest } from "@/src/types/requestTypes";
 | 
			
		||||
import { addMissionInventoryUpdates, addMissionRewards } from "@/src/services/missionInventoryUpdateService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getInventoryResponse } from "@/src/controllers/api/inventoryController";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import {
 | 
			
		||||
import type {
 | 
			
		||||
    IMissionInventoryUpdateResponse,
 | 
			
		||||
    IMissionInventoryUpdateResponseBackToDryDock,
 | 
			
		||||
    IMissionInventoryUpdateResponseRailjackInterstitial
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { sendWsBroadcastTo } from "@/src/services/wsService";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
@ -13,12 +13,14 @@ import {
 | 
			
		||||
    combineInventoryChanges,
 | 
			
		||||
    addSpecialItem
 | 
			
		||||
} from "@/src/services/inventoryService";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { getDefaultUpgrades } from "@/src/services/itemDataService";
 | 
			
		||||
import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
 | 
			
		||||
import { getRandomInt } from "@/src/services/rngService";
 | 
			
		||||
import { ExportSentinels, ExportWeapons, IDefaultUpgrade } from "warframe-public-export-plus";
 | 
			
		||||
import { IEquipmentDatabase, Status } from "@/src/types/equipmentTypes";
 | 
			
		||||
import type { IDefaultUpgrade } from "warframe-public-export-plus";
 | 
			
		||||
import { ExportSentinels, ExportWeapons } from "warframe-public-export-plus";
 | 
			
		||||
import type { IEquipmentDatabase } from "@/src/types/equipmentTypes";
 | 
			
		||||
import { Status } from "@/src/types/equipmentTypes";
 | 
			
		||||
 | 
			
		||||
interface IModularCraftRequest {
 | 
			
		||||
    WeaponType: string;
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import type { RequestHandler } from "express";
 | 
			
		||||
import { ExportWeapons } from "warframe-public-export-plus";
 | 
			
		||||
import { IMongoDate } from "@/src/types/commonTypes";
 | 
			
		||||
import type { IMongoDate } from "@/src/types/commonTypes";
 | 
			
		||||
import { toMongoDate } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
import { SRng } from "@/src/services/rngService";
 | 
			
		||||
import { ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import type { ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import {
 | 
			
		||||
    addEquipment,
 | 
			
		||||
@ -17,7 +17,7 @@ import { getDefaultUpgrades } from "@/src/services/itemDataService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { sendWsBroadcastTo } from "@/src/services/wsService";
 | 
			
		||||
import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
 | 
			
		||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import type { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { EquipmentFeatures } from "@/src/types/equipmentTypes";
 | 
			
		||||
 | 
			
		||||
export const modularWeaponSaleController: RequestHandler = async (req, res) => {
 | 
			
		||||
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user