2024-01-25 14:49:45 +01:00
|
|
|
import { HydratedDocument, Model, Schema, Types, model } from "mongoose";
|
2023-09-05 07:37:30 -05:00
|
|
|
import {
|
|
|
|
IFlavourItem,
|
|
|
|
IRawUpgrade,
|
|
|
|
IMiscItem,
|
|
|
|
IInventoryDatabase,
|
2023-09-11 13:20:07 +02:00
|
|
|
IBooster,
|
|
|
|
IInventoryResponse,
|
|
|
|
IInventoryDatabaseDocument,
|
2023-12-14 17:34:15 +01:00
|
|
|
ISlots,
|
|
|
|
IGenericItem,
|
|
|
|
IMailbox,
|
2024-01-25 14:49:45 +01:00
|
|
|
IDuviriInfo,
|
|
|
|
IPendingRecipe as IPendingRecipeDatabase,
|
|
|
|
IPendingRecipeResponse
|
2023-12-14 17:34:15 +01:00
|
|
|
} from "../../types/inventoryTypes/inventoryTypes";
|
|
|
|
import { IMongoDate, IOid } from "../../types/commonTypes";
|
|
|
|
import { ISuitDatabase } from "@/src/types/inventoryTypes/SuitTypes";
|
2023-06-14 02:26:19 +02:00
|
|
|
import { IWeaponDatabase } from "@/src/types/inventoryTypes/weaponTypes";
|
2023-12-14 17:34:15 +01:00
|
|
|
import {
|
|
|
|
IAbilityOverride,
|
|
|
|
IColor,
|
|
|
|
IItemConfig,
|
|
|
|
IOperatorConfigClient,
|
|
|
|
IOperatorConfigDatabase,
|
|
|
|
IPolarity
|
|
|
|
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
|
|
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
|
|
|
|
2024-01-25 14:49:45 +01:00
|
|
|
const pendingRecipeSchema = new Schema<IPendingRecipeDatabase>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
CompletionDate: Date
|
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
pendingRecipeSchema.virtual("ItemId").get(function () {
|
|
|
|
return { $oid: this._id.toString() };
|
|
|
|
});
|
|
|
|
|
|
|
|
pendingRecipeSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
|
|
|
(returnedObject as IPendingRecipeResponse).CompletionDate = {
|
|
|
|
$date: { $numberLong: (returnedObject as IPendingRecipeDatabase).CompletionDate.getTime().toString() }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
const polaritySchema = new Schema<IPolarity>({
|
|
|
|
Slot: Number,
|
|
|
|
Value: String
|
|
|
|
});
|
2023-06-04 03:06:22 +02:00
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
const abilityOverrideSchema = new Schema<IAbilityOverride>({
|
2023-06-04 03:06:22 +02:00
|
|
|
Ability: String,
|
|
|
|
Index: Number
|
|
|
|
});
|
2023-12-14 17:34:15 +01:00
|
|
|
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>(
|
|
|
|
{
|
|
|
|
Skins: [String],
|
|
|
|
pricol: colorSchema,
|
|
|
|
attcol: colorSchema,
|
|
|
|
sigcol: colorSchema,
|
|
|
|
eyecol: colorSchema,
|
|
|
|
facial: colorSchema,
|
|
|
|
syancol: colorSchema,
|
|
|
|
cloth: colorSchema,
|
|
|
|
Upgrades: [String],
|
|
|
|
Name: String, // not sure if possible in operator
|
|
|
|
ugly: Boolean // not sure if possible in operator
|
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
operatorConfigSchema.virtual("ItemId").get(function () {
|
|
|
|
return { $oid: this._id.toString() } satisfies IOid;
|
2023-06-04 03:06:22 +02:00
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
operatorConfigSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
2023-06-14 02:26:19 +02:00
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
///TODO: clearly seperate the different config schemas. (suit and weapon and so on)
|
|
|
|
const ItemConfigSchema = new Schema<IItemConfig>(
|
|
|
|
{
|
|
|
|
Skins: [String],
|
|
|
|
pricol: colorSchema,
|
|
|
|
attcol: colorSchema,
|
|
|
|
sigcol: colorSchema,
|
|
|
|
eyecol: colorSchema,
|
|
|
|
facial: colorSchema,
|
|
|
|
syancol: colorSchema,
|
|
|
|
Upgrades: [String],
|
|
|
|
Songs: [
|
|
|
|
{
|
|
|
|
m: String,
|
|
|
|
b: String,
|
|
|
|
p: String,
|
|
|
|
s: String
|
|
|
|
}
|
|
|
|
],
|
|
|
|
Name: String,
|
|
|
|
AbilityOverride: abilityOverrideSchema,
|
|
|
|
PvpUpgrades: [String],
|
|
|
|
ugly: Boolean
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
ItemConfigSchema.set("toJSON", {
|
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
//TODO: migrate to one schema for weapons and suits.. and possibly others
|
|
|
|
const WeaponSchema = new Schema<IWeaponDatabase>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
Configs: [ItemConfigSchema],
|
|
|
|
UpgradeVer: Number,
|
|
|
|
XP: Number,
|
|
|
|
Features: Number,
|
|
|
|
Polarized: Number,
|
|
|
|
Polarity: [polaritySchema],
|
|
|
|
FocusLens: String,
|
|
|
|
ModSlotPurchases: Number,
|
|
|
|
UpgradeType: Schema.Types.Mixed, //todo
|
|
|
|
UpgradeFingerprint: String,
|
|
|
|
ItemName: String,
|
|
|
|
ModularParts: [String],
|
|
|
|
UnlockLevel: Number
|
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
WeaponSchema.virtual("ItemId").get(function () {
|
|
|
|
return { $oid: this._id.toString() } satisfies IOid;
|
2023-06-14 02:26:19 +02:00
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
WeaponSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const BoosterSchema = new Schema<IBooster>({
|
2023-08-31 14:29:09 +04:00
|
|
|
ExpiryDate: Number,
|
|
|
|
ItemType: String
|
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
const RawUpgrades = new Schema<IRawUpgrade>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
ItemCount: Number
|
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
RawUpgrades.virtual("LastAdded").get(function () {
|
|
|
|
return { $oid: this._id.toString() } satisfies IOid;
|
2023-09-06 14:02:54 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
RawUpgrades.set("toJSON", {
|
2023-12-14 17:34:15 +01:00
|
|
|
virtuals: true,
|
2023-09-06 14:02:54 +04:00
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
//TODO: find out what this is
|
2023-09-06 14:02:54 +04:00
|
|
|
const Upgrade = new Schema({
|
|
|
|
UpgradeFingerprint: String,
|
|
|
|
ItemType: String
|
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
Upgrade.virtual("ItemId").get(function () {
|
|
|
|
return { $oid: this._id.toString() } satisfies IOid;
|
|
|
|
});
|
|
|
|
|
2023-09-06 14:02:54 +04:00
|
|
|
Upgrade.set("toJSON", {
|
2023-12-14 17:34:15 +01:00
|
|
|
virtuals: true,
|
2023-09-06 14:02:54 +04:00
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
//TODO: reduce weapon and suit schemas to one schema if reasonable
|
|
|
|
const suitSchema = new Schema<ISuitDatabase>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
Configs: [ItemConfigSchema],
|
|
|
|
UpgradeVer: Number,
|
|
|
|
XP: Number,
|
|
|
|
InfestationDate: Date,
|
|
|
|
Features: Number,
|
|
|
|
Polarity: [polaritySchema],
|
|
|
|
Polarized: Number,
|
|
|
|
ModSlotPurchases: Number,
|
|
|
|
FocusLens: String,
|
|
|
|
UnlockLevel: Number
|
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
suitSchema.virtual("ItemId").get(function () {
|
|
|
|
return { $oid: this._id.toString() } satisfies IOid;
|
|
|
|
});
|
|
|
|
|
|
|
|
suitSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
2023-07-27 22:15:15 +02:00
|
|
|
transform(_document, returnedObject) {
|
2023-06-14 02:26:19 +02:00
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
const slotsBinSchema = new Schema<ISlots>(
|
|
|
|
{
|
|
|
|
Slots: Number,
|
|
|
|
Extra: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
2023-06-14 02:26:19 +02:00
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
const FlavourItemSchema = new Schema(
|
|
|
|
{
|
|
|
|
ItemType: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
2023-06-04 03:06:22 +02:00
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
FlavourItemSchema.set("toJSON", {
|
2023-06-04 03:06:22 +02:00
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
const GenericItemSchema = new Schema<IGenericItem>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
Configs: [ItemConfigSchema],
|
|
|
|
UpgradeVer: Number //this is probably just __v
|
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
GenericItemSchema.virtual("ItemId").get(function () {
|
|
|
|
return { $oid: this._id.toString() } satisfies IOid;
|
2023-06-04 03:06:22 +02:00
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
GenericItemSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
2023-07-27 22:15:15 +02:00
|
|
|
transform(_document, returnedObject) {
|
2023-06-04 03:06:22 +02:00
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
// "Mailbox": { "LastInboxId": { "$oid": "123456780000000000000000" } }
|
|
|
|
const MailboxSchema = new Schema<IMailbox>(
|
2023-06-14 02:26:19 +02:00
|
|
|
{
|
2023-12-14 17:34:15 +01:00
|
|
|
LastInboxId: {
|
|
|
|
type: Schema.Types.ObjectId,
|
|
|
|
set: (v: IMailbox["LastInboxId"]) => v.$oid.toString()
|
|
|
|
}
|
2023-06-14 02:26:19 +02:00
|
|
|
},
|
2023-12-14 17:34:15 +01:00
|
|
|
{ id: false, _id: false }
|
2023-06-14 02:26:19 +02:00
|
|
|
);
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
MailboxSchema.set("toJSON", {
|
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject.__v;
|
|
|
|
//TODO: there is a lot of any here
|
|
|
|
returnedObject.LastInboxId = toOid(returnedObject.LastInboxId as Types.ObjectId);
|
|
|
|
}
|
2023-06-14 02:26:19 +02:00
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
const DuviriInfoSchema = new Schema<IDuviriInfo>(
|
|
|
|
{
|
|
|
|
Seed: Number,
|
|
|
|
NumCompletions: Number
|
|
|
|
},
|
|
|
|
{
|
|
|
|
_id: false,
|
|
|
|
id: false
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
DuviriInfoSchema.set("toJSON", {
|
2023-07-27 22:15:15 +02:00
|
|
|
transform(_document, returnedObject) {
|
2023-06-14 02:26:19 +02:00
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>({
|
2023-06-04 03:06:22 +02:00
|
|
|
accountOwnerId: Schema.Types.ObjectId,
|
|
|
|
SubscribedToEmails: Number,
|
|
|
|
Created: Schema.Types.Mixed,
|
|
|
|
RewardSeed: Number,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Credit
|
2023-06-04 03:06:22 +02:00
|
|
|
RegularCredits: Number,
|
2024-01-06 17:28:11 +02:00
|
|
|
//Platinum
|
2023-06-04 03:06:22 +02:00
|
|
|
PremiumCredits: Number,
|
2024-01-06 17:28:11 +02:00
|
|
|
//Gift Platinum(Non trade)
|
2023-06-04 03:06:22 +02:00
|
|
|
PremiumCreditsFree: Number,
|
2024-01-06 17:28:11 +02:00
|
|
|
//Endo
|
2023-06-04 03:06:22 +02:00
|
|
|
FusionPoints: Number,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//SlotAny
|
2023-06-14 02:26:19 +02:00
|
|
|
SuitBin: slotsBinSchema,
|
|
|
|
WeaponBin: slotsBinSchema,
|
|
|
|
SentinelBin: slotsBinSchema,
|
2023-12-14 17:34:15 +01:00
|
|
|
SpaceSuitBin: slotsBinSchema,
|
|
|
|
SpaceWeaponBin: slotsBinSchema,
|
|
|
|
PvpBonusLoadoutBin: slotsBinSchema,
|
|
|
|
PveBonusLoadoutBin: slotsBinSchema,
|
|
|
|
RandomModBin: slotsBinSchema,
|
|
|
|
OperatorAmpBin: slotsBinSchema,
|
|
|
|
CrewShipSalvageBin: slotsBinSchema,
|
|
|
|
MechBin: slotsBinSchema,
|
|
|
|
CrewMemberBin: slotsBinSchema,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//How many trades do you have left
|
2023-06-04 03:06:22 +02:00
|
|
|
TradesRemaining: Number,
|
2024-01-06 17:28:11 +02:00
|
|
|
//How many Gift do you have left*(gift spends the trade)
|
|
|
|
GiftsRemaining: Number,
|
|
|
|
//Curent trade info Giving or Getting items
|
|
|
|
PendingTrades: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Curent Syndicates rank\exp
|
|
|
|
Affiliations: [Schema.Types.Mixed],
|
|
|
|
//Syndicates Missions complate(Navigation->Syndicate)
|
|
|
|
CompletedSyndicates: [String],
|
|
|
|
//Daily Syndicates Exp
|
2023-06-04 03:06:22 +02:00
|
|
|
DailyAffiliation: Number,
|
|
|
|
DailyAffiliationPvp: Number,
|
|
|
|
DailyAffiliationLibrary: Number,
|
2024-01-06 17:28:11 +02:00
|
|
|
DailyAffiliationCetus: Number,
|
|
|
|
DailyAffiliationQuills: Number,
|
|
|
|
DailyAffiliationSolaris: Number,
|
|
|
|
DailyAffiliationVentkids: Number,
|
|
|
|
DailyAffiliationVox: Number,
|
|
|
|
DailyAffiliationEntrati: Number,
|
|
|
|
DailyAffiliationNecraloid: Number,
|
|
|
|
DailyAffiliationZariman: Number,
|
|
|
|
DailyAffiliationKahl: Number,
|
|
|
|
|
|
|
|
//Daily Focus limit
|
2023-06-04 03:06:22 +02:00
|
|
|
DailyFocus: Number,
|
2024-01-25 14:49:45 +01:00
|
|
|
//you not used Focus
|
2024-01-06 17:28:11 +02:00
|
|
|
FocusXP: Schema.Types.Mixed,
|
|
|
|
//Curent active like Active school focuses is = "Zenurik"
|
|
|
|
FocusAbility: String,
|
|
|
|
//The treeways of the Focus school.(Active and passive Ability)
|
|
|
|
FocusUpgrades: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Achievement
|
2023-06-04 03:06:22 +02:00
|
|
|
ChallengeProgress: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Account Item like Ferrite,Form,Kuva etc
|
|
|
|
MiscItems: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Non Upgrade Mods Example:I have 999 item WeaponElectricityDamageMod (only "ItemCount"+"ItemType")
|
2023-09-06 14:02:54 +04:00
|
|
|
RawUpgrades: [RawUpgrades],
|
2024-01-06 17:28:11 +02:00
|
|
|
//Upgrade Mods\Riven\Arcane Example:"UpgradeFingerprint"+"ItemType"+""
|
|
|
|
Upgrades: [Upgrade],
|
|
|
|
|
|
|
|
//Warframe
|
2023-06-04 03:06:22 +02:00
|
|
|
Suits: [suitSchema],
|
2024-01-06 17:28:11 +02:00
|
|
|
//Primary Weapon
|
2023-06-14 02:26:19 +02:00
|
|
|
LongGuns: [WeaponSchema],
|
2024-01-06 17:28:11 +02:00
|
|
|
//Secondary Weapon
|
2023-06-14 02:26:19 +02:00
|
|
|
Pistols: [WeaponSchema],
|
2024-01-06 17:28:11 +02:00
|
|
|
//Melee Weapon
|
2023-06-14 02:26:19 +02:00
|
|
|
Melee: [WeaponSchema],
|
2024-01-06 17:28:11 +02:00
|
|
|
//Ability Weapon like Ultimate Mech\Excalibur\Ivara etc
|
|
|
|
SpecialItems: [Schema.Types.Mixed],
|
|
|
|
//The Mandachord(Octavia) is a step sequencer
|
|
|
|
StepSequencers: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Sentinel(like Helios or modular)
|
|
|
|
Sentinels: [Schema.Types.Mixed],
|
|
|
|
//Any /Sentinels/SentinelWeapons/ (like warframe weapon)
|
|
|
|
SentinelWeapons: [Schema.Types.Mixed],
|
|
|
|
//Modular Pets
|
|
|
|
MoaPets: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
KubrowPetEggs: [Schema.Types.Mixed],
|
|
|
|
//Like PowerSuit Cat\Kubrow or etc Pets
|
|
|
|
KubrowPets: [Schema.Types.Mixed],
|
|
|
|
//Prints Cat(3 Prints)\Kubrow(2 Prints) Pets
|
|
|
|
KubrowPetPrints: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Item for EquippedGear example:Scaner,LoadoutTechSummon etc
|
|
|
|
Consumables: [Schema.Types.Mixed],
|
|
|
|
//Weel Emotes+Gear
|
|
|
|
EquippedEmotes: [String],
|
|
|
|
EquippedGear: [String],
|
|
|
|
//Equipped Shawzin
|
|
|
|
EquippedInstrument: String,
|
|
|
|
ReceivedStartingGear: Boolean,
|
|
|
|
|
|
|
|
//to use add SummonItem to Consumables+EquippedGear
|
|
|
|
//Archwing need Suits+Melee+Guns
|
|
|
|
SpaceSuits: [GenericItemSchema],
|
|
|
|
SpaceMelee: [GenericItemSchema],
|
|
|
|
SpaceGuns: [Schema.Types.Mixed],
|
|
|
|
ArchwingEnabled: Boolean,
|
|
|
|
//Mech need Suits+SpaceGuns+SpecialItem
|
|
|
|
MechSuits: [suitSchema],
|
|
|
|
///Restoratives/HoverboardSummon (like Suit)
|
|
|
|
Hoverboards: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Use Operator\Drifter
|
|
|
|
UseAdultOperatorLoadout: Boolean,
|
|
|
|
//Operator\Drifter Weapon
|
|
|
|
OperatorAmps: [Schema.Types.Mixed],
|
|
|
|
//Operator
|
|
|
|
OperatorLoadOuts: [operatorConfigSchema],
|
|
|
|
//Drifter
|
|
|
|
AdultOperatorLoadOuts: [operatorConfigSchema],
|
|
|
|
DrifterMelee: [GenericItemSchema],
|
|
|
|
DrifterGuns: [GenericItemSchema],
|
|
|
|
//ErsatzHorsePowerSuit
|
|
|
|
Horses: [GenericItemSchema],
|
|
|
|
|
|
|
|
//Liset colors skin etc
|
2023-06-04 03:06:22 +02:00
|
|
|
Ships: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
// /Lotus/Types/Items/ShipDecos/
|
|
|
|
ShipDecorations: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//RailJack Setting(Mods,Skin,Weapon,etc)
|
|
|
|
CrewShipHarnesses: [Schema.Types.Mixed],
|
|
|
|
//Railjack/Components(https://warframe.fandom.com/wiki/Railjack/Components)
|
|
|
|
CrewShipRawSalvage: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Default RailJack
|
|
|
|
CrewShips: [Schema.Types.Mixed],
|
|
|
|
CrewShipAmmo: [Schema.Types.Mixed],
|
|
|
|
CrewShipWeapons: [Schema.Types.Mixed],
|
|
|
|
CrewShipWeaponSkins: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//NPC Crew and weapon
|
|
|
|
CrewMembers: [Schema.Types.Mixed],
|
|
|
|
CrewShipSalvagedWeaponSkins: [Schema.Types.Mixed],
|
|
|
|
CrewShipSalvagedWeapons: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Complete Mission\Quests
|
|
|
|
Missions: [Schema.Types.Mixed],
|
2023-06-04 03:06:22 +02:00
|
|
|
QuestKeys: [Schema.Types.Mixed],
|
2024-01-25 14:49:45 +01:00
|
|
|
//item like DojoKey or Boss missions key
|
2024-01-06 17:28:11 +02:00
|
|
|
LevelKeys: [Schema.Types.Mixed],
|
|
|
|
//Active quests
|
|
|
|
Quests: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Cosmetics like profile glyphs\Kavasa Prime Kubrow Collar\Game Theme etc
|
2023-06-14 02:26:19 +02:00
|
|
|
FlavourItems: [FlavourItemSchema],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Lunaro Weapon
|
2023-12-14 17:34:15 +01:00
|
|
|
Scoops: [GenericItemSchema],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Mastery Rank*(Need item XPInfo to rank up)
|
|
|
|
PlayerLevel: Number,
|
|
|
|
//Item Mastery Rank exp
|
|
|
|
XPInfo: [Schema.Types.Mixed],
|
|
|
|
//24h timer rank up
|
|
|
|
TrainingDate: Date,
|
|
|
|
//Retries rank up(3 time)
|
2023-06-04 03:06:22 +02:00
|
|
|
TrainingRetriesLeft: Number,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//you saw last played Region when you opened the star map
|
2023-06-04 03:06:22 +02:00
|
|
|
LastRegionPlayed: String,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Blueprint
|
2023-06-04 03:06:22 +02:00
|
|
|
Recipes: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
//Crafting Blueprint(Item Name + CompletionDate)
|
2024-01-25 14:49:45 +01:00
|
|
|
PendingRecipes: [pendingRecipeSchema],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//warframe\Weapon skins
|
|
|
|
WeaponSkins: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Ayatan Item
|
2023-06-04 03:06:22 +02:00
|
|
|
FusionTreasures: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
//"node": "TreasureTutorial", "state": "TS_COMPLETED"
|
|
|
|
TauntHistory: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//noShow2FA,VisitPrimeVault etc
|
2023-06-04 03:06:22 +02:00
|
|
|
WebFlags: Schema.Types.Mixed,
|
2024-01-06 17:28:11 +02:00
|
|
|
//Id CompletedAlerts
|
2023-06-04 03:06:22 +02:00
|
|
|
CompletedAlerts: [String],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Warframe\Duviri
|
2023-06-04 03:06:22 +02:00
|
|
|
StoryModeChoice: String,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Alert->Kuva Siphon
|
2023-06-04 03:06:22 +02:00
|
|
|
PeriodicMissionCompletions: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Codex->LoreFragment
|
2023-06-04 03:06:22 +02:00
|
|
|
LoreFragmentScans: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Resource,Credit,Affinity etc or Bless any boosters
|
2023-08-31 14:29:09 +04:00
|
|
|
Boosters: [BoosterSchema],
|
2024-01-06 17:28:11 +02:00
|
|
|
BlessingCooldown: Schema.Types.Mixed,
|
|
|
|
|
|
|
|
//the color your clan requests like Items/Research/DojoColors/DojoColorPlainsB
|
2023-06-04 03:06:22 +02:00
|
|
|
ActiveDojoColorResearch: String,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
2023-06-04 03:06:22 +02:00
|
|
|
SentientSpawnChanceBoosters: Schema.Types.Mixed,
|
2024-01-25 14:49:45 +01:00
|
|
|
|
2023-06-04 03:06:22 +02:00
|
|
|
QualifyingInvasions: [Schema.Types.Mixed],
|
|
|
|
FactionScores: [Number],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Have only Suit+Pistols+LongGuns+Melee+ItemType(BronzeSpectre,GoldSpectre,PlatinumSpectreArmy,SilverSpectreArmy)
|
|
|
|
//"/Lotus/Types/Game/SpectreArmies/BronzeSpectreArmy": "Vapor Specter Regiment",
|
2023-06-04 03:06:22 +02:00
|
|
|
SpectreLoadouts: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
//If you want change Spectre Gear id
|
|
|
|
PendingSpectreLoadouts: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//New quest Email spam
|
|
|
|
//example:"ItemType": "/Lotus/Types/Keys/RailJackBuildQuest/RailjackBuildQuestEmailItem",
|
2023-06-04 03:06:22 +02:00
|
|
|
EmailItems: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Profile->Wishlist
|
2023-06-04 03:06:22 +02:00
|
|
|
Wishlist: [String],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//https://warframe.fandom.com/wiki/Alignment
|
|
|
|
//like "Alignment": { "Wisdom": 9, "Alignment": 1 },
|
2023-06-04 03:06:22 +02:00
|
|
|
Alignment: Schema.Types.Mixed,
|
2024-01-06 17:28:11 +02:00
|
|
|
AlignmentReplay: Schema.Types.Mixed,
|
|
|
|
|
|
|
|
//https://warframe.fandom.com/wiki/Sortie
|
2023-06-04 03:06:22 +02:00
|
|
|
CompletedSorties: [String],
|
|
|
|
LastSortieReward: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Resource_Drone[Uselees stuff]
|
2023-06-04 03:06:22 +02:00
|
|
|
Drones: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Active profile ico
|
2023-06-04 03:06:22 +02:00
|
|
|
ActiveAvatarImageType: String,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
// open location store like EidolonPlainsDiscoverable or OrbVallisCaveDiscoverable
|
2023-06-04 03:06:22 +02:00
|
|
|
DiscoveredMarkers: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
//Open location mission like "JobId" + "StageCompletions"
|
2023-06-04 03:06:22 +02:00
|
|
|
CompletedJobs: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Game mission\ivent score example "Tag": "WaterFight", "Best": 170, "Count": 1258,
|
2023-06-04 03:06:22 +02:00
|
|
|
PersonalGoalProgress: [Schema.Types.Mixed],
|
2024-01-25 14:49:45 +01:00
|
|
|
|
2024-01-06 17:28:11 +02:00
|
|
|
//Setting interface Style
|
2023-06-04 03:06:22 +02:00
|
|
|
ThemeStyle: String,
|
|
|
|
ThemeBackground: String,
|
|
|
|
ThemeSounds: String,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Daily LoginRewards
|
2023-06-04 03:06:22 +02:00
|
|
|
LoginMilestoneRewards: [String],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//You first Dialog with NPC or use new Item
|
2023-06-04 03:06:22 +02:00
|
|
|
NodeIntrosCompleted: [String],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//https://warframe.fandom.com/wiki/Heist
|
|
|
|
//ProfitTaker(1-4) Example:"LocationTag": "EudicoHeists", "Jobs":Mission name
|
2023-06-04 03:06:22 +02:00
|
|
|
CompletedJobChains: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
//Night Wave Challenge
|
2023-06-04 03:06:22 +02:00
|
|
|
SeasonChallengeHistory: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Cephalon Simaris Entries Example:"TargetType"+"Scans"(1-10)+"Completed": true|false
|
|
|
|
LibraryPersonalProgress: [Schema.Types.Mixed],
|
|
|
|
//Cephalon Simaris Daily Task
|
|
|
|
LibraryAvailableDailyTaskInfo: Schema.Types.Mixed,
|
|
|
|
|
|
|
|
//https://warframe.fandom.com/wiki/Invasion
|
2023-06-04 03:06:22 +02:00
|
|
|
InvasionChainProgress: [Schema.Types.Mixed],
|
2024-01-25 14:49:45 +01:00
|
|
|
|
2024-01-06 17:28:11 +02:00
|
|
|
//https://warframe.fandom.com/wiki/Parazon
|
2023-12-14 17:34:15 +01:00
|
|
|
DataKnives: [GenericItemSchema],
|
2024-01-25 14:49:45 +01:00
|
|
|
|
2024-01-06 17:28:11 +02:00
|
|
|
//CorpusLich or GrineerLich
|
|
|
|
NemesisAbandonedRewards: [String],
|
2024-01-25 14:49:45 +01:00
|
|
|
//CorpusLich\KuvaLich
|
2023-06-04 03:06:22 +02:00
|
|
|
NemesisHistory: [Schema.Types.Mixed],
|
|
|
|
LastNemesisAllySpawnTime: Schema.Types.Mixed,
|
2024-01-25 14:49:45 +01:00
|
|
|
|
2024-01-06 17:28:11 +02:00
|
|
|
//TradingRulesConfirmed,ShowFriendInvNotifications(Option->Social)
|
2023-06-04 03:06:22 +02:00
|
|
|
Settings: Schema.Types.Mixed,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
2024-01-25 14:49:45 +01:00
|
|
|
//Railjack craft
|
2024-01-06 17:28:11 +02:00
|
|
|
//https://warframe.fandom.com/wiki/Rising_Tide
|
2023-06-04 03:06:22 +02:00
|
|
|
PersonalTechProjects: [Schema.Types.Mixed],
|
2024-01-25 14:49:45 +01:00
|
|
|
|
2024-01-06 17:28:11 +02:00
|
|
|
//Modulars lvl and exp(Railjack|Duviri)
|
|
|
|
//https://warframe.fandom.com/wiki/Intrinsics
|
2023-06-04 03:06:22 +02:00
|
|
|
PlayerSkills: Schema.Types.Mixed,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//TradeBannedUntil data
|
2023-06-04 03:06:22 +02:00
|
|
|
TradeBannedUntil: Schema.Types.Mixed,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//https://warframe.fandom.com/wiki/Helminth
|
2023-06-04 03:06:22 +02:00
|
|
|
InfestedFoundry: Schema.Types.Mixed,
|
2024-01-06 17:28:11 +02:00
|
|
|
NextRefill: Schema.Types.Mixed,
|
|
|
|
|
|
|
|
//Purchase this new permanent skin from the Lotus customization options in Personal Quarters located in your Orbiter.
|
|
|
|
//https://warframe.fandom.com/wiki/Lotus#The_New_War
|
2023-06-04 03:06:22 +02:00
|
|
|
LotusCustomization: Schema.Types.Mixed,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
|
|
|
//Progress+Rank+ItemType(ZarimanPumpShotgun)
|
|
|
|
//https://warframe.fandom.com/wiki/Incarnon
|
|
|
|
EvolutionProgress: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Unknown and system
|
|
|
|
DuviriInfo: DuviriInfoSchema,
|
|
|
|
Mailbox: MailboxSchema,
|
|
|
|
KahlLoadOuts: [Schema.Types.Mixed],
|
|
|
|
HandlerPoints: Number,
|
|
|
|
ChallengesFixVersion: Number,
|
|
|
|
PlayedParkourTutorial: Boolean,
|
|
|
|
SubscribedToEmailsPersonalized: Number,
|
2023-06-04 03:06:22 +02:00
|
|
|
LastInventorySync: Schema.Types.Mixed,
|
|
|
|
ActiveLandscapeTraps: [Schema.Types.Mixed],
|
|
|
|
RepVotes: [Schema.Types.Mixed],
|
|
|
|
LeagueTickets: [Schema.Types.Mixed],
|
2024-01-06 17:28:11 +02:00
|
|
|
HasContributedToDojo: Boolean,
|
|
|
|
HWIDProtectEnabled: Boolean,
|
|
|
|
LoadOutPresets: { type: Schema.Types.ObjectId, ref: "Loadout" },
|
|
|
|
CurrentLoadOutIds: [Schema.Types.Mixed],
|
|
|
|
RandomUpgradesIdentified: Number,
|
|
|
|
BountyScore: Number,
|
|
|
|
ChallengeInstanceStates: [Schema.Types.Mixed],
|
|
|
|
RecentVendorPurchases: [Schema.Types.Mixed],
|
2023-06-04 03:06:22 +02:00
|
|
|
Robotics: [Schema.Types.Mixed],
|
|
|
|
UsedDailyDeals: [Schema.Types.Mixed],
|
|
|
|
CollectibleSeries: [Schema.Types.Mixed],
|
|
|
|
HasResetAccount: Boolean,
|
2024-01-06 17:28:11 +02:00
|
|
|
|
2024-01-25 14:49:45 +01:00
|
|
|
//Discount Coupon
|
2023-06-04 03:06:22 +02:00
|
|
|
PendingCoupon: Schema.Types.Mixed,
|
2024-01-06 17:28:11 +02:00
|
|
|
//Like BossAladV,BossCaptainVor come for you on missions % chance
|
|
|
|
DeathMarks: [String],
|
|
|
|
//Zanuka
|
2023-06-04 03:06:22 +02:00
|
|
|
Harvestable: Boolean,
|
2024-01-06 17:28:11 +02:00
|
|
|
//Grustag three
|
2023-06-04 03:06:22 +02:00
|
|
|
DeathSquadable: Boolean
|
|
|
|
});
|
|
|
|
|
|
|
|
inventorySchema.set("toJSON", {
|
2023-06-05 04:16:49 +08:00
|
|
|
transform(_document, returnedObject) {
|
2023-06-04 03:06:22 +02:00
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
2023-09-11 13:20:07 +02:00
|
|
|
|
|
|
|
const trainingDate = (returnedObject as IInventoryDatabaseDocument).TrainingDate;
|
|
|
|
|
|
|
|
(returnedObject as IInventoryResponse).TrainingDate = {
|
|
|
|
$date: {
|
|
|
|
$numberLong: trainingDate.getTime().toString()
|
|
|
|
}
|
|
|
|
} satisfies IMongoDate;
|
2023-06-04 03:06:22 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-06-14 02:26:19 +02:00
|
|
|
type InventoryDocumentProps = {
|
|
|
|
Suits: Types.DocumentArray<ISuitDatabase>;
|
|
|
|
LongGuns: Types.DocumentArray<IWeaponDatabase>;
|
|
|
|
Pistols: Types.DocumentArray<IWeaponDatabase>;
|
|
|
|
Melee: Types.DocumentArray<IWeaponDatabase>;
|
2023-09-05 07:37:30 -05:00
|
|
|
FlavourItems: Types.DocumentArray<IFlavourItem>;
|
|
|
|
RawUpgrades: Types.DocumentArray<IRawUpgrade>;
|
|
|
|
MiscItems: Types.DocumentArray<IMiscItem>;
|
|
|
|
Boosters: Types.DocumentArray<IBooster>;
|
2023-12-14 17:34:15 +01:00
|
|
|
OperatorLoadOuts: Types.DocumentArray<IOperatorConfigClient>;
|
2024-01-25 14:49:45 +01:00
|
|
|
AdultOperatorLoadOuts: Types.DocumentArray<IOperatorConfigClient>; //TODO: this should still contain _id
|
2023-12-14 17:34:15 +01:00
|
|
|
MechSuits: Types.DocumentArray<ISuitDatabase>;
|
|
|
|
Scoops: Types.DocumentArray<IGenericItem>;
|
|
|
|
DataKnives: Types.DocumentArray<IGenericItem>;
|
|
|
|
DrifterMelee: Types.DocumentArray<IGenericItem>;
|
|
|
|
Sentinels: Types.DocumentArray<IWeaponDatabase>;
|
|
|
|
Horses: Types.DocumentArray<IGenericItem>;
|
2024-01-25 14:49:45 +01:00
|
|
|
PendingRecipes: Types.DocumentArray<IPendingRecipeDatabase>;
|
2023-06-14 02:26:19 +02:00
|
|
|
};
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
type InventoryModelType = Model<IInventoryDatabase, {}, InventoryDocumentProps>;
|
2023-06-14 02:26:19 +02:00
|
|
|
|
|
|
|
const Inventory = model<IInventoryDatabase, InventoryModelType>("Inventory", inventorySchema);
|
2023-06-04 03:06:22 +02:00
|
|
|
|
2023-06-14 02:26:19 +02:00
|
|
|
export { Inventory };
|