ps99-api 1.2.0 → 2.0.0
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/.idea/runConfigurations/test.xml +11 -0
- package/.idea/runConfigurations/test_changing.xml +11 -0
- package/.idea/runConfigurations/test_snapshot.xml +11 -0
- package/.idea/runConfigurations/test_snapshot_changing.xml +12 -0
- package/.idea/webResources.xml +14 -0
- package/.releaserc +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ps99-api.d.ts +3 -3
- package/dist/ps99-api.js +2 -2
- package/dist/ps99-api.js.map +1 -1
- package/dist/responses/collection/achievement.d.ts +2 -9
- package/dist/responses/collection/boost.d.ts +2 -9
- package/dist/responses/collection/booth.d.ts +15 -22
- package/dist/responses/collection/box.d.ts +14 -21
- package/dist/responses/collection/buff.d.ts +2 -9
- package/dist/responses/collection/charm.d.ts +13 -20
- package/dist/responses/collection/collection-data.d.ts +9 -0
- package/dist/responses/collection/collection-data.js +3 -0
- package/dist/responses/collection/collection-data.js.map +1 -0
- package/dist/responses/collection/currency.d.ts +22 -29
- package/dist/responses/collection/egg.d.ts +25 -31
- package/dist/responses/collection/enchantment.d.ts +18 -25
- package/dist/responses/collection/fishing-rod.d.ts +9 -16
- package/dist/responses/collection/fruit.d.ts +15 -22
- package/dist/responses/collection/guild-battle.d.ts +6 -13
- package/dist/responses/collection/hoverboard.d.ts +27 -34
- package/dist/responses/collection/index.d.ts +7 -5
- package/dist/responses/collection/lootbox.d.ts +12 -19
- package/dist/responses/collection/mastery.d.ts +5 -12
- package/dist/responses/collection/merchant.d.ts +6 -13
- package/dist/responses/collection/misc-item.d.ts +10 -17
- package/dist/responses/collection/pet.d.ts +20 -27
- package/dist/responses/collection/potion.d.ts +17 -24
- package/dist/responses/collection/random-event.d.ts +9 -16
- package/dist/responses/collection/rank.d.ts +7 -22
- package/dist/responses/collection/rarity.d.ts +6 -13
- package/dist/responses/collection/rebirth.d.ts +4 -11
- package/dist/responses/collection/secret-room.d.ts +4 -41
- package/dist/responses/collection/seed.d.ts +47 -1
- package/dist/responses/collection/shovel.d.ts +4 -11
- package/dist/responses/collection/sprinkler.d.ts +14 -21
- package/dist/responses/collection/ultimate.d.ts +17 -23
- package/dist/responses/collection/upgrade.d.ts +26 -33
- package/dist/responses/collection/watering-can.d.ts +5 -12
- package/dist/responses/collection/world.d.ts +6 -13
- package/dist/responses/collection/zone-flag.d.ts +14 -21
- package/dist/responses/collection/zone.d.ts +25 -102
- package/dump-result.js +16 -3
- package/example-web/react2/package-lock.json +45 -8
- package/example-web/react2/package.json +4 -3
- package/example-web/react2/public/_redirects +1 -0
- package/example-web/react2/public/index.html +1 -1
- package/example-web/react2/public/service-worker.js +2 -1
- package/example-web/react2/src/App.tsx +26 -141
- package/example-web/react2/src/components/AchievementsComponent.tsx +34 -30
- package/example-web/react2/src/components/BoostsComponent.tsx +17 -31
- package/example-web/react2/src/components/BoothsComponent.tsx +25 -31
- package/example-web/react2/src/components/BoxesComponent.tsx +28 -31
- package/example-web/react2/src/components/BuffsComponent.tsx +19 -31
- package/example-web/react2/src/components/CharmsComponent.tsx +33 -38
- package/example-web/react2/src/components/CollectionConfigIndex.tsx +53 -0
- package/example-web/react2/src/components/CollectionsIndex.tsx +33 -0
- package/example-web/react2/src/components/CurrencyComponent.tsx +58 -31
- package/example-web/react2/src/components/DynamicCollectionConfigData.tsx +94 -0
- package/example-web/react2/src/components/EggsComponent.tsx +55 -32
- package/example-web/react2/src/components/EnchantsComponent.tsx +37 -40
- package/example-web/react2/src/components/FishingRodsComponent.tsx +35 -31
- package/example-web/react2/src/components/FruitsComponent.tsx +29 -37
- package/example-web/react2/src/components/GenericFetchComponent.tsx +53 -0
- package/example-web/react2/src/components/GuildBattlesComponent.tsx +70 -40
- package/example-web/react2/src/components/Header.tsx +27 -0
- package/example-web/react2/src/components/HomePage.tsx +14 -0
- package/example-web/react2/src/components/HoverboardsComponent.tsx +40 -31
- package/example-web/react2/src/components/ImageComponent.tsx +37 -19
- package/example-web/react2/src/components/LootboxesComponent.tsx +19 -31
- package/example-web/react2/src/components/MasteryComponent.tsx +48 -30
- package/example-web/react2/src/components/MerchantsComponent.tsx +39 -28
- package/example-web/react2/src/components/MiscItemsComponent.tsx +28 -46
- package/example-web/react2/src/components/PetsComponent.tsx +53 -34
- package/example-web/react2/src/components/PotionsComponent.tsx +42 -37
- package/example-web/react2/src/components/RandomEventsComponent.tsx +39 -32
- package/example-web/react2/src/components/RanksComponent.tsx +80 -29
- package/example-web/react2/src/components/RarityComponent.tsx +18 -27
- package/example-web/react2/src/components/RebirthsComponent.tsx +32 -29
- package/example-web/react2/src/components/SecretRoomsComponent.tsx +18 -28
- package/example-web/react2/src/components/SeedsComponent.tsx +66 -31
- package/example-web/react2/src/components/ShovelsComponent.tsx +22 -32
- package/example-web/react2/src/components/SprinklersComponent.tsx +23 -32
- package/example-web/react2/src/components/UltimatesComponent.tsx +29 -33
- package/example-web/react2/src/components/UpgradesComponent.tsx +68 -43
- package/example-web/react2/src/components/WateringCansComponent.tsx +25 -34
- package/example-web/react2/src/components/WorldsComponent.tsx +31 -29
- package/example-web/react2/src/components/ZoneFlagsComponent.tsx +27 -32
- package/example-web/react2/src/components/ZonesComponent.tsx +84 -29
- package/example-web/react2/src/index.tsx +4 -2
- package/example-web/react2/tsconfig.json +1 -1
- package/example-web/react2/webpack.config.js +2 -6
- package/package.json +5 -3
- package/src/__tests__/__snapshots__/ps99-api-changes.ts.snap +9852 -7851
- package/src/__tests__/__snapshots__/ps99-api-live.ts.snap +1313 -86
- package/src/__tests__/ps99-api-changes.ts +1 -1
- package/src/index.ts +1 -0
- package/src/ps99-api.ts +5 -5
- package/src/responses/collection/achievement.ts +12 -9
- package/src/responses/collection/boost.ts +9 -9
- package/src/responses/collection/booth.ts +17 -22
- package/src/responses/collection/box.ts +16 -21
- package/src/responses/collection/buff.ts +4 -9
- package/src/responses/collection/charm.ts +14 -20
- package/src/responses/collection/collection-data.ts +14 -0
- package/src/responses/collection/currency.ts +27 -29
- package/src/responses/collection/egg.ts +26 -31
- package/src/responses/collection/enchantment.ts +19 -25
- package/src/responses/collection/fishing-rod.ts +13 -16
- package/src/responses/collection/fruit.ts +16 -22
- package/src/responses/collection/guild-battle.ts +10 -13
- package/src/responses/collection/hoverboard.ts +31 -34
- package/src/responses/collection/index.ts +10 -6
- package/src/responses/collection/lootbox.ts +13 -19
- package/src/responses/collection/mastery.ts +6 -12
- package/src/responses/collection/merchant.ts +7 -13
- package/src/responses/collection/misc-item.ts +11 -17
- package/src/responses/collection/pet.ts +21 -27
- package/src/responses/collection/potion.ts +18 -24
- package/src/responses/collection/random-event.ts +13 -16
- package/src/responses/collection/rank.ts +8 -24
- package/src/responses/collection/rarity.ts +7 -13
- package/src/responses/collection/rebirth.ts +5 -11
- package/src/responses/collection/secret-room.ts +8 -44
- package/src/responses/collection/seed.ts +55 -0
- package/src/responses/collection/shovel.ts +5 -11
- package/src/responses/collection/sprinkler.ts +15 -21
- package/src/responses/collection/ultimate.ts +18 -23
- package/src/responses/collection/upgrade.ts +27 -33
- package/src/responses/collection/watering-can.ts +9 -12
- package/src/responses/collection/world.ts +7 -13
- package/src/responses/collection/zone-flag.ts +15 -21
- package/src/responses/collection/zone.ts +26 -119
- package/.release.rc +0 -8
|
@@ -1,147 +1,32 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import EnchantsComponent from "./components/EnchantsComponent";
|
|
13
|
-
import FishingRodsComponent from "./components/FishingRodsComponent";
|
|
14
|
-
import FruitsComponent from "./components/FruitsComponent";
|
|
15
|
-
import GuildBattlesComponent from "./components/GuildBattlesComponent";
|
|
16
|
-
import HoverboardsComponent from "./components/HoverboardsComponent";
|
|
17
|
-
import LootboxesComponent from "./components/LootboxesComponent";
|
|
18
|
-
import MasteryComponent from "./components/MasteryComponent";
|
|
19
|
-
import MerchantsComponent from "./components/MerchantsComponent";
|
|
20
|
-
import MiscItemsComponent from "./components/MiscItemsComponent";
|
|
21
|
-
import PetsComponent from "./components/PetsComponent";
|
|
22
|
-
import PotionsComponent from "./components/PotionsComponent";
|
|
23
|
-
import RandomEventsComponent from "./components/RandomEventsComponent";
|
|
24
|
-
import RanksComponent from "./components/RanksComponent";
|
|
25
|
-
import RarityComponent from "./components/RarityComponent";
|
|
26
|
-
import RebirthsComponent from "./components/RebirthsComponent";
|
|
27
|
-
import SecretRoomsComponent from "./components/SecretRoomsComponent";
|
|
28
|
-
import SeedsComponent from "./components/SeedsComponent";
|
|
29
|
-
import ShovelsComponent from "./components/ShovelsComponent";
|
|
30
|
-
import SprinklersComponent from "./components/SprinklersComponent";
|
|
31
|
-
import UltimatesComponent from "./components/UltimatesComponent";
|
|
32
|
-
import UpgradesComponent from "./components/UpgradesComponent";
|
|
33
|
-
import WateringCansComponent from "./components/WateringCansComponent";
|
|
34
|
-
import WorldsComponent from "./components/WorldsComponent";
|
|
35
|
-
import ZoneFlagsComponent from "./components/ZoneFlagsComponent";
|
|
36
|
-
import ZonesComponent from "./components/ZonesComponent";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
BrowserRouter as Router,
|
|
4
|
+
Routes,
|
|
5
|
+
Route,
|
|
6
|
+
} from "react-router-dom";
|
|
7
|
+
import HomePage from "./components/HomePage";
|
|
8
|
+
import Header from "./components/Header";
|
|
9
|
+
import CollectionsIndex from "./components/CollectionsIndex";
|
|
10
|
+
import CollectionConfigIndex from "./components/CollectionConfigIndex";
|
|
11
|
+
import DynamicCollectionConfigData from "./components/DynamicCollectionConfigData";
|
|
37
12
|
|
|
38
13
|
const App: React.FC = () => {
|
|
39
|
-
const [collections, setCollections] = useState([]);
|
|
40
|
-
const [selectedCollection, setSelectedCollection] = useState<string | null>(
|
|
41
|
-
null,
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
const fetchCollections = async () => {
|
|
46
|
-
const api = new PetSimulator99API();
|
|
47
|
-
const response = await api.getCollections();
|
|
48
|
-
console.log("Fetched collections:", response); // Add this line
|
|
49
|
-
if (response.status === "ok") {
|
|
50
|
-
setCollections(response.data);
|
|
51
|
-
} else {
|
|
52
|
-
console.error("Failed to fetch collections", response); // Add this line
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
fetchCollections();
|
|
56
|
-
}, []);
|
|
57
|
-
|
|
58
|
-
const renderComponent = () => {
|
|
59
|
-
switch (selectedCollection) {
|
|
60
|
-
case "Achievements":
|
|
61
|
-
return <AchievementsComponent />;
|
|
62
|
-
case "Boosts":
|
|
63
|
-
return <BoostsComponent />;
|
|
64
|
-
case "Booths":
|
|
65
|
-
return <BoothsComponent />;
|
|
66
|
-
case "Boxes":
|
|
67
|
-
return <BoxesComponent />;
|
|
68
|
-
case "Buffs":
|
|
69
|
-
return <BuffsComponent />;
|
|
70
|
-
case "Charms":
|
|
71
|
-
return <CharmsComponent />;
|
|
72
|
-
case "Currency":
|
|
73
|
-
return <CurrencyComponent />;
|
|
74
|
-
case "Eggs":
|
|
75
|
-
return <EggsComponent />;
|
|
76
|
-
case "Enchants":
|
|
77
|
-
return <EnchantsComponent />;
|
|
78
|
-
case "FishingRods":
|
|
79
|
-
return <FishingRodsComponent />;
|
|
80
|
-
case "Fruits":
|
|
81
|
-
return <FruitsComponent />;
|
|
82
|
-
case "GuildBattles":
|
|
83
|
-
return <GuildBattlesComponent />;
|
|
84
|
-
case "Hoverboards":
|
|
85
|
-
return <HoverboardsComponent />;
|
|
86
|
-
case "Lootboxes":
|
|
87
|
-
return <LootboxesComponent />;
|
|
88
|
-
case "Mastery":
|
|
89
|
-
return <MasteryComponent />;
|
|
90
|
-
case "Merchants":
|
|
91
|
-
return <MerchantsComponent />;
|
|
92
|
-
case "MiscItems":
|
|
93
|
-
return <MiscItemsComponent />;
|
|
94
|
-
case "Pets":
|
|
95
|
-
return <PetsComponent />;
|
|
96
|
-
case "Potions":
|
|
97
|
-
return <PotionsComponent />;
|
|
98
|
-
case "RandomEvents":
|
|
99
|
-
return <RandomEventsComponent />;
|
|
100
|
-
case "Ranks":
|
|
101
|
-
return <RanksComponent />;
|
|
102
|
-
case "Rarity":
|
|
103
|
-
return <RarityComponent />;
|
|
104
|
-
case "Rebirths":
|
|
105
|
-
return <RebirthsComponent />;
|
|
106
|
-
case "SecretRooms":
|
|
107
|
-
return <SecretRoomsComponent />;
|
|
108
|
-
case "Seeds":
|
|
109
|
-
return <SeedsComponent />;
|
|
110
|
-
case "Shovels":
|
|
111
|
-
return <ShovelsComponent />;
|
|
112
|
-
case "Sprinklers":
|
|
113
|
-
return <SprinklersComponent />;
|
|
114
|
-
case "Ultimates":
|
|
115
|
-
return <UltimatesComponent />;
|
|
116
|
-
case "Upgrades":
|
|
117
|
-
return <UpgradesComponent />;
|
|
118
|
-
case "WateringCans":
|
|
119
|
-
return <WateringCansComponent />;
|
|
120
|
-
case "Worlds":
|
|
121
|
-
return <WorldsComponent />;
|
|
122
|
-
case "ZoneFlags":
|
|
123
|
-
return <ZoneFlagsComponent />;
|
|
124
|
-
case "Zones":
|
|
125
|
-
return <ZonesComponent />;
|
|
126
|
-
default:
|
|
127
|
-
return <div>Please select a collection</div>;
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
14
|
return (
|
|
132
|
-
<
|
|
133
|
-
<
|
|
134
|
-
<
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
15
|
+
<Router>
|
|
16
|
+
<Header />
|
|
17
|
+
<Routes>
|
|
18
|
+
<Route path="/" element={<HomePage />} />
|
|
19
|
+
<Route path="/collections" element={<CollectionsIndex />} />
|
|
20
|
+
<Route
|
|
21
|
+
path="/collections/:collectionName"
|
|
22
|
+
element={<CollectionConfigIndex />}
|
|
23
|
+
/>
|
|
24
|
+
<Route
|
|
25
|
+
path="/collections/:collectionName/:configName"
|
|
26
|
+
element={<DynamicCollectionConfigData />}
|
|
27
|
+
/>
|
|
28
|
+
</Routes>
|
|
29
|
+
</Router>
|
|
145
30
|
);
|
|
146
31
|
};
|
|
147
32
|
|
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
3
4
|
import ImageComponent from "./ImageComponent";
|
|
4
5
|
|
|
5
|
-
const AchievementsComponent: React.FC
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const fetchAchievements = async () => {
|
|
10
|
-
const api = new PetSimulator99API();
|
|
11
|
-
const response = await api.getCollection("Achievements");
|
|
12
|
-
if (response.status === "ok") {
|
|
13
|
-
setAchievements(response.data);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
fetchAchievements();
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
6
|
+
const AchievementsComponent: React.FC<{
|
|
7
|
+
configData?: CollectionConfigData<"Achievements">;
|
|
8
|
+
}> = ({ configData }) => {
|
|
19
9
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
10
|
+
<GenericFetchComponent<CollectionConfigData<"Achievements">>
|
|
11
|
+
collectionName="Achievements"
|
|
12
|
+
configData={configData}
|
|
13
|
+
render={(data) => (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>{data.Name}</h2>
|
|
16
|
+
<ImageComponent src={data.Icon} alt={data.Name} />
|
|
17
|
+
<ul>
|
|
18
|
+
{data.Tiers.map((tier, index) => (
|
|
19
|
+
<li key={index}>
|
|
20
|
+
<h3>{tier.Title}</h3>
|
|
21
|
+
<p>{tier.Desc.replace("{amount}", tier.Amount.toString())}</p>
|
|
22
|
+
<p>Difficulty: {tier.Difficulty.Name}</p>
|
|
23
|
+
<p>Amount: {tier.Amount}</p>
|
|
24
|
+
<ul>
|
|
25
|
+
{tier.Rewards.map((reward, rewardIndex) => (
|
|
26
|
+
<li key={rewardIndex}>
|
|
27
|
+
Reward ID: {reward.Reward._data.id} Amount:{" "}
|
|
28
|
+
{reward.Reward._data._am}
|
|
29
|
+
</li>
|
|
30
|
+
))}
|
|
31
|
+
</ul>
|
|
32
|
+
</li>
|
|
33
|
+
))}
|
|
34
|
+
</ul>
|
|
35
|
+
</div>
|
|
36
|
+
)}
|
|
37
|
+
/>
|
|
34
38
|
);
|
|
35
39
|
};
|
|
36
40
|
|
|
@@ -1,37 +1,23 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
3
4
|
import ImageComponent from "./ImageComponent";
|
|
4
5
|
|
|
5
|
-
const BoostsComponent: React.FC
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const fetchBoosts = async () => {
|
|
10
|
-
const api = new PetSimulator99API();
|
|
11
|
-
const response = await api.getCollection("Boosts");
|
|
12
|
-
if (response.status === "ok") {
|
|
13
|
-
setBoosts(response.data);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
fetchBoosts();
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
6
|
+
const BoostsComponent: React.FC<{
|
|
7
|
+
configData?: CollectionConfigData<"Boosts">;
|
|
8
|
+
}> = ({ configData }) => {
|
|
19
9
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</li>
|
|
32
|
-
))}
|
|
33
|
-
</ul>
|
|
34
|
-
</div>
|
|
10
|
+
<GenericFetchComponent<CollectionConfigData<"Boosts">>
|
|
11
|
+
collectionName="Boosts"
|
|
12
|
+
configData={configData}
|
|
13
|
+
render={(data) => (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>{data.DisplayName}</h2>
|
|
16
|
+
<ImageComponent src={data.Icon} alt={data.DisplayName} />
|
|
17
|
+
<p>Maximum Percent: {data.MaximumPercent}%</p>
|
|
18
|
+
</div>
|
|
19
|
+
)}
|
|
20
|
+
/>
|
|
35
21
|
);
|
|
36
22
|
};
|
|
37
23
|
|
|
@@ -1,37 +1,31 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
3
4
|
import ImageComponent from "./ImageComponent";
|
|
4
5
|
|
|
5
|
-
const BoothsComponent: React.FC
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const fetchBooths = async () => {
|
|
10
|
-
const api = new PetSimulator99API();
|
|
11
|
-
const response = await api.getCollection("Booths");
|
|
12
|
-
if (response.status === "ok") {
|
|
13
|
-
setBooths(response.data);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
fetchBooths();
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
6
|
+
const BoothsComponent: React.FC<{
|
|
7
|
+
configData?: CollectionConfigData<"Booths">;
|
|
8
|
+
}> = ({ configData }) => {
|
|
19
9
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
<GenericFetchComponent<CollectionConfigData<"Booths">>
|
|
11
|
+
collectionName="Booths"
|
|
12
|
+
configData={configData}
|
|
13
|
+
render={(data) => (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>{data.DisplayName}</h2>
|
|
16
|
+
<ImageComponent src={data.Icon} alt={data.DisplayName} />
|
|
17
|
+
<p>Description: {data.Desc}</p>
|
|
18
|
+
<p>Rarity: {data.Rarity.DisplayName}</p>
|
|
19
|
+
<p>Rarity Number: {data.Rarity.RarityNumber}</p>
|
|
20
|
+
{data.Hidden && <p>Hidden: Yes</p>}
|
|
21
|
+
{data.Tradable && <p>Tradable: Yes</p>}
|
|
22
|
+
{data.OffSale && <p>Off Sale: Yes</p>}
|
|
23
|
+
{data.ProductId && <p>Product ID: {data.ProductId}</p>}
|
|
24
|
+
{data.DiamondPrice && <p>Diamond Price: {data.DiamondPrice}</p>}
|
|
25
|
+
{data.Sittable && <p>Sittable: Yes</p>}
|
|
26
|
+
</div>
|
|
27
|
+
)}
|
|
28
|
+
/>
|
|
35
29
|
);
|
|
36
30
|
};
|
|
37
31
|
|
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
3
4
|
import ImageComponent from "./ImageComponent";
|
|
4
5
|
|
|
5
|
-
const BoxesComponent: React.FC
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const fetchBoxes = async () => {
|
|
10
|
-
const api = new PetSimulator99API();
|
|
11
|
-
const response = await api.getCollection("Boxes");
|
|
12
|
-
if (response.status === "ok") {
|
|
13
|
-
setBoxes(response.data);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
fetchBoxes();
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
6
|
+
const BoxesComponent: React.FC<{
|
|
7
|
+
configData?: CollectionConfigData<"Boxes">;
|
|
8
|
+
}> = ({ configData }) => {
|
|
19
9
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
<GenericFetchComponent<CollectionConfigData<"Boxes">>
|
|
11
|
+
collectionName="Boxes"
|
|
12
|
+
configData={configData}
|
|
13
|
+
render={(data) => (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>{data.DisplayName}</h2>
|
|
16
|
+
<p>Description: {data.Desc}</p>
|
|
17
|
+
<p>Capacity: {data.Capacity}</p>
|
|
18
|
+
<p>Rarity: {data.Rarity.DisplayName}</p>
|
|
19
|
+
<p>Rarity Number: {data.Rarity.RarityNumber}</p>
|
|
20
|
+
<h3>Icons:</h3>
|
|
21
|
+
<ul>
|
|
22
|
+
{data.Icons.map((icon, index) => (
|
|
23
|
+
<li key={index}>
|
|
24
|
+
<ImageComponent src={icon.Icon} alt={icon.Name} />
|
|
25
|
+
<span>{icon.Name}</span>
|
|
26
|
+
</li>
|
|
27
|
+
))}
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
)}
|
|
31
|
+
/>
|
|
35
32
|
);
|
|
36
33
|
};
|
|
37
34
|
|
|
@@ -1,36 +1,24 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const BuffsComponent: React.FC = () => {
|
|
5
|
-
const [buffs, setBuffs] = useState<BuffData[]>([]);
|
|
6
|
-
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
const fetchBuffs = async () => {
|
|
9
|
-
const api = new PetSimulator99API();
|
|
10
|
-
const response = await api.getCollection("Buffs");
|
|
11
|
-
if (response.status === "ok") {
|
|
12
|
-
setBuffs(response.data);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
fetchBuffs();
|
|
16
|
-
}, []);
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
17
4
|
|
|
5
|
+
const BuffsComponent: React.FC<{
|
|
6
|
+
configData?: CollectionConfigData<"Buffs">;
|
|
7
|
+
}> = ({ configData }) => {
|
|
18
8
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</ul>
|
|
33
|
-
</div>
|
|
9
|
+
<GenericFetchComponent<CollectionConfigData<"Buffs">>
|
|
10
|
+
collectionName="Buffs"
|
|
11
|
+
configData={configData}
|
|
12
|
+
render={(data) => (
|
|
13
|
+
<div>
|
|
14
|
+
<h2>{data.DisplayName}</h2>
|
|
15
|
+
<p>Associated Item ID: {data.AssociatedItemID}</p>
|
|
16
|
+
<p>Associated Item Class: {data.AssociatedItemClass}</p>
|
|
17
|
+
<p>Length: {data.Length} seconds</p>
|
|
18
|
+
{data.IgnoreInstancePause && <p>Ignore Instance Pause: Yes</p>}
|
|
19
|
+
</div>
|
|
20
|
+
)}
|
|
21
|
+
/>
|
|
34
22
|
);
|
|
35
23
|
};
|
|
36
24
|
|
|
@@ -1,45 +1,40 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionConfigData } from "ps99-api";
|
|
3
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
3
4
|
import ImageComponent from "./ImageComponent";
|
|
4
5
|
|
|
5
|
-
const CharmsComponent: React.FC
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const fetchCharms = async () => {
|
|
10
|
-
const api = new PetSimulator99API();
|
|
11
|
-
const response = await api.getCollection("Charms");
|
|
12
|
-
if (response.status === "ok") {
|
|
13
|
-
setCharms(response.data);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
fetchCharms();
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
6
|
+
const CharmsComponent: React.FC<{
|
|
7
|
+
configData?: CollectionConfigData<"Charms">;
|
|
8
|
+
}> = ({ configData }) => {
|
|
19
9
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
10
|
+
<GenericFetchComponent<CollectionConfigData<"Charms">>
|
|
11
|
+
collectionName="Charms"
|
|
12
|
+
configData={configData}
|
|
13
|
+
render={(data) => (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>{data.Tiers[0].DisplayName}</h2>
|
|
16
|
+
<ImageComponent src={data.Icon} alt={data.Tiers[0].DisplayName} />
|
|
17
|
+
<p>Base Tier: {data.BaseTier}</p>
|
|
18
|
+
<p>Max Tier: {data.MaxTier}</p>
|
|
19
|
+
{data.DiminishPowerThreshold && (
|
|
20
|
+
<p>Diminish Power Threshold: {data.DiminishPowerThreshold}</p>
|
|
21
|
+
)}
|
|
22
|
+
{data.Unique && <p>Unique: Yes</p>}
|
|
23
|
+
<h3>Tiers:</h3>
|
|
24
|
+
<ul>
|
|
25
|
+
{data.Tiers.map((tier, index) => (
|
|
26
|
+
<li key={index}>
|
|
27
|
+
<p>{tier.DisplayName}</p>
|
|
28
|
+
<p>Description: {tier.Desc}</p>
|
|
29
|
+
<p>Power: {tier.Power}</p>
|
|
30
|
+
<p>Rarity: {tier.Rarity.DisplayName}</p>
|
|
31
|
+
<p>Rarity Number: {tier.Rarity.RarityNumber}</p>
|
|
32
|
+
</li>
|
|
38
33
|
))}
|
|
39
|
-
</
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
</ul>
|
|
35
|
+
</div>
|
|
36
|
+
)}
|
|
37
|
+
/>
|
|
43
38
|
);
|
|
44
39
|
};
|
|
45
40
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { useParams, Link } from "react-router-dom";
|
|
3
|
+
import { PetSimulator99API, CollectionName } from "ps99-api";
|
|
4
|
+
|
|
5
|
+
const CollectionConfigIndex: React.FC = () => {
|
|
6
|
+
const { collectionName } = useParams<{ collectionName: CollectionName }>();
|
|
7
|
+
const [configNames, setConfigNames] = useState<string[]>([]);
|
|
8
|
+
const [error, setError] = useState<string | null>(null);
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const fetchConfigNames = async () => {
|
|
12
|
+
if (!collectionName) return;
|
|
13
|
+
|
|
14
|
+
const api = new PetSimulator99API();
|
|
15
|
+
const response = await api.getCollection(collectionName);
|
|
16
|
+
|
|
17
|
+
if (response.status === "ok") {
|
|
18
|
+
const names = response.data.map((item) => item.configName);
|
|
19
|
+
setConfigNames(names);
|
|
20
|
+
} else {
|
|
21
|
+
setError(response.error.message);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
fetchConfigNames();
|
|
26
|
+
}, [collectionName]);
|
|
27
|
+
|
|
28
|
+
if (error) {
|
|
29
|
+
return <div>Error: {error}</div>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div>
|
|
34
|
+
<h2>{collectionName} Configurations</h2>
|
|
35
|
+
<ul>
|
|
36
|
+
<li>
|
|
37
|
+
<Link to={`/collections/${collectionName}/all`}>All</Link>
|
|
38
|
+
</li>
|
|
39
|
+
{configNames.map((configName, index) => (
|
|
40
|
+
<li key={index}>
|
|
41
|
+
<Link
|
|
42
|
+
to={`/collections/${collectionName}/${encodeURIComponent(configName)}`}
|
|
43
|
+
>
|
|
44
|
+
{configName}
|
|
45
|
+
</Link>
|
|
46
|
+
</li>
|
|
47
|
+
))}
|
|
48
|
+
</ul>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default CollectionConfigIndex;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
import { PetSimulator99API, CollectionName } from "ps99-api";
|
|
4
|
+
|
|
5
|
+
const CollectionsIndex: React.FC = () => {
|
|
6
|
+
const [collections, setCollections] = useState<CollectionName[]>([]);
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const fetchCollections = async () => {
|
|
10
|
+
const api = new PetSimulator99API();
|
|
11
|
+
const response = await api.getCollections();
|
|
12
|
+
if (response.status === "ok") {
|
|
13
|
+
setCollections(response.data);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
fetchCollections();
|
|
17
|
+
}, []);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div>
|
|
21
|
+
<h2>Collections</h2>
|
|
22
|
+
<ul>
|
|
23
|
+
{collections.map((collection, index) => (
|
|
24
|
+
<li key={index}>
|
|
25
|
+
<Link to={`/collections/${collection}`}>{collection}</Link>
|
|
26
|
+
</li>
|
|
27
|
+
))}
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default CollectionsIndex;
|