nextemos 4.6.0 → 4.6.2
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/dist/enums/cartFlags.d.ts +9 -0
- package/dist/enums/cartFlags.js +13 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.js +1 -0
- package/dist/interfaces/shoppingcart.d.ts +99 -62
- package/dist/services/shoppingcart/index.js +11 -0
- package/dist/services/shoppingcart/shoppingcart.types.d.ts +9 -2
- package/dist/services/urls.d.ts +1 -0
- package/dist/services/urls.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CART_FLAGS = void 0;
|
|
4
|
+
var CART_FLAGS;
|
|
5
|
+
(function (CART_FLAGS) {
|
|
6
|
+
CART_FLAGS[CART_FLAGS["None"] = 0] = "None";
|
|
7
|
+
CART_FLAGS[CART_FLAGS["ResetCartDetail"] = 1] = "ResetCartDetail";
|
|
8
|
+
CART_FLAGS[CART_FLAGS["InitializeDefaults"] = 2] = "InitializeDefaults";
|
|
9
|
+
CART_FLAGS[CART_FLAGS["ShipmentOptions"] = 4] = "ShipmentOptions";
|
|
10
|
+
CART_FLAGS[CART_FLAGS["CustomerAddresses"] = 8] = "CustomerAddresses";
|
|
11
|
+
CART_FLAGS[CART_FLAGS["PaymentTypes"] = 16] = "PaymentTypes";
|
|
12
|
+
CART_FLAGS[CART_FLAGS["Coupons"] = 32] = "Coupons";
|
|
13
|
+
})(CART_FLAGS || (exports.CART_FLAGS = CART_FLAGS = {}));
|
package/dist/enums/index.d.ts
CHANGED
package/dist/enums/index.js
CHANGED
|
@@ -1,28 +1,58 @@
|
|
|
1
|
+
import { IAddress } from "./address";
|
|
1
2
|
import { IResponse } from "./response";
|
|
2
|
-
export interface
|
|
3
|
+
export interface IGetCartResponse extends IResponse {
|
|
3
4
|
cart: ICart;
|
|
4
5
|
isUpdated: boolean;
|
|
5
6
|
isTotalsChanged: boolean;
|
|
7
|
+
isFreeOfChargeAvailable: boolean;
|
|
8
|
+
paymentTypes: IPaymentType[];
|
|
9
|
+
coupons: ICoupon[];
|
|
10
|
+
shipmentOptions: IShipmentOption[];
|
|
11
|
+
addresses: IAddress[];
|
|
6
12
|
}
|
|
7
13
|
export interface IGetCartItemCountResponse extends IResponse {
|
|
8
14
|
count: number;
|
|
9
15
|
}
|
|
10
|
-
export interface
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
export interface ICart {
|
|
17
|
+
documentId: string;
|
|
18
|
+
docNo: string;
|
|
19
|
+
docDate: string;
|
|
20
|
+
deliveredPerson: string;
|
|
21
|
+
isTaxIncluded: boolean;
|
|
22
|
+
isGuestOrder: boolean;
|
|
23
|
+
priceTypeId: number;
|
|
24
|
+
currencyId: number;
|
|
25
|
+
currencyRate: number;
|
|
26
|
+
shipperId: number;
|
|
27
|
+
channelId: number;
|
|
28
|
+
deliveryDate: string;
|
|
29
|
+
wareHouseId: number;
|
|
30
|
+
isGiftBoxRequested: boolean;
|
|
31
|
+
isGiftBoxEnabled: boolean;
|
|
32
|
+
shippingAddressId: number;
|
|
33
|
+
invoiceAddressId: number;
|
|
34
|
+
platformId: number;
|
|
35
|
+
clientIp: string;
|
|
36
|
+
referrerUrl: string;
|
|
37
|
+
referrerName: string;
|
|
38
|
+
userAgent: string;
|
|
39
|
+
orderNote: string;
|
|
40
|
+
memberNote: string;
|
|
41
|
+
giftBoxNote: string;
|
|
42
|
+
couponCode: string;
|
|
43
|
+
bankPoint: number;
|
|
44
|
+
sitePoint: number;
|
|
45
|
+
gainPoint: number;
|
|
46
|
+
paymentTypeId: number;
|
|
47
|
+
cardBin: string;
|
|
48
|
+
isSecurePaymentRequired: boolean;
|
|
49
|
+
memberId: number;
|
|
50
|
+
installmentNumber: number;
|
|
51
|
+
bankId: number;
|
|
52
|
+
extraMemberPoint: number;
|
|
53
|
+
totals: ITotal[];
|
|
54
|
+
items: ICartItem[];
|
|
55
|
+
cartInfo: ICartInfo[];
|
|
26
56
|
}
|
|
27
57
|
export interface ICartItem {
|
|
28
58
|
id: number;
|
|
@@ -41,9 +71,9 @@ export interface ICartItem {
|
|
|
41
71
|
stockBarcodeId: number;
|
|
42
72
|
availableStock: number;
|
|
43
73
|
flags: string;
|
|
44
|
-
totals:
|
|
74
|
+
totals: ITotal[];
|
|
45
75
|
itemDate: string;
|
|
46
|
-
cartItemInfo:
|
|
76
|
+
cartItemInfo: ICartItemInfo[];
|
|
47
77
|
isGiftBoxRequested: boolean;
|
|
48
78
|
giftBoxNote: string;
|
|
49
79
|
platformId: number;
|
|
@@ -51,10 +81,10 @@ export interface ICartItem {
|
|
|
51
81
|
referrerUrl: string;
|
|
52
82
|
referrerName: string;
|
|
53
83
|
userAgent: string;
|
|
54
|
-
giftCardInfo
|
|
84
|
+
giftCardInfo: IGiftCardInfo;
|
|
55
85
|
isGiftCard: boolean;
|
|
56
86
|
subscriptionOptionId: number;
|
|
57
|
-
subscriptionInfo
|
|
87
|
+
subscriptionInfo: ISubscriptionInfo;
|
|
58
88
|
commissionRate: number;
|
|
59
89
|
gainPoint: number;
|
|
60
90
|
taxTypeId: number;
|
|
@@ -63,7 +93,7 @@ export interface ICartItem {
|
|
|
63
93
|
criterias: number[];
|
|
64
94
|
tags: string[];
|
|
65
95
|
}
|
|
66
|
-
export interface
|
|
96
|
+
export interface ITotal {
|
|
67
97
|
customType: string;
|
|
68
98
|
customTypeName: string;
|
|
69
99
|
typeId: number;
|
|
@@ -81,44 +111,51 @@ export interface ICartTotal {
|
|
|
81
111
|
orderNo: number;
|
|
82
112
|
memberSubscriptionItemId: number;
|
|
83
113
|
}
|
|
84
|
-
export interface
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
114
|
+
export interface ICartItemInfo {
|
|
115
|
+
status: string;
|
|
116
|
+
message: string;
|
|
117
|
+
}
|
|
118
|
+
export interface IGiftCardInfo {
|
|
119
|
+
fromName: string;
|
|
120
|
+
toName: string;
|
|
121
|
+
toEmail: string;
|
|
122
|
+
note: string;
|
|
123
|
+
deliveryTime: string;
|
|
124
|
+
}
|
|
125
|
+
export interface ISubscriptionInfo {
|
|
126
|
+
duration: number;
|
|
127
|
+
durationType: number;
|
|
128
|
+
period: number;
|
|
129
|
+
periodType: number;
|
|
130
|
+
}
|
|
131
|
+
export interface ICartInfo {
|
|
132
|
+
status: string;
|
|
133
|
+
message: string;
|
|
134
|
+
}
|
|
135
|
+
export interface IPaymentType {
|
|
136
|
+
id: number;
|
|
137
|
+
name: string;
|
|
138
|
+
explanation: string;
|
|
139
|
+
isDefault: boolean;
|
|
140
|
+
paymentMethod: number;
|
|
141
|
+
paymentMethodProviderType: string;
|
|
142
|
+
order: number;
|
|
143
|
+
}
|
|
144
|
+
export interface ICoupon {
|
|
145
|
+
id: number;
|
|
146
|
+
code: string;
|
|
147
|
+
couponType: string;
|
|
148
|
+
userNote: string;
|
|
149
|
+
}
|
|
150
|
+
export interface IShipmentOption {
|
|
151
|
+
id: number;
|
|
152
|
+
productId: number;
|
|
153
|
+
name: string;
|
|
154
|
+
priceWithTax: number;
|
|
155
|
+
priceWithoutTax: number;
|
|
156
|
+
isDefault: boolean;
|
|
157
|
+
payAtDoorEnable: boolean;
|
|
158
|
+
cash: boolean;
|
|
159
|
+
creditCard: boolean;
|
|
160
|
+
note: string;
|
|
124
161
|
}
|
|
@@ -63,4 +63,15 @@ exports.ShoppingCartService = {
|
|
|
63
63
|
}), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
|
|
64
64
|
});
|
|
65
65
|
},
|
|
66
|
+
GetCart: function (data, options) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
|
|
69
|
+
serviceUrl: this.ServiceUrl(),
|
|
70
|
+
prefix: this.Prefix,
|
|
71
|
+
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
72
|
+
language: data === null || data === void 0 ? void 0 : data.language,
|
|
73
|
+
methodName: urls_1.default.ShoppingCart.GetCart,
|
|
74
|
+
}), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
|
|
75
|
+
});
|
|
76
|
+
},
|
|
66
77
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IApiResponse, IRequestInit, IService, IGiftCardInfo, IRequestInfo, IGetCartItemCountResponse, IGetCartResponse } from '../..';
|
|
2
2
|
export interface IAddToCartRequest {
|
|
3
3
|
flags?: string;
|
|
4
4
|
productId: number;
|
|
@@ -27,7 +27,14 @@ export interface IGetCartItemCountRequest {
|
|
|
27
27
|
tags?: string[];
|
|
28
28
|
language?: string;
|
|
29
29
|
}
|
|
30
|
+
export interface IGetCartRequest {
|
|
31
|
+
requestInfo?: IRequestInfo;
|
|
32
|
+
flags?: string | string[] | number[];
|
|
33
|
+
tags?: string[];
|
|
34
|
+
language?: string;
|
|
35
|
+
}
|
|
30
36
|
export interface IShoppingCartService extends IService {
|
|
31
|
-
AddToCart: (data: IAddToCartRequest, options?: IRequestInit) => Promise<IApiResponse<
|
|
37
|
+
AddToCart: (data: IAddToCartRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
|
|
32
38
|
GetCartItemCount: (data: IGetCartItemCountRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartItemCountResponse>>;
|
|
39
|
+
GetCart: (data: IGetCartRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
|
|
33
40
|
}
|
package/dist/services/urls.d.ts
CHANGED
package/dist/services/urls.js
CHANGED
|
@@ -98,6 +98,7 @@ exports.default = {
|
|
|
98
98
|
ShoppingCart: {
|
|
99
99
|
AddToCart: '/{language}/ShoppingCartGateway/v1/AddToCart',
|
|
100
100
|
GetCartItemCount: '/{language}/ShoppingCartGateway/v1/GetCartItemCount',
|
|
101
|
+
GetCart: '/{language}/ShoppingCartGateway/v1/GetCart',
|
|
101
102
|
},
|
|
102
103
|
};
|
|
103
104
|
const getUrl = ({ isClient = false, language = process.env.DEFAULT_LANGUAGE || "tr", methodName, serviceUrl, prefix, id = '' }) => {
|