chore: improve ship customization stuff #2402
@ -6,9 +6,8 @@ import { getAccountIdForRequest } from "@/src/services/loginService";
|
|||||||
import { createGarden, getPersonalRooms } from "@/src/services/personalRoomsService";
|
import { createGarden, getPersonalRooms } from "@/src/services/personalRoomsService";
|
||||||
import { IMongoDate } from "@/src/types/commonTypes";
|
import { IMongoDate } from "@/src/types/commonTypes";
|
||||||
import { IMissionReward } from "@/src/types/missionTypes";
|
import { IMissionReward } from "@/src/types/missionTypes";
|
||||||
import { IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
|
import { IGardeningClient, IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
|
||||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { IGardeningClient } from "@/src/types/shipTypes";
|
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { dict_en, ExportResources } from "warframe-public-export-plus";
|
import { dict_en, ExportResources } from "warframe-public-export-plus";
|
||||||
|
|
||||||
|
@ -3,10 +3,9 @@ import { config } from "@/src/services/configService";
|
|||||||
import allShipFeatures from "@/static/fixed_responses/allShipFeatures.json";
|
import allShipFeatures from "@/static/fixed_responses/allShipFeatures.json";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { createGarden, getPersonalRooms } from "@/src/services/personalRoomsService";
|
import { createGarden, getPersonalRooms } from "@/src/services/personalRoomsService";
|
||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { IGetShipResponse, IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
|
||||||
import { IGetShipResponse } from "@/src/types/shipTypes";
|
|
||||||
import { IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
|
|
||||||
import { getLoadout } from "@/src/services/loadoutService";
|
import { getLoadout } from "@/src/services/loadoutService";
|
||||||
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
|
|
||||||
export const getShipController: RequestHandler = async (req, res) => {
|
export const getShipController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -26,15 +25,7 @@ export const getShipController: RequestHandler = async (req, res) => {
|
|||||||
LoadOutInventory: { LoadOutPresets: loadout.toJSON() },
|
LoadOutInventory: { LoadOutPresets: loadout.toJSON() },
|
||||||
Ship: {
|
Ship: {
|
||||||
...personalRooms.Ship,
|
...personalRooms.Ship,
|
||||||
ShipId: toOid(personalRoomsDb.activeShipId),
|
ShipId: toOid(personalRoomsDb.activeShipId)
|
||||||
ShipInterior: {
|
|
||||||
Colors: personalRooms.ShipInteriorColors,
|
|
||||||
ShipAttachments: { HOOD_ORNAMENT: "" },
|
|
||||||
SkinFlavourItem: ""
|
|
||||||
},
|
|
||||||
FavouriteLoadoutId: personalRooms.Ship.FavouriteLoadoutId
|
|
||||||
? toOid(personalRooms.Ship.FavouriteLoadoutId)
|
|
||||||
: undefined
|
|
||||||
},
|
},
|
||||||
Apartment: personalRooms.Apartment,
|
Apartment: personalRooms.Apartment,
|
||||||
TailorShop: personalRooms.TailorShop
|
TailorShop: personalRooms.TailorShop
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { getPersonalRooms } from "@/src/services/personalRoomsService";
|
import { getPersonalRooms } from "@/src/services/personalRoomsService";
|
||||||
import { TBootLocation } from "@/src/types/shipTypes";
|
import { TBootLocation } from "@/src/types/personalRoomsTypes";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
|
||||||
export const setBootLocationController: RequestHandler = async (req, res) => {
|
export const setBootLocationController: RequestHandler = async (req, res) => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { IPictureFrameInfo, ISetPlacedDecoInfoRequest } from "@/src/types/shipTypes";
|
import { IPictureFrameInfo, ISetPlacedDecoInfoRequest } from "@/src/types/personalRoomsTypes";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { handleSetPlacedDecoInfo } from "@/src/services/shipCustomizationsService";
|
import { handleSetPlacedDecoInfo } from "@/src/services/shipCustomizationsService";
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { setShipCustomizations } from "@/src/services/shipCustomizationsService";
|
import { setShipCustomizations } from "@/src/services/shipCustomizationsService";
|
||||||
import { ISetShipCustomizationsRequest } from "@/src/types/shipTypes";
|
import { ISetShipCustomizationsRequest } from "@/src/types/personalRoomsTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { RequestHandler } from "express";
|
|||||||
import { getPersonalRooms } from "@/src/services/personalRoomsService";
|
import { getPersonalRooms } from "@/src/services/personalRoomsService";
|
||||||
import { IOid } from "@/src/types/commonTypes";
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { IFavouriteLoadoutDatabase, TBootLocation } from "@/src/types/shipTypes";
|
import { IFavouriteLoadoutDatabase, TBootLocation } from "@/src/types/personalRoomsTypes";
|
||||||
|
|
||||||
export const setShipFavouriteLoadoutController: RequestHandler = async (req, res) => {
|
export const setShipFavouriteLoadoutController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { IShipDecorationsRequest } from "@/src/types/shipTypes";
|
import { IShipDecorationsRequest } from "@/src/types/personalRoomsTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { handleSetShipDecorations } from "@/src/services/shipCustomizationsService";
|
import { handleSetShipDecorations } from "@/src/services/shipCustomizationsService";
|
||||||
|
26
src/models/commonModel.ts
Normal file
26
src/models/commonModel.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { Schema } from "mongoose";
|
||||||
|
import { IColor } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
|
import { IShipCustomization } from "@/src/types/personalRoomsTypes";
|
||||||
|
|
||||||
|
export const colorSchema = new Schema<IColor>(
|
||||||
|
{
|
||||||
|
t0: Number,
|
||||||
|
t1: Number,
|
||||||
|
t2: Number,
|
||||||
|
t3: Number,
|
||||||
|
en: Number,
|
||||||
|
e1: Number,
|
||||||
|
m0: Number,
|
||||||
|
m1: Number
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
export const shipCustomizationSchema = new Schema<IShipCustomization>(
|
||||||
|
{
|
||||||
|
SkinFlavourItem: String,
|
||||||
|
Colors: colorSchema,
|
||||||
|
ShipAttachments: { HOOD_ORNAMENT: String }
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
@ -42,7 +42,6 @@ import {
|
|||||||
ICrewShipCustomization,
|
ICrewShipCustomization,
|
||||||
ICrewShipWeapon,
|
ICrewShipWeapon,
|
||||||
ICrewShipWeaponEmplacements,
|
ICrewShipWeaponEmplacements,
|
||||||
IShipExterior,
|
|
||||||
IHelminthFoodRecord,
|
IHelminthFoodRecord,
|
||||||
ICrewShipMembersDatabase,
|
ICrewShipMembersDatabase,
|
||||||
IDialogueHistoryDatabase,
|
IDialogueHistoryDatabase,
|
||||||
@ -106,7 +105,6 @@ import {
|
|||||||
import { IOid } from "../../types/commonTypes";
|
import { IOid } from "../../types/commonTypes";
|
||||||
import {
|
import {
|
||||||
IAbilityOverride,
|
IAbilityOverride,
|
||||||
IColor,
|
|
||||||
IItemConfig,
|
IItemConfig,
|
||||||
IOperatorConfigDatabase,
|
IOperatorConfigDatabase,
|
||||||
IPolarity,
|
IPolarity,
|
||||||
@ -117,6 +115,7 @@ import {
|
|||||||
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { EquipmentSelectionSchema, oidSchema } from "./loadoutModel";
|
import { EquipmentSelectionSchema, oidSchema } from "./loadoutModel";
|
||||||
import { ICountedStoreItem } from "warframe-public-export-plus";
|
import { ICountedStoreItem } from "warframe-public-export-plus";
|
||||||
|
import { colorSchema, shipCustomizationSchema } from "../commonModel";
|
||||||
|
|
||||||
export const typeCountSchema = new Schema<ITypeCount>({ ItemType: String, ItemCount: Number }, { _id: false });
|
export const typeCountSchema = new Schema<ITypeCount>({ ItemType: String, ItemCount: Number }, { _id: false });
|
||||||
|
|
||||||
@ -166,20 +165,6 @@ const abilityOverrideSchema = new Schema<IAbilityOverride>(
|
|||||||
{ _id: false }
|
{ _id: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
export const colorSchema = new Schema<IColor>(
|
|
||||||
{
|
|
||||||
t0: Number,
|
|
||||||
t1: Number,
|
|
||||||
t2: Number,
|
|
||||||
t3: Number,
|
|
||||||
en: Number,
|
|
||||||
e1: Number,
|
|
||||||
m0: Number,
|
|
||||||
m1: Number
|
|
||||||
},
|
|
||||||
{ _id: false }
|
|
||||||
);
|
|
||||||
|
|
||||||
const operatorConfigSchema = new Schema<IOperatorConfigDatabase>(
|
const operatorConfigSchema = new Schema<IOperatorConfigDatabase>(
|
||||||
{
|
{
|
||||||
Skins: [String],
|
Skins: [String],
|
||||||
@ -896,18 +881,9 @@ const crewShipWeaponSchema = new Schema<ICrewShipWeapon>(
|
|||||||
{ _id: false }
|
{ _id: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
const shipExteriorSchema = new Schema<IShipExterior>(
|
|
||||||
{
|
|
||||||
SkinFlavourItem: String,
|
|
||||||
Colors: colorSchema,
|
|
||||||
ShipAttachments: { HOOD_ORNAMENT: String }
|
|
||||||
},
|
|
||||||
{ _id: false }
|
|
||||||
);
|
|
||||||
|
|
||||||
const crewShipCustomizationSchema = new Schema<ICrewShipCustomization>(
|
const crewShipCustomizationSchema = new Schema<ICrewShipCustomization>(
|
||||||
{
|
{
|
||||||
CrewshipInterior: shipExteriorSchema
|
CrewshipInterior: shipCustomizationSchema
|
||||||
},
|
},
|
||||||
{ _id: false }
|
{ _id: false }
|
||||||
);
|
);
|
||||||
|
@ -1,19 +1,22 @@
|
|||||||
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { colorSchema } from "@/src/models/inventoryModels/inventoryModel";
|
|
||||||
import { IOrbiter, IPersonalRoomsDatabase, PersonalRoomsModelType } from "@/src/types/personalRoomsTypes";
|
|
||||||
import {
|
import {
|
||||||
|
IApartmentDatabase,
|
||||||
IFavouriteLoadoutDatabase,
|
IFavouriteLoadoutDatabase,
|
||||||
IGardeningDatabase,
|
IGardeningDatabase,
|
||||||
IPlacedDecosDatabase,
|
IOrbiterClient,
|
||||||
|
IOrbiterDatabase,
|
||||||
|
IPersonalRoomsDatabase,
|
||||||
IPictureFrameInfo,
|
IPictureFrameInfo,
|
||||||
|
IPlacedDecosDatabase,
|
||||||
|
IPlantClient,
|
||||||
|
IPlantDatabase,
|
||||||
|
IPlanterDatabase,
|
||||||
IRoom,
|
IRoom,
|
||||||
ITailorShopDatabase,
|
ITailorShopDatabase,
|
||||||
IApartmentDatabase,
|
PersonalRoomsModelType
|
||||||
IPlanterDatabase,
|
} from "@/src/types/personalRoomsTypes";
|
||||||
IPlantDatabase,
|
|
||||||
IPlantClient
|
|
||||||
} from "@/src/types/shipTypes";
|
|
||||||
import { Schema, Types, model } from "mongoose";
|
import { Schema, Types, model } from "mongoose";
|
||||||
|
import { colorSchema, shipCustomizationSchema } from "./commonModel";
|
||||||
|
|
||||||
export const pictureFrameInfoSchema = new Schema<IPictureFrameInfo>(
|
export const pictureFrameInfoSchema = new Schema<IPictureFrameInfo>(
|
||||||
{
|
{
|
||||||
@ -137,10 +140,11 @@ const apartmentDefault: IApartmentDatabase = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const orbiterSchema = new Schema<IOrbiter>(
|
const orbiterSchema = new Schema<IOrbiterDatabase>(
|
||||||
{
|
{
|
||||||
Features: [String],
|
Features: [String],
|
||||||
Rooms: [roomSchema],
|
Rooms: [roomSchema],
|
||||||
|
ShipInterior: shipCustomizationSchema,
|
||||||
VignetteFish: { type: [String], default: undefined },
|
VignetteFish: { type: [String], default: undefined },
|
||||||
FavouriteLoadoutId: Schema.Types.ObjectId,
|
FavouriteLoadoutId: Schema.Types.ObjectId,
|
||||||
Wallpaper: String,
|
Wallpaper: String,
|
||||||
@ -150,7 +154,18 @@ const orbiterSchema = new Schema<IOrbiter>(
|
|||||||
},
|
},
|
||||||
{ _id: false }
|
{ _id: false }
|
||||||
);
|
);
|
||||||
const orbiterDefault: IOrbiter = {
|
orbiterSchema.set("toJSON", {
|
||||||
|
virtuals: true,
|
||||||
|
transform(_doc, obj) {
|
||||||
|
const db = obj as IOrbiterDatabase;
|
||||||
|
const client = obj as IOrbiterClient;
|
||||||
|
|
||||||
|
if (db.FavouriteLoadoutId) {
|
||||||
|
client.FavouriteLoadoutId = toOid(db.FavouriteLoadoutId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const orbiterDefault: IOrbiterDatabase = {
|
||||||
Features: ["/Lotus/Types/Items/ShipFeatureItems/EarthNavigationFeatureItem"], //TODO: potentially remove after missionstarting gear
|
Features: ["/Lotus/Types/Items/ShipFeatureItems/EarthNavigationFeatureItem"], //TODO: potentially remove after missionstarting gear
|
||||||
Rooms: [
|
Rooms: [
|
||||||
{ Name: "AlchemyRoom", MaxCapacity: 1600 },
|
{ Name: "AlchemyRoom", MaxCapacity: 1600 },
|
||||||
@ -197,7 +212,6 @@ const tailorShopDefault: ITailorShopDatabase = {
|
|||||||
export const personalRoomsSchema = new Schema<IPersonalRoomsDatabase>({
|
export const personalRoomsSchema = new Schema<IPersonalRoomsDatabase>({
|
||||||
personalRoomsOwnerId: Schema.Types.ObjectId,
|
personalRoomsOwnerId: Schema.Types.ObjectId,
|
||||||
activeShipId: Schema.Types.ObjectId,
|
activeShipId: Schema.Types.ObjectId,
|
||||||
ShipInteriorColors: colorSchema,
|
|
||||||
Ship: { type: orbiterSchema, default: orbiterDefault },
|
Ship: { type: orbiterSchema, default: orbiterDefault },
|
||||||
Apartment: { type: apartmentSchema, default: apartmentDefault },
|
Apartment: { type: apartmentSchema, default: apartmentDefault },
|
||||||
TailorShop: { type: tailorShopSchema, default: tailorShopDefault }
|
TailorShop: { type: tailorShopSchema, default: tailorShopDefault }
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Document, Schema, Types, model } from "mongoose";
|
import { Document, Schema, Types, model } from "mongoose";
|
||||||
import { IShipDatabase } from "../types/shipTypes";
|
import { IShipDatabase } from "../types/shipTypes";
|
||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { colorSchema } from "@/src/models/inventoryModels/inventoryModel";
|
import { colorSchema } from "@/src/models/commonModel";
|
||||||
import { IShipInventory } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IShipInventory } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
const shipSchema = new Schema<IShipDatabase>(
|
const shipSchema = new Schema<IShipDatabase>(
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { PersonalRooms } from "@/src/models/personalRoomsModel";
|
import { PersonalRooms } from "@/src/models/personalRoomsModel";
|
||||||
import { addItem, getInventory } from "@/src/services/inventoryService";
|
import { addItem, getInventory } from "@/src/services/inventoryService";
|
||||||
import { TPersonalRoomsDatabaseDocument } from "../types/personalRoomsTypes";
|
import { IGardeningDatabase, TPersonalRoomsDatabaseDocument } from "../types/personalRoomsTypes";
|
||||||
import { IGardeningDatabase } from "../types/shipTypes";
|
|
||||||
import { getRandomElement } from "./rngService";
|
import { getRandomElement } from "./rngService";
|
||||||
|
|
||||||
export const getPersonalRooms = async (
|
export const getPersonalRooms = async (
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
import { getPersonalRooms } from "@/src/services/personalRoomsService";
|
import { getPersonalRooms } from "@/src/services/personalRoomsService";
|
||||||
import { getShip } from "@/src/services/shipService";
|
import { getShip } from "@/src/services/shipService";
|
||||||
import {
|
import {
|
||||||
|
ISetPlacedDecoInfoRequest,
|
||||||
ISetShipCustomizationsRequest,
|
ISetShipCustomizationsRequest,
|
||||||
IShipDecorationsRequest,
|
IShipDecorationsRequest,
|
||||||
IShipDecorationsResponse,
|
IShipDecorationsResponse,
|
||||||
ISetPlacedDecoInfoRequest,
|
RoomsType,
|
||||||
TBootLocation
|
TBootLocation,
|
||||||
} from "@/src/types/shipTypes";
|
TPersonalRoomsDatabaseDocument
|
||||||
|
} from "../types/personalRoomsTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { addFusionTreasures, addShipDecorations, getInventory } from "./inventoryService";
|
import { addFusionTreasures, addShipDecorations, getInventory } from "./inventoryService";
|
||||||
@ -15,7 +17,6 @@ import { Guild } from "../models/guildModel";
|
|||||||
import { hasGuildPermission } from "./guildService";
|
import { hasGuildPermission } from "./guildService";
|
||||||
import { GuildPermission } from "../types/guildTypes";
|
import { GuildPermission } from "../types/guildTypes";
|
||||||
import { ExportResources } from "warframe-public-export-plus";
|
import { ExportResources } from "warframe-public-export-plus";
|
||||||
import { RoomsType, TPersonalRoomsDatabaseDocument } from "../types/personalRoomsTypes";
|
|
||||||
|
|
||||||
export const setShipCustomizations = async (
|
export const setShipCustomizations = async (
|
||||||
accountId: string,
|
accountId: string,
|
||||||
@ -39,7 +40,7 @@ export const setShipCustomizations = async (
|
|||||||
personalRooms.TailorShop.LevelDecosVisible = shipCustomization.Customization.LevelDecosVisible;
|
personalRooms.TailorShop.LevelDecosVisible = shipCustomization.Customization.LevelDecosVisible;
|
||||||
personalRooms.TailorShop.CustomJson = shipCustomization.Customization.CustomJson;
|
personalRooms.TailorShop.CustomJson = shipCustomization.Customization.CustomJson;
|
||||||
} else {
|
} else {
|
||||||
personalRooms.ShipInteriorColors = shipCustomization.Customization.Colors;
|
personalRooms.Ship.ShipInterior = shipCustomization.Customization;
|
||||||
}
|
}
|
||||||
await personalRooms.save();
|
await personalRooms.save();
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { IOid, IMongoDate, IOidWithLegacySupport } from "@/src/types/commonTypes";
|
import { IOid, IMongoDate, IOidWithLegacySupport } from "@/src/types/commonTypes";
|
||||||
import { IFusionTreasure, IMiscItem, ITypeCount } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IFusionTreasure, IMiscItem, ITypeCount } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IPictureFrameInfo } from "./shipTypes";
|
import { IPictureFrameInfo } from "./personalRoomsTypes";
|
||||||
import { IFriendInfo } from "./friendTypes";
|
import { IFriendInfo } from "./friendTypes";
|
||||||
|
|
||||||
export interface IGuildClient {
|
export interface IGuildClient {
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
IOperatorConfigDatabase
|
IOperatorConfigDatabase
|
||||||
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { IFingerprintStat, RivenFingerprint } from "@/src/helpers/rivenHelper";
|
import { IFingerprintStat, RivenFingerprint } from "@/src/helpers/rivenHelper";
|
||||||
import { IOrbiter } from "../personalRoomsTypes";
|
import { IOrbiterClient, IShipCustomization } from "../personalRoomsTypes";
|
||||||
import { ICountedStoreItem } from "warframe-public-export-plus";
|
import { ICountedStoreItem } from "warframe-public-export-plus";
|
||||||
|
|
||||||
export type InventoryDatabaseEquipment = {
|
export type InventoryDatabaseEquipment = {
|
||||||
@ -381,7 +381,7 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
|
|||||||
BrandedSuits?: IOidWithLegacySupport[];
|
BrandedSuits?: IOidWithLegacySupport[];
|
||||||
LockedWeaponGroup?: ILockedWeaponGroupClient;
|
LockedWeaponGroup?: ILockedWeaponGroupClient;
|
||||||
HubNpcCustomizations?: IHubNpcCustomization[];
|
HubNpcCustomizations?: IHubNpcCustomization[];
|
||||||
Ship?: IOrbiter; // U22 and below, response only
|
Ship?: IOrbiterClient; // U22 and below, response only
|
||||||
ClaimedJunctionChallengeRewards?: string[]; // U39
|
ClaimedJunctionChallengeRewards?: string[]; // U39
|
||||||
SpecialItemRewardAttenuation?: IRewardAttenuation[]; // Baro's Void Surplus
|
SpecialItemRewardAttenuation?: IRewardAttenuation[]; // Baro's Void Surplus
|
||||||
}
|
}
|
||||||
@ -575,17 +575,7 @@ export interface ICrewShipMemberDatabase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ICrewShipCustomization {
|
export interface ICrewShipCustomization {
|
||||||
CrewshipInterior: IShipExterior;
|
CrewshipInterior: IShipCustomization;
|
||||||
}
|
|
||||||
|
|
||||||
export interface IShipExterior {
|
|
||||||
SkinFlavourItem?: string;
|
|
||||||
Colors?: IColor;
|
|
||||||
ShipAttachments?: IShipAttachments;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IShipAttachments {
|
|
||||||
HOOD_ORNAMENT: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IFlavourItem {
|
export interface IFlavourItem {
|
||||||
@ -1104,7 +1094,7 @@ export interface ISettings {
|
|||||||
|
|
||||||
export interface IShipInventory {
|
export interface IShipInventory {
|
||||||
ItemType: string;
|
ItemType: string;
|
||||||
ShipExterior: IShipExterior;
|
ShipExterior: IShipCustomization;
|
||||||
AirSupportPower: string;
|
AirSupportPower: string;
|
||||||
ItemId: IOid;
|
ItemId: IOid;
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,45 @@
|
|||||||
import { IColor } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { IColor } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import {
|
|
||||||
IRoom,
|
|
||||||
IPlacedDecosDatabase,
|
|
||||||
ITailorShop,
|
|
||||||
ITailorShopDatabase,
|
|
||||||
TBootLocation,
|
|
||||||
IApartmentDatabase,
|
|
||||||
IApartmentClient
|
|
||||||
} from "@/src/types/shipTypes";
|
|
||||||
import { Document, Model, Types } from "mongoose";
|
import { Document, Model, Types } from "mongoose";
|
||||||
|
import { ILoadoutClient } from "./saveLoadoutTypes";
|
||||||
|
import { IMongoDate, IOid } from "./commonTypes";
|
||||||
|
|
||||||
export interface IOrbiter {
|
export interface IGetShipResponse {
|
||||||
|
ShipOwnerId: string;
|
||||||
|
Ship: IOrbiterClient;
|
||||||
|
Apartment: IApartmentClient;
|
||||||
|
TailorShop: ITailorShop;
|
||||||
|
LoadOutInventory: { LoadOutPresets: ILoadoutClient };
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IShipAttachments {
|
||||||
|
HOOD_ORNAMENT?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IShipCustomization {
|
||||||
|
SkinFlavourItem?: string;
|
||||||
|
Colors?: IColor;
|
||||||
|
ShipAttachments?: IShipAttachments;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type TBootLocation = "LISET" | "DRIFTER_CAMP" | "APARTMENT" | "SHOP";
|
||||||
|
|
||||||
|
export interface IOrbiterClient {
|
||||||
|
Features: string[];
|
||||||
|
ShipId: IOid;
|
||||||
|
ShipInterior: IShipCustomization;
|
||||||
|
Rooms: IRoom[];
|
||||||
|
VignetteFish?: string[];
|
||||||
|
FavouriteLoadoutId?: IOid;
|
||||||
|
Wallpaper?: string;
|
||||||
|
Vignette?: string;
|
||||||
|
BootLocation?: TBootLocation;
|
||||||
|
ContentUrlSignature?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IOrbiterDatabase {
|
||||||
Features: string[];
|
Features: string[];
|
||||||
Rooms: IRoom[];
|
Rooms: IRoom[];
|
||||||
|
ShipInterior?: IShipCustomization;
|
||||||
VignetteFish?: string[];
|
VignetteFish?: string[];
|
||||||
FavouriteLoadoutId?: Types.ObjectId;
|
FavouriteLoadoutId?: Types.ObjectId;
|
||||||
Wallpaper?: string;
|
Wallpaper?: string;
|
||||||
@ -22,25 +49,169 @@ export interface IOrbiter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IPersonalRoomsClient {
|
export interface IPersonalRoomsClient {
|
||||||
ShipInteriorColors: IColor;
|
Ship: IOrbiterClient;
|
||||||
Ship: IOrbiter;
|
|
||||||
Apartment: IApartmentClient;
|
Apartment: IApartmentClient;
|
||||||
TailorShop: ITailorShop;
|
TailorShop: ITailorShop;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IPersonalRoomsDatabase {
|
export interface IPersonalRoomsDatabase {
|
||||||
ShipInteriorColors: IColor;
|
|
||||||
personalRoomsOwnerId: Types.ObjectId;
|
personalRoomsOwnerId: Types.ObjectId;
|
||||||
activeShipId: Types.ObjectId;
|
activeShipId: Types.ObjectId;
|
||||||
Ship: IOrbiter;
|
|
||||||
|
Ship: IOrbiterDatabase;
|
||||||
Apartment: IApartmentDatabase;
|
Apartment: IApartmentDatabase;
|
||||||
TailorShop: ITailorShopDatabase;
|
TailorShop: ITailorShopDatabase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IRoom {
|
||||||
|
Name: string;
|
||||||
|
MaxCapacity: number;
|
||||||
|
PlacedDecos?: IPlacedDecosDatabase[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IPlantClient {
|
||||||
|
PlantType: string;
|
||||||
|
EndTime: IMongoDate;
|
||||||
|
PlotIndex: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IPlantDatabase extends Omit<IPlantClient, "EndTime"> {
|
||||||
|
EndTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IPlanterClient {
|
||||||
|
Name: string;
|
||||||
|
Plants: IPlantClient[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IPlanterDatabase {
|
||||||
|
Name: string;
|
||||||
|
Plants: IPlantDatabase[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IGardeningClient {
|
||||||
|
Planters: IPlanterClient[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IGardeningDatabase {
|
||||||
|
Planters: IPlanterDatabase[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IApartmentClient {
|
||||||
|
Gardening: IGardeningClient;
|
||||||
|
Rooms: IRoom[];
|
||||||
|
FavouriteLoadouts: IFavouriteLoadout[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IApartmentDatabase {
|
||||||
|
Gardening: IGardeningDatabase;
|
||||||
|
Rooms: IRoom[];
|
||||||
|
FavouriteLoadouts: IFavouriteLoadoutDatabase[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IPlacedDecosDatabase {
|
||||||
|
Type: string;
|
||||||
|
Pos: [number, number, number];
|
||||||
|
Rot: [number, number, number];
|
||||||
|
Scale?: number;
|
||||||
|
Sockets?: number;
|
||||||
|
PictureFrameInfo?: IPictureFrameInfo;
|
||||||
|
_id: Types.ObjectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IPlacedDecosClient extends Omit<IPlacedDecosDatabase, "_id"> {
|
||||||
|
id: IOid;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ISetShipCustomizationsRequest {
|
||||||
|
ShipId: string;
|
||||||
|
Customization: {
|
||||||
|
SkinFlavourItem?: string;
|
||||||
|
Colors?: IColor;
|
||||||
|
ShipAttachments?: IShipAttachments;
|
||||||
|
LevelDecosVisible?: boolean;
|
||||||
|
CustomJson?: string;
|
||||||
|
};
|
||||||
|
IsExterior: boolean;
|
||||||
|
AirSupportPower?: string;
|
||||||
|
IsShop?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IShipDecorationsRequest {
|
||||||
|
Type: string;
|
||||||
|
Pos: [number, number, number];
|
||||||
|
Rot: [number, number, number];
|
||||||
|
Room: string;
|
||||||
|
BootLocation?: TBootLocation;
|
||||||
|
IsApartment?: boolean;
|
||||||
|
RemoveId?: string;
|
||||||
|
MoveId?: string;
|
||||||
|
OldRoom?: string;
|
||||||
|
Scale?: number;
|
||||||
|
Sockets?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IShipDecorationsResponse {
|
||||||
|
DecoId?: string;
|
||||||
|
Room?: string;
|
||||||
|
IsApartment?: boolean;
|
||||||
|
MaxCapacityIncrease?: number;
|
||||||
|
OldRoom?: string;
|
||||||
|
NewRoom?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ISetPlacedDecoInfoRequest {
|
||||||
|
DecoType: string;
|
||||||
|
DecoId: string;
|
||||||
|
Room: string;
|
||||||
|
PictureFrameInfo: IPictureFrameInfo;
|
||||||
|
BootLocation?: TBootLocation;
|
||||||
|
ComponentId?: string;
|
||||||
|
GuildId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IPictureFrameInfo {
|
||||||
|
Image: string;
|
||||||
|
Filter: string;
|
||||||
|
XOffset: number;
|
||||||
|
YOffset: number;
|
||||||
|
Scale: number;
|
||||||
|
InvertX: boolean;
|
||||||
|
InvertY: boolean;
|
||||||
|
ColorCorrection: number;
|
||||||
|
Text: string;
|
||||||
|
TextScale: number;
|
||||||
|
TextColorA: number;
|
||||||
|
TextColorB: number;
|
||||||
|
TextOrientation: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IFavouriteLoadout {
|
||||||
|
Tag: string;
|
||||||
|
LoadoutId: IOid;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IFavouriteLoadoutDatabase {
|
||||||
|
Tag: string;
|
||||||
|
LoadoutId: Types.ObjectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ITailorShopDatabase {
|
||||||
|
FavouriteLoadouts: IFavouriteLoadoutDatabase[];
|
||||||
|
Colors?: IColor;
|
||||||
|
CustomJson?: string;
|
||||||
|
LevelDecosVisible?: boolean;
|
||||||
|
Rooms: IRoom[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ITailorShop extends Omit<ITailorShopDatabase, "FavouriteLoadouts"> {
|
||||||
|
FavouriteLoadouts: IFavouriteLoadout[];
|
||||||
|
}
|
||||||
|
|
||||||
export type RoomsType = { Name: string; MaxCapacity: number; PlacedDecos: Types.DocumentArray<IPlacedDecosDatabase> };
|
export type RoomsType = { Name: string; MaxCapacity: number; PlacedDecos: Types.DocumentArray<IPlacedDecosDatabase> };
|
||||||
|
|
||||||
export type PersonalRoomsDocumentProps = {
|
export type PersonalRoomsDocumentProps = {
|
||||||
Ship: Omit<IOrbiter, "Rooms"> & {
|
Ship: Omit<IOrbiterDatabase, "Rooms"> & {
|
||||||
Rooms: RoomsType[];
|
Rooms: RoomsType[];
|
||||||
};
|
};
|
||||||
Apartment: Omit<IApartmentDatabase, "Rooms"> & {
|
Apartment: Omit<IApartmentDatabase, "Rooms"> & {
|
||||||
|
@ -1,40 +1,6 @@
|
|||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { IMongoDate, IOid } from "@/src/types/commonTypes";
|
|
||||||
import { IColor } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { IColor } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { ILoadoutClient } from "./saveLoadoutTypes";
|
import { IShipAttachments } from "./personalRoomsTypes";
|
||||||
|
|
||||||
export interface IGetShipResponse {
|
|
||||||
ShipOwnerId: string;
|
|
||||||
Ship: IShip;
|
|
||||||
Apartment: IApartmentClient;
|
|
||||||
TailorShop: ITailorShop;
|
|
||||||
LoadOutInventory: { LoadOutPresets: ILoadoutClient };
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IShipAttachments {
|
|
||||||
HOOD_ORNAMENT: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IShipInterior {
|
|
||||||
Colors?: IColor;
|
|
||||||
ShipAttachments?: IShipAttachments;
|
|
||||||
SkinFlavourItem?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type TBootLocation = "LISET" | "DRIFTER_CAMP" | "APARTMENT" | "SHOP";
|
|
||||||
|
|
||||||
export interface IShip {
|
|
||||||
Features: string[];
|
|
||||||
ShipId: IOid;
|
|
||||||
ShipInterior: IShipInterior;
|
|
||||||
Rooms: IRoom[];
|
|
||||||
VignetteFish?: string[];
|
|
||||||
FavouriteLoadoutId?: IOid;
|
|
||||||
Wallpaper?: string;
|
|
||||||
Vignette?: string;
|
|
||||||
BootLocation?: TBootLocation;
|
|
||||||
ContentUrlSignature?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IShipDatabase {
|
export interface IShipDatabase {
|
||||||
ItemType: string;
|
ItemType: string;
|
||||||
@ -44,155 +10,3 @@ export interface IShipDatabase {
|
|||||||
ShipAttachments?: IShipAttachments;
|
ShipAttachments?: IShipAttachments;
|
||||||
SkinFlavourItem?: string;
|
SkinFlavourItem?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IRoom {
|
|
||||||
Name: string;
|
|
||||||
MaxCapacity: number;
|
|
||||||
PlacedDecos?: IPlacedDecosDatabase[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPlantClient {
|
|
||||||
PlantType: string;
|
|
||||||
EndTime: IMongoDate;
|
|
||||||
PlotIndex: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPlantDatabase extends Omit<IPlantClient, "EndTime"> {
|
|
||||||
EndTime: Date;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPlanterClient {
|
|
||||||
Name: string;
|
|
||||||
Plants: IPlantClient[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPlanterDatabase {
|
|
||||||
Name: string;
|
|
||||||
Plants: IPlantDatabase[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IGardeningClient {
|
|
||||||
Planters: IPlanterClient[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IGardeningDatabase {
|
|
||||||
Planters: IPlanterDatabase[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IApartmentClient {
|
|
||||||
Gardening: IGardeningClient;
|
|
||||||
Rooms: IRoom[];
|
|
||||||
FavouriteLoadouts: IFavouriteLoadout[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IApartmentDatabase {
|
|
||||||
Gardening: IGardeningDatabase;
|
|
||||||
Rooms: IRoom[];
|
|
||||||
FavouriteLoadouts: IFavouriteLoadoutDatabase[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPlacedDecosDatabase {
|
|
||||||
Type: string;
|
|
||||||
Pos: [number, number, number];
|
|
||||||
Rot: [number, number, number];
|
|
||||||
Scale?: number;
|
|
||||||
Sockets?: number;
|
|
||||||
PictureFrameInfo?: IPictureFrameInfo;
|
|
||||||
_id: Types.ObjectId;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPlacedDecosClient extends Omit<IPlacedDecosDatabase, "_id"> {
|
|
||||||
id: IOid;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ISetShipCustomizationsRequest {
|
|
||||||
ShipId: string;
|
|
||||||
Customization: Customization;
|
|
||||||
IsExterior: boolean;
|
|
||||||
AirSupportPower?: string;
|
|
||||||
IsShop?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Customization {
|
|
||||||
SkinFlavourItem: string;
|
|
||||||
Colors: IColor;
|
|
||||||
ShipAttachments: ShipAttachments;
|
|
||||||
LevelDecosVisible: boolean;
|
|
||||||
CustomJson: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: check for more attachments
|
|
||||||
export interface ShipAttachments {
|
|
||||||
HOOD_ORNAMENT: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IShipDecorationsRequest {
|
|
||||||
Type: string;
|
|
||||||
Pos: [number, number, number];
|
|
||||||
Rot: [number, number, number];
|
|
||||||
Room: string;
|
|
||||||
BootLocation?: TBootLocation;
|
|
||||||
IsApartment?: boolean;
|
|
||||||
RemoveId?: string;
|
|
||||||
MoveId?: string;
|
|
||||||
OldRoom?: string;
|
|
||||||
Scale?: number;
|
|
||||||
Sockets?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IShipDecorationsResponse {
|
|
||||||
DecoId?: string;
|
|
||||||
Room?: string;
|
|
||||||
IsApartment?: boolean;
|
|
||||||
MaxCapacityIncrease?: number;
|
|
||||||
OldRoom?: string;
|
|
||||||
NewRoom?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ISetPlacedDecoInfoRequest {
|
|
||||||
DecoType: string;
|
|
||||||
DecoId: string;
|
|
||||||
Room: string;
|
|
||||||
PictureFrameInfo: IPictureFrameInfo;
|
|
||||||
BootLocation?: TBootLocation;
|
|
||||||
ComponentId?: string;
|
|
||||||
GuildId?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPictureFrameInfo {
|
|
||||||
Image: string;
|
|
||||||
Filter: string;
|
|
||||||
XOffset: number;
|
|
||||||
YOffset: number;
|
|
||||||
Scale: number;
|
|
||||||
InvertX: boolean;
|
|
||||||
InvertY: boolean;
|
|
||||||
ColorCorrection: number;
|
|
||||||
Text: string;
|
|
||||||
TextScale: number;
|
|
||||||
TextColorA: number;
|
|
||||||
TextColorB: number;
|
|
||||||
TextOrientation: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IFavouriteLoadout {
|
|
||||||
Tag: string;
|
|
||||||
LoadoutId: IOid;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IFavouriteLoadoutDatabase {
|
|
||||||
Tag: string;
|
|
||||||
LoadoutId: Types.ObjectId;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ITailorShopDatabase {
|
|
||||||
FavouriteLoadouts: IFavouriteLoadoutDatabase[];
|
|
||||||
Colors?: IColor;
|
|
||||||
CustomJson: string;
|
|
||||||
LevelDecosVisible: boolean;
|
|
||||||
Rooms: IRoom[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ITailorShop extends Omit<ITailorShopDatabase, "FavouriteLoadouts"> {
|
|
||||||
FavouriteLoadouts: IFavouriteLoadout[];
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user