oneentry 1.0.27 → 1.0.29
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 +46 -5
- package/dist/admins/adminsApi.d.ts +5 -1
- package/dist/admins/adminsApi.js +6 -3
- package/dist/admins/adminsInterfaces.d.ts +1 -1
- package/dist/admins/adminsInterfaces.js +0 -1
- package/dist/base/oneEntry.js +0 -1
- package/dist/base/utils.js +0 -1
- package/dist/blocks/blocksApi.d.ts +27 -0
- package/dist/blocks/blocksApi.js +38 -0
- package/dist/blocks/blocksInterfaces.d.ts +38 -0
- package/dist/blocks/blocksInterfaces.js +2 -0
- package/dist/file-uploding/fileUploadingApi.d.ts +13 -1
- package/dist/file-uploding/fileUploadingApi.js +15 -1
- package/dist/file-uploding/fileUploadingInterfaces.d.ts +12 -1
- package/dist/file-uploding/fileUploadingInterfaces.js +0 -1
- package/dist/forms/formsApi.d.ts +9 -2
- package/dist/forms/formsApi.js +11 -5
- package/dist/forms/formsInterfaces.d.ts +3 -3
- package/dist/forms/formsInterfaces.js +0 -1
- package/dist/formsData/formsDataApi.d.ts +11 -4
- package/dist/formsData/formsDataApi.js +13 -7
- package/dist/formsData/formsDataInterfaces.d.ts +3 -2
- package/dist/formsData/formsDataInterfaces.js +0 -1
- package/dist/general-types/GeneralTypesApi.js +0 -1
- package/dist/general-types/generalTypesInterfaces.js +0 -1
- package/dist/index.js +0 -1
- package/dist/locales/localesApi.js +0 -1
- package/dist/locales/localesInterfaces.js +0 -1
- package/dist/menus/menusApi.d.ts +1 -1
- package/dist/menus/menusApi.js +8 -2
- package/dist/menus/menusApi.js.map +1 -1
- package/dist/menus/menusInterfaces.d.ts +2 -0
- package/dist/menus/menusInterfaces.js +0 -1
- package/dist/pages/pagesApi.d.ts +9 -9
- package/dist/pages/pagesApi.js +9 -10
- package/dist/pages/pagesInterfaces.js +0 -1
- package/dist/product-statuses/productStatusesApi.js +0 -1
- package/dist/product-statuses/productStatusesInterfaces.js +0 -1
- package/dist/products/productsApi.d.ts +22 -10
- package/dist/products/productsApi.js +24 -13
- package/dist/products/productsApi.js.map +1 -1
- package/dist/products/productsInterfaces.d.ts +2 -2
- package/dist/products/productsInterfaces.js +0 -1
- package/dist/system/systemApi.js +0 -1
- package/dist/system/systemInterfaces.js +0 -1
- package/dist/templates/templatesApi.js +0 -1
- package/dist/templates/templatesInterfaces.js +0 -1
- package/dist/templates-preview/templatesPreviewApi.js +0 -1
- package/dist/templates-preview/templatesPreviewInterfaces.js +0 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,7 +62,11 @@ const { Admins } = defineOneEntry('your-url')
|
|
|
62
62
|
### Admins.getAdminsInfo()
|
|
63
63
|
|
|
64
64
|
```
|
|
65
|
-
const
|
|
65
|
+
const langCode = 'en_US'
|
|
66
|
+
const offset = 0
|
|
67
|
+
const limit = 30
|
|
68
|
+
|
|
69
|
+
const value = await Admins.getAdminsInfo(langCode, offset, limit)
|
|
66
70
|
```
|
|
67
71
|
|
|
68
72
|
|
|
@@ -135,6 +139,27 @@ const value = await FileUploading.delete("file.png", query)
|
|
|
135
139
|
|
|
136
140
|
> This void method delete a file from the cloud file storage.
|
|
137
141
|
|
|
142
|
+
### FileUploading.getFile()
|
|
143
|
+
```
|
|
144
|
+
const id = 123
|
|
145
|
+
const type = 'page'
|
|
146
|
+
const entity = 'editor'
|
|
147
|
+
const filename = 'file.png'
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
const value = await FileUploading.getFile(id, type, entity, filename)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
> This method return file object by parameters.
|
|
154
|
+
|
|
155
|
+
Example return:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
{
|
|
159
|
+
"file": File,
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
138
163
|
## Forms
|
|
139
164
|
|
|
140
165
|
const { Forms } = defineOneEntry('your-url');
|
|
@@ -142,7 +167,11 @@ const { Forms } = defineOneEntry('your-url');
|
|
|
142
167
|
### Forms.getAllForms()
|
|
143
168
|
|
|
144
169
|
```
|
|
145
|
-
const
|
|
170
|
+
const langCode = 'en_US'
|
|
171
|
+
const offset = 0
|
|
172
|
+
const limit = 30
|
|
173
|
+
|
|
174
|
+
const value = await Forms.getAllForms(langCode, offset, limit)
|
|
146
175
|
```
|
|
147
176
|
|
|
148
177
|
> This method retrieves all form objects from the API. It returns a Promise that resolves to an array of FormEntity objects.
|
|
@@ -185,7 +214,10 @@ Example return:
|
|
|
185
214
|
### Forms.getFormByMarker()
|
|
186
215
|
|
|
187
216
|
```
|
|
188
|
-
const
|
|
217
|
+
const marker = 'My form'
|
|
218
|
+
const langCode = 'en_US'
|
|
219
|
+
|
|
220
|
+
const value = await Forms.getFormByMarker(marker, langCode)
|
|
189
221
|
```
|
|
190
222
|
|
|
191
223
|
> This method retrieves a single form object based on its textual identifier (marker) from the API. It returns a Promise that resolves to a FormEntity object.
|
|
@@ -256,7 +288,11 @@ Example return:
|
|
|
256
288
|
### FormData.getFormsData()
|
|
257
289
|
|
|
258
290
|
```
|
|
259
|
-
const
|
|
291
|
+
const langCode = 'en_US'
|
|
292
|
+
const offset = 0
|
|
293
|
+
const limit = 30
|
|
294
|
+
|
|
295
|
+
const value = await FormData.getFormsData(langCode, offset, limit)
|
|
260
296
|
```
|
|
261
297
|
|
|
262
298
|
> This method creates form data objects by sending a request to the API. It accepts an array of objects of type IFormsPost as the request body to provide the necessary form data. It returns a Promise that resolves to the created CreateFormDataDto objects.
|
|
@@ -284,7 +320,12 @@ Example return:
|
|
|
284
320
|
### FormData.getFormsDataByMarker()
|
|
285
321
|
|
|
286
322
|
```
|
|
287
|
-
const
|
|
323
|
+
const marker = 'my-marker'
|
|
324
|
+
const langCode = 'en_US'
|
|
325
|
+
const offset = 0
|
|
326
|
+
const limit = 30
|
|
327
|
+
|
|
328
|
+
const value = await FormData.getFormsDataByMarker(marker, langCode, offset, limit)
|
|
288
329
|
```
|
|
289
330
|
|
|
290
331
|
> This method retrieves a specific form data object by its marker from the API. It accepts a marker parameter as the marker of the form data. It returns a Promise that resolves to an array of objects of type FormDataEntity.
|
|
@@ -8,7 +8,11 @@ export default class AdminsApi extends OneEntry implements IAdmins {
|
|
|
8
8
|
/**
|
|
9
9
|
* Get all user objects - admins.
|
|
10
10
|
*
|
|
11
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
12
|
+
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
13
|
+
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
14
|
+
*
|
|
11
15
|
* @returns Returns all AdminEntity user objects
|
|
12
16
|
*/
|
|
13
|
-
getAdminsInfo(): Promise<Array<IAdminEntity>>;
|
|
17
|
+
getAdminsInfo(langCode?: string, offset?: number, limit?: number): Promise<Array<IAdminEntity>>;
|
|
14
18
|
}
|
package/dist/admins/adminsApi.js
CHANGED
|
@@ -12,12 +12,15 @@ class AdminsApi extends oneEntry_1.default {
|
|
|
12
12
|
/**
|
|
13
13
|
* Get all user objects - admins.
|
|
14
14
|
*
|
|
15
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
16
|
+
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
17
|
+
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
18
|
+
*
|
|
15
19
|
* @returns Returns all AdminEntity user objects
|
|
16
20
|
*/
|
|
17
|
-
async getAdminsInfo() {
|
|
18
|
-
const result = await this._fetchGet(
|
|
21
|
+
async getAdminsInfo(langCode = 'en_US', offset = 0, limit = 30) {
|
|
22
|
+
const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
19
23
|
return result;
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
exports.default = AdminsApi;
|
|
23
|
-
//# sourceMappingURL=adminsApi.js.map
|
|
@@ -5,7 +5,7 @@ import { IAttributeValues } from "../base/utils";
|
|
|
5
5
|
* @property {function} getAdminsInfo - Get all user objects - admins.
|
|
6
6
|
*/
|
|
7
7
|
interface IAdmins {
|
|
8
|
-
getAdminsInfo(): Promise<Array<IAdminEntity>>;
|
|
8
|
+
getAdminsInfo(langCode: string, offset?: number, limit?: number): Promise<Array<IAdminEntity>>;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Represents a position object.
|
package/dist/base/oneEntry.js
CHANGED
package/dist/base/utils.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import OneEntry from "../base/oneEntry";
|
|
2
|
+
import { IBlocks, IBlocksEntity } from "./blocksInterfaces";
|
|
3
|
+
/**
|
|
4
|
+
* Controllers for working with blocks
|
|
5
|
+
*/
|
|
6
|
+
export default class BlocksApi extends OneEntry implements IBlocks {
|
|
7
|
+
constructor(url: string, token: string);
|
|
8
|
+
/**
|
|
9
|
+
* Get blocks by parameters.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
12
|
+
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
13
|
+
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
14
|
+
*
|
|
15
|
+
* @returns Return array of BlocksEntity object.
|
|
16
|
+
*/
|
|
17
|
+
getBlocks(langCode?: string, offset?: number, limit?: number): Promise<Array<IBlocksEntity>>;
|
|
18
|
+
/**
|
|
19
|
+
* Get block by marker.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} [marker] - Marker of Block.
|
|
22
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
23
|
+
*
|
|
24
|
+
* @returns Return BlocksEntity object.
|
|
25
|
+
*/
|
|
26
|
+
getBlockByMarker(marker: string, langCode?: string): Promise<IBlocksEntity>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const oneEntry_1 = require("../base/oneEntry");
|
|
4
|
+
/**
|
|
5
|
+
* Controllers for working with blocks
|
|
6
|
+
*/
|
|
7
|
+
class BlocksApi extends oneEntry_1.default {
|
|
8
|
+
constructor(url, token) {
|
|
9
|
+
super(url, token);
|
|
10
|
+
this._url += '/api/content/blocks';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get blocks by parameters.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
16
|
+
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
17
|
+
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
18
|
+
*
|
|
19
|
+
* @returns Return array of BlocksEntity object.
|
|
20
|
+
*/
|
|
21
|
+
async getBlocks(langCode = 'en_US', offset = 0, limit = 30) {
|
|
22
|
+
const result = await this._fetchGet(`&langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get block by marker.
|
|
27
|
+
*
|
|
28
|
+
* @param {string} [marker] - Marker of Block.
|
|
29
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
30
|
+
*
|
|
31
|
+
* @returns Return BlocksEntity object.
|
|
32
|
+
*/
|
|
33
|
+
async getBlockByMarker(marker, langCode = 'en_US') {
|
|
34
|
+
const result = await this._fetchGet(`/marker/${marker}&langCode=${langCode}`);
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = BlocksApi;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IAttributeValues, ILocalizeInfos } from "../base/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a interface object of Blocks Api.
|
|
4
|
+
*
|
|
5
|
+
* @property {function} getBlocks - Get all Blocks objects.
|
|
6
|
+
* @property {function} getBlockByMarker - Get Block object by marker.
|
|
7
|
+
*/
|
|
8
|
+
interface IBlocks {
|
|
9
|
+
getBlocks(langCode: string, offset?: number, limit?: number): Promise<Array<IBlocksEntity>>;
|
|
10
|
+
getBlockByMarker(marker: string, langCode: string): Promise<IBlocksEntity>;
|
|
11
|
+
}
|
|
12
|
+
interface IBlocksEntity {
|
|
13
|
+
id: number;
|
|
14
|
+
attributeSetId: number;
|
|
15
|
+
localizeInfos: ILocalizeInfos;
|
|
16
|
+
customSettings: ICustomSetting;
|
|
17
|
+
version: number;
|
|
18
|
+
identifier: string;
|
|
19
|
+
position: number;
|
|
20
|
+
attributeValues: IAttributeValues;
|
|
21
|
+
type: string;
|
|
22
|
+
templateIdentifier: string | null;
|
|
23
|
+
}
|
|
24
|
+
interface ICustomSetting {
|
|
25
|
+
sliderDelay: number;
|
|
26
|
+
sliderDelayType: string;
|
|
27
|
+
productQuantity: number;
|
|
28
|
+
productSortType: string;
|
|
29
|
+
productSortOrder: string;
|
|
30
|
+
productCountElementsPerRow: number;
|
|
31
|
+
similarProductRules: Array<{
|
|
32
|
+
property: string;
|
|
33
|
+
includes: string;
|
|
34
|
+
keywords: string;
|
|
35
|
+
strict: string;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
export { IBlocks, IBlocksEntity };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import OneEntry from '../base/oneEntry';
|
|
2
|
-
import { IUploadingQuery, IUploadingReturns, IFileUploading } from "./fileUploadingInterfaces";
|
|
2
|
+
import { IUploadingQuery, IUploadingReturns, IFileUploading, IFileEntity } from "./fileUploadingInterfaces";
|
|
3
3
|
/**
|
|
4
4
|
* Controllers for working with file uploading
|
|
5
5
|
*/
|
|
@@ -35,4 +35,16 @@ export default class FileUploadingApi extends OneEntry implements IFileUploading
|
|
|
35
35
|
* @returns Deletes a file from the cloud file storage
|
|
36
36
|
*/
|
|
37
37
|
delete(filename: string, userQuery?: IUploadingQuery): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* Get file by parameters.
|
|
40
|
+
*
|
|
41
|
+
* @param {number} [id] Object identifier, from which the file is uploaded, determines the folder name in the storage
|
|
42
|
+
*
|
|
43
|
+
* @param {string} [type] - Type, determines the folder name in the storage
|
|
44
|
+
* @param {string} [entity] - entity name, from which the file is uploaded, determines the folder name in the storage
|
|
45
|
+
* @param {string} [filename] - Filename. Example "file.png"
|
|
46
|
+
*
|
|
47
|
+
* @returns Return file as File object
|
|
48
|
+
*/
|
|
49
|
+
getFile(id: number, type: string, entity: string, filename?: string): Promise<IFileEntity>;
|
|
38
50
|
}
|
|
@@ -54,6 +54,20 @@ class FileUploadingApi extends oneEntry_1.default {
|
|
|
54
54
|
const result = await this._fetchDelete(`?filename=${filename}&` + this._queryParamsToString(query));
|
|
55
55
|
return result;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Get file by parameters.
|
|
59
|
+
*
|
|
60
|
+
* @param {number} [id] Object identifier, from which the file is uploaded, determines the folder name in the storage
|
|
61
|
+
*
|
|
62
|
+
* @param {string} [type] - Type, determines the folder name in the storage
|
|
63
|
+
* @param {string} [entity] - entity name, from which the file is uploaded, determines the folder name in the storage
|
|
64
|
+
* @param {string} [filename] - Filename. Example "file.png"
|
|
65
|
+
*
|
|
66
|
+
* @returns Return file as File object
|
|
67
|
+
*/
|
|
68
|
+
async getFile(id, type, entity, filename) {
|
|
69
|
+
const result = await this._fetchGet(`?id=${id}&type=${type}&entity=${entity}${filename ? `&filename=${filename}` : ''}`);
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
57
72
|
}
|
|
58
73
|
exports.default = FileUploadingApi;
|
|
59
|
-
//# sourceMappingURL=fileUploadingApi.js.map
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a interface object of File Uploading Api.
|
|
3
|
+
*
|
|
4
|
+
* @property {function} upload - Upload file from CMS.
|
|
5
|
+
* @property {function} delete - Delete file from CMS.
|
|
6
|
+
* @property {function} getFile - Get file by parameters.
|
|
7
|
+
*/
|
|
1
8
|
interface IFileUploading {
|
|
2
9
|
upload(data: Event, userQuery?: IUploadingQuery): Promise<IUploadingReturns>;
|
|
3
10
|
delete(filename: string, userQuery?: IUploadingQuery): Promise<any>;
|
|
11
|
+
getFile(id: number, type: string, entity: string, filename?: string): Promise<IFileEntity>;
|
|
12
|
+
}
|
|
13
|
+
interface IFileEntity {
|
|
14
|
+
file: File | string | null;
|
|
4
15
|
}
|
|
5
16
|
interface IUploadingQuery {
|
|
6
17
|
type?: string | null;
|
|
@@ -16,4 +27,4 @@ interface IUploadingReturns {
|
|
|
16
27
|
downloadLink: string;
|
|
17
28
|
size: number;
|
|
18
29
|
}
|
|
19
|
-
export { IUploadingQuery, IUploadingReturns, IFileUploading };
|
|
30
|
+
export { IUploadingQuery, IUploadingReturns, IFileUploading, IFileEntity };
|
package/dist/forms/formsApi.d.ts
CHANGED
|
@@ -8,13 +8,20 @@ export default class FormsApi extends OneEntry implements IForms {
|
|
|
8
8
|
/**
|
|
9
9
|
* Get all forms.
|
|
10
10
|
*
|
|
11
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
12
|
+
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
13
|
+
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
14
|
+
*
|
|
11
15
|
* @returns Returns array for all objects of type FormEntity
|
|
12
16
|
*/
|
|
13
|
-
getAllForms(): Promise<Array<IFormsEntity>>;
|
|
17
|
+
getAllForms(langCode?: string, offset?: number, limit?: number): Promise<Array<IFormsEntity>>;
|
|
14
18
|
/**
|
|
15
19
|
* Get one form by form marker.
|
|
16
20
|
*
|
|
21
|
+
* @param {string} [marker] - Marker of form.
|
|
22
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
23
|
+
*
|
|
17
24
|
* @returns Returns object of type FormEntity
|
|
18
25
|
*/
|
|
19
|
-
getFormByMarker(marker: string): Promise<IFormsEntity>;
|
|
26
|
+
getFormByMarker(marker: string, langCode?: string): Promise<IFormsEntity>;
|
|
20
27
|
}
|
package/dist/forms/formsApi.js
CHANGED
|
@@ -12,21 +12,27 @@ class FormsApi extends oneEntry_1.default {
|
|
|
12
12
|
/**
|
|
13
13
|
* Get all forms.
|
|
14
14
|
*
|
|
15
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
16
|
+
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
17
|
+
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
18
|
+
*
|
|
15
19
|
* @returns Returns array for all objects of type FormEntity
|
|
16
20
|
*/
|
|
17
|
-
async getAllForms() {
|
|
18
|
-
const result = await this._fetchGet(
|
|
21
|
+
async getAllForms(langCode = 'en_US', offset = 0, limit = 30) {
|
|
22
|
+
const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
19
23
|
return result;
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
22
26
|
* Get one form by form marker.
|
|
23
27
|
*
|
|
28
|
+
* @param {string} [marker] - Marker of form.
|
|
29
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
30
|
+
*
|
|
24
31
|
* @returns Returns object of type FormEntity
|
|
25
32
|
*/
|
|
26
|
-
async getFormByMarker(marker) {
|
|
27
|
-
const result = await this._fetchGet(`/marker/${marker}`);
|
|
33
|
+
async getFormByMarker(marker, langCode = 'en_US') {
|
|
34
|
+
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
28
35
|
return result;
|
|
29
36
|
}
|
|
30
37
|
}
|
|
31
38
|
exports.default = FormsApi;
|
|
32
|
-
//# sourceMappingURL=formsApi.js.map
|
|
@@ -7,8 +7,8 @@ import { IAttributeValues, ILocalizeInfos } from "../base/utils";
|
|
|
7
7
|
* @property {function} getFormByMarker - Get one form by form marker.
|
|
8
8
|
*/
|
|
9
9
|
interface IForms {
|
|
10
|
-
getAllForms(): Promise<Array<IFormsEntity>>;
|
|
11
|
-
getFormByMarker(marker: string): Promise<IFormsEntity>;
|
|
10
|
+
getAllForms(langCode: string, offset?: number, limit?: number): Promise<Array<IFormsEntity>>;
|
|
11
|
+
getFormByMarker(marker: string, langCode: string): Promise<IFormsEntity>;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Represents an object with various properties.
|
|
@@ -30,7 +30,7 @@ interface IFormsEntity {
|
|
|
30
30
|
processingType: string;
|
|
31
31
|
localizeInfos: ILocalizeInfos;
|
|
32
32
|
processingData: object | string;
|
|
33
|
-
|
|
33
|
+
attributes: IAttributeValues;
|
|
34
34
|
version: number;
|
|
35
35
|
identifier: string;
|
|
36
36
|
position: number;
|
|
@@ -8,9 +8,13 @@ export default class FormsDataApi extends OneEntry implements IFormsData {
|
|
|
8
8
|
/**
|
|
9
9
|
* Get all forms data.
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
11
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
12
|
+
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
13
|
+
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
14
|
+
*
|
|
15
|
+
* @returns Returns array for all objects of FormData
|
|
12
16
|
*/
|
|
13
|
-
getFormsData(): Promise<Array<IFormsDataEntity>>;
|
|
17
|
+
getFormsData(langCode?: string, offset?: number, limit?: number): Promise<Array<IFormsDataEntity>>;
|
|
14
18
|
/**
|
|
15
19
|
* Find all product page objects with pagination and multiple filtering.
|
|
16
20
|
*
|
|
@@ -27,15 +31,18 @@ export default class FormsDataApi extends OneEntry implements IFormsData {
|
|
|
27
31
|
* ]
|
|
28
32
|
* }
|
|
29
33
|
*
|
|
30
|
-
* @returns - Returns created
|
|
34
|
+
* @returns - Returns created FormData objects.
|
|
31
35
|
*/
|
|
32
36
|
postFormsData(data: Array<IFormsPost>): Promise<IFormsDataEntity>;
|
|
33
37
|
/**
|
|
34
38
|
* Get one object of form data by marker.
|
|
35
39
|
*
|
|
36
40
|
* @param {string} [marker] - Marker of the form data
|
|
41
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
42
|
+
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
43
|
+
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
37
44
|
*
|
|
38
45
|
* @returns Returns array of object FormDataEntity
|
|
39
46
|
*/
|
|
40
|
-
getFormsDataByMarker(marker: string): Promise<Array<IFormsDataEntity>>;
|
|
47
|
+
getFormsDataByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<Array<IFormsDataEntity>>;
|
|
41
48
|
}
|
|
@@ -12,10 +12,14 @@ class FormsDataApi extends oneEntry_1.default {
|
|
|
12
12
|
/**
|
|
13
13
|
* Get all forms data.
|
|
14
14
|
*
|
|
15
|
-
* @
|
|
15
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
16
|
+
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
17
|
+
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
18
|
+
*
|
|
19
|
+
* @returns Returns array for all objects of FormData
|
|
16
20
|
*/
|
|
17
|
-
async getFormsData() {
|
|
18
|
-
const result = await this._fetchGet(
|
|
21
|
+
async getFormsData(langCode = 'en_US', offset = 0, limit = 30) {
|
|
22
|
+
const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
19
23
|
return result;
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
@@ -34,7 +38,7 @@ class FormsDataApi extends oneEntry_1.default {
|
|
|
34
38
|
* ]
|
|
35
39
|
* }
|
|
36
40
|
*
|
|
37
|
-
* @returns - Returns created
|
|
41
|
+
* @returns - Returns created FormData objects.
|
|
38
42
|
*/
|
|
39
43
|
async postFormsData(data) {
|
|
40
44
|
const result = await this._fetchPost('', data);
|
|
@@ -44,13 +48,15 @@ class FormsDataApi extends oneEntry_1.default {
|
|
|
44
48
|
* Get one object of form data by marker.
|
|
45
49
|
*
|
|
46
50
|
* @param {string} [marker] - Marker of the form data
|
|
51
|
+
* @param {string} [langCode] - Language code. Default "en_US"
|
|
52
|
+
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
53
|
+
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
47
54
|
*
|
|
48
55
|
* @returns Returns array of object FormDataEntity
|
|
49
56
|
*/
|
|
50
|
-
async getFormsDataByMarker(marker) {
|
|
51
|
-
const result = await this._fetchGet(`/${marker}`);
|
|
57
|
+
async getFormsDataByMarker(marker, langCode = 'en_US', offset = 0, limit = 30) {
|
|
58
|
+
const result = await this._fetchGet(`/${marker}?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
52
59
|
return result;
|
|
53
60
|
}
|
|
54
61
|
}
|
|
55
62
|
exports.default = FormsDataApi;
|
|
56
|
-
//# sourceMappingURL=formsDataApi.js.map
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* @property {function} getFormsDataByMarker - Get one object of form data by marker.
|
|
9
9
|
*/
|
|
10
10
|
interface IFormsData {
|
|
11
|
-
getFormsData(): Promise<Array<IFormsDataEntity>>;
|
|
11
|
+
getFormsData(langCode: string, offset?: number, limit?: number): Promise<Array<IFormsDataEntity>>;
|
|
12
12
|
postFormsData(data: Array<IFormsPost>): Promise<IFormsDataEntity>;
|
|
13
|
-
getFormsDataByMarker(marker: string): Promise<Array<IFormsDataEntity>>;
|
|
13
|
+
getFormsDataByMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<Array<IFormsDataEntity>>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Represents a form data.
|
|
@@ -26,6 +26,7 @@ interface IFormsDataEntity {
|
|
|
26
26
|
formIdentifier: string;
|
|
27
27
|
time: Date | string;
|
|
28
28
|
formData: IFormData;
|
|
29
|
+
attributeSetIdentifier: string;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Form data get by langcode identifier
|
package/dist/index.js
CHANGED
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,12 +14,18 @@ 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
|
}
|
|
24
31
|
exports.default = MenusApi;
|
|
25
|
-
//# sourceMappingURL=menusApi.js.map
|
|
@@ -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}`);
|
|
@@ -124,4 +124,3 @@ class PageApi extends oneEntry_1.default {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
exports.default = PageApi;
|
|
127
|
-
//# sourceMappingURL=pagesApi.js.map
|
|
@@ -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}`);
|
|
@@ -257,4 +269,3 @@ class ProductApi extends oneEntry_1.default {
|
|
|
257
269
|
}
|
|
258
270
|
}
|
|
259
271
|
exports.default = ProductApi;
|
|
260
|
-
//# sourceMappingURL=productsApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productsApi.js","sourceRoot":"","sources":["../../src/products/productsApi.ts"],"names":[],"mappings":";;AACA,+CAAuC;AAGvC;;GAEG;AACH,MAAqB,UAAW,SAAQ,kBAAQ;IAC5C,YAAY,GAAU,EAAE,KAAY;QAChC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA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C,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
|
/**
|
package/dist/system/systemApi.js
CHANGED