dnf-api 0.6.5 → 1.0.1

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/src/index.ts CHANGED
@@ -1,29 +1,35 @@
1
- import * as Request from "./api";
2
- import * as Model from "./model/index";
3
- import * as Util from "./util";
1
+ import * as request from "./api";
2
+ import * as model from "./model/index";
4
3
 
5
- import Config from "./util/config";
6
- import * as Params from "./util/params";
7
- import * as Query from "./util/query";
8
- import * as Static from "./util/static";
4
+ import config from "./util/config";
5
+ import * as params from "./util/params";
6
+ import * as query from "./util/query";
7
+ import * as staticUtil from "./util/static";
9
8
 
10
- // biome-ignore lint/complexity/noStaticOnlyClass: <explanation>
11
- export default class DnfApi {
12
- public static Util = Util;
13
- public static Request = Request;
14
- }
9
+ const serverNames = staticUtil.server;
10
+ const rarityNames = staticUtil.rarity;
15
11
 
16
- const ServerNames = Static.Server;
17
- const RarityNames = Static.Rarity;
12
+ const dnf = {
13
+ api: request,
14
+ request,
15
+ config,
16
+ staticUtil,
17
+ serverNames,
18
+ rarityNames,
19
+ query,
20
+ params,
21
+ model,
22
+ };
18
23
 
19
24
  export {
20
- Request as Api,
21
- Request,
22
- Config,
23
- Static,
24
- ServerNames,
25
- RarityNames,
26
- Query,
27
- Params,
28
- Model,
25
+ request as api,
26
+ request,
27
+ config,
28
+ staticUtil,
29
+ serverNames,
30
+ rarityNames,
31
+ query,
32
+ params,
33
+ model,
29
34
  };
35
+ export default dnf;
@@ -1,91 +1,98 @@
1
- import type { Static } from "../util";
2
- import type { NameValue } from "./";
3
-
4
- export type Character = {
5
- serverId: Static.Server;
6
- characterId: string;
7
- characterName: string;
8
- level: number;
9
- jobId: string;
10
- jobGrowId: string;
11
- jobName: string;
12
- jobGrowName: string;
13
- fame: number;
14
- };
15
-
16
- export type Info = {
17
- serverId: Static.Server;
18
- characterId: string;
19
- characterName: string;
20
- level: number;
21
- jobId: string;
22
- jobGrowId: string;
23
- jobName: string;
24
- jobGrowName: string;
25
- fame: number;
26
- adventureName: string;
27
- guildId: string | null;
28
- guildName: string | null;
29
- };
30
-
31
- export type Timeline = {
32
- serverId: Static.Server;
33
- characterId: string;
34
- characterName: string;
35
- level: number;
36
- jobId: string;
37
- jobGrowId: string;
38
- jobName: string;
39
- jobGrowName: string;
40
- adventureName: string;
41
- guildId: string;
42
- guildName: string;
43
- timeline: {
44
- date: {
45
- start: Date;
46
- end: Date;
47
- };
48
- next: string;
49
- rows: TimeLineRow[];
50
- };
51
- };
52
-
53
- export type TimeLineRow = {
54
- code: number;
55
- name: string;
56
- date: string;
57
- data: TimeLineRowData;
58
- };
59
-
60
- export type TimeLineRowData = {
61
- itemId: string;
62
- itemName: string;
63
- itemRarity: Static.Rarity;
64
- channelName: string;
65
- channelNo: number;
66
- dungeonName: string;
67
- mistGear: boolean;
68
- };
69
-
70
- export type CharacterStatus = {
71
- serverId: Static.Server;
72
- characterId: string;
73
- characterName: string;
74
- level: number;
75
- jobId: string;
76
- jobGrowId: string;
77
- jobName: string;
78
- jobGrowName: string;
79
- fame: number;
80
- adventureName: string;
81
- guildId: string | null;
82
- guildName: string | null;
83
- buff: Buff[];
84
- status: NameValue[];
85
- };
86
-
87
- export type Buff = {
88
- name: string;
89
- level?: number;
90
- status: NameValue[];
91
- };
1
+ import type { staticUtil } from "../util";
2
+ import type { INameValue } from "./";
3
+
4
+ /** 캐릭터 정보 인터페이스 */
5
+ export interface ICharacter {
6
+ serverId: staticUtil.server;
7
+ characterId: string;
8
+ characterName: string;
9
+ level: number;
10
+ jobId: string;
11
+ jobGrowId: string;
12
+ jobName: string;
13
+ jobGrowName: string;
14
+ fame: number;
15
+ }
16
+
17
+ /** 캐릭터 상세 정보 인터페이스 */
18
+ export interface IInfo {
19
+ serverId: staticUtil.server;
20
+ characterId: string;
21
+ characterName: string;
22
+ level: number;
23
+ jobId: string;
24
+ jobGrowId: string;
25
+ jobName: string;
26
+ jobGrowName: string;
27
+ fame: number;
28
+ adventureName: string;
29
+ guildId: string | null;
30
+ guildName: string | null;
31
+ }
32
+
33
+ /** 캐릭터 타임라인 인터페이스 */
34
+ export interface ITimeline {
35
+ serverId: staticUtil.server;
36
+ characterId: string;
37
+ characterName: string;
38
+ level: number;
39
+ jobId: string;
40
+ jobGrowId: string;
41
+ jobName: string;
42
+ jobGrowName: string;
43
+ adventureName: string;
44
+ guildId: string;
45
+ guildName: string;
46
+ timeline: {
47
+ date: {
48
+ start: Date;
49
+ end: Date;
50
+ };
51
+ next: string;
52
+ rows: ITimeLineRow[];
53
+ };
54
+ }
55
+
56
+ /** 타임라인 행 인터페이스 */
57
+ export interface ITimeLineRow {
58
+ code: number;
59
+ name: string;
60
+ date: string;
61
+ data: ITimeLineRowData;
62
+ }
63
+
64
+ /** 타임라인 행 데이터 인터페이스 */
65
+ export interface ITimeLineRowData {
66
+ itemId: string;
67
+ itemName: string;
68
+ itemRarity: staticUtil.rarity;
69
+ channelName: string;
70
+ channelNo: number;
71
+ dungeonName: string;
72
+ mistGear: boolean;
73
+ }
74
+
75
+ /** 캐릭터 상태 인터페이스 */
76
+ export interface ICharacterStatus {
77
+ serverId: staticUtil.server;
78
+ characterId: string;
79
+ characterName: string;
80
+ level: number;
81
+ jobId: string;
82
+ jobGrowId: string;
83
+ jobName: string;
84
+ jobGrowName: string;
85
+ fame: number;
86
+ adventureName: string;
87
+ guildId: string | null;
88
+ guildName: string | null;
89
+ buff: IBuff[];
90
+ status: INameValue[];
91
+ }
92
+
93
+ /** 버프 정보 인터페이스 */
94
+ export interface IBuff {
95
+ name: string;
96
+ level?: number;
97
+ status: INameValue[];
98
+ }
@@ -1,30 +1,35 @@
1
- import * as Char from "./character";
2
- import * as Item from "./item";
3
- import * as SetItem from "./setitem";
1
+ import * as char from "./character";
2
+ import * as item from "./item";
3
+ import * as setItem from "./setitem";
4
4
 
5
- export { Char, Item, SetItem };
5
+ export { char, item, setItem };
6
6
 
7
- export type DnfErrorResponse = {
7
+ /** 에러 응답 인터페이스 */
8
+ export interface IDnfErrorResponse {
8
9
  url: string;
9
10
  status: number;
10
11
  statusText: string;
11
12
  code: string;
12
13
  message: string;
13
- };
14
+ }
14
15
 
15
- export type DnfSuccess<T> = {
16
+ /** 성공 응답 인터페이스 */
17
+ export interface IDnfSuccess<T> {
16
18
  data: T;
17
19
  error?: never;
18
- };
20
+ }
19
21
 
20
- export type DnfError = {
22
+ /** 에러 정보 인터페이스 */
23
+ export interface IDnfError {
21
24
  data?: never;
22
- error: DnfErrorResponse;
23
- };
25
+ error: IDnfErrorResponse;
26
+ }
24
27
 
25
- export type DnfResponse<T> = DnfSuccess<T> | DnfError;
28
+ /** 응답 타입(합성 타입) */
29
+ export type IDnfResponse<T> = IDnfSuccess<T> | IDnfError;
26
30
 
27
- export type Auction = {
31
+ /** 경매장 아이템 인터페이스 */
32
+ export interface IAuction {
28
33
  auctionNo: number;
29
34
  regDate: Date;
30
35
  expireDate: Date;
@@ -48,9 +53,10 @@ export type Auction = {
48
53
  averagePrice: number;
49
54
  upgrade?: number;
50
55
  upgradeMax?: number;
51
- };
56
+ }
52
57
 
53
- export type AuctionSolid = {
58
+ /** 판매 완료 아이템 인터페이스 */
59
+ export interface IAuctionSolid {
54
60
  soldDate: string;
55
61
  itemId: string;
56
62
  itemName: string;
@@ -69,18 +75,21 @@ export type AuctionSolid = {
69
75
  unitPrice: number;
70
76
  upgrade?: number;
71
77
  upgradeMax?: number;
72
- };
78
+ }
73
79
 
74
- export type Rows<T> = {
80
+ /** 배열 인터페이스 */
81
+ export interface IRows<T> {
75
82
  rows: T[];
76
- };
83
+ }
77
84
 
78
- export type Server = {
85
+ /** 서버 정보 인터페이스 */
86
+ export interface IServer {
79
87
  serverId: string;
80
88
  serverName: string;
81
- };
89
+ }
82
90
 
83
- export type NameValue = {
91
+ /** 이름-값 인터페이스 */
92
+ export interface INameValue {
84
93
  name: string;
85
94
  value: string | number;
86
- };
95
+ }
package/src/model/item.ts CHANGED
@@ -1,104 +1,117 @@
1
- import type * as Static from "../util/static";
2
- import type { NameValue } from "./";
3
-
4
- export enum ItemDetailKind {
5
- Material = "material",
6
- Equip = "equip",
7
- }
8
-
9
- export type Item = {
10
- itemId: string;
11
- itemName: string;
12
- itemRarity: Static.Rarity;
13
- itemType: string;
14
- itemTypeDetail: string;
15
- itemAvailableLevel: number;
16
- };
17
-
18
- export type Detail = MaterialDetail | EquipDetail;
19
-
20
- export type MaterialDetail = {
21
- kind: ItemDetailKind.Material;
22
- itemId: string;
23
- itemName: string;
24
- itemRarity: string;
25
- itemTypeId: string;
26
- itemType: string;
27
- itemTypeDetailId: string;
28
- itemTypeDetail: string;
29
- itemAvailableLevel: number;
30
- itemExplain: string;
31
- itemExplainDetail: string;
32
- itemFlavorText: string;
33
- fame: number;
34
- setItemId: string | null;
35
- setItemName: string | null;
36
- obtainInfo: ObtainInfo;
37
- };
38
-
39
- export type EquipDetail = {
40
- kind: ItemDetailKind.Equip;
41
- itemId: string;
42
- itemName: string;
43
- itemRarity: string;
44
- itemTypeId: string;
45
- itemType: string;
46
- itemTypeDetailId: string;
47
- itemTypeDetail: string;
48
- itemAvailableLevel: number;
49
- itemExplain: string;
50
- itemExplainDetail: string;
51
- itemFlavorText: string;
52
- fame: number;
53
- setItemId: string | null;
54
- setItemName: string | null;
55
- itemStatus: NameValue[];
56
- tune: Tune;
57
- itemBuff: ItemBuff;
58
- hashtag: string[];
59
- obtainInfo: ObtainInfoDetail;
60
- };
61
-
62
- export type Tune = {
63
- level: number;
64
- setPoint: number;
65
- };
66
-
67
- export type ItemBuff = {
68
- explain: string;
69
- explainDetail: string;
70
- reinforceSkill: any[];
71
- status: any | null;
72
- };
73
-
74
- export type ObtainInfo = {
75
- dungeon: string | null;
76
- shop: ShopInfo[];
77
- };
78
-
79
- export type ObtainInfoDetail = {
80
- dungeon: Dungeon[];
81
- shop: ShopDetail[];
82
- };
83
-
84
- export type Dungeon = {
85
- type: string;
86
- rows: DungeonRow[];
87
- };
88
-
89
- export type DungeonRow = {
90
- name: string;
91
- };
92
-
93
- export type ShopInfo = {
94
- type: string;
95
- };
96
-
97
- export type ShopDetail = {
98
- rows: ShopRow[];
99
- };
100
-
101
- export type ShopRow = {
102
- name: string;
103
- details: string[];
104
- };
1
+ import type * as Static from "../util/static";
2
+ import type { INameValue } from "./";
3
+
4
+ export enum ItemDetailKind {
5
+ Material = "material",
6
+ Equip = "equip",
7
+ }
8
+
9
+ /** 아이템 인터페이스 */
10
+ export interface IItem {
11
+ itemId: string;
12
+ itemName: string;
13
+ itemRarity: Static.rarity;
14
+ itemType: string;
15
+ itemTypeDetail: string;
16
+ itemAvailableLevel: number;
17
+ }
18
+
19
+ /** 아이템 상세 인터페이스(합성 타입) */
20
+ export type IDetail = IMaterialDetail | IEquipDetail;
21
+
22
+ /** 재료 아이템 상세 인터페이스 */
23
+ export interface IMaterialDetail {
24
+ kind: ItemDetailKind.Material;
25
+ itemId: string;
26
+ itemName: string;
27
+ itemRarity: string;
28
+ itemTypeId: string;
29
+ itemType: string;
30
+ itemTypeDetailId: string;
31
+ itemTypeDetail: string;
32
+ itemAvailableLevel: number;
33
+ itemExplain: string;
34
+ itemExplainDetail: string;
35
+ itemFlavorText: string;
36
+ fame: number;
37
+ setItemId: string | null;
38
+ setItemName: string | null;
39
+ obtainInfo: IObtainInfo;
40
+ }
41
+
42
+ /** 장비 아이템 상세 인터페이스 */
43
+ export interface IEquipDetail {
44
+ kind: ItemDetailKind.Equip;
45
+ itemId: string;
46
+ itemName: string;
47
+ itemRarity: string;
48
+ itemTypeId: string;
49
+ itemType: string;
50
+ itemTypeDetailId: string;
51
+ itemTypeDetail: string;
52
+ itemAvailableLevel: number;
53
+ itemExplain: string;
54
+ itemExplainDetail: string;
55
+ itemFlavorText: string;
56
+ fame: number;
57
+ setItemId: string | null;
58
+ setItemName: string | null;
59
+ itemStatus: INameValue[];
60
+ tune: ITune;
61
+ itemBuff: IItemBuff;
62
+ hashtag: string[];
63
+ obtainInfo: IObtainInfoDetail;
64
+ }
65
+
66
+ /** 튠 정보 인터페이스 */
67
+ export interface ITune {
68
+ level: number;
69
+ setPoint: number;
70
+ }
71
+
72
+ /** 아이템 버프 인터페이스 */
73
+ export interface IItemBuff {
74
+ explain: string;
75
+ explainDetail: string;
76
+ reinforceSkill: any[];
77
+ status: any | null;
78
+ }
79
+
80
+ /** 획득 정보 인터페이스 */
81
+ export interface IObtainInfo {
82
+ dungeon: string | null;
83
+ shop: IShopInfo[];
84
+ }
85
+
86
+ /** 획득 상세 정보 인터페이스 */
87
+ export interface IObtainInfoDetail {
88
+ dungeon: IDungeon[];
89
+ shop: IShopDetail[];
90
+ }
91
+
92
+ /** 던전 정보 인터페이스 */
93
+ export interface IDungeon {
94
+ type: string;
95
+ rows: IDungeonRow[];
96
+ }
97
+
98
+ /** 던전 행 인터페이스 */
99
+ export interface IDungeonRow {
100
+ name: string;
101
+ }
102
+
103
+ /** 상점 정보 인터페이스 */
104
+ export interface IShopInfo {
105
+ type: string;
106
+ }
107
+
108
+ /** 상점 상세 정보 인터페이스 */
109
+ export interface IShopDetail {
110
+ rows: IShopRow[];
111
+ }
112
+
113
+ /** 상점 행 인터페이스 */
114
+ export interface IShopRow {
115
+ name: string;
116
+ details: string[];
117
+ }
@@ -1,9 +1,11 @@
1
- export type SetItem = {
1
+ /** 세트 아이템 인터페이스 */
2
+ export interface ISetItem {
2
3
  setItemId: string;
3
4
  setItemName: string;
4
- };
5
+ }
5
6
 
6
- export type Detail = {
7
+ /** 세트 아이템 상세 인터페이스 */
8
+ export interface IDetail {
7
9
  setItemId: string;
8
10
  setItemName: string;
9
11
  setItems: [
@@ -28,4 +30,4 @@ export type Detail = {
28
30
  ];
29
31
  }
30
32
  ];
31
- };
33
+ }
package/src/util/index.ts CHANGED
@@ -1,6 +1,6 @@
1
- import Config from "./config";
2
- import * as Params from "./params";
3
- import Query from "./query";
4
- import * as Static from "./static";
1
+ import config from "./config";
2
+ import * as params from "./params";
3
+ import query from "./query";
4
+ import * as staticUtil from "./static";
5
5
 
6
- export { Config, Query, Static, Params };
6
+ export { config, query, staticUtil, params };