artifacts-api-client 1.7.0 → 2.1.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.
Files changed (46) hide show
  1. package/README.md +90 -88
  2. package/dist/api/artifacts-accounts.api.d.ts +11 -1
  3. package/dist/api/artifacts-accounts.api.js +26 -0
  4. package/dist/api/artifacts-achievements.api.d.ts +10 -0
  5. package/dist/api/artifacts-achievements.api.js +20 -0
  6. package/dist/api/artifacts-badges.api.d.ts +10 -0
  7. package/dist/api/artifacts-badges.api.js +20 -0
  8. package/dist/api/artifacts-characters.api.d.ts +10 -5
  9. package/dist/api/artifacts-characters.api.js +17 -10
  10. package/dist/api/artifacts-effects.api.d.ts +10 -0
  11. package/dist/api/artifacts-effects.api.js +20 -0
  12. package/dist/api/artifacts-events.api.d.ts +3 -1
  13. package/dist/api/artifacts-events.api.js +6 -0
  14. package/dist/api/artifacts-game-assistant.api.d.ts +11 -0
  15. package/dist/api/artifacts-game-assistant.api.js +20 -0
  16. package/dist/api/artifacts-gems-shop.api.d.ts +16 -0
  17. package/dist/api/artifacts-gems-shop.api.js +44 -0
  18. package/dist/api/artifacts-grand-exchange.api.d.ts +10 -5
  19. package/dist/api/artifacts-grand-exchange.api.js +14 -5
  20. package/dist/api/artifacts-leaderboard.api.d.ts +4 -2
  21. package/dist/api/artifacts-leaderboard.api.js +8 -2
  22. package/dist/api/artifacts-maps.api.d.ts +7 -3
  23. package/dist/api/artifacts-maps.api.js +13 -3
  24. package/dist/api/artifacts-my-account.api.d.ts +32 -3
  25. package/dist/api/artifacts-my-account.api.js +88 -3
  26. package/dist/api/artifacts-my-characters.api.d.ts +67 -24
  27. package/dist/api/artifacts-my-characters.api.js +159 -40
  28. package/dist/api/artifacts-npcs.api.d.ts +14 -0
  29. package/dist/api/artifacts-npcs.api.js +32 -0
  30. package/dist/api/artifacts-raids.api.d.ts +12 -0
  31. package/dist/api/artifacts-raids.api.js +26 -0
  32. package/dist/api/artifacts-season-rewards.api.d.ts +10 -0
  33. package/dist/api/artifacts-season-rewards.api.js +22 -0
  34. package/dist/api/artifacts-simulation.api.d.ts +8 -0
  35. package/dist/api/artifacts-simulation.api.js +17 -0
  36. package/dist/api/artifacts-skins.api.d.ts +10 -0
  37. package/dist/api/artifacts-skins.api.js +20 -0
  38. package/dist/api/artifacts-tasks.api.d.ts +14 -0
  39. package/dist/api/artifacts-tasks.api.js +30 -0
  40. package/dist/api/artifacts-token.api.d.ts +2 -2
  41. package/dist/api/artifacts.api.d.ts +28 -6
  42. package/dist/api/artifacts.api.js +45 -12
  43. package/dist/api/types/api-schema-bindings.types.d.ts +145 -34
  44. package/dist/api/types/api-schema.types.d.ts +13292 -2700
  45. package/dist/http-client/types/artifacts-http-client.types.d.ts +6 -6
  46. package/package.json +49 -42
package/README.md CHANGED
@@ -1,88 +1,90 @@
1
-
2
- # Api Client for [Artifacts](https://artifactsmmo.com)
3
- [![npm](https://img.shields.io/npm/v/artifacts-api-client.svg?maxAge=1000)](https://www.npmjs.com/package/artifacts-api-client)
4
- [![npm](https://img.shields.io/npm/l/artifacts-api-client.svg?maxAge=1000)](https://github.com/siranweb/artifacts-api-client/LICENSE.md)
5
-
6
- API wrapper for NodeJS and browsers with TypeScript support
7
-
8
- ## Installation
9
- ```bash
10
- npm i artifacts-api-client
11
- ```
12
-
13
- ## Usage
14
-
15
- `artifacts-api-client` fully implements [official API](https://api.artifactsmmo.com/docs).
16
-
17
- ```ts
18
- import { ArtifactsApi } from 'artifacts-api-client';
19
-
20
- // Initialization
21
- const artifactsApi = ArtifactsApi.create({
22
- token: 'TOKEN'
23
- });
24
-
25
- // Usage
26
- const status = await artifactsApi.getStatus();
27
- const resources = await artifactsApi.resources.getAll({
28
- min_level: 1,
29
- max_level: 10,
30
- })
31
- await artifactsApi.myCharacters.fight('name');
32
- ```
33
-
34
- Alternatively, you can set token later:
35
-
36
- ```js
37
- import { ArtifactsApi } from 'artifacts-api-client';
38
-
39
- const artifactsApi = ArtifactsApi.create();
40
-
41
- await artifactsApi.myCharacters.fight('name'); // <-- fail, auth required
42
-
43
- const { token } = await artifactsApi.token.generate('username', 'password');
44
- artifactsApi.setToken(token);
45
-
46
- await artifactsApi.myCharacters.fight('name'); // <-- now it works
47
- ```
48
-
49
- ## Error handling
50
- All artifacts API errors are wrapped with `ArtifactsError`.
51
- Keep in mind, that the others errors like `NetworkError` left as they are:
52
- ```js
53
- import { ArtifactsApi, ArtifactsError } from 'artifacts-api-client';
54
-
55
- const artifactsApi = ArtifactsApi.create({
56
- token: 'TOKEN'
57
- });
58
-
59
- try {
60
- await artifactsApi.myCharacters.fight('name');
61
- } catch (err) {
62
- if (err instanceof ArtifactsError) {
63
- console.error('Artifacts error', e.message, e.code, e.data);
64
- } else {
65
- throw e;
66
- }
67
- }
68
- ```
69
-
70
- ## Type bindings
71
- If package being used with TypeScript you'll probably need methods' types.
72
- They are available to import:
73
-
74
- ```ts
75
- import { ArtifactsApi, GetAllMapsApiResult, GetAllMapsApiQuery } from 'artifacts-api-client';
76
-
77
- const artifactsApi = ArtifactsApi.create({
78
- token: 'TOKEN'
79
- });
80
-
81
- function getMaps(params: GetAllMapsApiQuery): Promise<GetAllMapsApiResult> {
82
- // ... custom logic ...
83
- return artifactsApi.maps.getAll(params);
84
- };
85
- ```
86
-
87
- ## Develop
88
- Refer to [DEVELOPMENT.md](./DEVELOPMENT.md).
1
+ # Looking for maintainers
2
+ Contact me with discord (sirandev) or [telegram](https://t.me/sirandev) if you interested in.
3
+
4
+ # Api Client for [Artifacts](https://artifactsmmo.com)
5
+ [![npm](https://img.shields.io/npm/v/artifacts-api-client.svg?maxAge=1000)](https://www.npmjs.com/package/artifacts-api-client)
6
+ [![npm](https://img.shields.io/npm/l/artifacts-api-client.svg?maxAge=1000)](https://github.com/siranweb/artifacts-api-client/LICENSE.md)
7
+
8
+ API wrapper for NodeJS and browsers with TypeScript support
9
+
10
+ ## Installation
11
+ ```bash
12
+ npm i artifacts-api-client
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ `artifacts-api-client` fully implements [official API](https://api.artifactsmmo.com/docs).
18
+
19
+ ```ts
20
+ import { ArtifactsApi } from 'artifacts-api-client';
21
+
22
+ // Initialization
23
+ const artifactsApi = ArtifactsApi.create({
24
+ token: 'TOKEN'
25
+ });
26
+
27
+ // Usage
28
+ const status = await artifactsApi.getStatus();
29
+ const resources = await artifactsApi.resources.getAll({
30
+ min_level: 1,
31
+ max_level: 10,
32
+ })
33
+ await artifactsApi.myCharacters.fight('name');
34
+ ```
35
+
36
+ Alternatively, you can set token later:
37
+
38
+ ```js
39
+ import { ArtifactsApi } from 'artifacts-api-client';
40
+
41
+ const artifactsApi = ArtifactsApi.create();
42
+
43
+ await artifactsApi.myCharacters.fight('name'); // <-- fail, auth required
44
+
45
+ const { token } = await artifactsApi.token.generate('username', 'password');
46
+ artifactsApi.setToken(token);
47
+
48
+ await artifactsApi.myCharacters.fight('name'); // <-- now it works
49
+ ```
50
+
51
+ ## Error handling
52
+ All artifacts API errors are wrapped with `ArtifactsError`.
53
+ Keep in mind, that the others errors like `NetworkError` left as they are:
54
+ ```js
55
+ import { ArtifactsApi, ArtifactsError } from 'artifacts-api-client';
56
+
57
+ const artifactsApi = ArtifactsApi.create({
58
+ token: 'TOKEN'
59
+ });
60
+
61
+ try {
62
+ await artifactsApi.myCharacters.fight('name');
63
+ } catch (err) {
64
+ if (err instanceof ArtifactsError) {
65
+ console.error('Artifacts error', e.message, e.code, e.data);
66
+ } else {
67
+ throw e;
68
+ }
69
+ }
70
+ ```
71
+
72
+ ## Type bindings
73
+ If package being used with TypeScript you'll probably need methods' types.
74
+ They are available to import:
75
+
76
+ ```ts
77
+ import { ArtifactsApi, GetAllMapsApiResult, GetAllMapsApiQuery } from 'artifacts-api-client';
78
+
79
+ const artifactsApi = ArtifactsApi.create({
80
+ token: 'TOKEN'
81
+ });
82
+
83
+ function getMaps(params: GetAllMapsApiQuery): Promise<GetAllMapsApiResult> {
84
+ // ... custom logic ...
85
+ return artifactsApi.maps.getAll(params);
86
+ };
87
+ ```
88
+
89
+ ## Develop
90
+ Refer to [DEVELOPMENT.md](./DEVELOPMENT.md).
@@ -1,8 +1,18 @@
1
1
  import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
- import { CreateAccountApiBody, CreateAccountApiResult } from './types/api-schema-bindings.types';
2
+ import { CreateAccountApiBody, CreateAccountApiResult, ForgotPasswordApiBody, ForgotPasswordApiResult, GetAccountAchievementsApiQuery, GetAccountAchievementsApiResult, GetAccountApiResult, GetAccountCharactersApiResult, ResetPasswordApiBody, ResetPasswordApiResult } from './types/api-schema-bindings.types';
3
3
  export declare class ArtifactsAccountsApi {
4
4
  private readonly httpClient;
5
5
  constructor(httpClient: ArtifactsHttpClient);
6
+ /** Retrieve the achievements of an account. */
7
+ getAchievements(account: string, params?: GetAccountAchievementsApiQuery): Promise<GetAccountAchievementsApiResult>;
8
+ /** Account character lists. */
9
+ getCharacters(account: string): Promise<GetAccountCharactersApiResult>;
6
10
  /** Create an account. */
7
11
  create(body: CreateAccountApiBody): Promise<CreateAccountApiResult>;
12
+ /** Request a password reset. */
13
+ forgotPassword(body: ForgotPasswordApiBody): Promise<ForgotPasswordApiResult>;
14
+ /** Reset password with a token. Use /forgot_password to get a token by email. */
15
+ resetPassword(body: ResetPasswordApiBody): Promise<ResetPasswordApiResult>;
16
+ /** Retrieve the details of an account. */
17
+ get(account: string): Promise<GetAccountApiResult>;
8
18
  }
@@ -6,11 +6,37 @@ class ArtifactsAccountsApi {
6
6
  constructor(httpClient) {
7
7
  this.httpClient = httpClient;
8
8
  }
9
+ /** Retrieve the achievements of an account. */
10
+ getAchievements(account, params) {
11
+ return this.httpClient.get(`/accounts/${account}/achievements`, {
12
+ query: params,
13
+ });
14
+ }
15
+ /** Account character lists. */
16
+ getCharacters(account) {
17
+ return this.httpClient.get(`/accounts/${account}/characters`);
18
+ }
9
19
  /** Create an account. */
10
20
  create(body) {
11
21
  return this.httpClient.post(`/accounts/create`, {
12
22
  body,
13
23
  });
14
24
  }
25
+ /** Request a password reset. */
26
+ forgotPassword(body) {
27
+ return this.httpClient.post(`/accounts/forgot_password`, {
28
+ body,
29
+ });
30
+ }
31
+ /** Reset password with a token. Use /forgot_password to get a token by email. */
32
+ resetPassword(body) {
33
+ return this.httpClient.post(`/accounts/reset_password`, {
34
+ body,
35
+ });
36
+ }
37
+ /** Retrieve the details of an account. */
38
+ get(account) {
39
+ return this.httpClient.get(`/accounts/${account}`);
40
+ }
15
41
  }
16
42
  exports.ArtifactsAccountsApi = ArtifactsAccountsApi;
@@ -0,0 +1,10 @@
1
+ import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
+ import { GetAchievementApiResult, GetAllAchievementsApiQuery, GetAllAchievementsApiResult } from './types/api-schema-bindings.types';
3
+ export declare class ArtifactsAchievementsApi {
4
+ private readonly httpClient;
5
+ constructor(httpClient: ArtifactsHttpClient);
6
+ /** List of all achievements. */
7
+ getAll(params?: GetAllAchievementsApiQuery): Promise<GetAllAchievementsApiResult>;
8
+ /** Retrieve the details of an achievement. */
9
+ get(code: string): Promise<GetAchievementApiResult>;
10
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArtifactsAchievementsApi = void 0;
4
+ class ArtifactsAchievementsApi {
5
+ httpClient;
6
+ constructor(httpClient) {
7
+ this.httpClient = httpClient;
8
+ }
9
+ /** List of all achievements. */
10
+ getAll(params = {}) {
11
+ return this.httpClient.get(`/achievements`, {
12
+ query: params,
13
+ });
14
+ }
15
+ /** Retrieve the details of an achievement. */
16
+ get(code) {
17
+ return this.httpClient.get(`/achievements/${code}`);
18
+ }
19
+ }
20
+ exports.ArtifactsAchievementsApi = ArtifactsAchievementsApi;
@@ -0,0 +1,10 @@
1
+ import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
+ import { GetAllBadgesApiQuery, GetAllBadgesApiResult, GetBadgeApiResult } from './types/api-schema-bindings.types';
3
+ export declare class ArtifactsBadgesApi {
4
+ private readonly httpClient;
5
+ constructor(httpClient: ArtifactsHttpClient);
6
+ /** List of all badges. */
7
+ getAll(params?: GetAllBadgesApiQuery): Promise<GetAllBadgesApiResult>;
8
+ /** Retrieve the details of a badge. */
9
+ get(code: string): Promise<GetBadgeApiResult>;
10
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArtifactsBadgesApi = void 0;
4
+ class ArtifactsBadgesApi {
5
+ httpClient;
6
+ constructor(httpClient) {
7
+ this.httpClient = httpClient;
8
+ }
9
+ /** List of all badges. */
10
+ getAll(params = {}) {
11
+ return this.httpClient.get(`/badges`, {
12
+ query: params,
13
+ });
14
+ }
15
+ /** Retrieve the details of a badge. */
16
+ get(code) {
17
+ return this.httpClient.get(`/badges/${code}`);
18
+ }
19
+ }
20
+ exports.ArtifactsBadgesApi = ArtifactsBadgesApi;
@@ -1,14 +1,19 @@
1
1
  import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
- import { CreateCharacterApiBody, CreateCharacterApiResult, DeleteCharacterApiBody, DeleteCharacterApiResult, GetAllCharactersApiQuery, GetAllCharactersApiResult, GetCharacterApiResult } from './types/api-schema-bindings.types';
2
+ import { CreateCharacterApiBody, CreateCharacterApiResult, DeleteCharacterApiBody, DeleteCharacterApiResult, GetActiveCharactersApiQuery, GetActiveCharactersApiResult, GetCharacterApiResult, GetCharacterStatsApiResult } from './types/api-schema-bindings.types';
3
3
  export declare class ArtifactsCharactersApi {
4
4
  private readonly httpClient;
5
5
  constructor(httpClient: ArtifactsHttpClient);
6
6
  /** Create new character on your account. You can create up to 5 characters. */
7
7
  create(body: CreateCharacterApiBody): Promise<CreateCharacterApiResult>;
8
- /** Fetch characters details. */
9
- getAll(params?: GetAllCharactersApiQuery): Promise<GetAllCharactersApiResult>;
10
- /** Fetch characters details. */
11
- get(name: string): Promise<GetCharacterApiResult>;
12
8
  /** Delete character on your account. */
13
9
  delete(body: DeleteCharacterApiBody): Promise<DeleteCharacterApiResult>;
10
+ /** Retrieve gameplay statistics for a character.
11
+
12
+ Stats are only visible if the character's account has an active subscription.
13
+ Statistics are still collected for all accounts regardless of subscription status. */
14
+ getStats(name: string): Promise<GetCharacterStatsApiResult>;
15
+ /** Fetch active characters details. */
16
+ getActive(params?: GetActiveCharactersApiQuery): Promise<GetActiveCharactersApiResult>;
17
+ /** Retrieve the details of a character. */
18
+ get(name: string): Promise<GetCharacterApiResult>;
14
19
  }
@@ -13,16 +13,6 @@ class ArtifactsCharactersApi {
13
13
  isSecure: true,
14
14
  });
15
15
  }
16
- /** Fetch characters details. */
17
- getAll(params = {}) {
18
- return this.httpClient.get(`/characters`, {
19
- query: params,
20
- });
21
- }
22
- /** Fetch characters details. */
23
- get(name) {
24
- return this.httpClient.get(`/characters/${name}`);
25
- }
26
16
  /** Delete character on your account. */
27
17
  delete(body) {
28
18
  return this.httpClient.post('/characters/delete', {
@@ -30,5 +20,22 @@ class ArtifactsCharactersApi {
30
20
  isSecure: true,
31
21
  });
32
22
  }
23
+ /** Retrieve gameplay statistics for a character.
24
+
25
+ Stats are only visible if the character's account has an active subscription.
26
+ Statistics are still collected for all accounts regardless of subscription status. */
27
+ getStats(name) {
28
+ return this.httpClient.get(`/characters/${name}/stats`);
29
+ }
30
+ /** Fetch active characters details. */
31
+ getActive(params = {}) {
32
+ return this.httpClient.get(`/characters/active`, {
33
+ query: params,
34
+ });
35
+ }
36
+ /** Retrieve the details of a character. */
37
+ get(name) {
38
+ return this.httpClient.get(`/characters/${name}`);
39
+ }
33
40
  }
34
41
  exports.ArtifactsCharactersApi = ArtifactsCharactersApi;
@@ -0,0 +1,10 @@
1
+ import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
+ import { GetAllEffectsApiQuery, GetAllEffectsApiResult, GetEffectApiResult } from './types/api-schema-bindings.types';
3
+ export declare class ArtifactsEffectsApi {
4
+ private readonly httpClient;
5
+ constructor(httpClient: ArtifactsHttpClient);
6
+ /** List of all effects. Effects are used by equipment, tools, runes, consumables and monsters. An effect is an action that produces an effect on the game. */
7
+ getAll(params?: GetAllEffectsApiQuery): Promise<GetAllEffectsApiResult>;
8
+ /** Retrieve the details of an effect. */
9
+ get(code: string): Promise<GetEffectApiResult>;
10
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArtifactsEffectsApi = void 0;
4
+ class ArtifactsEffectsApi {
5
+ httpClient;
6
+ constructor(httpClient) {
7
+ this.httpClient = httpClient;
8
+ }
9
+ /** List of all effects. Effects are used by equipment, tools, runes, consumables and monsters. An effect is an action that produces an effect on the game. */
10
+ getAll(params = {}) {
11
+ return this.httpClient.get(`/effects`, {
12
+ query: params,
13
+ });
14
+ }
15
+ /** Retrieve the details of an effect. */
16
+ get(code) {
17
+ return this.httpClient.get(`/effects/${code}`);
18
+ }
19
+ }
20
+ exports.ArtifactsEffectsApi = ArtifactsEffectsApi;
@@ -1,8 +1,10 @@
1
1
  import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
- import { GetAllEventsApiQuery, GetAllEventsApiResult } from './types/api-schema-bindings.types';
2
+ import { GetAllActiveEventsApiQuery, GetAllActiveEventsApiResult, GetAllEventsApiQuery, GetAllEventsApiResult } from './types/api-schema-bindings.types';
3
3
  export declare class ArtifactsEventsApi {
4
4
  private readonly httpClient;
5
5
  constructor(httpClient: ArtifactsHttpClient);
6
+ /** Fetch active events details. */
7
+ getAllActive(params?: GetAllActiveEventsApiQuery): Promise<GetAllActiveEventsApiResult>;
6
8
  /** Fetch events details. */
7
9
  getAll(params?: GetAllEventsApiQuery): Promise<GetAllEventsApiResult>;
8
10
  }
@@ -6,6 +6,12 @@ class ArtifactsEventsApi {
6
6
  constructor(httpClient) {
7
7
  this.httpClient = httpClient;
8
8
  }
9
+ /** Fetch active events details. */
10
+ getAllActive(params = {}) {
11
+ return this.httpClient.get(`/events/active`, {
12
+ query: params,
13
+ });
14
+ }
9
15
  /** Fetch events details. */
10
16
  getAll(params = {}) {
11
17
  return this.httpClient.get(`/events`, {
@@ -0,0 +1,11 @@
1
+ import { ArtifactsHttpClient } from "../http-client/artifacts.http-client";
2
+ import { AskGameAssistantApiBody, AskGameAssistantApiResult } from "./types/api-schema-bindings.types";
3
+ export declare class ArtifactsGameAssistantApi {
4
+ private readonly httpClient;
5
+ constructor(httpClient: ArtifactsHttpClient);
6
+ /** Ask the game assistant a question about game mechanics or public API usage.
7
+ * An active membership is required.
8
+ * Members receive a limited number of free questions per day.
9
+ * When no free question is available, the request can spend 1 gem with pay_with_gems=true. */
10
+ ask(body: AskGameAssistantApiBody): Promise<AskGameAssistantApiResult>;
11
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArtifactsGameAssistantApi = void 0;
4
+ class ArtifactsGameAssistantApi {
5
+ httpClient;
6
+ constructor(httpClient) {
7
+ this.httpClient = httpClient;
8
+ }
9
+ /** Ask the game assistant a question about game mechanics or public API usage.
10
+ * An active membership is required.
11
+ * Members receive a limited number of free questions per day.
12
+ * When no free question is available, the request can spend 1 gem with pay_with_gems=true. */
13
+ ask(body) {
14
+ return this.httpClient.post(`/game_assistant/ask`, {
15
+ body,
16
+ isSecure: true,
17
+ });
18
+ }
19
+ }
20
+ exports.ArtifactsGameAssistantApi = ArtifactsGameAssistantApi;
@@ -0,0 +1,16 @@
1
+ import { ArtifactsHttpClient } from "../http-client/artifacts.http-client";
2
+ import { BuyCustomDesignApiResult, BuySkinApiResult, BuySpawnEventApiResult, BuySubscriptionApiResult, GetCatalogApiResult } from "./types/api-schema-bindings.types";
3
+ export declare class ArtifactsGemsShopApi {
4
+ private readonly httpClient;
5
+ constructor(httpClient: ArtifactsHttpClient);
6
+ /** Return the gems shop catalog. */
7
+ get(): Promise<GetCatalogApiResult>;
8
+ /** Buy a skin from the gems shop using gems. */
9
+ buySkin(code: string): Promise<BuySkinApiResult>;
10
+ /** Spawn an event from the gems shop using gems. */
11
+ buySpawnEvent(code: string): Promise<BuySpawnEventApiResult>;
12
+ /** Buy or extend membership by 30 days using gems. Unavailable while a Stripe subscription is active. */
13
+ buySubscription(): Promise<BuySubscriptionApiResult>;
14
+ /** Buy a custom design using gems. */
15
+ buyCustomDesign(code: string): Promise<BuyCustomDesignApiResult>;
16
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArtifactsGemsShopApi = void 0;
4
+ class ArtifactsGemsShopApi {
5
+ httpClient;
6
+ constructor(httpClient) {
7
+ this.httpClient = httpClient;
8
+ }
9
+ /** Return the gems shop catalog. */
10
+ get() {
11
+ return this.httpClient.get(`/gems_shop/`);
12
+ }
13
+ /** Buy a skin from the gems shop using gems. */
14
+ buySkin(code) {
15
+ const body = { code };
16
+ return this.httpClient.post(`/gems_shop/skin`, {
17
+ body,
18
+ isSecure: true,
19
+ });
20
+ }
21
+ /** Spawn an event from the gems shop using gems. */
22
+ buySpawnEvent(code) {
23
+ const body = { code };
24
+ return this.httpClient.post(`/gems_shop/spawn_event`, {
25
+ body,
26
+ isSecure: true,
27
+ });
28
+ }
29
+ /** Buy or extend membership by 30 days using gems. Unavailable while a Stripe subscription is active. */
30
+ buySubscription() {
31
+ return this.httpClient.post(`/gems_shop/subscription`, {
32
+ isSecure: true,
33
+ });
34
+ }
35
+ /** Buy a custom design using gems. */
36
+ buyCustomDesign(code) {
37
+ const body = { code };
38
+ return this.httpClient.post(`/gems_shop/buy_custom_design`, {
39
+ body,
40
+ isSecure: true,
41
+ });
42
+ }
43
+ }
44
+ exports.ArtifactsGemsShopApi = ArtifactsGemsShopApi;
@@ -1,10 +1,15 @@
1
1
  import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
- import { GetAllGrandExchangeApiQuery, GetAllGrandExchangeApiResult, GetGrandExchangeApiResult } from './types/api-schema-bindings.types';
2
+ import { GetGrandExchangeSellHistoryApiQuery, GetGrandExchangeSellHistoryApiResult, GetGrandExchangeSellOrderApiResult, GetGrandExchangeSellOrdersApiQuery, GetGrandExchangeSellOrdersApiResult } from './types/api-schema-bindings.types';
3
3
  export declare class ArtifactsGrandExchangeApi {
4
4
  private readonly httpClient;
5
5
  constructor(httpClient: ArtifactsHttpClient);
6
- /** Fetch Grand Exchange items details. */
7
- getAll(params?: GetAllGrandExchangeApiQuery): Promise<GetAllGrandExchangeApiResult>;
8
- /** Retrieve the details of a Grand Exchange item. */
9
- get(code: string): Promise<GetGrandExchangeApiResult>;
6
+ /** Fetch the sales history of the item for the last 7 days (buy and sell orders). */
7
+ getHistory(code: string, params?: GetGrandExchangeSellHistoryApiQuery): Promise<GetGrandExchangeSellHistoryApiResult>;
8
+ /** Fetch all sell orders (sell and buy orders).
9
+
10
+ Use the type parameter to filter by order type;
11
+ when using account, type is required to keep account searches explicit.*/
12
+ getAll(params?: GetGrandExchangeSellOrdersApiQuery): Promise<GetGrandExchangeSellOrdersApiResult>;
13
+ /** Retrieve a specific order by ID. */
14
+ get(id: string): Promise<GetGrandExchangeSellOrderApiResult>;
10
15
  }
@@ -6,15 +6,24 @@ class ArtifactsGrandExchangeApi {
6
6
  constructor(httpClient) {
7
7
  this.httpClient = httpClient;
8
8
  }
9
- /** Fetch Grand Exchange items details. */
9
+ /** Fetch the sales history of the item for the last 7 days (buy and sell orders). */
10
+ getHistory(code, params = {}) {
11
+ return this.httpClient.get(`/grandexchange/history/${code}`, {
12
+ query: params,
13
+ });
14
+ }
15
+ /** Fetch all sell orders (sell and buy orders).
16
+
17
+ Use the type parameter to filter by order type;
18
+ when using account, type is required to keep account searches explicit.*/
10
19
  getAll(params = {}) {
11
- return this.httpClient.get(`/ge`, {
20
+ return this.httpClient.get('/grandexchange/orders', {
12
21
  query: params,
13
22
  });
14
23
  }
15
- /** Retrieve the details of a Grand Exchange item. */
16
- get(code) {
17
- return this.httpClient.get(`/ge/${code}`);
24
+ /** Retrieve a specific order by ID. */
25
+ get(id) {
26
+ return this.httpClient.get(`/grandexchange/orders/${id}`);
18
27
  }
19
28
  }
20
29
  exports.ArtifactsGrandExchangeApi = ArtifactsGrandExchangeApi;
@@ -1,8 +1,10 @@
1
1
  import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
- import { GetLeaderboardApiQuery, GetLeaderboardApiResult } from './types/api-schema-bindings.types';
2
+ import { GetAccountsLeaderboardApiQuery, GetAccountsLeaderboardApiResult, GetCharactersLeaderboardApiQuery, GetCharactersLeaderboardApiResult } from './types/api-schema-bindings.types';
3
3
  export declare class ArtifactsLeaderboardApi {
4
4
  private readonly httpClient;
5
5
  constructor(httpClient: ArtifactsHttpClient);
6
6
  /** Fetch leaderboard details. */
7
- getAll(params?: GetLeaderboardApiQuery): Promise<GetLeaderboardApiResult>;
7
+ getCharacters(params?: GetCharactersLeaderboardApiQuery): Promise<GetCharactersLeaderboardApiResult>;
8
+ /** Fetch leaderboard details. */
9
+ getAccounts(params?: GetAccountsLeaderboardApiQuery): Promise<GetAccountsLeaderboardApiResult>;
8
10
  }
@@ -7,8 +7,14 @@ class ArtifactsLeaderboardApi {
7
7
  this.httpClient = httpClient;
8
8
  }
9
9
  /** Fetch leaderboard details. */
10
- getAll(params = {}) {
11
- return this.httpClient.get(`/leaderboard`, {
10
+ getCharacters(params = {}) {
11
+ return this.httpClient.get(`/leaderboard/characters`, {
12
+ query: params,
13
+ });
14
+ }
15
+ /** Fetch leaderboard details. */
16
+ getAccounts(params = {}) {
17
+ return this.httpClient.get(`/leaderboard/accounts`, {
12
18
  query: params,
13
19
  });
14
20
  }
@@ -1,10 +1,14 @@
1
1
  import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
- import { GetAllMapsApiQuery, GetAllMapsApiResult, GetMapApiResult } from './types/api-schema-bindings.types';
2
+ import { GetAllMapsApiQuery, GetAllMapsApiResult, GetLayerMapsApiQuery, GetLayerMapsApiResult, GetMapByIdApiResult, GetMapByPositionApiResult } from './types/api-schema-bindings.types';
3
3
  export declare class ArtifactsMapsApi {
4
4
  private readonly httpClient;
5
5
  constructor(httpClient: ArtifactsHttpClient);
6
6
  /** Fetch maps details. */
7
7
  getAll(params?: GetAllMapsApiQuery): Promise<GetAllMapsApiResult>;
8
- /** Retrieve the details of a map. */
9
- get(x: number, y: number): Promise<GetMapApiResult>;
8
+ /** Fetch maps details. */
9
+ getLayerMaps(layer: 'interior' | 'overworld' | 'underground', params?: GetLayerMapsApiQuery): Promise<GetLayerMapsApiResult>;
10
+ /** Retrieve the details of a map by layer and coordinates. */
11
+ getByPosition(layer: 'interior' | 'overworld' | 'underground', x: number, y: number): Promise<GetMapByPositionApiResult>;
12
+ /** Retrieve the details of a map by its unique ID. */
13
+ getById(map_id: number): Promise<GetMapByIdApiResult>;
10
14
  }