oneentry 1.0.70 → 1.0.72

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.
Files changed (35) hide show
  1. package/README.md +642 -881
  2. package/dist/attribute-sets/attributeSetsApi.d.ts +2 -2
  3. package/dist/attribute-sets/attributeSetsApi.js +2 -2
  4. package/dist/auth-provider/authProviderApi.d.ts +3 -2
  5. package/dist/auth-provider/authProviderApi.js +5 -2
  6. package/dist/auth-provider/authProvidersInterfaces.d.ts +7 -2
  7. package/dist/base/asyncModules.js +6 -2
  8. package/dist/base/stateModule.js +1 -1
  9. package/dist/blocks/blocksApi.d.ts +3 -3
  10. package/dist/blocks/blocksApi.js +6 -6
  11. package/dist/blocks/blocksInterfaces.d.ts +2 -2
  12. package/dist/formsData/formsDataApi.d.ts +1 -0
  13. package/dist/formsData/formsDataApi.js +2 -1
  14. package/dist/formsData/formsDataInterfaces.d.ts +2 -2
  15. package/dist/orders/ordersApi.d.ts +1 -1
  16. package/dist/orders/ordersApi.js +3 -0
  17. package/dist/orders/ordersInterfaces.d.ts +11 -9
  18. package/dist/pages/pagesApi.js +12 -3
  19. package/dist/pages/pagesInterfaces.d.ts +6 -20
  20. package/dist/payments/paymentsApi.d.ts +5 -17
  21. package/dist/payments/paymentsApi.js +9 -18
  22. package/dist/payments/paymentsInterfaces.d.ts +11 -37
  23. package/dist/product-statuses/productStatusesApi.d.ts +3 -3
  24. package/dist/product-statuses/productStatusesApi.js +3 -3
  25. package/dist/products/productsApi.d.ts +4 -4
  26. package/dist/products/productsApi.js +4 -3
  27. package/dist/products/productsInterfaces.d.ts +40 -12
  28. package/dist/templates/templatesApi.d.ts +7 -7
  29. package/dist/templates/templatesApi.js +2 -2
  30. package/dist/templates/templatesInterfaces.d.ts +4 -15
  31. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +1 -5
  32. package/dist/users/usersApi.d.ts +1 -1
  33. package/dist/users/usersApi.js +3 -1
  34. package/dist/users/usersInterfaces.d.ts +6 -3
  35. package/package.json +1 -1
@@ -18,7 +18,7 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
18
18
  /**
19
19
  * Search for a product status object by identifier.
20
20
  *
21
- * @param {number} [id] - Status id
21
+ * @param {number} id - Status id
22
22
  * @param {string} [langCode] - Optional parameter language code
23
23
  *
24
24
  * @returns Returns a product status object
@@ -27,7 +27,7 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
27
27
  /**
28
28
  * Search for a product status object by its textual identifier (marker).
29
29
  *
30
- * @param {string} [marker] - Product marker
30
+ * @param {string} marker - Product marker
31
31
  * @param {string} [langCode] - Optional parameter language code
32
32
  *
33
33
  * @returns Returns a product status object
@@ -36,7 +36,7 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
36
36
  /**
37
37
  * Check the existence of a textual identifier.
38
38
  *
39
- * @param {string} [marker] - Product marker
39
+ * @param {string} marker - Product marker
40
40
  *
41
41
  * @returns Returns true if the textual identifier (marker) exists or false if it doesn't
42
42
  */
@@ -22,7 +22,7 @@ class ProductStatusesApi extends asyncModules_1.default {
22
22
  /**
23
23
  * Search for a product status object by identifier.
24
24
  *
25
- * @param {number} [id] - Status id
25
+ * @param {number} id - Status id
26
26
  * @param {string} [langCode] - Optional parameter language code
27
27
  *
28
28
  * @returns Returns a product status object
@@ -34,7 +34,7 @@ class ProductStatusesApi extends asyncModules_1.default {
34
34
  /**
35
35
  * Search for a product status object by its textual identifier (marker).
36
36
  *
37
- * @param {string} [marker] - Product marker
37
+ * @param {string} marker - Product marker
38
38
  * @param {string} [langCode] - Optional parameter language code
39
39
  *
40
40
  * @returns Returns a product status object
@@ -46,7 +46,7 @@ class ProductStatusesApi extends asyncModules_1.default {
46
46
  /**
47
47
  * Check the existence of a textual identifier.
48
48
  *
49
- * @param {string} [marker] - Product marker
49
+ * @param {string} marker - Product marker
50
50
  *
51
51
  * @returns Returns true if the textual identifier (marker) exists or false if it doesn't
52
52
  */
@@ -1,7 +1,6 @@
1
- import { IProductsQuery, IFilterParams, IProductApi, IProductsEntity, IProductInfo } from './productsInterfaces';
1
+ import { IProductsQuery, IFilterParams, IProductApi, IProductsEntity, IProductInfo, IProductBlock } from './productsInterfaces';
2
2
  import AsyncModules from '../base/asyncModules';
3
3
  import StateModule from "../base/stateModule";
4
- import { IBlocksResponse } from "../blocks/blocksInterfaces";
5
4
  /**
6
5
  * Controllers for working with product pages
7
6
  */
@@ -128,6 +127,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
128
127
  /**
129
128
  * Search for information about products and prices for the selected category.
130
129
  * @param {string} url - Page url.
130
+ * @param {string} langCode - Language code.
131
131
  * @param {IProductsQuery} [userQuery] - Optional set query parameters.
132
132
  * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
133
133
  *
@@ -147,7 +147,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
147
147
  *
148
148
  * @returns Array with ProductInformation objects
149
149
  */
150
- getProductsPriceByPageUrl(url: string, userQuery?: IProductsQuery): Promise<Array<IProductInfo>>;
150
+ getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductInfo>>;
151
151
  /**
152
152
  * Search for all products with pagination for the selected category.
153
153
  * @param {Array<IFilterParams>} body - Request body.
@@ -228,7 +228,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
228
228
  * @param {number} id - Product id
229
229
  *
230
230
  */
231
- getProductBlockById(id: number): Promise<Array<IBlocksResponse>>;
231
+ getProductBlockById(id: number): Promise<Array<IProductBlock>>;
232
232
  /**
233
233
  * Quick search for product page objects with limited output.
234
234
  *
@@ -66,7 +66,7 @@ class ProductApi extends asyncModules_1.default {
66
66
  */
67
67
  async getProducts(body = [], langCode = this.state.lang, userQuery) {
68
68
  const query = { ...this._defaultQuery, ...userQuery, langCode };
69
- const result = await this._fetchPost(`/all?langCode=${langCode}&` + this._queryParamsToString(query), body);
69
+ const result = await this._fetchPost(`/all?` + this._queryParamsToString(query), body);
70
70
  return this._dataPostProcess(result.items, langCode);
71
71
  }
72
72
  /**
@@ -150,6 +150,7 @@ class ProductApi extends asyncModules_1.default {
150
150
  /**
151
151
  * Search for information about products and prices for the selected category.
152
152
  * @param {string} url - Page url.
153
+ * @param {string} langCode - Language code.
153
154
  * @param {IProductsQuery} [userQuery] - Optional set query parameters.
154
155
  * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
155
156
  *
@@ -169,8 +170,8 @@ class ProductApi extends asyncModules_1.default {
169
170
  *
170
171
  * @returns Array with ProductInformation objects
171
172
  */
172
- async getProductsPriceByPageUrl(url, userQuery) {
173
- const query = { ...this._defaultQuery, ...userQuery };
173
+ async getProductsPriceByPageUrl(url, langCode = this.state.lang, userQuery) {
174
+ const query = { ...this._defaultQuery, ...userQuery, langCode };
174
175
  const result = await this._fetchGet(`/page/${url}/prices?` + this._queryParamsToString(query));
175
176
  return result.items;
176
177
  }
@@ -1,5 +1,4 @@
1
- import { LangType } from "../base/utils";
2
- import { IBlocksResponse } from "../blocks/blocksInterfaces";
1
+ import { LangType, Types } from "../base/utils";
3
2
  /**
4
3
  * Represents an interface object of Products Api.
5
4
  *
@@ -25,11 +24,11 @@ interface IProductApi {
25
24
  getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
26
25
  getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
27
26
  getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
28
- getProductsPriceByPageUrl(url: string, userQuery?: IProductsQuery): Promise<Array<IProductInfo>>;
27
+ getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductInfo>>;
29
28
  getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
30
- getRelatedProductsById(id: number, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
31
- getProductById(id: number, langCode: LangType): Promise<IProductsEntity>;
32
- getProductBlockById(id: number): Promise<Array<IBlocksResponse>>;
29
+ getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
30
+ getProductById(id: number, langCode: string): Promise<IProductsEntity>;
31
+ getProductBlockById(id: number): Promise<Array<IProductBlock>>;
33
32
  searchProduct(name: string, langCode: string): Promise<Array<IProductsEntity>>;
34
33
  }
35
34
  /**
@@ -100,9 +99,9 @@ interface IFilterParams {
100
99
  * @property {object} additional - Additional value from the index.
101
100
  * @property {Record<string, any>} localizeInfos - The name of the products, taking into account localization.
102
101
  * @property {boolean} isVisible - A sign of page visibility.
103
- * @property {number | null} statusId - Product page status identifiers (may be null).
102
+ * @property {number | null} statusIdentifier - Product page status identifiers (may be null).
104
103
  * @property {Array<number>} relatedIds - Ids of related product pages.
105
- * @property {number} attributeSetId - Set of attributes id.
104
+ * @property {string} attributeSetIdentifier - Set of attributes id.
106
105
  * @property {boolean} isSync - Indication of page indexing.
107
106
  * @property {number} price - The value of the product page price taken from the index.
108
107
  * @property {string} templateIdentifier - User id of the linked template.
@@ -121,9 +120,8 @@ interface IProductsEntity {
121
120
  localizeInfos: Record<string, any>;
122
121
  blocks?: string | Array<string>;
123
122
  isVisible: boolean;
124
- statusId: number | null;
125
- relatedIds: number[];
126
- attributeSetId: number;
123
+ statusIdentifier: number | null;
124
+ attributeSetIdentifier: string;
127
125
  isSync: number | boolean;
128
126
  price: number;
129
127
  templateIdentifier: string | null;
@@ -138,4 +136,34 @@ interface IProductInfo {
138
136
  id: number;
139
137
  price: number;
140
138
  }
141
- export { IFilterParams, IProductsQuery, IProductApi, IProductsEntity, IProductInfo };
139
+ interface IProductBlock {
140
+ id: number;
141
+ attributeSetIdentifier: number | null;
142
+ localizeInfos: Record<string, any>;
143
+ version: number;
144
+ position: number;
145
+ identifier: string;
146
+ type: Types;
147
+ customSettings: {
148
+ sliderDelay: number;
149
+ sliderDelayType: string;
150
+ productConfig: {
151
+ quantity: number;
152
+ sortType: string;
153
+ sortOrder: string;
154
+ countElementsPerRow: number;
155
+ };
156
+ similarProductRules: Array<{
157
+ property: string;
158
+ includes: string;
159
+ keywords: string;
160
+ strict: string;
161
+ }>;
162
+ condition: Record<string, any>;
163
+ };
164
+ templateIdentifier: string | null;
165
+ isVisible: boolean;
166
+ isSync: boolean;
167
+ attributeValues: Record<string, any>;
168
+ }
169
+ export { IFilterParams, IProductsQuery, IProductApi, IProductsEntity, IProductInfo, IProductBlock };
@@ -1,7 +1,7 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
- import { ITemplatesApi, ITemplateEntity, ITemplateList } from './templatesInterfaces';
2
+ import { ITemplatesApi, ITemplateEntity } from './templatesInterfaces';
3
+ import { Types } from "../base/utils";
3
4
  import StateModule from "../base/stateModule";
4
- import { BlockType } from "../blocks/blocksInterfaces";
5
5
  /**
6
6
  * Controllers for working with template objects
7
7
  */
@@ -15,22 +15,22 @@ export default class TemplatesPreviewApi extends AsyncModules implements ITempla
15
15
  *
16
16
  * @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
17
17
  */
18
- getAllTemplates(langCode?: string): Promise<ITemplateList>;
18
+ getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity>>;
19
19
  /**
20
20
  * Get template objects by type.
21
21
  *
22
- * @param {BlockType} type - Product marker
22
+ * @param {Types} type - Product marker
23
23
  * @param {string} [langCode] - Optional parameter language code
24
24
  *
25
25
  * @returns Returns a TemplateEntity object
26
26
  */
27
- getTemplateByType(type: BlockType): Promise<Array<ITemplateEntity>>;
27
+ getTemplateByType(type: Types): Promise<Array<ITemplateEntity>>;
28
28
  /**
29
29
  * Get one template object by id.
30
30
  *
31
- * @param {string} id - Template id
31
+ * @param {number} id - Template id
32
32
  *
33
33
  * @returns Returns a TemplateEntity object
34
34
  */
35
- getTemplateById(id: string): Promise<ITemplateList>;
35
+ getTemplateById(id: number): Promise<Record<Types, ITemplateEntity>>;
36
36
  }
@@ -26,7 +26,7 @@ class TemplatesPreviewApi extends asyncModules_1.default {
26
26
  /**
27
27
  * Get template objects by type.
28
28
  *
29
- * @param {BlockType} type - Product marker
29
+ * @param {Types} type - Product marker
30
30
  * @param {string} [langCode] - Optional parameter language code
31
31
  *
32
32
  * @returns Returns a TemplateEntity object
@@ -38,7 +38,7 @@ class TemplatesPreviewApi extends asyncModules_1.default {
38
38
  /**
39
39
  * Get one template object by id.
40
40
  *
41
- * @param {string} id - Template id
41
+ * @param {number} id - Template id
42
42
  *
43
43
  * @returns Returns a TemplateEntity object
44
44
  */
@@ -1,6 +1,4 @@
1
- import { IGeneralTypesEntity } from "../general-types/generalTypesInterfaces";
2
1
  import { Types } from "../base/utils";
3
- import { BlockType } from "../blocks/blocksInterfaces";
4
2
  /**
5
3
  * Represents an interface object of Templates Api.
6
4
  *
@@ -9,39 +7,30 @@ import { BlockType } from "../blocks/blocksInterfaces";
9
7
  * @property {function} getTemplateById - Get one template object by id.
10
8
  */
11
9
  interface ITemplatesApi {
12
- getAllTemplates(langCode: string): Promise<ITemplateList>;
13
- getTemplateByType(type: BlockType, langCode: string): Promise<Array<ITemplateEntity>>;
14
- getTemplateById(id: string): Promise<ITemplateList>;
10
+ getAllTemplates(langCode: string): Promise<Record<Types, ITemplateEntity>>;
11
+ getTemplateByType(type: Types, langCode: string): Promise<Array<ITemplateEntity>>;
12
+ getTemplateById(id: number): Promise<Record<Types, ITemplateEntity>>;
15
13
  }
16
14
  /**
17
15
  * Represents a template entity object.
18
16
  *
19
17
  * @interface
20
18
  * @property {number} id - The unique identifier of the position.
21
- * @property {Date | string} updateDate - The date of last updated.
22
19
  * @property {number} version - The version number of the object.
23
20
  * @property {string} identifier - The textual identifier for the record field.
24
- * @property {IGeneralTypesEntity} generalType - General type Entity object.
25
21
  * @property {number} generalTypeId - General type Entity id.
26
22
  * @property {string} title - The name of the template.
27
23
  * @property {number} position - The position of the object.
28
- * @property {number | string} positionId - Id of the item object.
29
24
  * @property {Types} generalTypeName - General type name.
30
25
  *
31
26
  */
32
27
  interface ITemplateEntity {
33
28
  id: number;
34
- updateDate?: string | Date;
35
29
  version: number;
36
30
  identifier: string;
37
- generalType?: IGeneralTypesEntity;
38
31
  generalTypeId: number;
39
32
  title: string;
40
33
  position: number;
41
- positionId?: number;
42
34
  generalTypeName: Types;
43
35
  }
44
- interface ITemplateList {
45
- [key: string]: ITemplateEntity;
46
- }
47
- export { ITemplatesApi, ITemplateEntity, ITemplateList };
36
+ export { ITemplatesApi, ITemplateEntity, };
@@ -17,7 +17,6 @@ interface ITemplatesPreview {
17
17
  *
18
18
  * @interface
19
19
  * @property {number} id - The unique identifier of the position.
20
- * @property {Date | string} updatedDate - The date of last updated.
21
20
  * @property {string} identifier - The textual identifier for the record field.
22
21
  * @property {object} proportion - Object contains info by proportion template preview.
23
22
  * @property {Record<string, any>} localizeInfos - The name of the template, taking into account localization.
@@ -26,7 +25,6 @@ interface ITemplatesPreview {
26
25
  */
27
26
  interface ITemplatesPreviewEntity {
28
27
  id: number;
29
- updatedDate: string | Date;
30
28
  version: number;
31
29
  identifier: string;
32
30
  proportion: {
@@ -41,13 +39,11 @@ interface IProportion {
41
39
  height: number | null;
42
40
  weight: number | null;
43
41
  marker: string;
44
- title: string;
45
42
  alignmentType: string;
46
43
  }
47
44
  interface ISquare {
48
45
  marker: string;
49
- title: string;
50
46
  slide: number;
51
47
  alignmentType: string;
52
48
  }
53
- export { ITemplatesPreview, ITemplatesPreviewEntity, ISquare, IProportion, };
49
+ export { ITemplatesPreview, ITemplatesPreviewEntity, ISquare, IProportion };
@@ -39,5 +39,5 @@ export default class UsersApi extends AsyncModules implements IUsers {
39
39
  * }
40
40
  * }
41
41
  */
42
- updateUser(data: IUserBody, langCode?: string): Promise<any>;
42
+ updateUser(data: IUserBody, langCode?: string): Promise<boolean>;
43
43
  }
@@ -44,7 +44,9 @@ class UsersApi extends asyncModules_1.default {
44
44
  * }
45
45
  */
46
46
  async updateUser(data, langCode = this.state.lang) {
47
- const result = await this._fetchPut('', this._normalizePostBody(data));
47
+ if (!('langCode' in data))
48
+ data['langCode'] = langCode;
49
+ const result = await this._fetchPut('/me', this._normalizePostBody(data, langCode));
48
50
  return result;
49
51
  }
50
52
  }
@@ -7,7 +7,7 @@ import { IAuthFormData } from "../auth-provider/authProvidersInterfaces";
7
7
  */
8
8
  interface IUsers {
9
9
  getUser(langCode?: string): Promise<IUserEntity>;
10
- updateUser(data: IUserBody, langCode?: string): Promise<any>;
10
+ updateUser(data: IUserBody, langCode?: string): Promise<boolean>;
11
11
  }
12
12
  interface IUserEntity {
13
13
  id: number;
@@ -18,13 +18,16 @@ interface IUserEntity {
18
18
  }
19
19
  interface IUserBody {
20
20
  formIdentifier: string;
21
+ langCode?: string;
21
22
  authData: Array<{
22
- marker: 'login' | 'password';
23
+ marker: string;
23
24
  value: string;
24
25
  }>;
25
26
  formData: IAuthFormData | Array<IAuthFormData>;
26
27
  notificationData: {
27
- [key: string]: string;
28
+ email: string;
29
+ phonePush: string;
30
+ phoneSMS: string;
28
31
  };
29
32
  }
30
33
  export { IUsers, IUserEntity, IUserBody, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.70",
3
+ "version": "1.0.72",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",