nest-wrapper-kiwoom 0.0.7 → 0.1.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.
@@ -1,10 +1,11 @@
1
1
  import { HttpService } from '@nestjs/axios';
2
- import { KA40004Params, KA40004Response } from '@src/types';
2
+ import { KA40001Params, KA40001Response, KA40004Params, KA40004Response } from '@src/types';
3
3
  import { Oauth2 } from '@services/oauth2.service';
4
4
  export declare class ETFService {
5
5
  private readonly httpService;
6
6
  private readonly oauth2;
7
7
  private readonly headers;
8
8
  constructor(httpService: HttpService, oauth2: Oauth2);
9
+ ka40001(ka40001Params: KA40001Params): Promise<KA40001Response>;
9
10
  ka40004(ka40004Params?: KA40004Params): Promise<KA40004Response>;
10
11
  }
@@ -67,20 +67,20 @@ var ETFService = (function () {
67
67
  this.oauth2 = oauth2;
68
68
  this.headers = { 'Content-Type': 'application/json;charset=UTF-8', 'cont-yn': 'N', 'next-key': 'N' };
69
69
  }
70
- ETFService.prototype.ka40004 = function (ka40004Params) {
70
+ ETFService.prototype.ka40001 = function (ka40001Params) {
71
71
  return __awaiter(this, void 0, void 0, function () {
72
72
  var _a, _b, params, response, e_1;
73
73
  return __generator(this, function (_c) {
74
74
  switch (_c.label) {
75
75
  case 0:
76
76
  _c.trys.push([0, 3, , 4]);
77
- this.headers['api-id'] = 'ka40004';
77
+ this.headers['api-id'] = 'ka40001';
78
78
  _a = this.headers;
79
79
  _b = 'authorization';
80
80
  return [4, this.oauth2.getBearerToken()];
81
81
  case 1:
82
82
  _a[_b] = _c.sent();
83
- params = __assign(__assign({}, types_1.ka40004ParamsDefault), ka40004Params);
83
+ params = __assign({}, ka40001Params);
84
84
  return [4, this.httpService.axiosRef.post('https://api.kiwoom.com/api/dostk/etf', params, { headers: this.headers })];
85
85
  case 2:
86
86
  response = _c.sent();
@@ -93,6 +93,32 @@ var ETFService = (function () {
93
93
  });
94
94
  });
95
95
  };
96
+ ETFService.prototype.ka40004 = function (ka40004Params) {
97
+ return __awaiter(this, void 0, void 0, function () {
98
+ var _a, _b, params, response, e_2;
99
+ return __generator(this, function (_c) {
100
+ switch (_c.label) {
101
+ case 0:
102
+ _c.trys.push([0, 3, , 4]);
103
+ this.headers['api-id'] = 'ka40004';
104
+ _a = this.headers;
105
+ _b = 'authorization';
106
+ return [4, this.oauth2.getBearerToken()];
107
+ case 1:
108
+ _a[_b] = _c.sent();
109
+ params = __assign(__assign({}, types_1.ka40004ParamsDefault), ka40004Params);
110
+ return [4, this.httpService.axiosRef.post('https://api.kiwoom.com/api/dostk/etf', params, { headers: this.headers })];
111
+ case 2:
112
+ response = _c.sent();
113
+ return [2, response.data];
114
+ case 3:
115
+ e_2 = _c.sent();
116
+ throw new common_1.InternalServerErrorException(e_2.message);
117
+ case 4: return [2];
118
+ }
119
+ });
120
+ });
121
+ };
96
122
  ETFService = __decorate([
97
123
  (0, common_1.Injectable)(),
98
124
  __metadata("design:paramtypes", [axios_1.HttpService,
@@ -1 +1 @@
1
- {"version":3,"file":"etf.service.js","sourceRoot":"","sources":["../../src/services/etf.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA0E;AAC1E,uCAA4C;AAC5C,oCAAkF;AAClF,2DAAkD;AAGlD;IAGC,oBACkB,WAAwB,EACxB,MAAc;QADd,gBAAW,GAAX,WAAW,CAAa;QACxB,WAAM,GAAN,MAAM,CAAQ;QAE/B,IAAI,CAAC,OAAO,GAAG,EAAE,cAAc,EAAE,gCAAgC,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;IACtG,CAAC;IAEK,4BAAO,GAAb,UAAc,aAA6B;;;;;;;wBAEzC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;wBACnC,KAAA,IAAI,CAAC,OAAO,CAAA;wBAAC,KAAA,eAAe,CAAA;wBAAI,WAAM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6B,GAAG,SAAkC,CAAC;wBAE7D,MAAM,gBAAuB,aAAa,CAAE,CAAC;wBAClC,WAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,sCAAsC,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAAA;;wBAA1H,QAAQ,GAAG,SAA+G;wBAChI,WAAO,QAAQ,CAAC,IAAuB,EAAC;;;wBAExC,MAAM,IAAI,qCAA4B,CAAC,GAAC,CAAC,OAAO,CAAC,CAAC;;;;;KAEnD;IAEK,4BAAO,GAAb,UAAc,aAA6B;;;;;;;wBAEzC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;wBACnC,KAAA,IAAI,CAAC,OAAO,CAAA;wBAAC,KAAA,eAAe,CAAA;wBAAI,WAAM,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAA;;wBAAlE,MAA6B,GAAG,SAAkC,CAAC;wBAE7D,MAAM,yBAAuB,4BAAoB,GAAK,aAAa,CAAE,CAAC;wBAE3D,WAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,sCAAsC,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAAA;;wBAA1H,QAAQ,GAAG,SAA+G;wBAChI,WAAO,QAAQ,CAAC,IAAuB,EAAC;;;wBAExC,MAAM,IAAI,qCAA4B,CAAC,GAAC,CAAC,OAAO,CAAC,CAAC;;;;;KAEnD;IAnCW,UAAU;QADtB,IAAA,mBAAU,GAAE;yCAKmB,mBAAW;YAChB,uBAAM;OALpB,UAAU,CAoCtB;IAAD,iBAAC;CAAA,AArCD,IAqCC;AApCY,gCAAU"}
@@ -1,3 +1,4 @@
1
- export * from './ka40004';
2
1
  export * from './au10001';
3
2
  export * from './kt10000';
3
+ export * from './ka40001';
4
+ export * from './ka40004';
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./ka40004"), exports);
18
17
  __exportStar(require("./au10001"), exports);
19
18
  __exportStar(require("./kt10000"), exports);
19
+ __exportStar(require("./ka40001"), exports);
20
+ __exportStar(require("./ka40004"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B"}
@@ -0,0 +1,17 @@
1
+ export interface KA40001Params {
2
+ stk_cd: string;
3
+ etfobjt_idex_cd: string;
4
+ dt: string;
5
+ }
6
+ interface EtfprftRtLst {
7
+ etfprft_rt: string;
8
+ cntr_prft_rt: string;
9
+ for_netprps_qty: string;
10
+ orgn_netprps_qty: string;
11
+ }
12
+ export interface KA40001Response {
13
+ etfprft_rt_lst: EtfprftRtLst[];
14
+ return_code: number;
15
+ return_msg: string;
16
+ }
17
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ka40001.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ka40001.js","sourceRoot":"","sources":["../../src/types/ka40001.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nest-wrapper-kiwoom",
3
- "version": "0.0.7",
3
+ "version": "0.1.0",
4
4
  "homepage": "https://github.com/gong-yeongbin/nest-wrapper-kiwoom",
5
5
  "description": "A Nest module wrapper for 키움 REST API",
6
6
  "main": "dist/index.js",