Merge branch 'main' into interface-names
This commit is contained in:
commit
28ec68a86a
@ -1,7 +1,30 @@
|
|||||||
|
import { updateGeneric } from "@/src/services/inventoryService";
|
||||||
|
import { IGenericUpdate } from "@/src/types/genericUpdate";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const genericUpdateController: RequestHandler = (_req, res) => {
|
// TODO: Nightwave evidence submission support is the only thing missing.
|
||||||
res.json({});
|
// TODO: Also, you might want to test this, because I definitely didn't.
|
||||||
|
const genericUpdateController: RequestHandler = async (request, response) => {
|
||||||
|
const accountId = request.query.accountId as string;
|
||||||
|
|
||||||
|
const [body] = String(request.body).split("\n");
|
||||||
|
|
||||||
|
let reply = {};
|
||||||
|
try {
|
||||||
|
const update = JSON.parse(body) as IGenericUpdate;
|
||||||
|
if (typeof update !== "object") {
|
||||||
|
throw new Error("Invalid data format");
|
||||||
|
}
|
||||||
|
|
||||||
|
reply = await updateGeneric(update, accountId);
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error parsing JSON data:", err);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Response support added for when Nightwave is supported below.
|
||||||
|
// response.json(reply);
|
||||||
|
|
||||||
|
response.json({});
|
||||||
};
|
};
|
||||||
|
|
||||||
export { genericUpdateController };
|
export { genericUpdateController };
|
||||||
|
@ -6,11 +6,10 @@ import {
|
|||||||
IMissionRewardResponse,
|
IMissionRewardResponse,
|
||||||
IReward
|
IReward
|
||||||
} from "@/src/types/missionInventoryUpdateType";
|
} from "@/src/types/missionInventoryUpdateType";
|
||||||
import { RawUpgrade } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IRawUpgrade } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
import missionsDropTable from "@/static/json/missions-drop-table.json";
|
import missionsDropTable from "@/static/json/missions-drop-table.json";
|
||||||
import { modNames, relicNames, miscNames, resourceNames, gearNames, blueprintNames } from "@/static/data/items";
|
import { modNames, relicNames, miscNames, resourceNames, gearNames, blueprintNames } from "@/static/data/items";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
**** INPUT ****
|
**** INPUT ****
|
||||||
- [ ] crossPlaySetting
|
- [ ] crossPlaySetting
|
||||||
@ -36,13 +35,13 @@ import { modNames, relicNames, miscNames, resourceNames, gearNames, blueprintNam
|
|||||||
- [ ] hosts
|
- [ ] hosts
|
||||||
- [x] ChallengeProgress
|
- [x] ChallengeProgress
|
||||||
- [ ] SeasonChallengeHistory
|
- [ ] SeasonChallengeHistory
|
||||||
- [ ] PS
|
- [ ] PS (Passive anti-cheat data which includes your username, module list, process list, and system name.)
|
||||||
- [ ] ActiveDojoColorResearch
|
- [ ] ActiveDojoColorResearch
|
||||||
- [ ] RewardInfo
|
- [ ] RewardInfo
|
||||||
- [ ] ReceivedCeremonyMsg
|
- [ ] ReceivedCeremonyMsg
|
||||||
- [ ] LastCeremonyResetDate
|
- [ ] LastCeremonyResetDate
|
||||||
- [ ] MissionPTS
|
- [ ] MissionPTS (Used to validate the mission/alive time above.)
|
||||||
- [ ] RepHash
|
- [ ] RepHash (A hash from the replication manager/RepMgr Unknown what it does.)
|
||||||
- [ ] EndOfMatchUpload
|
- [ ] EndOfMatchUpload
|
||||||
- [ ] ObjectiveReached
|
- [ ] ObjectiveReached
|
||||||
- [ ] FpsAvg
|
- [ ] FpsAvg
|
||||||
@ -53,7 +52,6 @@ import { modNames, relicNames, miscNames, resourceNames, gearNames, blueprintNam
|
|||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||||
const missionInventoryUpdateController: RequestHandler = async (req, res) => {
|
const missionInventoryUpdateController: RequestHandler = async (req, res) => {
|
||||||
const [data] = String(req.body).split("\n");
|
|
||||||
const id = req.query.accountId as string;
|
const id = req.query.accountId as string;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -81,7 +79,7 @@ const missionInventoryUpdateController: RequestHandler = async (req, res) => {
|
|||||||
|
|
||||||
const Inventory = await missionInventoryUpdate(parsedData, id);
|
const Inventory = await missionInventoryUpdate(parsedData, id);
|
||||||
InventoryChanges.RawUpgrades?.forEach(
|
InventoryChanges.RawUpgrades?.forEach(
|
||||||
(i: RawUpgrade) => (i.LastAdded = Inventory.RawUpgrades.find(j => j.ItemType === i.ItemType)?.LastAdded)
|
(i: IRawUpgrade) => (i.LastAdded = Inventory.RawUpgrades.find(j => j.ItemType === i.ItemType)?.LastAdded)
|
||||||
);
|
);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const InventoryJson = JSON.stringify(Inventory);
|
const InventoryJson = JSON.stringify(Inventory);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { Session, FindSessionRequest } from "@/src/types/session";
|
import { ISession, IFindSessionRequest } from "@/src/types/session";
|
||||||
|
|
||||||
const sessions: Session[] = [];
|
const sessions: ISession[] = [];
|
||||||
|
|
||||||
function createNewSession(sessionData: Session, Creator: string): Session {
|
function createNewSession(sessionData: ISession, Creator: string): ISession {
|
||||||
const sessionId = getNewSessionID();
|
const sessionId = getNewSessionID();
|
||||||
const newSession: Session = {
|
const newSession: ISession = {
|
||||||
sessionId,
|
sessionId,
|
||||||
creatorId: Creator,
|
creatorId: Creator,
|
||||||
maxPlayers: sessionData.maxPlayers || 4,
|
maxPlayers: sessionData.maxPlayers || 4,
|
||||||
@ -35,15 +35,15 @@ function createNewSession(sessionData: Session, Creator: string): Session {
|
|||||||
return newSession;
|
return newSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAllSessions(): Session[] {
|
function getAllSessions(): ISession[] {
|
||||||
return sessions;
|
return sessions;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSessionByID(sessionId: string): Session | undefined {
|
function getSessionByID(sessionId: string): ISession | undefined {
|
||||||
return sessions.find(session => session.sessionId === sessionId);
|
return sessions.find(session => session.sessionId === sessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSession(sessionIdOrRequest: string | FindSessionRequest): any[] {
|
function getSession(sessionIdOrRequest: string | IFindSessionRequest): any[] {
|
||||||
if (typeof sessionIdOrRequest === "string") {
|
if (typeof sessionIdOrRequest === "string") {
|
||||||
const session = sessions.find(session => session.sessionId === sessionIdOrRequest);
|
const session = sessions.find(session => session.sessionId === sessionIdOrRequest);
|
||||||
if (session) {
|
if (session) {
|
||||||
@ -58,10 +58,10 @@ function getSession(sessionIdOrRequest: string | FindSessionRequest): any[] {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const request = sessionIdOrRequest as FindSessionRequest;
|
const request = sessionIdOrRequest as IFindSessionRequest;
|
||||||
const matchingSessions = sessions.filter(session => {
|
const matchingSessions = sessions.filter(session => {
|
||||||
for (const key in request) {
|
for (const key in request) {
|
||||||
if (key !== "eloRating" && key !== "queryId" && request[key] !== session[key as keyof Session]) {
|
if (key !== "eloRating" && key !== "queryId" && request[key] !== session[key as keyof ISession]) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ function getSession(sessionIdOrRequest: string | FindSessionRequest): any[] {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSessionByCreatorID(creatorId: string): Session | undefined {
|
function getSessionByCreatorID(creatorId: string): ISession | undefined {
|
||||||
return sessions.find(session => session.creatorId === creatorId);
|
return sessions.find(session => session.creatorId === creatorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
import { Model, Schema, Types, model } from "mongoose";
|
import { Model, Schema, Types, model } from "mongoose";
|
||||||
import { FlavourItem, RawUpgrade, MiscItem, IInventoryDatabase, Booster } from "../types/inventoryTypes/inventoryTypes";
|
import {
|
||||||
import { Oid } from "../types/commonTypes";
|
IFlavourItem,
|
||||||
import { ISuitDatabase } from "@/src/types/inventoryTypes/SuitTypes";
|
IRawUpgrade,
|
||||||
|
IMiscItem,
|
||||||
|
IInventoryDatabase,
|
||||||
|
IBooster
|
||||||
|
} from "../types/inventoryTypes/inventoryTypes";
|
||||||
|
import { IOid } from "../types/commonTypes";
|
||||||
|
import { ISuitDatabase, ISuitDocument } from "@/src/types/inventoryTypes/SuitTypes";
|
||||||
import { IWeaponDatabase } from "@/src/types/inventoryTypes/weaponTypes";
|
import { IWeaponDatabase } from "@/src/types/inventoryTypes/weaponTypes";
|
||||||
|
|
||||||
const abilityOverrideSchema = new Schema({
|
const abilityOverrideSchema = new Schema({
|
||||||
@ -102,7 +108,7 @@ Upgrade.set("toJSON", {
|
|||||||
WeaponSchema.set("toJSON", {
|
WeaponSchema.set("toJSON", {
|
||||||
transform(_document, returnedObject) {
|
transform(_document, returnedObject) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
||||||
returnedObject.ItemId = { $oid: returnedObject._id.toString() } satisfies Oid;
|
returnedObject.ItemId = { $oid: returnedObject._id.toString() } satisfies IOid;
|
||||||
delete returnedObject._id;
|
delete returnedObject._id;
|
||||||
delete returnedObject.__v;
|
delete returnedObject.__v;
|
||||||
}
|
}
|
||||||
@ -158,7 +164,7 @@ const suitSchema = new Schema<ISuitDatabase>({
|
|||||||
suitSchema.set("toJSON", {
|
suitSchema.set("toJSON", {
|
||||||
transform(_document, returnedObject) {
|
transform(_document, returnedObject) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
||||||
returnedObject.ItemId = { $oid: returnedObject._id.toString() } satisfies Oid;
|
returnedObject.ItemId = { $oid: returnedObject._id.toString() } satisfies IOid;
|
||||||
delete returnedObject._id;
|
delete returnedObject._id;
|
||||||
delete returnedObject.__v;
|
delete returnedObject.__v;
|
||||||
}
|
}
|
||||||
@ -366,10 +372,10 @@ type InventoryDocumentProps = {
|
|||||||
LongGuns: Types.DocumentArray<IWeaponDatabase>;
|
LongGuns: Types.DocumentArray<IWeaponDatabase>;
|
||||||
Pistols: Types.DocumentArray<IWeaponDatabase>;
|
Pistols: Types.DocumentArray<IWeaponDatabase>;
|
||||||
Melee: Types.DocumentArray<IWeaponDatabase>;
|
Melee: Types.DocumentArray<IWeaponDatabase>;
|
||||||
FlavourItems: Types.DocumentArray<FlavourItem>;
|
FlavourItems: Types.DocumentArray<IFlavourItem>;
|
||||||
RawUpgrades: Types.DocumentArray<RawUpgrade>;
|
RawUpgrades: Types.DocumentArray<IRawUpgrade>;
|
||||||
MiscItems: Types.DocumentArray<MiscItem>;
|
MiscItems: Types.DocumentArray<IMiscItem>;
|
||||||
Boosters: Types.DocumentArray<Booster>;
|
Boosters: Types.DocumentArray<IBooster>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type InventoryModelType = Model<IInventoryDatabase, object, InventoryDocumentProps>;
|
type InventoryModelType = Model<IInventoryDatabase, object, InventoryDocumentProps>;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Schema, model } from "mongoose";
|
import { Schema, model } from "mongoose";
|
||||||
import { IShip } from "../types/shipTypes";
|
import { IShip } from "../types/shipTypes";
|
||||||
import { Oid } from "../types/commonTypes";
|
import { IOid } from "../types/commonTypes";
|
||||||
|
|
||||||
const roomSchema = new Schema(
|
const roomSchema = new Schema(
|
||||||
{
|
{
|
||||||
@ -19,7 +19,7 @@ const shipSchema = new Schema({
|
|||||||
shipSchema.set("toJSON", {
|
shipSchema.set("toJSON", {
|
||||||
transform(_document, returnedObject) {
|
transform(_document, returnedObject) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
||||||
returnedObject.ShipId = { $oid: returnedObject._id.toString() } satisfies Oid;
|
returnedObject.ShipId = { $oid: returnedObject._id.toString() } satisfies IOid;
|
||||||
delete returnedObject._id;
|
delete returnedObject._id;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -6,13 +6,13 @@ import { ISuitResponse } from "@/src/types/inventoryTypes/SuitTypes";
|
|||||||
import { SlotType } from "@/src/types/purchaseTypes";
|
import { SlotType } from "@/src/types/purchaseTypes";
|
||||||
import { IWeaponResponse } from "@/src/types/inventoryTypes/weaponTypes";
|
import { IWeaponResponse } from "@/src/types/inventoryTypes/weaponTypes";
|
||||||
import {
|
import {
|
||||||
ChallengeProgress,
|
IChallengeProgress,
|
||||||
Consumable,
|
IConsumable,
|
||||||
CrewShipSalvagedWeaponSkin,
|
ICrewShipSalvagedWeaponSkin,
|
||||||
FlavourItem,
|
IFlavourItem,
|
||||||
IInventoryDatabaseDocument,
|
IInventoryDatabaseDocument,
|
||||||
MiscItem,
|
IMiscItem,
|
||||||
RawUpgrade
|
IRawUpgrade
|
||||||
} from "@/src/types/inventoryTypes/inventoryTypes";
|
} from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IMissionInventoryUpdate, IMissionInventoryUpdateGear } from "../types/missionInventoryUpdateType";
|
import { IMissionInventoryUpdate, IMissionInventoryUpdateGear } from "../types/missionInventoryUpdateType";
|
||||||
|
|
||||||
@ -79,6 +79,27 @@ export const updateCurrency = async (price: number, usePremium: boolean, account
|
|||||||
return { [currencyName]: -price };
|
return { [currencyName]: -price };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO: AffiliationMods support (Nightwave).
|
||||||
|
export const updateGeneric = async (data: IGenericUpdate, accountId: string) => {
|
||||||
|
const inventory = await getInventory(accountId);
|
||||||
|
|
||||||
|
// Make it an array for easier parsing.
|
||||||
|
if (typeof data.NodeIntrosCompleted === "string") {
|
||||||
|
data.NodeIntrosCompleted = [data.NodeIntrosCompleted];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Combine the two arrays into one.
|
||||||
|
data.NodeIntrosCompleted = inventory.NodeIntrosCompleted.concat(data.NodeIntrosCompleted);
|
||||||
|
|
||||||
|
// Remove duplicate entries.
|
||||||
|
const nodes = [...new Set(data.NodeIntrosCompleted)];
|
||||||
|
|
||||||
|
inventory.NodeIntrosCompleted = nodes;
|
||||||
|
await inventory.save();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
export type WeaponTypeInternal = "LongGuns" | "Pistols" | "Melee";
|
export type WeaponTypeInternal = "LongGuns" | "Pistols" | "Melee";
|
||||||
|
|
||||||
export const addWeapon = async (
|
export const addWeapon = async (
|
||||||
@ -107,7 +128,7 @@ export const addWeapon = async (
|
|||||||
return changedInventory[weaponType][weaponIndex - 1].toJSON();
|
return changedInventory[weaponType][weaponIndex - 1].toJSON();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addCustomization = async (customizatonName: string, accountId: string): Promise<FlavourItem> => {
|
export const addCustomization = async (customizatonName: string, accountId: string): Promise<IFlavourItem> => {
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
|
|
||||||
const flavourItemIndex = inventory.FlavourItems.push({ ItemType: customizatonName }) - 1;
|
const flavourItemIndex = inventory.FlavourItems.push({ ItemType: customizatonName }) - 1;
|
||||||
@ -133,7 +154,7 @@ const addGearExpByCategory = (
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const addMiscItems = (inventory: IInventoryDatabaseDocument, itemsArray: MiscItem[] | undefined) => {
|
const addMiscItems = (inventory: IInventoryDatabaseDocument, itemsArray: IMiscItem[] | undefined) => {
|
||||||
const { MiscItems } = inventory;
|
const { MiscItems } = inventory;
|
||||||
|
|
||||||
itemsArray?.forEach(({ ItemCount, ItemType }) => {
|
itemsArray?.forEach(({ ItemCount, ItemType }) => {
|
||||||
@ -148,7 +169,7 @@ const addMiscItems = (inventory: IInventoryDatabaseDocument, itemsArray: MiscIte
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const addConsumables = (inventory: IInventoryDatabaseDocument, itemsArray: Consumable[] | undefined) => {
|
const addConsumables = (inventory: IInventoryDatabaseDocument, itemsArray: IConsumable[] | undefined) => {
|
||||||
const { Consumables } = inventory;
|
const { Consumables } = inventory;
|
||||||
|
|
||||||
itemsArray?.forEach(({ ItemCount, ItemType }) => {
|
itemsArray?.forEach(({ ItemCount, ItemType }) => {
|
||||||
@ -163,7 +184,7 @@ const addConsumables = (inventory: IInventoryDatabaseDocument, itemsArray: Consu
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const addRecipes = (inventory: IInventoryDatabaseDocument, itemsArray: Consumable[] | undefined) => {
|
const addRecipes = (inventory: IInventoryDatabaseDocument, itemsArray: IConsumable[] | undefined) => {
|
||||||
const { Recipes } = inventory;
|
const { Recipes } = inventory;
|
||||||
|
|
||||||
itemsArray?.forEach(({ ItemCount, ItemType }) => {
|
itemsArray?.forEach(({ ItemCount, ItemType }) => {
|
||||||
@ -178,7 +199,7 @@ const addRecipes = (inventory: IInventoryDatabaseDocument, itemsArray: Consumabl
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const addMods = (inventory: IInventoryDatabaseDocument, itemsArray: RawUpgrade[] | undefined) => {
|
const addMods = (inventory: IInventoryDatabaseDocument, itemsArray: IRawUpgrade[] | undefined) => {
|
||||||
const { RawUpgrades } = inventory;
|
const { RawUpgrades } = inventory;
|
||||||
itemsArray?.forEach(({ ItemType, ItemCount }) => {
|
itemsArray?.forEach(({ ItemType, ItemCount }) => {
|
||||||
const itemIndex = RawUpgrades.findIndex(i => i.ItemType === ItemType);
|
const itemIndex = RawUpgrades.findIndex(i => i.ItemType === ItemType);
|
||||||
@ -192,7 +213,7 @@ const addMods = (inventory: IInventoryDatabaseDocument, itemsArray: RawUpgrade[]
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const addChallenges = (inventory: IInventoryDatabaseDocument, itemsArray: ChallengeProgress[] | undefined) => {
|
const addChallenges = (inventory: IInventoryDatabaseDocument, itemsArray: IChallengeProgress[] | undefined) => {
|
||||||
const category = inventory.ChallengeProgress;
|
const category = inventory.ChallengeProgress;
|
||||||
|
|
||||||
itemsArray?.forEach(({ Name, Progress }) => {
|
itemsArray?.forEach(({ Name, Progress }) => {
|
||||||
@ -220,7 +241,7 @@ export const missionInventoryUpdate = async (data: IMissionInventoryUpdate, acco
|
|||||||
// endo
|
// endo
|
||||||
inventory.FusionPoints += FusionPoints || 0;
|
inventory.FusionPoints += FusionPoints || 0;
|
||||||
|
|
||||||
// gear exp
|
// Gear XP
|
||||||
gearKeys.forEach((key: GearKeysType) => addGearExpByCategory(inventory, data[key], key));
|
gearKeys.forEach((key: GearKeysType) => addGearExpByCategory(inventory, data[key], key));
|
||||||
|
|
||||||
// other
|
// other
|
||||||
@ -235,7 +256,7 @@ export const missionInventoryUpdate = async (data: IMissionInventoryUpdate, acco
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const addBooster = async (ItemType: string, time: number, accountId: string): Promise<void> => {
|
export const addBooster = async (ItemType: string, time: number, accountId: string): Promise<void> => {
|
||||||
const currentTime = Math.floor(Date.now() / 1000) - 129600; // booster time getting more without 129600, probably defence logic, idk
|
const currentTime = Math.floor(Date.now() / 1000) - 129600; // Value is wrong without 129600. Figure out why, please. :)
|
||||||
|
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
const { Boosters } = inventory;
|
const { Boosters } = inventory;
|
||||||
@ -259,7 +280,7 @@ export const upgradeMod = async (
|
|||||||
LevelDiff,
|
LevelDiff,
|
||||||
Cost,
|
Cost,
|
||||||
FusionPointCost
|
FusionPointCost
|
||||||
}: { Upgrade: CrewShipSalvagedWeaponSkin; LevelDiff: number; Cost: number; FusionPointCost: number },
|
}: { Upgrade: ICrewShipSalvagedWeaponSkin; LevelDiff: number; Cost: number; FusionPointCost: number },
|
||||||
accountId: string
|
accountId: string
|
||||||
): Promise<string | undefined> => {
|
): Promise<string | undefined> => {
|
||||||
try {
|
try {
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
export interface Oid {
|
export interface IOid {
|
||||||
$oid: string;
|
$oid: string;
|
||||||
}
|
}
|
||||||
|
4
src/types/genericUpdate.ts
Normal file
4
src/types/genericUpdate.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export interface IGenericUpdate {
|
||||||
|
NodeIntrosCompleted: string | string[];
|
||||||
|
// AffiliationMods: any[];
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
import { Oid } from "@/src/types/commonTypes";
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
import { AbilityOverride, Color, Polarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { IAbilityOverride, IColor, IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { Document, Types } from "mongoose";
|
import { Document, Types } from "mongoose";
|
||||||
|
|
||||||
// export interface ISuitDocument extends ISuitResponse, Document {}
|
// export interface ISuitDocument extends ISuitResponse, Document {}
|
||||||
@ -8,7 +8,7 @@ export interface ISuitDocument extends Document, ISuitResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ISuitResponse extends ISuitDatabase {
|
export interface ISuitResponse extends ISuitDatabase {
|
||||||
ItemId: Oid;
|
ItemId: IOid;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ISuitDatabase {
|
export interface ISuitDatabase {
|
||||||
@ -18,7 +18,7 @@ export interface ISuitDatabase {
|
|||||||
XP?: number;
|
XP?: number;
|
||||||
InfestationDate?: Date;
|
InfestationDate?: Date;
|
||||||
Features?: number;
|
Features?: number;
|
||||||
Polarity?: Polarity[];
|
Polarity?: IPolarity[];
|
||||||
Polarized?: number;
|
Polarized?: number;
|
||||||
ModSlotPurchases?: number;
|
ModSlotPurchases?: number;
|
||||||
FocusLens?: string;
|
FocusLens?: string;
|
||||||
@ -28,14 +28,14 @@ export interface ISuitDatabase {
|
|||||||
|
|
||||||
export interface SuitConfig {
|
export interface SuitConfig {
|
||||||
Skins?: string[];
|
Skins?: string[];
|
||||||
pricol?: Color;
|
pricol?: IColor;
|
||||||
attcol?: Color;
|
attcol?: IColor;
|
||||||
eyecol?: Color;
|
eyecol?: IColor;
|
||||||
sigcol?: Color;
|
sigcol?: IColor;
|
||||||
Upgrades?: string[];
|
Upgrades?: string[];
|
||||||
Songs?: Song[];
|
Songs?: Song[];
|
||||||
Name?: string;
|
Name?: string;
|
||||||
AbilityOverride?: AbilityOverride;
|
AbilityOverride?: IAbilityOverride;
|
||||||
PvpUpgrades?: string[];
|
PvpUpgrades?: string[];
|
||||||
ugly?: boolean;
|
ugly?: boolean;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export interface Polarity {
|
export interface IPolarity {
|
||||||
Slot: number;
|
Slot: number;
|
||||||
Value: FocusSchool;
|
Value: FocusSchool;
|
||||||
}
|
}
|
||||||
@ -15,7 +15,7 @@ export enum FocusSchool {
|
|||||||
ApWard = "AP_WARD"
|
ApWard = "AP_WARD"
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Color {
|
export interface IColor {
|
||||||
t0?: number;
|
t0?: number;
|
||||||
t1?: number;
|
t1?: number;
|
||||||
t2?: number;
|
t2?: number;
|
||||||
@ -26,16 +26,17 @@ export interface Color {
|
|||||||
m1?: number;
|
m1?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AbilityOverride {
|
export interface IAbilityOverride {
|
||||||
Ability: string;
|
Ability: string;
|
||||||
Index: number;
|
Index: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SlotsBin {
|
export interface ISlotsBin {
|
||||||
Slots: number;
|
Slots: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface sigcol {
|
// ISigCol? IsIgCoL? ISIGCOL!
|
||||||
|
export interface Isigcol {
|
||||||
t0: number;
|
t0: number;
|
||||||
t1: number;
|
t1: number;
|
||||||
en: number;
|
en: number;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
|||||||
import { Oid } from "@/src/types/commonTypes";
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
import { Color, Polarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { IColor, IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
|
|
||||||
export interface IWeaponResponse extends IWeaponDatabase {
|
export interface IWeaponResponse extends IWeaponDatabase {
|
||||||
ItemId: Oid;
|
ItemId: IOid;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IWeaponDatabase {
|
export interface IWeaponDatabase {
|
||||||
@ -13,7 +13,7 @@ export interface IWeaponDatabase {
|
|||||||
XP?: number;
|
XP?: number;
|
||||||
Features?: number;
|
Features?: number;
|
||||||
Polarized?: number;
|
Polarized?: number;
|
||||||
Polarity?: Polarity[];
|
Polarity?: IPolarity[];
|
||||||
FocusLens?: string;
|
FocusLens?: string;
|
||||||
ModSlotPurchases?: number;
|
ModSlotPurchases?: number;
|
||||||
UpgradeType?: string;
|
UpgradeType?: string;
|
||||||
@ -26,15 +26,15 @@ export interface IWeaponDatabase {
|
|||||||
|
|
||||||
export interface WeaponConfig {
|
export interface WeaponConfig {
|
||||||
Skins?: string[];
|
Skins?: string[];
|
||||||
pricol?: Color;
|
pricol?: IColor;
|
||||||
Upgrades?: string[];
|
Upgrades?: string[];
|
||||||
attcol?: Color;
|
attcol?: IColor;
|
||||||
eyecol?: OperatorLoadOutSigcol;
|
eyecol?: IOperatorLoadOutSigcol;
|
||||||
Name?: string;
|
Name?: string;
|
||||||
PvpUpgrades?: string[];
|
PvpUpgrades?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OperatorLoadOutSigcol {
|
export interface IOperatorLoadOutSigcol {
|
||||||
t0?: number;
|
t0?: number;
|
||||||
t1?: number;
|
t1?: number;
|
||||||
en?: number;
|
en?: number;
|
||||||
|
@ -10,7 +10,7 @@ export interface ILoginResponse extends Omit<IDatabaseAccountDocument, "email" |
|
|||||||
HUB: string;
|
HUB: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
//includes virtual id
|
// Includes virtual ID
|
||||||
export interface IDatabaseAccountDocument extends IDatabaseAccount {
|
export interface IDatabaseAccountDocument extends IDatabaseAccount {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import { Oid } from "./commonTypes";
|
import { IOid } from "./commonTypes";
|
||||||
import { Date } from "./inventoryTypes/inventoryTypes";
|
import { IDate } from "./inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
export interface IMissionInventoryUpdateGear {
|
export interface IMissionInventoryUpdateGear {
|
||||||
ItemType: string;
|
ItemType: string;
|
||||||
ItemName: string;
|
ItemName: string;
|
||||||
ItemId: Oid;
|
ItemId: IOid;
|
||||||
XP: number;
|
XP: number;
|
||||||
UpgradeVer: number;
|
UpgradeVer: number;
|
||||||
Features: number;
|
Features: number;
|
||||||
@ -13,7 +13,7 @@ export interface IMissionInventoryUpdateGear {
|
|||||||
CustomizationSlotPurchases: number;
|
CustomizationSlotPurchases: number;
|
||||||
ModSlotPurchases: number;
|
ModSlotPurchases: number;
|
||||||
FocusLens: string;
|
FocusLens: string;
|
||||||
Expiry: Date;
|
Expiry: IDate;
|
||||||
Polarity: any[];
|
Polarity: any[];
|
||||||
Configs: any[];
|
Configs: any[];
|
||||||
ModularParts: any[];
|
ModularParts: any[];
|
||||||
@ -22,7 +22,7 @@ export interface IMissionInventoryUpdateGear {
|
|||||||
UpgradeFingerprint: string;
|
UpgradeFingerprint: string;
|
||||||
OffensiveUpgrade: string;
|
OffensiveUpgrade: string;
|
||||||
DefensiveUpgrade: string;
|
DefensiveUpgrade: string;
|
||||||
UpgradesExpiry: Date;
|
UpgradesExpiry: IDate;
|
||||||
ArchonCrystalUpgrades: any[];
|
ArchonCrystalUpgrades: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,10 +32,10 @@ export interface IMissionInventoryUpdateItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IMissionInventoryUpdateCard extends IMissionInventoryUpdateItem {
|
export interface IMissionInventoryUpdateCard extends IMissionInventoryUpdateItem {
|
||||||
ItemId: Oid;
|
ItemId: IOid;
|
||||||
UpgradeFingerprint: string;
|
UpgradeFingerprint: string;
|
||||||
PendingRerollFingerprint: string;
|
PendingRerollFingerprint: string;
|
||||||
LastAdded: Oid;
|
LastAdded: IOid;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IMissionInventoryUpdateChallange {
|
export interface IMissionInventoryUpdateChallange {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable prettier/prettier */
|
|
||||||
import { ISuitDatabase } from "@/src/types/inventoryTypes/SuitTypes";
|
import { ISuitDatabase } from "@/src/types/inventoryTypes/SuitTypes";
|
||||||
import { FlavourItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IFlavourItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IWeaponResponse } from "@/src/types/inventoryTypes/weaponTypes";
|
import { IWeaponResponse } from "@/src/types/inventoryTypes/weaponTypes";
|
||||||
|
|
||||||
export interface IPurchaseRequest {
|
export interface IPurchaseRequest {
|
||||||
@ -29,7 +28,7 @@ export interface IPurchaseResponse {
|
|||||||
Melee?: IWeaponResponse[];
|
Melee?: IWeaponResponse[];
|
||||||
PremiumCredits?: number;
|
PremiumCredits?: number;
|
||||||
RegularCredits?: number;
|
RegularCredits?: number;
|
||||||
FlavourItems?: FlavourItem[];
|
FlavourItems?: IFlavourItem[];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export interface Session {
|
export interface ISession {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
creatorId: string;
|
creatorId: string;
|
||||||
maxPlayers: number;
|
maxPlayers: number;
|
||||||
@ -26,6 +26,6 @@ export interface Session {
|
|||||||
fullReset: number;
|
fullReset: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FindSessionRequest {
|
export interface IFindSessionRequest {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { Oid } from "@/src/types/commonTypes";
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
|
|
||||||
export interface IShip {
|
export interface IShip {
|
||||||
ShipOwnerId: Types.ObjectId;
|
ShipOwnerId: Types.ObjectId;
|
||||||
@ -10,8 +8,9 @@ export interface IShip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IShipClassResponse extends IShipClassDatabase {
|
export interface IShipClassResponse extends IShipClassDatabase {
|
||||||
ShipId: Oid;
|
ShipId: IOid;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IShipClassDatabase {
|
export interface IShipClassDatabase {
|
||||||
Rooms: IRoomsClass[];
|
Rooms: IRoomsClass[];
|
||||||
Features: string[];
|
Features: string[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user