forked from OpenWF/SpaceNinjaServer
chore: enforce consistent imports (#2408)
Reviewed-on: OpenWF/SpaceNinjaServer#2408 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
a75e6d6b95
commit
c7c7fd4ea0
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@ -19,6 +19,7 @@ jobs:
|
|||||||
- run: npm run lint:ci
|
- run: npm run lint:ci
|
||||||
- run: npm run prettier
|
- run: npm run prettier
|
||||||
- run: npm run update-translations
|
- run: npm run update-translations
|
||||||
|
- run: npm run fix-imports
|
||||||
- name: Fail if there are uncommitted changes
|
- name: Fail if there are uncommitted changes
|
||||||
run: |
|
run: |
|
||||||
if [[ -n "$(git status --porcelain)" ]]; then
|
if [[ -n "$(git status --porcelain)" ]]; then
|
||||||
|
@ -19,7 +19,9 @@
|
|||||||
"lint:ci": "eslint --ext .ts --rule \"prettier/prettier: off\" .",
|
"lint:ci": "eslint --ext .ts --rule \"prettier/prettier: off\" .",
|
||||||
"lint:fix": "eslint --fix --ext .ts .",
|
"lint:fix": "eslint --fix --ext .ts .",
|
||||||
"prettier": "prettier --write .",
|
"prettier": "prettier --write .",
|
||||||
"update-translations": "cd scripts && node update-translations.js"
|
"update-translations": "cd scripts && node update-translations.js",
|
||||||
|
"fix-imports": "cd scripts && node fix-imports.js",
|
||||||
|
"fix": "npm run update-translations && npm run fix-imports && npm run prettier"
|
||||||
},
|
},
|
||||||
"license": "GNU",
|
"license": "GNU",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
46
scripts/fix-imports.js
Normal file
46
scripts/fix-imports.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const root = path.join(process.cwd(), "..");
|
||||||
|
|
||||||
|
function listFiles(dir) {
|
||||||
|
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
||||||
|
let results = [];
|
||||||
|
for (const entry of entries) {
|
||||||
|
const fullPath = path.join(dir, entry.name);
|
||||||
|
if (entry.isDirectory()) {
|
||||||
|
results = results.concat(listFiles(fullPath));
|
||||||
|
} else {
|
||||||
|
results.push(fullPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
const files = listFiles(path.join(root, "src"));
|
||||||
|
|
||||||
|
for (const file of files) {
|
||||||
|
let content;
|
||||||
|
try {
|
||||||
|
content = fs.readFileSync(file, "utf8");
|
||||||
|
} catch (e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const dir = path.dirname(file);
|
||||||
|
const fixedContent = content.replaceAll(/} from "([^"]+)";/g, (sub, importPath) => {
|
||||||
|
if (!importPath.startsWith("@/")) {
|
||||||
|
const fullImportPath = path.resolve(dir, importPath);
|
||||||
|
if (fs.existsSync(fullImportPath + ".ts")) {
|
||||||
|
const relative = path.relative(root, fullImportPath).replace(/\\/g, "/");
|
||||||
|
const fixedPath = "@/" + relative;
|
||||||
|
console.log(`${importPath} -> ${fixedPath}`);
|
||||||
|
return sub.split(importPath).join(fixedPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sub;
|
||||||
|
});
|
||||||
|
if (content != fixedContent) {
|
||||||
|
fs.writeFileSync(file, fixedContent, "utf8");
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@ import { getAccountForRequest } from "@/src/services/loginService";
|
|||||||
import { IMissionInventoryUpdateRequest } from "@/src/types/requestTypes";
|
import { IMissionInventoryUpdateRequest } from "@/src/types/requestTypes";
|
||||||
import { addMissionInventoryUpdates, addMissionRewards } from "@/src/services/missionInventoryUpdateService";
|
import { addMissionInventoryUpdates, addMissionRewards } from "@/src/services/missionInventoryUpdateService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
import { getInventoryResponse } from "./inventoryController";
|
import { getInventoryResponse } from "@/src/controllers/api/inventoryController";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { IMissionInventoryUpdateResponse } from "@/src/types/missionTypes";
|
import { IMissionInventoryUpdateResponse } from "@/src/types/missionTypes";
|
||||||
import { sendWsBroadcastTo } from "@/src/services/wsService";
|
import { sendWsBroadcastTo } from "@/src/services/wsService";
|
||||||
|
@ -2,7 +2,7 @@ import { getAccountIdForRequest } from "@/src/services/loginService";
|
|||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { ISettings } from "../../types/inventoryTypes/inventoryTypes";
|
import { ISettings } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
interface ISaveSettingsRequest {
|
interface ISaveSettingsRequest {
|
||||||
Settings: ISettings;
|
Settings: ISettings;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { IAccountCreation } from "@/src/types/customTypes";
|
import { IAccountCreation } from "@/src/types/customTypes";
|
||||||
import { IDatabaseAccountRequiredFields } from "@/src/types/loginTypes";
|
import { IDatabaseAccountRequiredFields } from "@/src/types/loginTypes";
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import { isString, parseEmail, parseString } from "../general";
|
import { isString, parseEmail, parseString } from "@/src/helpers/general";
|
||||||
|
|
||||||
const getWhirlpoolHash = (rawPassword: string): string => {
|
const getWhirlpoolHash = (rawPassword: string): string => {
|
||||||
const whirlpool = crypto.createHash("whirlpool");
|
const whirlpool = crypto.createHash("whirlpool");
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { TEquipmentKey } from "../types/inventoryTypes/inventoryTypes";
|
import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
export const modularWeaponTypes: Record<string, TEquipmentKey> = {
|
export const modularWeaponTypes: Record<string, TEquipmentKey> = {
|
||||||
"/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary": "LongGuns",
|
"/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary": "LongGuns",
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { ExportRegions, ExportWarframes } from "warframe-public-export-plus";
|
import { ExportRegions, ExportWarframes } from "warframe-public-export-plus";
|
||||||
import { IInfNode, TNemesisFaction } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IInfNode, TNemesisFaction } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { generateRewardSeed, getRewardAtPercentage, SRng } from "@/src/services/rngService";
|
import { generateRewardSeed, getRewardAtPercentage, SRng } from "@/src/services/rngService";
|
||||||
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { IOid } from "../types/commonTypes";
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
import { isArchwingMission } from "../services/worldStateService";
|
import { isArchwingMission } from "@/src/services/worldStateService";
|
||||||
|
|
||||||
type TInnateDamageTag =
|
type TInnateDamageTag =
|
||||||
| "InnateElectricityDamage"
|
| "InnateElectricityDamage"
|
||||||
|
@ -5,8 +5,8 @@ import { getRandomWeightedReward, IRngResult } from "@/src/services/rngService";
|
|||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { addMiscItems, combineInventoryChanges } from "@/src/services/inventoryService";
|
import { addMiscItems, combineInventoryChanges } from "@/src/services/inventoryService";
|
||||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
||||||
import { IInventoryChanges } from "../types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { config } from "../services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
|
|
||||||
export const crackRelic = async (
|
export const crackRelic = async (
|
||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IUpgrade } from "warframe-public-export-plus";
|
import { IUpgrade } from "warframe-public-export-plus";
|
||||||
import { getRandomElement, getRandomInt, getRandomReward } from "../services/rngService";
|
import { getRandomElement, getRandomInt, getRandomReward } from "@/src/services/rngService";
|
||||||
|
|
||||||
export type RivenFingerprint = IVeiledRivenFingerprint | IUnveiledRivenFingerprint;
|
export type RivenFingerprint = IVeiledRivenFingerprint | IUnveiledRivenFingerprint;
|
||||||
|
|
||||||
|
@ -19,10 +19,10 @@ logger.info("Starting up...");
|
|||||||
// Proceed with normal startup: bring up config watcher service, validate config, connect to MongoDB, and finally start listening for HTTP.
|
// Proceed with normal startup: bring up config watcher service, validate config, connect to MongoDB, and finally start listening for HTTP.
|
||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
import { JSONStringify } from "json-with-bigint";
|
import { JSONStringify } from "json-with-bigint";
|
||||||
import { startWebServer } from "./services/webService";
|
import { startWebServer } from "@/src/services/webService";
|
||||||
|
|
||||||
import { syncConfigWithDatabase, validateConfig } from "@/src/services/configWatcherService";
|
import { syncConfigWithDatabase, validateConfig } from "@/src/services/configWatcherService";
|
||||||
import { updateWorldStateCollections } from "./services/worldStateService";
|
import { updateWorldStateCollections } from "@/src/services/worldStateService";
|
||||||
|
|
||||||
// Patch JSON.stringify to work flawlessly with Bigints.
|
// Patch JSON.stringify to work flawlessly with Bigints.
|
||||||
JSON.stringify = JSONStringify;
|
JSON.stringify = JSONStringify;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { NextFunction, Request, Response } from "express";
|
import { NextFunction, Request, Response } from "express";
|
||||||
import { logger } from "../utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
|
|
||||||
export const errorHandler = (err: Error, req: Request, res: Response, _next: NextFunction): void => {
|
export const errorHandler = (err: Error, req: Request, res: Response, _next: NextFunction): void => {
|
||||||
if (err.message == "Invalid accountId-nonce pair") {
|
if (err.message == "Invalid accountId-nonce pair") {
|
||||||
|
@ -17,8 +17,8 @@ import {
|
|||||||
GuildPermission
|
GuildPermission
|
||||||
} from "@/src/types/guildTypes";
|
} from "@/src/types/guildTypes";
|
||||||
import { Document, Model, model, Schema, Types } from "mongoose";
|
import { Document, Model, model, Schema, Types } from "mongoose";
|
||||||
import { fusionTreasuresSchema, typeCountSchema } from "./inventoryModels/inventoryModel";
|
import { fusionTreasuresSchema, typeCountSchema } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { pictureFrameInfoSchema } from "./personalRoomsModel";
|
import { pictureFrameInfoSchema } from "@/src/models/personalRoomsModel";
|
||||||
|
|
||||||
const dojoDecoSchema = new Schema<IDojoDecoDatabase>({
|
const dojoDecoSchema = new Schema<IDojoDecoDatabase>({
|
||||||
Type: String,
|
Type: String,
|
||||||
|
@ -89,8 +89,8 @@ import {
|
|||||||
IPersonalGoalProgressClient,
|
IPersonalGoalProgressClient,
|
||||||
IKubrowPetPrintClient,
|
IKubrowPetPrintClient,
|
||||||
IKubrowPetPrintDatabase
|
IKubrowPetPrintDatabase
|
||||||
} from "../../types/inventoryTypes/inventoryTypes";
|
} from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IOid, ITypeCount } from "../../types/commonTypes";
|
import { IOid, ITypeCount } from "@/src/types/commonTypes";
|
||||||
import {
|
import {
|
||||||
IAbilityOverride,
|
IAbilityOverride,
|
||||||
ICrewShipCustomization,
|
ICrewShipCustomization,
|
||||||
@ -101,9 +101,9 @@ import {
|
|||||||
IPolarity
|
IPolarity
|
||||||
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { EquipmentSelectionSchema, oidSchema } from "./loadoutModel";
|
import { EquipmentSelectionSchema, oidSchema } from "@/src/models/inventoryModels/loadoutModel";
|
||||||
import { ICountedStoreItem } from "warframe-public-export-plus";
|
import { ICountedStoreItem } from "warframe-public-export-plus";
|
||||||
import { colorSchema, shipCustomizationSchema } from "../commonModel";
|
import { colorSchema, shipCustomizationSchema } from "@/src/models/commonModel";
|
||||||
import {
|
import {
|
||||||
IArchonCrystalUpgrade,
|
IArchonCrystalUpgrade,
|
||||||
ICrewShipMemberClient,
|
ICrewShipMemberClient,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Document, model, Schema, Types } from "mongoose";
|
import { Document, model, Schema, Types } from "mongoose";
|
||||||
import { ILeaderboardEntryDatabase } from "../types/leaderboardTypes";
|
import { ILeaderboardEntryDatabase } from "@/src/types/leaderboardTypes";
|
||||||
|
|
||||||
const leaderboardEntrySchema = new Schema<ILeaderboardEntryDatabase>(
|
const leaderboardEntrySchema = new Schema<ILeaderboardEntryDatabase>(
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ import {
|
|||||||
PersonalRoomsModelType
|
PersonalRoomsModelType
|
||||||
} from "@/src/types/personalRoomsTypes";
|
} from "@/src/types/personalRoomsTypes";
|
||||||
import { Schema, Types, model } from "mongoose";
|
import { Schema, Types, model } from "mongoose";
|
||||||
import { colorSchema, shipCustomizationSchema } from "./commonModel";
|
import { colorSchema, shipCustomizationSchema } from "@/src/models/commonModel";
|
||||||
|
|
||||||
export const pictureFrameInfoSchema = new Schema<IPictureFrameInfo>(
|
export const pictureFrameInfoSchema = new Schema<IPictureFrameInfo>(
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Document, Schema, Types, model } from "mongoose";
|
import { Document, Schema, Types, model } from "mongoose";
|
||||||
import { IShipDatabase } from "../types/shipTypes";
|
import { IShipDatabase } from "@/src/types/shipTypes";
|
||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { colorSchema } from "@/src/models/commonModel";
|
import { colorSchema } from "@/src/models/commonModel";
|
||||||
import { IShipInventory } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IShipInventory } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import chokidar from "chokidar";
|
import chokidar from "chokidar";
|
||||||
import fsPromises from "fs/promises";
|
import fsPromises from "fs/promises";
|
||||||
import { logger } from "../utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { config, configPath, loadConfig } from "./configService";
|
import { config, configPath, loadConfig } from "@/src/services/configService";
|
||||||
import { getWebPorts, startWebServer, stopWebServer } from "./webService";
|
import { getWebPorts, startWebServer, stopWebServer } from "@/src/services/webService";
|
||||||
import { sendWsBroadcast } from "./wsService";
|
import { sendWsBroadcast } from "@/src/services/wsService";
|
||||||
import { Inbox } from "../models/inboxModel";
|
import { Inbox } from "@/src/models/inboxModel";
|
||||||
import varzia from "@/static/fixed_responses/worldState/varzia.json";
|
import varzia from "@/static/fixed_responses/worldState/varzia.json";
|
||||||
|
|
||||||
let amnesia = false;
|
let amnesia = false;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { IFriendInfo } from "../types/friendTypes";
|
import { IFriendInfo } from "@/src/types/friendTypes";
|
||||||
import { getInventory } from "./inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
import { config } from "./configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { Account } from "../models/loginModel";
|
import { Account } from "@/src/models/loginModel";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { Friendship } from "../models/friendModel";
|
import { Friendship } from "@/src/models/friendModel";
|
||||||
import { fromOid, toMongoDate } from "../helpers/inventoryHelpers";
|
import { fromOid, toMongoDate } from "@/src/helpers/inventoryHelpers";
|
||||||
|
|
||||||
export const addAccountDataToFriendInfo = async (info: IFriendInfo): Promise<void> => {
|
export const addAccountDataToFriendInfo = async (info: IFriendInfo): Promise<void> => {
|
||||||
const account = (await Account.findById(fromOid(info._id), "DisplayName LastLogin"))!;
|
const account = (await Account.findById(fromOid(info._id), "DisplayName LastLogin"))!;
|
||||||
|
@ -22,17 +22,17 @@ import {
|
|||||||
import { toMongoDate, toOid, toOid2 } from "@/src/helpers/inventoryHelpers";
|
import { toMongoDate, toOid, toOid2 } from "@/src/helpers/inventoryHelpers";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { ExportDojoRecipes, ExportResources, IDojoBuild, IDojoResearch } from "warframe-public-export-plus";
|
import { ExportDojoRecipes, ExportResources, IDojoBuild, IDojoResearch } from "warframe-public-export-plus";
|
||||||
import { logger } from "../utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { config } from "./configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { getRandomInt } from "./rngService";
|
import { getRandomInt } from "@/src/services/rngService";
|
||||||
import { Inbox } from "../models/inboxModel";
|
import { Inbox } from "@/src/models/inboxModel";
|
||||||
import { IFusionTreasure } from "../types/inventoryTypes/inventoryTypes";
|
import { IFusionTreasure } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IInventoryChanges } from "../types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { parallelForeach } from "../utils/async-utils";
|
import { parallelForeach } from "@/src/utils/async-utils";
|
||||||
import allDecoRecipes from "@/static/fixed_responses/allDecoRecipes.json";
|
import allDecoRecipes from "@/static/fixed_responses/allDecoRecipes.json";
|
||||||
import { createMessage } from "./inboxService";
|
import { createMessage } from "@/src/services/inboxService";
|
||||||
import { addAccountDataToFriendInfo, addInventoryDataToFriendInfo } from "./friendService";
|
import { addAccountDataToFriendInfo, addInventoryDataToFriendInfo } from "@/src/services/friendService";
|
||||||
import { ITypeCount } from "../types/commonTypes";
|
import { ITypeCount } from "@/src/types/commonTypes";
|
||||||
|
|
||||||
export const getGuildForRequest = async (req: Request): Promise<TGuildDatabaseDocument> => {
|
export const getGuildForRequest = async (req: Request): Promise<TGuildDatabaseDocument> => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
@ -3,8 +3,8 @@ import {
|
|||||||
IItemConfig,
|
IItemConfig,
|
||||||
IOperatorConfigClient,
|
IOperatorConfigClient,
|
||||||
IOperatorConfigDatabase
|
IOperatorConfigDatabase
|
||||||
} from "../types/inventoryTypes/commonInventoryTypes";
|
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { IMongoDate } from "../types/commonTypes";
|
import { IMongoDate } from "@/src/types/commonTypes";
|
||||||
import {
|
import {
|
||||||
equipmentKeys,
|
equipmentKeys,
|
||||||
IDialogueClient,
|
IDialogueClient,
|
||||||
@ -25,15 +25,15 @@ import {
|
|||||||
IUpgradeDatabase,
|
IUpgradeDatabase,
|
||||||
IWeaponSkinClient,
|
IWeaponSkinClient,
|
||||||
IWeaponSkinDatabase
|
IWeaponSkinDatabase
|
||||||
} from "../types/inventoryTypes/inventoryTypes";
|
} from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import {
|
import {
|
||||||
ILoadoutConfigClient,
|
ILoadoutConfigClient,
|
||||||
ILoadoutConfigDatabase,
|
ILoadoutConfigDatabase,
|
||||||
ILoadoutDatabase,
|
ILoadoutDatabase,
|
||||||
ILoadOutPresets
|
ILoadOutPresets
|
||||||
} from "../types/saveLoadoutTypes";
|
} from "@/src/types/saveLoadoutTypes";
|
||||||
import { slotNames } from "../types/purchaseTypes";
|
import { slotNames } from "@/src/types/purchaseTypes";
|
||||||
import {
|
import {
|
||||||
ICrewShipMemberClient,
|
ICrewShipMemberClient,
|
||||||
ICrewShipMemberDatabase,
|
ICrewShipMemberDatabase,
|
||||||
@ -43,7 +43,7 @@ import {
|
|||||||
IEquipmentDatabase,
|
IEquipmentDatabase,
|
||||||
IKubrowPetDetailsClient,
|
IKubrowPetDetailsClient,
|
||||||
IKubrowPetDetailsDatabase
|
IKubrowPetDetailsDatabase
|
||||||
} from "../types/equipmentTypes";
|
} from "@/src/types/equipmentTypes";
|
||||||
|
|
||||||
const convertDate = (value: IMongoDate): Date => {
|
const convertDate = (value: IMongoDate): Date => {
|
||||||
return new Date(parseInt(value.$date.$numberLong));
|
return new Date(parseInt(value.$date.$numberLong));
|
||||||
|
@ -2,8 +2,8 @@ import { IMessageDatabase, Inbox } from "@/src/models/inboxModel";
|
|||||||
import { getAccountForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import { HydratedDocument, Types } from "mongoose";
|
import { HydratedDocument, Types } from "mongoose";
|
||||||
import { Request } from "express";
|
import { Request } from "express";
|
||||||
import { unixTimesInMs } from "../constants/timeConstants";
|
import { unixTimesInMs } from "@/src/constants/timeConstants";
|
||||||
import { config } from "./configService";
|
import { config } from "@/src/services/configService";
|
||||||
|
|
||||||
export const getAllMessagesSorted = async (accountId: string): Promise<HydratedDocument<IMessageDatabase>[]> => {
|
export const getAllMessagesSorted = async (accountId: string): Promise<HydratedDocument<IMessageDatabase>[]> => {
|
||||||
const inbox = await Inbox.find({ ownerId: accountId }).sort({ date: -1 });
|
const inbox = await Inbox.find({ ownerId: accountId }).sort({ date: -1 });
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { ExportRecipes } from "warframe-public-export-plus";
|
import { ExportRecipes } from "warframe-public-export-plus";
|
||||||
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { IInfestedFoundryClient, IInfestedFoundryDatabase } from "../types/inventoryTypes/inventoryTypes";
|
import { IInfestedFoundryClient, IInfestedFoundryDatabase } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { addRecipes } from "./inventoryService";
|
import { addRecipes } from "@/src/services/inventoryService";
|
||||||
import { config } from "./configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { ITypeCount } from "../types/commonTypes";
|
import { ITypeCount } from "@/src/types/commonTypes";
|
||||||
|
|
||||||
export const addInfestedFoundryXP = (infestedFoundry: IInfestedFoundryDatabase, delta: number): ITypeCount[] => {
|
export const addInfestedFoundryXP = (infestedFoundry: IInfestedFoundryDatabase, delta: number): ITypeCount[] => {
|
||||||
const recipeChanges: ITypeCount[] = [];
|
const recipeChanges: ITypeCount[] = [];
|
||||||
|
@ -27,11 +27,11 @@ import {
|
|||||||
IDialogueDatabase,
|
IDialogueDatabase,
|
||||||
IKubrowPetPrintClient
|
IKubrowPetPrintClient
|
||||||
} from "@/src/types/inventoryTypes/inventoryTypes";
|
} from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IGenericUpdate, IUpdateNodeIntrosResponse } from "../types/genericUpdate";
|
import { IGenericUpdate, IUpdateNodeIntrosResponse } from "@/src/types/genericUpdate";
|
||||||
import { IKeyChainRequest, IMissionInventoryUpdateRequest } from "../types/requestTypes";
|
import { IKeyChainRequest, IMissionInventoryUpdateRequest } from "@/src/types/requestTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { convertInboxMessage, fromStoreItem, getKeyChainItems } from "@/src/services/itemDataService";
|
import { convertInboxMessage, fromStoreItem, getKeyChainItems } from "@/src/services/itemDataService";
|
||||||
import { IFlavourItem, IItemConfig } from "../types/inventoryTypes/commonInventoryTypes";
|
import { IFlavourItem, IItemConfig } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import {
|
import {
|
||||||
ExportArcanes,
|
ExportArcanes,
|
||||||
ExportBoosters,
|
ExportBoosters,
|
||||||
@ -59,7 +59,7 @@ import {
|
|||||||
ISentinel,
|
ISentinel,
|
||||||
TStandingLimitBin
|
TStandingLimitBin
|
||||||
} from "warframe-public-export-plus";
|
} from "warframe-public-export-plus";
|
||||||
import { createShip } from "./shipService";
|
import { createShip } from "@/src/services/shipService";
|
||||||
import {
|
import {
|
||||||
catbrowDetails,
|
catbrowDetails,
|
||||||
fromMongoDate,
|
fromMongoDate,
|
||||||
@ -68,19 +68,25 @@ import {
|
|||||||
kubrowFurPatternsWeights,
|
kubrowFurPatternsWeights,
|
||||||
kubrowWeights,
|
kubrowWeights,
|
||||||
toOid
|
toOid
|
||||||
} from "../helpers/inventoryHelpers";
|
} from "@/src/helpers/inventoryHelpers";
|
||||||
import { addQuestKey, completeQuest } from "@/src/services/questService";
|
import { addQuestKey, completeQuest } from "@/src/services/questService";
|
||||||
import { handleBundleAcqusition } from "./purchaseService";
|
import { handleBundleAcqusition } from "@/src/services/purchaseService";
|
||||||
import libraryDailyTasks from "@/static/fixed_responses/libraryDailyTasks.json";
|
import libraryDailyTasks from "@/static/fixed_responses/libraryDailyTasks.json";
|
||||||
import { generateRewardSeed, getRandomElement, getRandomInt, getRandomWeightedReward, SRng } from "./rngService";
|
import {
|
||||||
import { createMessage, IMessageCreationTemplate } from "./inboxService";
|
generateRewardSeed,
|
||||||
|
getRandomElement,
|
||||||
|
getRandomInt,
|
||||||
|
getRandomWeightedReward,
|
||||||
|
SRng
|
||||||
|
} from "@/src/services/rngService";
|
||||||
|
import { createMessage, IMessageCreationTemplate } from "@/src/services/inboxService";
|
||||||
import { getMaxStanding, getMinStanding } from "@/src/helpers/syndicateStandingHelper";
|
import { getMaxStanding, getMinStanding } from "@/src/helpers/syndicateStandingHelper";
|
||||||
import { getNightwaveSyndicateTag, getWorldState } from "./worldStateService";
|
import { getNightwaveSyndicateTag, getWorldState } from "@/src/services/worldStateService";
|
||||||
import { ICalendarSeason } from "@/src/types/worldStateTypes";
|
import { ICalendarSeason } from "@/src/types/worldStateTypes";
|
||||||
import { generateNemesisProfile, INemesisProfile } from "../helpers/nemesisHelpers";
|
import { generateNemesisProfile, INemesisProfile } from "@/src/helpers/nemesisHelpers";
|
||||||
import { TAccountDocument } from "./loginService";
|
import { TAccountDocument } from "@/src/services/loginService";
|
||||||
import { unixTimesInMs } from "../constants/timeConstants";
|
import { unixTimesInMs } from "@/src/constants/timeConstants";
|
||||||
import { addString } from "../helpers/stringHelpers";
|
import { addString } from "@/src/helpers/stringHelpers";
|
||||||
import {
|
import {
|
||||||
EquipmentFeatures,
|
EquipmentFeatures,
|
||||||
IEquipmentClient,
|
IEquipmentClient,
|
||||||
@ -88,8 +94,8 @@ import {
|
|||||||
IKubrowPetDetailsDatabase,
|
IKubrowPetDetailsDatabase,
|
||||||
ITraits,
|
ITraits,
|
||||||
Status
|
Status
|
||||||
} from "../types/equipmentTypes";
|
} from "@/src/types/equipmentTypes";
|
||||||
import { ITypeCount } from "../types/commonTypes";
|
import { ITypeCount } from "@/src/types/commonTypes";
|
||||||
|
|
||||||
export const createInventory = async (
|
export const createInventory = async (
|
||||||
accountOwnerId: Types.ObjectId,
|
accountOwnerId: Types.ObjectId,
|
||||||
|
@ -33,7 +33,7 @@ import {
|
|||||||
IRecipe,
|
IRecipe,
|
||||||
TReward
|
TReward
|
||||||
} from "warframe-public-export-plus";
|
} from "warframe-public-export-plus";
|
||||||
import { IMessage } from "../models/inboxModel";
|
import { IMessage } from "@/src/models/inboxModel";
|
||||||
|
|
||||||
export type WeaponTypeInternal =
|
export type WeaponTypeInternal =
|
||||||
| "LongGuns"
|
| "LongGuns"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Guild } from "../models/guildModel";
|
import { Guild } from "@/src/models/guildModel";
|
||||||
import { Leaderboard, TLeaderboardEntryDocument } from "../models/leaderboardModel";
|
import { Leaderboard, TLeaderboardEntryDocument } from "@/src/models/leaderboardModel";
|
||||||
import { ILeaderboardEntryClient } from "../types/leaderboardTypes";
|
import { ILeaderboardEntryClient } from "@/src/types/leaderboardTypes";
|
||||||
|
|
||||||
export const submitLeaderboardScore = async (
|
export const submitLeaderboardScore = async (
|
||||||
schedule: "weekly" | "daily",
|
schedule: "weekly" | "daily",
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import randomRewards from "@/static/fixed_responses/loginRewards/randomRewards.json";
|
import randomRewards from "@/static/fixed_responses/loginRewards/randomRewards.json";
|
||||||
import { IInventoryChanges } from "../types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { TAccountDocument } from "./loginService";
|
import { TAccountDocument } from "@/src/services/loginService";
|
||||||
import { mixSeeds, SRng } from "./rngService";
|
import { mixSeeds, SRng } from "@/src/services/rngService";
|
||||||
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { addBooster, updateCurrency } from "./inventoryService";
|
import { addBooster, updateCurrency } from "@/src/services/inventoryService";
|
||||||
import { handleStoreItemAcquisition } from "./purchaseService";
|
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
||||||
import {
|
import {
|
||||||
ExportBoosterPacks,
|
ExportBoosterPacks,
|
||||||
ExportBoosters,
|
ExportBoosters,
|
||||||
@ -12,7 +12,7 @@ import {
|
|||||||
ExportWarframes,
|
ExportWarframes,
|
||||||
ExportWeapons
|
ExportWeapons
|
||||||
} from "warframe-public-export-plus";
|
} from "warframe-public-export-plus";
|
||||||
import { toStoreItem } from "./itemDataService";
|
import { toStoreItem } from "@/src/services/itemDataService";
|
||||||
|
|
||||||
export interface ILoginRewardsReponse {
|
export interface ILoginRewardsReponse {
|
||||||
DailyTributeInfo: {
|
DailyTributeInfo: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Account } from "@/src/models/loginModel";
|
import { Account } from "@/src/models/loginModel";
|
||||||
import { createInventory } from "@/src/services/inventoryService";
|
import { createInventory } from "@/src/services/inventoryService";
|
||||||
import { IDatabaseAccountJson, IDatabaseAccountRequiredFields } from "@/src/types/loginTypes";
|
import { IDatabaseAccountJson, IDatabaseAccountRequiredFields } from "@/src/types/loginTypes";
|
||||||
import { createShip } from "./shipService";
|
import { createShip } from "@/src/services/shipService";
|
||||||
import { Document, Types } from "mongoose";
|
import { Document, Types } from "mongoose";
|
||||||
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
|
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
|
||||||
import { PersonalRooms } from "@/src/models/personalRoomsModel";
|
import { PersonalRooms } from "@/src/models/personalRoomsModel";
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
IRegion,
|
IRegion,
|
||||||
IReward
|
IReward
|
||||||
} from "warframe-public-export-plus";
|
} from "warframe-public-export-plus";
|
||||||
import { IMissionInventoryUpdateRequest, IRewardInfo } from "../types/requestTypes";
|
import { IMissionInventoryUpdateRequest, IRewardInfo } from "@/src/types/requestTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { IRngResult, SRng, generateRewardSeed, getRandomElement, getRandomReward } from "@/src/services/rngService";
|
import { IRngResult, SRng, generateRewardSeed, getRandomElement, getRandomReward } from "@/src/services/rngService";
|
||||||
import { equipmentKeys, IMission, TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { equipmentKeys, IMission, TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
@ -47,10 +47,10 @@ import { IAffiliationMods, IInventoryChanges } from "@/src/types/purchaseTypes";
|
|||||||
import { fromStoreItem, getLevelKeyRewards, isStoreItem, toStoreItem } from "@/src/services/itemDataService";
|
import { fromStoreItem, getLevelKeyRewards, isStoreItem, toStoreItem } from "@/src/services/itemDataService";
|
||||||
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { getEntriesUnsafe } from "@/src/utils/ts-utils";
|
import { getEntriesUnsafe } from "@/src/utils/ts-utils";
|
||||||
import { handleStoreItemAcquisition } from "./purchaseService";
|
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
||||||
import { IMissionCredits, IMissionReward } from "../types/missionTypes";
|
import { IMissionCredits, IMissionReward } from "@/src/types/missionTypes";
|
||||||
import { crackRelic } from "@/src/helpers/relicHelper";
|
import { crackRelic } from "@/src/helpers/relicHelper";
|
||||||
import { createMessage } from "./inboxService";
|
import { createMessage } from "@/src/services/inboxService";
|
||||||
import kuriaMessage50 from "@/static/fixed_responses/kuriaMessages/fiftyPercent.json";
|
import kuriaMessage50 from "@/static/fixed_responses/kuriaMessages/fiftyPercent.json";
|
||||||
import kuriaMessage75 from "@/static/fixed_responses/kuriaMessages/seventyFivePercent.json";
|
import kuriaMessage75 from "@/static/fixed_responses/kuriaMessages/seventyFivePercent.json";
|
||||||
import kuriaMessage100 from "@/static/fixed_responses/kuriaMessages/oneHundredPercent.json";
|
import kuriaMessage100 from "@/static/fixed_responses/kuriaMessages/oneHundredPercent.json";
|
||||||
@ -63,8 +63,8 @@ import {
|
|||||||
getNemesisManifest,
|
getNemesisManifest,
|
||||||
getNemesisPasscode
|
getNemesisPasscode
|
||||||
} from "@/src/helpers/nemesisHelpers";
|
} from "@/src/helpers/nemesisHelpers";
|
||||||
import { Loadout } from "../models/inventoryModels/loadoutModel";
|
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
|
||||||
import { ILoadoutConfigDatabase } from "../types/saveLoadoutTypes";
|
import { ILoadoutConfigDatabase } from "@/src/types/saveLoadoutTypes";
|
||||||
import {
|
import {
|
||||||
getLiteSortie,
|
getLiteSortie,
|
||||||
getSortie,
|
getSortie,
|
||||||
@ -73,14 +73,14 @@ import {
|
|||||||
idToDay,
|
idToDay,
|
||||||
idToWeek,
|
idToWeek,
|
||||||
pushClassicBounties
|
pushClassicBounties
|
||||||
} from "./worldStateService";
|
} from "@/src/services/worldStateService";
|
||||||
import { config } from "./configService";
|
import { config } from "@/src/services/configService";
|
||||||
import libraryDailyTasks from "@/static/fixed_responses/libraryDailyTasks.json";
|
import libraryDailyTasks from "@/static/fixed_responses/libraryDailyTasks.json";
|
||||||
import { ISyndicateMissionInfo } from "../types/worldStateTypes";
|
import { ISyndicateMissionInfo } from "@/src/types/worldStateTypes";
|
||||||
import { fromOid } from "../helpers/inventoryHelpers";
|
import { fromOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { TAccountDocument } from "./loginService";
|
import { TAccountDocument } from "@/src/services/loginService";
|
||||||
import { ITypeCount } from "../types/commonTypes";
|
import { ITypeCount } from "@/src/types/commonTypes";
|
||||||
import { IEquipmentClient } from "../types/equipmentTypes";
|
import { IEquipmentClient } from "@/src/types/equipmentTypes";
|
||||||
|
|
||||||
const getRotations = (rewardInfo: IRewardInfo, tierOverride?: number): number[] => {
|
const getRotations = (rewardInfo: IRewardInfo, tierOverride?: number): number[] => {
|
||||||
// For Spy missions, e.g. 3 vaults cracked = A, B, C
|
// For Spy missions, e.g. 3 vaults cracked = A, B, C
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { PersonalRooms } from "@/src/models/personalRoomsModel";
|
import { PersonalRooms } from "@/src/models/personalRoomsModel";
|
||||||
import { addItem, getInventory } from "@/src/services/inventoryService";
|
import { addItem, getInventory } from "@/src/services/inventoryService";
|
||||||
import { IGardeningDatabase, TPersonalRoomsDatabaseDocument } from "../types/personalRoomsTypes";
|
import { IGardeningDatabase, TPersonalRoomsDatabaseDocument } from "@/src/types/personalRoomsTypes";
|
||||||
import { getRandomElement } from "./rngService";
|
import { getRandomElement } from "@/src/services/rngService";
|
||||||
|
|
||||||
export const getPersonalRooms = async (
|
export const getPersonalRooms = async (
|
||||||
accountId: string,
|
accountId: string,
|
||||||
|
@ -20,7 +20,7 @@ import {
|
|||||||
IPurchaseParams
|
IPurchaseParams
|
||||||
} from "@/src/types/purchaseTypes";
|
} from "@/src/types/purchaseTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { getWorldState } from "./worldStateService";
|
import { getWorldState } from "@/src/services/worldStateService";
|
||||||
import {
|
import {
|
||||||
ExportBoosterPacks,
|
ExportBoosterPacks,
|
||||||
ExportBoosters,
|
ExportBoosters,
|
||||||
@ -32,11 +32,11 @@ import {
|
|||||||
ExportVendors,
|
ExportVendors,
|
||||||
TRarity
|
TRarity
|
||||||
} from "warframe-public-export-plus";
|
} from "warframe-public-export-plus";
|
||||||
import { config } from "./configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { fromStoreItem, toStoreItem } from "./itemDataService";
|
import { fromStoreItem, toStoreItem } from "@/src/services/itemDataService";
|
||||||
import { DailyDeal } from "../models/worldStateModel";
|
import { DailyDeal } from "@/src/models/worldStateModel";
|
||||||
import { fromMongoDate, toMongoDate } from "../helpers/inventoryHelpers";
|
import { fromMongoDate, toMongoDate } from "@/src/helpers/inventoryHelpers";
|
||||||
|
|
||||||
export const getStoreItemCategory = (storeItem: string): string => {
|
export const getStoreItemCategory = (storeItem: string): string => {
|
||||||
const storeItemString = getSubstringFromKeyword(storeItem, "StoreItems/");
|
const storeItemString = getSubstringFromKeyword(storeItem, "StoreItems/");
|
||||||
|
@ -8,10 +8,10 @@ import { IQuestKeyClient, IQuestKeyDatabase, IQuestStage } from "@/src/types/inv
|
|||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { ExportKeys } from "warframe-public-export-plus";
|
import { ExportKeys } from "warframe-public-export-plus";
|
||||||
import { addFixedLevelRewards } from "./missionInventoryUpdateService";
|
import { addFixedLevelRewards } from "@/src/services/missionInventoryUpdateService";
|
||||||
import { IInventoryChanges } from "../types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import questCompletionItems from "@/static/fixed_responses/questCompletionRewards.json";
|
import questCompletionItems from "@/static/fixed_responses/questCompletionRewards.json";
|
||||||
import { ITypeCount } from "../types/commonTypes";
|
import { ITypeCount } from "@/src/types/commonTypes";
|
||||||
|
|
||||||
export interface IUpdateQuestRequest {
|
export interface IUpdateQuestRequest {
|
||||||
QuestKeys: Omit<IQuestKeyDatabase, "CompletionDate">[];
|
QuestKeys: Omit<IQuestKeyDatabase, "CompletionDate">[];
|
||||||
|
@ -13,8 +13,8 @@ import { Types } from "mongoose";
|
|||||||
import { isEmptyObject } from "@/src/helpers/general";
|
import { isEmptyObject } from "@/src/helpers/general";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { equipmentKeys, TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { equipmentKeys, TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IItemConfig } from "../types/inventoryTypes/commonInventoryTypes";
|
import { IItemConfig } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { importCrewMemberId } from "./importService";
|
import { importCrewMemberId } from "@/src/services/importService";
|
||||||
|
|
||||||
//TODO: setup default items on account creation or like originally in giveStartingItems.php
|
//TODO: setup default items on account creation or like originally in giveStartingItems.php
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import { mixSeeds, SRng } from "@/src/services/rngService";
|
|||||||
import { IItemManifest, IVendorInfo, IVendorManifest } from "@/src/types/vendorTypes";
|
import { IItemManifest, IVendorInfo, IVendorManifest } from "@/src/types/vendorTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { ExportVendors, IRange, IVendor, IVendorOffer } from "warframe-public-export-plus";
|
import { ExportVendors, IRange, IVendor, IVendorOffer } from "warframe-public-export-plus";
|
||||||
import { config } from "./configService";
|
import { config } from "@/src/services/configService";
|
||||||
|
|
||||||
interface IGeneratableVendorInfo extends Omit<IVendorInfo, "ItemManifest" | "Expiry"> {
|
interface IGeneratableVendorInfo extends Omit<IVendorInfo, "ItemManifest" | "Expiry"> {
|
||||||
cycleOffset?: number;
|
cycleOffset?: number;
|
||||||
|
@ -8,14 +8,14 @@ import {
|
|||||||
RoomsType,
|
RoomsType,
|
||||||
TBootLocation,
|
TBootLocation,
|
||||||
TPersonalRoomsDatabaseDocument
|
TPersonalRoomsDatabaseDocument
|
||||||
} from "../types/personalRoomsTypes";
|
} from "@/src/types/personalRoomsTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { addFusionTreasures, addShipDecorations, getInventory } from "./inventoryService";
|
import { addFusionTreasures, addShipDecorations, getInventory } from "@/src/services/inventoryService";
|
||||||
import { config } from "./configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { Guild } from "../models/guildModel";
|
import { Guild } from "@/src/models/guildModel";
|
||||||
import { hasGuildPermission } from "./guildService";
|
import { hasGuildPermission } from "@/src/services/guildService";
|
||||||
import { GuildPermission } from "../types/guildTypes";
|
import { GuildPermission } from "@/src/types/guildTypes";
|
||||||
import { ExportResources } from "warframe-public-export-plus";
|
import { ExportResources } from "warframe-public-export-plus";
|
||||||
|
|
||||||
export const setShipCustomizations = async (
|
export const setShipCustomizations = async (
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
} from "@/src/types/statTypes";
|
} from "@/src/types/statTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { addEmailItem, getInventory } from "@/src/services/inventoryService";
|
import { addEmailItem, getInventory } from "@/src/services/inventoryService";
|
||||||
import { submitLeaderboardScore } from "./leaderboardService";
|
import { submitLeaderboardScore } from "@/src/services/leaderboardService";
|
||||||
|
|
||||||
export const createStats = async (accountId: string): Promise<TStatsDatabaseDocument> => {
|
export const createStats = async (accountId: string): Promise<TStatsDatabaseDocument> => {
|
||||||
const stats = new Stats({ accountOwnerId: accountId });
|
const stats = new Stats({ accountOwnerId: accountId });
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import http from "http";
|
import http from "http";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import { config } from "./configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { logger } from "../utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { app } from "../app";
|
import { app } from "@/src/app";
|
||||||
import { AddressInfo } from "node:net";
|
import { AddressInfo } from "node:net";
|
||||||
import { Agent, WebSocket as UnidiciWebSocket } from "undici";
|
import { Agent, WebSocket as UnidiciWebSocket } from "undici";
|
||||||
import { startWsServer, startWssServer, stopWsServers } from "./wsService";
|
import { startWsServer, startWssServer, stopWsServers } from "@/src/services/wsService";
|
||||||
|
|
||||||
let httpServer: http.Server | undefined;
|
let httpServer: http.Server | undefined;
|
||||||
let httpsServer: https.Server | undefined;
|
let httpsServer: https.Server | undefined;
|
||||||
|
@ -28,10 +28,10 @@ import {
|
|||||||
IVoidTraderOffer,
|
IVoidTraderOffer,
|
||||||
IWorldState,
|
IWorldState,
|
||||||
TCircuitGameMode
|
TCircuitGameMode
|
||||||
} from "../types/worldStateTypes";
|
} from "@/src/types/worldStateTypes";
|
||||||
import { toMongoDate, toOid, version_compare } from "../helpers/inventoryHelpers";
|
import { toMongoDate, toOid, version_compare } from "@/src/helpers/inventoryHelpers";
|
||||||
import { logger } from "../utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { DailyDeal, Fissure } from "../models/worldStateModel";
|
import { DailyDeal, Fissure } from "@/src/models/worldStateModel";
|
||||||
|
|
||||||
const sortieBosses = [
|
const sortieBosses = [
|
||||||
"SORTIE_BOSS_HYENA",
|
"SORTIE_BOSS_HYENA",
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import http from "http";
|
import http from "http";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import ws from "ws";
|
import ws from "ws";
|
||||||
import { Account } from "../models/loginModel";
|
import { Account } from "@/src/models/loginModel";
|
||||||
import { createAccount, createNonce, getUsernameFromEmail, isCorrectPassword } from "./loginService";
|
import { createAccount, createNonce, getUsernameFromEmail, isCorrectPassword } from "@/src/services/loginService";
|
||||||
import { IDatabaseAccountJson } from "../types/loginTypes";
|
import { IDatabaseAccountJson } from "@/src/types/loginTypes";
|
||||||
import { HydratedDocument } from "mongoose";
|
import { HydratedDocument } from "mongoose";
|
||||||
|
|
||||||
let wsServer: ws.Server | undefined;
|
let wsServer: ws.Server | undefined;
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { IMongoDate, IOid, IOidWithLegacySupport } from "./commonTypes";
|
import { IMongoDate, IOid, IOidWithLegacySupport } from "@/src/types/commonTypes";
|
||||||
import { ICrewShipCustomization, IFlavourItem, IItemConfig, IPolarity } from "./inventoryTypes/commonInventoryTypes";
|
import {
|
||||||
|
ICrewShipCustomization,
|
||||||
|
IFlavourItem,
|
||||||
|
IItemConfig,
|
||||||
|
IPolarity
|
||||||
|
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
|
|
||||||
export interface IEquipmentSelection {
|
export interface IEquipmentSelection {
|
||||||
ItemId: IOid;
|
ItemId: IOid;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { IMongoDate, IOidWithLegacySupport } from "./commonTypes";
|
import { IMongoDate, IOidWithLegacySupport } from "@/src/types/commonTypes";
|
||||||
|
|
||||||
export interface IFriendInfo {
|
export interface IFriendInfo {
|
||||||
_id: IOidWithLegacySupport;
|
_id: IOidWithLegacySupport;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryChanges } from "./purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
|
|
||||||
export interface IGenericUpdate {
|
export interface IGenericUpdate {
|
||||||
NodeIntrosCompleted: string | string[];
|
NodeIntrosCompleted: string | string[];
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { IOid, IMongoDate, IOidWithLegacySupport, ITypeCount } from "@/src/types/commonTypes";
|
import { IOid, IMongoDate, IOidWithLegacySupport, ITypeCount } from "@/src/types/commonTypes";
|
||||||
import { IFusionTreasure, IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IFusionTreasure, IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IPictureFrameInfo } from "./personalRoomsTypes";
|
import { IPictureFrameInfo } from "@/src/types/personalRoomsTypes";
|
||||||
import { IFriendInfo } from "./friendTypes";
|
import { IFriendInfo } from "@/src/types/friendTypes";
|
||||||
|
|
||||||
export interface IGuildClient {
|
export interface IGuildClient {
|
||||||
_id: IOidWithLegacySupport;
|
_id: IOidWithLegacySupport;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { IOid, IMongoDate, IOidWithLegacySupport, ITypeCount } from "../commonTypes";
|
import { IOid, IMongoDate, IOidWithLegacySupport, ITypeCount } from "@/src/types/commonTypes";
|
||||||
import {
|
import {
|
||||||
IColor,
|
IColor,
|
||||||
IItemConfig,
|
IItemConfig,
|
||||||
@ -11,10 +11,10 @@ import {
|
|||||||
IShipCustomization
|
IShipCustomization
|
||||||
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { IFingerprintStat, RivenFingerprint } from "@/src/helpers/rivenHelper";
|
import { IFingerprintStat, RivenFingerprint } from "@/src/helpers/rivenHelper";
|
||||||
import { IOrbiterClient } from "../personalRoomsTypes";
|
import { IOrbiterClient } from "@/src/types/personalRoomsTypes";
|
||||||
import { ICountedStoreItem } from "warframe-public-export-plus";
|
import { ICountedStoreItem } from "warframe-public-export-plus";
|
||||||
import { IEquipmentClient, IEquipmentDatabase, ITraits } from "../equipmentTypes";
|
import { IEquipmentClient, IEquipmentDatabase, ITraits } from "@/src/types/equipmentTypes";
|
||||||
import { ILoadOutPresets } from "../saveLoadoutTypes";
|
import { ILoadOutPresets } from "@/src/types/saveLoadoutTypes";
|
||||||
|
|
||||||
export type InventoryDatabaseEquipment = {
|
export type InventoryDatabaseEquipment = {
|
||||||
[_ in TEquipmentKey]: IEquipmentDatabase[];
|
[_ in TEquipmentKey]: IEquipmentDatabase[];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IAffiliationMods, IInventoryChanges } from "./purchaseTypes";
|
import { IAffiliationMods, IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
|
|
||||||
export const inventoryFields = ["RawUpgrades", "MiscItems", "Consumables", "Recipes"] as const;
|
export const inventoryFields = ["RawUpgrades", "MiscItems", "Consumables", "Recipes"] as const;
|
||||||
export type IInventoryFieldType = (typeof inventoryFields)[number];
|
export type IInventoryFieldType = (typeof inventoryFields)[number];
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { IColor, IShipAttachments, IShipCustomization } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { IColor, IShipAttachments, IShipCustomization } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { Document, Model, Types } from "mongoose";
|
import { Document, Model, Types } from "mongoose";
|
||||||
import { ILoadoutClient } from "./saveLoadoutTypes";
|
import { ILoadoutClient } from "@/src/types/saveLoadoutTypes";
|
||||||
import { IMongoDate, IOid } from "./commonTypes";
|
import { IMongoDate, IOid } from "@/src/types/commonTypes";
|
||||||
|
|
||||||
export interface IGetShipResponse {
|
export interface IGetShipResponse {
|
||||||
ShipOwnerId: string;
|
ShipOwnerId: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ITypeCount } from "./commonTypes";
|
import { ITypeCount } from "@/src/types/commonTypes";
|
||||||
import { IEquipmentClient } from "./equipmentTypes";
|
import { IEquipmentClient } from "@/src/types/equipmentTypes";
|
||||||
import {
|
import {
|
||||||
IDroneClient,
|
IDroneClient,
|
||||||
IInfestedFoundryClient,
|
IInfestedFoundryClient,
|
||||||
@ -9,7 +9,7 @@ import {
|
|||||||
TEquipmentKey,
|
TEquipmentKey,
|
||||||
ICrewMemberClient,
|
ICrewMemberClient,
|
||||||
IKubrowPetPrintClient
|
IKubrowPetPrintClient
|
||||||
} from "./inventoryTypes/inventoryTypes";
|
} from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
export enum PurchaseSource {
|
export enum PurchaseSource {
|
||||||
Market = 0,
|
Market = 0,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IOid, ITypeCount } from "./commonTypes";
|
import { IOid, ITypeCount } from "@/src/types/commonTypes";
|
||||||
import { ArtifactPolarity, IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { ArtifactPolarity, IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import {
|
import {
|
||||||
IBooster,
|
IBooster,
|
||||||
@ -22,10 +22,10 @@ import {
|
|||||||
IWeaponSkinClient,
|
IWeaponSkinClient,
|
||||||
IKubrowPetEggClient,
|
IKubrowPetEggClient,
|
||||||
INemesisClient
|
INemesisClient
|
||||||
} from "./inventoryTypes/inventoryTypes";
|
} from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IGroup } from "./loginTypes";
|
import { IGroup } from "@/src/types/loginTypes";
|
||||||
import { ILoadOutPresets } from "./saveLoadoutTypes";
|
import { ILoadOutPresets } from "@/src/types/saveLoadoutTypes";
|
||||||
import { IEquipmentClient } from "./equipmentTypes";
|
import { IEquipmentClient } from "@/src/types/equipmentTypes";
|
||||||
|
|
||||||
export interface IAffiliationChange {
|
export interface IAffiliationChange {
|
||||||
Tag: string;
|
Tag: string;
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
IOperatorConfigClient
|
IOperatorConfigClient
|
||||||
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { ICrewShipMembersClient, ICrewShipWeapon, IEquipmentSelection } from "./equipmentTypes";
|
import { ICrewShipMembersClient, ICrewShipWeapon, IEquipmentSelection } from "@/src/types/equipmentTypes";
|
||||||
|
|
||||||
export interface ISaveLoadoutRequest {
|
export interface ISaveLoadoutRequest {
|
||||||
LoadOuts: ILoadoutClient;
|
LoadOuts: ILoadoutClient;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IMongoDate, IOid } from "./commonTypes";
|
import { IMongoDate, IOid } from "@/src/types/commonTypes";
|
||||||
|
|
||||||
export interface IItemPrice {
|
export interface IItemPrice {
|
||||||
ItemType: string;
|
ItemType: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IMissionReward } from "warframe-public-export-plus";
|
import { IMissionReward } from "warframe-public-export-plus";
|
||||||
import { IMongoDate, IOid } from "./commonTypes";
|
import { IMongoDate, IOid } from "@/src/types/commonTypes";
|
||||||
|
|
||||||
export interface IWorldState {
|
export interface IWorldState {
|
||||||
Version: number; // for goals
|
Version: number; // for goals
|
||||||
|
Loading…
x
Reference in New Issue
Block a user