eclesiar-sdk 1.1.1 → 1.1.3

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.
Files changed (122) hide show
  1. package/dist/ApiError.d.ts +10 -0
  2. package/dist/ApiError.js +17 -0
  3. package/dist/_.d.ts +25 -0
  4. package/dist/_.js +71 -0
  5. package/dist/api/accounts/getAccount.d.ts +4 -0
  6. package/dist/api/accounts/getAccount.js +5 -0
  7. package/dist/api/accounts/getMyEquipment.d.ts +4 -0
  8. package/dist/api/accounts/getMyEquipment.js +5 -0
  9. package/{src/api/accounts/index.ts → dist/api/accounts/index.d.ts} +2 -10
  10. package/dist/api/accounts/index.js +7 -0
  11. package/dist/api/accounts/types.d.ts +7 -0
  12. package/dist/api/accounts/types.js +1 -0
  13. package/dist/api/countries/getCountries.d.ts +2 -0
  14. package/dist/api/countries/getCountries.js +4 -0
  15. package/dist/api/countries/getCountryRegions.d.ts +6 -0
  16. package/dist/api/countries/getCountryRegions.js +5 -0
  17. package/{src/api/countries/index.ts → dist/api/countries/index.d.ts} +2 -10
  18. package/dist/api/countries/index.js +7 -0
  19. package/dist/api/countries/types.d.ts +7 -0
  20. package/dist/api/countries/types.js +1 -0
  21. package/{src/api/index.ts → dist/api/index.d.ts} +1 -2
  22. package/dist/api/index.js +6 -0
  23. package/dist/api/market/getAuctionBid.d.ts +5 -0
  24. package/dist/api/market/getAuctionBid.js +8 -0
  25. package/dist/api/market/getAuctions.d.ts +5 -0
  26. package/dist/api/market/getAuctions.js +8 -0
  27. package/dist/api/market/getCoinOffers.d.ts +6 -0
  28. package/dist/api/market/getCoinOffers.js +9 -0
  29. package/dist/api/market/getItemOffers.d.ts +6 -0
  30. package/dist/api/market/getItemOffers.js +9 -0
  31. package/dist/api/market/getJobs.d.ts +7 -0
  32. package/dist/api/market/getJobs.js +8 -0
  33. package/dist/api/market/index.d.ts +9 -0
  34. package/{src/api/market/index.ts → dist/api/market/index.js} +3 -13
  35. package/dist/api/market/types.d.ts +25 -0
  36. package/dist/api/market/types.js +1 -0
  37. package/dist/api/server/getEquipments.d.ts +4 -0
  38. package/dist/api/server/getEquipments.js +5 -0
  39. package/dist/api/server/getItems.d.ts +4 -0
  40. package/dist/api/server/getItems.js +5 -0
  41. package/dist/api/server/getStatus.d.ts +2 -0
  42. package/dist/api/server/getStatus.js +4 -0
  43. package/{src/api/server/index.ts → dist/api/server/index.d.ts} +2 -12
  44. package/dist/api/server/index.js +9 -0
  45. package/dist/api/server/types.d.ts +10 -0
  46. package/dist/api/server/types.js +1 -0
  47. package/dist/api/statistics/getStatistics.d.ts +6 -0
  48. package/dist/api/statistics/getStatistics.js +5 -0
  49. package/{src/api/statistics/index.ts → dist/api/statistics/index.d.ts} +2 -9
  50. package/dist/api/statistics/index.js +5 -0
  51. package/dist/api/statistics/types.d.ts +6 -0
  52. package/dist/api/statistics/types.js +1 -0
  53. package/dist/api/wars/getWarRoundHits.d.ts +7 -0
  54. package/dist/api/wars/getWarRoundHits.js +8 -0
  55. package/dist/api/wars/getWarRounds.d.ts +6 -0
  56. package/dist/api/wars/getWarRounds.js +5 -0
  57. package/dist/api/wars/getWars.d.ts +2 -0
  58. package/dist/api/wars/getWars.js +11 -0
  59. package/{src/api/wars/index.ts → dist/api/wars/index.d.ts} +2 -13
  60. package/dist/api/wars/index.js +9 -0
  61. package/dist/api/wars/types.d.ts +10 -0
  62. package/dist/api/wars/types.js +1 -0
  63. package/dist/client copy.d.ts +25 -0
  64. package/dist/client copy.js +71 -0
  65. package/dist/client.d.ts +17 -0
  66. package/dist/client.js +33 -0
  67. package/dist/config/index.d.ts +23 -0
  68. package/dist/config/index.js +54 -0
  69. package/dist/config/initConfigFile.d.ts +1 -0
  70. package/dist/config/initConfigFile.js +120 -0
  71. package/dist/config/types/configSchema.d.ts +19 -0
  72. package/dist/config/types/configSchema.js +14 -0
  73. package/dist/config/types/types.d.ts +19 -0
  74. package/dist/config/types/types.js +1 -0
  75. package/dist/config.d.ts +16 -0
  76. package/dist/config.js +46 -0
  77. package/dist/index.d.ts +3 -0
  78. package/dist/index.js +1 -0
  79. package/{src/types/accounts.ts → dist/types/accounts.d.ts} +3 -4
  80. package/dist/types/accounts.js +1 -0
  81. package/{src/types/country.ts → dist/types/country.d.ts} +11 -15
  82. package/dist/types/country.js +1 -0
  83. package/dist/types/index.d.ts +6 -0
  84. package/dist/types/index.js +6 -0
  85. package/dist/types/market.d.ts +52 -0
  86. package/dist/types/market.js +1 -0
  87. package/{src/types/server.ts → dist/types/server.d.ts} +5 -7
  88. package/dist/types/server.js +1 -0
  89. package/dist/types/statistics.d.ts +10 -0
  90. package/dist/types/statistics.js +1 -0
  91. package/dist/types/wars.d.ts +52 -0
  92. package/dist/types/wars.js +1 -0
  93. package/package.json +4 -1
  94. package/src/api/accounts/getAccount.ts +0 -9
  95. package/src/api/accounts/getMyEquipment.ts +0 -9
  96. package/src/api/accounts/types.ts +0 -6
  97. package/src/api/countries/getCountries.ts +0 -7
  98. package/src/api/countries/getCountryRegions.ts +0 -13
  99. package/src/api/countries/types.ts +0 -6
  100. package/src/api/market/getAuctionBid.ts +0 -14
  101. package/src/api/market/getAuctions.ts +0 -13
  102. package/src/api/market/getCoinOffers.ts +0 -20
  103. package/src/api/market/getItemOffers.ts +0 -20
  104. package/src/api/market/getJobs.ts +0 -19
  105. package/src/api/market/types.ts +0 -9
  106. package/src/api/server/getEquipments.ts +0 -9
  107. package/src/api/server/getItems.ts +0 -9
  108. package/src/api/server/getStatus.ts +0 -6
  109. package/src/api/server/types.ts +0 -6
  110. package/src/api/statistics/getStatistics.ts +0 -14
  111. package/src/api/statistics/types.ts +0 -5
  112. package/src/api/wars/getWarRoundHits.ts +0 -19
  113. package/src/api/wars/getWarRounds.ts +0 -11
  114. package/src/api/wars/getWars.ts +0 -22
  115. package/src/api/wars/types.ts +0 -7
  116. package/src/client.ts +0 -68
  117. package/src/index.ts +0 -10
  118. package/src/types/index.ts +0 -6
  119. package/src/types/market.ts +0 -57
  120. package/src/types/statistics.ts +0 -25
  121. package/src/types/wars.ts +0 -59
  122. package/tsconfig.json +0 -18
@@ -4,17 +4,15 @@ export type ServerStatus = {
4
4
  server_name: string;
5
5
  server_time: string;
6
6
  server_day: number;
7
- };
8
-
9
- export type ServerItem = {
7
+ };
8
+ export type ServerItem = {
10
9
  id: number;
11
10
  name: string;
12
11
  quality: number;
13
12
  type: string;
14
13
  avatar: string;
15
- };
16
-
17
- export type ServerEquipment = {
14
+ };
15
+ export type ServerEquipment = {
18
16
  id: number;
19
17
  slot: number;
20
18
  grade: number;
@@ -38,4 +36,4 @@ export type ServerStatus = {
38
36
  construction_energy_reduction_percentage: number;
39
37
  avatar: string;
40
38
  drop_category: string;
41
- };
39
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ export type CountryStatisticType = "development" | "citizens" | "builders" | "buildings" | "miners" | "todaycitizens" | "productivity" | "activecitizens" | "damagetoday" | "damage" | "strength" | "regions" | "npcwage";
2
+ export type RankedEntity = {
3
+ id: number;
4
+ name: string;
5
+ avatar: string;
6
+ };
7
+ export type RankingItem = {
8
+ entity: RankedEntity;
9
+ value: number;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,52 @@
1
+ export type WarNation = {
2
+ id: number;
3
+ name: string;
4
+ avatar: string;
5
+ };
6
+ export type WarRegion = {
7
+ id: number;
8
+ name: string;
9
+ };
10
+ export type WarFlags = {
11
+ is_revolution: 0 | 1;
12
+ };
13
+ export type War = {
14
+ id: number;
15
+ attackers: WarNation;
16
+ defenders: WarNation;
17
+ region: WarRegion;
18
+ attackers_score: number;
19
+ defenders_score: number;
20
+ current_round_number: number;
21
+ current_round_id: number;
22
+ flags: WarFlags;
23
+ };
24
+ export type WarRound = {
25
+ id: number;
26
+ end_date: string;
27
+ attackers_score: number;
28
+ defenders_score: number;
29
+ attackers_points: number;
30
+ defenders_points: number;
31
+ attackers_hero: number | null;
32
+ defenders_hero: number | null;
33
+ };
34
+ export type HitFighter = {
35
+ id: number;
36
+ type: "account";
37
+ };
38
+ export type WarHit = {
39
+ id: number;
40
+ fighter: HitFighter;
41
+ damage: number;
42
+ side: "ATTACKER" | "DEFENDER";
43
+ item_id: number | null;
44
+ created_at: string;
45
+ };
46
+ export type GetWarsParams = {
47
+ event_wars?: 0 | 1;
48
+ extra_details?: 0 | 1;
49
+ war_id?: number;
50
+ expired?: number;
51
+ page?: number;
52
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "eclesiar-sdk",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
7
10
  "exports": {
8
11
  ".": {
9
12
  "import": "./dist/index.js",
@@ -1,9 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { AccountData } from "@/types/accounts";
3
-
4
- export async function getAccount({
5
- account_id
6
- }: { account_id: number }): Promise<AccountData>{
7
- const params = new URLSearchParams({ account_id: String(account_id) });
8
- return apiFetch<AccountData>(`/account?${params.toString()}`)
9
- }
@@ -1,9 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { EquipmentItem } from "@/types/accounts";
3
-
4
- export async function getMyEquipment({
5
- page = 1
6
- }: { page?: number } = {}): Promise<EquipmentItem[]>{
7
- const params = new URLSearchParams({ page: String(page) });
8
- return apiFetch<EquipmentItem[]>(`/account/mine/equipments?${params.toString()}`)
9
- }
@@ -1,6 +0,0 @@
1
- import { AccountData, EquipmentItem } from "@/types";
2
-
3
- export interface AccountsApi {
4
- getAccount({ account_id }: { account_id: number }): Promise<AccountData>
5
- getMyEquipment(): Promise<EquipmentItem[]>;
6
- }
@@ -1,7 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { Nation } from "@/types/country";
3
-
4
- export async function getCountries(
5
- ): Promise<Nation[]>{
6
- return apiFetch<Nation[]>(`/countries`)
7
- }
@@ -1,13 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { Region } from "@/types/country";
3
-
4
- type GetCountryRegionsParams = {
5
- country_id: number;
6
- };
7
-
8
- export async function getCountryRegions({
9
- country_id
10
- }: GetCountryRegionsParams): Promise<Region[]>{
11
- const params = new URLSearchParams({ country_id: String(country_id) });
12
- return apiFetch<Region[]>(`/country/regions?${params.toString()}`)
13
- }
@@ -1,6 +0,0 @@
1
- import { Nation, Region } from "@/types";
2
-
3
- export interface CountriesApi {
4
- getCountries(): Promise<Nation[]>;
5
- getCountryRegions({ country_id }: { country_id: number }): Promise<Region[]>;
6
- }
@@ -1,14 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { MarketAuctionBid } from "@/types/market";
3
-
4
- export async function getAuctionBid({
5
- auction_id,
6
- page = 1,
7
- }: { auction_id: number; page?: number }): Promise<MarketAuctionBid[]> {
8
- const params = new URLSearchParams({
9
- auction_id: String(auction_id),
10
- page: String(page),
11
- });
12
-
13
- return apiFetch<MarketAuctionBid[]>(`/market/auction/bids/get?${params.toString()}`);
14
- }
@@ -1,13 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { MarketAuction } from "@/types/market";
3
-
4
- export async function getAuctions({
5
- finished = 0,
6
- page = 1,
7
- }: { finished?: 0 | 1; page?: number } = {}): Promise<MarketAuction[]> {
8
- const params = new URLSearchParams({
9
- finished: finished.toString(),
10
- page: page.toString(),
11
- });
12
- return apiFetch<MarketAuction[]>(`/market/auctions/get?${params.toString()}`);
13
- }
@@ -1,20 +0,0 @@
1
- import { apiFetch } from '@/client';
2
- import { MarketCoinOffer } from '@/types/market';
3
-
4
- export async function getCoinOffers({
5
- currency_id,
6
- transaction = 'BUY',
7
- page = 1,
8
- }: {
9
- currency_id: number;
10
- transaction?: 'BUY' | 'SELL';
11
- page?: number;
12
- }): Promise<MarketCoinOffer[]> {
13
- const query = new URLSearchParams({
14
- currency_id: String(currency_id),
15
- transaction: String(transaction),
16
- page: String(page),
17
- });
18
-
19
- return apiFetch<MarketCoinOffer[]>(`/market/coin/get?${query}`);
20
- }
@@ -1,20 +0,0 @@
1
- import { apiFetch } from '@/client';
2
- import { MarketItemOffer } from '@/types/market';
3
-
4
- export async function getItemOffers({
5
- country_id,
6
- item_id,
7
- page = 1,
8
- }: {
9
- country_id: number;
10
- item_id: number;
11
- page?: number;
12
- }): Promise<MarketItemOffer[]> {
13
- const query = new URLSearchParams({
14
- country_id: String(country_id),
15
- item_id: String(item_id),
16
- page: String(page),
17
- });
18
-
19
- return apiFetch<MarketItemOffer[]>(`/market/items/get?${query}`);
20
- }
@@ -1,19 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { MarketJobOffer } from "@/types/market";
3
-
4
- type GetJobsParams = {
5
- country_id: number;
6
- page?: number;
7
- };
8
-
9
- export async function getJobs({
10
- country_id,
11
- page = 1,
12
- }: GetJobsParams): Promise<MarketJobOffer[]> {
13
- const query = new URLSearchParams({
14
- country_id: String(country_id),
15
- page: String(page),
16
- });
17
-
18
- return apiFetch<MarketJobOffer[]>(`/market/jobs/get?${query}`);
19
- }
@@ -1,9 +0,0 @@
1
- import { MarketAuction, MarketAuctionBid, MarketCoinOffer, MarketItemOffer, MarketJobOffer } from "@/types";
2
-
3
- export interface MarketApi {
4
- getCoinOffers({ currency_id, transaction, page }: { currency_id: number, transaction: 'BUY' | 'SELL', page?: number }): Promise<MarketCoinOffer[]>;
5
- getItemOffers({ country_id, item_id, page }: { country_id: number, item_id: number, page?: number }): Promise<MarketItemOffer[]>;
6
- getJobs({ country_id, page }: { country_id: number, page?: number }): Promise<MarketJobOffer[]>;
7
- getAuctions({ finished, page }: { finished?: 0 | 1, page?: number }): Promise<MarketAuction[]>;
8
- getAuctionBid({ auction_id, page }: { auction_id: number, page?: number }): Promise<MarketAuctionBid[]>;
9
- }
@@ -1,9 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { ServerEquipment } from "@/types/server";
3
-
4
- export async function getServerEquipments(
5
- { page = 1 }: { page?: number } = {}
6
- ): Promise<ServerEquipment[]> {
7
- const params = new URLSearchParams({ page: String(page) });
8
- return apiFetch<ServerEquipment[]>(`/server/equipments?${params}`);
9
- }
@@ -1,9 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { ServerItem } from "@/types/server";
3
-
4
- export async function getServerItems(
5
- { page = 1 }: { page?: number } = {}
6
- ): Promise<ServerItem[]> {
7
- const params = new URLSearchParams({ page: String(page) });
8
- return apiFetch<ServerItem[]>(`/server/items?${params}`);
9
- }
@@ -1,6 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { ServerStatus } from "@/types/server";
3
-
4
- export async function getServerStatus(): Promise<ServerStatus[]> {
5
- return apiFetch<ServerStatus[]>("/server/status");
6
- }
@@ -1,6 +0,0 @@
1
- import { ServerEquipment, ServerItem, ServerStatus } from "@/types/server";
2
- export interface ServerApi {
3
- getServerStatus(): Promise<ServerStatus[]>;
4
- getServerItems({ page }: { page?: number }): Promise<ServerItem[]>;
5
- getServerEquipments({ page }: { page?: number }): Promise<ServerEquipment[]>;
6
- }
@@ -1,14 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { CountryStatisticType, RankingItem } from "@/types/statistics";
3
-
4
- type GetStatisticsParams = {
5
- statistic: CountryStatisticType;
6
- };
7
-
8
- export async function getStatistics({
9
- statistic,
10
- }: GetStatisticsParams): Promise<RankingItem[]> {
11
- const query = new URLSearchParams({ statistic });
12
-
13
- return apiFetch<RankingItem[]>(`/statistics/country?${query}`);
14
- }
@@ -1,5 +0,0 @@
1
- import { CountryStatisticType, RankingItem } from "@/types";
2
-
3
- export interface StatisticsApi {
4
- getStatistics({ statistic }: { statistic: CountryStatisticType }): Promise<RankingItem[]>;
5
- }
@@ -1,19 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { WarHit } from "@/types/wars";
3
-
4
- type GetWarRoundHitsParams = {
5
- war_round_id: number;
6
- page?: number;
7
- };
8
-
9
- export async function getWarRoundHits({
10
- war_round_id,
11
- page = 1,
12
- }: GetWarRoundHitsParams): Promise<WarHit[]> {
13
- const query = new URLSearchParams({
14
- war_round_id: String(war_round_id),
15
- page: String(page),
16
- });
17
-
18
- return apiFetch<WarHit[]>(`/war/round/hits?${query}`);
19
- }
@@ -1,11 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { WarRound } from "@/types/wars";
3
-
4
- type GetWarRoundsParams = {
5
- war_id: number;
6
- };
7
-
8
- export async function getWarRounds({ war_id }: GetWarRoundsParams): Promise<WarRound[]> {
9
- const query = new URLSearchParams({ war_id: String(war_id) });
10
- return apiFetch<WarRound[]>(`/war/rounds?${query}`);
11
- }
@@ -1,22 +0,0 @@
1
- import { apiFetch } from "@/client";
2
- import { GetWarsParams, War } from "@/types/wars";
3
-
4
-
5
-
6
- export async function getWars({
7
- event_wars = 0,
8
- extra_details = 0,
9
- war_id = 0,
10
- expired = 0,
11
- page = 1,
12
- }: GetWarsParams = {}): Promise<War[]> {
13
- const query = new URLSearchParams({
14
- event_wars: String(event_wars),
15
- extra_details: String(extra_details),
16
- war_id: String(war_id),
17
- expired: String(expired),
18
- page: String(page)
19
- });
20
-
21
- return apiFetch<War[]>(`/wars?${query}`);
22
- }
@@ -1,7 +0,0 @@
1
- import { WarRound, WarHit, War, GetWarsParams } from "@/types";
2
-
3
- export interface WarsApi {
4
- getWars(params: GetWarsParams): Promise<War[]>;
5
- getWarRounds({ war_id }: { war_id: number }): Promise<WarRound[]>;
6
- getWarRoundHits({ war_round_id }: { war_round_id: number }): Promise<WarHit[]>;
7
- }
package/src/client.ts DELETED
@@ -1,68 +0,0 @@
1
- import { accountsApi } from './api/accounts';
2
- import { countriesApi } from './api/countries';
3
- import { marketApi } from './api/market';
4
- import { serverApi } from './api/server';
5
- import { statisticsApi } from './api/statistics';
6
- import { warsApi } from './api/wars';
7
-
8
- import type { AccountsApi } from './api/accounts/types';
9
- import type { CountriesApi } from './api/countries/types';
10
- import type { MarketApi } from './api/market/types';
11
- import type { ServerApi } from './api/server/types';
12
- import type { StatisticsApi } from './api/statistics/types';
13
- import type { WarsApi } from './api/wars/types';
14
-
15
- type ApiResponse<T> = {
16
- code: number;
17
- description: string;
18
- data: T;
19
- };
20
-
21
- const BASE_URL = 'https://api.eclesiar.com';
22
-
23
- let token = '';
24
-
25
- export function setToken(newToken: string) {
26
- token = newToken;
27
- }
28
-
29
- export async function apiFetch<T>(
30
- endpoint: string,
31
- options: RequestInit = {}
32
- ): Promise<T> {
33
- const res = await fetch(`${BASE_URL}${endpoint}`, {
34
- ...options,
35
- headers: {
36
- Authorization: `Bearer ${token}`,
37
- ...(options.headers || {}),
38
- },
39
- });
40
-
41
- if (!res.ok) {
42
- throw new Error(
43
- `API Error: ${res.status} ${res.statusText} ${endpoint}`
44
- );
45
- }
46
-
47
- const json: ApiResponse<T> = await res.json();
48
-
49
- return json.data;
50
- }
51
-
52
- export interface SdkClient {
53
- accounts: AccountsApi;
54
- countries: CountriesApi;
55
- market: MarketApi;
56
- server: ServerApi;
57
- statistics: StatisticsApi;
58
- wars: WarsApi;
59
- }
60
-
61
- export const apiClient: SdkClient = {
62
- accounts: accountsApi,
63
- countries: countriesApi,
64
- market: marketApi,
65
- server: serverApi,
66
- statistics: statisticsApi,
67
- wars: warsApi,
68
- };
package/src/index.ts DELETED
@@ -1,10 +0,0 @@
1
- export { apiClient, setToken } from './client';
2
- export type {
3
- AccountsApi,
4
- CountriesApi,
5
- MarketApi,
6
- ServerApi,
7
- StatisticsApi,
8
- WarsApi,
9
- } from './api';
10
- export type { SdkClient } from './client';
@@ -1,6 +0,0 @@
1
- export * from './market';
2
- export * from './server';
3
- export * from './accounts'
4
- export * from './country'
5
- export * from './statistics'
6
- export * from './wars'
@@ -1,57 +0,0 @@
1
- export interface ApiResponse<T> {
2
- code: number;
3
- description: string;
4
- data: T;
5
- }
6
-
7
- export interface MarketCoinOffer {
8
- amount: number;
9
- rate: number;
10
- owner: {
11
- id: number;
12
- type: string;
13
- };
14
- }
15
-
16
- export interface MarketItemOffer {
17
- amount: number;
18
- rate: number;
19
- owner: {
20
- id: number;
21
- type: string;
22
- };
23
- }
24
-
25
- export interface MarketJobOffer {
26
- value: number;
27
- amount: number;
28
- economic_skill: number;
29
- currency_id: number;
30
- business_id: number;
31
- }
32
-
33
- export interface MarketAuction {
34
- id: number;
35
- item: {
36
- id: number;
37
- type: string;
38
- };
39
- owner: {
40
- id: number;
41
- type: string;
42
- };
43
- initial_bid: number;
44
- created_at: string;
45
- end_at: string;
46
- status: number;
47
- }
48
-
49
- export interface MarketAuctionBid {
50
- id: number;
51
- bid: number;
52
- created_at: string;
53
- owner: {
54
- id: number;
55
- type: string;
56
- };
57
- }
@@ -1,25 +0,0 @@
1
- export type CountryStatisticType =
2
- | "development"
3
- | "citizens"
4
- | "builders"
5
- | "buildings"
6
- | "miners"
7
- | "todaycitizens"
8
- | "productivity"
9
- | "activecitizens"
10
- | "damagetoday"
11
- | "damage"
12
- | "strength"
13
- | "regions"
14
- | "npcwage";
15
-
16
- export type RankedEntity = {
17
- id: number;
18
- name: string;
19
- avatar: string;
20
- }
21
-
22
- export type RankingItem = {
23
- entity: RankedEntity;
24
- value: number;
25
- }
package/src/types/wars.ts DELETED
@@ -1,59 +0,0 @@
1
- export type WarNation = {
2
- id: number;
3
- name: string;
4
- avatar: string;
5
- };
6
-
7
- export type WarRegion = {
8
- id: number;
9
- name: string;
10
- };
11
-
12
- export type WarFlags = {
13
- is_revolution: 0 | 1;
14
- };
15
-
16
- export type War = {
17
- id: number;
18
- attackers: WarNation;
19
- defenders: WarNation;
20
- region: WarRegion;
21
- attackers_score: number;
22
- defenders_score: number;
23
- current_round_number: number;
24
- current_round_id: number;
25
- flags: WarFlags;
26
- };
27
-
28
- export type WarRound = {
29
- id: number;
30
- end_date: string;
31
- attackers_score: number;
32
- defenders_score: number;
33
- attackers_points: number;
34
- defenders_points: number;
35
- attackers_hero: number | null;
36
- defenders_hero: number | null;
37
- };
38
-
39
- export type HitFighter = {
40
- id: number;
41
- type: "account";
42
- };
43
-
44
- export type WarHit = {
45
- id: number;
46
- fighter: HitFighter;
47
- damage: number;
48
- side: "ATTACKER" | "DEFENDER";
49
- item_id: number | null;
50
- created_at: string;
51
- };
52
-
53
- export type GetWarsParams = {
54
- event_wars?: 0 | 1;
55
- extra_details?: 0 | 1;
56
- war_id?: number;
57
- expired?: number;
58
- page?: number;
59
- };
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ES2022",
5
- "moduleResolution": "node",
6
- "outDir": "dist",
7
- "declaration": true,
8
- "emitDeclarationOnly": false,
9
- "strict": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true,
12
- "baseUrl": "./src",
13
- "paths": {
14
- "@/*": ["*"]
15
- }
16
- },
17
- "include": ["src"]
18
- }