@shopby/shop-sdk 1.27.21 → 1.27.23
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/CHANGELOG.md +9 -0
- package/build/src/index.d.ts +1 -1
- package/build/src/index.js +20 -1
- package/build/src/index.js.map +1 -1
- package/build/types/domain/order/index.d.ts +10 -1
- package/build/types/domain/order/index.js +1 -0
- package/build/types/domain/order/index.js.map +1 -1
- package/build/types/http/index.d.ts +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.27.23](https://gitlab.e-ncp.com/ncp-client/shop-sdk/compare/v1.27.22...v1.27.23) (2022-11-16)
|
|
6
|
+
|
|
7
|
+
### [1.27.22](https://gitlab.e-ncp.com/ncp-client/shop-sdk/compare/v1.27.21...v1.27.22) (2022-11-03)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* myzorder cart api modify ([bc001f8](https://gitlab.e-ncp.com/ncp-client/shop-sdk/commit/bc001f8bacf2f8ebcb7d1e870263f97a8657dcbe))
|
|
13
|
+
|
|
5
14
|
### [1.27.21](https://gitlab.e-ncp.com/ncp-client/shop-sdk/compare/v1.27.20...v1.27.21) (2022-11-02)
|
|
6
15
|
|
|
7
16
|
|
package/build/src/index.d.ts
CHANGED
|
@@ -174,7 +174,7 @@ export declare const create: ({ baseURL, headerOption, customHttpRequest, versio
|
|
|
174
174
|
putCart(request: import("../types").PutCartRequest): Promise<import("../types/http").ResponseData<void>>;
|
|
175
175
|
postCart(request: import("../types").PostCartRequest): Promise<import("../types/http").ResponseData<import("../types").PostCartResponse>>;
|
|
176
176
|
deleteCart(request: import("../types").DeleteCartRequest): Promise<import("../types/http").ResponseData<any>>;
|
|
177
|
-
getCartCalculate(request: import("../types").GetCartCalculateRequest): Promise<import("../types/http").ResponseData<import("../types").
|
|
177
|
+
getCartCalculate(request: import("../types").GetCartCalculateRequest): Promise<import("../types/http").ResponseData<import("../types").GetCartCalculateResponse>>;
|
|
178
178
|
getCartCount(): Promise<{
|
|
179
179
|
count: number;
|
|
180
180
|
}>;
|
package/build/src/index.js
CHANGED
|
@@ -13,6 +13,22 @@ import image from './storage/image';
|
|
|
13
13
|
import curry from 'lodash.curry';
|
|
14
14
|
import { createRequestHeader, requestMiddleware } from './middlewares';
|
|
15
15
|
import { HTTPError, parseJSONSafely } from './utils';
|
|
16
|
+
var abortMap = new Map();
|
|
17
|
+
var setAbortMap = function (requestUrl, isCanceled) {
|
|
18
|
+
if (!isCanceled)
|
|
19
|
+
return;
|
|
20
|
+
if (abortMap.has(requestUrl))
|
|
21
|
+
return;
|
|
22
|
+
abortMap.set(requestUrl, new AbortController());
|
|
23
|
+
};
|
|
24
|
+
var addedSignalOption = function (request, option) {
|
|
25
|
+
var url = request.url, _a = request.getAbortController, getAbortController = _a === void 0 ? null : _a, _b = request.isCancelable, isCancelable = _b === void 0 ? false : _b;
|
|
26
|
+
if (!isCancelable)
|
|
27
|
+
return option;
|
|
28
|
+
setAbortMap(url, isCancelable);
|
|
29
|
+
isCancelable && (getAbortController === null || getAbortController === void 0 ? void 0 : getAbortController(abortMap.get(request.url)));
|
|
30
|
+
return __assign(__assign({}, option), { signal: abortMap.get(url) });
|
|
31
|
+
};
|
|
16
32
|
function fetchHttpRequest(options, request) {
|
|
17
33
|
return __awaiter(this, void 0, void 0, function () {
|
|
18
34
|
var option, response, content, data;
|
|
@@ -22,7 +38,7 @@ function fetchHttpRequest(options, request) {
|
|
|
22
38
|
option = __assign(__assign({}, options), request);
|
|
23
39
|
if (request.body)
|
|
24
40
|
option['body'] = request.body;
|
|
25
|
-
return [4 /*yield*/, fetch(options.baseURL + request.url, option)];
|
|
41
|
+
return [4 /*yield*/, fetch(options.baseURL + request.url, addedSignalOption(request, option))];
|
|
26
42
|
case 1:
|
|
27
43
|
response = _a.sent();
|
|
28
44
|
return [4 /*yield*/, response.text()];
|
|
@@ -32,6 +48,9 @@ function fetchHttpRequest(options, request) {
|
|
|
32
48
|
if (!response.ok) {
|
|
33
49
|
throw new HTTPError(response.status, data.code, data.message);
|
|
34
50
|
}
|
|
51
|
+
else {
|
|
52
|
+
abortMap.has(request.url) && abortMap.delete(request.url);
|
|
53
|
+
}
|
|
35
54
|
return [2 /*return*/, {
|
|
36
55
|
status: response.status,
|
|
37
56
|
url: response.url,
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAMA,OAAO,KAAK,MAAM,gBAAgB,CAAC;AACnC,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,KAAK,MAAM,gBAAgB,CAAC;AACnC,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,MAAM,gBAAgB,CAAC;AACnC,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,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,IAAM,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;AAE3B,IAAM,WAAW,GAAG,UAAC,UAAkB,EAAE,UAAoB;I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;QAC3B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC;QACzB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC;QAC7B,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC;QACjC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC;KAC5B,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc;AACd,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC"}
|
|
@@ -96,7 +96,16 @@ export interface GetCartCalculateRequest extends OptionalAccessTokenRequest {
|
|
|
96
96
|
divideInvalidProducts: boolean;
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
export
|
|
99
|
+
export interface GetCartCalculateResponse {
|
|
100
|
+
buyAmt: number;
|
|
101
|
+
discountAmt: number;
|
|
102
|
+
totalAmt: number;
|
|
103
|
+
accumulationAmtWhenBuyConfirm: number;
|
|
104
|
+
standardAmt: number;
|
|
105
|
+
totalPayOnDeliveryAmt: number;
|
|
106
|
+
totalDeliveryAmt: number;
|
|
107
|
+
totalPrePaidDeliveryAmt: number;
|
|
108
|
+
}
|
|
100
109
|
/**
|
|
101
110
|
* path: /order-configs
|
|
102
111
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../types/domain/order/index.ts"],"names":[],"mappings":"AAiDA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../types/domain/order/index.ts"],"names":[],"mappings":"AAiDA,cAAc,UAAU,CAAC;AAmHxB,CAAC"}
|
|
@@ -6,6 +6,7 @@ export interface CreatorType {
|
|
|
6
6
|
Version: string;
|
|
7
7
|
} & HeadersInit;
|
|
8
8
|
}
|
|
9
|
+
export declare type GetAbortControllerType = (abortController: AbortController) => AbortController;
|
|
9
10
|
export interface RequestOption<QueryStringType, BodyType, PathType = null> {
|
|
10
11
|
method?: Method;
|
|
11
12
|
url?: string;
|
|
@@ -17,6 +18,8 @@ export interface RequestOption<QueryStringType, BodyType, PathType = null> {
|
|
|
17
18
|
headers?: {
|
|
18
19
|
Version?: string;
|
|
19
20
|
};
|
|
21
|
+
isCancelable?: boolean;
|
|
22
|
+
getAbortController?: GetAbortControllerType;
|
|
20
23
|
}
|
|
21
24
|
export interface RequestConfig {
|
|
22
25
|
method?: Method;
|