artifacts-api-client 1.4.0 → 1.6.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/README.md CHANGED
@@ -83,3 +83,6 @@ function getMaps(params: GetAllMapsApiQuery): Promise<GetAllMapsApiResult> {
83
83
  return artifactsApi.maps.getAll(params);
84
84
  };
85
85
  ```
86
+
87
+ ## Develop
88
+ Refer to [DEVELOPMENT.md](./DEVELOPMENT.md).
@@ -0,0 +1,8 @@
1
+ import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
+ import { GetLeaderboardApiQuery, GetLeaderboardApiResult } from './types/api-schema-bindings.types';
3
+ export declare class ArtifactsLeaderboardApi {
4
+ private readonly httpClient;
5
+ constructor(httpClient: ArtifactsHttpClient);
6
+ /** Fetch leaderboard details. */
7
+ getAll(params?: GetLeaderboardApiQuery): Promise<GetLeaderboardApiResult>;
8
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArtifactsLeaderboardApi = void 0;
4
+ class ArtifactsLeaderboardApi {
5
+ httpClient;
6
+ constructor(httpClient) {
7
+ this.httpClient = httpClient;
8
+ }
9
+ /** Fetch leaderboard details. */
10
+ getAll(params = {}) {
11
+ return this.httpClient.get(`/leaderboard`, {
12
+ query: params,
13
+ });
14
+ }
15
+ }
16
+ exports.ArtifactsLeaderboardApi = ArtifactsLeaderboardApi;
@@ -1,12 +1,12 @@
1
1
  import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
- import { ChangePasswordApiBody, ChangePasswordApiResult, GetBankGoldApiResult, GetBankItemsApiQuery, GetBankItemsApiResult } from './types/api-schema-bindings.types';
2
+ import { ChangePasswordApiBody, ChangePasswordApiResult, GetBankApiResult, GetBankItemsApiQuery, GetBankItemsApiResult } from './types/api-schema-bindings.types';
3
3
  export declare class ArtifactsMyAccountApi {
4
4
  private readonly httpClient;
5
5
  constructor(httpClient: ArtifactsHttpClient);
6
6
  /** Fetch all items in your bank. */
7
7
  getBankItems(params?: GetBankItemsApiQuery): Promise<GetBankItemsApiResult>;
8
- /** Fetch golds in your bank. */
9
- getBankGold(): Promise<GetBankGoldApiResult>;
8
+ /** Fetch bank details. */
9
+ getBank(): Promise<GetBankApiResult>;
10
10
  /** Change your account password. Changing the password reset the account token. */
11
11
  changePassword(body: ChangePasswordApiBody): Promise<ChangePasswordApiResult>;
12
12
  }
@@ -13,9 +13,9 @@ class ArtifactsMyAccountApi {
13
13
  isSecure: true,
14
14
  });
15
15
  }
16
- /** Fetch golds in your bank. */
17
- getBankGold() {
18
- return this.httpClient.get(`/my/bank/gold`, {
16
+ /** Fetch bank details. */
17
+ getBank() {
18
+ return this.httpClient.get(`/my/bank`, {
19
19
  isSecure: true,
20
20
  });
21
21
  }
@@ -1,5 +1,5 @@
1
1
  import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
2
- import { CraftingApiBody, CraftingApiResult, DepositBankApiBody, DepositBankGoldApiBody, DepositBankGoldApiResult, DepositBankApiResult, EquipItemApiBody, EquipItemApiResult, FightApiResult, GatheringApiResult, MoveApiBody, MoveApiResult, UnequipItemApiBody, UnequipItemApiResult, WithdrawBankApiBody, WithdrawBankApiResult, WithdrawBankGoldApiBody, WithdrawBankGoldApiResult, RecyclingApiBody, RecyclingApiResult, BuyGrandExchangeItemApiBody, BuyGrandExchangeItemApiResult, SellGrandExchangeItemApiBody, SellGrandExchangeItemApiResult, DeleteItemApiBody, DeleteItemApiResult, AcceptTaskApiResult, CompleteTaskApiResult, ExchangeTaskApiResult, GetLogsApiResult, GetLogsApiQuery, GetMyCharactersApiResult } from './types/api-schema-bindings.types';
2
+ import { CraftingApiBody, CraftingApiResult, DepositBankApiBody, DepositBankGoldApiBody, DepositBankGoldApiResult, DepositBankApiResult, EquipItemApiBody, EquipItemApiResult, FightApiResult, GatheringApiResult, MoveApiBody, MoveApiResult, UnequipItemApiBody, UnequipItemApiResult, WithdrawBankApiBody, WithdrawBankApiResult, WithdrawBankGoldApiBody, WithdrawBankGoldApiResult, RecyclingApiBody, RecyclingApiResult, BuyGrandExchangeItemApiBody, BuyGrandExchangeItemApiResult, SellGrandExchangeItemApiBody, SellGrandExchangeItemApiResult, DeleteItemApiBody, DeleteItemApiResult, AcceptTaskApiResult, CompleteTaskApiResult, ExchangeTaskApiResult, GetLogsApiResult, GetLogsApiQuery, GetMyCharactersApiResult, CancelTaskApiResult, BuyExpansionApiResult } from './types/api-schema-bindings.types';
3
3
  export declare class ArtifactsMyCharactersApi {
4
4
  private readonly httpClient;
5
5
  constructor(httpClient: ArtifactsHttpClient);
@@ -44,4 +44,8 @@ export declare class ArtifactsMyCharactersApi {
44
44
  getLogs(params?: GetLogsApiQuery): Promise<GetLogsApiResult>;
45
45
  /** List of your characters. */
46
46
  getAll(): Promise<GetMyCharactersApiResult>;
47
+ /** Cancel a task for 1 tasks coin. */
48
+ cancelTask(name: string): Promise<CancelTaskApiResult>;
49
+ /** Buy a 20 slots bank expansion. */
50
+ buyBankExpansion(name: string): Promise<BuyExpansionApiResult>;
47
51
  }
@@ -128,5 +128,17 @@ class ArtifactsMyCharactersApi {
128
128
  isSecure: true,
129
129
  });
130
130
  }
131
+ /** Cancel a task for 1 tasks coin. */
132
+ cancelTask(name) {
133
+ return this.httpClient.post(`/my/${name}/action/task/cancel`, {
134
+ isSecure: true,
135
+ });
136
+ }
137
+ /** Buy a 20 slots bank expansion. */
138
+ buyBankExpansion(name) {
139
+ return this.httpClient.post(`/my/${name}/action/bank/buy_expansion`, {
140
+ isSecure: true,
141
+ });
142
+ }
131
143
  }
132
144
  exports.ArtifactsMyCharactersApi = ArtifactsMyCharactersApi;
@@ -12,6 +12,7 @@ import { ArtifactsGrandExchangeApi } from './artifacts-grand-exchange.api';
12
12
  import { ArtifactsAccountsApi } from './artifacts-accounts.api';
13
13
  import { ArtifactsTokenApi } from './artifacts-token.api';
14
14
  import { GetStatusApiResult } from './types/api-schema-bindings.types';
15
+ import { ArtifactsLeaderboardApi } from './artifacts-leaderboard.api';
15
16
  export declare class ArtifactsApi {
16
17
  private readonly httpClient;
17
18
  readonly myCharacters: ArtifactsMyCharactersApi;
@@ -25,6 +26,7 @@ export declare class ArtifactsApi {
25
26
  readonly events: ArtifactsEventsApi;
26
27
  readonly grandExchange: ArtifactsGrandExchangeApi;
27
28
  readonly token: ArtifactsTokenApi;
29
+ readonly leaderboard: ArtifactsLeaderboardApi;
28
30
  protected constructor(httpClient: ArtifactsHttpClient);
29
31
  static create(params?: ArtifactsApiParams): ArtifactsApi;
30
32
  getStatus(): Promise<GetStatusApiResult>;
@@ -13,6 +13,7 @@ const artifacts_events_api_1 = require("./artifacts-events.api");
13
13
  const artifacts_grand_exchange_api_1 = require("./artifacts-grand-exchange.api");
14
14
  const artifacts_accounts_api_1 = require("./artifacts-accounts.api");
15
15
  const artifacts_token_api_1 = require("./artifacts-token.api");
16
+ const artifacts_leaderboard_api_1 = require("./artifacts-leaderboard.api");
16
17
  class ArtifactsApi {
17
18
  httpClient;
18
19
  myCharacters;
@@ -26,6 +27,7 @@ class ArtifactsApi {
26
27
  events;
27
28
  grandExchange;
28
29
  token;
30
+ leaderboard;
29
31
  constructor(httpClient) {
30
32
  this.httpClient = httpClient;
31
33
  this.myCharacters = new artifacts_my_characters_api_1.ArtifactsMyCharactersApi(httpClient);
@@ -39,6 +41,7 @@ class ArtifactsApi {
39
41
  this.grandExchange = new artifacts_grand_exchange_api_1.ArtifactsGrandExchangeApi(httpClient);
40
42
  this.accounts = new artifacts_accounts_api_1.ArtifactsAccountsApi(httpClient);
41
43
  this.token = new artifacts_token_api_1.ArtifactsTokenApi(httpClient);
44
+ this.leaderboard = new artifacts_leaderboard_api_1.ArtifactsLeaderboardApi(httpClient);
42
45
  }
43
46
  static create(params = {}) {
44
47
  const httpClient = new artifacts_http_client_1.ArtifactsHttpClient(params.baseUrl ?? 'https://api.artifactsmmo.com', params.token ?? '');
@@ -36,31 +36,35 @@ export type CreateAccountApiBody = paths['/accounts/create']['post']['requestBod
36
36
  export type CreateAccountApiResult = paths['/accounts/create']['post']['responses'][200]['content']['application/json'];
37
37
  export type CreateCharacterApiBody = paths['/characters/create']['post']['requestBody']['content']['application/json'];
38
38
  export type CreateCharacterApiResult = paths['/accounts/create']['post']['responses'][200]['content']['application/json'];
39
- export type GetAllCharactersApiQuery = paths['/characters/']['get']['parameters']['query'];
40
- export type GetAllCharactersApiResult = paths['/characters/']['get']['responses'][200]['content']['application/json'];
39
+ export type GetAllCharactersApiQuery = paths['/characters']['get']['parameters']['query'];
40
+ export type GetAllCharactersApiResult = paths['/characters']['get']['responses'][200]['content']['application/json'];
41
41
  export type GetCharacterApiResult = paths['/characters/{name}']['get']['responses'][200]['content']['application/json'];
42
- export type GetAllEventsApiQuery = paths['/events/']['get']['parameters']['query'];
43
- export type GetAllEventsApiResult = paths['/events/']['get']['responses'][200]['content']['application/json'];
44
- export type GetAllGrandExchangeApiQuery = paths['/ge/']['get']['parameters']['query'];
45
- export type GetAllGrandExchangeApiResult = paths['/ge/']['get']['responses'][200]['content']['application/json'];
42
+ export type GetAllEventsApiQuery = paths['/events']['get']['parameters']['query'];
43
+ export type GetAllEventsApiResult = paths['/events']['get']['responses'][200]['content']['application/json'];
44
+ export type GetAllGrandExchangeApiQuery = paths['/ge']['get']['parameters']['query'];
45
+ export type GetAllGrandExchangeApiResult = paths['/ge']['get']['responses'][200]['content']['application/json'];
46
46
  export type GetGrandExchangeApiResult = paths['/ge/{code}']['get']['responses'][200]['content']['application/json'];
47
- export type GetAllItemsApiQuery = paths['/items/']['get']['parameters']['query'];
48
- export type GetAllItemsApiResult = paths['/items/']['get']['responses'][200]['content']['application/json'];
47
+ export type GetAllItemsApiQuery = paths['/items']['get']['parameters']['query'];
48
+ export type GetAllItemsApiResult = paths['/items']['get']['responses'][200]['content']['application/json'];
49
49
  export type GetItemApiResult = paths['/items/{code}']['get']['responses'][200]['content']['application/json'];
50
- export type GetAllMapsApiQuery = paths['/maps/']['get']['parameters']['query'];
51
- export type GetAllMapsApiResult = paths['/maps/']['get']['responses'][200]['content']['application/json'];
50
+ export type GetAllMapsApiQuery = paths['/maps']['get']['parameters']['query'];
51
+ export type GetAllMapsApiResult = paths['/maps']['get']['responses'][200]['content']['application/json'];
52
52
  export type GetMapApiResult = paths['/maps/{x}/{y}']['get']['responses'][200]['content']['application/json'];
53
- export type GetAllMonstersApiQuery = paths['/monsters/']['get']['parameters']['query'];
54
- export type GetAllMonstersApiResult = paths['/monsters/']['get']['responses'][200]['content']['application/json'];
53
+ export type GetAllMonstersApiQuery = paths['/monsters']['get']['parameters']['query'];
54
+ export type GetAllMonstersApiResult = paths['/monsters']['get']['responses'][200]['content']['application/json'];
55
55
  export type GetMonsterApiResult = paths['/monsters/{code}']['get']['responses'][200]['content']['application/json'];
56
56
  export type GetBankItemsApiQuery = paths['/my/bank/items']['get']['parameters']['query'];
57
57
  export type GetBankItemsApiResult = paths['/my/bank/items']['get']['responses'][200]['content']['application/json'];
58
- export type GetBankGoldApiResult = paths['/my/bank/gold']['get']['responses'][200]['content']['application/json'];
58
+ export type GetBankApiResult = paths['/my/bank']['get']['responses'][200]['content']['application/json'];
59
59
  export type ChangePasswordApiBody = paths['/my/change_password']['post']['requestBody']['content']['application/json'];
60
60
  export type ChangePasswordApiResult = paths['/my/change_password']['post']['responses'][200]['content']['application/json'];
61
- export type GetAllResourcesApiQuery = paths['/resources/']['get']['parameters']['query'];
62
- export type GetAllResourcesApiResult = paths['/resources/']['get']['responses'][200]['content']['application/json'];
61
+ export type GetAllResourcesApiQuery = paths['/resources']['get']['parameters']['query'];
62
+ export type GetAllResourcesApiResult = paths['/resources']['get']['responses'][200]['content']['application/json'];
63
63
  export type GetResourceApiResult = paths['/resources/{code}']['get']['responses'][200]['content']['application/json'];
64
- export type GenerateTokenResult = paths['/token/']['post']['responses'][200]['content']['application/json'];
64
+ export type GenerateTokenResult = paths['/token']['post']['responses'][200]['content']['application/json'];
65
65
  export type DeleteCharacterApiBody = paths['/characters/delete']['post']['requestBody']['content']['application/json'];
66
66
  export type DeleteCharacterApiResult = paths['/characters/delete']['post']['responses'][200]['content']['application/json'];
67
+ export type CancelTaskApiResult = paths['/my/{name}/action/task/cancel']['post']['responses'][200]['content']['application/json'];
68
+ export type BuyExpansionApiResult = paths['/my/{name}/action/bank/buy_expansion']['post']['responses'][200]['content']['application/json'];
69
+ export type GetLeaderboardApiResult = paths['/leaderboard']['get']['responses'][200]['content']['application/json'];
70
+ export type GetLeaderboardApiQuery = paths['/leaderboard']['get']['parameters']['query'];