nextemos 4.6.3 → 4.6.4

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.
@@ -74,4 +74,26 @@ exports.ShoppingCartService = {
74
74
  }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
75
75
  });
76
76
  },
77
+ RemoveFromCart: function (data, options) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
80
+ serviceUrl: this.ServiceUrl(),
81
+ prefix: this.Prefix,
82
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
83
+ language: data === null || data === void 0 ? void 0 : data.language,
84
+ methodName: urls_1.default.ShoppingCart.RemoveFromCart,
85
+ }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
86
+ });
87
+ },
88
+ ChangeQuantity: function (data, options) {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
91
+ serviceUrl: this.ServiceUrl(),
92
+ prefix: this.Prefix,
93
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
94
+ language: data === null || data === void 0 ? void 0 : data.language,
95
+ methodName: urls_1.default.ShoppingCart.ChangeQuantity,
96
+ }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
97
+ });
98
+ },
77
99
  };
@@ -33,8 +33,17 @@ export interface IGetCartRequest {
33
33
  tags?: string[];
34
34
  language?: string;
35
35
  }
36
+ export interface IRemoveFromCartRequest extends IGetCartRequest {
37
+ itemId: string;
38
+ }
39
+ export interface IChangeQuantityRequest extends IGetCartRequest {
40
+ itemId: string;
41
+ quantity: number;
42
+ }
36
43
  export interface IShoppingCartService extends IService {
37
44
  AddToCart: (data: IAddToCartRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
38
45
  GetCartItemCount: (data: IGetCartItemCountRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartItemCountResponse>>;
39
46
  GetCart: (data: IGetCartRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
47
+ RemoveFromCart: (data: IRemoveFromCartRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
48
+ ChangeQuantity: (data: IChangeQuantityRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
40
49
  }
@@ -94,6 +94,8 @@ declare const _default: {
94
94
  AddToCart: string;
95
95
  GetCartItemCount: string;
96
96
  GetCart: string;
97
+ RemoveFromCart: string;
98
+ ChangeQuantity: string;
97
99
  };
98
100
  };
99
101
  export default _default;
@@ -100,6 +100,8 @@ exports.default = {
100
100
  AddToCart: '/{language}/ShoppingCartGateway/v1/AddToCart',
101
101
  GetCartItemCount: '/{language}/ShoppingCartGateway/v1/GetCartItemCount',
102
102
  GetCart: '/{language}/ShoppingCartGateway/v1/GetCart',
103
+ RemoveFromCart: '/{language}/ShoppingCartGateway/v1/RemoveFromCart',
104
+ ChangeQuantity: '/{language}/ShoppingCartGateway/v1/ChangeQuantity',
103
105
  },
104
106
  };
105
107
  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.3",
3
+ "version": "4.6.4",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",