oneentry 1.0.27 → 1.0.28
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/dist/formsData/formsDataApi.d.ts +2 -2
- package/dist/formsData/formsDataApi.js +2 -2
- package/dist/menus/menusApi.d.ts +1 -1
- package/dist/menus/menusApi.js +8 -1
- package/dist/menus/menusApi.js.map +1 -1
- package/dist/menus/menusInterfaces.d.ts +2 -0
- package/dist/pages/pagesApi.d.ts +9 -9
- package/dist/pages/pagesApi.js +9 -9
- package/dist/products/productsApi.d.ts +22 -10
- package/dist/products/productsApi.js +24 -12
- package/dist/products/productsApi.js.map +1 -1
- package/dist/products/productsInterfaces.d.ts +2 -2
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ export default class FormsDataApi extends OneEntry implements IFormsData {
|
|
|
8
8
|
/**
|
|
9
9
|
* Get all forms data.
|
|
10
10
|
*
|
|
11
|
-
* @returns Returns array for all objects of
|
|
11
|
+
* @returns Returns array for all objects of FormData
|
|
12
12
|
*/
|
|
13
13
|
getFormsData(): Promise<Array<IFormsDataEntity>>;
|
|
14
14
|
/**
|
|
@@ -27,7 +27,7 @@ export default class FormsDataApi extends OneEntry implements IFormsData {
|
|
|
27
27
|
* ]
|
|
28
28
|
* }
|
|
29
29
|
*
|
|
30
|
-
* @returns - Returns created
|
|
30
|
+
* @returns - Returns created FormData objects.
|
|
31
31
|
*/
|
|
32
32
|
postFormsData(data: Array<IFormsPost>): Promise<IFormsDataEntity>;
|
|
33
33
|
/**
|
|
@@ -12,7 +12,7 @@ class FormsDataApi extends oneEntry_1.default {
|
|
|
12
12
|
/**
|
|
13
13
|
* Get all forms data.
|
|
14
14
|
*
|
|
15
|
-
* @returns Returns array for all objects of
|
|
15
|
+
* @returns Returns array for all objects of FormData
|
|
16
16
|
*/
|
|
17
17
|
async getFormsData() {
|
|
18
18
|
const result = await this._fetchGet('');
|
|
@@ -34,7 +34,7 @@ class FormsDataApi extends oneEntry_1.default {
|
|
|
34
34
|
* ]
|
|
35
35
|
* }
|
|
36
36
|
*
|
|
37
|
-
* @returns - Returns created
|
|
37
|
+
* @returns - Returns created FormData objects.
|
|
38
38
|
*/
|
|
39
39
|
async postFormsData(data) {
|
|
40
40
|
const result = await this._fetchPost('', data);
|
package/dist/menus/menusApi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export default class MenusApi extends OneEntry implements IMenus {
|
|
|
10
10
|
*
|
|
11
11
|
* @param {string} [marker] - Menu marker
|
|
12
12
|
*
|
|
13
|
-
* @returns Returns a single menu object as a
|
|
13
|
+
* @returns Returns a single menu object as a ContentMenu object with included pages
|
|
14
14
|
*/
|
|
15
15
|
getMenusByMarker(marker: string): Promise<IMenusEntity>;
|
|
16
16
|
}
|
package/dist/menus/menusApi.js
CHANGED
|
@@ -14,10 +14,17 @@ class MenusApi extends oneEntry_1.default {
|
|
|
14
14
|
*
|
|
15
15
|
* @param {string} [marker] - Menu marker
|
|
16
16
|
*
|
|
17
|
-
* @returns Returns a single menu object as a
|
|
17
|
+
* @returns Returns a single menu object as a ContentMenu object with included pages
|
|
18
18
|
*/
|
|
19
19
|
async getMenusByMarker(marker) {
|
|
20
20
|
const result = await this._fetchGet(`/marker/${marker}`);
|
|
21
|
+
const pages = result.pages;
|
|
22
|
+
pages.forEach(page => {
|
|
23
|
+
const children = pages.filter(child => child.parentId === page.id);
|
|
24
|
+
if (children.length) {
|
|
25
|
+
page.children = children;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
21
28
|
return result;
|
|
22
29
|
}
|
|
23
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menusApi.js","sourceRoot":"","sources":["../../src/menus/menusApi.ts"],"names":[],"mappings":";;AAAA,+CAAwC;AAGxC;;GAEG;AACH,MAAqB,QAAS,SAAQ,kBAAQ;IAC1C,YAAY,GAAW,EAAE,KAAY;QACjC,KAAK,CAAC,GAAG,EAAC,KAAK,CAAC,CAAA;QAChB,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAA;IACrC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,gBAAgB,CAAC,MAAa;QACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;QACxD,OAAO,MAAM,CAAA;IACjB,CAAC;CAEJ;
|
|
1
|
+
{"version":3,"file":"menusApi.js","sourceRoot":"","sources":["../../src/menus/menusApi.ts"],"names":[],"mappings":";;AAAA,+CAAwC;AAGxC;;GAEG;AACH,MAAqB,QAAS,SAAQ,kBAAQ;IAC1C,YAAY,GAAW,EAAE,KAAY;QACjC,KAAK,CAAC,GAAG,EAAC,KAAK,CAAC,CAAA;QAChB,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAA;IACrC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,gBAAgB,CAAC,MAAa;QACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;QACxD,MAAM,KAAK,GAAc,MAAM,CAAC,KAAK,CAAA;QACrC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACjB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC,CAAA;YAClE,IAAI,QAAQ,CAAC,MAAM,EAAE;gBACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;aAC3B;QACL,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACjB,CAAC;CAEJ;AA1BD,2BA0BC"}
|
|
@@ -11,6 +11,7 @@ interface IMenus {
|
|
|
11
11
|
* Represents a position object.
|
|
12
12
|
*
|
|
13
13
|
* @interface
|
|
14
|
+
* @property {Array<IMenusPages>} children - The optional parameter. Contains array with child page objects.
|
|
14
15
|
* @property {number} id - The unique identifier of the menu.
|
|
15
16
|
* @property {string} pageUrl - The page url string.
|
|
16
17
|
* @property {ILocalizeInfos} localizeInfos - The menu data, taking into account localization.
|
|
@@ -18,6 +19,7 @@ interface IMenus {
|
|
|
18
19
|
* @property {number | null} parentId - The menu parent id.
|
|
19
20
|
*/
|
|
20
21
|
interface IMenusPages {
|
|
22
|
+
children?: Array<IMenusPages>;
|
|
21
23
|
id: number;
|
|
22
24
|
pageUrl: string;
|
|
23
25
|
localizeInfos: ILocalizeInfos;
|
package/dist/pages/pagesApi.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
11
11
|
*
|
|
12
12
|
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
13
13
|
*
|
|
14
|
-
* @returns Returns all created pages without parents as an array of
|
|
14
|
+
* @returns Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
15
15
|
*/
|
|
16
16
|
getRootPages(langCode: LangType): Promise<Array<IPagesEntity>>;
|
|
17
17
|
/**
|
|
@@ -23,7 +23,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
23
23
|
*
|
|
24
24
|
* @param {number} [offset] - Optional parameter for pagination, default is 0
|
|
25
25
|
*
|
|
26
|
-
* @returns Returns all created pages as an array of
|
|
26
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
27
27
|
*/
|
|
28
28
|
getCatalogPages(langCode: LangType, limit?: number, offset?: number): Promise<Array<IPagesEntity>>;
|
|
29
29
|
/**
|
|
@@ -31,7 +31,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
31
31
|
*
|
|
32
32
|
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
33
33
|
*
|
|
34
|
-
* @returns Returns all created pages as an array of
|
|
34
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
35
35
|
*/
|
|
36
36
|
getPages(langCode: LangType): Promise<Array<IPagesEntity>>;
|
|
37
37
|
/**
|
|
@@ -41,7 +41,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
41
41
|
*
|
|
42
42
|
* @param {number} [id] - Page object identifier
|
|
43
43
|
*
|
|
44
|
-
* @returns Returns
|
|
44
|
+
* @returns Returns PageEntity object
|
|
45
45
|
*/
|
|
46
46
|
getPageById(id: number, langCode: LangType): Promise<IPagesEntity>;
|
|
47
47
|
/**
|
|
@@ -51,7 +51,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
51
51
|
*
|
|
52
52
|
* @param {string} [url] - Page URL
|
|
53
53
|
*
|
|
54
|
-
* @returns Returns
|
|
54
|
+
* @returns Returns PageEntity object
|
|
55
55
|
*/
|
|
56
56
|
getPageByUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
57
57
|
/**
|
|
@@ -61,7 +61,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
61
61
|
*
|
|
62
62
|
* @param {string} [url] - Page URL
|
|
63
63
|
*
|
|
64
|
-
* @returns Returns all created pages as an array of
|
|
64
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
65
65
|
*/
|
|
66
66
|
getChildPagesByParentUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
67
67
|
/**
|
|
@@ -71,7 +71,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
71
71
|
*
|
|
72
72
|
* @param {string} [url] - Page URL
|
|
73
73
|
*
|
|
74
|
-
* @returns Returns all forms as an array of
|
|
74
|
+
* @returns Returns all forms as an array of PositionForm objects or an empty array [] (if there is no data) for the selected parent
|
|
75
75
|
*/
|
|
76
76
|
getFormsByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionForm>>;
|
|
77
77
|
/**
|
|
@@ -79,7 +79,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
79
79
|
*
|
|
80
80
|
* @param {string} [url] - Page URL
|
|
81
81
|
*
|
|
82
|
-
* @returns Returns a
|
|
82
|
+
* @returns Returns a ConfigPage object with page display settings
|
|
83
83
|
*/
|
|
84
84
|
getConfigPageByUrl(url: string): Promise<IPageConfig>;
|
|
85
85
|
/**
|
|
@@ -89,7 +89,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
89
89
|
*
|
|
90
90
|
* @param {string} [langCode] Required parameter lang code
|
|
91
91
|
*
|
|
92
|
-
* @returns Returns all created pages as an array of
|
|
92
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
93
93
|
*/
|
|
94
94
|
searchPage(name: string, langCode: string): Promise<Array<IPagesEntity>>;
|
|
95
95
|
}
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -14,7 +14,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
14
14
|
*
|
|
15
15
|
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
16
16
|
*
|
|
17
|
-
* @returns Returns all created pages without parents as an array of
|
|
17
|
+
* @returns Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
18
18
|
*/
|
|
19
19
|
async getRootPages(langCode) {
|
|
20
20
|
const result = await this._fetchRequests(`/root?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
@@ -29,7 +29,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
29
29
|
*
|
|
30
30
|
* @param {number} [offset] - Optional parameter for pagination, default is 0
|
|
31
31
|
*
|
|
32
|
-
* @returns Returns all created pages as an array of
|
|
32
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
33
33
|
*/
|
|
34
34
|
async getCatalogPages(langCode, limit = 30, offset = 0) {
|
|
35
35
|
const result = await this._fetchRequests(`/catalog?langCode=${this._LANGCODE_KEY}&limit=${limit}&offset=${offset}`, langCode);
|
|
@@ -40,7 +40,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
40
40
|
*
|
|
41
41
|
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
42
42
|
*
|
|
43
|
-
* @returns Returns all created pages as an array of
|
|
43
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
44
44
|
*/
|
|
45
45
|
async getPages(langCode) {
|
|
46
46
|
const result = await this._fetchRequests(`?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
@@ -53,7 +53,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
53
53
|
*
|
|
54
54
|
* @param {number} [id] - Page object identifier
|
|
55
55
|
*
|
|
56
|
-
* @returns Returns
|
|
56
|
+
* @returns Returns PageEntity object
|
|
57
57
|
*/
|
|
58
58
|
async getPageById(id, langCode) {
|
|
59
59
|
const result = await this._fetchRequests(`/${id}?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
@@ -66,7 +66,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
66
66
|
*
|
|
67
67
|
* @param {string} [url] - Page URL
|
|
68
68
|
*
|
|
69
|
-
* @returns Returns
|
|
69
|
+
* @returns Returns PageEntity object
|
|
70
70
|
*/
|
|
71
71
|
async getPageByUrl(url, langCode) {
|
|
72
72
|
const result = await this._fetchRequests(`/url/${url}?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
@@ -79,7 +79,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
79
79
|
*
|
|
80
80
|
* @param {string} [url] - Page URL
|
|
81
81
|
*
|
|
82
|
-
* @returns Returns all created pages as an array of
|
|
82
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
83
83
|
*/
|
|
84
84
|
async getChildPagesByParentUrl(url, langCode) {
|
|
85
85
|
const result = await this._fetchRequests(`/${url}/children?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
@@ -92,7 +92,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
92
92
|
*
|
|
93
93
|
* @param {string} [url] - Page URL
|
|
94
94
|
*
|
|
95
|
-
* @returns Returns all forms as an array of
|
|
95
|
+
* @returns Returns all forms as an array of PositionForm objects or an empty array [] (if there is no data) for the selected parent
|
|
96
96
|
*/
|
|
97
97
|
async getFormsByPageUrl(url, langCode) {
|
|
98
98
|
const result = await this._fetchRequests(`/${url}/forms?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
@@ -103,7 +103,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
103
103
|
*
|
|
104
104
|
* @param {string} [url] - Page URL
|
|
105
105
|
*
|
|
106
|
-
* @returns Returns a
|
|
106
|
+
* @returns Returns a ConfigPage object with page display settings
|
|
107
107
|
*/
|
|
108
108
|
async getConfigPageByUrl(url) {
|
|
109
109
|
const result = await this._fetchGet(`/${url}/config`);
|
|
@@ -116,7 +116,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
116
116
|
*
|
|
117
117
|
* @param {string} [langCode] Required parameter lang code
|
|
118
118
|
*
|
|
119
|
-
* @returns Returns all created pages as an array of
|
|
119
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
120
120
|
*/
|
|
121
121
|
async searchPage(name, langCode) {
|
|
122
122
|
const result = await this._fetchGet(`/quick/search?lang=${langCode}&name=${name}`);
|
|
@@ -24,13 +24,11 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
24
24
|
*
|
|
25
25
|
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
26
26
|
*
|
|
27
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
28
|
-
*
|
|
29
27
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
30
28
|
*
|
|
31
29
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
32
30
|
*
|
|
33
|
-
* @returns
|
|
31
|
+
* @returns Array with ProductEntity objects
|
|
34
32
|
*/
|
|
35
33
|
getProducts(langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
36
34
|
/**
|
|
@@ -54,7 +52,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
54
52
|
*
|
|
55
53
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
56
54
|
*
|
|
57
|
-
* @returns
|
|
55
|
+
* @returns Array with ProductEntity objects
|
|
58
56
|
*/
|
|
59
57
|
getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
60
58
|
/**
|
|
@@ -81,7 +79,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
81
79
|
*
|
|
82
80
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
83
81
|
*
|
|
84
|
-
* @returns
|
|
82
|
+
* @returns Array with ProductEntity objects
|
|
85
83
|
*/
|
|
86
84
|
getProductsPageById(id: number, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
87
85
|
/**
|
|
@@ -108,7 +106,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
108
106
|
*
|
|
109
107
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
110
108
|
*
|
|
111
|
-
* @returns
|
|
109
|
+
* @returns Array with ProductEntity objects
|
|
112
110
|
*/
|
|
113
111
|
getProductsPageByUrl(url: string, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
114
112
|
/**
|
|
@@ -127,7 +125,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
127
125
|
*
|
|
128
126
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
129
127
|
*
|
|
130
|
-
* @returns
|
|
128
|
+
* @returns Array with ProductEntity objects
|
|
131
129
|
*/
|
|
132
130
|
getRelatedProductsById(id: number, langCode?: LangType, userQuery?: IProductsQuery): Promise<IProductsEntity>;
|
|
133
131
|
/**
|
|
@@ -137,7 +135,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
137
135
|
*
|
|
138
136
|
* @param {string | Array<string>} [langCode] Language code parameter. Default "en_US". You can also pass several language parameters ['en_US', 'it_IT']
|
|
139
137
|
*
|
|
140
|
-
* @returns
|
|
138
|
+
* @returns ProductEntity object.
|
|
141
139
|
*/
|
|
142
140
|
getProductById(id: number, langCode?: LangType): Promise<IProductsEntity>;
|
|
143
141
|
/**
|
|
@@ -149,19 +147,33 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
149
147
|
*
|
|
150
148
|
* @example
|
|
151
149
|
* const objects = [
|
|
150
|
+
*
|
|
152
151
|
* {
|
|
152
|
+
*
|
|
153
153
|
* attributeMarker: "price",
|
|
154
|
+
*
|
|
154
155
|
* conditionMarker: "mth",
|
|
156
|
+
*
|
|
155
157
|
* conditionValue: 1,
|
|
158
|
+
*
|
|
156
159
|
* pageId: 0,
|
|
160
|
+
*
|
|
157
161
|
* },
|
|
162
|
+
*
|
|
158
163
|
* {
|
|
164
|
+
*
|
|
159
165
|
* attributeMarker: "price",
|
|
166
|
+
*
|
|
160
167
|
* conditionMarker: "lth",
|
|
168
|
+
*
|
|
161
169
|
* conditionValue: 3,
|
|
170
|
+
*
|
|
162
171
|
* pageId: 0,
|
|
172
|
+
*
|
|
163
173
|
* },
|
|
174
|
+
*
|
|
164
175
|
* ];
|
|
176
|
+
*
|
|
165
177
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
166
178
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
167
179
|
*
|
|
@@ -171,7 +183,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
171
183
|
*
|
|
172
184
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
173
185
|
*
|
|
174
|
-
* @returns
|
|
186
|
+
* @returns Array with ProductEntity objects
|
|
175
187
|
*/
|
|
176
188
|
filterProduct(data: Array<IFilterParams>, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
177
189
|
/**
|
|
@@ -181,7 +193,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
181
193
|
*
|
|
182
194
|
* @param {string} [langCode] - Language code
|
|
183
195
|
*
|
|
184
|
-
* @returns
|
|
196
|
+
* @returns Array with ProductEntity objects
|
|
185
197
|
*/
|
|
186
198
|
searchProduct(name: string, langCode?: string): Promise<Array<IProductsEntity>>;
|
|
187
199
|
}
|
|
@@ -14,8 +14,8 @@ class ProductApi extends oneEntry_1.default {
|
|
|
14
14
|
conditionValue: null,
|
|
15
15
|
conditionMarker: null,
|
|
16
16
|
attributeMarker: null,
|
|
17
|
-
sortOrder:
|
|
18
|
-
sortKey:
|
|
17
|
+
sortOrder: null,
|
|
18
|
+
sortKey: null
|
|
19
19
|
};
|
|
20
20
|
this._url += '/api/content/products';
|
|
21
21
|
}
|
|
@@ -36,13 +36,11 @@ class ProductApi extends oneEntry_1.default {
|
|
|
36
36
|
*
|
|
37
37
|
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
38
38
|
*
|
|
39
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
40
|
-
*
|
|
41
39
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
42
40
|
*
|
|
43
41
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
44
42
|
*
|
|
45
|
-
* @returns
|
|
43
|
+
* @returns Array with ProductEntity objects
|
|
46
44
|
*/
|
|
47
45
|
async getProducts(langCode = 'en_US', userQuery) {
|
|
48
46
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -70,7 +68,7 @@ class ProductApi extends oneEntry_1.default {
|
|
|
70
68
|
*
|
|
71
69
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
72
70
|
*
|
|
73
|
-
* @returns
|
|
71
|
+
* @returns Array with ProductEntity objects
|
|
74
72
|
*/
|
|
75
73
|
async getProductsEmptyPage(langCode = 'en_US', userQuery) {
|
|
76
74
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -101,7 +99,7 @@ class ProductApi extends oneEntry_1.default {
|
|
|
101
99
|
*
|
|
102
100
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
103
101
|
*
|
|
104
|
-
* @returns
|
|
102
|
+
* @returns Array with ProductEntity objects
|
|
105
103
|
*/
|
|
106
104
|
async getProductsPageById(id, langCode = 'en_US', userQuery) {
|
|
107
105
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -132,7 +130,7 @@ class ProductApi extends oneEntry_1.default {
|
|
|
132
130
|
*
|
|
133
131
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
134
132
|
*
|
|
135
|
-
* @returns
|
|
133
|
+
* @returns Array with ProductEntity objects
|
|
136
134
|
*/
|
|
137
135
|
async getProductsPageByUrl(url, langCode = 'en_US', userQuery) {
|
|
138
136
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -155,7 +153,7 @@ class ProductApi extends oneEntry_1.default {
|
|
|
155
153
|
*
|
|
156
154
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
157
155
|
*
|
|
158
|
-
* @returns
|
|
156
|
+
* @returns Array with ProductEntity objects
|
|
159
157
|
*/
|
|
160
158
|
async getRelatedProductsById(id, langCode = 'en_US', userQuery) {
|
|
161
159
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -169,7 +167,7 @@ class ProductApi extends oneEntry_1.default {
|
|
|
169
167
|
*
|
|
170
168
|
* @param {string | Array<string>} [langCode] Language code parameter. Default "en_US". You can also pass several language parameters ['en_US', 'it_IT']
|
|
171
169
|
*
|
|
172
|
-
* @returns
|
|
170
|
+
* @returns ProductEntity object.
|
|
173
171
|
*/
|
|
174
172
|
async getProductById(id, langCode = 'en_US') {
|
|
175
173
|
const result = await this._fetchRequests(`/${id}?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
@@ -184,19 +182,33 @@ class ProductApi extends oneEntry_1.default {
|
|
|
184
182
|
*
|
|
185
183
|
* @example
|
|
186
184
|
* const objects = [
|
|
185
|
+
*
|
|
187
186
|
* {
|
|
187
|
+
*
|
|
188
188
|
* attributeMarker: "price",
|
|
189
|
+
*
|
|
189
190
|
* conditionMarker: "mth",
|
|
191
|
+
*
|
|
190
192
|
* conditionValue: 1,
|
|
193
|
+
*
|
|
191
194
|
* pageId: 0,
|
|
195
|
+
*
|
|
192
196
|
* },
|
|
197
|
+
*
|
|
193
198
|
* {
|
|
199
|
+
*
|
|
194
200
|
* attributeMarker: "price",
|
|
201
|
+
*
|
|
195
202
|
* conditionMarker: "lth",
|
|
203
|
+
*
|
|
196
204
|
* conditionValue: 3,
|
|
205
|
+
*
|
|
197
206
|
* pageId: 0,
|
|
207
|
+
*
|
|
198
208
|
* },
|
|
209
|
+
*
|
|
199
210
|
* ];
|
|
211
|
+
*
|
|
200
212
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
201
213
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
202
214
|
*
|
|
@@ -206,7 +218,7 @@ class ProductApi extends oneEntry_1.default {
|
|
|
206
218
|
*
|
|
207
219
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
208
220
|
*
|
|
209
|
-
* @returns
|
|
221
|
+
* @returns Array with ProductEntity objects
|
|
210
222
|
*/
|
|
211
223
|
async filterProduct(data, langCode = 'en_US', userQuery) {
|
|
212
224
|
const query = { ...this._defaultQuery, ...userQuery };
|
|
@@ -243,7 +255,7 @@ class ProductApi extends oneEntry_1.default {
|
|
|
243
255
|
*
|
|
244
256
|
* @param {string} [langCode] - Language code
|
|
245
257
|
*
|
|
246
|
-
* @returns
|
|
258
|
+
* @returns Array with ProductEntity objects
|
|
247
259
|
*/
|
|
248
260
|
async searchProduct(name, langCode = 'en_US') {
|
|
249
261
|
const searchProducts = await this._fetchGet(`/quick/search?lang=${langCode}&name=${name}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productsApi.js","sourceRoot":"","sources":["../../src/products/productsApi.ts"],"names":[],"mappings":";;AACA,+CAAuC;AAGvC;;GAEG;AACH,MAAqB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CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;gBAClD,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC7B,CAAC,CAAC,CAAA;QACN,CAAC,CAAC,CACL,CAAA;QACD,OAAO,YAAY,CAAA;IACvB,CAAC;CACJ;AA7RD,6BA6RC"}
|
|
@@ -59,8 +59,8 @@ interface IProductsQuery {
|
|
|
59
59
|
*/
|
|
60
60
|
conditionMarker?: 'in' | 'nin' | 'eq' | 'neq' | 'mth' | 'lth' | 'exs' | 'nexs' | null;
|
|
61
61
|
attributeMarker?: string | null;
|
|
62
|
-
sortOrder?: 'DESC' | 'ASC';
|
|
63
|
-
sortKey?: string;
|
|
62
|
+
sortOrder?: 'DESC' | 'ASC' | null;
|
|
63
|
+
sortKey?: string | null;
|
|
64
64
|
[key: string]: string | number | null;
|
|
65
65
|
}
|
|
66
66
|
/**
|