nextemos 4.7.5 → 4.7.7

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,2 +1,2 @@
1
- import { IProductService } from './product.types';
1
+ import { IProductService } from "./product.types";
2
2
  export declare const ProductService: IProductService;
@@ -37,11 +37,11 @@ const urls_1 = __importStar(require("../urls"));
37
37
  const __1 = require("../..");
38
38
  // Product servisi, Product, Product Category, Channel ve Price Type verilerini alır.
39
39
  exports.ProductService = {
40
- Namespace: process.env.MS_NAMESPACE || 'emosv2service',
40
+ Namespace: process.env.MS_NAMESPACE || "emosv2service",
41
41
  ServiceUrl: function () {
42
42
  return `http://product.${this.Namespace}.svc.cluster.local`;
43
43
  },
44
- Prefix: '/api/product',
44
+ Prefix: "/api/product",
45
45
  Product: function (data, options) {
46
46
  return __awaiter(this, void 0, void 0, function* () {
47
47
  return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
@@ -61,7 +61,7 @@ exports.ProductService = {
61
61
  prefix: this.Prefix,
62
62
  isClient: options === null || options === void 0 ? void 0 : options.useClient,
63
63
  language: data === null || data === void 0 ? void 0 : data.language,
64
- methodName: urls_1.default.Product.SearchProductsRequest
64
+ methodName: urls_1.default.Product.SearchProductsRequest,
65
65
  }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
66
66
  });
67
67
  },
@@ -72,7 +72,7 @@ exports.ProductService = {
72
72
  prefix: this.Prefix,
73
73
  isClient: options === null || options === void 0 ? void 0 : options.useClient,
74
74
  language: data === null || data === void 0 ? void 0 : data.language,
75
- methodName: urls_1.default.Product.GetAllProductsRequest
75
+ methodName: urls_1.default.Product.GetAllProductsRequest,
76
76
  }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
77
77
  });
78
78
  },
@@ -83,7 +83,7 @@ exports.ProductService = {
83
83
  prefix: this.Prefix,
84
84
  isClient: options === null || options === void 0 ? void 0 : options.useClient,
85
85
  language: data === null || data === void 0 ? void 0 : data.language,
86
- methodName: urls_1.default.ProductCategory.CategoryTree
86
+ methodName: urls_1.default.ProductCategory.CategoryTree,
87
87
  }), Object.assign(Object.assign({}, options), { params: data }));
88
88
  });
89
89
  },
@@ -94,7 +94,7 @@ exports.ProductService = {
94
94
  prefix: this.Prefix,
95
95
  isClient: options === null || options === void 0 ? void 0 : options.useClient,
96
96
  language: data === null || data === void 0 ? void 0 : data.language,
97
- methodName: urls_1.default.ProductCategory.All
97
+ methodName: urls_1.default.ProductCategory.All,
98
98
  }), Object.assign(Object.assign({}, options), { params: data }));
99
99
  });
100
100
  },
@@ -105,7 +105,7 @@ exports.ProductService = {
105
105
  prefix: this.Prefix,
106
106
  isClient: options === null || options === void 0 ? void 0 : options.useClient,
107
107
  language: data === null || data === void 0 ? void 0 : data.language,
108
- methodName: urls_1.default.ProductCategory.Hierarchy
108
+ methodName: urls_1.default.ProductCategory.Hierarchy,
109
109
  }), Object.assign(Object.assign({}, options), { params: data }));
110
110
  });
111
111
  },
@@ -171,7 +171,7 @@ exports.ProductService = {
171
171
  prefix: this.Prefix,
172
172
  isClient: options === null || options === void 0 ? void 0 : options.useClient,
173
173
  methodName: urls_1.default.ProductFavorite,
174
- }), Object.assign(Object.assign({}, options), { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) }));
174
+ }), Object.assign(Object.assign({}, options), { headers: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.headers), { "Content-Type": "application/json" }), body: JSON.stringify(data) }));
175
175
  });
176
176
  },
177
177
  GetPriceAlerts: function () {
@@ -201,7 +201,7 @@ exports.ProductService = {
201
201
  prefix: this.Prefix,
202
202
  isClient: options === null || options === void 0 ? void 0 : options.useClient,
203
203
  methodName: urls_1.default.ProductPriceAlert,
204
- }), Object.assign(Object.assign({}, options), { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) }));
204
+ }), Object.assign(Object.assign({}, options), { headers: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.headers), { "Content-Type": "application/json" }), body: JSON.stringify(data) }));
205
205
  });
206
206
  },
207
207
  GetStockAlerts: function () {
@@ -231,7 +231,7 @@ exports.ProductService = {
231
231
  prefix: this.Prefix,
232
232
  isClient: options === null || options === void 0 ? void 0 : options.useClient,
233
233
  methodName: urls_1.default.ProductStockAlert,
234
- }), Object.assign(Object.assign({}, options), { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) }));
234
+ }), Object.assign(Object.assign({}, options), { headers: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.headers), { "Content-Type": "application/json" }), body: JSON.stringify(data) }));
235
235
  });
236
236
  },
237
237
  };
@@ -107,4 +107,15 @@ exports.ShoppingCartService = {
107
107
  }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
108
108
  });
109
109
  },
110
+ GetInstallmentOptions: function (data, options) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
113
+ serviceUrl: this.ServiceUrl(),
114
+ prefix: this.Prefix,
115
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
116
+ language: data === null || data === void 0 ? void 0 : data.language,
117
+ methodName: urls_1.default.ShoppingCart.GetInstallmentOptions,
118
+ }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
119
+ });
120
+ },
110
121
  };
@@ -1,4 +1,4 @@
1
- import { IApiResponse, IRequestInit, IService, IGiftCardInfo, IRequestInfo, IGetCartItemCountResponse, IGetCartResponse } from '../..';
1
+ import { IApiResponse, IRequestInit, IService, IGiftCardInfo, IRequestInfo, IGetCartItemCountResponse, IGetCartResponse, IResponse } from '../..';
2
2
  export interface IAddToCartRequest {
3
3
  flags?: string | number | string[];
4
4
  productId: number;
@@ -60,6 +60,16 @@ export interface IChangeCartDetailRequest extends IGetCartRequest {
60
60
  cardBin?: string;
61
61
  reComputeShipper?: boolean;
62
62
  }
63
+ interface IGetInstallmentOptionsRequest extends IGetCartRequest {
64
+ productId?: number;
65
+ stockBarcodeId?: number;
66
+ children?: {
67
+ productId: number;
68
+ productHierarchyId?: number;
69
+ stockBarcodeId: number;
70
+ quantity?: number;
71
+ }[];
72
+ }
63
73
  export interface IShoppingCartService extends IService {
64
74
  AddToCart: (data: IAddToCartRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
65
75
  GetCartItemCount: (data: IGetCartItemCountRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartItemCountResponse>>;
@@ -67,4 +77,6 @@ export interface IShoppingCartService extends IService {
67
77
  RemoveFromCart: (data: IRemoveFromCartRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
68
78
  ChangeQuantity: (data: IChangeQuantityRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
69
79
  ChangeCartDetail: (data: IChangeCartDetailRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
80
+ GetInstallmentOptions: (data: IGetInstallmentOptionsRequest, options?: IRequestInit) => Promise<IApiResponse<IResponse>>;
70
81
  }
82
+ export {};
@@ -100,6 +100,7 @@ declare const _default: {
100
100
  RemoveFromCart: string;
101
101
  ChangeQuantity: string;
102
102
  ChangeCartDetail: string;
103
+ GetInstallmentOptions: string;
103
104
  };
104
105
  };
105
106
  export default _default;
@@ -106,6 +106,7 @@ exports.default = {
106
106
  RemoveFromCart: '/{language}/ShoppingCartGateway/v1/RemoveFromCart',
107
107
  ChangeQuantity: '/{language}/ShoppingCartGateway/v1/ChangeQuantity',
108
108
  ChangeCartDetail: '/{language}/ShoppingCartGateway/v1/ChangeCartDetail',
109
+ GetInstallmentOptions: '/{language}/ShoppingCartGateway/v1/GetInstallmentOptions',
109
110
  },
110
111
  };
111
112
  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.7.5",
3
+ "version": "4.7.7",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",