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.
@@ -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 };
@@ -0,0 +1,7 @@
1
+ import type * as Model from "../model";
2
+ /**
3
+ * 해당하는 아이템의 상세정보를 요청합니다.
4
+ *
5
+ * @param {string} itemId 검색할 아이템의 ID
6
+ */
7
+ export declare const items: (itemIdList: string[]) => Promise<Model.DnfResponse<Model.Item.Detail[]>>;
@@ -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",
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 src/index.ts",
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:dev": "bun --watch test.ts",
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": ["dnf"],
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
@@ -17,7 +17,7 @@ export const item = async (itemName: string, params: Params.IItem = {}) => {
17
17
  params: {
18
18
  ...params,
19
19
  ...(params.hashtag
20
- ? { hashtag: Query.QueryBuilder(params.hashtag) }
20
+ ? { hashtag: Query.QueryBuilder(params.hashtag ?? []) }
21
21
  : {}),
22
22
  },
23
23
  };
@@ -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 || "",
@@ -42,6 +42,7 @@ export enum BaseUri {
42
42
  AuctionSold = "df/auction-sold",
43
43
  Item = "df/items",
44
44
  SetItem = "df/setitems",
45
+ Multi = "df/multi",
45
46
  }
46
47
 
47
48
  export enum reinforceType {