@ix-xs/metamob.api 3.0.21 → 3.0.23
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/README.md +34 -49
- package/package.json +1 -1
- package/src/MetamobAPI.js +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#  [Metamob](https://metamob.fr)
|
|
2
2
|
|
|
3
|
-
<img align=right src="https://
|
|
3
|
+
<img align=right src="https://metamob.fr/img/ocre.png">
|
|
4
4
|
<div>
|
|
5
5
|
<div>
|
|
6
6
|
<h3>Complétez votre quête du Dofus Ocre</h3>
|
|
@@ -126,11 +126,18 @@ Toutes les requêtes retournent un objet JSON **normalisé** avec une structure
|
|
|
126
126
|
status: 200,
|
|
127
127
|
statusText: "OK",
|
|
128
128
|
data: [
|
|
129
|
-
{
|
|
130
|
-
|
|
129
|
+
{
|
|
130
|
+
username: "player1",
|
|
131
|
+
avatar: {
|
|
132
|
+
id: 123,
|
|
133
|
+
name: { fr: "Tofu", en: "Tofu", es: "Tofu" },
|
|
134
|
+
image: "tofu.png"
|
|
135
|
+
},
|
|
136
|
+
last_active: "2026-01-27 14:22:00"
|
|
137
|
+
}
|
|
131
138
|
],
|
|
132
139
|
pagination: {
|
|
133
|
-
total:
|
|
140
|
+
total: 5,
|
|
134
141
|
limit: 20,
|
|
135
142
|
offset: 0
|
|
136
143
|
}
|
|
@@ -303,28 +310,28 @@ getServers(options?: { server_name?: string })
|
|
|
303
310
|
|
|
304
311
|
#### Serveurs disponibles
|
|
305
312
|
|
|
306
|
-
|
|
|
307
|
-
|
|
|
308
|
-
| Brial
|
|
309
|
-
| Rafal
|
|
310
|
-
| Salar
|
|
311
|
-
| Kourial
|
|
312
|
-
| Dakal
|
|
313
|
-
| Mikhal
|
|
314
|
-
| Imagiro
|
|
315
|
-
| Hell Mina
|
|
316
|
-
| Tylezia
|
|
317
|
-
| Orukam
|
|
318
|
-
| Tal Kasha
|
|
319
|
-
| Draconiros |
|
|
320
|
-
| Ombre
|
|
321
|
-
| Fallanster |
|
|
322
|
-
| Boune
|
|
323
|
-
| Allisteria |
|
|
324
|
-
| Blair
|
|
325
|
-
| Kelerog
|
|
326
|
-
| Talok
|
|
327
|
-
| Tiliwan
|
|
313
|
+
| Serveur | Communauté | Version |
|
|
314
|
+
| --- | --- | --- |
|
|
315
|
+
| Brial | World | Dofus (Unity) |
|
|
316
|
+
| Rafal | World | Dofus (Unity) |
|
|
317
|
+
| Salar | World | Dofus (Unity) |
|
|
318
|
+
| Kourial | World | Dofus (Unity) |
|
|
319
|
+
| Dakal | World | Dofus (Unity) |
|
|
320
|
+
| Mikhal | World | Dofus (Unity) |
|
|
321
|
+
| Imagiro | France | Dofus (Unity) |
|
|
322
|
+
| Hell Mina | France | Dofus (Unity) |
|
|
323
|
+
| Tylezia | France | Dofus (Unity) |
|
|
324
|
+
| Orukam | France | Dofus (Unity) |
|
|
325
|
+
| Tal Kasha | World | Dofus (Unity) |
|
|
326
|
+
| Draconiros | World | Dofus (Unity) |
|
|
327
|
+
| Ombre | World | Dofus (Unity) |
|
|
328
|
+
| Fallanster | World | Dofus Retro (1.29) |
|
|
329
|
+
| Boune | World | Dofus Retro (1.29)
|
|
330
|
+
| Allisteria | World | Dofus Retro (1.29) |
|
|
331
|
+
| Blair | World | Dofus Touch |
|
|
332
|
+
| Kelerog | France | Dofus Touch
|
|
333
|
+
| Talok | World | Dofus Touch |
|
|
334
|
+
| Tiliwan | France | Dofus Touch |
|
|
328
335
|
|
|
329
336
|
#### Exemples
|
|
330
337
|
|
|
@@ -360,26 +367,6 @@ if (response.ok) {
|
|
|
360
367
|
}
|
|
361
368
|
```
|
|
362
369
|
|
|
363
|
-
**Grouper par communauté**
|
|
364
|
-
|
|
365
|
-
```javascript
|
|
366
|
-
const response = await client.getServers();
|
|
367
|
-
|
|
368
|
-
if (response.ok) {
|
|
369
|
-
const byRegion = response.data.reduce((acc, server) => {
|
|
370
|
-
if (!acc[server.community]) acc[server.community] = [];
|
|
371
|
-
acc[server.community].push(server.name);
|
|
372
|
-
return acc;
|
|
373
|
-
}, {});
|
|
374
|
-
|
|
375
|
-
console.log(byRegion);
|
|
376
|
-
// {
|
|
377
|
-
// France: ["Brial", "Rafal", ...],
|
|
378
|
-
// World: ["Brial", "Rafal", ...]
|
|
379
|
-
// }
|
|
380
|
-
}
|
|
381
|
-
```
|
|
382
|
-
|
|
383
370
|
---
|
|
384
371
|
|
|
385
372
|
### Types de monstres
|
|
@@ -655,7 +642,6 @@ getUser(username: string)
|
|
|
655
642
|
* @property {string} username - Nom d'utilisateur
|
|
656
643
|
* @property {string} bio - Biographie de l'utilisateur
|
|
657
644
|
* @property {UserAvatar} avatar - Avatar utilisateur
|
|
658
|
-
* @property {string} created_at - Date de création du compte (ISO 8601)
|
|
659
645
|
* @property {string} last_active - Dernière activité (ISO 8601)
|
|
660
646
|
*/
|
|
661
647
|
```
|
|
@@ -676,7 +662,6 @@ console.log(`
|
|
|
676
662
|
${user.username}
|
|
677
663
|
Avatar: ${user.avatar.name.fr}
|
|
678
664
|
Bio: ${user.bio || "Pas de bio"}
|
|
679
|
-
Compte créé: ${new Date(user.created_at).toLocaleDateString("fr-FR")}
|
|
680
665
|
Dernière activité: ${new Date(user.last_active).toLocaleDateString("fr-FR")}
|
|
681
666
|
`);
|
|
682
667
|
```
|
package/package.json
CHANGED
package/src/MetamobAPI.js
CHANGED
|
@@ -141,6 +141,8 @@ module.exports = class MetamobAPI {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
this.#api_key = api_key;
|
|
144
|
+
|
|
145
|
+
this.cache = cache;
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
/**
|
|
@@ -842,7 +844,6 @@ module.exports = class MetamobAPI {
|
|
|
842
844
|
* @property {string} username
|
|
843
845
|
* @property {string} bio
|
|
844
846
|
* @property {UserAvatar} avatar
|
|
845
|
-
* @property {string} created_at
|
|
846
847
|
* @property {string} last_active
|
|
847
848
|
|
|
848
849
|
* @param {string} username
|