torn-client 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +66 -2
- package/dist/index.d.ts +66 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1438,6 +1438,12 @@ type JobPositionLawEnum = "Law Student" | "Paralegal" | "Probate Lawyer" | "Tria
|
|
|
1438
1438
|
/** @category Models */
|
|
1439
1439
|
type JobPositionMedicalEnum = "Medical Student" | "Houseman" | "Senior Houseman" | "GP" | "Consultant" | "Surgeon" | "Brain Surgeon";
|
|
1440
1440
|
|
|
1441
|
+
/** @category Models */
|
|
1442
|
+
type KeyInfoAvailableLog = {
|
|
1443
|
+
category_id: LogCategoryId;
|
|
1444
|
+
log_ids: LogId[];
|
|
1445
|
+
};
|
|
1446
|
+
|
|
1441
1447
|
/** @category Models */
|
|
1442
1448
|
type KeyInfoResponse = {
|
|
1443
1449
|
info: {
|
|
@@ -1464,6 +1470,10 @@ type KeyInfoResponse = {
|
|
|
1464
1470
|
faction_id?: FactionId | unknown;
|
|
1465
1471
|
company: boolean;
|
|
1466
1472
|
company_id?: CompanyId | unknown;
|
|
1473
|
+
log: {
|
|
1474
|
+
custom_permissions: boolean;
|
|
1475
|
+
available: KeyInfoAvailableLog[];
|
|
1476
|
+
};
|
|
1467
1477
|
};
|
|
1468
1478
|
};
|
|
1469
1479
|
};
|
|
@@ -2194,6 +2204,11 @@ type PropertyLookupResponse = {
|
|
|
2194
2204
|
/** @category Models */
|
|
2195
2205
|
type PropertyModificationEnum = "Hot Tub" | "Sauna" | "Open Bar" | "Small Pool" | "Medium Pool" | "Large Pool" | "Small Vault" | "Medium Vault" | "Large Vault" | "Extra Large Vault" | "Medical Facility" | "Advanced Shooting Range" | "Airstrip" | "Private Yacht" | "Sufficient Interior Modification" | "Superior Interior Modification";
|
|
2196
2206
|
|
|
2207
|
+
/** @category Models */
|
|
2208
|
+
type PropertyPropertyResponse = {
|
|
2209
|
+
property: UserPropertyDetailsExtendedWithRent;
|
|
2210
|
+
};
|
|
2211
|
+
|
|
2197
2212
|
/** @category Models */
|
|
2198
2213
|
type PropertyResponse = UserPropertyResponse | PropertyLookupResponse | TimestampResponse;
|
|
2199
2214
|
|
|
@@ -3479,6 +3494,28 @@ type UserListResponse = {
|
|
|
3479
3494
|
_metadata: RequestMetadataWithLinks;
|
|
3480
3495
|
};
|
|
3481
3496
|
|
|
3497
|
+
/** @category Models */
|
|
3498
|
+
type UserLog = {
|
|
3499
|
+
id: UserLogId;
|
|
3500
|
+
timestamp: number;
|
|
3501
|
+
details: {
|
|
3502
|
+
id: LogId;
|
|
3503
|
+
title: string;
|
|
3504
|
+
category: string;
|
|
3505
|
+
};
|
|
3506
|
+
data: Record<string, unknown>;
|
|
3507
|
+
params: Record<string, unknown>;
|
|
3508
|
+
};
|
|
3509
|
+
|
|
3510
|
+
/** @category Models */
|
|
3511
|
+
type UserLogId = string;
|
|
3512
|
+
|
|
3513
|
+
/** @category Models */
|
|
3514
|
+
type UserLogsResponse = {
|
|
3515
|
+
log: UserLog[];
|
|
3516
|
+
_metadata: RequestMetadataWithLinks;
|
|
3517
|
+
};
|
|
3518
|
+
|
|
3482
3519
|
/** @category Models */
|
|
3483
3520
|
type UserLookupResponse = {
|
|
3484
3521
|
selections: UserSelectionName[];
|
|
@@ -3583,6 +3620,13 @@ type UserPropertyDetailsExtendedRented = UserPropertyBasicDetails & {
|
|
|
3583
3620
|
rented_by: BasicUser;
|
|
3584
3621
|
};
|
|
3585
3622
|
|
|
3623
|
+
/** @category Models */
|
|
3624
|
+
type UserPropertyDetailsExtendedWithRent = UserPropertyBasicDetails & {
|
|
3625
|
+
used_by: BasicUser[];
|
|
3626
|
+
status: "none" | "in_use";
|
|
3627
|
+
rented_by?: BasicUser;
|
|
3628
|
+
};
|
|
3629
|
+
|
|
3586
3630
|
/** @category Models */
|
|
3587
3631
|
type UserPropertyResponse = {
|
|
3588
3632
|
property: UserPropertyDetails;
|
|
@@ -3668,6 +3712,7 @@ declare class FactionEndpoint {
|
|
|
3668
3712
|
* @param params - Optional query parameters
|
|
3669
3713
|
*/
|
|
3670
3714
|
attacks(params?: {
|
|
3715
|
+
filters?: "incoming" | "outgoing";
|
|
3671
3716
|
limit?: number;
|
|
3672
3717
|
sort?: "DESC" | "ASC";
|
|
3673
3718
|
to?: number;
|
|
@@ -3679,6 +3724,7 @@ declare class FactionEndpoint {
|
|
|
3679
3724
|
* @param params - Optional query parameters
|
|
3680
3725
|
*/
|
|
3681
3726
|
attacksfull(params?: {
|
|
3727
|
+
filters?: "incoming" | "outgoing";
|
|
3682
3728
|
limit?: number;
|
|
3683
3729
|
sort?: "DESC" | "ASC";
|
|
3684
3730
|
to?: number;
|
|
@@ -3825,6 +3871,7 @@ declare class FactionEndpoint {
|
|
|
3825
3871
|
* @param params - Optional query parameters
|
|
3826
3872
|
*/
|
|
3827
3873
|
revives(params?: {
|
|
3874
|
+
filters?: "incoming" | "outgoing";
|
|
3828
3875
|
limit?: number;
|
|
3829
3876
|
sort?: "DESC" | "ASC";
|
|
3830
3877
|
to?: number;
|
|
@@ -3837,6 +3884,7 @@ declare class FactionEndpoint {
|
|
|
3837
3884
|
* @param params - Optional query parameters
|
|
3838
3885
|
*/
|
|
3839
3886
|
revivesfull(params?: {
|
|
3887
|
+
filters?: "incoming" | "outgoing";
|
|
3840
3888
|
limit?: number;
|
|
3841
3889
|
sort?: "DESC" | "ASC";
|
|
3842
3890
|
to?: number;
|
|
@@ -4418,7 +4466,7 @@ declare class PropertyIdContext {
|
|
|
4418
4466
|
*/
|
|
4419
4467
|
get(params?: {
|
|
4420
4468
|
timestamp?: string;
|
|
4421
|
-
}): Promise<
|
|
4469
|
+
}): Promise<PropertyPropertyResponse>;
|
|
4422
4470
|
}
|
|
4423
4471
|
|
|
4424
4472
|
/**
|
|
@@ -4764,6 +4812,7 @@ declare class UserEndpoint {
|
|
|
4764
4812
|
* @param params - Optional query parameters
|
|
4765
4813
|
*/
|
|
4766
4814
|
attacks(params?: {
|
|
4815
|
+
filters?: "incoming" | "outgoing";
|
|
4767
4816
|
limit?: number;
|
|
4768
4817
|
sort?: "DESC" | "ASC";
|
|
4769
4818
|
to?: number;
|
|
@@ -4775,6 +4824,7 @@ declare class UserEndpoint {
|
|
|
4775
4824
|
* @param params - Optional query parameters
|
|
4776
4825
|
*/
|
|
4777
4826
|
attacksfull(params?: {
|
|
4827
|
+
filters?: "incoming" | "outgoing";
|
|
4778
4828
|
limit?: number;
|
|
4779
4829
|
sort?: "DESC" | "ASC";
|
|
4780
4830
|
to?: number;
|
|
@@ -4893,6 +4943,18 @@ declare class UserEndpoint {
|
|
|
4893
4943
|
sort?: "DESC" | "ASC";
|
|
4894
4944
|
timestamp?: string;
|
|
4895
4945
|
}): Promise<PaginatedResponse<UserListResponse> & UserListResponse>;
|
|
4946
|
+
/**
|
|
4947
|
+
* Get your logs
|
|
4948
|
+
* @param params - Optional query parameters
|
|
4949
|
+
*/
|
|
4950
|
+
log(params?: {
|
|
4951
|
+
log?: LogId[];
|
|
4952
|
+
cat?: LogCategoryId;
|
|
4953
|
+
limit?: number;
|
|
4954
|
+
to?: number;
|
|
4955
|
+
from?: number;
|
|
4956
|
+
timestamp?: string;
|
|
4957
|
+
}): Promise<PaginatedResponse<UserLogsResponse> & UserLogsResponse>;
|
|
4896
4958
|
/**
|
|
4897
4959
|
* Get your current ongoing organized crime
|
|
4898
4960
|
* @param params - Optional query parameters
|
|
@@ -4960,6 +5022,7 @@ declare class UserEndpoint {
|
|
|
4960
5022
|
* @param params - Optional query parameters
|
|
4961
5023
|
*/
|
|
4962
5024
|
revives(params?: {
|
|
5025
|
+
filters?: "incoming" | "outgoing";
|
|
4963
5026
|
limit?: number;
|
|
4964
5027
|
sort?: "DESC" | "ASC";
|
|
4965
5028
|
to?: number;
|
|
@@ -4972,6 +5035,7 @@ declare class UserEndpoint {
|
|
|
4972
5035
|
* @param params - Optional query parameters
|
|
4973
5036
|
*/
|
|
4974
5037
|
revivesfull(params?: {
|
|
5038
|
+
filters?: "incoming" | "outgoing";
|
|
4975
5039
|
limit?: number;
|
|
4976
5040
|
sort?: "DESC" | "ASC";
|
|
4977
5041
|
to?: number;
|
|
@@ -5244,4 +5308,4 @@ declare class TornRateLimitError extends Error {
|
|
|
5244
5308
|
constructor(message: string);
|
|
5245
5309
|
}
|
|
5246
5310
|
|
|
5247
|
-
export { type AmmoId, type ApiKeyAccessTypeEnum, type ApiKeyBalancing, type Attack, type AttackActionEnum, type AttackCode, type AttackFinishingHitEffect, type AttackId, type AttackLog, type AttackLogResponse, type AttackLogSummary, type AttackPlayer, type AttackPlayerFaction, type AttackPlayerSimplified, type AttackSimplified, type AttackingFinishingHitEffects, type BasicProperty, type BasicUser, type Bazaar, type BazaarAdvancedItemSales, type BazaarBargainSales, type BazaarBulkSales, type BazaarDollarSales, type BazaarRecentFavorites, type BazaarResponse, type BazaarResponseSpecialized, type BazaarSpecialized, type BazaarTotalFavorites, type BazaarWeekly, type BazaarWeeklyCustomers, type BazaarWeeklyIncome, type Bounty, type ChainId, type CompanyId, type CountryEnum, type DirtyBombId, type EducationId, type Faction, type FactionApplication, type FactionApplicationStatusEnum, type FactionApplicationsResponse, type FactionAttackResult, type FactionAttacksFullResponse, type FactionAttacksResponse, type FactionBalance, type FactionBalanceResponse, type FactionBasic, type FactionBasicResponse, type FactionBranchDetails, type FactionBranchId, type FactionBranchStateEnum, type FactionChain, FactionChainIdContext, type FactionChainReport, type FactionChainReportAttacker, type FactionChainReportAttackerAttacks, type FactionChainReportAttackerRespect, type FactionChainReportBonus, type FactionChainReportDetails, type FactionChainReportResponse, type FactionChainWarfare, type FactionChainsResponse, type FactionContributor, type FactionContributorsResponse, type FactionCrime, type FactionCrimeId, FactionCrimeIdContext, type FactionCrimeResponse, type FactionCrimeReward, type FactionCrimeRewardItem, type FactionCrimeRewardPayout, type FactionCrimeSlot, type FactionCrimeStatusEnum, type FactionCrimeUser, type FactionCrimeUserOutcome, type FactionCrimesResponse, FactionEndpoint, type FactionHofResponse, type FactionHofStats, type FactionHofValues, type FactionId, FactionIdContext, type FactionLookupResponse, type FactionMember, type FactionMembersResponse, type FactionNews, type FactionNewsCategory, type FactionNewsResponse, type FactionOngoingChain, type FactionOngoingChainResponse, type FactionOrganizedCrimePayoutType, type FactionPact, type FactionPosition, type FactionPositionAbilityEnum, type FactionPositionsResponse, type FactionRacketsResponse, type FactionRaidReport, type FactionRaidReportAttacker, type FactionRaidReportFaction, type FactionRaidReportUser, type FactionRaidWar, FactionRaidWarIdContext, type FactionRaidWarParticipant, type FactionRaidWarReportResponse, type FactionRaidWarfare, type FactionRaidWarfareFaction, type FactionRaidsResponse, type FactionRank, type FactionRankEnum, type FactionRankedWar, type FactionRankedWarDetails, FactionRankedWarIdContext, type FactionRankedWarParticipant, type FactionRankedWarReportResponse, type FactionRankedWarResponse, type FactionRankedWarsCategoryEnum, type FactionResponse, type FactionSearch, type FactionSearchLeader, type FactionSearchResponse, type FactionSelectionName, type FactionStat, type FactionStatEnum, type FactionStatsResponse, type FactionTerritoriesOwnershipResponse, type FactionTerritoriesResponse, type FactionTerritory, type FactionTerritoryEnum, type FactionTerritoryOwnership, type FactionTerritoryWar, type FactionTerritoryWarFaction, type FactionTerritoryWarFactionWallPlayers, type FactionTerritoryWarFinished, type FactionTerritoryWarFinishedFaction, FactionTerritoryWarIdContext, type FactionTerritoryWarOngoing, type FactionTerritoryWarOngoingFaction, type FactionTerritoryWarParticipant, type FactionTerritoryWarReport, type FactionTerritoryWarReportFaction, type FactionTerritoryWarReportMembers, type FactionTerritoryWarReportResponse, type FactionTerritoryWarResultEnum, type FactionTerritoryWarfare, type FactionTerritoryWarsCategoryEnum, type FactionTerritoryWarsHistoryResponse, type FactionTerritoryWarsResponse, type FactionUpgradeDetails, type FactionUpgrades, type FactionUpgradesResponse, type FactionWarfareDirtyBomb, type FactionWarfareDirtyBombPlanter, type FactionWarfareDirtyBombTargetFaction, type FactionWarfareResponse, type FactionWarfareTypeEnum, type FactionWars, type FactionWarsResponse, type ForumCategoriesResponse, ForumCategoryIdsContext, ForumEndpoint, type ForumFeed, type ForumFeedTypeEnum, type ForumId, type ForumLookupResponse, type ForumPoll, type ForumPollVote, type ForumPost, type ForumPostId, type ForumPostsResponse, type ForumResponse, type ForumSelectionName, type ForumSubscribedThread, type ForumSubscribedThreadPostsCount, type ForumThreadAuthor, type ForumThreadBase, type ForumThreadExtended, type ForumThreadId, ForumThreadIdContext, type ForumThreadResponse, type ForumThreadUserExtended, type ForumThreadsResponse, type HofValue, type HofValueFloat, type HofValueString, type ItemId, type ItemMarket, type ItemMarketItem, type ItemMarketListingItemBonus, type ItemMarketListingItemDetails, type ItemMarketListingItemStats, type ItemMarketListingNonstackable, type ItemMarketListingStackable, type ItemModId, type ItemUid, type JobPositionArmyEnum, type JobPositionCasinoEnum, type JobPositionEducationEnum, type JobPositionGrocerEnum, type JobPositionLawEnum, type JobPositionMedicalEnum, KeyEndpoint, type KeyInfoResponse, type KeyLogResponse, type KeyResponse, type KeySelectionName, type LogCategoryId, type LogId, MarketEndpoint, MarketIdContext, type MarketItemMarketResponse, type MarketLookupResponse, type MarketPropertiesResponse, type MarketPropertyDetails, MarketPropertyTypeIdContext, type MarketRentalDetails, type MarketRentalsResponse, type MarketResponse, type MarketSelectionName, type MarketSpecializedBazaarCategoryEnum, type OrganizedCrimeName, PaginatedResponse, type Parameters, type PersonalStatsAttackingExtended, type PersonalStatsAttackingPopular, type PersonalStatsAttackingPublic, type PersonalStatsBattleStats, type PersonalStatsBounties, type PersonalStatsCategoryEnum, type PersonalStatsCommunication, type PersonalStatsCrimes, type PersonalStatsCrimesPopular, type PersonalStatsCrimesV1, type PersonalStatsCrimesV2, type PersonalStatsDrugs, type PersonalStatsFinishingHits, type PersonalStatsHistoricStat, type PersonalStatsHospital, type PersonalStatsHospitalPopular, type PersonalStatsInvestments, type PersonalStatsItems, type PersonalStatsItemsPopular, type PersonalStatsJail, type PersonalStatsJobsExtended, type PersonalStatsJobsPublic, type PersonalStatsMissions, type PersonalStatsNetworthExtended, type PersonalStatsNetworthPublic, type PersonalStatsOther, type PersonalStatsOtherPopular, type PersonalStatsRacing, type PersonalStatsStatName, type PersonalStatsTrading, type PersonalStatsTravel, type PersonalStatsTravelPopular, PropertyEndpoint, type PropertyId, PropertyIdContext, type PropertyLookupResponse, type PropertyModificationEnum, type PropertyResponse, type PropertySelectionName, type PropertyStaffEnum, type PropertyTypeId, type Race, type RaceCar, type RaceCarId, type RaceCarUpgrade, type RaceCarUpgradeCategory, type RaceCarUpgradeId, type RaceCarUpgradeSubCategory, type RaceClassEnum, type RaceId, type RaceRecord, type RaceStatusEnum, type RaceTrack, type RaceTrackId, type RacerDetails, type RacingCarUpgradesResponse, type RacingCarsResponse, RacingEndpoint, type RacingLookupResponse, type RacingRaceDetails, type RacingRaceDetailsResponse, RacingRaceIdContext, type RacingRaceTypeEnum, type RacingRacesResponse, type RacingResponse, type RacingSelectionName, RacingTrackIdContext, type RacingTrackRecordsResponse, type RacingTracksResponse, type RaidWarId, type RankedWarId, type RateLimitMode, type Report, type ReportAnonymousBounties, type ReportBase, type ReportCompanyFinancials, type ReportFriendOrFoe, type ReportFriendOrFoeUser, type ReportHistory, type ReportHistoryCompany, type ReportHistoryFaction, type ReportInvestment, type ReportMoney, type ReportMostWanted, type ReportReport, type ReportStats, type ReportStockAnalysis, type ReportTrueLevel, type ReportTypeEnum, type ReportWarrantDetails, type ReportsResponse, type RequestLinks, type RequestMetadata, type RequestMetadataWithLinks, type RequestMetadataWithLinksAndTotal, type Requester, type Revive, type ReviveId, type ReviveSetting, type ReviveSimplified, type RevivesFullResponse, type RevivesResponse, type SelectionCategoryEnum, type TerritoryWarId, type TimestampResponse, TornAPI, type TornAPIOptions, TornApiError, type TornBountiesResponse, type TornCalendarActivity, type TornCalendarResponse, type TornCrime, type TornCrimeId, TornCrimeIdContext, type TornCrimesResponse, type TornEducation, type TornEducationCourses, type TornEducationPrerequisites, type TornEducationResponse, type TornEducationRewards, TornEndpoint, type TornFactionHof, type TornFactionHofCategory, type TornFactionHofResponse, type TornFactionTree, type TornFactionTreeBranch, type TornFactionTreeResponse, type TornHof, type TornHofBasic, type TornHofCategory, type TornHofResponse, type TornHofWithOffenses, TornIdsContext, type TornItem, type TornItemAmmo, type TornItemAmmoResponse, type TornItemAmmoTypeEnum, type TornItemArmorCoverage, type TornItemArmorCoveragePartEnum, type TornItemArmorDetails, type TornItemBaseStats, type TornItemCategory, type TornItemMods, type TornItemModsResponse, type TornItemTypeEnum, type TornItemWeaponCategoryEnum, type TornItemWeaponDetails, type TornItemWeaponTypeEnum, type TornItemsResponse, type TornLog, type TornLogCategoriesResponse, type TornLogCategory, TornLogCategoryIdContext, type TornLogTypesResponse, type TornLookupResponse, type TornOrganizedCrime, type TornOrganizedCrimePositionId, type TornOrganizedCrimeRequiredItem, type TornOrganizedCrimeResponse, type TornOrganizedCrimeScope, type TornOrganizedCrimeSlot, type TornOrganizedCrimeSpawn, type TornProperties, type TornRacket, type TornRacketReward, type TornRacketType, TornRateLimitError, type TornResponse, type TornSelectionName, type TornSubcrime, type TornSubcrimesResponse, type TornTerritoriesNoLinksResponse, type TornTerritoriesResponse, type TornTerritory, type TornTerritoryCoordinates, type User, type UserBountiesResponse, type UserCalendar, type UserCalendarResponse, type UserCrime, type UserCrimeAttempts, type UserCrimeDetailsBootlegging, type UserCrimeDetailsCardSkimming, type UserCrimeDetailsCracking, type UserCrimeDetailsGraffiti, type UserCrimeDetailsHustling, type UserCrimeDetailsScamming, type UserCrimeDetailsShoplifting, UserCrimeIdContext, type UserCrimeRewardAmmo, type UserCrimeRewardItem, type UserCrimeRewards, type UserCrimeUniques, type UserCrimeUniquesReward, type UserCrimeUniquesRewardAmmo, type UserCrimeUniquesRewardAmmoEnum, type UserCrimeUniquesRewardMoney, type UserCrimesResponse, type UserCurrentEducation, type UserEducation, type UserEducationResponse, UserEndpoint, type UserEnlistedCarsResponse, type UserFactionBalance, type UserFactionBalanceResponse, type UserForumFeedResponse, type UserForumFriendsResponse, type UserForumPostsResponse, type UserForumSubscribedThreadsResponse, type UserForumThreadsResponse, type UserHofResponse, type UserHofStats, type UserId, UserIdContext, type UserItemMarkeListingItemDetails, type UserItemMarketListing, type UserItemMarketResponse, type UserJobRanks, type UserJobRanksResponse, type UserLastAction, type UserList, type UserListEnum, type UserListResponse, type UserLookupResponse, type UserOrganizedCrimeResponse, type UserPersonalStatsCategory, type UserPersonalStatsFull, type UserPersonalStatsFullPublic, type UserPersonalStatsHistoric, type UserPersonalStatsPopular, type UserPersonalStatsResponse, type UserPropertiesResponse, type UserPropertyBasicDetails, type UserPropertyDetails, type UserPropertyDetailsExtended, type UserPropertyDetailsExtendedForRent, type UserPropertyDetailsExtendedForSale, type UserPropertyDetailsExtendedRented, type UserPropertyResponse, type UserRaceCarDetails, type UserRacesResponse, type UserRacingRecordsResponse, type UserResponse, type UserSelectionName, type UserStatus, type UserSubcrime, type WeaponBonusEnum };
|
|
5311
|
+
export { type AmmoId, type ApiKeyAccessTypeEnum, type ApiKeyBalancing, type Attack, type AttackActionEnum, type AttackCode, type AttackFinishingHitEffect, type AttackId, type AttackLog, type AttackLogResponse, type AttackLogSummary, type AttackPlayer, type AttackPlayerFaction, type AttackPlayerSimplified, type AttackSimplified, type AttackingFinishingHitEffects, type BasicProperty, type BasicUser, type Bazaar, type BazaarAdvancedItemSales, type BazaarBargainSales, type BazaarBulkSales, type BazaarDollarSales, type BazaarRecentFavorites, type BazaarResponse, type BazaarResponseSpecialized, type BazaarSpecialized, type BazaarTotalFavorites, type BazaarWeekly, type BazaarWeeklyCustomers, type BazaarWeeklyIncome, type Bounty, type ChainId, type CompanyId, type CountryEnum, type DirtyBombId, type EducationId, type Faction, type FactionApplication, type FactionApplicationStatusEnum, type FactionApplicationsResponse, type FactionAttackResult, type FactionAttacksFullResponse, type FactionAttacksResponse, type FactionBalance, type FactionBalanceResponse, type FactionBasic, type FactionBasicResponse, type FactionBranchDetails, type FactionBranchId, type FactionBranchStateEnum, type FactionChain, FactionChainIdContext, type FactionChainReport, type FactionChainReportAttacker, type FactionChainReportAttackerAttacks, type FactionChainReportAttackerRespect, type FactionChainReportBonus, type FactionChainReportDetails, type FactionChainReportResponse, type FactionChainWarfare, type FactionChainsResponse, type FactionContributor, type FactionContributorsResponse, type FactionCrime, type FactionCrimeId, FactionCrimeIdContext, type FactionCrimeResponse, type FactionCrimeReward, type FactionCrimeRewardItem, type FactionCrimeRewardPayout, type FactionCrimeSlot, type FactionCrimeStatusEnum, type FactionCrimeUser, type FactionCrimeUserOutcome, type FactionCrimesResponse, FactionEndpoint, type FactionHofResponse, type FactionHofStats, type FactionHofValues, type FactionId, FactionIdContext, type FactionLookupResponse, type FactionMember, type FactionMembersResponse, type FactionNews, type FactionNewsCategory, type FactionNewsResponse, type FactionOngoingChain, type FactionOngoingChainResponse, type FactionOrganizedCrimePayoutType, type FactionPact, type FactionPosition, type FactionPositionAbilityEnum, type FactionPositionsResponse, type FactionRacketsResponse, type FactionRaidReport, type FactionRaidReportAttacker, type FactionRaidReportFaction, type FactionRaidReportUser, type FactionRaidWar, FactionRaidWarIdContext, type FactionRaidWarParticipant, type FactionRaidWarReportResponse, type FactionRaidWarfare, type FactionRaidWarfareFaction, type FactionRaidsResponse, type FactionRank, type FactionRankEnum, type FactionRankedWar, type FactionRankedWarDetails, FactionRankedWarIdContext, type FactionRankedWarParticipant, type FactionRankedWarReportResponse, type FactionRankedWarResponse, type FactionRankedWarsCategoryEnum, type FactionResponse, type FactionSearch, type FactionSearchLeader, type FactionSearchResponse, type FactionSelectionName, type FactionStat, type FactionStatEnum, type FactionStatsResponse, type FactionTerritoriesOwnershipResponse, type FactionTerritoriesResponse, type FactionTerritory, type FactionTerritoryEnum, type FactionTerritoryOwnership, type FactionTerritoryWar, type FactionTerritoryWarFaction, type FactionTerritoryWarFactionWallPlayers, type FactionTerritoryWarFinished, type FactionTerritoryWarFinishedFaction, FactionTerritoryWarIdContext, type FactionTerritoryWarOngoing, type FactionTerritoryWarOngoingFaction, type FactionTerritoryWarParticipant, type FactionTerritoryWarReport, type FactionTerritoryWarReportFaction, type FactionTerritoryWarReportMembers, type FactionTerritoryWarReportResponse, type FactionTerritoryWarResultEnum, type FactionTerritoryWarfare, type FactionTerritoryWarsCategoryEnum, type FactionTerritoryWarsHistoryResponse, type FactionTerritoryWarsResponse, type FactionUpgradeDetails, type FactionUpgrades, type FactionUpgradesResponse, type FactionWarfareDirtyBomb, type FactionWarfareDirtyBombPlanter, type FactionWarfareDirtyBombTargetFaction, type FactionWarfareResponse, type FactionWarfareTypeEnum, type FactionWars, type FactionWarsResponse, type ForumCategoriesResponse, ForumCategoryIdsContext, ForumEndpoint, type ForumFeed, type ForumFeedTypeEnum, type ForumId, type ForumLookupResponse, type ForumPoll, type ForumPollVote, type ForumPost, type ForumPostId, type ForumPostsResponse, type ForumResponse, type ForumSelectionName, type ForumSubscribedThread, type ForumSubscribedThreadPostsCount, type ForumThreadAuthor, type ForumThreadBase, type ForumThreadExtended, type ForumThreadId, ForumThreadIdContext, type ForumThreadResponse, type ForumThreadUserExtended, type ForumThreadsResponse, type HofValue, type HofValueFloat, type HofValueString, type ItemId, type ItemMarket, type ItemMarketItem, type ItemMarketListingItemBonus, type ItemMarketListingItemDetails, type ItemMarketListingItemStats, type ItemMarketListingNonstackable, type ItemMarketListingStackable, type ItemModId, type ItemUid, type JobPositionArmyEnum, type JobPositionCasinoEnum, type JobPositionEducationEnum, type JobPositionGrocerEnum, type JobPositionLawEnum, type JobPositionMedicalEnum, KeyEndpoint, type KeyInfoAvailableLog, type KeyInfoResponse, type KeyLogResponse, type KeyResponse, type KeySelectionName, type LogCategoryId, type LogId, MarketEndpoint, MarketIdContext, type MarketItemMarketResponse, type MarketLookupResponse, type MarketPropertiesResponse, type MarketPropertyDetails, MarketPropertyTypeIdContext, type MarketRentalDetails, type MarketRentalsResponse, type MarketResponse, type MarketSelectionName, type MarketSpecializedBazaarCategoryEnum, type OrganizedCrimeName, PaginatedResponse, type Parameters, type PersonalStatsAttackingExtended, type PersonalStatsAttackingPopular, type PersonalStatsAttackingPublic, type PersonalStatsBattleStats, type PersonalStatsBounties, type PersonalStatsCategoryEnum, type PersonalStatsCommunication, type PersonalStatsCrimes, type PersonalStatsCrimesPopular, type PersonalStatsCrimesV1, type PersonalStatsCrimesV2, type PersonalStatsDrugs, type PersonalStatsFinishingHits, type PersonalStatsHistoricStat, type PersonalStatsHospital, type PersonalStatsHospitalPopular, type PersonalStatsInvestments, type PersonalStatsItems, type PersonalStatsItemsPopular, type PersonalStatsJail, type PersonalStatsJobsExtended, type PersonalStatsJobsPublic, type PersonalStatsMissions, type PersonalStatsNetworthExtended, type PersonalStatsNetworthPublic, type PersonalStatsOther, type PersonalStatsOtherPopular, type PersonalStatsRacing, type PersonalStatsStatName, type PersonalStatsTrading, type PersonalStatsTravel, type PersonalStatsTravelPopular, PropertyEndpoint, type PropertyId, PropertyIdContext, type PropertyLookupResponse, type PropertyModificationEnum, type PropertyPropertyResponse, type PropertyResponse, type PropertySelectionName, type PropertyStaffEnum, type PropertyTypeId, type Race, type RaceCar, type RaceCarId, type RaceCarUpgrade, type RaceCarUpgradeCategory, type RaceCarUpgradeId, type RaceCarUpgradeSubCategory, type RaceClassEnum, type RaceId, type RaceRecord, type RaceStatusEnum, type RaceTrack, type RaceTrackId, type RacerDetails, type RacingCarUpgradesResponse, type RacingCarsResponse, RacingEndpoint, type RacingLookupResponse, type RacingRaceDetails, type RacingRaceDetailsResponse, RacingRaceIdContext, type RacingRaceTypeEnum, type RacingRacesResponse, type RacingResponse, type RacingSelectionName, RacingTrackIdContext, type RacingTrackRecordsResponse, type RacingTracksResponse, type RaidWarId, type RankedWarId, type RateLimitMode, type Report, type ReportAnonymousBounties, type ReportBase, type ReportCompanyFinancials, type ReportFriendOrFoe, type ReportFriendOrFoeUser, type ReportHistory, type ReportHistoryCompany, type ReportHistoryFaction, type ReportInvestment, type ReportMoney, type ReportMostWanted, type ReportReport, type ReportStats, type ReportStockAnalysis, type ReportTrueLevel, type ReportTypeEnum, type ReportWarrantDetails, type ReportsResponse, type RequestLinks, type RequestMetadata, type RequestMetadataWithLinks, type RequestMetadataWithLinksAndTotal, type Requester, type Revive, type ReviveId, type ReviveSetting, type ReviveSimplified, type RevivesFullResponse, type RevivesResponse, type SelectionCategoryEnum, type TerritoryWarId, type TimestampResponse, TornAPI, type TornAPIOptions, TornApiError, type TornBountiesResponse, type TornCalendarActivity, type TornCalendarResponse, type TornCrime, type TornCrimeId, TornCrimeIdContext, type TornCrimesResponse, type TornEducation, type TornEducationCourses, type TornEducationPrerequisites, type TornEducationResponse, type TornEducationRewards, TornEndpoint, type TornFactionHof, type TornFactionHofCategory, type TornFactionHofResponse, type TornFactionTree, type TornFactionTreeBranch, type TornFactionTreeResponse, type TornHof, type TornHofBasic, type TornHofCategory, type TornHofResponse, type TornHofWithOffenses, TornIdsContext, type TornItem, type TornItemAmmo, type TornItemAmmoResponse, type TornItemAmmoTypeEnum, type TornItemArmorCoverage, type TornItemArmorCoveragePartEnum, type TornItemArmorDetails, type TornItemBaseStats, type TornItemCategory, type TornItemMods, type TornItemModsResponse, type TornItemTypeEnum, type TornItemWeaponCategoryEnum, type TornItemWeaponDetails, type TornItemWeaponTypeEnum, type TornItemsResponse, type TornLog, type TornLogCategoriesResponse, type TornLogCategory, TornLogCategoryIdContext, type TornLogTypesResponse, type TornLookupResponse, type TornOrganizedCrime, type TornOrganizedCrimePositionId, type TornOrganizedCrimeRequiredItem, type TornOrganizedCrimeResponse, type TornOrganizedCrimeScope, type TornOrganizedCrimeSlot, type TornOrganizedCrimeSpawn, type TornProperties, type TornRacket, type TornRacketReward, type TornRacketType, TornRateLimitError, type TornResponse, type TornSelectionName, type TornSubcrime, type TornSubcrimesResponse, type TornTerritoriesNoLinksResponse, type TornTerritoriesResponse, type TornTerritory, type TornTerritoryCoordinates, type User, type UserBountiesResponse, type UserCalendar, type UserCalendarResponse, type UserCrime, type UserCrimeAttempts, type UserCrimeDetailsBootlegging, type UserCrimeDetailsCardSkimming, type UserCrimeDetailsCracking, type UserCrimeDetailsGraffiti, type UserCrimeDetailsHustling, type UserCrimeDetailsScamming, type UserCrimeDetailsShoplifting, UserCrimeIdContext, type UserCrimeRewardAmmo, type UserCrimeRewardItem, type UserCrimeRewards, type UserCrimeUniques, type UserCrimeUniquesReward, type UserCrimeUniquesRewardAmmo, type UserCrimeUniquesRewardAmmoEnum, type UserCrimeUniquesRewardMoney, type UserCrimesResponse, type UserCurrentEducation, type UserEducation, type UserEducationResponse, UserEndpoint, type UserEnlistedCarsResponse, type UserFactionBalance, type UserFactionBalanceResponse, type UserForumFeedResponse, type UserForumFriendsResponse, type UserForumPostsResponse, type UserForumSubscribedThreadsResponse, type UserForumThreadsResponse, type UserHofResponse, type UserHofStats, type UserId, UserIdContext, type UserItemMarkeListingItemDetails, type UserItemMarketListing, type UserItemMarketResponse, type UserJobRanks, type UserJobRanksResponse, type UserLastAction, type UserList, type UserListEnum, type UserListResponse, type UserLog, type UserLogId, type UserLogsResponse, type UserLookupResponse, type UserOrganizedCrimeResponse, type UserPersonalStatsCategory, type UserPersonalStatsFull, type UserPersonalStatsFullPublic, type UserPersonalStatsHistoric, type UserPersonalStatsPopular, type UserPersonalStatsResponse, type UserPropertiesResponse, type UserPropertyBasicDetails, type UserPropertyDetails, type UserPropertyDetailsExtended, type UserPropertyDetailsExtendedForRent, type UserPropertyDetailsExtendedForSale, type UserPropertyDetailsExtendedRented, type UserPropertyDetailsExtendedWithRent, type UserPropertyResponse, type UserRaceCarDetails, type UserRacesResponse, type UserRacingRecordsResponse, type UserResponse, type UserSelectionName, type UserStatus, type UserSubcrime, type WeaponBonusEnum };
|
package/dist/index.d.ts
CHANGED
|
@@ -1438,6 +1438,12 @@ type JobPositionLawEnum = "Law Student" | "Paralegal" | "Probate Lawyer" | "Tria
|
|
|
1438
1438
|
/** @category Models */
|
|
1439
1439
|
type JobPositionMedicalEnum = "Medical Student" | "Houseman" | "Senior Houseman" | "GP" | "Consultant" | "Surgeon" | "Brain Surgeon";
|
|
1440
1440
|
|
|
1441
|
+
/** @category Models */
|
|
1442
|
+
type KeyInfoAvailableLog = {
|
|
1443
|
+
category_id: LogCategoryId;
|
|
1444
|
+
log_ids: LogId[];
|
|
1445
|
+
};
|
|
1446
|
+
|
|
1441
1447
|
/** @category Models */
|
|
1442
1448
|
type KeyInfoResponse = {
|
|
1443
1449
|
info: {
|
|
@@ -1464,6 +1470,10 @@ type KeyInfoResponse = {
|
|
|
1464
1470
|
faction_id?: FactionId | unknown;
|
|
1465
1471
|
company: boolean;
|
|
1466
1472
|
company_id?: CompanyId | unknown;
|
|
1473
|
+
log: {
|
|
1474
|
+
custom_permissions: boolean;
|
|
1475
|
+
available: KeyInfoAvailableLog[];
|
|
1476
|
+
};
|
|
1467
1477
|
};
|
|
1468
1478
|
};
|
|
1469
1479
|
};
|
|
@@ -2194,6 +2204,11 @@ type PropertyLookupResponse = {
|
|
|
2194
2204
|
/** @category Models */
|
|
2195
2205
|
type PropertyModificationEnum = "Hot Tub" | "Sauna" | "Open Bar" | "Small Pool" | "Medium Pool" | "Large Pool" | "Small Vault" | "Medium Vault" | "Large Vault" | "Extra Large Vault" | "Medical Facility" | "Advanced Shooting Range" | "Airstrip" | "Private Yacht" | "Sufficient Interior Modification" | "Superior Interior Modification";
|
|
2196
2206
|
|
|
2207
|
+
/** @category Models */
|
|
2208
|
+
type PropertyPropertyResponse = {
|
|
2209
|
+
property: UserPropertyDetailsExtendedWithRent;
|
|
2210
|
+
};
|
|
2211
|
+
|
|
2197
2212
|
/** @category Models */
|
|
2198
2213
|
type PropertyResponse = UserPropertyResponse | PropertyLookupResponse | TimestampResponse;
|
|
2199
2214
|
|
|
@@ -3479,6 +3494,28 @@ type UserListResponse = {
|
|
|
3479
3494
|
_metadata: RequestMetadataWithLinks;
|
|
3480
3495
|
};
|
|
3481
3496
|
|
|
3497
|
+
/** @category Models */
|
|
3498
|
+
type UserLog = {
|
|
3499
|
+
id: UserLogId;
|
|
3500
|
+
timestamp: number;
|
|
3501
|
+
details: {
|
|
3502
|
+
id: LogId;
|
|
3503
|
+
title: string;
|
|
3504
|
+
category: string;
|
|
3505
|
+
};
|
|
3506
|
+
data: Record<string, unknown>;
|
|
3507
|
+
params: Record<string, unknown>;
|
|
3508
|
+
};
|
|
3509
|
+
|
|
3510
|
+
/** @category Models */
|
|
3511
|
+
type UserLogId = string;
|
|
3512
|
+
|
|
3513
|
+
/** @category Models */
|
|
3514
|
+
type UserLogsResponse = {
|
|
3515
|
+
log: UserLog[];
|
|
3516
|
+
_metadata: RequestMetadataWithLinks;
|
|
3517
|
+
};
|
|
3518
|
+
|
|
3482
3519
|
/** @category Models */
|
|
3483
3520
|
type UserLookupResponse = {
|
|
3484
3521
|
selections: UserSelectionName[];
|
|
@@ -3583,6 +3620,13 @@ type UserPropertyDetailsExtendedRented = UserPropertyBasicDetails & {
|
|
|
3583
3620
|
rented_by: BasicUser;
|
|
3584
3621
|
};
|
|
3585
3622
|
|
|
3623
|
+
/** @category Models */
|
|
3624
|
+
type UserPropertyDetailsExtendedWithRent = UserPropertyBasicDetails & {
|
|
3625
|
+
used_by: BasicUser[];
|
|
3626
|
+
status: "none" | "in_use";
|
|
3627
|
+
rented_by?: BasicUser;
|
|
3628
|
+
};
|
|
3629
|
+
|
|
3586
3630
|
/** @category Models */
|
|
3587
3631
|
type UserPropertyResponse = {
|
|
3588
3632
|
property: UserPropertyDetails;
|
|
@@ -3668,6 +3712,7 @@ declare class FactionEndpoint {
|
|
|
3668
3712
|
* @param params - Optional query parameters
|
|
3669
3713
|
*/
|
|
3670
3714
|
attacks(params?: {
|
|
3715
|
+
filters?: "incoming" | "outgoing";
|
|
3671
3716
|
limit?: number;
|
|
3672
3717
|
sort?: "DESC" | "ASC";
|
|
3673
3718
|
to?: number;
|
|
@@ -3679,6 +3724,7 @@ declare class FactionEndpoint {
|
|
|
3679
3724
|
* @param params - Optional query parameters
|
|
3680
3725
|
*/
|
|
3681
3726
|
attacksfull(params?: {
|
|
3727
|
+
filters?: "incoming" | "outgoing";
|
|
3682
3728
|
limit?: number;
|
|
3683
3729
|
sort?: "DESC" | "ASC";
|
|
3684
3730
|
to?: number;
|
|
@@ -3825,6 +3871,7 @@ declare class FactionEndpoint {
|
|
|
3825
3871
|
* @param params - Optional query parameters
|
|
3826
3872
|
*/
|
|
3827
3873
|
revives(params?: {
|
|
3874
|
+
filters?: "incoming" | "outgoing";
|
|
3828
3875
|
limit?: number;
|
|
3829
3876
|
sort?: "DESC" | "ASC";
|
|
3830
3877
|
to?: number;
|
|
@@ -3837,6 +3884,7 @@ declare class FactionEndpoint {
|
|
|
3837
3884
|
* @param params - Optional query parameters
|
|
3838
3885
|
*/
|
|
3839
3886
|
revivesfull(params?: {
|
|
3887
|
+
filters?: "incoming" | "outgoing";
|
|
3840
3888
|
limit?: number;
|
|
3841
3889
|
sort?: "DESC" | "ASC";
|
|
3842
3890
|
to?: number;
|
|
@@ -4418,7 +4466,7 @@ declare class PropertyIdContext {
|
|
|
4418
4466
|
*/
|
|
4419
4467
|
get(params?: {
|
|
4420
4468
|
timestamp?: string;
|
|
4421
|
-
}): Promise<
|
|
4469
|
+
}): Promise<PropertyPropertyResponse>;
|
|
4422
4470
|
}
|
|
4423
4471
|
|
|
4424
4472
|
/**
|
|
@@ -4764,6 +4812,7 @@ declare class UserEndpoint {
|
|
|
4764
4812
|
* @param params - Optional query parameters
|
|
4765
4813
|
*/
|
|
4766
4814
|
attacks(params?: {
|
|
4815
|
+
filters?: "incoming" | "outgoing";
|
|
4767
4816
|
limit?: number;
|
|
4768
4817
|
sort?: "DESC" | "ASC";
|
|
4769
4818
|
to?: number;
|
|
@@ -4775,6 +4824,7 @@ declare class UserEndpoint {
|
|
|
4775
4824
|
* @param params - Optional query parameters
|
|
4776
4825
|
*/
|
|
4777
4826
|
attacksfull(params?: {
|
|
4827
|
+
filters?: "incoming" | "outgoing";
|
|
4778
4828
|
limit?: number;
|
|
4779
4829
|
sort?: "DESC" | "ASC";
|
|
4780
4830
|
to?: number;
|
|
@@ -4893,6 +4943,18 @@ declare class UserEndpoint {
|
|
|
4893
4943
|
sort?: "DESC" | "ASC";
|
|
4894
4944
|
timestamp?: string;
|
|
4895
4945
|
}): Promise<PaginatedResponse<UserListResponse> & UserListResponse>;
|
|
4946
|
+
/**
|
|
4947
|
+
* Get your logs
|
|
4948
|
+
* @param params - Optional query parameters
|
|
4949
|
+
*/
|
|
4950
|
+
log(params?: {
|
|
4951
|
+
log?: LogId[];
|
|
4952
|
+
cat?: LogCategoryId;
|
|
4953
|
+
limit?: number;
|
|
4954
|
+
to?: number;
|
|
4955
|
+
from?: number;
|
|
4956
|
+
timestamp?: string;
|
|
4957
|
+
}): Promise<PaginatedResponse<UserLogsResponse> & UserLogsResponse>;
|
|
4896
4958
|
/**
|
|
4897
4959
|
* Get your current ongoing organized crime
|
|
4898
4960
|
* @param params - Optional query parameters
|
|
@@ -4960,6 +5022,7 @@ declare class UserEndpoint {
|
|
|
4960
5022
|
* @param params - Optional query parameters
|
|
4961
5023
|
*/
|
|
4962
5024
|
revives(params?: {
|
|
5025
|
+
filters?: "incoming" | "outgoing";
|
|
4963
5026
|
limit?: number;
|
|
4964
5027
|
sort?: "DESC" | "ASC";
|
|
4965
5028
|
to?: number;
|
|
@@ -4972,6 +5035,7 @@ declare class UserEndpoint {
|
|
|
4972
5035
|
* @param params - Optional query parameters
|
|
4973
5036
|
*/
|
|
4974
5037
|
revivesfull(params?: {
|
|
5038
|
+
filters?: "incoming" | "outgoing";
|
|
4975
5039
|
limit?: number;
|
|
4976
5040
|
sort?: "DESC" | "ASC";
|
|
4977
5041
|
to?: number;
|
|
@@ -5244,4 +5308,4 @@ declare class TornRateLimitError extends Error {
|
|
|
5244
5308
|
constructor(message: string);
|
|
5245
5309
|
}
|
|
5246
5310
|
|
|
5247
|
-
export { type AmmoId, type ApiKeyAccessTypeEnum, type ApiKeyBalancing, type Attack, type AttackActionEnum, type AttackCode, type AttackFinishingHitEffect, type AttackId, type AttackLog, type AttackLogResponse, type AttackLogSummary, type AttackPlayer, type AttackPlayerFaction, type AttackPlayerSimplified, type AttackSimplified, type AttackingFinishingHitEffects, type BasicProperty, type BasicUser, type Bazaar, type BazaarAdvancedItemSales, type BazaarBargainSales, type BazaarBulkSales, type BazaarDollarSales, type BazaarRecentFavorites, type BazaarResponse, type BazaarResponseSpecialized, type BazaarSpecialized, type BazaarTotalFavorites, type BazaarWeekly, type BazaarWeeklyCustomers, type BazaarWeeklyIncome, type Bounty, type ChainId, type CompanyId, type CountryEnum, type DirtyBombId, type EducationId, type Faction, type FactionApplication, type FactionApplicationStatusEnum, type FactionApplicationsResponse, type FactionAttackResult, type FactionAttacksFullResponse, type FactionAttacksResponse, type FactionBalance, type FactionBalanceResponse, type FactionBasic, type FactionBasicResponse, type FactionBranchDetails, type FactionBranchId, type FactionBranchStateEnum, type FactionChain, FactionChainIdContext, type FactionChainReport, type FactionChainReportAttacker, type FactionChainReportAttackerAttacks, type FactionChainReportAttackerRespect, type FactionChainReportBonus, type FactionChainReportDetails, type FactionChainReportResponse, type FactionChainWarfare, type FactionChainsResponse, type FactionContributor, type FactionContributorsResponse, type FactionCrime, type FactionCrimeId, FactionCrimeIdContext, type FactionCrimeResponse, type FactionCrimeReward, type FactionCrimeRewardItem, type FactionCrimeRewardPayout, type FactionCrimeSlot, type FactionCrimeStatusEnum, type FactionCrimeUser, type FactionCrimeUserOutcome, type FactionCrimesResponse, FactionEndpoint, type FactionHofResponse, type FactionHofStats, type FactionHofValues, type FactionId, FactionIdContext, type FactionLookupResponse, type FactionMember, type FactionMembersResponse, type FactionNews, type FactionNewsCategory, type FactionNewsResponse, type FactionOngoingChain, type FactionOngoingChainResponse, type FactionOrganizedCrimePayoutType, type FactionPact, type FactionPosition, type FactionPositionAbilityEnum, type FactionPositionsResponse, type FactionRacketsResponse, type FactionRaidReport, type FactionRaidReportAttacker, type FactionRaidReportFaction, type FactionRaidReportUser, type FactionRaidWar, FactionRaidWarIdContext, type FactionRaidWarParticipant, type FactionRaidWarReportResponse, type FactionRaidWarfare, type FactionRaidWarfareFaction, type FactionRaidsResponse, type FactionRank, type FactionRankEnum, type FactionRankedWar, type FactionRankedWarDetails, FactionRankedWarIdContext, type FactionRankedWarParticipant, type FactionRankedWarReportResponse, type FactionRankedWarResponse, type FactionRankedWarsCategoryEnum, type FactionResponse, type FactionSearch, type FactionSearchLeader, type FactionSearchResponse, type FactionSelectionName, type FactionStat, type FactionStatEnum, type FactionStatsResponse, type FactionTerritoriesOwnershipResponse, type FactionTerritoriesResponse, type FactionTerritory, type FactionTerritoryEnum, type FactionTerritoryOwnership, type FactionTerritoryWar, type FactionTerritoryWarFaction, type FactionTerritoryWarFactionWallPlayers, type FactionTerritoryWarFinished, type FactionTerritoryWarFinishedFaction, FactionTerritoryWarIdContext, type FactionTerritoryWarOngoing, type FactionTerritoryWarOngoingFaction, type FactionTerritoryWarParticipant, type FactionTerritoryWarReport, type FactionTerritoryWarReportFaction, type FactionTerritoryWarReportMembers, type FactionTerritoryWarReportResponse, type FactionTerritoryWarResultEnum, type FactionTerritoryWarfare, type FactionTerritoryWarsCategoryEnum, type FactionTerritoryWarsHistoryResponse, type FactionTerritoryWarsResponse, type FactionUpgradeDetails, type FactionUpgrades, type FactionUpgradesResponse, type FactionWarfareDirtyBomb, type FactionWarfareDirtyBombPlanter, type FactionWarfareDirtyBombTargetFaction, type FactionWarfareResponse, type FactionWarfareTypeEnum, type FactionWars, type FactionWarsResponse, type ForumCategoriesResponse, ForumCategoryIdsContext, ForumEndpoint, type ForumFeed, type ForumFeedTypeEnum, type ForumId, type ForumLookupResponse, type ForumPoll, type ForumPollVote, type ForumPost, type ForumPostId, type ForumPostsResponse, type ForumResponse, type ForumSelectionName, type ForumSubscribedThread, type ForumSubscribedThreadPostsCount, type ForumThreadAuthor, type ForumThreadBase, type ForumThreadExtended, type ForumThreadId, ForumThreadIdContext, type ForumThreadResponse, type ForumThreadUserExtended, type ForumThreadsResponse, type HofValue, type HofValueFloat, type HofValueString, type ItemId, type ItemMarket, type ItemMarketItem, type ItemMarketListingItemBonus, type ItemMarketListingItemDetails, type ItemMarketListingItemStats, type ItemMarketListingNonstackable, type ItemMarketListingStackable, type ItemModId, type ItemUid, type JobPositionArmyEnum, type JobPositionCasinoEnum, type JobPositionEducationEnum, type JobPositionGrocerEnum, type JobPositionLawEnum, type JobPositionMedicalEnum, KeyEndpoint, type KeyInfoResponse, type KeyLogResponse, type KeyResponse, type KeySelectionName, type LogCategoryId, type LogId, MarketEndpoint, MarketIdContext, type MarketItemMarketResponse, type MarketLookupResponse, type MarketPropertiesResponse, type MarketPropertyDetails, MarketPropertyTypeIdContext, type MarketRentalDetails, type MarketRentalsResponse, type MarketResponse, type MarketSelectionName, type MarketSpecializedBazaarCategoryEnum, type OrganizedCrimeName, PaginatedResponse, type Parameters, type PersonalStatsAttackingExtended, type PersonalStatsAttackingPopular, type PersonalStatsAttackingPublic, type PersonalStatsBattleStats, type PersonalStatsBounties, type PersonalStatsCategoryEnum, type PersonalStatsCommunication, type PersonalStatsCrimes, type PersonalStatsCrimesPopular, type PersonalStatsCrimesV1, type PersonalStatsCrimesV2, type PersonalStatsDrugs, type PersonalStatsFinishingHits, type PersonalStatsHistoricStat, type PersonalStatsHospital, type PersonalStatsHospitalPopular, type PersonalStatsInvestments, type PersonalStatsItems, type PersonalStatsItemsPopular, type PersonalStatsJail, type PersonalStatsJobsExtended, type PersonalStatsJobsPublic, type PersonalStatsMissions, type PersonalStatsNetworthExtended, type PersonalStatsNetworthPublic, type PersonalStatsOther, type PersonalStatsOtherPopular, type PersonalStatsRacing, type PersonalStatsStatName, type PersonalStatsTrading, type PersonalStatsTravel, type PersonalStatsTravelPopular, PropertyEndpoint, type PropertyId, PropertyIdContext, type PropertyLookupResponse, type PropertyModificationEnum, type PropertyResponse, type PropertySelectionName, type PropertyStaffEnum, type PropertyTypeId, type Race, type RaceCar, type RaceCarId, type RaceCarUpgrade, type RaceCarUpgradeCategory, type RaceCarUpgradeId, type RaceCarUpgradeSubCategory, type RaceClassEnum, type RaceId, type RaceRecord, type RaceStatusEnum, type RaceTrack, type RaceTrackId, type RacerDetails, type RacingCarUpgradesResponse, type RacingCarsResponse, RacingEndpoint, type RacingLookupResponse, type RacingRaceDetails, type RacingRaceDetailsResponse, RacingRaceIdContext, type RacingRaceTypeEnum, type RacingRacesResponse, type RacingResponse, type RacingSelectionName, RacingTrackIdContext, type RacingTrackRecordsResponse, type RacingTracksResponse, type RaidWarId, type RankedWarId, type RateLimitMode, type Report, type ReportAnonymousBounties, type ReportBase, type ReportCompanyFinancials, type ReportFriendOrFoe, type ReportFriendOrFoeUser, type ReportHistory, type ReportHistoryCompany, type ReportHistoryFaction, type ReportInvestment, type ReportMoney, type ReportMostWanted, type ReportReport, type ReportStats, type ReportStockAnalysis, type ReportTrueLevel, type ReportTypeEnum, type ReportWarrantDetails, type ReportsResponse, type RequestLinks, type RequestMetadata, type RequestMetadataWithLinks, type RequestMetadataWithLinksAndTotal, type Requester, type Revive, type ReviveId, type ReviveSetting, type ReviveSimplified, type RevivesFullResponse, type RevivesResponse, type SelectionCategoryEnum, type TerritoryWarId, type TimestampResponse, TornAPI, type TornAPIOptions, TornApiError, type TornBountiesResponse, type TornCalendarActivity, type TornCalendarResponse, type TornCrime, type TornCrimeId, TornCrimeIdContext, type TornCrimesResponse, type TornEducation, type TornEducationCourses, type TornEducationPrerequisites, type TornEducationResponse, type TornEducationRewards, TornEndpoint, type TornFactionHof, type TornFactionHofCategory, type TornFactionHofResponse, type TornFactionTree, type TornFactionTreeBranch, type TornFactionTreeResponse, type TornHof, type TornHofBasic, type TornHofCategory, type TornHofResponse, type TornHofWithOffenses, TornIdsContext, type TornItem, type TornItemAmmo, type TornItemAmmoResponse, type TornItemAmmoTypeEnum, type TornItemArmorCoverage, type TornItemArmorCoveragePartEnum, type TornItemArmorDetails, type TornItemBaseStats, type TornItemCategory, type TornItemMods, type TornItemModsResponse, type TornItemTypeEnum, type TornItemWeaponCategoryEnum, type TornItemWeaponDetails, type TornItemWeaponTypeEnum, type TornItemsResponse, type TornLog, type TornLogCategoriesResponse, type TornLogCategory, TornLogCategoryIdContext, type TornLogTypesResponse, type TornLookupResponse, type TornOrganizedCrime, type TornOrganizedCrimePositionId, type TornOrganizedCrimeRequiredItem, type TornOrganizedCrimeResponse, type TornOrganizedCrimeScope, type TornOrganizedCrimeSlot, type TornOrganizedCrimeSpawn, type TornProperties, type TornRacket, type TornRacketReward, type TornRacketType, TornRateLimitError, type TornResponse, type TornSelectionName, type TornSubcrime, type TornSubcrimesResponse, type TornTerritoriesNoLinksResponse, type TornTerritoriesResponse, type TornTerritory, type TornTerritoryCoordinates, type User, type UserBountiesResponse, type UserCalendar, type UserCalendarResponse, type UserCrime, type UserCrimeAttempts, type UserCrimeDetailsBootlegging, type UserCrimeDetailsCardSkimming, type UserCrimeDetailsCracking, type UserCrimeDetailsGraffiti, type UserCrimeDetailsHustling, type UserCrimeDetailsScamming, type UserCrimeDetailsShoplifting, UserCrimeIdContext, type UserCrimeRewardAmmo, type UserCrimeRewardItem, type UserCrimeRewards, type UserCrimeUniques, type UserCrimeUniquesReward, type UserCrimeUniquesRewardAmmo, type UserCrimeUniquesRewardAmmoEnum, type UserCrimeUniquesRewardMoney, type UserCrimesResponse, type UserCurrentEducation, type UserEducation, type UserEducationResponse, UserEndpoint, type UserEnlistedCarsResponse, type UserFactionBalance, type UserFactionBalanceResponse, type UserForumFeedResponse, type UserForumFriendsResponse, type UserForumPostsResponse, type UserForumSubscribedThreadsResponse, type UserForumThreadsResponse, type UserHofResponse, type UserHofStats, type UserId, UserIdContext, type UserItemMarkeListingItemDetails, type UserItemMarketListing, type UserItemMarketResponse, type UserJobRanks, type UserJobRanksResponse, type UserLastAction, type UserList, type UserListEnum, type UserListResponse, type UserLookupResponse, type UserOrganizedCrimeResponse, type UserPersonalStatsCategory, type UserPersonalStatsFull, type UserPersonalStatsFullPublic, type UserPersonalStatsHistoric, type UserPersonalStatsPopular, type UserPersonalStatsResponse, type UserPropertiesResponse, type UserPropertyBasicDetails, type UserPropertyDetails, type UserPropertyDetailsExtended, type UserPropertyDetailsExtendedForRent, type UserPropertyDetailsExtendedForSale, type UserPropertyDetailsExtendedRented, type UserPropertyResponse, type UserRaceCarDetails, type UserRacesResponse, type UserRacingRecordsResponse, type UserResponse, type UserSelectionName, type UserStatus, type UserSubcrime, type WeaponBonusEnum };
|
|
5311
|
+
export { type AmmoId, type ApiKeyAccessTypeEnum, type ApiKeyBalancing, type Attack, type AttackActionEnum, type AttackCode, type AttackFinishingHitEffect, type AttackId, type AttackLog, type AttackLogResponse, type AttackLogSummary, type AttackPlayer, type AttackPlayerFaction, type AttackPlayerSimplified, type AttackSimplified, type AttackingFinishingHitEffects, type BasicProperty, type BasicUser, type Bazaar, type BazaarAdvancedItemSales, type BazaarBargainSales, type BazaarBulkSales, type BazaarDollarSales, type BazaarRecentFavorites, type BazaarResponse, type BazaarResponseSpecialized, type BazaarSpecialized, type BazaarTotalFavorites, type BazaarWeekly, type BazaarWeeklyCustomers, type BazaarWeeklyIncome, type Bounty, type ChainId, type CompanyId, type CountryEnum, type DirtyBombId, type EducationId, type Faction, type FactionApplication, type FactionApplicationStatusEnum, type FactionApplicationsResponse, type FactionAttackResult, type FactionAttacksFullResponse, type FactionAttacksResponse, type FactionBalance, type FactionBalanceResponse, type FactionBasic, type FactionBasicResponse, type FactionBranchDetails, type FactionBranchId, type FactionBranchStateEnum, type FactionChain, FactionChainIdContext, type FactionChainReport, type FactionChainReportAttacker, type FactionChainReportAttackerAttacks, type FactionChainReportAttackerRespect, type FactionChainReportBonus, type FactionChainReportDetails, type FactionChainReportResponse, type FactionChainWarfare, type FactionChainsResponse, type FactionContributor, type FactionContributorsResponse, type FactionCrime, type FactionCrimeId, FactionCrimeIdContext, type FactionCrimeResponse, type FactionCrimeReward, type FactionCrimeRewardItem, type FactionCrimeRewardPayout, type FactionCrimeSlot, type FactionCrimeStatusEnum, type FactionCrimeUser, type FactionCrimeUserOutcome, type FactionCrimesResponse, FactionEndpoint, type FactionHofResponse, type FactionHofStats, type FactionHofValues, type FactionId, FactionIdContext, type FactionLookupResponse, type FactionMember, type FactionMembersResponse, type FactionNews, type FactionNewsCategory, type FactionNewsResponse, type FactionOngoingChain, type FactionOngoingChainResponse, type FactionOrganizedCrimePayoutType, type FactionPact, type FactionPosition, type FactionPositionAbilityEnum, type FactionPositionsResponse, type FactionRacketsResponse, type FactionRaidReport, type FactionRaidReportAttacker, type FactionRaidReportFaction, type FactionRaidReportUser, type FactionRaidWar, FactionRaidWarIdContext, type FactionRaidWarParticipant, type FactionRaidWarReportResponse, type FactionRaidWarfare, type FactionRaidWarfareFaction, type FactionRaidsResponse, type FactionRank, type FactionRankEnum, type FactionRankedWar, type FactionRankedWarDetails, FactionRankedWarIdContext, type FactionRankedWarParticipant, type FactionRankedWarReportResponse, type FactionRankedWarResponse, type FactionRankedWarsCategoryEnum, type FactionResponse, type FactionSearch, type FactionSearchLeader, type FactionSearchResponse, type FactionSelectionName, type FactionStat, type FactionStatEnum, type FactionStatsResponse, type FactionTerritoriesOwnershipResponse, type FactionTerritoriesResponse, type FactionTerritory, type FactionTerritoryEnum, type FactionTerritoryOwnership, type FactionTerritoryWar, type FactionTerritoryWarFaction, type FactionTerritoryWarFactionWallPlayers, type FactionTerritoryWarFinished, type FactionTerritoryWarFinishedFaction, FactionTerritoryWarIdContext, type FactionTerritoryWarOngoing, type FactionTerritoryWarOngoingFaction, type FactionTerritoryWarParticipant, type FactionTerritoryWarReport, type FactionTerritoryWarReportFaction, type FactionTerritoryWarReportMembers, type FactionTerritoryWarReportResponse, type FactionTerritoryWarResultEnum, type FactionTerritoryWarfare, type FactionTerritoryWarsCategoryEnum, type FactionTerritoryWarsHistoryResponse, type FactionTerritoryWarsResponse, type FactionUpgradeDetails, type FactionUpgrades, type FactionUpgradesResponse, type FactionWarfareDirtyBomb, type FactionWarfareDirtyBombPlanter, type FactionWarfareDirtyBombTargetFaction, type FactionWarfareResponse, type FactionWarfareTypeEnum, type FactionWars, type FactionWarsResponse, type ForumCategoriesResponse, ForumCategoryIdsContext, ForumEndpoint, type ForumFeed, type ForumFeedTypeEnum, type ForumId, type ForumLookupResponse, type ForumPoll, type ForumPollVote, type ForumPost, type ForumPostId, type ForumPostsResponse, type ForumResponse, type ForumSelectionName, type ForumSubscribedThread, type ForumSubscribedThreadPostsCount, type ForumThreadAuthor, type ForumThreadBase, type ForumThreadExtended, type ForumThreadId, ForumThreadIdContext, type ForumThreadResponse, type ForumThreadUserExtended, type ForumThreadsResponse, type HofValue, type HofValueFloat, type HofValueString, type ItemId, type ItemMarket, type ItemMarketItem, type ItemMarketListingItemBonus, type ItemMarketListingItemDetails, type ItemMarketListingItemStats, type ItemMarketListingNonstackable, type ItemMarketListingStackable, type ItemModId, type ItemUid, type JobPositionArmyEnum, type JobPositionCasinoEnum, type JobPositionEducationEnum, type JobPositionGrocerEnum, type JobPositionLawEnum, type JobPositionMedicalEnum, KeyEndpoint, type KeyInfoAvailableLog, type KeyInfoResponse, type KeyLogResponse, type KeyResponse, type KeySelectionName, type LogCategoryId, type LogId, MarketEndpoint, MarketIdContext, type MarketItemMarketResponse, type MarketLookupResponse, type MarketPropertiesResponse, type MarketPropertyDetails, MarketPropertyTypeIdContext, type MarketRentalDetails, type MarketRentalsResponse, type MarketResponse, type MarketSelectionName, type MarketSpecializedBazaarCategoryEnum, type OrganizedCrimeName, PaginatedResponse, type Parameters, type PersonalStatsAttackingExtended, type PersonalStatsAttackingPopular, type PersonalStatsAttackingPublic, type PersonalStatsBattleStats, type PersonalStatsBounties, type PersonalStatsCategoryEnum, type PersonalStatsCommunication, type PersonalStatsCrimes, type PersonalStatsCrimesPopular, type PersonalStatsCrimesV1, type PersonalStatsCrimesV2, type PersonalStatsDrugs, type PersonalStatsFinishingHits, type PersonalStatsHistoricStat, type PersonalStatsHospital, type PersonalStatsHospitalPopular, type PersonalStatsInvestments, type PersonalStatsItems, type PersonalStatsItemsPopular, type PersonalStatsJail, type PersonalStatsJobsExtended, type PersonalStatsJobsPublic, type PersonalStatsMissions, type PersonalStatsNetworthExtended, type PersonalStatsNetworthPublic, type PersonalStatsOther, type PersonalStatsOtherPopular, type PersonalStatsRacing, type PersonalStatsStatName, type PersonalStatsTrading, type PersonalStatsTravel, type PersonalStatsTravelPopular, PropertyEndpoint, type PropertyId, PropertyIdContext, type PropertyLookupResponse, type PropertyModificationEnum, type PropertyPropertyResponse, type PropertyResponse, type PropertySelectionName, type PropertyStaffEnum, type PropertyTypeId, type Race, type RaceCar, type RaceCarId, type RaceCarUpgrade, type RaceCarUpgradeCategory, type RaceCarUpgradeId, type RaceCarUpgradeSubCategory, type RaceClassEnum, type RaceId, type RaceRecord, type RaceStatusEnum, type RaceTrack, type RaceTrackId, type RacerDetails, type RacingCarUpgradesResponse, type RacingCarsResponse, RacingEndpoint, type RacingLookupResponse, type RacingRaceDetails, type RacingRaceDetailsResponse, RacingRaceIdContext, type RacingRaceTypeEnum, type RacingRacesResponse, type RacingResponse, type RacingSelectionName, RacingTrackIdContext, type RacingTrackRecordsResponse, type RacingTracksResponse, type RaidWarId, type RankedWarId, type RateLimitMode, type Report, type ReportAnonymousBounties, type ReportBase, type ReportCompanyFinancials, type ReportFriendOrFoe, type ReportFriendOrFoeUser, type ReportHistory, type ReportHistoryCompany, type ReportHistoryFaction, type ReportInvestment, type ReportMoney, type ReportMostWanted, type ReportReport, type ReportStats, type ReportStockAnalysis, type ReportTrueLevel, type ReportTypeEnum, type ReportWarrantDetails, type ReportsResponse, type RequestLinks, type RequestMetadata, type RequestMetadataWithLinks, type RequestMetadataWithLinksAndTotal, type Requester, type Revive, type ReviveId, type ReviveSetting, type ReviveSimplified, type RevivesFullResponse, type RevivesResponse, type SelectionCategoryEnum, type TerritoryWarId, type TimestampResponse, TornAPI, type TornAPIOptions, TornApiError, type TornBountiesResponse, type TornCalendarActivity, type TornCalendarResponse, type TornCrime, type TornCrimeId, TornCrimeIdContext, type TornCrimesResponse, type TornEducation, type TornEducationCourses, type TornEducationPrerequisites, type TornEducationResponse, type TornEducationRewards, TornEndpoint, type TornFactionHof, type TornFactionHofCategory, type TornFactionHofResponse, type TornFactionTree, type TornFactionTreeBranch, type TornFactionTreeResponse, type TornHof, type TornHofBasic, type TornHofCategory, type TornHofResponse, type TornHofWithOffenses, TornIdsContext, type TornItem, type TornItemAmmo, type TornItemAmmoResponse, type TornItemAmmoTypeEnum, type TornItemArmorCoverage, type TornItemArmorCoveragePartEnum, type TornItemArmorDetails, type TornItemBaseStats, type TornItemCategory, type TornItemMods, type TornItemModsResponse, type TornItemTypeEnum, type TornItemWeaponCategoryEnum, type TornItemWeaponDetails, type TornItemWeaponTypeEnum, type TornItemsResponse, type TornLog, type TornLogCategoriesResponse, type TornLogCategory, TornLogCategoryIdContext, type TornLogTypesResponse, type TornLookupResponse, type TornOrganizedCrime, type TornOrganizedCrimePositionId, type TornOrganizedCrimeRequiredItem, type TornOrganizedCrimeResponse, type TornOrganizedCrimeScope, type TornOrganizedCrimeSlot, type TornOrganizedCrimeSpawn, type TornProperties, type TornRacket, type TornRacketReward, type TornRacketType, TornRateLimitError, type TornResponse, type TornSelectionName, type TornSubcrime, type TornSubcrimesResponse, type TornTerritoriesNoLinksResponse, type TornTerritoriesResponse, type TornTerritory, type TornTerritoryCoordinates, type User, type UserBountiesResponse, type UserCalendar, type UserCalendarResponse, type UserCrime, type UserCrimeAttempts, type UserCrimeDetailsBootlegging, type UserCrimeDetailsCardSkimming, type UserCrimeDetailsCracking, type UserCrimeDetailsGraffiti, type UserCrimeDetailsHustling, type UserCrimeDetailsScamming, type UserCrimeDetailsShoplifting, UserCrimeIdContext, type UserCrimeRewardAmmo, type UserCrimeRewardItem, type UserCrimeRewards, type UserCrimeUniques, type UserCrimeUniquesReward, type UserCrimeUniquesRewardAmmo, type UserCrimeUniquesRewardAmmoEnum, type UserCrimeUniquesRewardMoney, type UserCrimesResponse, type UserCurrentEducation, type UserEducation, type UserEducationResponse, UserEndpoint, type UserEnlistedCarsResponse, type UserFactionBalance, type UserFactionBalanceResponse, type UserForumFeedResponse, type UserForumFriendsResponse, type UserForumPostsResponse, type UserForumSubscribedThreadsResponse, type UserForumThreadsResponse, type UserHofResponse, type UserHofStats, type UserId, UserIdContext, type UserItemMarkeListingItemDetails, type UserItemMarketListing, type UserItemMarketResponse, type UserJobRanks, type UserJobRanksResponse, type UserLastAction, type UserList, type UserListEnum, type UserListResponse, type UserLog, type UserLogId, type UserLogsResponse, type UserLookupResponse, type UserOrganizedCrimeResponse, type UserPersonalStatsCategory, type UserPersonalStatsFull, type UserPersonalStatsFullPublic, type UserPersonalStatsHistoric, type UserPersonalStatsPopular, type UserPersonalStatsResponse, type UserPropertiesResponse, type UserPropertyBasicDetails, type UserPropertyDetails, type UserPropertyDetailsExtended, type UserPropertyDetailsExtendedForRent, type UserPropertyDetailsExtendedForSale, type UserPropertyDetailsExtendedRented, type UserPropertyDetailsExtendedWithRent, type UserPropertyResponse, type UserRaceCarDetails, type UserRacesResponse, type UserRacingRecordsResponse, type UserResponse, type UserSelectionName, type UserStatus, type UserSubcrime, type WeaponBonusEnum };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var a=class{requester;constructor(e){this.requester=e;}async applications(e){let t="/faction/applications",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async attacks(e){let t="/faction/attacks",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async attacksfull(e){let t="/faction/attacksfull",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async balance(e){let t="/faction/balance",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async basic(e){let t="/faction/basic",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async chain(e){let t="/faction/chain",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async chains(e){let t="/faction/chains",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async chainreport(e){let t="/faction/chainreport",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async contributors(e){let t="/faction/contributors",s={...e?.stat!==void 0&&{stat:e.stat},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async crimes(e){let t="/faction/crimes",s={...e?.cat!==void 0&&{cat:e.cat},...e?.filters!==void 0&&{filters:e.filters},...e?.offset!==void 0&&{offset:e.offset},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async hof(e){let t="/faction/hof",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async members(e){let t="/faction/members",s={...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async news(e){let t="/faction/news",s={...e?.striptags!==void 0&&{striptags:e.striptags},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async positions(e){let t="/faction/positions",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async rackets(e){let t="/faction/rackets",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async raids(e){let t="/faction/raids",s={...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async rankedwars(e){let t="/faction/rankedwars",s={...e?.cat!==void 0&&{cat:e.cat},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async reports(e){let t="/faction/reports",s={...e?.cat!==void 0&&{cat:e.cat},...e?.target!==void 0&&{target:e.target},...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async revives(e){let t="/faction/revives",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async revivesfull(e){let t="/faction/revivesFull",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async search(e){let t="/faction/search",s={...e?.name!==void 0&&{name:e.name},...e?.filters&&{filters:e.filters.join(",")},...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async stats(e){let t="/faction/stats",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territory(e){let t="/faction/territory",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territoryownership(e){let t="/faction/territoryownership",s={...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territorywars(e){let t="/faction/territorywars",s={...e?.cat!==void 0&&{cat:e.cat},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.sort!==void 0&&{sort:e.sort},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async upgrades(e){let t="/faction/upgrades",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async warfare(e){let t="/faction/warfare",s={...e?.cat!==void 0&&{cat:e.cat},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async wars(e){let t="/faction/wars",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/faction/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/faction/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/faction",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.limit!==void 0&&{limit:e.limit},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.cat!==void 0&&{cat:e.cat},...e?.stat!==void 0&&{stat:e.stat},...e?.filters!==void 0&&{filters:e.filters},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.sort!==void 0&&{sort:e.sort},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withId(e){return new F(this.requester,e)}withChainId(e){return new T(this.requester,e)}withCrimeId(e){return new k(this.requester,e)}withRaidWarId(e){return new I(this.requester,e)}withRankedWarId(e){return new C(this.requester,e)}withTerritoryWarId(e){return new x(this.requester,e)}},F=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async basic(e){let t=`/faction/${this.contextId}/basic`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async chain(e){let t=`/faction/${this.contextId}/chain`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async chains(e){let t=`/faction/${this.contextId}/chains`,s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async hof(e){let t=`/faction/${this.contextId}/hof`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async members(e){let t=`/faction/${this.contextId}/members`,s={...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async raids(e){let t=`/faction/${this.contextId}/raids`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async rankedwars(e){let t=`/faction/${this.contextId}/rankedwars`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territory(e){let t=`/faction/${this.contextId}/territory`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territorywars(e){let t=`/faction/${this.contextId}/territorywars`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async wars(e){let t=`/faction/${this.contextId}/wars`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(){let e=`/faction/${this.contextId}`,t={};return this.requester(e,t)}},T=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async chainreport(e){let t=`/faction/${this.contextId}/chainreport`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},k=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async crime(e){let t=`/faction/${this.contextId}/crime`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},I=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async raidreport(e){let t=`/faction/${this.contextId}/raidreport`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},C=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async rankedwarreport(e){let t=`/faction/${this.contextId}/rankedwarreport`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},x=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async territorywarreport(e){let t=`/faction/${this.contextId}/territorywarreport`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var f=class{requester;constructor(e){this.requester=e;}async categories(e){let t="/forum/categories",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async threads(e){let t="/forum/threads",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/forum/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/forum/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/forum",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withThreadId(e){return new v(this.requester,e)}withCategoryIds(e){return new S(this.requester,e)}},v=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async posts(e){let t=`/forum/${this.contextId}/posts`,s={...e?.offset!==void 0&&{offset:e.offset},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async thread(e){let t=`/forum/${this.contextId}/thread`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},S=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async threads(e){let t=`/forum/${this.contextId}/threads`,s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var l=class{requester;constructor(e){this.requester=e;}async log(e){let t="/key/log",s={...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async info(e){let t="/key/info",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/key",s={...e?.selections&&{selections:e.selections.join(",")},...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var h=class{requester;constructor(e){this.requester=e;}async bazaar(e){let t="/market/bazaar",s={...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/market/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/market/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/market",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.cat!==void 0&&{cat:e.cat},...e?.bonus!==void 0&&{bonus:e.bonus},...e?.sort!==void 0&&{sort:e.sort},...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withId(e){return new w(this.requester,e)}withPropertyTypeId(e){return new E(this.requester,e)}},w=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async bazaar(e){let t=`/market/${this.contextId}/bazaar`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async itemmarket(e){let t=`/market/${this.contextId}/itemmarket`,s={...e?.bonus!==void 0&&{bonus:e.bonus},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},E=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async properties(e){let t=`/market/${this.contextId}/properties`,s={...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async rentals(e){let t=`/market/${this.contextId}/rentals`,s={...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var y=class{requester;constructor(e){this.requester=e;}withId(e){return new U(this.requester,e)}async lookup(e){let t="/property/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/property/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/property",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},U=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async get(e){let t=`/property/${this.contextId}/property`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var R=class{requester;constructor(e){this.requester=e;}async cars(e){let t="/racing/cars",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async carupgrades(e){let t="/racing/carupgrades",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async races(e){let t="/racing/races",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async tracks(e){let t="/racing/tracks",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/racing/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/racing/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/racing",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.cat!==void 0&&{cat:e.cat},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withRaceId(e){return new A(this.requester,e)}withTrackId(e){return new M(this.requester,e)}},A=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async race(e){let t=`/racing/${this.contextId}/race`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},M=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async records(e){let t=`/racing/${this.contextId}/records`,s={...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var g=class{requester;constructor(e){this.requester=e;}async attacklog(e){let t="/torn/attacklog",s={...e?.log!==void 0&&{log:e.log},...e?.offset!==void 0&&{offset:e.offset},...e?.sort!==void 0&&{sort:e.sort},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async bounties(e){let t="/torn/bounties",s={...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async calendar(e){let t="/torn/calendar",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async crimes(e){let t="/torn/crimes",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async education(e){let t="/torn/education",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async factionhof(e){let t="/torn/factionhof",s={...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async factiontree(e){let t="/torn/factiontree",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async hof(e){let t="/torn/hof",s={...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async itemammo(e){let t="/torn/itemammo",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async itemmods(e){let t="/torn/itemmods",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async items(e){let t="/torn/items",s={...e?.cat!==void 0&&{cat:e.cat},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async logcategories(e){let t="/torn/logcategories",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async logtypes(e){let t="/torn/logtypes",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async organizedcrimes(e){let t="/torn/organizedcrimes",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async properties(e){let t="/torn/properties",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territory(e){let t="/torn/territory",s={...e?.ids&&{ids:e.ids.join(",")},...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/torn/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/torn/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/torn",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.limit!==void 0&&{limit:e.limit},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.sort!==void 0&&{sort:e.sort},...e?.cat!==void 0&&{cat:e.cat},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withIds(e){return new L(this.requester,e)}withLogCategoryId(e){return new K(this.requester,e)}withCrimeId(e){return new D(this.requester,e)}},L=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async items(e){let t=`/torn/${this.contextId}/items`,s={...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},K=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async logtypes(e){let t=`/torn/${this.contextId}/logtypes`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},D=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async subcrimes(e){let t=`/torn/${this.contextId}/subcrimes`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var b=class{requester;constructor(e){this.requester=e;}async attacks(e){let t="/user/attacks",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async attacksfull(e){let t="/user/attacksfull",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async bounties(e){let t="/user/bounties",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async calendar(e){let t="/user/calendar",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async education(e){let t="/user/education",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async enlistedcars(e){let t="/user/enlistedcars",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async factionbalance(e){let t="/user/factionbalance",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumfeed(e){let t="/user/forumfeed",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumfriends(e){let t="/user/forumfriends",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumposts(e){let t="/user/forumposts",s={...e?.striptags!==void 0&&{striptags:e.striptags},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumsubscribedthreads(e){let t="/user/forumsubscribedthreads",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumthreads(e){let t="/user/forumthreads",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async hof(e){let t="/user/hof",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async itemmarket(e){let t="/user/itemmarket",s={...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async jobranks(e){let t="/user/jobranks",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async list(e){let t="/user/list",s={...e?.cat!==void 0&&{cat:e.cat},...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async organizedcrime(e){let t="/user/organizedcrime",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async personalstats(e){let t="/user/personalstats",s={...e?.cat!==void 0&&{cat:e.cat},...e?.stat&&{stat:e.stat.join(",")},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async properties(e){let t="/user/properties",s={...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async property(e){let t="/user/property",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async races(e){let t="/user/races",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async racingrecords(e){let t="/user/racingrecords",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async reports(e){let t="/user/reports",s={...e?.cat!==void 0&&{cat:e.cat},...e?.target!==void 0&&{target:e.target},...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async revives(e){let t="/user/revives",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async revivesfull(e){let t="/user/revivesFull",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/user/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/user/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/user",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.limit!==void 0&&{limit:e.limit},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.sort!==void 0&&{sort:e.sort},...e?.cat!==void 0&&{cat:e.cat},...e?.stat&&{stat:e.stat.join(",")},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withId(e){return new W(this.requester,e)}withCrimeId(e){return new $(this.requester,e)}},W=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async bounties(e){let t=`/user/${this.contextId}/bounties`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumposts(e){let t=`/user/${this.contextId}/forumposts`,s={...e?.striptags!==void 0&&{striptags:e.striptags},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumthreads(e){let t=`/user/${this.contextId}/forumthreads`,s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async hof(e){let t=`/user/${this.contextId}/hof`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async personalstats(e){let t=`/user/${this.contextId}/personalstats`,s={...e?.cat!==void 0&&{cat:e.cat},...e?.stat&&{stat:e.stat.join(",")},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async properties(e){let t=`/user/${this.contextId}/properties`,s={...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async property(e){let t=`/user/${this.contextId}/property`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(){let e=`/user/${this.contextId}`,t={};return this.requester(e,t)}},$=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async crimes(e){let t=`/user/${this.contextId}/crimes`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var c=class extends Error{code;constructor(e){super(e.error),this.name="TornApiError",this.code=e.code;}},d=class extends Error{constructor(e){super(e),this.name="TornRateLimitError";}};var q=class{nextUrl;prevUrl;requester;constructor(e,t,s,r){Object.assign(this,e),this.nextUrl=t,this.prevUrl=s,this.requester=r;}async fetchPage(e){if(!e)return null;let t=new URL(e),s=t.pathname.substring(3),r={};for(let[u,n]of t.searchParams.entries())r[u]=n;return this.requester(s,r)}next(){return this.fetchPage(this.nextUrl)}prev(){return this.fetchPage(this.prevUrl)}};var z=i=>i instanceof Error,N=i=>typeof i=="object"&&i!==null&&"error"in i&&typeof i.error=="object"&&i.error!==null&&"code"in i.error&&"error"in i.error,j=i=>typeof i=="object"&&i!==null&&"_metadata"in i&&typeof i._metadata=="object"&&i._metadata!==null&&"links"in i._metadata,P=class{apiKeys;rateLimitMode;comment;headers;apiUrl;apiKeyBalancing;verbose;apiKeyIndex=0;requestTimestamps=new Map;constructor(e){if(!e.apiKeys||e.apiKeys.length===0)throw new Error("At least one API key must be provided.");this.apiKeys=e.apiKeys,this.rateLimitMode=e.rateLimitMode??"autoDelay",this.comment=e.comment,this.headers=e.headers??{},this.apiUrl=e.apiUrl??"https://api.torn.com/v2",this.apiKeyBalancing=e.apiKeyBalancing??"roundRobin",this.verbose=!!e.verbose;for(let t of this.apiKeys)this.requestTimestamps.set(t,[]);}log(...e){this.verbose&&console.log("[TornClient]",...e);}requester=this.makeRequest.bind(this);isKeyAvailable(e){if(this.rateLimitMode==="ignore")return true;let s=Date.now()-6e4,r=(this.requestTimestamps.get(e)??[]).filter(u=>u>s);return this.requestTimestamps.set(e,r),r.length<100}findAvailableKey(){for(let e=0;e<this.apiKeys.length;e++){let t=this.getApiKey();if(this.isKeyAvailable(t))return t}return null}getMinWaitTime(){let e=Date.now(),t=60100;for(let s of this.apiKeys){let r=this.requestTimestamps.get(s)??[];if(r.length>=100){let u=r[0],n=6e4-(e-u)+100;n<t&&(t=n);}}return Math.max(0,t)}getApiKey(){if(this.apiKeys.length===1)return this.apiKeys[0];if(this.apiKeyBalancing==="random"){let t=Math.floor(Math.random()*this.apiKeys.length);return this.apiKeys[t]}let e=this.apiKeys[this.apiKeyIndex];return this.apiKeyIndex=(this.apiKeyIndex+1)%this.apiKeys.length,e}async makeRequest(e,t){this.log("Request received:",e,t);let s=this.findAvailableKey();if(!s){if(this.rateLimitMode==="autoDelay"){let n=this.getMinWaitTime();this.log(`All keys are on cooldown. Delaying for ${n}ms...`),await new Promise(o=>setTimeout(o,n)),s=this.findAvailableKey();}if(!s){let n=new d("Rate limit of 100 requests/minute exceeded for all available keys");throw this.log("Rate limit exceeded for all keys"),n}}this.log(`Using API key: ${s.slice(0,5)}...`);let r=new URL(`${this.apiUrl}${e}`);for(let[n,o]of Object.entries(t))o!=null&&n!=="key"&&n!=="comment"&&r.searchParams.set(n,String(o));this.comment&&r.searchParams.set("comment",this.comment);let u={headers:{Accept:"application/json",Authorization:`ApiKey ${s}`,...this.headers}};try{this.log("Fetching:",r.toString());let n=await fetch(r.toString(),u);if(this.rateLimitMode!=="ignore"){let p=this.requestTimestamps.get(s)??[];p.push(Date.now()),this.requestTimestamps.set(s,p);}if(!n.ok)throw new Error(`Request failed with status ${n.status}: ${n.statusText}`);let o=await n.json();if(N(o))throw new c(o.error);let m;return j(o)?m=new q(o,o._metadata.links.next,o._metadata.links.prev,this.requester):m=o,this.log("Response data:",m),m}catch(n){let o=z(n)?n:new Error("An unknown error occurred");throw this.log("Request failed:",o.message),o}}getRateLimitInfo(){let e=Date.now(),t=e-6e4,s={};for(let r of this.apiKeys){let u=(this.requestTimestamps.get(r)??[]).filter(H=>H>t),n=u.length,o=Math.max(0,100-n),m=u[0]??null,p=m?Math.max(0,6e4-(e-m)):0;s[r.slice(0,5)]={used:n,remaining:o,resetInMs:p};}return s}};var B=class{user;faction;market;property;racing;forum;key;torn;rateLimitMode;requestHandler;constructor(e){if(!e.apiKeys||e.apiKeys.length===0)throw new Error("At least one API key is required to initialize the client.");this.rateLimitMode=e.rateLimitMode??"autoDelay",this.requestHandler=new P(e);let t=this.requestHandler.requester;this.user=new b(t),this.faction=new a(t),this.market=new h(t),this.property=new y(t),this.racing=new R(t),this.forum=new f(t),this.torn=new g(t),this.key=new l(t);}getRateLimitInfo(){return this.requestHandler.getRateLimitInfo()}};
|
|
2
|
-
exports.FactionChainIdContext=T;exports.FactionCrimeIdContext=
|
|
1
|
+
'use strict';var a=class{requester;constructor(e){this.requester=e;}async applications(e){let t="/faction/applications",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async attacks(e){let t="/faction/attacks",s={...e?.filters!==void 0&&{filters:e.filters},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async attacksfull(e){let t="/faction/attacksfull",s={...e?.filters!==void 0&&{filters:e.filters},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async balance(e){let t="/faction/balance",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async basic(e){let t="/faction/basic",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async chain(e){let t="/faction/chain",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async chains(e){let t="/faction/chains",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async chainreport(e){let t="/faction/chainreport",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async contributors(e){let t="/faction/contributors",s={...e?.stat!==void 0&&{stat:e.stat},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async crimes(e){let t="/faction/crimes",s={...e?.cat!==void 0&&{cat:e.cat},...e?.filters!==void 0&&{filters:e.filters},...e?.offset!==void 0&&{offset:e.offset},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async hof(e){let t="/faction/hof",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async members(e){let t="/faction/members",s={...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async news(e){let t="/faction/news",s={...e?.striptags!==void 0&&{striptags:e.striptags},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async positions(e){let t="/faction/positions",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async rackets(e){let t="/faction/rackets",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async raids(e){let t="/faction/raids",s={...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async rankedwars(e){let t="/faction/rankedwars",s={...e?.cat!==void 0&&{cat:e.cat},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async reports(e){let t="/faction/reports",s={...e?.cat!==void 0&&{cat:e.cat},...e?.target!==void 0&&{target:e.target},...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async revives(e){let t="/faction/revives",s={...e?.filters!==void 0&&{filters:e.filters},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async revivesfull(e){let t="/faction/revivesFull",s={...e?.filters!==void 0&&{filters:e.filters},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async search(e){let t="/faction/search",s={...e?.name!==void 0&&{name:e.name},...e?.filters&&{filters:e.filters.join(",")},...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async stats(e){let t="/faction/stats",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territory(e){let t="/faction/territory",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territoryownership(e){let t="/faction/territoryownership",s={...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territorywars(e){let t="/faction/territorywars",s={...e?.cat!==void 0&&{cat:e.cat},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.sort!==void 0&&{sort:e.sort},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async upgrades(e){let t="/faction/upgrades",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async warfare(e){let t="/faction/warfare",s={...e?.cat!==void 0&&{cat:e.cat},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async wars(e){let t="/faction/wars",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/faction/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/faction/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/faction",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.limit!==void 0&&{limit:e.limit},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.cat!==void 0&&{cat:e.cat},...e?.stat!==void 0&&{stat:e.stat},...e?.filters!==void 0&&{filters:e.filters},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.sort!==void 0&&{sort:e.sort},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withId(e){return new F(this.requester,e)}withChainId(e){return new T(this.requester,e)}withCrimeId(e){return new I(this.requester,e)}withRaidWarId(e){return new k(this.requester,e)}withRankedWarId(e){return new C(this.requester,e)}withTerritoryWarId(e){return new x(this.requester,e)}},F=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async basic(e){let t=`/faction/${this.contextId}/basic`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async chain(e){let t=`/faction/${this.contextId}/chain`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async chains(e){let t=`/faction/${this.contextId}/chains`,s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async hof(e){let t=`/faction/${this.contextId}/hof`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async members(e){let t=`/faction/${this.contextId}/members`,s={...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async raids(e){let t=`/faction/${this.contextId}/raids`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async rankedwars(e){let t=`/faction/${this.contextId}/rankedwars`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territory(e){let t=`/faction/${this.contextId}/territory`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territorywars(e){let t=`/faction/${this.contextId}/territorywars`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async wars(e){let t=`/faction/${this.contextId}/wars`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(){let e=`/faction/${this.contextId}`,t={};return this.requester(e,t)}},T=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async chainreport(e){let t=`/faction/${this.contextId}/chainreport`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},I=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async crime(e){let t=`/faction/${this.contextId}/crime`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},k=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async raidreport(e){let t=`/faction/${this.contextId}/raidreport`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},C=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async rankedwarreport(e){let t=`/faction/${this.contextId}/rankedwarreport`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},x=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async territorywarreport(e){let t=`/faction/${this.contextId}/territorywarreport`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var f=class{requester;constructor(e){this.requester=e;}async categories(e){let t="/forum/categories",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async threads(e){let t="/forum/threads",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/forum/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/forum/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/forum",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withThreadId(e){return new v(this.requester,e)}withCategoryIds(e){return new S(this.requester,e)}},v=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async posts(e){let t=`/forum/${this.contextId}/posts`,s={...e?.offset!==void 0&&{offset:e.offset},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async thread(e){let t=`/forum/${this.contextId}/thread`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},S=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async threads(e){let t=`/forum/${this.contextId}/threads`,s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var l=class{requester;constructor(e){this.requester=e;}async log(e){let t="/key/log",s={...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async info(e){let t="/key/info",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/key",s={...e?.selections&&{selections:e.selections.join(",")},...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var h=class{requester;constructor(e){this.requester=e;}async bazaar(e){let t="/market/bazaar",s={...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/market/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/market/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/market",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.cat!==void 0&&{cat:e.cat},...e?.bonus!==void 0&&{bonus:e.bonus},...e?.sort!==void 0&&{sort:e.sort},...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withId(e){return new w(this.requester,e)}withPropertyTypeId(e){return new E(this.requester,e)}},w=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async bazaar(e){let t=`/market/${this.contextId}/bazaar`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async itemmarket(e){let t=`/market/${this.contextId}/itemmarket`,s={...e?.bonus!==void 0&&{bonus:e.bonus},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},E=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async properties(e){let t=`/market/${this.contextId}/properties`,s={...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async rentals(e){let t=`/market/${this.contextId}/rentals`,s={...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var g=class{requester;constructor(e){this.requester=e;}withId(e){return new U(this.requester,e)}async lookup(e){let t="/property/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/property/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/property",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},U=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async get(e){let t=`/property/${this.contextId}/property`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var y=class{requester;constructor(e){this.requester=e;}async cars(e){let t="/racing/cars",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async carupgrades(e){let t="/racing/carupgrades",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async races(e){let t="/racing/races",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async tracks(e){let t="/racing/tracks",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/racing/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/racing/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/racing",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.cat!==void 0&&{cat:e.cat},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withRaceId(e){return new A(this.requester,e)}withTrackId(e){return new L(this.requester,e)}},A=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async race(e){let t=`/racing/${this.contextId}/race`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},L=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async records(e){let t=`/racing/${this.contextId}/records`,s={...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var R=class{requester;constructor(e){this.requester=e;}async attacklog(e){let t="/torn/attacklog",s={...e?.log!==void 0&&{log:e.log},...e?.offset!==void 0&&{offset:e.offset},...e?.sort!==void 0&&{sort:e.sort},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async bounties(e){let t="/torn/bounties",s={...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async calendar(e){let t="/torn/calendar",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async crimes(e){let t="/torn/crimes",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async education(e){let t="/torn/education",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async factionhof(e){let t="/torn/factionhof",s={...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async factiontree(e){let t="/torn/factiontree",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async hof(e){let t="/torn/hof",s={...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async itemammo(e){let t="/torn/itemammo",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async itemmods(e){let t="/torn/itemmods",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async items(e){let t="/torn/items",s={...e?.cat!==void 0&&{cat:e.cat},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async logcategories(e){let t="/torn/logcategories",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async logtypes(e){let t="/torn/logtypes",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async organizedcrimes(e){let t="/torn/organizedcrimes",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async properties(e){let t="/torn/properties",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async territory(e){let t="/torn/territory",s={...e?.ids&&{ids:e.ids.join(",")},...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/torn/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/torn/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/torn",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.limit!==void 0&&{limit:e.limit},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.sort!==void 0&&{sort:e.sort},...e?.cat!==void 0&&{cat:e.cat},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withIds(e){return new M(this.requester,e)}withLogCategoryId(e){return new K(this.requester,e)}withCrimeId(e){return new D(this.requester,e)}},M=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async items(e){let t=`/torn/${this.contextId}/items`,s={...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},K=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async logtypes(e){let t=`/torn/${this.contextId}/logtypes`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}},D=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async subcrimes(e){let t=`/torn/${this.contextId}/subcrimes`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var b=class{requester;constructor(e){this.requester=e;}async attacks(e){let t="/user/attacks",s={...e?.filters!==void 0&&{filters:e.filters},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async attacksfull(e){let t="/user/attacksfull",s={...e?.filters!==void 0&&{filters:e.filters},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async bounties(e){let t="/user/bounties",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async calendar(e){let t="/user/calendar",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async education(e){let t="/user/education",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async enlistedcars(e){let t="/user/enlistedcars",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async factionbalance(e){let t="/user/factionbalance",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumfeed(e){let t="/user/forumfeed",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumfriends(e){let t="/user/forumfriends",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumposts(e){let t="/user/forumposts",s={...e?.striptags!==void 0&&{striptags:e.striptags},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumsubscribedthreads(e){let t="/user/forumsubscribedthreads",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumthreads(e){let t="/user/forumthreads",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async hof(e){let t="/user/hof",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async itemmarket(e){let t="/user/itemmarket",s={...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async jobranks(e){let t="/user/jobranks",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async list(e){let t="/user/list",s={...e?.cat!==void 0&&{cat:e.cat},...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.sort!==void 0&&{sort:e.sort},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async log(e){let t="/user/log",s={...e?.log&&{log:e.log.join(",")},...e?.cat!==void 0&&{cat:e.cat},...e?.limit!==void 0&&{limit:e.limit},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async organizedcrime(e){let t="/user/organizedcrime",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async personalstats(e){let t="/user/personalstats",s={...e?.cat!==void 0&&{cat:e.cat},...e?.stat&&{stat:e.stat.join(",")},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async properties(e){let t="/user/properties",s={...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async property(e){let t="/user/property",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async races(e){let t="/user/races",s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.cat!==void 0&&{cat:e.cat},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async racingrecords(e){let t="/user/racingrecords",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async reports(e){let t="/user/reports",s={...e?.cat!==void 0&&{cat:e.cat},...e?.target!==void 0&&{target:e.target},...e?.limit!==void 0&&{limit:e.limit},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async revives(e){let t="/user/revives",s={...e?.filters!==void 0&&{filters:e.filters},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async revivesfull(e){let t="/user/revivesFull",s={...e?.filters!==void 0&&{filters:e.filters},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.to!==void 0&&{to:e.to},...e?.from!==void 0&&{from:e.from},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async lookup(e){let t="/user/lookup",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async timestamp(e){let t="/user/timestamp",s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(e){let t="/user",s={...e?.selections&&{selections:e.selections.join(",")},...e?.id!==void 0&&{id:e.id},...e?.limit!==void 0&&{limit:e.limit},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.sort!==void 0&&{sort:e.sort},...e?.cat!==void 0&&{cat:e.cat},...e?.stat&&{stat:e.stat.join(",")},...e?.striptags!==void 0&&{striptags:e.striptags},...e?.offset!==void 0&&{offset:e.offset},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}withId(e){return new W(this.requester,e)}withCrimeId(e){return new $(this.requester,e)}},W=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async bounties(e){let t=`/user/${this.contextId}/bounties`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumposts(e){let t=`/user/${this.contextId}/forumposts`,s={...e?.striptags!==void 0&&{striptags:e.striptags},...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async forumthreads(e){let t=`/user/${this.contextId}/forumthreads`,s={...e?.limit!==void 0&&{limit:e.limit},...e?.sort!==void 0&&{sort:e.sort},...e?.from!==void 0&&{from:e.from},...e?.to!==void 0&&{to:e.to},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async hof(e){let t=`/user/${this.contextId}/hof`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async personalstats(e){let t=`/user/${this.contextId}/personalstats`,s={...e?.cat!==void 0&&{cat:e.cat},...e?.stat&&{stat:e.stat.join(",")},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async properties(e){let t=`/user/${this.contextId}/properties`,s={...e?.offset!==void 0&&{offset:e.offset},...e?.limit!==void 0&&{limit:e.limit},...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async property(e){let t=`/user/${this.contextId}/property`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}async get(){let e=`/user/${this.contextId}`,t={};return this.requester(e,t)}},$=class{requester;contextId;constructor(e,t){this.requester=e,this.contextId=t;}async crimes(e){let t=`/user/${this.contextId}/crimes`,s={...e?.timestamp!==void 0&&{timestamp:e.timestamp}};return this.requester(t,s)}};var c=class extends Error{code;constructor(e){super(e.error),this.name="TornApiError",this.code=e.code;}},d=class extends Error{constructor(e){super(e),this.name="TornRateLimitError";}};var q=class{nextUrl;prevUrl;requester;constructor(e,t,s,r){Object.assign(this,e),this.nextUrl=t,this.prevUrl=s,this.requester=r;}async fetchPage(e){if(!e)return null;let t=new URL(e),s=t.pathname.substring(3),r={};for(let[u,n]of t.searchParams.entries())r[u]=n;return this.requester(s,r)}next(){return this.fetchPage(this.nextUrl)}prev(){return this.fetchPage(this.prevUrl)}};var j=i=>i instanceof Error,z=i=>typeof i=="object"&&i!==null&&"error"in i&&typeof i.error=="object"&&i.error!==null&&"code"in i.error&&"error"in i.error,N=i=>typeof i=="object"&&i!==null&&"_metadata"in i&&typeof i._metadata=="object"&&i._metadata!==null&&"links"in i._metadata,P=class{apiKeys;rateLimitMode;comment;headers;apiUrl;apiKeyBalancing;verbose;apiKeyIndex=0;requestTimestamps=new Map;constructor(e){if(!e.apiKeys||e.apiKeys.length===0)throw new Error("At least one API key must be provided.");this.apiKeys=e.apiKeys,this.rateLimitMode=e.rateLimitMode??"autoDelay",this.comment=e.comment,this.headers=e.headers??{},this.apiUrl=e.apiUrl??"https://api.torn.com/v2",this.apiKeyBalancing=e.apiKeyBalancing??"roundRobin",this.verbose=!!e.verbose;for(let t of this.apiKeys)this.requestTimestamps.set(t,[]);}log(...e){this.verbose&&console.log("[TornClient]",...e);}requester=this.makeRequest.bind(this);isKeyAvailable(e){if(this.rateLimitMode==="ignore")return true;let s=Date.now()-6e4,r=(this.requestTimestamps.get(e)??[]).filter(u=>u>s);return this.requestTimestamps.set(e,r),r.length<100}findAvailableKey(){for(let e=0;e<this.apiKeys.length;e++){let t=this.getApiKey();if(this.isKeyAvailable(t))return t}return null}getMinWaitTime(){let e=Date.now(),t=60100;for(let s of this.apiKeys){let r=this.requestTimestamps.get(s)??[];if(r.length>=100){let u=r[0],n=6e4-(e-u)+100;n<t&&(t=n);}}return Math.max(0,t)}getApiKey(){if(this.apiKeys.length===1)return this.apiKeys[0];if(this.apiKeyBalancing==="random"){let t=Math.floor(Math.random()*this.apiKeys.length);return this.apiKeys[t]}let e=this.apiKeys[this.apiKeyIndex];return this.apiKeyIndex=(this.apiKeyIndex+1)%this.apiKeys.length,e}async makeRequest(e,t){this.log("Request received:",e,t);let s=this.findAvailableKey();if(!s){if(this.rateLimitMode==="autoDelay"){let n=this.getMinWaitTime();this.log(`All keys are on cooldown. Delaying for ${n}ms...`),await new Promise(o=>setTimeout(o,n)),s=this.findAvailableKey();}if(!s){let n=new d("Rate limit of 100 requests/minute exceeded for all available keys");throw this.log("Rate limit exceeded for all keys"),n}}this.log(`Using API key: ${s.slice(0,5)}...`);let r=new URL(`${this.apiUrl}${e}`);for(let[n,o]of Object.entries(t))o!=null&&n!=="key"&&n!=="comment"&&r.searchParams.set(n,String(o));this.comment&&r.searchParams.set("comment",this.comment);let u={headers:{Accept:"application/json",Authorization:`ApiKey ${s}`,...this.headers}};try{this.log("Fetching:",r.toString());let n=await fetch(r.toString(),u);if(this.rateLimitMode!=="ignore"){let p=this.requestTimestamps.get(s)??[];p.push(Date.now()),this.requestTimestamps.set(s,p);}if(!n.ok)throw new Error(`Request failed with status ${n.status}: ${n.statusText}`);let o=await n.json();if(z(o))throw new c(o.error);let m;return N(o)?m=new q(o,o._metadata.links.next,o._metadata.links.prev,this.requester):m=o,this.log("Response data:",m),m}catch(n){let o=j(n)?n:new Error("An unknown error occurred");throw this.log("Request failed:",o.message),o}}getRateLimitInfo(){let e=Date.now(),t=e-6e4,s={};for(let r of this.apiKeys){let u=(this.requestTimestamps.get(r)??[]).filter(H=>H>t),n=u.length,o=Math.max(0,100-n),m=u[0]??null,p=m?Math.max(0,6e4-(e-m)):0;s[r.slice(0,5)]={used:n,remaining:o,resetInMs:p};}return s}};var B=class{user;faction;market;property;racing;forum;key;torn;rateLimitMode;requestHandler;constructor(e){if(!e.apiKeys||e.apiKeys.length===0)throw new Error("At least one API key is required to initialize the client.");this.rateLimitMode=e.rateLimitMode??"autoDelay",this.requestHandler=new P(e);let t=this.requestHandler.requester;this.user=new b(t),this.faction=new a(t),this.market=new h(t),this.property=new g(t),this.racing=new y(t),this.forum=new f(t),this.torn=new R(t),this.key=new l(t);}getRateLimitInfo(){return this.requestHandler.getRateLimitInfo()}};
|
|
2
|
+
exports.FactionChainIdContext=T;exports.FactionCrimeIdContext=I;exports.FactionEndpoint=a;exports.FactionIdContext=F;exports.FactionRaidWarIdContext=k;exports.FactionRankedWarIdContext=C;exports.FactionTerritoryWarIdContext=x;exports.ForumCategoryIdsContext=S;exports.ForumEndpoint=f;exports.ForumThreadIdContext=v;exports.KeyEndpoint=l;exports.MarketEndpoint=h;exports.MarketIdContext=w;exports.MarketPropertyTypeIdContext=E;exports.PaginatedResponse=q;exports.PropertyEndpoint=g;exports.PropertyIdContext=U;exports.RacingEndpoint=y;exports.RacingRaceIdContext=A;exports.RacingTrackIdContext=L;exports.TornAPI=B;exports.TornApiError=c;exports.TornCrimeIdContext=D;exports.TornEndpoint=R;exports.TornIdsContext=M;exports.TornLogCategoryIdContext=K;exports.TornRateLimitError=d;exports.UserCrimeIdContext=$;exports.UserEndpoint=b;exports.UserIdContext=W;//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|