artifacts-api-client 1.7.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/README.md +90 -88
- package/dist/api/artifacts-accounts.api.d.ts +11 -1
- package/dist/api/artifacts-accounts.api.js +26 -0
- package/dist/api/artifacts-achievements.api.d.ts +10 -0
- package/dist/api/artifacts-achievements.api.js +20 -0
- package/dist/api/artifacts-badges.api.d.ts +10 -0
- package/dist/api/artifacts-badges.api.js +20 -0
- package/dist/api/artifacts-characters.api.d.ts +5 -5
- package/dist/api/artifacts-characters.api.js +10 -10
- package/dist/api/artifacts-effects.api.d.ts +10 -0
- package/dist/api/artifacts-effects.api.js +20 -0
- package/dist/api/artifacts-events.api.d.ts +12 -1
- package/dist/api/artifacts-events.api.js +20 -0
- package/dist/api/artifacts-grand-exchange.api.d.ts +7 -5
- package/dist/api/artifacts-grand-exchange.api.js +11 -5
- package/dist/api/artifacts-leaderboard.api.d.ts +4 -2
- package/dist/api/artifacts-leaderboard.api.js +8 -2
- package/dist/api/artifacts-maps.api.d.ts +7 -3
- package/dist/api/artifacts-maps.api.js +13 -3
- package/dist/api/artifacts-my-account.api.d.ts +9 -3
- package/dist/api/artifacts-my-account.api.js +21 -3
- package/dist/api/artifacts-my-characters.api.d.ts +39 -20
- package/dist/api/artifacts-my-characters.api.js +112 -36
- package/dist/api/artifacts-npcs.api.d.ts +14 -0
- package/dist/api/artifacts-npcs.api.js +32 -0
- package/dist/api/artifacts-simulation.api.d.ts +8 -0
- package/dist/api/artifacts-simulation.api.js +17 -0
- package/dist/api/artifacts-tasks.api.d.ts +14 -0
- package/dist/api/artifacts-tasks.api.js +30 -0
- package/dist/api/artifacts.api.d.ts +18 -6
- package/dist/api/artifacts.api.js +30 -12
- package/dist/api/types/api-schema-bindings.types.d.ts +98 -29
- package/dist/api/types/api-schema.types.d.ts +9370 -2429
- package/dist/http-client/types/artifacts-http-client.types.d.ts +6 -6
- package/package.json +49 -42
package/README.md
CHANGED
|
@@ -1,88 +1,90 @@
|
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
+
[](https://www.npmjs.com/package/artifacts-api-client)
|
|
6
|
+
[](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
6
|
/** Create an account. */
|
|
7
7
|
create(body: CreateAccountApiBody): Promise<CreateAccountApiResult>;
|
|
8
|
+
/** Request a password reset. */
|
|
9
|
+
forgotPassword(body: ForgotPasswordApiBody): Promise<ForgotPasswordApiResult>;
|
|
10
|
+
/** Reset password with a token. Use /forgot_password to get a token by email. */
|
|
11
|
+
resetPassword(body: ResetPasswordApiBody): Promise<ResetPasswordApiResult>;
|
|
12
|
+
/** Retrieve the achievements of an account. */
|
|
13
|
+
getAchievements(account: string, params?: GetAccountAchievementsApiQuery): Promise<GetAccountAchievementsApiResult>;
|
|
14
|
+
/** Account character lists. */
|
|
15
|
+
getCharacters(account: string): Promise<GetAccountCharactersApiResult>;
|
|
16
|
+
/** Retrieve the details of an account. */
|
|
17
|
+
get(account: string): Promise<GetAccountApiResult>;
|
|
8
18
|
}
|
|
@@ -12,5 +12,31 @@ class ArtifactsAccountsApi {
|
|
|
12
12
|
body,
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
+
/** Request a password reset. */
|
|
16
|
+
forgotPassword(body) {
|
|
17
|
+
return this.httpClient.post(`/accounts/forgot_password`, {
|
|
18
|
+
body,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** Reset password with a token. Use /forgot_password to get a token by email. */
|
|
22
|
+
resetPassword(body) {
|
|
23
|
+
return this.httpClient.post(`/accounts/reset_password`, {
|
|
24
|
+
body,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Retrieve the achievements of an account. */
|
|
28
|
+
getAchievements(account, params) {
|
|
29
|
+
return this.httpClient.get(`/accounts/${account}/achievements`, {
|
|
30
|
+
query: params,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Account character lists. */
|
|
34
|
+
getCharacters(account) {
|
|
35
|
+
return this.httpClient.get(`/accounts/${account}/characters`);
|
|
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,14 @@
|
|
|
1
1
|
import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
|
|
2
|
-
import { CreateCharacterApiBody, CreateCharacterApiResult, DeleteCharacterApiBody, DeleteCharacterApiResult,
|
|
2
|
+
import { CreateCharacterApiBody, CreateCharacterApiResult, DeleteCharacterApiBody, DeleteCharacterApiResult, GetActiveCharactersApiQuery, GetActiveCharactersApiResult, GetCharacterApiResult } 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
|
+
/** Fetch active characters details. */
|
|
11
|
+
getActive(params?: GetActiveCharactersApiQuery): Promise<GetActiveCharactersApiResult>;
|
|
12
|
+
/** Retrieve the details of a character. */
|
|
13
|
+
get(name: string): Promise<GetCharacterApiResult>;
|
|
14
14
|
}
|
|
@@ -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,15 @@ class ArtifactsCharactersApi {
|
|
|
30
20
|
isSecure: true,
|
|
31
21
|
});
|
|
32
22
|
}
|
|
23
|
+
/** Fetch active characters details. */
|
|
24
|
+
getActive(params = {}) {
|
|
25
|
+
return this.httpClient.get(`/characters/active`, {
|
|
26
|
+
query: params,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/** Retrieve the details of a character. */
|
|
30
|
+
get(name) {
|
|
31
|
+
return this.httpClient.get(`/characters/${name}`);
|
|
32
|
+
}
|
|
33
33
|
}
|
|
34
34
|
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,19 @@
|
|
|
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, SpawnEventApiBody, SpawnEventApiResult } 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>;
|
|
10
|
+
/**
|
|
11
|
+
* Spawn a specific event by code consuming 1 event token.
|
|
12
|
+
*
|
|
13
|
+
* Rules:
|
|
14
|
+
* - Maximum active events defined by utils.config.max_active_events().
|
|
15
|
+
* - Event must not already be active.
|
|
16
|
+
* - Member or founder account required.
|
|
17
|
+
*/
|
|
18
|
+
spawn(body: SpawnEventApiBody): Promise<SpawnEventApiResult>;
|
|
8
19
|
}
|
|
@@ -6,11 +6,31 @@ 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`, {
|
|
12
18
|
query: params,
|
|
13
19
|
});
|
|
14
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Spawn a specific event by code consuming 1 event token.
|
|
23
|
+
*
|
|
24
|
+
* Rules:
|
|
25
|
+
* - Maximum active events defined by utils.config.max_active_events().
|
|
26
|
+
* - Event must not already be active.
|
|
27
|
+
* - Member or founder account required.
|
|
28
|
+
*/
|
|
29
|
+
spawn(body) {
|
|
30
|
+
return this.httpClient.post(`/events/spawn`, {
|
|
31
|
+
body,
|
|
32
|
+
isSecure: true,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
15
35
|
}
|
|
16
36
|
exports.ArtifactsEventsApi = ArtifactsEventsApi;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
|
|
2
|
-
import {
|
|
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
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
6
|
+
/** Fetch the sales history of the item for the last 7 days. */
|
|
7
|
+
getHistory(code: string, params?: GetGrandExchangeSellHistoryApiQuery): Promise<GetGrandExchangeSellHistoryApiResult>;
|
|
8
|
+
/** Fetch all sell orders. */
|
|
9
|
+
getAll(params?: GetGrandExchangeSellOrdersApiQuery): Promise<GetGrandExchangeSellOrdersApiResult>;
|
|
10
|
+
/** Retrieve the sell order of a item. */
|
|
11
|
+
get(id: string): Promise<GetGrandExchangeSellOrderApiResult>;
|
|
10
12
|
}
|
|
@@ -6,15 +6,21 @@ class ArtifactsGrandExchangeApi {
|
|
|
6
6
|
constructor(httpClient) {
|
|
7
7
|
this.httpClient = httpClient;
|
|
8
8
|
}
|
|
9
|
-
/** Fetch
|
|
9
|
+
/** Fetch the sales history of the item for the last 7 days. */
|
|
10
|
+
getHistory(code, params = {}) {
|
|
11
|
+
return this.httpClient.get(`/grandexchange/history/${code}`, {
|
|
12
|
+
query: params,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/** Fetch all sell orders. */
|
|
10
16
|
getAll(params = {}) {
|
|
11
|
-
return this.httpClient.get(
|
|
17
|
+
return this.httpClient.get('/grandexchange/orders', {
|
|
12
18
|
query: params,
|
|
13
19
|
});
|
|
14
20
|
}
|
|
15
|
-
/** Retrieve the
|
|
16
|
-
get(
|
|
17
|
-
return this.httpClient.get(`/
|
|
21
|
+
/** Retrieve the sell order of a item. */
|
|
22
|
+
get(id) {
|
|
23
|
+
return this.httpClient.get(`/grandexchange/orders/${id}`);
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
26
|
exports.ArtifactsGrandExchangeApi = ArtifactsGrandExchangeApi;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
|
|
2
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
-
/**
|
|
9
|
-
|
|
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
|
}
|
|
@@ -12,9 +12,19 @@ class ArtifactsMapsApi {
|
|
|
12
12
|
query: params,
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
return this.httpClient.get(`/maps/${
|
|
15
|
+
/** Fetch maps details. */
|
|
16
|
+
getLayerMaps(layer, params = {}) {
|
|
17
|
+
return this.httpClient.get(`/maps/${layer}`, {
|
|
18
|
+
query: params,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** Retrieve the details of a map by layer and coordinates. */
|
|
22
|
+
getByPosition(layer, x, y) {
|
|
23
|
+
return this.httpClient.get(`/maps/${layer}/${x}/${y}`);
|
|
24
|
+
}
|
|
25
|
+
/** Retrieve the details of a map by its unique ID. */
|
|
26
|
+
getById(map_id) {
|
|
27
|
+
return this.httpClient.get(`/maps/id/${map_id}`);
|
|
18
28
|
}
|
|
19
29
|
}
|
|
20
30
|
exports.ArtifactsMapsApi = ArtifactsMapsApi;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { ArtifactsHttpClient } from '../http-client/artifacts.http-client';
|
|
2
|
-
import { ChangePasswordApiBody, ChangePasswordApiResult, GetBankApiResult, GetBankItemsApiQuery, GetBankItemsApiResult } from './types/api-schema-bindings.types';
|
|
2
|
+
import { ChangePasswordApiBody, ChangePasswordApiResult, GetAccountDetailsApiResult, GetBankApiResult, GetBankItemsApiQuery, GetBankItemsApiResult, GetMyGrandExchangeSellHistoryApiRequest, GetMyGrandExchangeSellHistoryApiResult, GetMyGrandExchangeSellOrdersApiRequest, GetMyGrandExchangeSellOrdersApiResult } from './types/api-schema-bindings.types';
|
|
3
3
|
export declare class ArtifactsMyAccountApi {
|
|
4
4
|
private readonly httpClient;
|
|
5
5
|
constructor(httpClient: ArtifactsHttpClient);
|
|
6
|
-
/** Fetch all items in your bank. */
|
|
7
|
-
getBankItems(params?: GetBankItemsApiQuery): Promise<GetBankItemsApiResult>;
|
|
8
6
|
/** Fetch bank details. */
|
|
9
7
|
getBank(): Promise<GetBankApiResult>;
|
|
8
|
+
/** Fetch all items in your bank. */
|
|
9
|
+
getBankItems(params?: GetBankItemsApiQuery): Promise<GetBankItemsApiResult>;
|
|
10
|
+
/** Fetch your sell orders details. */
|
|
11
|
+
getGrandExchangeSellOrders(params?: GetMyGrandExchangeSellOrdersApiRequest): Promise<GetMyGrandExchangeSellOrdersApiResult>;
|
|
12
|
+
/** Fetch your sales history of the last 7 days. */
|
|
13
|
+
getGrandExchangeSellHistory(params?: GetMyGrandExchangeSellHistoryApiRequest): Promise<GetMyGrandExchangeSellHistoryApiResult>;
|
|
14
|
+
/** Fetch account details. */
|
|
15
|
+
get(): Promise<GetAccountDetailsApiResult>;
|
|
10
16
|
/** Change your account password. Changing the password reset the account token. */
|
|
11
17
|
changePassword(body: ChangePasswordApiBody): Promise<ChangePasswordApiResult>;
|
|
12
18
|
}
|
|
@@ -6,6 +6,12 @@ class ArtifactsMyAccountApi {
|
|
|
6
6
|
constructor(httpClient) {
|
|
7
7
|
this.httpClient = httpClient;
|
|
8
8
|
}
|
|
9
|
+
/** Fetch bank details. */
|
|
10
|
+
getBank() {
|
|
11
|
+
return this.httpClient.get(`/my/bank`, {
|
|
12
|
+
isSecure: true,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
9
15
|
/** Fetch all items in your bank. */
|
|
10
16
|
getBankItems(params = {}) {
|
|
11
17
|
return this.httpClient.get(`/my/bank/items`, {
|
|
@@ -13,12 +19,24 @@ class ArtifactsMyAccountApi {
|
|
|
13
19
|
isSecure: true,
|
|
14
20
|
});
|
|
15
21
|
}
|
|
16
|
-
/** Fetch
|
|
17
|
-
|
|
18
|
-
return this.httpClient.get(`/my/
|
|
22
|
+
/** Fetch your sell orders details. */
|
|
23
|
+
getGrandExchangeSellOrders(params = {}) {
|
|
24
|
+
return this.httpClient.get(`/my/grandexchange/orders`, {
|
|
25
|
+
query: params,
|
|
19
26
|
isSecure: true,
|
|
20
27
|
});
|
|
21
28
|
}
|
|
29
|
+
/** Fetch your sales history of the last 7 days. */
|
|
30
|
+
getGrandExchangeSellHistory(params = {}) {
|
|
31
|
+
return this.httpClient.get(`/my/grandexchange/history`, {
|
|
32
|
+
query: params,
|
|
33
|
+
isSecure: true,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** Fetch account details. */
|
|
37
|
+
get() {
|
|
38
|
+
return this.httpClient.get(`/my/details`, { isSecure: true });
|
|
39
|
+
}
|
|
22
40
|
/** Change your account password. Changing the password reset the account token. */
|
|
23
41
|
changePassword(body) {
|
|
24
42
|
return this.httpClient.post(`/my/change_password`, {
|