-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepro_collection_fetch.ts
More file actions
33 lines (28 loc) · 1.05 KB
/
repro_collection_fetch.ts
File metadata and controls
33 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { PetSimulator99API } from './src/ps99-api';
const api = new PetSimulator99API();
async function run() {
console.log("Fetching Eggs collection...");
try {
const response = await api.getCollection("Eggs");
if (response.status === "ok") {
const items = response.data;
console.log(`Got ${items.length} items.`);
// Log the first 5 items fully to see structure
items.slice(0, 5).forEach((item, index) => {
console.log(`\nItem ${index}:`);
console.log(JSON.stringify(item, null, 2));
});
// Allow looking for a specific item if needed
const egg16 = items.find(i => i.configName.includes("Exclusive Egg 16"));
if (egg16) {
console.log("\nExclusive Egg 16:");
console.log(JSON.stringify(egg16, null, 2));
}
} else {
console.error("Error status:", response);
}
} catch (error) {
console.error("Error fetching:", error);
}
}
run();