nextemos 4.5.13 → 4.5.14

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.
@@ -1,4 +1,4 @@
1
- import { HTTPMethod as httpMethods } from '../';
1
+ import { DeviceType, HTTPMethod as httpMethods } from '../';
2
2
  type HTTPMethod = httpMethods;
3
3
  export interface IRequestOptions extends RequestInit {
4
4
  url: string;
@@ -41,4 +41,10 @@ export interface IOutputCacheConfiguration {
41
41
  value: string;
42
42
  positionId: number;
43
43
  }
44
+ export interface IRequestInfo {
45
+ platformId?: number | DeviceType;
46
+ referrerUrl?: string;
47
+ referrerName?: string;
48
+ userAgent?: string;
49
+ }
44
50
  export {};
@@ -4,6 +4,9 @@ export interface IShoppingCartResponse extends IResponse {
4
4
  isUpdated: boolean;
5
5
  isTotalsChanged: boolean;
6
6
  }
7
+ export interface IGetCartItemCountResponse extends IResponse {
8
+ count: number;
9
+ }
7
10
  export interface ISubscriptionInfo {
8
11
  duration: number;
9
12
  durationType: number;
@@ -52,4 +52,15 @@ exports.ShoppingCartService = {
52
52
  }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
53
53
  });
54
54
  },
55
+ GetCartItemCount: function (data, options) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
58
+ serviceUrl: this.ServiceUrl(),
59
+ prefix: this.Prefix,
60
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
61
+ language: data === null || data === void 0 ? void 0 : data.language,
62
+ methodName: urls_1.default.ShoppingCart.GetCartItemCount,
63
+ }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
64
+ });
65
+ },
55
66
  };
@@ -1,4 +1,4 @@
1
- import { IShoppingCartResponse, IApiResponse, IRequestInit, IService, IGiftCardInfo, DeviceType } from '../..';
1
+ import { IShoppingCartResponse, IApiResponse, IRequestInit, IService, IGiftCardInfo, IRequestInfo, IGetCartItemCountResponse } from '../..';
2
2
  export interface IAddToCartRequest {
3
3
  flags?: string;
4
4
  productId: number;
@@ -10,12 +10,7 @@ export interface IAddToCartRequest {
10
10
  subscriptionOptionId?: number;
11
11
  children?: IProductChild[];
12
12
  giftCardInfo?: IGiftCardInfo;
13
- requestInfo?: {
14
- platformId?: number | DeviceType;
15
- referrerUrl?: string;
16
- referrerName?: string;
17
- userAgent?: string;
18
- };
13
+ requestInfo?: IRequestInfo;
19
14
  language?: string;
20
15
  tags?: string[];
21
16
  }
@@ -27,6 +22,12 @@ export interface IProductChild {
27
22
  lineInfo?: string;
28
23
  tags?: string[];
29
24
  }
25
+ export interface IGetCartItemCountRequest {
26
+ requestInfo?: IRequestInfo;
27
+ tags?: string[];
28
+ language?: string;
29
+ }
30
30
  export interface IShoppingCartService extends IService {
31
31
  AddToCart: (data: IAddToCartRequest, options?: IRequestInit) => Promise<IApiResponse<IShoppingCartResponse>>;
32
+ GetCartItemCount: (data: IGetCartItemCountRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartItemCountResponse>>;
32
33
  }
@@ -86,6 +86,7 @@ declare const _default: {
86
86
  };
87
87
  ShoppingCart: {
88
88
  AddToCart: string;
89
+ GetCartItemCount: string;
89
90
  };
90
91
  };
91
92
  export default _default;
@@ -92,6 +92,7 @@ exports.default = {
92
92
  },
93
93
  ShoppingCart: {
94
94
  AddToCart: '/{language}/ShoppingCartGateway/v1/AddToCart',
95
+ GetCartItemCount: '/{language}/ShoppingCartGateway/v1/GetCartItemCount',
95
96
  },
96
97
  };
97
98
  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.5.13",
3
+ "version": "4.5.14",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",