dnf-api 2.0.4 → 3.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/src/api/items.ts DELETED
@@ -1,60 +0,0 @@
1
- import type * as model from "../model";
2
- import { type params, query, staticUtil } from "../util";
3
-
4
- /**
5
- * 현재 인게임에서 획득 가능한 아이템의 경우만 검색 가능합니다.
6
- *
7
- * @param {string} itemName 검색할 아이템의 명칭
8
- * @param {string} params 선택적 요청변수의 Object입니다.
9
- */
10
- export const item = async (itemName: string, params: params.IItem = {}) => {
11
- // if (params === undefined) params = {};
12
- params.itemName = itemName;
13
- // if (query) params.q = query.makeItemQuery(query);
14
- //let querystring =
15
- const opt = {
16
- base: query.UriBuilder(staticUtil.BaseUri.Item),
17
- params: {
18
- ...params,
19
- ...(params.hashtag
20
- ? { hashtag: query.QueryBuilder(params.hashtag ?? []) }
21
- : {}),
22
- },
23
- };
24
- return await query.Request<model.item.IItem>(opt);
25
- };
26
- /**
27
- * 해당하는 아이템의 상세정보를 요청합니다.
28
- *
29
- * @param {string} itemId 검색할 아이템의 ID
30
- */
31
- export const detail = (itemId: string) => {
32
- const opt = {
33
- base: query.UriBuilder(staticUtil.BaseUri.Item, itemId),
34
- };
35
- return query.Request<model.item.IDetail>(opt);
36
- };
37
-
38
- /**
39
- * 26. 아이템 상점 판매 정보 조회
40
- * 인게임 백과사전 기준의 상점 판매 95레벨 에픽, 100레벨 이상 유니크, 레전더리, 에픽 장비가 조회 가능 합니다.
41
- *
42
- * @param {string} itemId 검색할 아이템의 ID
43
- */
44
- export const shop = (itemId: string) => {
45
- const opt = {
46
- base: query.UriBuilder(staticUtil.BaseUri.Item, itemId, "shop"),
47
- };
48
- return query.Request<model.item.IShop>(opt);
49
- };
50
-
51
- /**
52
- * 28. 아이템 해시태그 조회
53
- * 아이템 검색에 사용 가능한 해시태그 목록을 조회합니다.
54
- */
55
- export const hashtag = () => {
56
- const opt = {
57
- base: query.UriBuilder(staticUtil.BaseUri.ItemHashtag),
58
- };
59
- return query.Request<model.item.IHashtag>(opt);
60
- };
package/src/api/jobs.ts DELETED
@@ -1,40 +0,0 @@
1
- import type * as model from "../model";
2
- import { query, staticUtil } from "../util";
3
-
4
- /**
5
- * 32. 직업 정보
6
- * 던전앤파이터 게임 내 모든 직업 정보를 조회합니다.
7
- */
8
- export const list = () => {
9
- const opt = {
10
- base: query.UriBuilder(staticUtil.BaseUri.Jobs),
11
- };
12
- return query.Request<model.job.IJob[]>(opt);
13
- };
14
-
15
- /**
16
- * 33. 직업별 스킬 리스트
17
- *
18
- * @param {string} jobId 캐릭터 직업 고유 코드
19
- * @param {string} jobGrowId 캐릭터 전직 직업 고유 코드
20
- */
21
- export const skills = (jobId: string, jobGrowId: string) => {
22
- const opt = {
23
- base: query.UriBuilder(staticUtil.BaseUri.Skills, jobId),
24
- params: { jobGrowId },
25
- };
26
- return query.Request<model.job.ISkillList>(opt);
27
- };
28
-
29
- /**
30
- * 34. 직업별 스킬 상세 정보 조회
31
- *
32
- * @param {string} jobId 캐릭터 직업 고유 코드
33
- * @param {string} skillId 스킬 고유 코드
34
- */
35
- export const skillDetail = (jobId: string, skillId: string) => {
36
- const opt = {
37
- base: query.UriBuilder(staticUtil.BaseUri.Skills, jobId, skillId),
38
- };
39
- return query.Request<model.job.ISkillDetail>(opt);
40
- };
package/src/api/multi.ts DELETED
@@ -1,52 +0,0 @@
1
- import type * as model from "../model";
2
- import { type params, query, staticUtil } 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(staticUtil.BaseUri.Multi, "items"),
12
- params: {
13
- itemIds: itemIdList.join(","),
14
- },
15
- };
16
- return query.Request<model.IRows<model.item.IDetail>>(opt);
17
- };
18
-
19
- /**
20
- * 31. 다중 세트 아이템 상세 정보 조회
21
- * 세트 아이템 최대 15개 조회 가능합니다.
22
- * 중복된 세트 아이템 ID 요청 시 중복된 항목은 제거 됩니다.
23
- *
24
- * @param {string[]} setItemIdList 세트 아이템 ID 배열
25
- */
26
- export const setItems = (setItemIdList: string[]) => {
27
- const opt = {
28
- base: query.UriBuilder(staticUtil.BaseUri.Multi, "setitems"),
29
- params: {
30
- setItemIds: setItemIdList.join(","),
31
- },
32
- };
33
- return query.Request<model.IRows<model.setItem.IDetail>>(opt);
34
- };
35
-
36
- /**
37
- * 35. 다중 스킬 상세 정보 조회
38
- * 스킬 목록 최대 10개 조회 가능합니다.
39
- * 중복된 스킬 ID 요청 시 중복된 항목은 제거 됩니다.
40
- *
41
- * @param {string} jobId 캐릭터 직업 고유 코드
42
- * @param {string[]} skillIdList 스킬 ID 배열
43
- */
44
- export const skills = (jobId: string, skillIdList: string[]) => {
45
- const opt = {
46
- base: query.UriBuilder(staticUtil.BaseUri.Multi, "skills", jobId),
47
- params: {
48
- skillIds: skillIdList.join(","),
49
- },
50
- };
51
- return query.Request<model.IRows<model.job.ISkillDetail>>(opt);
52
- };
package/src/api/server.ts DELETED
@@ -1,9 +0,0 @@
1
- import type * as Model from "../model";
2
- import { query, staticUtil } from "../util";
3
-
4
- export const list = () => {
5
- const opt = {
6
- base: query.UriBuilder(staticUtil.BaseUri.Servers),
7
- };
8
- return query.Request<Model.IServer[]>(opt);
9
- };
@@ -1,29 +0,0 @@
1
- import type * as Model from "../model";
2
- import { type params, query, staticUtil } from "../util";
3
-
4
- /**
5
- * 세트 아이템 정보를 세트의 이름으로 검색합니다.
6
- *
7
- * @param {string} setItemName 세트 아이템의 이름입니다.
8
- * @param {object} params 선택적 요청변수의 Object입니다.
9
- */
10
- export const setitem = (setItemName: string, params: params.ISetItem = {}) => {
11
- params.setItemName = setItemName;
12
- const opt = {
13
- base: query.UriBuilder(staticUtil.BaseUri.SetItem),
14
- params: params,
15
- };
16
- return query.Request<Model.setItem.ISetItem[]>(opt);
17
- };
18
-
19
- /**
20
- * 세트 ID로 세트 아이템 정보를 받아옵니다.
21
- *
22
- * @param {string} setItemId 세트 아이템의 ID입니다.
23
- */
24
- export const detail = (setItemId: string) => {
25
- const opt = {
26
- base: query.UriBuilder(staticUtil.BaseUri.SetItem, setItemId),
27
- };
28
- return query.Request<Model.setItem.IDetail>(opt);
29
- };
package/src/index.ts DELETED
@@ -1,28 +0,0 @@
1
- import * as request from "./api";
2
- import * as model from "./model/index";
3
- import * as util from "./util";
4
-
5
- import config from "./util/config";
6
- import * as params from "./util/params";
7
- import * as query from "./util/query";
8
- import * as staticUtil from "./util/static";
9
-
10
- export default class DnfApi {
11
- util = util;
12
- request = request;
13
- }
14
-
15
- const ServerNames = staticUtil.Server;
16
- const RarityNames = staticUtil.Rarity;
17
-
18
- export {
19
- request as api,
20
- request,
21
- config,
22
- staticUtil,
23
- ServerNames,
24
- RarityNames,
25
- query,
26
- params,
27
- model,
28
- };
@@ -1,48 +0,0 @@
1
- /** 경매장 아이템 인터페이스 */
2
- export interface IAuction {
3
- auctionNo: number;
4
- regDate: Date;
5
- expireDate: Date;
6
- itemId: string;
7
- itemName: string;
8
- itemAvailableLevel: number;
9
- itemRarity: string;
10
- itemTypeId: string;
11
- itemType: string;
12
- itemTypeDetailId: string;
13
- itemTypeDetail: string;
14
- refine: number;
15
- reinforce: number;
16
- amplificationName: string;
17
- fame: number;
18
- count: number;
19
- regCount: number;
20
- price: number;
21
- currentPrice: number;
22
- unitPrice: number;
23
- averagePrice: number;
24
- upgrade?: number;
25
- upgradeMax?: number;
26
- }
27
-
28
- /** 판매 완료 아이템 인터페이스 */
29
- export interface IAuctionSolid {
30
- soldDate: string;
31
- itemId: string;
32
- itemName: string;
33
- itemAvailableLevel: number;
34
- itemRarity: string;
35
- itemTypeId: string;
36
- itemType: string;
37
- itemTypeDetailId: string;
38
- itemTypeDetail: string;
39
- refine: number;
40
- reinforce: number;
41
- amplificationName: string | null;
42
- fame: number;
43
- count: number;
44
- price: number;
45
- unitPrice: number;
46
- upgrade?: number;
47
- upgradeMax?: number;
48
- }
@@ -1,70 +0,0 @@
1
- /** 아바타 마켓 상품 검색 결과 인터페이스 */
2
- export interface ISale {
3
- goodsNo: number;
4
- sellerId: string;
5
- sellerName: string;
6
- title: string;
7
- price: number;
8
- registDate: string;
9
- hashtag: string[];
10
- avatarCount: number;
11
- }
12
-
13
- /** 아바타 마켓 상품 상세 인터페이스 */
14
- export interface ISaleDetail extends ISale {
15
- avatar: IAvatarItem[];
16
- }
17
-
18
- /** 아바타 아이템 인터페이스 */
19
- export interface IAvatarItem {
20
- slotId: string;
21
- slotName: string;
22
- itemId: string;
23
- itemName: string;
24
- itemRarity: string;
25
- clone: ICloneAvatar;
26
- optionAbility: string | null;
27
- emblems: IEmblem[];
28
- }
29
-
30
- /** 클론 아바타 인터페이스 */
31
- export interface ICloneAvatar {
32
- itemId: string | null;
33
- itemName: string | null;
34
- }
35
-
36
- /** 엠블렘 인터페이스 */
37
- export interface IEmblem {
38
- slotNo: number;
39
- slotColor: string;
40
- itemName: string;
41
- itemRarity: string;
42
- }
43
-
44
- /** 아바타 마켓 시세 검색 결과 인터페이스 */
45
- export interface ISold {
46
- goodsNo: number;
47
- sellerId: string;
48
- sellerName: string;
49
- title: string;
50
- price: number;
51
- soldDate: string;
52
- hashtag: string[];
53
- avatarCount: number;
54
- }
55
-
56
- /** 아바타 마켓 시세 상세 인터페이스 */
57
- export interface ISoldDetail extends ISold {
58
- avatar: IAvatarItem[];
59
- }
60
-
61
- /** 해시태그 조회 결과 인터페이스 */
62
- export interface IHashtag {
63
- hashtag: IHashtagItem[];
64
- }
65
-
66
- /** 해시태그 아이템 인터페이스 */
67
- export interface IHashtagItem {
68
- hashtagType: string;
69
- name: string;
70
- }
@@ -1,134 +0,0 @@
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
- }
99
-
100
- /** 캐릭터 명성 검색 결과 인터페이스 */
101
- export interface ICharacterFame {
102
- serverId: staticUtil.Server;
103
- characterId: string;
104
- characterName: string;
105
- level: number;
106
- jobId: string;
107
- jobGrowId: string;
108
- jobName: string;
109
- jobGrowName: string;
110
- fame: number;
111
- }
112
-
113
- /** 안개 융화 정보 인터페이스 */
114
- export interface IMistAssimilation {
115
- serverId: staticUtil.Server;
116
- characterId: string;
117
- characterName: string;
118
- level: number;
119
- jobId: string;
120
- jobGrowId: string;
121
- jobName: string;
122
- jobGrowName: string;
123
- mistAssimilation: {
124
- level: number;
125
- expRate: number;
126
- status: IMistStatus[];
127
- };
128
- }
129
-
130
- /** 안개 융화 상태 인터페이스 */
131
- export interface IMistStatus {
132
- name: string;
133
- value: number;
134
- }
@@ -1,49 +0,0 @@
1
- import * as auction from "./auction";
2
- import * as avatarMarket from "./avatar-market";
3
- import * as char from "./character";
4
- import * as item from "./item";
5
- import * as job from "./job";
6
- import * as setItem from "./setitem";
7
-
8
- export { char, item, setItem, auction, avatarMarket, job };
9
-
10
- /** 에러 응답 인터페이스 */
11
- export interface IDnfErrorResponse {
12
- url: string;
13
- status: number;
14
- statusText: string;
15
- code: string;
16
- message: string;
17
- }
18
-
19
- /** 성공 응답 인터페이스 */
20
- export interface IDnfSuccess<T> {
21
- data: T;
22
- error?: never;
23
- }
24
-
25
- /** 에러 정보 인터페이스 */
26
- export interface IDnfError {
27
- data?: never;
28
- error: IDnfErrorResponse;
29
- }
30
-
31
- /** 응답 타입(합성 타입) */
32
- export type IDnfResponse<T> = IDnfSuccess<T> | IDnfError;
33
-
34
- /** 행 배열 인터페이스 */
35
- export interface IRows<T> {
36
- rows: T[];
37
- }
38
-
39
- /** 서버 정보 인터페이스 */
40
- export interface IServer {
41
- serverId: string;
42
- serverName: string;
43
- }
44
-
45
- /** 이름-값 쌍 인터페이스 */
46
- export interface INameValue {
47
- name: string;
48
- value: string | number;
49
- }
package/src/model/item.ts DELETED
@@ -1,149 +0,0 @@
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
- }
118
-
119
- /** 아이템 상점 판매 정보 인터페이스 */
120
- export interface IShop {
121
- itemId: string;
122
- itemName: string;
123
- itemRarity: string;
124
- itemTypeId: string;
125
- itemType: string;
126
- itemTypeDetailId: string;
127
- itemTypeDetail: string;
128
- shopInfo: IShopSaleInfo[];
129
- }
130
-
131
- /** 상점 판매 상세 정보 인터페이스 */
132
- export interface IShopSaleInfo {
133
- shopName: string;
134
- npcName: string;
135
- cost: IShopCost[];
136
- }
137
-
138
- /** 상점 비용 인터페이스 */
139
- export interface IShopCost {
140
- type: string;
141
- itemId?: string;
142
- itemName?: string;
143
- value: number;
144
- }
145
-
146
- /** 아이템 해시태그 목록 인터페이스 */
147
- export interface IHashtag {
148
- hashtag: string[];
149
- }