feat: add dev.keepVendorsExpired config option (#2161)
Reviewed-on: OpenWF/SpaceNinjaServer#2161 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									b67ddf6df2
								
							
						
					
					
						commit
						12d09531b3
					
				@ -50,6 +50,7 @@
 | 
			
		||||
  "noDojoResearchTime": false,
 | 
			
		||||
  "fastClanAscension": false,
 | 
			
		||||
  "spoofMasteryRank": -1,
 | 
			
		||||
  "nightwaveStandingMultiplier": 1,
 | 
			
		||||
  "worldState": {
 | 
			
		||||
    "creditBoost": false,
 | 
			
		||||
    "affinityBoost": false,
 | 
			
		||||
@ -58,5 +59,8 @@
 | 
			
		||||
    "eidolonOverride": "",
 | 
			
		||||
    "vallisOverride": "",
 | 
			
		||||
    "nightwaveOverride": ""
 | 
			
		||||
  },
 | 
			
		||||
  "dev": {
 | 
			
		||||
    "keepVendorsExpired": false
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -2,6 +2,7 @@ import { RequestHandler } from "express";
 | 
			
		||||
import { applyStandingToVendorManifest, getVendorManifestByTypeName } from "@/src/services/serversideVendorsService";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { config } from "@/src/services/configService";
 | 
			
		||||
 | 
			
		||||
export const getVendorInfoController: RequestHandler = async (req, res) => {
 | 
			
		||||
    let manifest = getVendorManifestByTypeName(req.query.vendor as string);
 | 
			
		||||
@ -14,6 +15,14 @@ export const getVendorInfoController: RequestHandler = async (req, res) => {
 | 
			
		||||
        const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
        const inventory = await getInventory(accountId);
 | 
			
		||||
        manifest = applyStandingToVendorManifest(inventory, manifest);
 | 
			
		||||
        if (config.dev?.keepVendorsExpired) {
 | 
			
		||||
            manifest = {
 | 
			
		||||
                VendorInfo: {
 | 
			
		||||
                    ...manifest.VendorInfo,
 | 
			
		||||
                    Expiry: { $date: { $numberLong: "0" } }
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    res.json(manifest);
 | 
			
		||||
 | 
			
		||||
@ -56,6 +56,7 @@ interface IConfig {
 | 
			
		||||
    noDojoResearchTime?: boolean;
 | 
			
		||||
    fastClanAscension?: boolean;
 | 
			
		||||
    spoofMasteryRank?: number;
 | 
			
		||||
    nightwaveStandingMultiplier?: number;
 | 
			
		||||
    worldState?: {
 | 
			
		||||
        creditBoost?: boolean;
 | 
			
		||||
        affinityBoost?: boolean;
 | 
			
		||||
@ -65,7 +66,9 @@ interface IConfig {
 | 
			
		||||
        vallisOverride?: string;
 | 
			
		||||
        nightwaveOverride?: string;
 | 
			
		||||
    };
 | 
			
		||||
    nightwaveStandingMultiplier?: number;
 | 
			
		||||
    dev?: {
 | 
			
		||||
        keepVendorsExpired?: boolean;
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export const configPath = path.join(repoDir, "config.json");
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user