Lint: ts files (!82)
Co-authored-by: alimoncul <alimoncul@gmail.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/82 Co-authored-by: CZPZ <czpz@noreply.dev.sp-tarkov.com> Co-committed-by: CZPZ <czpz@noreply.dev.sp-tarkov.com>
This commit is contained in:
parent
d595e26ee6
commit
8c37bc7837
@ -1,6 +1,6 @@
|
|||||||
import readline from "readline";
|
import readline from "readline";
|
||||||
import { ILogger } from "./models/spt/utils/ILogger";
|
import { ILogger } from "./models/spt/utils/ILogger";
|
||||||
import { AsyncQueue } from "./utils/AyncQueue";
|
import { AsyncQueue } from "./utils/AsyncQueue";
|
||||||
import { WinstonMainLogger } from "./utils/logging/WinstonMainLogger";
|
import { WinstonMainLogger } from "./utils/logging/WinstonMainLogger";
|
||||||
import { UUidGenerator } from "./utils/UUidGenerator";
|
import { UUidGenerator } from "./utils/UUidGenerator";
|
||||||
|
|
||||||
|
@ -158,7 +158,6 @@ export class DataCallbacks
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
public getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetItemPricesResponse>
|
public getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetItemPricesResponse>
|
||||||
{
|
{
|
||||||
const traderId = url.replace("/client/items/prices/", "");
|
|
||||||
const handbookPrices = this.ragfairController.getStaticPrices();
|
const handbookPrices = this.ragfairController.getStaticPrices();
|
||||||
const response: IGetItemPricesResponse = {
|
const response: IGetItemPricesResponse = {
|
||||||
supplyNextTime: 1672236024, // todo: get trader refresh time?
|
supplyNextTime: 1672236024, // todo: get trader refresh time?
|
||||||
|
@ -227,7 +227,7 @@ import { SeasonalEventService } from "../services/SeasonalEventService";
|
|||||||
import { TraderAssortService } from "../services/TraderAssortService";
|
import { TraderAssortService } from "../services/TraderAssortService";
|
||||||
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
|
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
|
||||||
import { App } from "../utils/App";
|
import { App } from "../utils/App";
|
||||||
import { AsyncQueue } from "../utils/AyncQueue";
|
import { AsyncQueue } from "../utils/AsyncQueue";
|
||||||
import { DatabaseImporter } from "../utils/DatabaseImporter";
|
import { DatabaseImporter } from "../utils/DatabaseImporter";
|
||||||
import { EncodingUtil } from "../utils/EncodingUtil";
|
import { EncodingUtil } from "../utils/EncodingUtil";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ILocations } from "../../spt/server/ILocations"
|
import { ILocations } from "../../spt/server/ILocations";
|
||||||
|
|
||||||
export interface ILocationsGenerateAllResponse
|
export interface ILocationsGenerateAllResponse
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Item } from "./IItem"
|
import { Item } from "./IItem";
|
||||||
|
|
||||||
export interface ILootBase
|
export interface ILootBase
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { Item } from "./IItem"
|
import { Item } from "./IItem";
|
||||||
|
|
||||||
export interface ITrader
|
export interface ITrader
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Message } from "../profile/IAkiProfile"
|
import { Message } from "../profile/IAkiProfile";
|
||||||
|
|
||||||
export interface IGetAllAttachmentsResponse
|
export interface IGetAllAttachmentsResponse
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { MemberCategory } from "../../enums/MemberCategory"
|
import { MemberCategory } from "../../enums/MemberCategory";
|
||||||
|
|
||||||
export interface IGetFriendListDataResponse
|
export interface IGetFriendListDataResponse
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { MessageType } from "../../enums/MessageType"
|
import { MessageType } from "../../enums/MessageType";
|
||||||
|
|
||||||
export interface ISendMessageRequest
|
export interface ISendMessageRequest
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseInteractionRequestData } from "../common/request/IBaseInteractionRequestData"
|
import { IBaseInteractionRequestData } from "../common/request/IBaseInteractionRequestData";
|
||||||
|
|
||||||
export interface IOffraidEatRequestData extends IBaseInteractionRequestData
|
export interface IOffraidEatRequestData extends IBaseInteractionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseInteractionRequestData } from "../common/request/IBaseInteractionRequestData"
|
import { IBaseInteractionRequestData } from "../common/request/IBaseInteractionRequestData";
|
||||||
|
|
||||||
export interface IOffraidHealRequestData extends IBaseInteractionRequestData
|
export interface IOffraidHealRequestData extends IBaseInteractionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { MinMax } from "../../common/MinMax"
|
import { MinMax } from "../../common/MinMax";
|
||||||
|
|
||||||
export interface IHideoutScavCase
|
export interface IHideoutScavCase
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IPmcData } from "../common/IPmcData"
|
import { IPmcData } from "../common/IPmcData";
|
||||||
import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"
|
import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData";
|
||||||
|
|
||||||
export interface ISaveProgressRequestData
|
export interface ISaveProgressRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseInteractionRequestData } from "../common/request/IBaseInteractionRequestData"
|
import { IBaseInteractionRequestData } from "../common/request/IBaseInteractionRequestData";
|
||||||
|
|
||||||
export interface IInsureRequestData extends IBaseInteractionRequestData
|
export interface IInsureRequestData extends IBaseInteractionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Item, Location } from "../common/tables/IItem"
|
import { Item, Location } from "../common/tables/IItem";
|
||||||
|
|
||||||
export interface IAddItemTempObject
|
export interface IAddItemTempObject
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseInteractionRequestData } from "../common/request/IBaseInteractionRequestData"
|
import { IBaseInteractionRequestData } from "../common/request/IBaseInteractionRequestData";
|
||||||
|
|
||||||
export interface IInventoryBaseActionRequestData extends IBaseInteractionRequestData
|
export interface IInventoryBaseActionRequestData extends IBaseInteractionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryCreateMarkerRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryCreateMarkerRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryDeleteMarkerRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryDeleteMarkerRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryEditMarkerRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryEditMarkerRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryFoldRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryFoldRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryMergeRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryMergeRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData, To } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData, To } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryMoveRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryMoveRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryReadEncyclopediaRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryReadEncyclopediaRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryRemoveRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryRemoveRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Upd } from "../common/tables/IItem"
|
import { Upd } from "../common/tables/IItem";
|
||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventorySortRequestData extends IInventoryBaseActionRequestData
|
export interface IInventorySortRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData
|
export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryTagRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryTagRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryToggleRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryToggleRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"
|
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
|
||||||
|
|
||||||
export interface IInventoryTransferRequestData extends IInventoryBaseActionRequestData
|
export interface IInventoryTransferRequestData extends IInventoryBaseActionRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IItemEventRouterBase } from "./IItemEventRouterBase"
|
import { IItemEventRouterBase } from "./IItemEventRouterBase";
|
||||||
|
|
||||||
export interface IItemEventRouterResponse extends IItemEventRouterBase
|
export interface IItemEventRouterResponse extends IItemEventRouterBase
|
||||||
{}
|
{}
|
@ -1,4 +1,4 @@
|
|||||||
import { RaidMode } from "../../enums/RaidMode"
|
import { RaidMode } from "../../enums/RaidMode";
|
||||||
|
|
||||||
export interface ICreateGroupRequestData
|
export interface ICreateGroupRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { RaidMode } from "../../enums/RaidMode"
|
import { RaidMode } from "../../enums/RaidMode";
|
||||||
|
|
||||||
export interface IGetGroupStatusRequestData
|
export interface IGetGroupStatusRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { INotifierChannel } from "./INotifier"
|
import { INotifierChannel } from "./INotifier";
|
||||||
|
|
||||||
export interface ISelectProfileResponse
|
export interface ISelectProfileResponse
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Skills } from "../common/tables/IBotBase"
|
import { Skills } from "../common/tables/IBotBase";
|
||||||
|
|
||||||
export interface IPlayerIncrementSkillLevelRequestData
|
export interface IPlayerIncrementSkillLevelRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IRagfairOffer } from "./IRagfairOffer"
|
import { IRagfairOffer } from "./IRagfairOffer";
|
||||||
|
|
||||||
export interface IGetOffersResult
|
export interface IGetOffersResult
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { RagfairSort } from "../../enums/RagfairSort"
|
import { RagfairSort } from "../../enums/RagfairSort";
|
||||||
|
|
||||||
export interface ISearchRequestData
|
export interface ISearchRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseRepairActionDataRequest } from "./IBaseRepairActionDataRequest"
|
import { IBaseRepairActionDataRequest } from "./IBaseRepairActionDataRequest";
|
||||||
|
|
||||||
export interface ITraderRepairActionDataRequest extends IBaseRepairActionDataRequest
|
export interface ITraderRepairActionDataRequest extends IBaseRepairActionDataRequest
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { IProcessBaseTradeRequestData } from "./IProcessBaseTradeRequestData"
|
import { IProcessBaseTradeRequestData } from "./IProcessBaseTradeRequestData";
|
||||||
|
|
||||||
export interface IProcessBuyTradeRequestData extends IProcessBaseTradeRequestData
|
export interface IProcessBuyTradeRequestData extends IProcessBaseTradeRequestData
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IProcessBaseTradeRequestData } from "./IProcessBaseTradeRequestData"
|
import { IProcessBaseTradeRequestData } from "./IProcessBaseTradeRequestData";
|
||||||
|
|
||||||
export interface IProcessSellTradeRequestData extends IProcessBaseTradeRequestData
|
export interface IProcessSellTradeRequestData extends IProcessBaseTradeRequestData
|
||||||
{
|
{
|
||||||
|
28
project/src/models/external/HttpFramework.ts
vendored
28
project/src/models/external/HttpFramework.ts
vendored
@ -19,7 +19,7 @@ export const Listen = (basePath: string) =>
|
|||||||
return class extends Base
|
return class extends Base
|
||||||
{
|
{
|
||||||
// Record of each handler per HTTP method and path
|
// Record of each handler per HTTP method and path
|
||||||
handlers: Partial<Record<HttpMethods, Record<string, HandleFn>>>
|
handlers: Partial<Record<HttpMethods, Record<string, HandleFn>>>;
|
||||||
|
|
||||||
constructor(...args: any[])
|
constructor(...args: any[])
|
||||||
{
|
{
|
||||||
@ -33,7 +33,7 @@ export const Listen = (basePath: string) =>
|
|||||||
// Add each flagged handler to the Record
|
// Add each flagged handler to the Record
|
||||||
handlersArray.forEach(({ handlerName, path, httpMethod }) =>
|
handlersArray.forEach(({ handlerName, path, httpMethod }) =>
|
||||||
{
|
{
|
||||||
if (!this.handlers[httpMethod]) this.handlers[httpMethod] = {}
|
if (!this.handlers[httpMethod]) this.handlers[httpMethod] = {};
|
||||||
|
|
||||||
if (this[handlerName] !== undefined && typeof this[handlerName] === "function")
|
if (this[handlerName] !== undefined && typeof this[handlerName] === "function")
|
||||||
{
|
{
|
||||||
@ -53,8 +53,8 @@ export const Listen = (basePath: string) =>
|
|||||||
const routesHandles = this.handlers[req.method];
|
const routesHandles = this.handlers[req.method];
|
||||||
|
|
||||||
return Object.keys(this.handlers).some(meth => meth === req.method) &&
|
return Object.keys(this.handlers).some(meth => meth === req.method) &&
|
||||||
Object.keys(routesHandles).some(route => (new RegExp(route)).test(req.url))
|
Object.keys(routesHandles).some(route => (new RegExp(route)).test(req.url));
|
||||||
}
|
};
|
||||||
|
|
||||||
// The actual handle method dispatches the request to the registered handlers
|
// The actual handle method dispatches the request to the registered handlers
|
||||||
handle = (sessionID: string, req: IncomingMessage, resp: ServerResponse): void =>
|
handle = (sessionID: string, req: IncomingMessage, resp: ServerResponse): void =>
|
||||||
@ -70,11 +70,11 @@ export const Listen = (basePath: string) =>
|
|||||||
|
|
||||||
// Filter to select valid routes but only use the first element since it's the most precise
|
// Filter to select valid routes but only use the first element since it's the most precise
|
||||||
const validRoutes = routes.filter(handlerKey => (new RegExp(handlerKey)).test(route));
|
const validRoutes = routes.filter(handlerKey => (new RegExp(handlerKey)).test(route));
|
||||||
if (validRoutes.length > 0) routesHandles[validRoutes[0]](sessionID, req, resp)
|
if (validRoutes.length > 0) routesHandles[validRoutes[0]](sessionID, req, resp);
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internally used to create HTTP decorators.
|
* Internally used to create HTTP decorators.
|
||||||
@ -89,17 +89,17 @@ const createHttpDecorator = (httpMethod: HttpMethods) =>
|
|||||||
return (target: any, propertyKey: string) =>
|
return (target: any, propertyKey: string) =>
|
||||||
{
|
{
|
||||||
// If the handlers array has not been initialized yet
|
// If the handlers array has not been initialized yet
|
||||||
if (!target["handlers"]) target["handlers"] = []
|
if (!target["handlers"]) target["handlers"] = [];
|
||||||
|
|
||||||
// Flag the method as a HTTP handler
|
// Flag the method as a HTTP handler
|
||||||
target["handlers"].push({
|
target["handlers"].push({
|
||||||
handlerName: propertyKey,
|
handlerName: propertyKey,
|
||||||
path,
|
path,
|
||||||
httpMethod
|
httpMethod
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP DELETE decorator
|
* HTTP DELETE decorator
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import { ITemplateItem } from "../../eft/common/tables/ITemplateItem"
|
import { ITemplateItem } from "../../eft/common/tables/ITemplateItem";
|
||||||
|
|
||||||
export class BotLootCache
|
export class BotLootCache
|
||||||
{
|
{
|
||||||
backpackLoot: ITemplateItem[]
|
backpackLoot: ITemplateItem[];
|
||||||
pocketLoot: ITemplateItem[]
|
pocketLoot: ITemplateItem[];
|
||||||
vestLoot: ITemplateItem[]
|
vestLoot: ITemplateItem[];
|
||||||
combinedPoolLoot: ITemplateItem[]
|
combinedPoolLoot: ITemplateItem[];
|
||||||
|
|
||||||
specialItems: ITemplateItem[]
|
specialItems: ITemplateItem[];
|
||||||
healingItems: ITemplateItem[]
|
healingItems: ITemplateItem[];
|
||||||
drugItems: ITemplateItem[]
|
drugItems: ITemplateItem[];
|
||||||
stimItems: ITemplateItem[]
|
stimItems: ITemplateItem[];
|
||||||
grenadeItems: ITemplateItem[]
|
grenadeItems: ITemplateItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LootCacheType
|
export enum LootCacheType
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { Mods } from "../../eft/common/tables/IBotType"
|
import { Mods } from "../../eft/common/tables/IBotType";
|
||||||
import { Item } from "../../eft/common/tables/IItem"
|
import { Item } from "../../eft/common/tables/IItem";
|
||||||
import { ITemplateItem } from "../../eft/common/tables/ITemplateItem"
|
import { ITemplateItem } from "../../eft/common/tables/ITemplateItem";
|
||||||
|
|
||||||
export class GenerateWeaponResult
|
export class GenerateWeaponResult
|
||||||
{
|
{
|
||||||
weapon: Item[]
|
weapon: Item[];
|
||||||
chosenAmmoTpl: string
|
chosenAmmoTpl: string;
|
||||||
chosenUbglAmmoTpl: string
|
chosenUbglAmmoTpl: string;
|
||||||
weaponMods: Mods
|
weaponMods: Mods;
|
||||||
weaponTemplate: ITemplateItem
|
weaponTemplate: ITemplateItem;
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseConfig } from "./IBaseConfig"
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
|
||||||
export interface IHealthConfig extends IBaseConfig
|
export interface IHealthConfig extends IBaseConfig
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseConfig } from "./IBaseConfig"
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
|
||||||
export interface IHideoutConfig extends IBaseConfig
|
export interface IHideoutConfig extends IBaseConfig
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseConfig } from "./IBaseConfig"
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
|
||||||
export interface IHttpConfig extends IBaseConfig
|
export interface IHttpConfig extends IBaseConfig
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseConfig } from "./IBaseConfig"
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
|
||||||
export interface IInRaidConfig extends IBaseConfig
|
export interface IInRaidConfig extends IBaseConfig
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseConfig } from "./IBaseConfig"
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
|
||||||
export interface IInsuranceConfig extends IBaseConfig
|
export interface IInsuranceConfig extends IBaseConfig
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseConfig } from "./IBaseConfig"
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
|
||||||
export interface IItemConfig extends IBaseConfig
|
export interface IItemConfig extends IBaseConfig
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseConfig } from "./IBaseConfig"
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
|
||||||
export interface ILocaleConfig extends IBaseConfig
|
export interface ILocaleConfig extends IBaseConfig
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { MinMax } from "../../../models/common/MinMax"
|
import { MinMax } from "../../../models/common/MinMax";
|
||||||
import { IBaseConfig } from "./IBaseConfig"
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
|
||||||
export interface IRepairConfig extends IBaseConfig
|
export interface IRepairConfig extends IBaseConfig
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { MinMax } from "../../common/MinMax"
|
import { MinMax } from "../../common/MinMax";
|
||||||
import { IBaseConfig } from "./IBaseConfig"
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
|
||||||
|
|
||||||
export interface IScavCaseConfig extends IBaseConfig
|
export interface IScavCaseConfig extends IBaseConfig
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IBaseConfig } from "./IBaseConfig"
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
|
||||||
export interface ISeasonalEventConfig extends IBaseConfig
|
export interface ISeasonalEventConfig extends IBaseConfig
|
||||||
{
|
{
|
||||||
|
@ -3,49 +3,49 @@ import { ITemplateItem, Props } from "../../eft/common/tables/ITemplateItem";
|
|||||||
export abstract class NewItemDetailsBase
|
export abstract class NewItemDetailsBase
|
||||||
{
|
{
|
||||||
/** Price of the item on flea market */
|
/** Price of the item on flea market */
|
||||||
fleaPriceRoubles: number
|
fleaPriceRoubles: number;
|
||||||
|
|
||||||
/** Price of the item in the handbook */
|
/** Price of the item in the handbook */
|
||||||
handbookPriceRoubles: number
|
handbookPriceRoubles: number;
|
||||||
|
|
||||||
/** Handbook ParentId for the new item */
|
/** Handbook ParentId for the new item */
|
||||||
handbookParentId : string
|
handbookParentId : string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A dictionary for locale settings, key = langauge (e.g. en,cn,es-mx,jp,fr)
|
* A dictionary for locale settings, key = langauge (e.g. en,cn,es-mx,jp,fr)
|
||||||
* If a language is not included, the first item in the array will be used in its place
|
* If a language is not included, the first item in the array will be used in its place
|
||||||
*/
|
*/
|
||||||
locales: Record<string, LocaleDetails>
|
locales: Record<string, LocaleDetails>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NewItemFromCloneDetails extends NewItemDetailsBase
|
export class NewItemFromCloneDetails extends NewItemDetailsBase
|
||||||
{
|
{
|
||||||
/** Id of the item to copy and use as a base */
|
/** Id of the item to copy and use as a base */
|
||||||
itemTplToClone: string
|
itemTplToClone: string;
|
||||||
|
|
||||||
/** Item properties that should be applied over the top of the cloned base */
|
/** Item properties that should be applied over the top of the cloned base */
|
||||||
overrideProperties: Props
|
overrideProperties: Props;
|
||||||
|
|
||||||
/** ParentId for the new item (item type) */
|
/** ParentId for the new item (item type) */
|
||||||
parentId: string
|
parentId: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the id the new item should have, leave blank to have one generated for you
|
* the id the new item should have, leave blank to have one generated for you
|
||||||
* This is often known as the TplId, or TemplateId
|
* This is often known as the TplId, or TemplateId
|
||||||
*/
|
*/
|
||||||
newId = ""
|
newId = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NewItemDetails extends NewItemDetailsBase
|
export class NewItemDetails extends NewItemDetailsBase
|
||||||
{
|
{
|
||||||
newItem: ITemplateItem
|
newItem: ITemplateItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LocaleDetails
|
export class LocaleDetails
|
||||||
{
|
{
|
||||||
name: string
|
name: string;
|
||||||
shortName: string
|
shortName: string;
|
||||||
description: string
|
description: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateItemResult
|
export class CreateItemResult
|
||||||
@ -55,7 +55,7 @@ export class CreateItemResult
|
|||||||
this.success = false;
|
this.success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
success: boolean
|
success: boolean;
|
||||||
itemId: string
|
itemId: string;
|
||||||
errors: string[]
|
errors: string[];
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
import { ILocationBase } from "../../eft/common/ILocationBase"
|
import { ILocationBase } from "../../eft/common/ILocationBase";
|
||||||
import { ILooseLoot } from "../../eft/common/ILooseLoot"
|
import { ILooseLoot } from "../../eft/common/ILooseLoot";
|
||||||
import { ILocationsBase } from "../../eft/common/tables/ILocationsBase"
|
import { ILocationsBase } from "../../eft/common/tables/ILocationsBase";
|
||||||
|
|
||||||
export interface ILocations
|
export interface ILocations
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
export class LootItem
|
export class LootItem
|
||||||
{
|
{
|
||||||
id?: string
|
id?: string;
|
||||||
tpl: string
|
tpl: string;
|
||||||
isPreset: boolean
|
isPreset: boolean;
|
||||||
stackCount: number
|
stackCount: number;
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ export class ModCompilerService
|
|||||||
let fileExists = true; // does every js file exist (been compiled before)
|
let fileExists = true; // does every js file exist (been compiled before)
|
||||||
for (const file of modTypeScriptFiles)
|
for (const file of modTypeScriptFiles)
|
||||||
{
|
{
|
||||||
const fileContent = this.vfs.readFile(file)
|
const fileContent = this.vfs.readFile(file);
|
||||||
tsFileContents+= fileContent;
|
tsFileContents+= fileContent;
|
||||||
|
|
||||||
// Does equivalent .js file exist
|
// Does equivalent .js file exist
|
||||||
@ -69,7 +69,7 @@ export class ModCompilerService
|
|||||||
{
|
{
|
||||||
const tranOptions: TranspileOptions = {
|
const tranOptions: TranspileOptions = {
|
||||||
compilerOptions: options
|
compilerOptions: options
|
||||||
}
|
};
|
||||||
|
|
||||||
for (const filePath of fileNames)
|
for (const filePath of fileNames)
|
||||||
{
|
{
|
||||||
|
@ -2,9 +2,6 @@ import { inject, injectable } from "tsyringe";
|
|||||||
|
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||||
import { Common } from "../models/eft/common/tables/IBotBase";
|
import { Common } from "../models/eft/common/tables/IBotBase";
|
||||||
import {
|
|
||||||
IPlayerIncrementSkillLevelRequestData
|
|
||||||
} from "../models/eft/player/IPlayerIncrementSkillLevelRequestData";
|
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
import { LocalisationService } from "./LocalisationService";
|
import { LocalisationService } from "./LocalisationService";
|
||||||
|
@ -28,7 +28,7 @@ export class RagfairCategoriesService
|
|||||||
*/
|
*/
|
||||||
public getBespokeCategories(offers: IRagfairOffer[]): Record<string, number>
|
public getBespokeCategories(offers: IRagfairOffer[]): Record<string, number>
|
||||||
{
|
{
|
||||||
return this.processOffersIntoCategories(offers)
|
return this.processOffersIntoCategories(offers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,7 +18,7 @@ export class RagfairRequiredItemsService
|
|||||||
|
|
||||||
public getRequiredItemsById(searchId: string): any
|
public getRequiredItemsById(searchId: string): any
|
||||||
{
|
{
|
||||||
return this.requiredItemsCache[searchId] || []
|
return this.requiredItemsCache[searchId] || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildRequiredItemTable(): void
|
public buildRequiredItemTable(): void
|
||||||
|
@ -3,7 +3,7 @@ import { ICommand } from "../models/spt/utils/ICommand";
|
|||||||
|
|
||||||
export class AsyncQueue implements IAsyncQueue
|
export class AsyncQueue implements IAsyncQueue
|
||||||
{
|
{
|
||||||
protected commandsQueue: ICommand[]
|
protected commandsQueue: ICommand[];
|
||||||
|
|
||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
@ -23,7 +23,7 @@ export class AsyncQueue implements IAsyncQueue
|
|||||||
await new Promise<void>(resolve =>
|
await new Promise<void>(resolve =>
|
||||||
{
|
{
|
||||||
setTimeout(resolve, 100);
|
setTimeout(resolve, 100);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// When the command is ready, execute it
|
// When the command is ready, execute it
|
@ -44,9 +44,9 @@ export abstract class AbstractWinstonLogger implements ILogger
|
|||||||
cyanBG: "cyanBG",
|
cyanBG: "cyanBG",
|
||||||
whiteBG: "whiteBG"
|
whiteBG: "whiteBG"
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
protected logger: winston.Logger & SptLogger;
|
protected logger: winston.Logger & SptLogger;
|
||||||
protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise<void>
|
protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise<void>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected asyncQueue: IAsyncQueue,
|
protected asyncQueue: IAsyncQueue,
|
||||||
|
@ -7,7 +7,7 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
|||||||
import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
||||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { AsyncQueue } from "@spt-aki/utils/AyncQueue";
|
import { AsyncQueue } from "@spt-aki/utils/AsyncQueue";
|
||||||
import { DatabaseImporter } from "@spt-aki/utils/DatabaseImporter";
|
import { DatabaseImporter } from "@spt-aki/utils/DatabaseImporter";
|
||||||
import { EncodingUtil } from "@spt-aki/utils/EncodingUtil";
|
import { EncodingUtil } from "@spt-aki/utils/EncodingUtil";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
@ -22,7 +22,8 @@ import { VFS } from "@spt-aki/utils/VFS";
|
|||||||
import { MockHelper } from "./MockHelper";
|
import { MockHelper } from "./MockHelper";
|
||||||
import WinstonLogger from "./__mocks__/WinstonLogger";
|
import WinstonLogger from "./__mocks__/WinstonLogger";
|
||||||
|
|
||||||
export class TestHelper {
|
export class TestHelper
|
||||||
|
{
|
||||||
logger: ILogger;
|
logger: ILogger;
|
||||||
asyncQueue: AsyncQueue;
|
asyncQueue: AsyncQueue;
|
||||||
uuidGenerator: UUidGenerator;
|
uuidGenerator: UUidGenerator;
|
||||||
@ -44,7 +45,8 @@ export class TestHelper {
|
|||||||
itemBaseClassService: ItemBaseClassService;
|
itemBaseClassService: ItemBaseClassService;
|
||||||
botHelper: BotHelper;
|
botHelper: BotHelper;
|
||||||
|
|
||||||
public static async fetchTestHelper() {
|
public static async fetchTestHelper()
|
||||||
|
{
|
||||||
const initTestHelper = new TestHelper();
|
const initTestHelper = new TestHelper();
|
||||||
const mockHelper = new MockHelper();
|
const mockHelper = new MockHelper();
|
||||||
|
|
||||||
@ -60,10 +62,11 @@ export class TestHelper {
|
|||||||
initTestHelper.importerUtil
|
initTestHelper.importerUtil
|
||||||
);
|
);
|
||||||
await dbImporter.onLoad();
|
await dbImporter.onLoad();
|
||||||
return initTestHelper
|
return initTestHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor()
|
||||||
|
{
|
||||||
|
|
||||||
this.logger = new WinstonLogger();
|
this.logger = new WinstonLogger();
|
||||||
this.asyncQueue = new AsyncQueue();
|
this.asyncQueue = new AsyncQueue();
|
||||||
|
Loading…
Reference in New Issue
Block a user