nest-wrapper-kiwoom 1.0.1 → 1.0.3

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.
@@ -0,0 +1,2 @@
1
+ export * from './kiwoom-options.interface';
2
+ export * from './kiwoom-async-options.interface';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./kiwoom-options.interface"), exports);
18
+ __exportStar(require("./kiwoom-async-options.interface"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,mEAAiD"}
@@ -0,0 +1,3 @@
1
+ import { FactoryProvider, ModuleMetadata } from '@nestjs/common';
2
+ import { KiwoomOptions } from './kiwoom-options.interface';
3
+ export type KiwoomAsyncOptions = Pick<ModuleMetadata, 'imports'> & Pick<FactoryProvider<KiwoomOptions>, 'useFactory' | 'inject'>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=kiwoom-async-options.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kiwoom-async-options.interface.js","sourceRoot":"","sources":["../../src/interfaces/kiwoom-async-options.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export interface KiwoomOptions {
2
+ appKey: string;
3
+ secretKey: string;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=kiwoom-options.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kiwoom-options.interface.js","sourceRoot":"","sources":["../../src/interfaces/kiwoom-options.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare const KIWOOM_MODULE_OPTIONS: unique symbol;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KIWOOM_MODULE_OPTIONS = void 0;
4
+ exports.KIWOOM_MODULE_OPTIONS = Symbol('KIWOOM_MODULE_OPTIONS');
5
+ //# sourceMappingURL=kiwoom.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kiwoom.constants.js","sourceRoot":"","sources":["../src/kiwoom.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC"}
@@ -1,2 +1,6 @@
1
+ import { DynamicModule } from '@nestjs/common';
2
+ import { KiwoomAsyncOptions, KiwoomOptions } from './interfaces';
1
3
  export declare class KiwoomModule {
4
+ static register(options: KiwoomOptions): DynamicModule;
5
+ static registerAsync(options: KiwoomAsyncOptions): DynamicModule;
2
6
  }
@@ -1,68 +1,41 @@
1
1
  "use strict";
2
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
- var _, done = false;
8
- for (var i = decorators.length - 1; i >= 0; i--) {
9
- var context = {};
10
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
- if (kind === "accessor") {
15
- if (result === void 0) continue;
16
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
- if (_ = accept(result.get)) descriptor.get = _;
18
- if (_ = accept(result.set)) descriptor.set = _;
19
- if (_ = accept(result.init)) initializers.unshift(_);
20
- }
21
- else if (_ = accept(result)) {
22
- if (kind === "field") initializers.unshift(_);
23
- else descriptor[key] = _;
24
- }
25
- }
26
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
- done = true;
28
- };
29
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
- var useValue = arguments.length > 2;
31
- for (var i = 0; i < initializers.length; i++) {
32
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
- }
34
- return useValue ? value : void 0;
35
- };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
39
7
  };
40
8
  Object.defineProperty(exports, "__esModule", { value: true });
41
9
  exports.KiwoomModule = void 0;
42
10
  var common_1 = require("@nestjs/common");
43
- var kiwoom_service_1 = require("./kiwoom.service");
44
- var KiwoomModule = function () {
45
- var _classDecorators = [(0, common_1.Module)({
46
- providers: [kiwoom_service_1.KiwoomService],
47
- exports: [kiwoom_service_1.KiwoomService],
48
- })];
49
- var _classDescriptor;
50
- var _classExtraInitializers = [];
51
- var _classThis;
52
- var KiwoomModule = _classThis = (function () {
53
- function KiwoomModule_1() {
54
- }
55
- return KiwoomModule_1;
56
- }());
57
- __setFunctionName(_classThis, "KiwoomModule");
58
- (function () {
59
- var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
60
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
61
- KiwoomModule = _classThis = _classDescriptor.value;
62
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
63
- __runInitializers(_classThis, _classExtraInitializers);
64
- })();
65
- return KiwoomModule = _classThis;
66
- }();
11
+ var kiwoom_constants_1 = require("./kiwoom.constants");
12
+ var axios_1 = require("@nestjs/axios");
13
+ var services_1 = require("./services");
14
+ var KiwoomModule = (function () {
15
+ function KiwoomModule() {
16
+ }
17
+ KiwoomModule_1 = KiwoomModule;
18
+ KiwoomModule.register = function (options) {
19
+ return {
20
+ module: KiwoomModule_1,
21
+ providers: [{ provide: kiwoom_constants_1.KIWOOM_MODULE_OPTIONS, useValue: options }],
22
+ exports: [services_1.Oauth2],
23
+ };
24
+ };
25
+ KiwoomModule.registerAsync = function (options) {
26
+ return {
27
+ module: KiwoomModule_1,
28
+ providers: [{ provide: kiwoom_constants_1.KIWOOM_MODULE_OPTIONS, useFactory: options.useFactory, inject: options.inject }],
29
+ exports: [services_1.Oauth2],
30
+ };
31
+ };
32
+ var KiwoomModule_1;
33
+ KiwoomModule = KiwoomModule_1 = __decorate([
34
+ (0, common_1.Module)({
35
+ imports: [axios_1.HttpModule],
36
+ })
37
+ ], KiwoomModule);
38
+ return KiwoomModule;
39
+ }());
67
40
  exports.KiwoomModule = KiwoomModule;
68
41
  //# sourceMappingURL=kiwoom.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kiwoom.module.js","sourceRoot":"","sources":["../src/kiwoom.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAwC;AACxC,mDAAiD;AAMjD;4BAJC,IAAA,eAAM,EAAC;YACP,SAAS,EAAE,CAAC,8BAAa,CAAC;YAC1B,OAAO,EAAE,CAAC,8BAAa,CAAC;SACxB,CAAC;;;;;;QACyB,CAAC;QAAD,qBAAC;IAAD,CAAC;;;;QAA5B,6KAA4B;;;QAAf,uDAAY;;;IAAG;AAAf,oCAAY"}
1
+ {"version":3,"file":"kiwoom.module.js","sourceRoot":"","sources":["../src/kiwoom.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAAuD;AAEvD,uDAA2D;AAC3D,uCAA2C;AAC3C,uCAAoC;AAKpC;IAAA;IAgBA,CAAC;qBAhBY,YAAY;IACjB,qBAAQ,GAAf,UAAgB,OAAsB;QACrC,OAAO;YACN,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,wCAAqB,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;YAClE,OAAO,EAAE,CAAC,iBAAM,CAAC;SACjB,CAAC;IACH,CAAC;IAEM,0BAAa,GAApB,UAAqB,OAA2B;QAC/C,OAAO;YACN,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,wCAAqB,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;YACvG,OAAO,EAAE,CAAC,iBAAM,CAAC;SACjB,CAAC;IACH,CAAC;;IAfW,YAAY;QAHxB,IAAA,eAAM,EAAC;YACP,OAAO,EAAE,CAAC,kBAAU,CAAC;SACrB,CAAC;OACW,YAAY,CAgBxB;IAAD,mBAAC;CAAA,AAhBD,IAgBC;AAhBY,oCAAY"}
@@ -1,64 +1,20 @@
1
1
  "use strict";
2
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
- var _, done = false;
8
- for (var i = decorators.length - 1; i >= 0; i--) {
9
- var context = {};
10
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
- if (kind === "accessor") {
15
- if (result === void 0) continue;
16
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
- if (_ = accept(result.get)) descriptor.get = _;
18
- if (_ = accept(result.set)) descriptor.set = _;
19
- if (_ = accept(result.init)) initializers.unshift(_);
20
- }
21
- else if (_ = accept(result)) {
22
- if (kind === "field") initializers.unshift(_);
23
- else descriptor[key] = _;
24
- }
25
- }
26
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
- done = true;
28
- };
29
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
- var useValue = arguments.length > 2;
31
- for (var i = 0; i < initializers.length; i++) {
32
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
- }
34
- return useValue ? value : void 0;
35
- };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
39
7
  };
40
8
  Object.defineProperty(exports, "__esModule", { value: true });
41
9
  exports.KiwoomService = void 0;
42
10
  var common_1 = require("@nestjs/common");
43
- var KiwoomService = function () {
44
- var _classDecorators = [(0, common_1.Injectable)()];
45
- var _classDescriptor;
46
- var _classExtraInitializers = [];
47
- var _classThis;
48
- var KiwoomService = _classThis = (function () {
49
- function KiwoomService_1() {
50
- }
51
- return KiwoomService_1;
52
- }());
53
- __setFunctionName(_classThis, "KiwoomService");
54
- (function () {
55
- var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
56
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
57
- KiwoomService = _classThis = _classDescriptor.value;
58
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
59
- __runInitializers(_classThis, _classExtraInitializers);
60
- })();
61
- return KiwoomService = _classThis;
62
- }();
11
+ var KiwoomService = (function () {
12
+ function KiwoomService() {
13
+ }
14
+ KiwoomService = __decorate([
15
+ (0, common_1.Injectable)()
16
+ ], KiwoomService);
17
+ return KiwoomService;
18
+ }());
63
19
  exports.KiwoomService = KiwoomService;
64
20
  //# sourceMappingURL=kiwoom.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kiwoom.service.js","sourceRoot":"","sources":["../src/kiwoom.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA4C;AAG5C;4BADC,IAAA,mBAAU,GAAE;;;;;;QACe,CAAC;QAAD,sBAAC;IAAD,CAAC;;;;QAA7B,6KAA6B;;;QAAhB,uDAAa;;;IAAG;AAAhB,sCAAa"}
1
+ {"version":3,"file":"kiwoom.service.js","sourceRoot":"","sources":["../src/kiwoom.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAA4C;AAG5C;IAAA;IAA4B,CAAC;IAAhB,aAAa;QADzB,IAAA,mBAAU,GAAE;OACA,aAAa,CAAG;IAAD,oBAAC;CAAA,AAA7B,IAA6B;AAAhB,sCAAa"}
@@ -0,0 +1 @@
1
+ export * from './oauth2.service';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./oauth2.service"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
@@ -0,0 +1,11 @@
1
+ import { KiwoomOptions } from '../interfaces';
2
+ import { HttpService } from '@nestjs/axios';
3
+ export declare class Oauth2 {
4
+ private readonly option;
5
+ private readonly httpService;
6
+ private readonly headers;
7
+ private readonly body;
8
+ constructor(option: KiwoomOptions, httpService: HttpService);
9
+ au10001(): Promise<any>;
10
+ au10002(): Promise<any>;
11
+ }
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ var __generator = (this && this.__generator) || function (thisArg, body) {
24
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
25
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
+ function verb(n) { return function (v) { return step([n, v]); }; }
27
+ function step(op) {
28
+ if (f) throw new TypeError("Generator is already executing.");
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
31
+ if (y = 0, t) op = [op[0] & 2, t.value];
32
+ switch (op[0]) {
33
+ case 0: case 1: t = op; break;
34
+ case 4: _.label++; return { value: op[1], done: false };
35
+ case 5: _.label++; y = op[1]; op = [0]; continue;
36
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
+ default:
38
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
+ if (t[2]) _.ops.pop();
43
+ _.trys.pop(); continue;
44
+ }
45
+ op = body.call(thisArg, _);
46
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
+ }
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.Oauth2 = void 0;
52
+ var common_1 = require("@nestjs/common");
53
+ var kiwoom_constants_1 = require("../kiwoom.constants");
54
+ var axios_1 = require("@nestjs/axios");
55
+ var Oauth2 = (function () {
56
+ function Oauth2(option, httpService) {
57
+ this.option = option;
58
+ this.httpService = httpService;
59
+ this.headers = { 'Content-Type': 'application/json;charset=UTF-8' };
60
+ this.body = { grant_type: 'client_credentials', appKey: this.option.appKey, secretKey: this.option.secretKey };
61
+ }
62
+ Oauth2.prototype.au10001 = function () {
63
+ return __awaiter(this, void 0, void 0, function () {
64
+ var response, e_1;
65
+ return __generator(this, function (_a) {
66
+ switch (_a.label) {
67
+ case 0:
68
+ _a.trys.push([0, 2, , 3]);
69
+ return [4, this.httpService.axiosRef.post('https://api.kiwoom.com/oauth2/token', this.body, { headers: this.headers })];
70
+ case 1:
71
+ response = _a.sent();
72
+ return [2, response.data];
73
+ case 2:
74
+ e_1 = _a.sent();
75
+ throw new common_1.InternalServerErrorException(e_1.message);
76
+ case 3: return [2];
77
+ }
78
+ });
79
+ });
80
+ };
81
+ Oauth2.prototype.au10002 = function () {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ var response, e_2;
84
+ return __generator(this, function (_a) {
85
+ switch (_a.label) {
86
+ case 0:
87
+ _a.trys.push([0, 2, , 3]);
88
+ return [4, this.httpService.axiosRef.post('https://api.kiwoom.com/oauth2/revoke', this.body, { headers: this.headers })];
89
+ case 1:
90
+ response = _a.sent();
91
+ return [2, response.data];
92
+ case 2:
93
+ e_2 = _a.sent();
94
+ throw new common_1.InternalServerErrorException(e_2.message);
95
+ case 3: return [2];
96
+ }
97
+ });
98
+ });
99
+ };
100
+ Oauth2 = __decorate([
101
+ (0, common_1.Injectable)(),
102
+ __param(0, (0, common_1.Inject)(kiwoom_constants_1.KIWOOM_MODULE_OPTIONS)),
103
+ __metadata("design:paramtypes", [Object, axios_1.HttpService])
104
+ ], Oauth2);
105
+ return Oauth2;
106
+ }());
107
+ exports.Oauth2 = Oauth2;
108
+ //# sourceMappingURL=oauth2.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth2.service.js","sourceRoot":"","sources":["../../src/services/oauth2.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAkF;AAClF,wDAA4D;AAE5D,uCAA4C;AAG5C;IAIC,gBACiD,MAAqB,EACpD,WAAwB;QADO,WAAM,GAAN,MAAM,CAAe;QACpD,gBAAW,GAAX,WAAW,CAAa;QAEzC,IAAI,CAAC,OAAO,GAAG,EAAE,cAAc,EAAE,gCAAgC,EAAE,CAAC;QACpE,IAAI,CAAC,IAAI,GAAG,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAChH,CAAC;IAEK,wBAAO,GAAb;;;;;;;wBAEmB,WAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,qCAAqC,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAAA;;wBAA5H,QAAQ,GAAG,SAAiH;wBAClI,WAAO,QAAQ,CAAC,IAAI,EAAC;;;wBAErB,MAAM,IAAI,qCAA4B,CAAC,GAAC,CAAC,OAAO,CAAC,CAAC;;;;;KAEnD;IAEK,wBAAO,GAAb;;;;;;;wBAEmB,WAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,sCAAsC,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAAA;;wBAA7H,QAAQ,GAAG,SAAkH;wBACnI,WAAO,QAAQ,CAAC,IAAI,EAAC;;;wBAErB,MAAM,IAAI,qCAA4B,CAAC,GAAC,CAAC,OAAO,CAAC,CAAC;;;;;KAEnD;IA5BW,MAAM;QADlB,IAAA,mBAAU,GAAE;QAMV,WAAA,IAAA,eAAM,EAAC,wCAAqB,CAAC,CAAA;iDACA,mBAAW;OAN9B,MAAM,CA6BlB;IAAD,aAAC;CAAA,AA9BD,IA8BC;AA7BY,wBAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nest-wrapper-kiwoom",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "키움증권"
14
14
  ],
15
15
  "author": "",
16
- "license": "ISC",
16
+ "license": "MIT",
17
17
  "devDependencies": {
18
18
  "@eslint/js": "^9.39.1",
19
19
  "@nestjs/testing": "^11.1.8",
@@ -27,7 +27,9 @@
27
27
  "prettier": "^3.6.2"
28
28
  },
29
29
  "dependencies": {
30
- "@nestjs/common": "^11.1.8"
30
+ "@nestjs/axios": "^4.0.1",
31
+ "@nestjs/common": "^11.1.8",
32
+ "axios": "^1.13.2"
31
33
  },
32
34
  "scripts": {
33
35
  "build": "rm -rf ./dist && tsc -p tsconfig.lib.json",