@shopby/shop-sdk 1.7.9 → 1.7.12
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/build/src/index.d.ts +1 -1
- package/build/src/index.js +3 -4
- package/build/src/index.js.map +1 -1
- package/build/src/middlewares/index.d.ts +2 -2
- package/build/src/middlewares/index.js +1 -9
- package/build/src/middlewares/index.js.map +1 -1
- package/build/src/utils/index.d.ts +0 -2
- package/build/src/utils/index.js +0 -17
- package/build/src/utils/index.js.map +1 -1
- package/build/types/order.d.ts +9 -11
- package/build/types/root.d.ts +1 -7
- package/build/types/root.js +1 -1
- package/build/types/root.js.map +1 -1
- package/package.json +1 -1
package/build/src/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CreatedOutput, CreateOptions } from '../types/root';
|
|
2
|
-
export declare const create: ({ baseURL, headerOption, customHttpRequest, version,
|
|
2
|
+
export declare const create: ({ baseURL, headerOption, customHttpRequest, version, }: CreateOptions) => CreatedOutput;
|
package/build/src/index.js
CHANGED
|
@@ -19,8 +19,7 @@ function fetchHttpRequest(options, request) {
|
|
|
19
19
|
return __generator(this, function (_a) {
|
|
20
20
|
switch (_a.label) {
|
|
21
21
|
case 0:
|
|
22
|
-
option = __assign(
|
|
23
|
-
console.log(option);
|
|
22
|
+
option = __assign(__assign({}, options), request);
|
|
24
23
|
if (request.body)
|
|
25
24
|
option['body'] = request.body;
|
|
26
25
|
return [4 /*yield*/, fetch(options.baseURL + request.url, option)];
|
|
@@ -46,8 +45,8 @@ function fetchHttpRequest(options, request) {
|
|
|
46
45
|
}
|
|
47
46
|
var defaultHttpRequest = curry(fetchHttpRequest);
|
|
48
47
|
export var create = function (_a) {
|
|
49
|
-
var baseURL = _a.baseURL, headerOption = _a.headerOption, _b = _a.customHttpRequest, customHttpRequest = _b === void 0 ? defaultHttpRequest : _b, _c = _a.version, version = _c === void 0 ? '1.0' : _c
|
|
50
|
-
var httpRequest = curry(requestMiddleware)(createRequestHeader(baseURL, headerOption, version
|
|
48
|
+
var baseURL = _a.baseURL, headerOption = _a.headerOption, _b = _a.customHttpRequest, customHttpRequest = _b === void 0 ? defaultHttpRequest : _b, _c = _a.version, version = _c === void 0 ? '1.0' : _c;
|
|
49
|
+
var httpRequest = curry(requestMiddleware)(createRequestHeader(baseURL, headerOption, version), customHttpRequest);
|
|
51
50
|
return {
|
|
52
51
|
admin: admin(httpRequest),
|
|
53
52
|
auth: auth(httpRequest),
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AACrE,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,SAAS,CAAC;AAEnD,SAAe,gBAAgB,CAC7B,OAAoB,EACpB,OAA4B;;;;;;oBAEtB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS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EAAE,QAAQ,CAAC,IAAI;4BACnB,EAAE,EAAE,QAAQ,CAAC,EAAE;4BACf,IAAI,MAAA;yBACL,EAAC;;;;CACH;AAED,IAAM,kBAAkB,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAEnD,MAAM,CAAC,IAAM,MAAM,GAAG,UAAC,EAKP;QAJd,OAAO,aAAA,EACP,YAAY,kBAAA,EACZ,yBAAsC,EAAtC,iBAAiB,mBAAG,kBAAkB,KAAA,EACtC,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA;IAEf,IAAM,WAAW,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAC1C,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EACnD,iBAAiB,CAClB,CAAC;IAEF,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC;QACzB,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC;QACvB,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC;QACzB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC;QAC7B,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC;QACjC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC;QAC3B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC;QACzB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC;QAC7B,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC;QACjC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC;KAC9B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreatorType, RequestOption } from '../../types/root';
|
|
2
2
|
declare type Query = string[][] | Record<string, string> | string | URLSearchParams;
|
|
3
3
|
export declare const requestMiddleware: <Q extends Query, B extends object, F extends Function>(options: CreatorType, next: F, request: RequestOption<Q, B, null>) => any;
|
|
4
|
-
export declare const createRequestHeader: (baseURL: string, headerOption?: HeadersInit | undefined, version?: string
|
|
4
|
+
export declare const createRequestHeader: (baseURL: string, headerOption?: HeadersInit | undefined, version?: string) => CreatorType;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
import { getAccessToken } from "../utils";
|
|
3
2
|
export var requestMiddleware = function (options, next, request) {
|
|
4
3
|
// request.queryString 존재시 미들웨어에서 queryString string 주입
|
|
5
4
|
if (request.queryString) {
|
|
@@ -12,20 +11,13 @@ export var requestMiddleware = function (options, next, request) {
|
|
|
12
11
|
? request.requestBody
|
|
13
12
|
: JSON.stringify(request.requestBody);
|
|
14
13
|
}
|
|
15
|
-
var accessToken = getAccessToken(options.accessTokenOption);
|
|
16
|
-
console.log(accessToken, options, request);
|
|
17
|
-
if (request.useAccessToken && accessToken) {
|
|
18
|
-
Object.assign(options.headers, { accessToken: accessToken });
|
|
19
|
-
}
|
|
20
|
-
console.log(options);
|
|
21
14
|
return next(options, request);
|
|
22
15
|
};
|
|
23
|
-
export var createRequestHeader = function (baseURL, headerOption, version
|
|
16
|
+
export var createRequestHeader = function (baseURL, headerOption, version) {
|
|
24
17
|
if (version === void 0) { version = '1.0'; }
|
|
25
18
|
return {
|
|
26
19
|
baseURL: baseURL,
|
|
27
20
|
headers: __assign({ Version: version }, headerOption),
|
|
28
|
-
accessTokenOption: accessTokenOption,
|
|
29
21
|
};
|
|
30
22
|
};
|
|
31
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middlewares/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middlewares/index.ts"],"names":[],"mappings":";AAIA,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAK/B,OAAoB,EACpB,IAAO,EACP,OAA4B;IAE5B,uDAAuD;IACvD,IAAI,OAAO,CAAC,WAAW,EAAE;QACvB,OAAO,CAAC,GAAG,IAAI,GAAG,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC;KAC1E;IAED,yCAAyC;IACzC,IAAI,OAAO,CAAC,WAAW,EAAE;QACvB,OAAO,CAAC,IAAI;YACV,OAAO,CAAC,WAAW,YAAY,QAAQ;gBACrC,CAAC,CAAC,OAAO,CAAC,WAAW;gBACrB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;KAC3C;IAED,OAAO,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,mBAAmB,GAAG,UACjC,OAAe,EACf,YAA0B,EAC1B,OAAe;IAAf,wBAAA,EAAA,eAAe;IAEf,OAAoB;QAClB,OAAO,SAAA;QACP,OAAO,aACL,OAAO,EAAE,OAAO,IACb,YAAY,CAChB;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AccessTokenOptions } from "../../types/root";
|
|
2
1
|
declare class CustomError extends Error {
|
|
3
2
|
name: string;
|
|
4
3
|
constructor(message?: string);
|
|
@@ -9,5 +8,4 @@ export declare class HTTPError extends CustomError {
|
|
|
9
8
|
constructor(status: number, errorData: Record<string, any>, message?: string);
|
|
10
9
|
}
|
|
11
10
|
export declare const parseJSONSafely: (text: string) => any;
|
|
12
|
-
export declare const getAccessToken: (accessTokenOptions?: AccessTokenOptions | undefined) => string;
|
|
13
11
|
export {};
|
package/build/src/utils/index.js
CHANGED
|
@@ -27,21 +27,4 @@ export var parseJSONSafely = function (text) {
|
|
|
27
27
|
return text;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
export var getAccessToken = function (accessTokenOptions) {
|
|
31
|
-
var _a;
|
|
32
|
-
console.log(accessTokenOptions);
|
|
33
|
-
if (!accessTokenOptions)
|
|
34
|
-
return '';
|
|
35
|
-
var tokenName = accessTokenOptions.tokenName, tokenType = accessTokenOptions.tokenType;
|
|
36
|
-
var getCookie = function (name) {
|
|
37
|
-
if (name === void 0) { name = tokenName; }
|
|
38
|
-
var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
|
|
39
|
-
return match ? match[2] : '';
|
|
40
|
-
};
|
|
41
|
-
var token = {
|
|
42
|
-
cookie: getCookie(),
|
|
43
|
-
localStorage: (_a = JSON.parse(window.localStorage.getItem(tokenName))) !== null && _a !== void 0 ? _a : '',
|
|
44
|
-
};
|
|
45
|
-
return token[tokenType];
|
|
46
|
-
};
|
|
47
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";AAAA;IAA0B,+BAAK;IAG7B,qBAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC;;IAC3B,CAAC;IACH,kBAAC;AAAD,CAAC,AAPD,CAA0B,KAAK,GAO9B;AAED;IAA+B,6BAAW;IACxC,mBAAmB,MAAc,EAAS,SAA8B,EAAE,OAAgB;QAA1F,YACE,kBAAM,OAAO,CAAC,SACf;QAFkB,YAAM,GAAN,MAAM,CAAQ;QAAS,eAAS,GAAT,SAAS,CAAqB;;IAExE,CAAC;IACH,gBAAC;AAAD,CAAC,AAJD,CAA+B,WAAW,GAIzC;;AAED,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,IAAY;IAC1C,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACzB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC"}
|
package/build/types/order.d.ts
CHANGED
|
@@ -96,8 +96,14 @@ export interface PaymentInfo {
|
|
|
96
96
|
accumulationAmt: number;
|
|
97
97
|
deliveryAmtOnDelivery: number;
|
|
98
98
|
salesTaxAmt: number;
|
|
99
|
-
|
|
99
|
+
isAvailableAccumulation: boolean;
|
|
100
100
|
totalStandardAmt: number;
|
|
101
|
+
remoteDeliveryAmtOnDelivery: number;
|
|
102
|
+
cartCouponAmt: number;
|
|
103
|
+
minAccumulationLimit: number;
|
|
104
|
+
minPriceLimit: number;
|
|
105
|
+
deliveryAmt: number;
|
|
106
|
+
totalAdditionalDiscountAmt: number;
|
|
101
107
|
}
|
|
102
108
|
export interface OrderSheetAddress {
|
|
103
109
|
recentAddresses: OrderSheetAddressAddressDetail[];
|
|
@@ -278,15 +284,7 @@ export interface PostOrderSheetsOrderSheetNoCalculateResponse {
|
|
|
278
284
|
deliveryGroups: DeliveryGroup[];
|
|
279
285
|
appliedCoupons: AppliedCoupon;
|
|
280
286
|
availablePayTypes: PayType[];
|
|
281
|
-
paymentInfo:
|
|
282
|
-
}
|
|
283
|
-
export interface OrderSheetsOrderSheetNoCalculatePaymentInfo extends PaymentInfo {
|
|
284
|
-
remoteDeliveryAmtOnDelivery: number;
|
|
285
|
-
cartCouponAmt: number;
|
|
286
|
-
minAccumulationLimit: number;
|
|
287
|
-
minPriceLimit: number;
|
|
288
|
-
deliveryAmt: number;
|
|
289
|
-
totalAdditionalDiscountAmt: number;
|
|
287
|
+
paymentInfo: PaymentInfo;
|
|
290
288
|
}
|
|
291
289
|
export interface CouponRequest {
|
|
292
290
|
productCoupons: ProductCouponWithProductNo[];
|
|
@@ -422,7 +420,7 @@ export interface AddressPayload {
|
|
|
422
420
|
receiverName: string;
|
|
423
421
|
addressType: AddressType;
|
|
424
422
|
customsIdNumber?: string;
|
|
425
|
-
countryCd
|
|
423
|
+
countryCd?: CountryCode;
|
|
426
424
|
receiverZipCd: string;
|
|
427
425
|
addressName?: string;
|
|
428
426
|
receiverDetailAddress?: string;
|
package/build/types/root.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export interface CreatorType {
|
|
|
14
14
|
accessToken?: string;
|
|
15
15
|
Version: string;
|
|
16
16
|
} & HeadersInit;
|
|
17
|
-
accessTokenOption?: AccessTokenOptions;
|
|
18
17
|
}
|
|
19
18
|
export interface RequestOption<QueryStringType, BodyType, PathType = null> {
|
|
20
19
|
method?: Method;
|
|
@@ -32,16 +31,11 @@ export interface RequestConfig {
|
|
|
32
31
|
export interface ResponseData<T> extends Response {
|
|
33
32
|
data: T;
|
|
34
33
|
}
|
|
35
|
-
export interface AccessTokenOptions {
|
|
36
|
-
tokenType: 'cookie' | 'localStorage';
|
|
37
|
-
tokenName: string;
|
|
38
|
-
}
|
|
39
34
|
export interface CreateOptions {
|
|
40
35
|
baseURL: string;
|
|
41
36
|
headerOption?: HeadersInit;
|
|
42
37
|
customHttpRequest?: Function;
|
|
43
38
|
version?: string;
|
|
44
|
-
accessTokenOption?: AccessTokenOptions;
|
|
45
39
|
}
|
|
46
40
|
export interface CreatedOutput {
|
|
47
41
|
marketing: {
|
|
@@ -327,5 +321,5 @@ export * from './order';
|
|
|
327
321
|
export * from './product';
|
|
328
322
|
export * from './storage';
|
|
329
323
|
export * from './enum';
|
|
330
|
-
export * from '../src/utils
|
|
324
|
+
export * from '../src/utils';
|
|
331
325
|
export * from '../src/index';
|
package/build/types/root.js
CHANGED
package/build/types/root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../types/root.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../types/root.ts"],"names":[],"mappings":"AA2oBA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|