oneentry 1.0.67 → 1.0.69

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.
@@ -22,7 +22,7 @@ class ProductApi extends asyncModules_1.default {
22
22
  }
23
23
  /**
24
24
  * Search for all products with pagination and filter.
25
- * @param {Array<IFilterParams>} body - Request body.
25
+ * @param {Array<IFilterParams>} body - Request body. Default [].
26
26
  * @param {string} [langCode] - Language code parameter. Default "en_US"
27
27
  * @param {IProductsQuery} [userQuery] - Optional set query parameters.
28
28
  * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
@@ -64,9 +64,9 @@ class ProductApi extends asyncModules_1.default {
64
64
  *
65
65
  * @returns Array with ProductEntity objects
66
66
  */
67
- async getProducts(body, langCode = this.state.lang, userQuery) {
68
- const query = { ...this._defaultQuery, ...userQuery };
69
- const result = await this._fetchPost(`/all?` + this._queryParamsToString(query), body);
67
+ async getProducts(body = [], langCode = this.state.lang, userQuery) {
68
+ const query = { ...this._defaultQuery, ...userQuery, langCode };
69
+ const result = await this._fetchPost(`/all?langCode=${langCode}&` + this._queryParamsToString(query), body);
70
70
  return this._dataPostProcess(result.items, langCode);
71
71
  }
72
72
  /**
@@ -142,9 +142,9 @@ class ProductApi extends asyncModules_1.default {
142
142
  *
143
143
  * @returns Array with ProductEntity objects
144
144
  */
145
- async getProductsByPageId(id, body, langCode = this.state.lang, userQuery) {
145
+ async getProductsByPageId(id, body = [], langCode = this.state.lang, userQuery) {
146
146
  const query = { ...this._defaultQuery, ...userQuery };
147
- const result = await this._fetchPost(`/page/${id}?` + this._queryParamsToString(query), body);
147
+ const result = await this._fetchPost(`/page/${id}?langCode=${langCode}&` + this._queryParamsToString(query), body);
148
148
  return this._dataPostProcess(result.items, langCode);
149
149
  }
150
150
  /**
@@ -219,9 +219,9 @@ class ProductApi extends asyncModules_1.default {
219
219
  *
220
220
  * @returns Array with ProductEntity objects
221
221
  */
222
- async getProductsByPageUrl(url, body, langCode = this.state.lang, userQuery) {
222
+ async getProductsByPageUrl(url, body = [], langCode = this.state.lang, userQuery) {
223
223
  const query = { ...this._defaultQuery, ...userQuery };
224
- const result = await this._fetchPost(`/page/url/${url}?` + this._queryParamsToString(query), body);
224
+ const result = await this._fetchPost(`/page/url/${url}?langCode=${langCode}&` + this._queryParamsToString(query), body);
225
225
  return this._dataPostProcess(result.items, langCode);
226
226
  }
227
227
  /**
@@ -279,7 +279,7 @@ class ProductApi extends asyncModules_1.default {
279
279
  * @returns Array with ProductEntity objects
280
280
  */
281
281
  async searchProduct(name, langCode = this.state.lang) {
282
- const searchProducts = await this._fetchGet(`/quick/search?lang=${langCode}&name=${name}`);
282
+ const searchProducts = await this._fetchGet(`/quick/search?langCode=${langCode}&name=${name}`);
283
283
  if (this.state.multipleResponse) {
284
284
  const productsList = [];
285
285
  await Promise.all(searchProducts.map(async (product) => {
@@ -22,11 +22,11 @@ import { IBlocksResponse } from "../blocks/blocksInterfaces";
22
22
  * @property {function} searchProduct - Quick search for product page objects with limited output.
23
23
  */
24
24
  interface IProductApi {
25
- getProducts(body: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
25
+ getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
26
26
  getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
27
- getProductsByPageId(id: number, body: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
27
+ getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
28
28
  getProductsPriceByPageUrl(url: string, userQuery?: IProductsQuery): Promise<Array<IProductInfo>>;
29
- getProductsByPageUrl(url: string, body: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
29
+ getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
30
30
  getRelatedProductsById(id: number, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
31
31
  getProductById(id: number, langCode: LangType): Promise<IProductsEntity>;
32
32
  getProductBlockById(id: number): Promise<Array<IBlocksResponse>>;
@@ -33,7 +33,7 @@ export default class UsersApi extends AsyncModules implements IUsers {
33
33
  * "value": "Username"
34
34
  * },
35
35
  * "notificationData": {
36
- * "email": "test@test.com",
36
+ * "email": "example@oneentry.cloud",
37
37
  * "phonePush": "",
38
38
  * "phoneSMS": "+99999999999"
39
39
  * }
@@ -15,7 +15,7 @@ class UsersApi extends asyncModules_1.default {
15
15
  */
16
16
  async getUser(langCode = this.state.lang) {
17
17
  const result = await this._fetchGet(`/me?langCode=${langCode}`);
18
- return result;
18
+ return this._normalizeData(result);
19
19
  }
20
20
  /**
21
21
  * Updating a single user object.
@@ -37,7 +37,7 @@ class UsersApi extends asyncModules_1.default {
37
37
  * "value": "Username"
38
38
  * },
39
39
  * "notificationData": {
40
- * "email": "test@test.com",
40
+ * "email": "example@oneentry.cloud",
41
41
  * "phonePush": "",
42
42
  * "phoneSMS": "+99999999999"
43
43
  * }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.67",
3
+ "version": "1.0.69",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",