Compare commits

..

1 Commits

Author SHA1 Message Date
939d3a3ec2 support legacy oid for BrandedSuits
All checks were successful
Build / build (push) Successful in 1m42s
Build / build (pull_request) Successful in 1m4s
2025-05-09 09:06:13 +02:00
3 changed files with 8 additions and 3 deletions

View File

@ -327,6 +327,11 @@ export const getInventoryResponse = async (
for (const upgrade of inventoryResponse.Upgrades) {
toLegacyOid(upgrade.ItemId);
}
if (inventoryResponse.BrandedSuits) {
for (const id of inventoryResponse.BrandedSuits) {
toLegacyOid(id);
}
}
}
}
}

View File

@ -26,7 +26,7 @@ export const toOid = (objectId: Types.ObjectId): IOid => {
export function toOid2(objectId: Types.ObjectId, buildLabel: undefined): IOid;
export function toOid2(objectId: Types.ObjectId, buildLabel: string | undefined): IOidWithLegacySupport;
export function toOid2(objectId: Types.ObjectId, buildLabel: string | undefined): IOidWithLegacySupport {
if (buildLabel && version_compare(buildLabel, "2017.03.02.14.59") >= 0) {
if (buildLabel && version_compare(buildLabel, "2016.12.21.19.13") <= 0) {
return { $id: objectId.toString() };
}
return { $oid: objectId.toString() };

View File

@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Types } from "mongoose";
import { IOid, IMongoDate } from "../commonTypes";
import { IOid, IMongoDate, IOidWithLegacySupport } from "../commonTypes";
import {
IColor,
IItemConfig,
@ -371,7 +371,7 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
EchoesHexConquestCacheScoreMission?: number;
EchoesHexConquestActiveFrameVariants?: string[];
EchoesHexConquestActiveStickers?: string[];
BrandedSuits?: IOid[];
BrandedSuits?: IOidWithLegacySupport[];
LockedWeaponGroup?: ILockedWeaponGroupClient;
HubNpcCustomizations?: IHubNpcCustomization[];
Ship?: IOrbiter; // U22 and below, response only