oneentry 1.0.83 → 1.0.85
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.
- package/README.md +476 -442
- package/dist/auth-provider/authProvidersInterfaces.d.ts +1 -1
- package/dist/base/syncModules.js +20 -8
- package/dist/blocks/blocksApi.d.ts +4 -5
- package/dist/blocks/blocksApi.js +14 -14
- package/dist/blocks/blocksInterfaces.d.ts +7 -36
- package/dist/events/eventsApi.d.ts +4 -4
- package/dist/events/eventsApi.js +6 -6
- package/dist/events/eventsInterfaces.d.ts +2 -2
- package/dist/formsData/formsDataApi.d.ts +4 -4
- package/dist/formsData/formsDataApi.js +2 -2
- package/dist/formsData/formsDataInterfaces.d.ts +16 -5
- package/dist/orders/ordersApi.d.ts +4 -4
- package/dist/orders/ordersApi.js +2 -2
- package/dist/orders/ordersInterfaces.d.ts +17 -6
- package/dist/pages/pagesApi.js +21 -8
- package/dist/payments/paymentsApi.d.ts +2 -2
- package/dist/payments/paymentsApi.js +1 -1
- package/dist/payments/paymentsInterfaces.d.ts +9 -5
- package/dist/products/productsApi.d.ts +8 -8
- package/dist/products/productsApi.js +6 -6
- package/dist/products/productsInterfaces.d.ts +21 -17
- package/dist/users/usersApi.d.ts +1 -1
- package/dist/users/usersApi.js +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IProductsQuery, IFilterParams, IProductApi, IProductsEntity,
|
|
1
|
+
import { IProductsQuery, IFilterParams, IProductApi, IProductsEntity, IProductBlock, IProductEntity, IProductsResponse, IProductsInfo } from './productsInterfaces';
|
|
2
2
|
import AsyncModules from '../base/asyncModules';
|
|
3
3
|
import StateModule from "../base/stateModule";
|
|
4
4
|
/**
|
|
@@ -53,7 +53,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
|
|
|
53
53
|
*
|
|
54
54
|
* @returns Array with ProductEntity objects
|
|
55
55
|
*/
|
|
56
|
-
getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
56
|
+
getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
|
|
57
57
|
/**
|
|
58
58
|
* Search for all product page objects with pagination that do not have a category.
|
|
59
59
|
*
|
|
@@ -77,7 +77,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
|
|
|
77
77
|
*
|
|
78
78
|
* @returns Array with ProductEntity objects
|
|
79
79
|
*/
|
|
80
|
-
getProductsEmptyPage(langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
80
|
+
getProductsEmptyPage(langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
|
|
81
81
|
/**
|
|
82
82
|
* Search for all products with pagination for the selected category.
|
|
83
83
|
* @param {Array<IFilterParams>} body - Request body.
|
|
@@ -123,7 +123,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
|
|
|
123
123
|
*
|
|
124
124
|
* @returns Array with ProductEntity objects
|
|
125
125
|
*/
|
|
126
|
-
getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
126
|
+
getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
|
|
127
127
|
/**
|
|
128
128
|
* Search for information about products and prices for the selected category.
|
|
129
129
|
* @param {string} url - Page url.
|
|
@@ -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, langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
150
|
+
getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo>;
|
|
151
151
|
/**
|
|
152
152
|
* Search for all products with pagination for the selected category.
|
|
153
153
|
* @param {Array<IFilterParams>} body - Request body.
|
|
@@ -193,7 +193,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
|
|
|
193
193
|
*
|
|
194
194
|
* @returns Array with ProductEntity objects
|
|
195
195
|
*/
|
|
196
|
-
getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
196
|
+
getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
|
|
197
197
|
/**
|
|
198
198
|
* Find all related product page objects.
|
|
199
199
|
*
|
|
@@ -212,7 +212,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
|
|
|
212
212
|
*
|
|
213
213
|
* @returns Array with ProductEntity objects
|
|
214
214
|
*/
|
|
215
|
-
getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
215
|
+
getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
|
|
216
216
|
/**
|
|
217
217
|
* Retrieve one product object.
|
|
218
218
|
*
|
|
@@ -222,7 +222,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
|
|
|
222
222
|
*
|
|
223
223
|
* @returns ProductEntity object.
|
|
224
224
|
*/
|
|
225
|
-
getProductById(id: number, langCode?: string): Promise<
|
|
225
|
+
getProductById(id: number, langCode?: string): Promise<IProductEntity>;
|
|
226
226
|
/**
|
|
227
227
|
* Getting a product block object by product id.
|
|
228
228
|
* @param {number} id - Product id
|
|
@@ -67,7 +67,7 @@ class ProductApi extends asyncModules_1.default {
|
|
|
67
67
|
async getProducts(body = [], langCode = this.state.lang, userQuery) {
|
|
68
68
|
const query = { ...this._defaultQuery, ...userQuery, langCode };
|
|
69
69
|
const result = await this._fetchPost(`/all?` + this._queryParamsToString(query), body);
|
|
70
|
-
return this._dataPostProcess(result
|
|
70
|
+
return this._dataPostProcess(result, langCode);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* Search for all product page objects with pagination that do not have a category.
|
|
@@ -95,7 +95,7 @@ class ProductApi extends asyncModules_1.default {
|
|
|
95
95
|
async getProductsEmptyPage(langCode = this.state.lang, userQuery) {
|
|
96
96
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
97
97
|
const result = await this._fetchGet(`/empty-page?langCode=${langCode}&` + this._queryParamsToString(query));
|
|
98
|
-
return this._dataPostProcess(result
|
|
98
|
+
return this._dataPostProcess(result, langCode);
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Search for all products with pagination for the selected category.
|
|
@@ -145,7 +145,7 @@ class ProductApi extends asyncModules_1.default {
|
|
|
145
145
|
async getProductsByPageId(id, body = [], langCode = this.state.lang, userQuery) {
|
|
146
146
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
147
147
|
const result = await this._fetchPost(`/page/${id}?langCode=${langCode}&` + this._queryParamsToString(query), body);
|
|
148
|
-
return this._dataPostProcess(result
|
|
148
|
+
return this._dataPostProcess(result, langCode);
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
151
|
* Search for information about products and prices for the selected category.
|
|
@@ -173,7 +173,7 @@ class ProductApi extends asyncModules_1.default {
|
|
|
173
173
|
async getProductsPriceByPageUrl(url, langCode = this.state.lang, userQuery) {
|
|
174
174
|
const query = { ...this._defaultQuery, ...userQuery, langCode };
|
|
175
175
|
const result = await this._fetchGet(`/page/${url}/prices?` + this._queryParamsToString(query));
|
|
176
|
-
return result
|
|
176
|
+
return result;
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
179
179
|
* Search for all products with pagination for the selected category.
|
|
@@ -223,7 +223,7 @@ class ProductApi extends asyncModules_1.default {
|
|
|
223
223
|
async getProductsByPageUrl(url, body = [], langCode = this.state.lang, userQuery) {
|
|
224
224
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
225
225
|
const result = await this._fetchPost(`/page/url/${url}?langCode=${langCode}&` + this._queryParamsToString(query), body);
|
|
226
|
-
return this._dataPostProcess(result
|
|
226
|
+
return this._dataPostProcess(result, langCode);
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
229
229
|
* Find all related product page objects.
|
|
@@ -246,7 +246,7 @@ class ProductApi extends asyncModules_1.default {
|
|
|
246
246
|
async getRelatedProductsById(id, langCode = this.state.lang, userQuery) {
|
|
247
247
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
248
248
|
const result = await this._fetchGet(`/${id}/related?langCode=${langCode}&` + this._queryParamsToString(query));
|
|
249
|
-
return this._dataPostProcess(result
|
|
249
|
+
return this._dataPostProcess(result, langCode);
|
|
250
250
|
}
|
|
251
251
|
/**
|
|
252
252
|
* Retrieve one product object.
|
|
@@ -3,31 +3,23 @@ import { LangType, Types } from "../base/utils";
|
|
|
3
3
|
* Represents an interface object of Products Api.
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getProducts - Search for all product page objects with pagination and filtering.
|
|
6
|
-
*
|
|
7
6
|
* @property {function} getProductsEmptyPage - Search for all product page objects with pagination that do not have a category.
|
|
8
|
-
*
|
|
9
7
|
* @property {function} getProductsByPageId - Search for all products with pagination for the selected category.
|
|
10
|
-
*
|
|
11
8
|
* @property {function} getProductsPriceByPageUrl - Search for information about products and prices for the selected category.
|
|
12
|
-
*
|
|
13
9
|
* @property {function} getProductsByPageUrl - Search for all products with pagination for the selected category.
|
|
14
|
-
*
|
|
15
10
|
* @property {function} getRelatedProductsById - Find all related product page objects.
|
|
16
|
-
*
|
|
17
11
|
* @property {function} getProductById - Retrieve one product object.
|
|
18
|
-
*
|
|
19
12
|
* @property {function} getProductBlockById - Getting a product block object by product id.
|
|
20
|
-
*
|
|
21
13
|
* @property {function} searchProduct - Quick search for product page objects with limited output.
|
|
22
14
|
*/
|
|
23
15
|
interface IProductApi {
|
|
24
|
-
getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
25
|
-
getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<
|
|
26
|
-
getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
27
|
-
getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
28
|
-
getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
29
|
-
getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<
|
|
30
|
-
getProductById(id: number, langCode: string): Promise<
|
|
16
|
+
getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
|
|
17
|
+
getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<IProductsResponse>;
|
|
18
|
+
getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
|
|
19
|
+
getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo>;
|
|
20
|
+
getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
|
|
21
|
+
getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
|
|
22
|
+
getProductById(id: number, langCode: string): Promise<IProductEntity>;
|
|
31
23
|
getProductBlockById(id: number): Promise<Array<IProductBlock>>;
|
|
32
24
|
searchProduct(name: string, langCode: string): Promise<Array<IProductsEntity>>;
|
|
33
25
|
}
|
|
@@ -99,6 +91,7 @@ interface IFilterParams {
|
|
|
99
91
|
* @property {object} additional - Additional value from the index.
|
|
100
92
|
* @property {Record<string, any>} localizeInfos - The name of the products, taking into account localization.
|
|
101
93
|
* @property {boolean} isVisible - A sign of page visibility.
|
|
94
|
+
* @property {boolean} [isPositionLocked] - Sorting position lock indicator (optional).
|
|
102
95
|
* @property {number | null} statusIdentifier - Product page status identifiers (may be null).
|
|
103
96
|
* @property {Array<number>} relatedIds - Ids of related product pages.
|
|
104
97
|
* @property {string} attributeSetIdentifier - Set of attributes id.
|
|
@@ -117,8 +110,8 @@ interface IProductsEntity {
|
|
|
117
110
|
max: number;
|
|
118
111
|
};
|
|
119
112
|
};
|
|
113
|
+
isPositionLocked?: Boolean;
|
|
120
114
|
localizeInfos: Record<string, any>;
|
|
121
|
-
blocks?: string | Array<string>;
|
|
122
115
|
isVisible: boolean;
|
|
123
116
|
statusIdentifier: string | null;
|
|
124
117
|
attributeSetIdentifier: string;
|
|
@@ -130,8 +123,19 @@ interface IProductsEntity {
|
|
|
130
123
|
attributeValues: Record<string, any>;
|
|
131
124
|
position: number;
|
|
132
125
|
sku: string | null;
|
|
126
|
+
}
|
|
127
|
+
interface IProductEntity extends IProductsEntity {
|
|
128
|
+
blocks?: Array<string>;
|
|
133
129
|
productPages?: Array<Record<string, any>> | Record<string, any>;
|
|
134
130
|
}
|
|
131
|
+
interface IProductsResponse {
|
|
132
|
+
total: number;
|
|
133
|
+
items: Array<IProductsEntity>;
|
|
134
|
+
}
|
|
135
|
+
interface IProductsInfo {
|
|
136
|
+
total: number;
|
|
137
|
+
items: Array<IProductsInfo>;
|
|
138
|
+
}
|
|
135
139
|
interface IProductInfo {
|
|
136
140
|
id: number;
|
|
137
141
|
price: number;
|
|
@@ -166,4 +170,4 @@ interface IProductBlock {
|
|
|
166
170
|
isSync: boolean;
|
|
167
171
|
attributeValues: Record<string, any>;
|
|
168
172
|
}
|
|
169
|
-
export { IFilterParams, IProductsQuery, IProductApi, IProductsEntity, IProductInfo, IProductBlock };
|
|
173
|
+
export { IFilterParams, IProductsQuery, IProductApi, IProductsEntity, IProductsInfo, IProductInfo, IProductBlock, IProductEntity, IProductsResponse };
|
package/dist/users/usersApi.d.ts
CHANGED
package/dist/users/usersApi.js
CHANGED
package/package.json
CHANGED