@cmarket/partner-sdk 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.
- package/.openapi-generator/FILES +57 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +95 -0
- package/api/oauth-api.ts +127 -0
- package/api/partner-v1-api.ts +191 -0
- package/api/partner-v1-legacy-api.ts +178 -0
- package/api/partner-v2-api.ts +285 -0
- package/api.ts +21 -0
- package/base.ts +62 -0
- package/common.ts +127 -0
- package/configuration.ts +121 -0
- package/dist/api/oauth-api.d.ts +68 -0
- package/dist/api/oauth-api.js +130 -0
- package/dist/api/partner-v1-api.d.ts +96 -0
- package/dist/api/partner-v1-api.js +191 -0
- package/dist/api/partner-v1-legacy-api.d.ts +91 -0
- package/dist/api/partner-v1-legacy-api.js +181 -0
- package/dist/api/partner-v2-api.d.ts +136 -0
- package/dist/api/partner-v2-api.js +273 -0
- package/dist/api.d.ts +15 -0
- package/dist/api.js +33 -0
- package/dist/base.d.ts +42 -0
- package/dist/base.js +46 -0
- package/dist/common.d.ts +34 -0
- package/dist/common.js +139 -0
- package/dist/configuration.d.ts +98 -0
- package/dist/configuration.js +44 -0
- package/dist/esm/api/oauth-api.d.ts +68 -0
- package/dist/esm/api/oauth-api.js +123 -0
- package/dist/esm/api/partner-v1-api.d.ts +96 -0
- package/dist/esm/api/partner-v1-api.js +184 -0
- package/dist/esm/api/partner-v1-legacy-api.d.ts +91 -0
- package/dist/esm/api/partner-v1-legacy-api.js +174 -0
- package/dist/esm/api/partner-v2-api.d.ts +136 -0
- package/dist/esm/api/partner-v2-api.js +266 -0
- package/dist/esm/api.d.ts +15 -0
- package/dist/esm/api.js +17 -0
- package/dist/esm/base.d.ts +42 -0
- package/dist/esm/base.js +41 -0
- package/dist/esm/common.d.ts +34 -0
- package/dist/esm/common.js +126 -0
- package/dist/esm/configuration.d.ts +98 -0
- package/dist/esm/configuration.js +40 -0
- package/dist/esm/index.d.ts +14 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/models/award-registered-response-dto.d.ts +25 -0
- package/dist/esm/models/award-registered-response-dto.js +14 -0
- package/dist/esm/models/bid-bond-dto.d.ts +27 -0
- package/dist/esm/models/bid-bond-dto.js +18 -0
- package/dist/esm/models/bid-created-response-dto.d.ts +17 -0
- package/dist/esm/models/bid-created-response-dto.js +14 -0
- package/dist/esm/models/bid-document-dto.d.ts +25 -0
- package/dist/esm/models/bid-document-dto.js +14 -0
- package/dist/esm/models/bid-item-dto.d.ts +41 -0
- package/dist/esm/models/bid-item-dto.js +14 -0
- package/dist/esm/models/bid-manager-dto.d.ts +25 -0
- package/dist/esm/models/bid-manager-dto.js +14 -0
- package/dist/esm/models/bid-status.d.ts +23 -0
- package/dist/esm/models/bid-status.js +24 -0
- package/dist/esm/models/bid-summary-response-dto.d.ts +30 -0
- package/dist/esm/models/bid-summary-response-dto.js +14 -0
- package/dist/esm/models/create-bid-request-dto.d.ts +278 -0
- package/dist/esm/models/create-bid-request-dto.js +101 -0
- package/dist/esm/models/file-uploaded-response-dto.d.ts +17 -0
- package/dist/esm/models/file-uploaded-response-dto.js +14 -0
- package/dist/esm/models/health-response-dto.d.ts +21 -0
- package/dist/esm/models/health-response-dto.js +14 -0
- package/dist/esm/models/hierarchical-region-dto.d.ts +21 -0
- package/dist/esm/models/hierarchical-region-dto.js +14 -0
- package/dist/esm/models/index.d.ts +18 -0
- package/dist/esm/models/index.js +18 -0
- package/dist/esm/models/legacy-envelope-dto.d.ts +25 -0
- package/dist/esm/models/legacy-envelope-dto.js +14 -0
- package/dist/esm/models/preconditions-dto.d.ts +88 -0
- package/dist/esm/models/preconditions-dto.js +44 -0
- package/dist/esm/models/register-award-request-dto.d.ts +25 -0
- package/dist/esm/models/register-award-request-dto.js +14 -0
- package/dist/esm/models/token-request-dto.d.ts +33 -0
- package/dist/esm/models/token-request-dto.js +16 -0
- package/dist/esm/models/token-response-dto.d.ts +29 -0
- package/dist/esm/models/token-response-dto.js +14 -0
- package/dist/esm/models/upload-file-request-dto.d.ts +25 -0
- package/dist/esm/models/upload-file-request-dto.js +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +32 -0
- package/dist/models/award-registered-response-dto.d.ts +25 -0
- package/dist/models/award-registered-response-dto.js +15 -0
- package/dist/models/bid-bond-dto.d.ts +27 -0
- package/dist/models/bid-bond-dto.js +21 -0
- package/dist/models/bid-created-response-dto.d.ts +17 -0
- package/dist/models/bid-created-response-dto.js +15 -0
- package/dist/models/bid-document-dto.d.ts +25 -0
- package/dist/models/bid-document-dto.js +15 -0
- package/dist/models/bid-item-dto.d.ts +41 -0
- package/dist/models/bid-item-dto.js +15 -0
- package/dist/models/bid-manager-dto.d.ts +25 -0
- package/dist/models/bid-manager-dto.js +15 -0
- package/dist/models/bid-status.d.ts +23 -0
- package/dist/models/bid-status.js +27 -0
- package/dist/models/bid-summary-response-dto.d.ts +30 -0
- package/dist/models/bid-summary-response-dto.js +15 -0
- package/dist/models/create-bid-request-dto.d.ts +278 -0
- package/dist/models/create-bid-request-dto.js +104 -0
- package/dist/models/file-uploaded-response-dto.d.ts +17 -0
- package/dist/models/file-uploaded-response-dto.js +15 -0
- package/dist/models/health-response-dto.d.ts +21 -0
- package/dist/models/health-response-dto.js +15 -0
- package/dist/models/hierarchical-region-dto.d.ts +21 -0
- package/dist/models/hierarchical-region-dto.js +15 -0
- package/dist/models/index.d.ts +18 -0
- package/dist/models/index.js +34 -0
- package/dist/models/legacy-envelope-dto.d.ts +25 -0
- package/dist/models/legacy-envelope-dto.js +15 -0
- package/dist/models/preconditions-dto.d.ts +88 -0
- package/dist/models/preconditions-dto.js +47 -0
- package/dist/models/register-award-request-dto.d.ts +25 -0
- package/dist/models/register-award-request-dto.js +15 -0
- package/dist/models/token-request-dto.d.ts +33 -0
- package/dist/models/token-request-dto.js +19 -0
- package/dist/models/token-response-dto.d.ts +29 -0
- package/dist/models/token-response-dto.js +15 -0
- package/dist/models/upload-file-request-dto.d.ts +25 -0
- package/dist/models/upload-file-request-dto.js +15 -0
- package/docs/AwardRegisteredResponseDto.md +24 -0
- package/docs/BidBondDto.md +22 -0
- package/docs/BidCreatedResponseDto.md +20 -0
- package/docs/BidDocumentDto.md +24 -0
- package/docs/BidItemDto.md +32 -0
- package/docs/BidManagerDto.md +24 -0
- package/docs/BidStatus.md +19 -0
- package/docs/BidSummaryResponseDto.md +26 -0
- package/docs/CreateBidRequestDto.md +96 -0
- package/docs/FileUploadedResponseDto.md +20 -0
- package/docs/HealthResponseDto.md +22 -0
- package/docs/HierarchicalRegionDto.md +22 -0
- package/docs/LegacyEnvelopeDto.md +24 -0
- package/docs/OauthApi.md +61 -0
- package/docs/PartnerV1Api.md +105 -0
- package/docs/PartnerV1LegacyApi.md +97 -0
- package/docs/PartnerV2Api.md +166 -0
- package/docs/PreconditionsDto.md +38 -0
- package/docs/RegisterAwardRequestDto.md +24 -0
- package/docs/TokenRequestDto.md +26 -0
- package/docs/TokenResponseDto.md +26 -0
- package/docs/UploadFileRequestDto.md +24 -0
- package/git_push.sh +57 -0
- package/index.ts +18 -0
- package/models/award-registered-response-dto.ts +31 -0
- package/models/bid-bond-dto.ts +36 -0
- package/models/bid-created-response-dto.ts +23 -0
- package/models/bid-document-dto.ts +31 -0
- package/models/bid-item-dto.ts +47 -0
- package/models/bid-manager-dto.ts +31 -0
- package/models/bid-status.ts +33 -0
- package/models/bid-summary-response-dto.ts +40 -0
- package/models/create-bid-request-dto.ts +312 -0
- package/models/file-uploaded-response-dto.ts +23 -0
- package/models/health-response-dto.ts +27 -0
- package/models/hierarchical-region-dto.ts +27 -0
- package/models/index.ts +18 -0
- package/models/legacy-envelope-dto.ts +31 -0
- package/models/preconditions-dto.ts +101 -0
- package/models/register-award-request-dto.ts +31 -0
- package/models/token-request-dto.ts +42 -0
- package/models/token-response-dto.ts +35 -0
- package/models/upload-file-request-dto.ts +31 -0
- package/package.json +33 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +18 -0
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CMARKET V6 Partner API
|
|
3
|
+
* 외부 ERP 연동용 RESTful API. V5 17개 엔드포인트의 V6 후속.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Configuration } from './configuration';
|
|
13
|
+
import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
14
|
+
export declare const BASE_PATH: string;
|
|
15
|
+
export declare const COLLECTION_FORMATS: {
|
|
16
|
+
csv: string;
|
|
17
|
+
ssv: string;
|
|
18
|
+
tsv: string;
|
|
19
|
+
pipes: string;
|
|
20
|
+
};
|
|
21
|
+
export interface RequestArgs {
|
|
22
|
+
url: string;
|
|
23
|
+
options: RawAxiosRequestConfig;
|
|
24
|
+
}
|
|
25
|
+
export declare class BaseAPI {
|
|
26
|
+
protected basePath: string;
|
|
27
|
+
protected axios: AxiosInstance;
|
|
28
|
+
protected configuration: Configuration | undefined;
|
|
29
|
+
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
30
|
+
}
|
|
31
|
+
export declare class RequiredError extends Error {
|
|
32
|
+
field: string;
|
|
33
|
+
constructor(field: string, msg?: string);
|
|
34
|
+
}
|
|
35
|
+
interface ServerMap {
|
|
36
|
+
[key: string]: {
|
|
37
|
+
url: string;
|
|
38
|
+
description: string;
|
|
39
|
+
}[];
|
|
40
|
+
}
|
|
41
|
+
export declare const operationServerMap: ServerMap;
|
|
42
|
+
export {};
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* CMARKET V6 Partner API
|
|
6
|
+
* 외부 ERP 연동용 RESTful API. V5 17개 엔드포인트의 V6 후속.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
17
|
+
const axios_1 = require("axios");
|
|
18
|
+
exports.BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
|
19
|
+
exports.COLLECTION_FORMATS = {
|
|
20
|
+
csv: ",",
|
|
21
|
+
ssv: " ",
|
|
22
|
+
tsv: "\t",
|
|
23
|
+
pipes: "|",
|
|
24
|
+
};
|
|
25
|
+
class BaseAPI {
|
|
26
|
+
constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
|
|
27
|
+
var _a;
|
|
28
|
+
this.basePath = basePath;
|
|
29
|
+
this.axios = axios;
|
|
30
|
+
if (configuration) {
|
|
31
|
+
this.configuration = configuration;
|
|
32
|
+
this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.BaseAPI = BaseAPI;
|
|
37
|
+
;
|
|
38
|
+
class RequiredError extends Error {
|
|
39
|
+
constructor(field, msg) {
|
|
40
|
+
super(msg);
|
|
41
|
+
this.field = field;
|
|
42
|
+
this.name = "RequiredError";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.RequiredError = RequiredError;
|
|
46
|
+
exports.operationServerMap = {};
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CMARKET V6 Partner API
|
|
3
|
+
* 외부 ERP 연동용 RESTful API. V5 17개 엔드포인트의 V6 후속.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Configuration } from "./configuration";
|
|
13
|
+
import type { RequestArgs } from "./base";
|
|
14
|
+
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
15
|
+
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @throws {RequiredError}
|
|
19
|
+
*/
|
|
20
|
+
export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
|
|
21
|
+
export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
|
|
22
|
+
export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
|
|
23
|
+
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
24
|
+
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
|
|
25
|
+
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
26
|
+
/**
|
|
27
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
28
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
29
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
30
|
+
*/
|
|
31
|
+
export declare const replaceWithSerializableTypeIfNeeded: (key: string, value: any) => any;
|
|
32
|
+
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
33
|
+
export declare const toPathString: (url: URL) => string;
|
|
34
|
+
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
package/dist/common.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* CMARKET V6 Partner API
|
|
6
|
+
* 외부 ERP 연동용 RESTful API. V5 17개 엔드포인트의 V6 후속.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.replaceWithSerializableTypeIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
26
|
+
const base_1 = require("./base");
|
|
27
|
+
exports.DUMMY_BASE_URL = 'https://example.com';
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @throws {RequiredError}
|
|
31
|
+
*/
|
|
32
|
+
const assertParamExists = function (functionName, paramName, paramValue) {
|
|
33
|
+
if (paramValue === null || paramValue === undefined) {
|
|
34
|
+
throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.assertParamExists = assertParamExists;
|
|
38
|
+
const setApiKeyToObject = function (object, keyParamName, configuration) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (configuration && configuration.apiKey) {
|
|
41
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
42
|
+
? yield configuration.apiKey(keyParamName)
|
|
43
|
+
: yield configuration.apiKey;
|
|
44
|
+
object[keyParamName] = localVarApiKeyValue;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.setApiKeyToObject = setApiKeyToObject;
|
|
49
|
+
const setBasicAuthToObject = function (object, configuration) {
|
|
50
|
+
if (configuration && (configuration.username || configuration.password)) {
|
|
51
|
+
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.setBasicAuthToObject = setBasicAuthToObject;
|
|
55
|
+
const setBearerAuthToObject = function (object, configuration) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
if (configuration && configuration.accessToken) {
|
|
58
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
59
|
+
? yield configuration.accessToken()
|
|
60
|
+
: yield configuration.accessToken;
|
|
61
|
+
object["Authorization"] = "Bearer " + accessToken;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
exports.setBearerAuthToObject = setBearerAuthToObject;
|
|
66
|
+
const setOAuthToObject = function (object, name, scopes, configuration) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
if (configuration && configuration.accessToken) {
|
|
69
|
+
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
70
|
+
? yield configuration.accessToken(name, scopes)
|
|
71
|
+
: yield configuration.accessToken;
|
|
72
|
+
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
exports.setOAuthToObject = setOAuthToObject;
|
|
77
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
78
|
+
if (parameter == null)
|
|
79
|
+
return;
|
|
80
|
+
if (typeof parameter === "object") {
|
|
81
|
+
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
82
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
if (urlSearchParams.has(key)) {
|
|
90
|
+
urlSearchParams.append(key, parameter);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
urlSearchParams.set(key, parameter);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const setSearchParams = function (url, ...objects) {
|
|
98
|
+
const searchParams = new URLSearchParams(url.search);
|
|
99
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
100
|
+
url.search = searchParams.toString();
|
|
101
|
+
};
|
|
102
|
+
exports.setSearchParams = setSearchParams;
|
|
103
|
+
/**
|
|
104
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
105
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
106
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
107
|
+
*/
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
const replaceWithSerializableTypeIfNeeded = function (key, value) {
|
|
110
|
+
if (value instanceof Set) {
|
|
111
|
+
return Array.from(value);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
return value;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
exports.replaceWithSerializableTypeIfNeeded = replaceWithSerializableTypeIfNeeded;
|
|
118
|
+
const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
119
|
+
const nonString = typeof value !== 'string';
|
|
120
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
121
|
+
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
122
|
+
: nonString;
|
|
123
|
+
return needsSerialization
|
|
124
|
+
? JSON.stringify(value !== undefined ? value : {}, exports.replaceWithSerializableTypeIfNeeded)
|
|
125
|
+
: (value || "");
|
|
126
|
+
};
|
|
127
|
+
exports.serializeDataIfNeeded = serializeDataIfNeeded;
|
|
128
|
+
const toPathString = function (url) {
|
|
129
|
+
return url.pathname + url.search + url.hash;
|
|
130
|
+
};
|
|
131
|
+
exports.toPathString = toPathString;
|
|
132
|
+
const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
133
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
134
|
+
var _a;
|
|
135
|
+
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? '' : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url });
|
|
136
|
+
return axios.request(axiosRequestArgs);
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
exports.createRequestFunction = createRequestFunction;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CMARKET V6 Partner API
|
|
3
|
+
* 외부 ERP 연동용 RESTful API. V5 17개 엔드포인트의 V6 후속.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
interface AWSv4Configuration {
|
|
13
|
+
options?: {
|
|
14
|
+
region?: string;
|
|
15
|
+
service?: string;
|
|
16
|
+
};
|
|
17
|
+
credentials?: {
|
|
18
|
+
accessKeyId?: string;
|
|
19
|
+
secretAccessKey?: string;
|
|
20
|
+
sessionToken?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface ConfigurationParameters {
|
|
24
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
25
|
+
username?: string;
|
|
26
|
+
password?: string;
|
|
27
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
28
|
+
awsv4?: AWSv4Configuration;
|
|
29
|
+
basePath?: string;
|
|
30
|
+
serverIndex?: number;
|
|
31
|
+
baseOptions?: any;
|
|
32
|
+
formDataCtor?: new () => any;
|
|
33
|
+
}
|
|
34
|
+
export declare class Configuration {
|
|
35
|
+
/**
|
|
36
|
+
* parameter for apiKey security
|
|
37
|
+
* @param name security name
|
|
38
|
+
*/
|
|
39
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
40
|
+
/**
|
|
41
|
+
* parameter for basic security
|
|
42
|
+
*/
|
|
43
|
+
username?: string;
|
|
44
|
+
/**
|
|
45
|
+
* parameter for basic security
|
|
46
|
+
*/
|
|
47
|
+
password?: string;
|
|
48
|
+
/**
|
|
49
|
+
* parameter for oauth2 security
|
|
50
|
+
* @param name security name
|
|
51
|
+
* @param scopes oauth2 scope
|
|
52
|
+
*/
|
|
53
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
54
|
+
/**
|
|
55
|
+
* parameter for aws4 signature security
|
|
56
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
57
|
+
* @param {string} options.region - aws region
|
|
58
|
+
* @param {string} options.service - name of the service.
|
|
59
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
60
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
61
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
62
|
+
* @memberof Configuration
|
|
63
|
+
*/
|
|
64
|
+
awsv4?: AWSv4Configuration;
|
|
65
|
+
/**
|
|
66
|
+
* override base path
|
|
67
|
+
*/
|
|
68
|
+
basePath?: string;
|
|
69
|
+
/**
|
|
70
|
+
* override server index
|
|
71
|
+
*/
|
|
72
|
+
serverIndex?: number;
|
|
73
|
+
/**
|
|
74
|
+
* base options for axios calls
|
|
75
|
+
*/
|
|
76
|
+
baseOptions?: any;
|
|
77
|
+
/**
|
|
78
|
+
* The FormData constructor that will be used to create multipart form data
|
|
79
|
+
* requests. You can inject this here so that execution environments that
|
|
80
|
+
* do not support the FormData class can still run the generated client.
|
|
81
|
+
*
|
|
82
|
+
* @type {new () => FormData}
|
|
83
|
+
*/
|
|
84
|
+
formDataCtor?: new () => any;
|
|
85
|
+
constructor(param?: ConfigurationParameters);
|
|
86
|
+
/**
|
|
87
|
+
* Check if the given MIME is a JSON MIME.
|
|
88
|
+
* JSON MIME examples:
|
|
89
|
+
* application/json
|
|
90
|
+
* application/json; charset=UTF8
|
|
91
|
+
* APPLICATION/JSON
|
|
92
|
+
* application/vnd.company+json
|
|
93
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
94
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
95
|
+
*/
|
|
96
|
+
isJsonMime(mime: string): boolean;
|
|
97
|
+
}
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/**
|
|
4
|
+
* CMARKET V6 Partner API
|
|
5
|
+
* 외부 ERP 연동용 RESTful API. V5 17개 엔드포인트의 V6 후속.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.Configuration = void 0;
|
|
16
|
+
class Configuration {
|
|
17
|
+
constructor(param = {}) {
|
|
18
|
+
var _a;
|
|
19
|
+
this.apiKey = param.apiKey;
|
|
20
|
+
this.username = param.username;
|
|
21
|
+
this.password = param.password;
|
|
22
|
+
this.accessToken = param.accessToken;
|
|
23
|
+
this.awsv4 = param.awsv4;
|
|
24
|
+
this.basePath = param.basePath;
|
|
25
|
+
this.serverIndex = param.serverIndex;
|
|
26
|
+
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
|
|
27
|
+
this.formDataCtor = param.formDataCtor;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Check if the given MIME is a JSON MIME.
|
|
31
|
+
* JSON MIME examples:
|
|
32
|
+
* application/json
|
|
33
|
+
* application/json; charset=UTF8
|
|
34
|
+
* APPLICATION/JSON
|
|
35
|
+
* application/vnd.company+json
|
|
36
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
37
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
38
|
+
*/
|
|
39
|
+
isJsonMime(mime) {
|
|
40
|
+
const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
|
|
41
|
+
return mime !== null && jsonMime.test(mime);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.Configuration = Configuration;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CMARKET V6 Partner API
|
|
3
|
+
* 외부 ERP 연동용 RESTful API. V5 17개 엔드포인트의 V6 후속.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Configuration } from '../configuration';
|
|
13
|
+
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
14
|
+
import { type RequestArgs, BaseAPI } from '../base';
|
|
15
|
+
import type { TokenRequestDto } from '../models';
|
|
16
|
+
import type { TokenResponseDto } from '../models';
|
|
17
|
+
/**
|
|
18
|
+
* OauthApi - axios parameter creator
|
|
19
|
+
*/
|
|
20
|
+
export declare const OauthApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
21
|
+
/**
|
|
22
|
+
* 파트너 ERP 가 client_id/secret 로 단명 JWT access token 을 발급받습니다 (TTL 15분). 이후 모든 보호 endpoint 는 Authorization: Bearer <token> 헤더로 호출합니다.
|
|
23
|
+
* @summary OAuth 2.0 access token 발급 (client_credentials)
|
|
24
|
+
* @param {TokenRequestDto} tokenRequestDto
|
|
25
|
+
* @param {*} [options] Override http request option.
|
|
26
|
+
* @throws {RequiredError}
|
|
27
|
+
*/
|
|
28
|
+
token: (tokenRequestDto: TokenRequestDto, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* OauthApi - functional programming interface
|
|
32
|
+
*/
|
|
33
|
+
export declare const OauthApiFp: (configuration?: Configuration) => {
|
|
34
|
+
/**
|
|
35
|
+
* 파트너 ERP 가 client_id/secret 로 단명 JWT access token 을 발급받습니다 (TTL 15분). 이후 모든 보호 endpoint 는 Authorization: Bearer <token> 헤더로 호출합니다.
|
|
36
|
+
* @summary OAuth 2.0 access token 발급 (client_credentials)
|
|
37
|
+
* @param {TokenRequestDto} tokenRequestDto
|
|
38
|
+
* @param {*} [options] Override http request option.
|
|
39
|
+
* @throws {RequiredError}
|
|
40
|
+
*/
|
|
41
|
+
token(tokenRequestDto: TokenRequestDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TokenResponseDto>>;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* OauthApi - factory interface
|
|
45
|
+
*/
|
|
46
|
+
export declare const OauthApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
47
|
+
/**
|
|
48
|
+
* 파트너 ERP 가 client_id/secret 로 단명 JWT access token 을 발급받습니다 (TTL 15분). 이후 모든 보호 endpoint 는 Authorization: Bearer <token> 헤더로 호출합니다.
|
|
49
|
+
* @summary OAuth 2.0 access token 발급 (client_credentials)
|
|
50
|
+
* @param {TokenRequestDto} tokenRequestDto
|
|
51
|
+
* @param {*} [options] Override http request option.
|
|
52
|
+
* @throws {RequiredError}
|
|
53
|
+
*/
|
|
54
|
+
token(tokenRequestDto: TokenRequestDto, options?: RawAxiosRequestConfig): AxiosPromise<TokenResponseDto>;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* OauthApi - object-oriented interface
|
|
58
|
+
*/
|
|
59
|
+
export declare class OauthApi extends BaseAPI {
|
|
60
|
+
/**
|
|
61
|
+
* 파트너 ERP 가 client_id/secret 로 단명 JWT access token 을 발급받습니다 (TTL 15분). 이후 모든 보호 endpoint 는 Authorization: Bearer <token> 헤더로 호출합니다.
|
|
62
|
+
* @summary OAuth 2.0 access token 발급 (client_credentials)
|
|
63
|
+
* @param {TokenRequestDto} tokenRequestDto
|
|
64
|
+
* @param {*} [options] Override http request option.
|
|
65
|
+
* @throws {RequiredError}
|
|
66
|
+
*/
|
|
67
|
+
token(tokenRequestDto: TokenRequestDto, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<TokenResponseDto, any, {}>>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* CMARKET V6 Partner API
|
|
5
|
+
* 외부 ERP 연동용 RESTful API. V5 17개 엔드포인트의 V6 후속.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
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
|
+
import globalAxios from 'axios';
|
|
24
|
+
// Some imports not used depending on template conditions
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { BASE_PATH, BaseAPI, operationServerMap } from '../base';
|
|
29
|
+
/**
|
|
30
|
+
* OauthApi - axios parameter creator
|
|
31
|
+
*/
|
|
32
|
+
export const OauthApiAxiosParamCreator = function (configuration) {
|
|
33
|
+
return {
|
|
34
|
+
/**
|
|
35
|
+
* 파트너 ERP 가 client_id/secret 로 단명 JWT access token 을 발급받습니다 (TTL 15분). 이후 모든 보호 endpoint 는 Authorization: Bearer <token> 헤더로 호출합니다.
|
|
36
|
+
* @summary OAuth 2.0 access token 발급 (client_credentials)
|
|
37
|
+
* @param {TokenRequestDto} tokenRequestDto
|
|
38
|
+
* @param {*} [options] Override http request option.
|
|
39
|
+
* @throws {RequiredError}
|
|
40
|
+
*/
|
|
41
|
+
token: (tokenRequestDto_1, ...args_1) => __awaiter(this, [tokenRequestDto_1, ...args_1], void 0, function* (tokenRequestDto, options = {}) {
|
|
42
|
+
// verify required parameter 'tokenRequestDto' is not null or undefined
|
|
43
|
+
assertParamExists('token', 'tokenRequestDto', tokenRequestDto);
|
|
44
|
+
const localVarPath = `/v1/oauth/token`;
|
|
45
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
46
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
47
|
+
let baseOptions;
|
|
48
|
+
if (configuration) {
|
|
49
|
+
baseOptions = configuration.baseOptions;
|
|
50
|
+
}
|
|
51
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
52
|
+
const localVarHeaderParameter = {};
|
|
53
|
+
const localVarQueryParameter = {};
|
|
54
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
55
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
56
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
57
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
58
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
59
|
+
localVarRequestOptions.data = serializeDataIfNeeded(tokenRequestDto, localVarRequestOptions, configuration);
|
|
60
|
+
return {
|
|
61
|
+
url: toPathString(localVarUrlObj),
|
|
62
|
+
options: localVarRequestOptions,
|
|
63
|
+
};
|
|
64
|
+
}),
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* OauthApi - functional programming interface
|
|
69
|
+
*/
|
|
70
|
+
export const OauthApiFp = function (configuration) {
|
|
71
|
+
const localVarAxiosParamCreator = OauthApiAxiosParamCreator(configuration);
|
|
72
|
+
return {
|
|
73
|
+
/**
|
|
74
|
+
* 파트너 ERP 가 client_id/secret 로 단명 JWT access token 을 발급받습니다 (TTL 15분). 이후 모든 보호 endpoint 는 Authorization: Bearer <token> 헤더로 호출합니다.
|
|
75
|
+
* @summary OAuth 2.0 access token 발급 (client_credentials)
|
|
76
|
+
* @param {TokenRequestDto} tokenRequestDto
|
|
77
|
+
* @param {*} [options] Override http request option.
|
|
78
|
+
* @throws {RequiredError}
|
|
79
|
+
*/
|
|
80
|
+
token(tokenRequestDto, options) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
var _a, _b, _c;
|
|
83
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.token(tokenRequestDto, options);
|
|
84
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
85
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['OauthApi.token']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
86
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* OauthApi - factory interface
|
|
93
|
+
*/
|
|
94
|
+
export const OauthApiFactory = function (configuration, basePath, axios) {
|
|
95
|
+
const localVarFp = OauthApiFp(configuration);
|
|
96
|
+
return {
|
|
97
|
+
/**
|
|
98
|
+
* 파트너 ERP 가 client_id/secret 로 단명 JWT access token 을 발급받습니다 (TTL 15분). 이후 모든 보호 endpoint 는 Authorization: Bearer <token> 헤더로 호출합니다.
|
|
99
|
+
* @summary OAuth 2.0 access token 발급 (client_credentials)
|
|
100
|
+
* @param {TokenRequestDto} tokenRequestDto
|
|
101
|
+
* @param {*} [options] Override http request option.
|
|
102
|
+
* @throws {RequiredError}
|
|
103
|
+
*/
|
|
104
|
+
token(tokenRequestDto, options) {
|
|
105
|
+
return localVarFp.token(tokenRequestDto, options).then((request) => request(axios, basePath));
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* OauthApi - object-oriented interface
|
|
111
|
+
*/
|
|
112
|
+
export class OauthApi extends BaseAPI {
|
|
113
|
+
/**
|
|
114
|
+
* 파트너 ERP 가 client_id/secret 로 단명 JWT access token 을 발급받습니다 (TTL 15분). 이후 모든 보호 endpoint 는 Authorization: Bearer <token> 헤더로 호출합니다.
|
|
115
|
+
* @summary OAuth 2.0 access token 발급 (client_credentials)
|
|
116
|
+
* @param {TokenRequestDto} tokenRequestDto
|
|
117
|
+
* @param {*} [options] Override http request option.
|
|
118
|
+
* @throws {RequiredError}
|
|
119
|
+
*/
|
|
120
|
+
token(tokenRequestDto, options) {
|
|
121
|
+
return OauthApiFp(this.configuration).token(tokenRequestDto, options).then((request) => request(this.axios, this.basePath));
|
|
122
|
+
}
|
|
123
|
+
}
|