dnf-api 0.6.3 → 0.6.5
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/bun.lockb +0 -0
- package/dist/index.js +21 -144
- package/dist/src/api/index.d.ts +2 -1
- package/dist/src/api/multi.d.ts +7 -0
- package/dist/src/util/static.d.ts +2 -1
- package/package.json +6 -4
- package/src/api/index.ts +2 -1
- package/src/api/items.ts +1 -1
- package/src/api/multi.ts +17 -0
- package/src/util/query.ts +1 -1
- package/src/util/static.ts +1 -0
package/dist/src/api/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as Characters from "./characters";
|
|
|
3
3
|
import * as Equip from "./characters.equip";
|
|
4
4
|
import * as Skill from "./characters.skill";
|
|
5
5
|
import * as Item from "./items";
|
|
6
|
+
import * as Multi from "./multi";
|
|
6
7
|
import * as Server from "./server";
|
|
7
8
|
import * as SetItem from "./setitems";
|
|
8
|
-
export { Action, Equip, Skill, Characters, Item, SetItem, Server };
|
|
9
|
+
export { Action, Equip, Skill, Characters, Item, SetItem, Server, Multi };
|
|
@@ -40,7 +40,8 @@ export declare enum BaseUri {
|
|
|
40
40
|
Auction = "df/auction",
|
|
41
41
|
AuctionSold = "df/auction-sold",
|
|
42
42
|
Item = "df/items",
|
|
43
|
-
SetItem = "df/setitems"
|
|
43
|
+
SetItem = "df/setitems",
|
|
44
|
+
Multi = "df/multi"
|
|
44
45
|
}
|
|
45
46
|
export declare enum reinforceType {
|
|
46
47
|
reinforce = "\uAC15\uD654",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dnf-api",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "던전 앤 파이터 API",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -18,16 +18,18 @@
|
|
|
18
18
|
"typescript": "5.5.3"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"dev": "bun --watch
|
|
21
|
+
"dev": "bun --watch test.ts",
|
|
22
22
|
"bundle": "tsc --declaration --emitDeclarationOnly --outDir dist && bun build src/index.ts --minify --target=bun --outfile dist/index.js",
|
|
23
|
-
"test
|
|
23
|
+
"dev:test": "bun --watch test.ts",
|
|
24
24
|
"test": "jest"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
28
|
"url": "git+https://github.com/k22pr/dnf-api.git"
|
|
29
29
|
},
|
|
30
|
-
"keywords": [
|
|
30
|
+
"keywords": [
|
|
31
|
+
"dnf"
|
|
32
|
+
],
|
|
31
33
|
"author": "서버지기",
|
|
32
34
|
"license": "MIT",
|
|
33
35
|
"bugs": {
|
package/src/api/index.ts
CHANGED
|
@@ -3,7 +3,8 @@ import * as Characters from "./characters";
|
|
|
3
3
|
import * as Equip from "./characters.equip";
|
|
4
4
|
import * as Skill from "./characters.skill";
|
|
5
5
|
import * as Item from "./items";
|
|
6
|
+
import * as Multi from "./multi";
|
|
6
7
|
import * as Server from "./server";
|
|
7
8
|
import * as SetItem from "./setitems";
|
|
8
9
|
|
|
9
|
-
export { Action, Equip, Skill, Characters, Item, SetItem, Server };
|
|
10
|
+
export { Action, Equip, Skill, Characters, Item, SetItem, Server, Multi };
|
package/src/api/items.ts
CHANGED
package/src/api/multi.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as Model from "../model";
|
|
2
|
+
import { type Params, Query, Static } from "../util";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 해당하는 아이템의 상세정보를 요청합니다.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} itemId 검색할 아이템의 ID
|
|
8
|
+
*/
|
|
9
|
+
export const items = (itemIdList: string[]) => {
|
|
10
|
+
const opt = {
|
|
11
|
+
base: Query.UriBuilder(Static.BaseUri.Multi, "items"),
|
|
12
|
+
params: {
|
|
13
|
+
itemIds: itemIdList.join(","),
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
return Query.Request<Model.Item.Detail[]>(opt);
|
|
17
|
+
};
|
package/src/util/query.ts
CHANGED
|
@@ -81,7 +81,7 @@ export default class Request {
|
|
|
81
81
|
if (res.statusCode !== 200) {
|
|
82
82
|
const resBody = (await res.body.json()) as Model.DnfResponse<T>;
|
|
83
83
|
const error: Model.DnfErrorResponse = {
|
|
84
|
-
url: showUrl(opt.url),
|
|
84
|
+
url: showUrl(opt.url ?? ""),
|
|
85
85
|
status: res.statusCode || 0,
|
|
86
86
|
statusText: "",
|
|
87
87
|
code: resBody.error?.code || "",
|