Compare commits

..

1 Commits

Author SHA1 Message Date
5ef5a68e51 support legacy oid for BrandedSuits
Some checks failed
Build / build (push) Has been cancelled
Build / build (pull_request) Successful in 1m42s
2025-05-09 09:05:14 +02:00
3 changed files with 3 additions and 8 deletions

View File

@ -327,11 +327,6 @@ export const getInventoryResponse = async (
for (const upgrade of inventoryResponse.Upgrades) { for (const upgrade of inventoryResponse.Upgrades) {
toLegacyOid(upgrade.ItemId); 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: undefined): IOid;
export function toOid2(objectId: Types.ObjectId, buildLabel: string | undefined): IOidWithLegacySupport; export function toOid2(objectId: Types.ObjectId, buildLabel: string | undefined): IOidWithLegacySupport;
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, "2016.12.21.19.13") <= 0) { if (buildLabel && version_compare(buildLabel, "2017.03.02.14.59") >= 0) {
return { $id: objectId.toString() }; return { $id: objectId.toString() };
} }
return { $oid: objectId.toString() }; return { $oid: objectId.toString() };

View File

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