2025-01-31 14:15:36 +01:00
|
|
|
import { Document, 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,
|
2025-01-20 12:19:32 +01:00
|
|
|
IInventoryClient,
|
2023-12-14 17:34:15 +01:00
|
|
|
ISlots,
|
2025-01-31 14:15:36 +01:00
|
|
|
IMailboxDatabase,
|
2024-01-25 14:49:45 +01:00
|
|
|
IDuviriInfo,
|
2025-02-28 06:47:34 -08:00
|
|
|
IPendingRecipeDatabase,
|
|
|
|
IPendingRecipeClient,
|
2024-02-12 14:31:28 +01:00
|
|
|
ITypeCount,
|
|
|
|
IFocusXP,
|
2025-01-20 12:19:32 +01:00
|
|
|
IFocusUpgrade,
|
2024-02-12 14:31:28 +01:00
|
|
|
ITypeXPItem,
|
|
|
|
IChallengeProgress,
|
|
|
|
IStepSequencer,
|
|
|
|
IAffiliation,
|
|
|
|
INotePacks,
|
|
|
|
ICompletedJobChain,
|
2024-06-16 17:51:20 +02:00
|
|
|
ISeasonChallenge,
|
2024-02-12 14:31:28 +01:00
|
|
|
IPlayerSkills,
|
|
|
|
ISettings,
|
2025-01-20 12:19:32 +01:00
|
|
|
IInfestedFoundryDatabase,
|
2024-12-22 07:26:14 +01:00
|
|
|
IHelminthResource,
|
2025-02-06 04:39:01 -08:00
|
|
|
IMissionDatabase,
|
2024-02-12 14:31:28 +01:00
|
|
|
IConsumedSuit,
|
2025-01-24 14:13:21 +01:00
|
|
|
IQuestStage,
|
2024-02-12 14:31:28 +01:00
|
|
|
IQuestKeyDatabase,
|
2025-01-24 14:13:21 +01:00
|
|
|
IQuestKeyClient,
|
2024-02-12 14:31:28 +01:00
|
|
|
IFusionTreasure,
|
|
|
|
ISpectreLoadout,
|
2024-06-22 23:19:07 +02:00
|
|
|
IWeaponSkinDatabase,
|
2024-07-01 12:27:33 +02:00
|
|
|
ITaunt,
|
2024-02-12 14:31:28 +01:00
|
|
|
IPeriodicMissionCompletionDatabase,
|
|
|
|
IPeriodicMissionCompletionResponse,
|
2024-06-20 13:05:07 +02:00
|
|
|
ILoreFragmentScan,
|
2024-12-22 20:36:01 +01:00
|
|
|
IEvolutionProgress,
|
2024-12-23 22:47:58 +01:00
|
|
|
IEndlessXpProgress,
|
|
|
|
ICrewShipCustomization,
|
|
|
|
ICrewShipWeapon,
|
2025-04-18 11:15:50 -07:00
|
|
|
ICrewShipWeaponEmplacements,
|
2025-01-05 13:34:41 +01:00
|
|
|
IShipExterior,
|
2025-01-11 23:08:17 +01:00
|
|
|
IHelminthFoodRecord,
|
2025-01-19 01:57:24 +01:00
|
|
|
ICrewShipMembersDatabase,
|
|
|
|
IDialogueHistoryDatabase,
|
|
|
|
IDialogueDatabase,
|
|
|
|
IDialogueGift,
|
|
|
|
ICompletedDialogue,
|
2025-01-20 12:19:32 +01:00
|
|
|
IDialogueClient,
|
|
|
|
IUpgradeDatabase,
|
2025-01-21 20:07:15 +01:00
|
|
|
ICrewShipMemberDatabase,
|
2025-01-27 13:18:16 +01:00
|
|
|
ICrewShipMemberClient,
|
2025-01-31 14:15:36 +01:00
|
|
|
IMailboxClient,
|
2025-01-27 13:18:16 +01:00
|
|
|
TEquipmentKey,
|
|
|
|
equipmentKeys,
|
|
|
|
IKubrowPetDetailsDatabase,
|
|
|
|
ITraits,
|
2025-01-31 17:02:46 +01:00
|
|
|
IKubrowPetDetailsClient,
|
|
|
|
IKubrowPetEggDatabase,
|
2025-02-01 07:41:34 -08:00
|
|
|
IKubrowPetEggClient,
|
|
|
|
ICustomMarkers,
|
|
|
|
IMarkerInfo,
|
2025-02-22 11:10:52 -08:00
|
|
|
IMarker,
|
|
|
|
ICalendarProgress,
|
|
|
|
IPendingCouponDatabase,
|
|
|
|
IPendingCouponClient,
|
2025-02-25 17:31:52 -08:00
|
|
|
ILibraryDailyTaskInfo,
|
2025-02-24 05:28:43 -08:00
|
|
|
IDroneDatabase,
|
2025-02-28 12:36:49 -08:00
|
|
|
IDroneClient,
|
2025-02-28 18:09:37 -08:00
|
|
|
IAlignment,
|
|
|
|
ICollectibleEntry,
|
2025-02-28 18:18:33 -08:00
|
|
|
IIncentiveState,
|
2025-03-07 00:40:22 -08:00
|
|
|
ISongChallenge,
|
2025-03-11 07:56:18 -07:00
|
|
|
ILibraryPersonalProgress,
|
2025-03-13 02:14:53 -07:00
|
|
|
IRecentVendorPurchaseDatabase,
|
|
|
|
IVendorPurchaseHistoryEntryDatabase,
|
2025-03-20 05:36:09 -07:00
|
|
|
IVendorPurchaseHistoryEntryClient,
|
|
|
|
INemesisDatabase,
|
|
|
|
INemesisClient,
|
2025-03-27 03:32:50 -07:00
|
|
|
IInfNode,
|
2025-03-29 15:35:43 -07:00
|
|
|
IDiscoveredMarker,
|
2025-04-01 02:29:29 -07:00
|
|
|
IWeeklyMission,
|
2025-04-13 05:51:15 -07:00
|
|
|
ILockedWeaponGroupDatabase,
|
|
|
|
IPersonalTechProjectDatabase,
|
2025-04-17 08:02:13 -07:00
|
|
|
IPersonalTechProjectClient,
|
|
|
|
ILastSortieRewardDatabase,
|
2025-04-18 11:15:27 -07:00
|
|
|
ILastSortieRewardClient,
|
|
|
|
ICrewMemberSkill,
|
|
|
|
ICrewMemberSkillEfficiency,
|
|
|
|
ICrewMemberDatabase,
|
2025-04-18 11:23:52 -07:00
|
|
|
ICrewMemberClient,
|
|
|
|
ISortieRewardAttenuation
|
2023-12-14 17:34:15 +01:00
|
|
|
} from "../../types/inventoryTypes/inventoryTypes";
|
2024-05-06 15:19:42 +02:00
|
|
|
import { IOid } from "../../types/commonTypes";
|
2023-12-14 17:34:15 +01:00
|
|
|
import {
|
|
|
|
IAbilityOverride,
|
|
|
|
IColor,
|
|
|
|
IItemConfig,
|
|
|
|
IOperatorConfigDatabase,
|
2024-06-16 17:51:20 +02:00
|
|
|
IPolarity,
|
|
|
|
IEquipmentDatabase,
|
2025-01-24 14:17:52 +01:00
|
|
|
IArchonCrystalUpgrade,
|
|
|
|
IEquipmentClient
|
2023-12-14 17:34:15 +01:00
|
|
|
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
2024-02-12 14:31:28 +01:00
|
|
|
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
2025-04-18 11:17:19 -07:00
|
|
|
import { EquipmentSelectionSchema, oidSchema } from "./loadoutModel";
|
2024-02-12 14:31:28 +01:00
|
|
|
|
2025-01-03 09:06:50 +01:00
|
|
|
export const typeCountSchema = new Schema<ITypeCount>({ ItemType: String, ItemCount: Number }, { _id: false });
|
2024-02-12 14:31:28 +01:00
|
|
|
|
2025-04-02 13:20:06 -07:00
|
|
|
typeCountSchema.set("toJSON", {
|
|
|
|
transform(_doc, obj) {
|
|
|
|
if (obj.ItemCount > 2147483647) {
|
|
|
|
obj.ItemCount = 2147483647;
|
|
|
|
} else if (obj.ItemCount < -2147483648) {
|
|
|
|
obj.ItemCount = -2147483648;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
const focusXPSchema = new Schema<IFocusXP>(
|
|
|
|
{
|
|
|
|
AP_POWER: Number,
|
|
|
|
AP_TACTIC: Number,
|
|
|
|
AP_DEFENSE: Number,
|
|
|
|
AP_ATTACK: Number,
|
|
|
|
AP_WARD: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-01-20 12:19:32 +01:00
|
|
|
const focusUpgradeSchema = new Schema<IFocusUpgrade>(
|
2024-02-12 14:31:28 +01:00
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
Level: Number,
|
|
|
|
IsUniversal: Boolean
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
2023-12-14 17:34:15 +01:00
|
|
|
|
2024-06-07 16:06:35 +02:00
|
|
|
const polaritySchema = new Schema<IPolarity>(
|
|
|
|
{
|
|
|
|
Slot: Number,
|
|
|
|
Value: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
2023-06-04 03:06:22 +02:00
|
|
|
|
2025-01-24 14:17:52 +01:00
|
|
|
const abilityOverrideSchema = new Schema<IAbilityOverride>(
|
|
|
|
{
|
|
|
|
Ability: String,
|
|
|
|
Index: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2024-02-18 13:58:43 +01:00
|
|
|
export const colorSchema = new Schema<IColor>(
|
2023-12-14 17:34:15 +01:00
|
|
|
{
|
|
|
|
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],
|
2024-06-20 11:48:12 +02:00
|
|
|
Songs: {
|
|
|
|
type: [
|
|
|
|
{
|
|
|
|
m: String,
|
|
|
|
b: String,
|
|
|
|
p: String,
|
|
|
|
s: String
|
|
|
|
}
|
|
|
|
],
|
|
|
|
default: undefined
|
|
|
|
},
|
2023-12-14 17:34:15 +01:00
|
|
|
Name: String,
|
|
|
|
AbilityOverride: abilityOverrideSchema,
|
|
|
|
PvpUpgrades: [String],
|
|
|
|
ugly: Boolean
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
ItemConfigSchema.set("toJSON", {
|
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2024-06-18 13:02:29 +02:00
|
|
|
const ArchonCrystalUpgradeSchema = new Schema<IArchonCrystalUpgrade>(
|
|
|
|
{
|
|
|
|
UpgradeType: String,
|
|
|
|
Color: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
ArchonCrystalUpgradeSchema.set("toJSON", {
|
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
const boosterSchema = new Schema<IBooster>(
|
|
|
|
{
|
|
|
|
ExpiryDate: Number,
|
|
|
|
ItemType: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
2023-08-31 14:29:09 +04:00
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-01-20 12:19:32 +01:00
|
|
|
const upgradeSchema = new Schema<IUpgradeDatabase>(
|
2024-02-12 14:31:28 +01:00
|
|
|
{
|
|
|
|
UpgradeFingerprint: String,
|
2025-01-19 01:57:52 +01:00
|
|
|
PendingRerollFingerprint: { type: String, required: false },
|
2024-02-12 14:31:28 +01:00
|
|
|
ItemType: String
|
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
2023-09-06 14:02:54 +04:00
|
|
|
|
2025-01-20 12:19:32 +01:00
|
|
|
upgradeSchema.virtual("ItemId").get(function () {
|
2024-02-12 14:31:28 +01:00
|
|
|
return toOid(this._id);
|
2023-12-14 17:34:15 +01:00
|
|
|
});
|
|
|
|
|
2025-01-20 12:19:32 +01:00
|
|
|
upgradeSchema.set("toJSON", {
|
2023-12-14 17:34:15 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-04-18 11:15:27 -07:00
|
|
|
const crewMemberSkillSchema = new Schema<ICrewMemberSkill>(
|
|
|
|
{
|
|
|
|
Assigned: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const crewMemberSkillEfficiencySchema = new Schema<ICrewMemberSkillEfficiency>(
|
|
|
|
{
|
|
|
|
PILOTING: crewMemberSkillSchema,
|
|
|
|
GUNNERY: crewMemberSkillSchema,
|
|
|
|
ENGINEERING: crewMemberSkillSchema,
|
|
|
|
COMBAT: crewMemberSkillSchema,
|
|
|
|
SURVIVABILITY: crewMemberSkillSchema
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const crewMemberSchema = new Schema<ICrewMemberDatabase>(
|
|
|
|
{
|
|
|
|
ItemType: { type: String, required: true },
|
|
|
|
NemesisFingerprint: { type: BigInt, default: 0n },
|
|
|
|
Seed: { type: BigInt, default: 0n },
|
|
|
|
AssignedRole: Number,
|
|
|
|
SkillEfficiency: crewMemberSkillEfficiencySchema,
|
|
|
|
WeaponConfigIdx: Number,
|
|
|
|
WeaponId: { type: Schema.Types.ObjectId, default: "000000000000000000000000" },
|
|
|
|
XP: { type: Number, default: 0 },
|
|
|
|
PowersuitType: { type: String, required: true },
|
|
|
|
Configs: [ItemConfigSchema],
|
|
|
|
SecondInCommand: { type: Boolean, default: false }
|
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
crewMemberSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_doc, obj) {
|
|
|
|
const db = obj as ICrewMemberDatabase;
|
|
|
|
const client = obj as ICrewMemberClient;
|
|
|
|
|
|
|
|
client.WeaponId = toOid(db.WeaponId);
|
|
|
|
client.ItemId = toOid(db._id);
|
|
|
|
|
|
|
|
delete obj._id;
|
|
|
|
delete obj.__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;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-01-31 14:15:36 +01:00
|
|
|
const MailboxSchema = new Schema<IMailboxDatabase>(
|
2023-06-14 02:26:19 +02:00
|
|
|
{
|
2025-01-31 14:15:36 +01:00
|
|
|
LastInboxId: Schema.Types.ObjectId
|
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) {
|
2025-01-31 14:15:36 +01:00
|
|
|
const mailboxDatabase = returnedObject as HydratedDocument<IMailboxDatabase, { __v?: number }>;
|
|
|
|
delete mailboxDatabase.__v;
|
|
|
|
(returnedObject as IMailboxClient).LastInboxId = toOid(mailboxDatabase.LastInboxId);
|
2023-12-14 17:34:15 +01:00
|
|
|
}
|
2023-06-14 02:26:19 +02:00
|
|
|
});
|
|
|
|
|
2023-12-14 17:34:15 +01:00
|
|
|
const DuviriInfoSchema = new Schema<IDuviriInfo>(
|
|
|
|
{
|
|
|
|
Seed: Number,
|
2025-02-22 11:10:52 -08:00
|
|
|
NumCompletions: { type: Number, default: 0 }
|
2023-12-14 17:34:15 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
_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;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
const TypeXPItemSchema = new Schema<ITypeXPItem>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
XP: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-02-24 05:28:43 -08:00
|
|
|
const droneSchema = new Schema<IDroneDatabase>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
CurrentHP: Number,
|
2025-03-03 05:48:46 -08:00
|
|
|
RepairStart: { type: Date, default: undefined },
|
|
|
|
|
|
|
|
DeployTime: { type: Date, default: undefined },
|
|
|
|
System: Number,
|
|
|
|
DamageTime: { type: Date, default: undefined },
|
|
|
|
PendingDamage: Number,
|
|
|
|
ResourceType: String,
|
|
|
|
ResourceCount: Number
|
2025-02-24 05:28:43 -08:00
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
droneSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_document, obj) {
|
|
|
|
const client = obj as IDroneClient;
|
|
|
|
const db = obj as IDroneDatabase;
|
|
|
|
|
|
|
|
client.ItemId = toOid(db._id);
|
2025-03-03 05:48:46 -08:00
|
|
|
if (db.RepairStart) {
|
|
|
|
client.RepairStart = toMongoDate(db.RepairStart);
|
|
|
|
}
|
|
|
|
|
|
|
|
delete db.DeployTime;
|
|
|
|
delete db.System;
|
|
|
|
delete db.DamageTime;
|
|
|
|
delete db.PendingDamage;
|
|
|
|
delete db.ResourceType;
|
|
|
|
delete db.ResourceCount;
|
2025-02-24 05:28:43 -08:00
|
|
|
|
|
|
|
delete obj._id;
|
|
|
|
delete obj.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-03-27 03:32:50 -07:00
|
|
|
const discoveredMarkerSchema = new Schema<IDiscoveredMarker>(
|
|
|
|
{
|
|
|
|
tag: String,
|
|
|
|
discoveryState: [Number]
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
const challengeProgressSchema = new Schema<IChallengeProgress>(
|
|
|
|
{
|
|
|
|
Progress: Number,
|
|
|
|
Name: String,
|
|
|
|
Completed: [String]
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const notePacksSchema = new Schema<INotePacks>(
|
|
|
|
{
|
|
|
|
MELODY: String,
|
|
|
|
BASS: String,
|
|
|
|
PERCUSSION: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const StepSequencersSchema = new Schema<IStepSequencer>(
|
|
|
|
{
|
|
|
|
NotePacks: notePacksSchema,
|
|
|
|
FingerPrint: String,
|
|
|
|
Name: String
|
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
StepSequencersSchema.virtual("ItemId").get(function () {
|
|
|
|
return { $oid: this._id.toString() } satisfies IOid;
|
|
|
|
});
|
|
|
|
|
|
|
|
StepSequencersSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-01-31 17:02:46 +01:00
|
|
|
const kubrowPetEggSchema = new Schema<IKubrowPetEggDatabase>(
|
|
|
|
{
|
|
|
|
ItemType: String
|
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
kubrowPetEggSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_document, obj) {
|
|
|
|
const client = obj as IKubrowPetEggClient;
|
|
|
|
const db = obj as IKubrowPetEggDatabase;
|
|
|
|
|
|
|
|
client.ExpirationDate = { $date: { $numberLong: "2000000000000" } };
|
|
|
|
client.ItemId = toOid(db._id);
|
|
|
|
|
|
|
|
delete obj._id;
|
|
|
|
delete obj.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-03-29 15:35:43 -07:00
|
|
|
const weeklyMissionSchema = new Schema<IWeeklyMission>(
|
|
|
|
{
|
|
|
|
MissionIndex: Number,
|
|
|
|
CompletedMission: Boolean,
|
|
|
|
JobManifest: String,
|
|
|
|
Challenges: [String],
|
|
|
|
ChallengesReset: Boolean,
|
|
|
|
WeekCount: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
const affiliationsSchema = new Schema<IAffiliation>(
|
|
|
|
{
|
|
|
|
Initiated: Boolean,
|
|
|
|
Standing: Number,
|
2024-06-25 02:06:05 +02:00
|
|
|
Title: Number,
|
|
|
|
FreeFavorsEarned: { type: [Number], default: undefined },
|
|
|
|
FreeFavorsUsed: { type: [Number], default: undefined },
|
2025-03-29 15:35:43 -07:00
|
|
|
WeeklyMissions: { type: [weeklyMissionSchema], default: undefined },
|
2024-02-12 14:31:28 +01:00
|
|
|
Tag: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const completedJobChainsSchema = new Schema<ICompletedJobChain>(
|
|
|
|
{
|
|
|
|
LocationTag: String,
|
|
|
|
Jobs: [String]
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2024-06-16 17:51:20 +02:00
|
|
|
const seasonChallengeHistorySchema = new Schema<ISeasonChallenge>(
|
2024-02-12 14:31:28 +01:00
|
|
|
{
|
|
|
|
challenge: String,
|
|
|
|
id: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-04-13 05:51:15 -07:00
|
|
|
const personalTechProjectSchema = new Schema<IPersonalTechProjectDatabase>({
|
|
|
|
State: Number,
|
|
|
|
ReqCredits: Number,
|
|
|
|
ItemType: String,
|
2025-04-16 06:31:00 -07:00
|
|
|
ProductCategory: String,
|
|
|
|
CategoryItemId: Schema.Types.ObjectId,
|
2025-04-13 05:51:15 -07:00
|
|
|
ReqItems: { type: [typeCountSchema], default: undefined },
|
|
|
|
HasContributions: Boolean,
|
|
|
|
CompletionDate: Date
|
|
|
|
});
|
|
|
|
|
|
|
|
personalTechProjectSchema.virtual("ItemId").get(function () {
|
|
|
|
return { $oid: this._id.toString() };
|
|
|
|
});
|
|
|
|
|
|
|
|
personalTechProjectSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_doc, ret, _options) {
|
|
|
|
delete ret._id;
|
|
|
|
delete ret.__v;
|
|
|
|
|
|
|
|
const db = ret as IPersonalTechProjectDatabase;
|
|
|
|
const client = ret as IPersonalTechProjectClient;
|
|
|
|
|
2025-04-16 06:31:00 -07:00
|
|
|
if (db.CategoryItemId) {
|
|
|
|
client.CategoryItemId = toOid(db.CategoryItemId);
|
|
|
|
}
|
2025-04-13 05:51:15 -07:00
|
|
|
if (db.CompletionDate) {
|
|
|
|
client.CompletionDate = toMongoDate(db.CompletionDate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
const playerSkillsSchema = new Schema<IPlayerSkills>(
|
|
|
|
{
|
2025-01-06 05:36:18 +01:00
|
|
|
LPP_SPACE: { type: Number, default: 0 },
|
|
|
|
LPS_PILOTING: { type: Number, default: 0 },
|
|
|
|
LPS_GUNNERY: { type: Number, default: 0 },
|
|
|
|
LPS_TACTICAL: { type: Number, default: 0 },
|
|
|
|
LPS_ENGINEERING: { type: Number, default: 0 },
|
|
|
|
LPS_COMMAND: { type: Number, default: 0 },
|
|
|
|
LPP_DRIFTER: { type: Number, default: 0 },
|
|
|
|
LPS_DRIFT_COMBAT: { type: Number, default: 0 },
|
|
|
|
LPS_DRIFT_RIDING: { type: Number, default: 0 },
|
|
|
|
LPS_DRIFT_OPPORTUNITY: { type: Number, default: 0 },
|
|
|
|
LPS_DRIFT_ENDURANCE: { type: Number, default: 0 }
|
2024-02-12 14:31:28 +01:00
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const settingsSchema = new Schema<ISettings>({
|
|
|
|
FriendInvRestriction: String,
|
|
|
|
GiftMode: String,
|
|
|
|
GuildInvRestriction: String,
|
|
|
|
ShowFriendInvNotifications: Boolean,
|
2025-03-27 12:30:12 +01:00
|
|
|
TradingRulesConfirmed: Boolean,
|
|
|
|
SubscribedToSurveys: Boolean
|
2024-02-12 14:31:28 +01:00
|
|
|
});
|
|
|
|
|
2025-01-03 05:22:56 +01:00
|
|
|
const consumedSchuitsSchema = new Schema<IConsumedSuit>(
|
|
|
|
{
|
|
|
|
s: String,
|
|
|
|
c: colorSchema
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
2024-02-12 14:31:28 +01:00
|
|
|
|
2025-01-05 13:34:41 +01:00
|
|
|
const helminthFoodRecordSchema = new Schema<IHelminthFoodRecord>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
Date: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const helminthResourceSchema = new Schema<IHelminthResource>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
Count: Number,
|
|
|
|
RecentlyConvertedResources: { type: [helminthFoodRecordSchema], default: undefined }
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
2024-12-22 07:26:14 +01:00
|
|
|
|
2025-02-06 04:39:01 -08:00
|
|
|
const missionSchema = new Schema<IMissionDatabase>(
|
|
|
|
{
|
|
|
|
Tag: String,
|
|
|
|
Completes: { type: Number, default: 0 },
|
|
|
|
Tier: { type: Number, required: false }
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-01-31 17:24:42 +01:00
|
|
|
const questProgressSchema = new Schema<IQuestStage>(
|
|
|
|
{
|
|
|
|
c: Number,
|
|
|
|
i: Boolean,
|
|
|
|
m: Boolean,
|
|
|
|
b: []
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
const questKeysSchema = new Schema<IQuestKeyDatabase>(
|
|
|
|
{
|
2025-02-24 06:14:47 -08:00
|
|
|
Progress: { type: [questProgressSchema], default: [] },
|
2024-02-12 14:31:28 +01:00
|
|
|
unlock: Boolean,
|
|
|
|
Completed: Boolean,
|
2025-01-31 17:24:42 +01:00
|
|
|
CustomData: String,
|
2024-02-12 14:31:28 +01:00
|
|
|
CompletionDate: Date,
|
|
|
|
ItemType: String
|
|
|
|
},
|
|
|
|
{
|
|
|
|
_id: false
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
questKeysSchema.set("toJSON", {
|
|
|
|
transform(_doc, ret, _options) {
|
|
|
|
const questKeysDatabase = ret as IQuestKeyDatabase;
|
|
|
|
|
|
|
|
if (questKeysDatabase.CompletionDate) {
|
2025-01-24 14:13:21 +01:00
|
|
|
(questKeysDatabase as IQuestKeyClient).CompletionDate = toMongoDate(questKeysDatabase.CompletionDate);
|
2024-02-12 14:31:28 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-03-06 21:24:25 -08:00
|
|
|
export const fusionTreasuresSchema = new Schema<IFusionTreasure>().add(typeCountSchema).add({ Sockets: Number });
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
const spectreLoadoutsSchema = new Schema<ISpectreLoadout>(
|
|
|
|
{
|
2025-01-06 01:21:37 +01:00
|
|
|
ItemType: String,
|
|
|
|
Suits: String,
|
2024-02-12 14:31:28 +01:00
|
|
|
LongGuns: String,
|
2025-01-06 01:21:37 +01:00
|
|
|
LongGunsModularParts: { type: [String], default: undefined },
|
2024-02-12 14:31:28 +01:00
|
|
|
Pistols: String,
|
2025-01-06 01:21:37 +01:00
|
|
|
PistolsModularParts: { type: [String], default: undefined },
|
|
|
|
Melee: String,
|
|
|
|
MeleeModularParts: { type: [String], default: undefined }
|
2024-02-12 14:31:28 +01:00
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2024-06-22 23:19:07 +02:00
|
|
|
const weaponSkinsSchema = new Schema<IWeaponSkinDatabase>(
|
2024-02-12 14:31:28 +01:00
|
|
|
{
|
2025-03-29 09:27:38 -07:00
|
|
|
ItemType: String,
|
2025-04-11 06:56:45 -07:00
|
|
|
Favorite: Boolean,
|
2025-03-29 09:27:38 -07:00
|
|
|
IsNew: Boolean
|
2024-02-12 14:31:28 +01:00
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
weaponSkinsSchema.virtual("ItemId").get(function () {
|
|
|
|
return { $oid: this._id.toString() };
|
|
|
|
});
|
|
|
|
|
2024-06-22 23:19:07 +02:00
|
|
|
weaponSkinsSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_doc, ret, _options) {
|
|
|
|
delete ret._id;
|
|
|
|
delete ret.__v;
|
|
|
|
}
|
|
|
|
});
|
2024-02-12 14:31:28 +01:00
|
|
|
|
2024-07-01 12:27:33 +02:00
|
|
|
const tauntSchema = new Schema<ITaunt>(
|
2024-02-12 14:31:28 +01:00
|
|
|
{
|
|
|
|
node: String,
|
|
|
|
state: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const periodicMissionCompletionsSchema = new Schema<IPeriodicMissionCompletionDatabase>(
|
|
|
|
{
|
|
|
|
date: Date,
|
|
|
|
tag: String,
|
|
|
|
count: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
periodicMissionCompletionsSchema.set("toJSON", {
|
|
|
|
transform(_doc, ret, _options) {
|
|
|
|
const periodicMissionCompletionDatabase = ret as IPeriodicMissionCompletionDatabase;
|
|
|
|
|
|
|
|
(periodicMissionCompletionDatabase as unknown as IPeriodicMissionCompletionResponse).date = toMongoDate(
|
|
|
|
periodicMissionCompletionDatabase.date
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const loreFragmentScansSchema = new Schema<ILoreFragmentScan>(
|
|
|
|
{
|
|
|
|
Progress: Number,
|
|
|
|
Region: String,
|
|
|
|
ItemType: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2024-06-20 13:05:07 +02:00
|
|
|
const evolutionProgressSchema = new Schema<IEvolutionProgress>(
|
|
|
|
{
|
|
|
|
Progress: Number,
|
|
|
|
Rank: Number,
|
|
|
|
ItemType: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2024-12-22 20:36:01 +01:00
|
|
|
const endlessXpProgressSchema = new Schema<IEndlessXpProgress>(
|
|
|
|
{
|
|
|
|
Category: String,
|
|
|
|
Choices: [String]
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-04-18 11:15:50 -07:00
|
|
|
const crewShipWeaponEmplacementsSchema = new Schema<ICrewShipWeaponEmplacements>(
|
2024-12-23 22:47:58 +01:00
|
|
|
{
|
|
|
|
PRIMARY_A: EquipmentSelectionSchema,
|
2025-04-18 11:15:50 -07:00
|
|
|
PRIMARY_B: EquipmentSelectionSchema,
|
|
|
|
SECONDARY_A: EquipmentSelectionSchema,
|
|
|
|
SECONDARY_B: EquipmentSelectionSchema
|
2024-12-23 22:47:58 +01:00
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const crewShipWeaponSchema = new Schema<ICrewShipWeapon>(
|
|
|
|
{
|
2025-04-18 11:15:50 -07:00
|
|
|
PILOT: crewShipWeaponEmplacementsSchema,
|
|
|
|
PORT_GUNS: crewShipWeaponEmplacementsSchema,
|
|
|
|
STARBOARD_GUNS: crewShipWeaponEmplacementsSchema,
|
|
|
|
ARTILLERY: crewShipWeaponEmplacementsSchema,
|
|
|
|
SCANNER: crewShipWeaponEmplacementsSchema
|
2024-12-23 22:47:58 +01:00
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const shipExteriorSchema = new Schema<IShipExterior>(
|
|
|
|
{
|
|
|
|
SkinFlavourItem: String,
|
|
|
|
Colors: colorSchema,
|
|
|
|
ShipAttachments: { HOOD_ORNAMENT: String }
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const crewShipCustomizationSchema = new Schema<ICrewShipCustomization>(
|
|
|
|
{
|
|
|
|
CrewshipInterior: shipExteriorSchema
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-01-21 20:07:15 +01:00
|
|
|
const crewShipMemberSchema = new Schema<ICrewShipMemberDatabase>(
|
2024-12-23 22:47:58 +01:00
|
|
|
{
|
2025-01-21 20:07:15 +01:00
|
|
|
ItemId: { type: Schema.Types.ObjectId, required: false },
|
2025-04-18 11:15:50 -07:00
|
|
|
NemesisFingerprint: { type: BigInt, required: false }
|
2024-12-23 22:47:58 +01:00
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
2025-01-21 20:07:15 +01:00
|
|
|
crewShipMemberSchema.set("toJSON", {
|
2024-12-23 22:47:58 +01:00
|
|
|
virtuals: true,
|
2025-01-11 23:08:17 +01:00
|
|
|
transform(_doc, obj) {
|
2025-01-21 20:07:15 +01:00
|
|
|
const db = obj as ICrewShipMemberDatabase;
|
|
|
|
const client = obj as ICrewShipMemberClient;
|
|
|
|
if (db.ItemId) {
|
|
|
|
client.ItemId = toOid(db.ItemId);
|
|
|
|
}
|
2024-12-23 22:47:58 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-01-21 20:07:15 +01:00
|
|
|
const crewShipMembersSchema = new Schema<ICrewShipMembersDatabase>(
|
|
|
|
{
|
|
|
|
SLOT_A: { type: crewShipMemberSchema, required: false },
|
|
|
|
SLOT_B: { type: crewShipMemberSchema, required: false },
|
|
|
|
SLOT_C: { type: crewShipMemberSchema, required: false }
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-01-19 01:57:24 +01:00
|
|
|
const dialogueGiftSchema = new Schema<IDialogueGift>(
|
|
|
|
{
|
|
|
|
Item: String,
|
|
|
|
GiftedQuantity: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const completedDialogueSchema = new Schema<ICompletedDialogue>(
|
|
|
|
{
|
|
|
|
Id: { type: String, required: true },
|
|
|
|
Booleans: { type: [String], required: true },
|
|
|
|
Choices: { type: [Number], required: true }
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const dialogueSchema = new Schema<IDialogueDatabase>(
|
|
|
|
{
|
|
|
|
Rank: Number,
|
|
|
|
Chemistry: Number,
|
|
|
|
AvailableDate: Date,
|
|
|
|
AvailableGiftDate: Date,
|
|
|
|
RankUpExpiry: Date,
|
|
|
|
BountyChemExpiry: Date,
|
2025-04-09 15:30:59 -07:00
|
|
|
QueuedDialogues: { type: [String], default: [] },
|
2025-01-19 01:57:24 +01:00
|
|
|
Gifts: { type: [dialogueGiftSchema], default: [] },
|
|
|
|
Booleans: { type: [String], default: [] },
|
|
|
|
Completed: { type: [completedDialogueSchema], default: [] },
|
|
|
|
DialogueName: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
dialogueSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_doc, ret) {
|
|
|
|
const db = ret as IDialogueDatabase;
|
|
|
|
const client = ret as IDialogueClient;
|
|
|
|
|
|
|
|
client.AvailableDate = toMongoDate(db.AvailableDate);
|
|
|
|
client.AvailableGiftDate = toMongoDate(db.AvailableGiftDate);
|
|
|
|
client.RankUpExpiry = toMongoDate(db.RankUpExpiry);
|
|
|
|
client.BountyChemExpiry = toMongoDate(db.BountyChemExpiry);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const dialogueHistorySchema = new Schema<IDialogueHistoryDatabase>(
|
|
|
|
{
|
|
|
|
YearIteration: { type: Number, required: true },
|
2025-04-09 15:28:29 -07:00
|
|
|
Resets: Number,
|
2025-01-19 01:57:24 +01:00
|
|
|
Dialogues: { type: [dialogueSchema], required: false }
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-01-27 13:18:16 +01:00
|
|
|
const traitsSchema = new Schema<ITraits>(
|
|
|
|
{
|
|
|
|
BaseColor: String,
|
|
|
|
SecondaryColor: String,
|
|
|
|
TertiaryColor: String,
|
|
|
|
AccentColor: String,
|
|
|
|
EyeColor: String,
|
|
|
|
FurPattern: String,
|
|
|
|
Personality: String,
|
|
|
|
BodyType: String,
|
|
|
|
Head: { type: String, required: false },
|
|
|
|
Tail: { type: String, required: false }
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const detailsSchema = new Schema<IKubrowPetDetailsDatabase>(
|
|
|
|
{
|
|
|
|
Name: String,
|
|
|
|
IsPuppy: Boolean,
|
|
|
|
HasCollar: Boolean,
|
|
|
|
PrintsRemaining: Number,
|
|
|
|
Status: String,
|
|
|
|
HatchDate: Date,
|
|
|
|
DominantTraits: traitsSchema,
|
|
|
|
RecessiveTraits: traitsSchema,
|
|
|
|
IsMale: Boolean,
|
|
|
|
Size: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
detailsSchema.set("toJSON", {
|
|
|
|
transform(_doc, returnedObject) {
|
|
|
|
delete returnedObject.__v;
|
|
|
|
|
|
|
|
const db = returnedObject as IKubrowPetDetailsDatabase;
|
|
|
|
const client = returnedObject as IKubrowPetDetailsClient;
|
|
|
|
|
2025-03-28 03:08:02 -07:00
|
|
|
if (db.HatchDate) {
|
|
|
|
client.HatchDate = toMongoDate(db.HatchDate);
|
|
|
|
}
|
2025-01-27 13:18:16 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const EquipmentSchema = new Schema<IEquipmentDatabase>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
2025-02-24 20:56:34 -08:00
|
|
|
Configs: { type: [ItemConfigSchema], default: [] },
|
2025-01-27 13:18:16 +01:00
|
|
|
UpgradeVer: { type: Number, default: 101 },
|
|
|
|
XP: { type: Number, default: 0 },
|
|
|
|
Features: Number,
|
|
|
|
Polarized: Number,
|
|
|
|
Polarity: [polaritySchema],
|
|
|
|
FocusLens: String,
|
|
|
|
ModSlotPurchases: Number,
|
|
|
|
CustomizationSlotPurchases: Number,
|
|
|
|
UpgradeType: String,
|
|
|
|
UpgradeFingerprint: String,
|
|
|
|
ItemName: String,
|
|
|
|
InfestationDate: Date,
|
|
|
|
InfestationDays: Number,
|
|
|
|
InfestationType: String,
|
|
|
|
ModularParts: { type: [String], default: undefined },
|
|
|
|
UnlockLevel: Number,
|
|
|
|
Expiry: Date,
|
|
|
|
SkillTree: String,
|
|
|
|
OffensiveUpgrade: String,
|
|
|
|
DefensiveUpgrade: String,
|
|
|
|
UpgradesExpiry: Date,
|
2025-04-07 05:30:15 -07:00
|
|
|
UmbraDate: Date,
|
2025-01-27 13:18:16 +01:00
|
|
|
ArchonCrystalUpgrades: { type: [ArchonCrystalUpgradeSchema], default: undefined },
|
|
|
|
Weapon: crewShipWeaponSchema,
|
|
|
|
Customization: crewShipCustomizationSchema,
|
|
|
|
RailjackImage: FlavourItemSchema,
|
|
|
|
CrewMembers: crewShipMembersSchema,
|
2025-03-27 12:27:38 -07:00
|
|
|
Details: detailsSchema,
|
2025-04-11 06:56:45 -07:00
|
|
|
Favorite: Boolean,
|
2025-03-27 12:27:38 -07:00
|
|
|
IsNew: Boolean
|
2025-01-27 13:18:16 +01:00
|
|
|
},
|
|
|
|
{ id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
EquipmentSchema.virtual("ItemId").get(function () {
|
|
|
|
return { $oid: this._id.toString() } satisfies IOid;
|
|
|
|
});
|
|
|
|
|
|
|
|
EquipmentSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_document, returnedObject) {
|
|
|
|
delete returnedObject._id;
|
|
|
|
delete returnedObject.__v;
|
|
|
|
|
|
|
|
const db = returnedObject as IEquipmentDatabase;
|
|
|
|
const client = returnedObject as IEquipmentClient;
|
|
|
|
|
|
|
|
if (db.InfestationDate) {
|
|
|
|
client.InfestationDate = toMongoDate(db.InfestationDate);
|
|
|
|
}
|
2025-04-06 06:04:04 -07:00
|
|
|
if (db.UpgradesExpiry) {
|
|
|
|
client.UpgradesExpiry = toMongoDate(db.UpgradesExpiry);
|
|
|
|
}
|
2025-04-07 05:30:15 -07:00
|
|
|
if (db.UmbraDate) {
|
|
|
|
client.UmbraDate = toMongoDate(db.UmbraDate);
|
|
|
|
}
|
2025-01-27 13:18:16 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const equipmentFields: Record<string, { type: (typeof EquipmentSchema)[] }> = {};
|
|
|
|
|
|
|
|
equipmentKeys.forEach(key => {
|
|
|
|
equipmentFields[key] = { type: [EquipmentSchema] };
|
|
|
|
});
|
|
|
|
|
2025-02-28 06:47:34 -08:00
|
|
|
const pendingRecipeSchema = new Schema<IPendingRecipeDatabase>(
|
|
|
|
{
|
|
|
|
ItemType: String,
|
|
|
|
CompletionDate: Date,
|
|
|
|
LongGuns: { type: [EquipmentSchema], default: undefined },
|
|
|
|
Pistols: { type: [EquipmentSchema], default: undefined },
|
2025-03-31 04:14:20 -07:00
|
|
|
Melee: { type: [EquipmentSchema], default: undefined },
|
|
|
|
SuitToUnbrand: { type: Schema.Types.ObjectId, default: undefined }
|
2025-02-28 06:47:34 -08:00
|
|
|
},
|
|
|
|
{ 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;
|
|
|
|
delete returnedObject.LongGuns;
|
|
|
|
delete returnedObject.Pistols;
|
|
|
|
delete returnedObject.Melees;
|
2025-03-31 04:14:20 -07:00
|
|
|
delete returnedObject.SuitToUnbrand;
|
2025-02-28 06:47:34 -08:00
|
|
|
(returnedObject as IPendingRecipeClient).CompletionDate = {
|
|
|
|
$date: { $numberLong: (returnedObject as IPendingRecipeDatabase).CompletionDate.getTime().toString() }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-01-27 13:18:16 +01:00
|
|
|
const infestedFoundrySchema = new Schema<IInfestedFoundryDatabase>(
|
|
|
|
{
|
|
|
|
Name: String,
|
|
|
|
Resources: { type: [helminthResourceSchema], default: undefined },
|
|
|
|
Slots: Number,
|
|
|
|
XP: Number,
|
|
|
|
ConsumedSuits: { type: [consumedSchuitsSchema], default: undefined },
|
|
|
|
InvigorationIndex: Number,
|
|
|
|
InvigorationSuitOfferings: { type: [String], default: undefined },
|
|
|
|
InvigorationsApplied: Number,
|
|
|
|
LastConsumedSuit: { type: EquipmentSchema, default: undefined },
|
|
|
|
AbilityOverrideUnlockCooldown: Date
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
infestedFoundrySchema.set("toJSON", {
|
|
|
|
transform(_doc, ret, _options) {
|
|
|
|
if (ret.AbilityOverrideUnlockCooldown) {
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
|
|
ret.AbilityOverrideUnlockCooldown = toMongoDate(ret.AbilityOverrideUnlockCooldown);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-02-01 07:41:34 -08:00
|
|
|
const markerSchema = new Schema<IMarker>(
|
|
|
|
{
|
|
|
|
anchorName: String,
|
|
|
|
color: Number,
|
|
|
|
label: String,
|
|
|
|
x: Number,
|
|
|
|
y: Number,
|
|
|
|
z: Number,
|
|
|
|
showInHud: Boolean
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const markerInfoSchema = new Schema<IMarkerInfo>(
|
|
|
|
{
|
|
|
|
icon: String,
|
|
|
|
markers: [markerSchema]
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const CustomMarkersSchema = new Schema<ICustomMarkers>(
|
|
|
|
{
|
|
|
|
tag: String,
|
|
|
|
markerInfos: [markerInfoSchema]
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-02-22 11:10:52 -08:00
|
|
|
const calenderProgressSchema = new Schema<ICalendarProgress>(
|
|
|
|
{
|
|
|
|
Version: { type: Number, default: 19 },
|
|
|
|
Iteration: { type: Number, default: 2 },
|
|
|
|
YearProgress: {
|
|
|
|
Upgrades: { type: [] }
|
|
|
|
},
|
|
|
|
SeasonProgress: {
|
|
|
|
SeasonType: String,
|
|
|
|
LastCompletedDayIdx: { type: Number, default: -1 },
|
|
|
|
LastCompletedChallengeDayIdx: { type: Number, default: -1 },
|
|
|
|
ActivatedChallenges: []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-02-28 18:09:37 -08:00
|
|
|
const incentiveStateSchema = new Schema<IIncentiveState>(
|
|
|
|
{
|
|
|
|
threshold: Number,
|
|
|
|
complete: Boolean,
|
|
|
|
sent: Boolean
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-03-13 02:14:53 -07:00
|
|
|
const vendorPurchaseHistoryEntrySchema = new Schema<IVendorPurchaseHistoryEntryDatabase>(
|
|
|
|
{
|
|
|
|
Expiry: Date,
|
|
|
|
NumPurchased: Number,
|
|
|
|
ItemId: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
vendorPurchaseHistoryEntrySchema.set("toJSON", {
|
|
|
|
transform(_doc, obj) {
|
|
|
|
const db = obj as IVendorPurchaseHistoryEntryDatabase;
|
|
|
|
const client = obj as IVendorPurchaseHistoryEntryClient;
|
|
|
|
client.Expiry = toMongoDate(db.Expiry);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const recentVendorPurchaseSchema = new Schema<IRecentVendorPurchaseDatabase>(
|
|
|
|
{
|
|
|
|
VendorType: String,
|
|
|
|
PurchaseHistory: [vendorPurchaseHistoryEntrySchema]
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-02-28 18:09:37 -08:00
|
|
|
const collectibleEntrySchema = new Schema<ICollectibleEntry>(
|
|
|
|
{
|
|
|
|
CollectibleType: String,
|
|
|
|
Count: Number,
|
|
|
|
Tracking: String,
|
|
|
|
ReqScans: Number,
|
|
|
|
IncentiveStates: [incentiveStateSchema]
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-02-28 18:18:33 -08:00
|
|
|
const songChallengeSchema = new Schema<ISongChallenge>(
|
|
|
|
{
|
|
|
|
Song: String,
|
|
|
|
Difficulties: [Number]
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-02-22 11:10:52 -08:00
|
|
|
const pendingCouponSchema = new Schema<IPendingCouponDatabase>(
|
|
|
|
{
|
|
|
|
Expiry: { type: Date, default: new Date(0) },
|
|
|
|
Discount: { type: Number, default: 0 }
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
pendingCouponSchema.set("toJSON", {
|
|
|
|
transform(_doc, ret, _options) {
|
|
|
|
(ret as IPendingCouponClient).Expiry = toMongoDate((ret as IPendingCouponDatabase).Expiry);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-03-07 00:40:22 -08:00
|
|
|
const libraryPersonalProgressSchema = new Schema<ILibraryPersonalProgress>(
|
|
|
|
{
|
|
|
|
TargetType: String,
|
|
|
|
Scans: Number,
|
|
|
|
Completed: Boolean
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-02-25 17:31:52 -08:00
|
|
|
const libraryDailyTaskInfoSchema = new Schema<ILibraryDailyTaskInfo>(
|
2025-02-22 11:10:52 -08:00
|
|
|
{
|
|
|
|
EnemyTypes: [String],
|
|
|
|
EnemyLocTag: String,
|
|
|
|
EnemyIcon: String,
|
2025-02-25 17:31:52 -08:00
|
|
|
Scans: Number,
|
2025-02-22 11:10:52 -08:00
|
|
|
ScansRequired: Number,
|
|
|
|
RewardStoreItem: String,
|
|
|
|
RewardQuantity: Number,
|
|
|
|
RewardStanding: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-03-20 05:36:09 -07:00
|
|
|
const infNodeSchema = new Schema<IInfNode>(
|
|
|
|
{
|
|
|
|
Node: String,
|
|
|
|
Influence: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
const nemesisSchema = new Schema<INemesisDatabase>(
|
|
|
|
{
|
|
|
|
fp: BigInt,
|
|
|
|
manifest: String,
|
|
|
|
KillingSuit: String,
|
|
|
|
killingDamageType: Number,
|
|
|
|
ShoulderHelmet: String,
|
|
|
|
WeaponIdx: Number,
|
|
|
|
AgentIdx: Number,
|
|
|
|
BirthNode: String,
|
|
|
|
Faction: String,
|
|
|
|
Rank: Number,
|
|
|
|
k: Boolean,
|
|
|
|
Traded: Boolean,
|
|
|
|
d: Date,
|
|
|
|
PrevOwners: Number,
|
|
|
|
SecondInCommand: Boolean,
|
|
|
|
Weakened: Boolean,
|
|
|
|
InfNodes: [infNodeSchema],
|
|
|
|
HenchmenKilled: Number,
|
|
|
|
HintProgress: Number,
|
|
|
|
Hints: [Number],
|
2025-03-22 06:08:00 -07:00
|
|
|
GuessHistory: [Number],
|
|
|
|
MissionCount: Number,
|
|
|
|
LastEnc: Number
|
2025-03-20 05:36:09 -07:00
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
nemesisSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_doc, obj) {
|
|
|
|
const db = obj as INemesisDatabase;
|
|
|
|
const client = obj as INemesisClient;
|
|
|
|
|
|
|
|
client.d = toMongoDate(db.d);
|
|
|
|
|
|
|
|
delete obj._id;
|
|
|
|
delete obj.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-02-28 12:36:49 -08:00
|
|
|
const alignmentSchema = new Schema<IAlignment>(
|
|
|
|
{
|
|
|
|
Alignment: Number,
|
|
|
|
Wisdom: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-04-17 08:02:13 -07:00
|
|
|
const lastSortieRewardSchema = new Schema<ILastSortieRewardDatabase>(
|
|
|
|
{
|
|
|
|
SortieId: Schema.Types.ObjectId,
|
|
|
|
StoreItem: String,
|
|
|
|
Manifest: String
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
lastSortieRewardSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_doc, obj) {
|
|
|
|
const db = obj as ILastSortieRewardDatabase;
|
|
|
|
const client = obj as ILastSortieRewardClient;
|
|
|
|
|
|
|
|
client.SortieId = toOid(db.SortieId);
|
|
|
|
|
|
|
|
delete obj._id;
|
|
|
|
delete obj.__v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-04-18 11:23:52 -07:00
|
|
|
const sortieRewardAttenutationSchema = new Schema<ISortieRewardAttenuation>(
|
|
|
|
{
|
|
|
|
Tag: String,
|
|
|
|
Atten: Number
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2025-04-01 02:29:29 -07:00
|
|
|
const lockedWeaponGroupSchema = new Schema<ILockedWeaponGroupDatabase>(
|
|
|
|
{
|
|
|
|
s: Schema.Types.ObjectId,
|
|
|
|
p: Schema.Types.ObjectId,
|
|
|
|
l: Schema.Types.ObjectId,
|
|
|
|
m: Schema.Types.ObjectId,
|
|
|
|
sn: Schema.Types.ObjectId
|
|
|
|
},
|
|
|
|
{ _id: false }
|
|
|
|
);
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|
|
|
{
|
|
|
|
accountOwnerId: Schema.Types.ObjectId,
|
2025-02-22 11:10:52 -08:00
|
|
|
SubscribedToEmails: { type: Number, default: 0 },
|
|
|
|
SubscribedToEmailsPersonalized: { type: Number, default: 0 },
|
2025-04-15 09:46:08 -07:00
|
|
|
RewardSeed: BigInt,
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Credit
|
2025-01-20 18:25:50 +01:00
|
|
|
RegularCredits: { type: Number, default: 0 },
|
2024-02-12 14:31:28 +01:00
|
|
|
//Platinum
|
2025-02-22 11:10:52 -08:00
|
|
|
PremiumCredits: { type: Number, default: 0 },
|
2024-02-12 14:31:28 +01:00
|
|
|
//Gift Platinum(Non trade)
|
2025-02-22 11:10:52 -08:00
|
|
|
PremiumCreditsFree: { type: Number, default: 0 },
|
2024-02-12 14:31:28 +01:00
|
|
|
//Endo
|
2024-12-29 21:11:10 +01:00
|
|
|
FusionPoints: { type: Number, default: 0 },
|
2024-12-22 23:28:59 +01:00
|
|
|
//Regal Aya
|
2024-12-29 21:11:10 +01:00
|
|
|
PrimeTokens: { type: Number, default: 0 },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Slots
|
2025-01-20 18:25:50 +01:00
|
|
|
SuitBin: { type: slotsBinSchema, default: { Slots: 3 } },
|
2025-02-22 11:10:52 -08:00
|
|
|
WeaponBin: { type: slotsBinSchema, default: { Slots: 11 } },
|
2025-01-20 18:25:50 +01:00
|
|
|
SentinelBin: { type: slotsBinSchema, default: { Slots: 10 } },
|
|
|
|
SpaceSuitBin: { type: slotsBinSchema, default: { Slots: 4 } },
|
|
|
|
SpaceWeaponBin: { type: slotsBinSchema, default: { Slots: 4 } },
|
|
|
|
PvpBonusLoadoutBin: { type: slotsBinSchema, default: { Slots: 0 } },
|
|
|
|
PveBonusLoadoutBin: { type: slotsBinSchema, default: { Slots: 0 } },
|
|
|
|
RandomModBin: { type: slotsBinSchema, default: { Slots: 15 } },
|
|
|
|
OperatorAmpBin: { type: slotsBinSchema, default: { Slots: 8 } },
|
|
|
|
CrewShipSalvageBin: { type: slotsBinSchema, default: { Slots: 8 } },
|
|
|
|
MechBin: { type: slotsBinSchema, default: { Slots: 4 } },
|
|
|
|
CrewMemberBin: { type: slotsBinSchema, default: { Slots: 3 } },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
2025-01-27 13:18:16 +01:00
|
|
|
...equipmentFields,
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
//How many trades do you have left
|
2024-12-29 21:11:10 +01:00
|
|
|
TradesRemaining: { type: Number, default: 0 },
|
2024-02-12 14:31:28 +01:00
|
|
|
//How many Gift do you have left*(gift spends the trade)
|
2024-12-29 21:11:10 +01:00
|
|
|
GiftsRemaining: { type: Number, default: 8 },
|
2024-02-12 14:31:28 +01:00
|
|
|
//Curent trade info Giving or Getting items
|
|
|
|
PendingTrades: [Schema.Types.Mixed],
|
|
|
|
|
2024-05-06 15:38:10 +02:00
|
|
|
//Syndicate currently being pledged to.
|
|
|
|
SupportedSyndicate: String,
|
2024-02-12 14:31:28 +01:00
|
|
|
//Curent Syndicates rank\exp
|
|
|
|
Affiliations: [affiliationsSchema],
|
|
|
|
//Syndicates Missions complate(Navigation->Syndicate)
|
|
|
|
CompletedSyndicates: [String],
|
|
|
|
//Daily Syndicates Exp
|
2025-01-20 18:25:50 +01:00
|
|
|
DailyAffiliation: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationPvp: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationLibrary: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationCetus: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationQuills: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationSolaris: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationVentkids: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationVox: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationEntrati: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationNecraloid: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationZariman: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationKahl: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationCavia: { type: Number, default: 16000 },
|
|
|
|
DailyAffiliationHex: { type: Number, default: 16000 },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Daily Focus limit
|
2024-12-29 21:11:10 +01:00
|
|
|
DailyFocus: { type: Number, default: 250000 },
|
2024-02-12 14:31:28 +01:00
|
|
|
//Focus XP per School
|
|
|
|
FocusXP: focusXPSchema,
|
|
|
|
//Curent active like Active school focuses is = "Zenurik"
|
|
|
|
FocusAbility: String,
|
|
|
|
//The treeways of the Focus school.(Active and passive Ability)
|
2025-01-20 12:19:32 +01:00
|
|
|
FocusUpgrades: [focusUpgradeSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Achievement
|
|
|
|
ChallengeProgress: [challengeProgressSchema],
|
|
|
|
|
|
|
|
//Account Item like Ferrite,Form,Kuva etc
|
2025-03-15 06:39:54 -07:00
|
|
|
MiscItems: { type: [typeCountSchema], default: [] },
|
|
|
|
FoundToday: { type: [typeCountSchema], default: undefined },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Non Upgrade Mods Example:I have 999 item WeaponElectricityDamageMod (only "ItemCount"+"ItemType")
|
|
|
|
RawUpgrades: [RawUpgrades],
|
|
|
|
//Upgrade Mods\Riven\Arcane Example:"UpgradeFingerprint"+"ItemType"+""
|
2025-01-20 12:19:32 +01:00
|
|
|
Upgrades: [upgradeSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//The Mandachord(Octavia) is a step sequencer
|
|
|
|
StepSequencers: [StepSequencersSchema],
|
|
|
|
|
2025-01-31 17:02:46 +01:00
|
|
|
KubrowPetEggs: [kubrowPetEggSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
//Prints Cat(3 Prints)\Kubrow(2 Prints) Pets
|
|
|
|
KubrowPetPrints: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Item for EquippedGear example:Scaner,LoadoutTechSummon etc
|
|
|
|
Consumables: [typeCountSchema],
|
|
|
|
//Weel Emotes+Gear
|
|
|
|
EquippedEmotes: [String],
|
|
|
|
EquippedGear: [String],
|
|
|
|
//Equipped Shawzin
|
|
|
|
EquippedInstrument: String,
|
|
|
|
ReceivedStartingGear: Boolean,
|
|
|
|
|
|
|
|
ArchwingEnabled: Boolean,
|
2025-03-15 10:25:32 -07:00
|
|
|
HasOwnedVoidProjectionsPreviously: Boolean,
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Use Operator\Drifter
|
|
|
|
UseAdultOperatorLoadout: Boolean,
|
|
|
|
//Operator
|
|
|
|
OperatorLoadOuts: [operatorConfigSchema],
|
|
|
|
//Drifter
|
|
|
|
AdultOperatorLoadOuts: [operatorConfigSchema],
|
2025-01-27 13:18:16 +01:00
|
|
|
// Kahl
|
|
|
|
KahlLoadOuts: [operatorConfigSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//LandingCraft like Liset
|
2024-02-18 13:58:43 +01:00
|
|
|
Ships: { type: [Schema.Types.ObjectId], ref: "Ships" },
|
2024-02-12 14:31:28 +01:00
|
|
|
// /Lotus/Types/Items/ShipDecos/
|
|
|
|
ShipDecorations: [typeCountSchema],
|
|
|
|
|
|
|
|
//Railjack/Components(https://warframe.fandom.com/wiki/Railjack/Components)
|
2025-02-05 12:23:35 -08:00
|
|
|
CrewShipRawSalvage: [typeCountSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Default RailJack
|
|
|
|
CrewShipAmmo: [typeCountSchema],
|
2025-02-25 17:31:33 -08:00
|
|
|
CrewShipWeaponSkins: [upgradeSchema],
|
2025-03-23 13:33:26 -07:00
|
|
|
CrewShipSalvagedWeaponSkins: [upgradeSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
|
2025-03-23 13:33:26 -07:00
|
|
|
//RailJack Crew
|
2025-04-18 11:15:27 -07:00
|
|
|
CrewMembers: [crewMemberSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Complete Mission\Quests
|
2025-02-06 04:39:01 -08:00
|
|
|
Missions: [missionSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
QuestKeys: [questKeysSchema],
|
2025-02-22 11:10:52 -08:00
|
|
|
ActiveQuest: { type: String, default: "" },
|
2024-02-12 14:31:28 +01:00
|
|
|
//item like DojoKey or Boss missions key
|
2025-03-23 13:33:26 -07:00
|
|
|
LevelKeys: [typeCountSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
//Active quests
|
|
|
|
Quests: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Cosmetics like profile glyphs\Kavasa Prime Kubrow Collar\Game Theme etc
|
|
|
|
FlavourItems: [FlavourItemSchema],
|
|
|
|
|
|
|
|
//Mastery Rank*(Need item XPInfo to rank up)
|
2024-12-29 21:11:10 +01:00
|
|
|
PlayerLevel: { type: Number, default: 0 },
|
2024-02-12 14:31:28 +01:00
|
|
|
//Item Mastery Rank exp
|
|
|
|
XPInfo: [TypeXPItemSchema],
|
|
|
|
//Mastery Rank next availability
|
2025-01-20 18:25:50 +01:00
|
|
|
TrainingDate: { type: Date, default: new Date(0) },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//you saw last played Region when you opened the star map
|
|
|
|
LastRegionPlayed: String,
|
|
|
|
|
|
|
|
//Blueprints for Foundry
|
|
|
|
Recipes: [typeCountSchema],
|
|
|
|
//Crafting Blueprint(Item Name + CompletionDate)
|
|
|
|
PendingRecipes: [pendingRecipeSchema],
|
|
|
|
|
|
|
|
//Skins for Suits, Weapons etc.
|
|
|
|
WeaponSkins: [weaponSkinsSchema],
|
|
|
|
|
|
|
|
//Ayatan Item
|
|
|
|
FusionTreasures: [fusionTreasuresSchema],
|
2024-07-01 12:27:33 +02:00
|
|
|
//only used for Maroo apparently - { "node": "TreasureTutorial", "state": "TS_COMPLETED" }
|
|
|
|
TauntHistory: { type: [tauntSchema], default: undefined },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//noShow2FA,VisitPrimeVault etc
|
|
|
|
WebFlags: Schema.Types.Mixed,
|
|
|
|
//Id CompletedAlerts
|
|
|
|
CompletedAlerts: [String],
|
|
|
|
|
|
|
|
//Warframe\Duviri
|
2025-01-20 18:25:50 +01:00
|
|
|
StoryModeChoice: { type: String, default: "WARFRAME" },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Alert->Kuva Siphon
|
|
|
|
PeriodicMissionCompletions: [periodicMissionCompletionsSchema],
|
|
|
|
|
|
|
|
//Codex->LoreFragment
|
|
|
|
LoreFragmentScans: [loreFragmentScansSchema],
|
|
|
|
|
|
|
|
//Resource,Credit,Affinity etc or Bless any boosters
|
|
|
|
Boosters: [boosterSchema],
|
|
|
|
BlessingCooldown: Date, // Date convert to IMongoDate
|
|
|
|
|
|
|
|
//the color your clan requests like Items/Research/DojoColors/DojoColorPlainsB
|
|
|
|
ActiveDojoColorResearch: String,
|
|
|
|
|
|
|
|
SentientSpawnChanceBoosters: Schema.Types.Mixed,
|
|
|
|
|
|
|
|
QualifyingInvasions: [Schema.Types.Mixed],
|
|
|
|
FactionScores: [Number],
|
|
|
|
|
2025-01-06 01:21:37 +01:00
|
|
|
// https://warframe.fandom.com/wiki/Specter_(Tenno)
|
|
|
|
PendingSpectreLoadouts: { type: [spectreLoadoutsSchema], default: undefined },
|
|
|
|
SpectreLoadouts: { type: [spectreLoadoutsSchema], default: undefined },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//New Quest Email
|
2025-03-23 13:33:26 -07:00
|
|
|
EmailItems: [typeCountSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Profile->Wishlist
|
|
|
|
Wishlist: [String],
|
|
|
|
|
|
|
|
//https://warframe.fandom.com/wiki/Alignment
|
|
|
|
//like "Alignment": { "Wisdom": 9, "Alignment": 1 },
|
2025-02-28 12:36:49 -08:00
|
|
|
Alignment: alignmentSchema,
|
|
|
|
AlignmentReplay: alignmentSchema,
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//https://warframe.fandom.com/wiki/Sortie
|
|
|
|
CompletedSorties: [String],
|
2025-04-17 08:02:13 -07:00
|
|
|
LastSortieReward: { type: [lastSortieRewardSchema], default: undefined },
|
|
|
|
LastLiteSortieReward: { type: [lastSortieRewardSchema], default: undefined },
|
2025-04-18 11:23:52 -07:00
|
|
|
SortieRewardAttenuation: { type: [sortieRewardAttenutationSchema], default: undefined },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
2025-02-24 05:28:43 -08:00
|
|
|
// Resource Extractor Drones
|
|
|
|
Drones: [droneSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Active profile ico
|
2025-03-10 16:40:40 -07:00
|
|
|
ActiveAvatarImageType: { type: String, default: "/Lotus/Types/StoreItems/AvatarImages/AvatarImageDefault" },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
// open location store like EidolonPlainsDiscoverable or OrbVallisCaveDiscoverable
|
2025-03-27 03:32:50 -07:00
|
|
|
DiscoveredMarkers: [discoveredMarkerSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
//Open location mission like "JobId" + "StageCompletions"
|
|
|
|
CompletedJobs: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Game mission\ivent score example "Tag": "WaterFight", "Best": 170, "Count": 1258,
|
|
|
|
PersonalGoalProgress: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//Setting interface Style
|
|
|
|
ThemeStyle: String,
|
|
|
|
ThemeBackground: String,
|
|
|
|
ThemeSounds: String,
|
|
|
|
|
|
|
|
//Daily LoginRewards
|
2025-03-21 05:19:42 -07:00
|
|
|
LoginMilestoneRewards: { type: [String], default: [] },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//You first Dialog with NPC or use new Item
|
|
|
|
NodeIntrosCompleted: [String],
|
|
|
|
|
2024-05-04 15:42:25 +02:00
|
|
|
//Current guild id, if applicable.
|
|
|
|
GuildId: { type: Schema.Types.ObjectId, ref: "Guild" },
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
//https://warframe.fandom.com/wiki/Heist
|
|
|
|
//ProfitTaker(1-4) Example:"LocationTag": "EudicoHeists", "Jobs":Mission name
|
2025-04-10 07:15:54 -07:00
|
|
|
CompletedJobChains: { type: [completedJobChainsSchema], default: undefined },
|
2024-02-12 14:31:28 +01:00
|
|
|
//Night Wave Challenge
|
|
|
|
SeasonChallengeHistory: [seasonChallengeHistorySchema],
|
|
|
|
|
2025-01-31 17:03:00 +01:00
|
|
|
LibraryPersonalTarget: String,
|
2024-02-12 14:31:28 +01:00
|
|
|
//Cephalon Simaris Entries Example:"TargetType"+"Scans"(1-10)+"Completed": true|false
|
2025-03-07 00:40:22 -08:00
|
|
|
LibraryPersonalProgress: { type: [libraryPersonalProgressSchema], default: [] },
|
2024-02-12 14:31:28 +01:00
|
|
|
//Cephalon Simaris Daily Task
|
2025-02-25 17:31:52 -08:00
|
|
|
LibraryAvailableDailyTaskInfo: libraryDailyTaskInfoSchema,
|
|
|
|
LibraryActiveDailyTaskInfo: libraryDailyTaskInfoSchema,
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//https://warframe.fandom.com/wiki/Invasion
|
|
|
|
InvasionChainProgress: [Schema.Types.Mixed],
|
|
|
|
|
|
|
|
//CorpusLich or GrineerLich
|
2025-03-08 05:36:06 -08:00
|
|
|
NemesisAbandonedRewards: { type: [String], default: [] },
|
2025-03-20 05:36:09 -07:00
|
|
|
Nemesis: nemesisSchema,
|
2024-02-12 14:31:28 +01:00
|
|
|
NemesisHistory: [Schema.Types.Mixed],
|
|
|
|
LastNemesisAllySpawnTime: Schema.Types.Mixed,
|
|
|
|
|
|
|
|
//TradingRulesConfirmed,ShowFriendInvNotifications(Option->Social)
|
|
|
|
Settings: settingsSchema,
|
|
|
|
|
|
|
|
//Railjack craft
|
|
|
|
//https://warframe.fandom.com/wiki/Rising_Tide
|
2025-04-13 05:51:15 -07:00
|
|
|
PersonalTechProjects: { type: [personalTechProjectSchema], default: [] },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Modulars lvl and exp(Railjack|Duviri)
|
|
|
|
//https://warframe.fandom.com/wiki/Intrinsics
|
2025-01-06 05:36:18 +01:00
|
|
|
PlayerSkills: { type: playerSkillsSchema, default: {} },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//TradeBannedUntil data
|
|
|
|
TradeBannedUntil: Schema.Types.Mixed,
|
|
|
|
|
|
|
|
//https://warframe.fandom.com/wiki/Helminth
|
|
|
|
InfestedFoundry: infestedFoundrySchema,
|
|
|
|
|
2025-03-15 06:39:54 -07:00
|
|
|
NextRefill: { type: Date, default: undefined },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//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
|
|
|
|
LotusCustomization: Schema.Types.Mixed,
|
|
|
|
|
|
|
|
//Progress+Rank+ItemType(ZarimanPumpShotgun)
|
|
|
|
//https://warframe.fandom.com/wiki/Incarnon
|
2024-06-20 13:05:07 +02:00
|
|
|
EvolutionProgress: { type: [evolutionProgressSchema], default: undefined },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
2025-02-01 07:41:34 -08:00
|
|
|
//https://warframe.fandom.com/wiki/Loc-Pin
|
|
|
|
CustomMarkers: { type: [CustomMarkersSchema], default: undefined },
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
//Unknown and system
|
|
|
|
DuviriInfo: DuviriInfoSchema,
|
|
|
|
Mailbox: MailboxSchema,
|
|
|
|
HandlerPoints: Number,
|
2025-04-12 18:55:01 -07:00
|
|
|
ChallengesFixVersion: { type: Number, default: 6 },
|
2024-02-12 14:31:28 +01:00
|
|
|
PlayedParkourTutorial: Boolean,
|
|
|
|
ActiveLandscapeTraps: [Schema.Types.Mixed],
|
|
|
|
RepVotes: [Schema.Types.Mixed],
|
|
|
|
LeagueTickets: [Schema.Types.Mixed],
|
|
|
|
HasContributedToDojo: Boolean,
|
|
|
|
HWIDProtectEnabled: Boolean,
|
|
|
|
LoadOutPresets: { type: Schema.Types.ObjectId, ref: "Loadout" },
|
2025-04-18 11:17:19 -07:00
|
|
|
CurrentLoadOutIds: [oidSchema],
|
2024-02-12 14:31:28 +01:00
|
|
|
RandomUpgradesIdentified: Number,
|
|
|
|
BountyScore: Number,
|
|
|
|
ChallengeInstanceStates: [Schema.Types.Mixed],
|
2025-03-13 02:14:53 -07:00
|
|
|
RecentVendorPurchases: { type: [recentVendorPurchaseSchema], default: undefined },
|
2024-02-12 14:31:28 +01:00
|
|
|
Robotics: [Schema.Types.Mixed],
|
|
|
|
UsedDailyDeals: [Schema.Types.Mixed],
|
2025-02-28 18:09:37 -08:00
|
|
|
CollectibleSeries: { type: [collectibleEntrySchema], default: undefined },
|
2024-12-29 21:11:10 +01:00
|
|
|
HasResetAccount: { type: Boolean, default: false },
|
2024-02-12 14:31:28 +01:00
|
|
|
|
|
|
|
//Discount Coupon
|
2025-02-22 11:10:52 -08:00
|
|
|
PendingCoupon: pendingCouponSchema,
|
2024-02-12 14:31:28 +01:00
|
|
|
//Like BossAladV,BossCaptainVor come for you on missions % chance
|
2025-03-16 04:33:21 -07:00
|
|
|
DeathMarks: { type: [String], default: [] },
|
2024-02-12 14:31:28 +01:00
|
|
|
//Zanuka
|
|
|
|
Harvestable: Boolean,
|
|
|
|
//Grustag three
|
2024-12-22 20:36:01 +01:00
|
|
|
DeathSquadable: Boolean,
|
|
|
|
|
2025-01-19 01:57:24 +01:00
|
|
|
EndlessXP: { type: [endlessXpProgressSchema], default: undefined },
|
|
|
|
|
2025-02-22 11:10:52 -08:00
|
|
|
DialogueHistory: dialogueHistorySchema,
|
2025-02-28 18:18:33 -08:00
|
|
|
CalendarProgress: calenderProgressSchema,
|
|
|
|
|
2025-03-23 05:06:31 -07:00
|
|
|
SongChallenges: { type: [songChallengeSchema], default: undefined },
|
|
|
|
|
|
|
|
// Netracells + Deep Archimedea
|
|
|
|
EntratiVaultCountLastPeriod: { type: Number, default: undefined },
|
|
|
|
EntratiVaultCountResetDate: { type: Date, default: undefined },
|
|
|
|
EntratiLabConquestUnlocked: { type: Number, default: undefined },
|
|
|
|
EntratiLabConquestHardModeStatus: { type: Number, default: undefined },
|
|
|
|
EntratiLabConquestCacheScoreMission: { type: Number, default: undefined },
|
|
|
|
EntratiLabConquestActiveFrameVariants: { type: [String], default: undefined },
|
|
|
|
EchoesHexConquestUnlocked: { type: Number, default: undefined },
|
|
|
|
EchoesHexConquestHardModeStatus: { type: Number, default: undefined },
|
|
|
|
EchoesHexConquestCacheScoreMission: { type: Number, default: undefined },
|
|
|
|
EchoesHexConquestActiveFrameVariants: { type: [String], default: undefined },
|
2025-03-31 04:14:20 -07:00
|
|
|
EchoesHexConquestActiveStickers: { type: [String], default: undefined },
|
|
|
|
|
2025-04-01 02:29:29 -07:00
|
|
|
// G3 + Zanuka
|
|
|
|
BrandedSuits: { type: [Schema.Types.ObjectId], default: undefined },
|
|
|
|
LockedWeaponGroup: { type: lockedWeaponGroupSchema, default: undefined }
|
2024-02-12 14:31:28 +01:00
|
|
|
},
|
2025-01-24 14:17:52 +01:00
|
|
|
{ timestamps: { createdAt: "Created", updatedAt: false } }
|
2024-02-12 14:31:28 +01:00
|
|
|
);
|
|
|
|
|
2023-06-04 03:06:22 +02:00
|
|
|
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;
|
2025-01-03 22:17:34 +01:00
|
|
|
delete returnedObject.accountOwnerId;
|
2023-09-11 13:20:07 +02:00
|
|
|
|
2025-03-02 16:02:04 +01:00
|
|
|
const inventoryDatabase = returnedObject as Partial<IInventoryDatabase>;
|
2025-01-20 12:19:32 +01:00
|
|
|
const inventoryResponse = returnedObject as IInventoryClient;
|
2023-09-11 13:20:07 +02:00
|
|
|
|
2025-03-02 16:02:04 +01:00
|
|
|
if (inventoryDatabase.TrainingDate) {
|
|
|
|
inventoryResponse.TrainingDate = toMongoDate(inventoryDatabase.TrainingDate);
|
|
|
|
}
|
|
|
|
if (inventoryDatabase.Created) {
|
|
|
|
inventoryResponse.Created = toMongoDate(inventoryDatabase.Created);
|
|
|
|
}
|
2024-05-04 15:42:25 +02:00
|
|
|
if (inventoryDatabase.GuildId) {
|
|
|
|
inventoryResponse.GuildId = toOid(inventoryDatabase.GuildId);
|
|
|
|
}
|
2025-02-24 20:56:34 -08:00
|
|
|
if (inventoryDatabase.BlessingCooldown) {
|
2024-02-12 14:31:28 +01:00
|
|
|
inventoryResponse.BlessingCooldown = toMongoDate(inventoryDatabase.BlessingCooldown);
|
|
|
|
}
|
2025-03-15 06:39:54 -07:00
|
|
|
if (inventoryDatabase.NextRefill) {
|
|
|
|
inventoryResponse.NextRefill = toMongoDate(inventoryDatabase.NextRefill);
|
|
|
|
}
|
2025-03-23 13:09:38 -07:00
|
|
|
if (inventoryDatabase.EntratiVaultCountResetDate) {
|
|
|
|
inventoryResponse.EntratiVaultCountResetDate = toMongoDate(inventoryDatabase.EntratiVaultCountResetDate);
|
|
|
|
}
|
2025-03-31 04:14:20 -07:00
|
|
|
if (inventoryDatabase.BrandedSuits) {
|
|
|
|
inventoryResponse.BrandedSuits = inventoryDatabase.BrandedSuits.map(toOid);
|
|
|
|
}
|
2025-04-01 02:29:29 -07:00
|
|
|
if (inventoryDatabase.LockedWeaponGroup) {
|
|
|
|
inventoryResponse.LockedWeaponGroup = {
|
|
|
|
s: toOid(inventoryDatabase.LockedWeaponGroup.s),
|
|
|
|
l: inventoryDatabase.LockedWeaponGroup.l ? toOid(inventoryDatabase.LockedWeaponGroup.l) : undefined,
|
|
|
|
p: inventoryDatabase.LockedWeaponGroup.p ? toOid(inventoryDatabase.LockedWeaponGroup.p) : undefined,
|
|
|
|
m: inventoryDatabase.LockedWeaponGroup.m ? toOid(inventoryDatabase.LockedWeaponGroup.m) : undefined,
|
|
|
|
sn: inventoryDatabase.LockedWeaponGroup.sn ? toOid(inventoryDatabase.LockedWeaponGroup.sn) : undefined
|
|
|
|
};
|
|
|
|
}
|
2023-06-04 03:06:22 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2025-03-16 08:46:02 -07:00
|
|
|
inventorySchema.index({ accountOwnerId: 1 }, { unique: true });
|
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
// type overwrites for subdocuments/subdocument arrays
|
2025-01-24 14:13:21 +01:00
|
|
|
export type InventoryDocumentProps = {
|
2023-09-05 07:37:30 -05:00
|
|
|
FlavourItems: Types.DocumentArray<IFlavourItem>;
|
|
|
|
RawUpgrades: Types.DocumentArray<IRawUpgrade>;
|
2025-01-20 12:19:32 +01:00
|
|
|
Upgrades: Types.DocumentArray<IUpgradeDatabase>;
|
2023-09-05 07:37:30 -05:00
|
|
|
MiscItems: Types.DocumentArray<IMiscItem>;
|
|
|
|
Boosters: Types.DocumentArray<IBooster>;
|
2025-01-20 12:19:32 +01:00
|
|
|
OperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
|
|
|
|
AdultOperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
|
2025-01-27 13:18:16 +01:00
|
|
|
KahlLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
|
2024-01-25 14:49:45 +01:00
|
|
|
PendingRecipes: Types.DocumentArray<IPendingRecipeDatabase>;
|
2024-06-22 23:19:07 +02:00
|
|
|
WeaponSkins: Types.DocumentArray<IWeaponSkinDatabase>;
|
2025-02-19 14:09:47 -08:00
|
|
|
QuestKeys: Types.DocumentArray<IQuestKeyDatabase>;
|
2025-02-24 05:28:43 -08:00
|
|
|
Drones: Types.DocumentArray<IDroneDatabase>;
|
2025-02-25 17:31:33 -08:00
|
|
|
CrewShipWeaponSkins: Types.DocumentArray<IUpgradeDatabase>;
|
2025-04-16 03:40:21 +02:00
|
|
|
CrewShipSalvagedWeaponSkins: Types.DocumentArray<IUpgradeDatabase>;
|
2025-04-13 05:51:15 -07:00
|
|
|
PersonalTechProjects: Types.DocumentArray<IPersonalTechProjectDatabase>;
|
2025-04-18 11:15:27 -07:00
|
|
|
CrewMembers: Types.DocumentArray<ICrewMemberDatabase>;
|
2025-01-27 13:18:16 +01:00
|
|
|
} & { [K in TEquipmentKey]: Types.DocumentArray<IEquipmentDatabase> };
|
2023-06-14 02:26:19 +02:00
|
|
|
|
2025-03-29 15:20:54 -07:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
2023-12-14 17:34:15 +01:00
|
|
|
type InventoryModelType = Model<IInventoryDatabase, {}, InventoryDocumentProps>;
|
2023-06-14 02:26:19 +02:00
|
|
|
|
2024-02-12 14:31:28 +01:00
|
|
|
export const Inventory = model<IInventoryDatabase, InventoryModelType>("Inventory", inventorySchema);
|
2025-01-03 22:17:34 +01:00
|
|
|
|
2025-03-29 15:20:54 -07:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
2025-01-03 22:17:34 +01:00
|
|
|
export type TInventoryDatabaseDocument = Document<unknown, {}, IInventoryDatabase> &
|
|
|
|
Omit<
|
|
|
|
IInventoryDatabase & {
|
|
|
|
_id: Types.ObjectId;
|
|
|
|
} & {
|
|
|
|
__v: number;
|
|
|
|
},
|
|
|
|
keyof InventoryDocumentProps
|
|
|
|
> &
|
|
|
|
InventoryDocumentProps;
|