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.
@@ -0,0 +1,9 @@
1
+ export declare enum CART_FLAGS {
2
+ None = 0,
3
+ ResetCartDetail = 1,
4
+ InitializeDefaults = 2,
5
+ ShipmentOptions = 4,
6
+ CustomerAddresses = 8,
7
+ PaymentTypes = 16,
8
+ Coupons = 32
9
+ }
@@ -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 = {}));
@@ -5,3 +5,4 @@ export * from './productFlags';
5
5
  export * from './scopeTypes';
6
6
  export * from './addressPartTypeId';
7
7
  export * from './deviceTypes';
8
+ export * from './cartFlags';
@@ -21,3 +21,4 @@ __exportStar(require("./productFlags"), exports);
21
21
  __exportStar(require("./scopeTypes"), exports);
22
22
  __exportStar(require("./addressPartTypeId"), exports);
23
23
  __exportStar(require("./deviceTypes"), exports);
24
+ __exportStar(require("./cartFlags"), exports);
@@ -1,28 +1,58 @@
1
+ import { IAddress } from "./address";
1
2
  import { IResponse } from "./response";
2
- export interface IShoppingCartResponse extends IResponse {
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 ISubscriptionInfo {
11
- duration: number;
12
- durationType: number;
13
- period: number;
14
- periodType: number;
15
- }
16
- export interface IGiftCardInfo {
17
- fromName?: string;
18
- toName?: string;
19
- toEmail?: string;
20
- note: string;
21
- deliveryTime?: string;
22
- }
23
- export interface ICartInfo {
24
- status: string;
25
- message: string;
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: ICartTotal[];
74
+ totals: ITotal[];
45
75
  itemDate: string;
46
- cartItemInfo: ICartInfo[];
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?: IGiftCardInfo;
84
+ giftCardInfo: IGiftCardInfo;
55
85
  isGiftCard: boolean;
56
86
  subscriptionOptionId: number;
57
- subscriptionInfo?: ISubscriptionInfo;
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 ICartTotal {
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 ICart {
85
- documentId: string;
86
- docNo: string;
87
- docDate: string;
88
- deliveredPerson: string;
89
- isTaxIncluded: boolean;
90
- isGuestOrder: boolean;
91
- priceTypeId: number;
92
- currencyId: number;
93
- currencyRate: number;
94
- shipperId: number;
95
- channelId: number;
96
- deliveryDate: string;
97
- wareHouseId: number;
98
- isGiftBoxRequested: boolean;
99
- isGiftBoxEnabled: boolean;
100
- shippingAddressId: number;
101
- invoiceAddressId: number;
102
- platformId: number;
103
- clientIp: string;
104
- referrerUrl: string;
105
- referrerName: string;
106
- userAgent: string;
107
- orderNote: string;
108
- memberNote: string;
109
- giftBoxNote: string;
110
- couponCode: string;
111
- bankPoint: number;
112
- sitePoint: number;
113
- gainPoint: number;
114
- paymentTypeId: number;
115
- cardBin: string;
116
- isSecurePaymentRequired: boolean;
117
- memberId: number;
118
- installmentNumber: number;
119
- bankId: number;
120
- extraMemberPoint: number;
121
- totals: ICartTotal[];
122
- items: ICartItem[];
123
- cartInfo: ICartInfo[];
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 { IShoppingCartResponse, IApiResponse, IRequestInit, IService, IGiftCardInfo, IRequestInfo, IGetCartItemCountResponse } from '../..';
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<IShoppingCartResponse>>;
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
  }
@@ -92,6 +92,7 @@ declare const _default: {
92
92
  ShoppingCart: {
93
93
  AddToCart: string;
94
94
  GetCartItemCount: string;
95
+ GetCart: string;
95
96
  };
96
97
  };
97
98
  export default _default;
@@ -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 = '' }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "4.6.0",
3
+ "version": "4.6.2",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",