oneentry 1.0.126 → 1.0.127
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 +0 -2
- package/configure.js +25 -18
- package/dist/admins/adminsApi.d.ts +30 -25
- package/dist/admins/adminsApi.js +30 -25
- package/dist/admins/adminsInterfaces.d.ts +45 -54
- package/dist/attribute-sets/attributeSetsApi.d.ts +26 -27
- package/dist/attribute-sets/attributeSetsApi.js +26 -27
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +101 -109
- package/dist/auth-provider/authProviderApi.d.ts +132 -158
- package/dist/auth-provider/authProviderApi.js +131 -157
- package/dist/auth-provider/authProvidersInterfaces.d.ts +241 -237
- package/dist/base/asyncModules.d.ts +23 -21
- package/dist/base/asyncModules.js +30 -25
- package/dist/base/result.d.ts +31 -0
- package/dist/base/result.js +32 -1
- package/dist/base/stateModule.d.ts +10 -0
- package/dist/base/stateModule.js +50 -2
- package/dist/base/syncModules.d.ts +41 -49
- package/dist/base/syncModules.js +49 -48
- package/dist/base/utils.d.ts +38 -7
- package/dist/blocks/blocksApi.d.ts +27 -36
- package/dist/blocks/blocksApi.js +27 -36
- package/dist/blocks/blocksInterfaces.d.ts +92 -97
- package/dist/config.d.ts +13 -0
- package/dist/config.js +30 -0
- package/dist/events/eventsApi.d.ts +16 -33
- package/dist/events/eventsApi.js +32 -46
- package/dist/events/eventsInterfaces.d.ts +42 -37
- package/dist/file-uploading/fileUploadingApi.d.ts +42 -47
- package/dist/file-uploading/fileUploadingApi.js +44 -47
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +49 -60
- package/dist/forms/formsApi.d.ts +15 -14
- package/dist/forms/formsApi.js +15 -14
- package/dist/forms/formsInterfaces.d.ts +36 -40
- package/dist/forms-data/formsDataApi.d.ts +40 -44
- package/dist/forms-data/formsDataApi.js +42 -44
- package/dist/forms-data/formsDataInterfaces.d.ts +231 -231
- package/dist/general-types/generalTypesApi.d.ts +5 -5
- package/dist/general-types/generalTypesApi.js +5 -5
- package/dist/general-types/generalTypesInterfaces.d.ts +6 -9
- package/dist/index.d.ts +12 -13
- package/dist/index.js +12 -13
- package/dist/integration-collections/integrationCollectionsApi.d.ts +84 -98
- package/dist/integration-collections/integrationCollectionsApi.js +86 -102
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +177 -169
- package/dist/locales/localesApi.d.ts +7 -3
- package/dist/locales/localesApi.js +7 -3
- package/dist/locales/localesInterfaces.d.ts +14 -13
- package/dist/menus/menusApi.d.ts +9 -5
- package/dist/menus/menusApi.js +9 -5
- package/dist/menus/menusInterfaces.d.ts +43 -48
- package/dist/menus/menusInterfaces.js +1 -0
- package/dist/orders/ordersApi.d.ts +62 -70
- package/dist/orders/ordersApi.js +62 -71
- package/dist/orders/ordersInterfaces.d.ts +238 -203
- package/dist/pages/pagesApi.d.ts +67 -80
- package/dist/pages/pagesApi.js +71 -81
- package/dist/pages/pagesInterfaces.d.ts +164 -160
- package/dist/payments/paymentsApi.d.ts +24 -34
- package/dist/payments/paymentsApi.js +24 -38
- package/dist/payments/paymentsInterfaces.d.ts +82 -76
- package/dist/product-statuses/productStatusesApi.d.ts +13 -13
- package/dist/product-statuses/productStatusesApi.js +13 -13
- package/dist/product-statuses/productStatusesInterfaces.d.ts +29 -27
- package/dist/products/productsApi.d.ts +246 -267
- package/dist/products/productsApi.js +247 -267
- package/dist/products/productsInterfaces.d.ts +333 -339
- package/dist/system/systemApi.d.ts +19 -21
- package/dist/system/systemApi.js +20 -21
- package/dist/system/systemInterfaces.d.ts +14 -3
- package/dist/templates/templatesApi.d.ts +13 -16
- package/dist/templates/templatesApi.js +13 -16
- package/dist/templates/templatesInterfaces.d.ts +30 -29
- package/dist/templates-preview/templatesPreviewApi.d.ts +10 -11
- package/dist/templates-preview/templatesPreviewApi.js +10 -11
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +61 -64
- package/dist/users/usersApi.d.ts +36 -43
- package/dist/users/usersApi.js +36 -43
- package/dist/users/usersInterfaces.d.ts +92 -96
- package/dist/web-socket/wsApi.d.ts +5 -3
- package/dist/web-socket/wsApi.js +6 -3
- package/dist/web-socket/wsInterfaces.d.ts +7 -2
- package/package.json +16 -12
package/dist/pages/pagesApi.d.ts
CHANGED
|
@@ -5,156 +5,143 @@ import type { IPageApi, IPageConfig, IPagesEntity, IPositionBlock } from './page
|
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with page objects, including catalog pages
|
|
7
7
|
* @handle /api/content/pages
|
|
8
|
+
* @description Controllers for working with page objects, including catalog pages
|
|
8
9
|
*/
|
|
9
10
|
export default class PageApi extends AsyncModules implements IPageApi {
|
|
10
11
|
protected state: StateModule;
|
|
11
12
|
protected _url: string;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param {StateModule} state - The state module.
|
|
16
|
+
* @description Constructor initializes the PageApi with a given state.
|
|
17
|
+
*/
|
|
12
18
|
constructor(state: StateModule);
|
|
13
19
|
/**
|
|
14
20
|
* Get all top-level page objects.
|
|
15
|
-
*
|
|
16
21
|
* @handleName getRootPages
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
19
|
-
* @return {IPagesEntity[]} Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
22
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
+
* @returns {IPagesEntity[]} Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
20
24
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
21
25
|
* @description Get all top-level page objects.
|
|
22
26
|
*/
|
|
23
27
|
getRootPages(langCode?: string): Promise<IPagesEntity[] | IError>;
|
|
24
28
|
/**
|
|
25
29
|
* Get all page objects with product information as an array.
|
|
26
|
-
*
|
|
27
30
|
* @handleName getPages
|
|
28
|
-
*
|
|
29
|
-
* @
|
|
30
|
-
* @return {IPagesEntity[]} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data).
|
|
31
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
32
|
+
* @returns {IPagesEntity[]} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data).
|
|
31
33
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
32
34
|
* @description Get all page objects with product information as an array.
|
|
33
35
|
*/
|
|
34
36
|
getPages(langCode?: string): Promise<IPagesEntity[] | IError>;
|
|
35
37
|
/**
|
|
36
38
|
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
37
|
-
*
|
|
38
39
|
* @handleName getPageById
|
|
39
|
-
*
|
|
40
|
-
* @param
|
|
41
|
-
* @
|
|
42
|
-
* @return {IPagesEntity} Returns PageEntity object
|
|
40
|
+
* @param {number} id - The unique identifier of the page to be fetched. Example: 1.
|
|
41
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
42
|
+
* @returns {IPagesEntity} Returns PageEntity object
|
|
43
43
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
44
44
|
* @description Get page object with information about forms, blocks, menus, linked to the page.
|
|
45
45
|
*/
|
|
46
46
|
getPageById(id: number, langCode?: string): Promise<IPagesEntity | IError>;
|
|
47
47
|
/**
|
|
48
48
|
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
49
|
-
*
|
|
50
49
|
* @handleName getPageByUrl
|
|
51
|
-
*
|
|
52
|
-
* @param
|
|
53
|
-
* @
|
|
54
|
-
* @return {IPagesEntity} Returns PageEntity object
|
|
50
|
+
* @param {string} url - Page URL. Example: "about".
|
|
51
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
52
|
+
* @returns {IPagesEntity} Returns PageEntity object
|
|
55
53
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
56
54
|
* @description Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
57
55
|
*/
|
|
58
56
|
getPageByUrl(url: string, langCode?: string): Promise<IPagesEntity | IError>;
|
|
59
57
|
/**
|
|
60
58
|
* Get child pages object with information as an array.
|
|
61
|
-
*
|
|
62
59
|
* @handleName getChildPagesByParentUrl
|
|
63
|
-
*
|
|
64
|
-
* @param
|
|
65
|
-
* @
|
|
66
|
-
* @return {IPagesEntity} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
60
|
+
* @param {string} url - The URL of the parent page for which child pages are to be fetched. Example: "about/our-team".
|
|
61
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
62
|
+
* @returns {IPagesEntity} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
67
63
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
68
64
|
* @description Get child pages object with information as an array.
|
|
69
65
|
*/
|
|
70
66
|
getChildPagesByParentUrl(url: string, langCode?: string): Promise<IPagesEntity[] | IError>;
|
|
71
67
|
/**
|
|
72
68
|
* Get all blocks by page url.
|
|
73
|
-
*
|
|
74
69
|
* @handleName getBlocksByPageUrl
|
|
75
|
-
*
|
|
76
|
-
* @param
|
|
77
|
-
* @
|
|
78
|
-
* @return {IPositionBlock[]} Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
70
|
+
* @param {string} url - Page URL. Example: "about".
|
|
71
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
72
|
+
* @returns {IPositionBlock[]} Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
79
73
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
80
74
|
* @description Get all blocks by page url.
|
|
81
75
|
*/
|
|
82
76
|
getBlocksByPageUrl(url: string, langCode?: string): Promise<IPositionBlock[] | IError>;
|
|
83
77
|
/**
|
|
84
78
|
* Get settings for the page.
|
|
85
|
-
*
|
|
86
79
|
* @handleName getConfigPageByUrl
|
|
87
|
-
*
|
|
88
|
-
* @
|
|
89
|
-
* @return {IPageConfig} Returns a ConfigPage object with page display settings
|
|
80
|
+
* @param {string} url - Page URL. Example: "about".
|
|
81
|
+
* @returns {IPageConfig} Returns a ConfigPage object with page display settings
|
|
90
82
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
91
83
|
* @description Get settings for the page.
|
|
92
84
|
*/
|
|
93
85
|
getConfigPageByUrl(url: string): Promise<IPageConfig | IError>;
|
|
94
86
|
/**
|
|
95
87
|
* Quick search for page objects with limited output.
|
|
96
|
-
*
|
|
97
88
|
* @handleName searchPage
|
|
98
|
-
*
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
101
|
-
* @
|
|
89
|
+
* @param {string} name - Text for searching page objects (search is performed on the title field of the localizeInfos object with the language taken into account). Example: "About Us".
|
|
90
|
+
* @param {string} [url] - Page URL. Example: "catalog".
|
|
91
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
92
|
+
* @returns {IPagesEntity[]} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
102
93
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
103
94
|
* @description Quick search for page objects with limited output.
|
|
104
95
|
*/
|
|
105
|
-
searchPage(name: string, langCode?: string): Promise<IPagesEntity[] | IError>;
|
|
96
|
+
searchPage(name: string, url?: string, langCode?: string): Promise<IPagesEntity[] | IError>;
|
|
106
97
|
/**
|
|
107
98
|
* Add template data to pages
|
|
108
|
-
*
|
|
109
99
|
* @handleName addTemplateToPages
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
* @return {any} An array of page objects with template data added
|
|
100
|
+
* @param {IPagesEntity[]} data - An array of page objects (IPagesEntity[]) to which template data will be added. Example:
|
|
101
|
+
[
|
|
102
|
+
{
|
|
103
|
+
id: 8,
|
|
104
|
+
parentId: null,
|
|
105
|
+
moduleFormConfigs: [],
|
|
106
|
+
pageUrl: 'blog',
|
|
107
|
+
depth: 0,
|
|
108
|
+
localizeInfos: {
|
|
109
|
+
title: 'Blog',
|
|
110
|
+
menuTitle: 'Blog',
|
|
111
|
+
htmlContent: '',
|
|
112
|
+
plainContent: '',
|
|
113
|
+
},
|
|
114
|
+
isVisible: true,
|
|
115
|
+
forms: [],
|
|
116
|
+
blocks: [],
|
|
117
|
+
type: 'common_page',
|
|
118
|
+
templateIdentifier: 'template',
|
|
119
|
+
attributeSetIdentifier: 'page',
|
|
120
|
+
attributeValues: {},
|
|
121
|
+
isSync: true,
|
|
122
|
+
template: {
|
|
123
|
+
id: 4,
|
|
124
|
+
attributeSetIdentifier: null,
|
|
125
|
+
title: 'Template',
|
|
126
|
+
generalTypeId: 4,
|
|
127
|
+
identifier: 'template',
|
|
128
|
+
version: 0,
|
|
129
|
+
generalTypeName: 'catalog_page',
|
|
130
|
+
attributeValues: {},
|
|
131
|
+
position: 1,
|
|
132
|
+
},
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
* @returns {any} An array of page objects with template data added
|
|
147
136
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
148
137
|
* @description Add template data to pages
|
|
149
138
|
*/
|
|
150
139
|
protected addTemplateToPages(data: IPagesEntity[]): Promise<any | IError>;
|
|
151
140
|
/**
|
|
152
141
|
* Add template data to page by page templateIdentifier
|
|
153
|
-
*
|
|
154
142
|
* @handleName addTemplateToPage
|
|
155
|
-
*
|
|
156
|
-
* @
|
|
157
|
-
* @return {any} An array of page objects with template data added
|
|
143
|
+
* @param {IPagesEntity} data - Page object (IPagesEntity) to which template data will be added.
|
|
144
|
+
* @returns {any} An array of page objects with template data added
|
|
158
145
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
159
146
|
* @description Add template data to page by page templateIdentifier
|
|
160
147
|
*/
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -3,25 +3,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/* eslint-disable jsdoc/reject-any-type */
|
|
6
7
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
8
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
8
9
|
const templatesApi_1 = __importDefault(require("../templates/templatesApi"));
|
|
9
10
|
/**
|
|
10
11
|
* Controllers for working with page objects, including catalog pages
|
|
11
12
|
* @handle /api/content/pages
|
|
13
|
+
* @description Controllers for working with page objects, including catalog pages
|
|
12
14
|
*/
|
|
13
15
|
class PageApi extends asyncModules_1.default {
|
|
16
|
+
/**
|
|
17
|
+
* Constructor
|
|
18
|
+
* @param {StateModule} state - The state module.
|
|
19
|
+
* @description Constructor initializes the PageApi with a given state.
|
|
20
|
+
*/
|
|
14
21
|
constructor(state) {
|
|
15
22
|
super(state);
|
|
16
23
|
this._url = state.url + '/api/content/pages';
|
|
17
24
|
}
|
|
18
25
|
/**
|
|
19
26
|
* Get all top-level page objects.
|
|
20
|
-
*
|
|
21
27
|
* @handleName getRootPages
|
|
22
|
-
*
|
|
23
|
-
* @
|
|
24
|
-
* @return {IPagesEntity[]} Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
28
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
29
|
+
* @returns {IPagesEntity[]} Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
25
30
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
26
31
|
* @description Get all top-level page objects.
|
|
27
32
|
*/
|
|
@@ -35,11 +40,9 @@ class PageApi extends asyncModules_1.default {
|
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
37
42
|
* Get all page objects with product information as an array.
|
|
38
|
-
*
|
|
39
43
|
* @handleName getPages
|
|
40
|
-
*
|
|
41
|
-
* @
|
|
42
|
-
* @return {IPagesEntity[]} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data).
|
|
44
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
45
|
+
* @returns {IPagesEntity[]} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data).
|
|
43
46
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
44
47
|
* @description Get all page objects with product information as an array.
|
|
45
48
|
*/
|
|
@@ -53,12 +56,10 @@ class PageApi extends asyncModules_1.default {
|
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
58
|
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
56
|
-
*
|
|
57
59
|
* @handleName getPageById
|
|
58
|
-
*
|
|
59
|
-
* @param
|
|
60
|
-
* @
|
|
61
|
-
* @return {IPagesEntity} Returns PageEntity object
|
|
60
|
+
* @param {number} id - The unique identifier of the page to be fetched. Example: 1.
|
|
61
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
62
|
+
* @returns {IPagesEntity} Returns PageEntity object
|
|
62
63
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
63
64
|
* @description Get page object with information about forms, blocks, menus, linked to the page.
|
|
64
65
|
*/
|
|
@@ -72,12 +73,10 @@ class PageApi extends asyncModules_1.default {
|
|
|
72
73
|
}
|
|
73
74
|
/**
|
|
74
75
|
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
75
|
-
*
|
|
76
76
|
* @handleName getPageByUrl
|
|
77
|
-
*
|
|
78
|
-
* @param
|
|
79
|
-
* @
|
|
80
|
-
* @return {IPagesEntity} Returns PageEntity object
|
|
77
|
+
* @param {string} url - Page URL. Example: "about".
|
|
78
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
79
|
+
* @returns {IPagesEntity} Returns PageEntity object
|
|
81
80
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
82
81
|
* @description Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
83
82
|
*/
|
|
@@ -91,12 +90,10 @@ class PageApi extends asyncModules_1.default {
|
|
|
91
90
|
}
|
|
92
91
|
/**
|
|
93
92
|
* Get child pages object with information as an array.
|
|
94
|
-
*
|
|
95
93
|
* @handleName getChildPagesByParentUrl
|
|
96
|
-
*
|
|
97
|
-
* @param
|
|
98
|
-
* @
|
|
99
|
-
* @return {IPagesEntity} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
94
|
+
* @param {string} url - The URL of the parent page for which child pages are to be fetched. Example: "about/our-team".
|
|
95
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
96
|
+
* @returns {IPagesEntity} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
100
97
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
101
98
|
* @description Get child pages object with information as an array.
|
|
102
99
|
*/
|
|
@@ -110,12 +107,10 @@ class PageApi extends asyncModules_1.default {
|
|
|
110
107
|
}
|
|
111
108
|
/**
|
|
112
109
|
* Get all blocks by page url.
|
|
113
|
-
*
|
|
114
110
|
* @handleName getBlocksByPageUrl
|
|
115
|
-
*
|
|
116
|
-
* @param
|
|
117
|
-
* @
|
|
118
|
-
* @return {IPositionBlock[]} Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
111
|
+
* @param {string} url - Page URL. Example: "about".
|
|
112
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
113
|
+
* @returns {IPositionBlock[]} Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
119
114
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
120
115
|
* @description Get all blocks by page url.
|
|
121
116
|
*/
|
|
@@ -200,11 +195,9 @@ class PageApi extends asyncModules_1.default {
|
|
|
200
195
|
}
|
|
201
196
|
/**
|
|
202
197
|
* Get settings for the page.
|
|
203
|
-
*
|
|
204
198
|
* @handleName getConfigPageByUrl
|
|
205
|
-
*
|
|
206
|
-
* @
|
|
207
|
-
* @return {IPageConfig} Returns a ConfigPage object with page display settings
|
|
199
|
+
* @param {string} url - Page URL. Example: "about".
|
|
200
|
+
* @returns {IPageConfig} Returns a ConfigPage object with page display settings
|
|
208
201
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
209
202
|
* @description Get settings for the page.
|
|
210
203
|
*/
|
|
@@ -216,18 +209,18 @@ class PageApi extends asyncModules_1.default {
|
|
|
216
209
|
}
|
|
217
210
|
/**
|
|
218
211
|
* Quick search for page objects with limited output.
|
|
219
|
-
*
|
|
220
212
|
* @handleName searchPage
|
|
221
|
-
*
|
|
222
|
-
* @param
|
|
223
|
-
* @param
|
|
224
|
-
* @
|
|
213
|
+
* @param {string} name - Text for searching page objects (search is performed on the title field of the localizeInfos object with the language taken into account). Example: "About Us".
|
|
214
|
+
* @param {string} [url] - Page URL. Example: "catalog".
|
|
215
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
216
|
+
* @returns {IPagesEntity[]} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
225
217
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
226
218
|
* @description Quick search for page objects with limited output.
|
|
227
219
|
*/
|
|
228
|
-
async searchPage(name, langCode = this.state.lang) {
|
|
220
|
+
async searchPage(name, url, langCode = this.state.lang) {
|
|
229
221
|
// Fetch data from the server using a GET request to perform a quick search by page name and language code
|
|
230
|
-
const data = await this._fetchGet(`/quick/search
|
|
222
|
+
const data = await this._fetchGet(`/quick/search?${url && 'url=' + url}&lang=${langCode}&name=${name}`);
|
|
223
|
+
// /quick/search?url=catalog&langCode=en_US&name=cat
|
|
231
224
|
// Check if there is no traffic limit set in the state
|
|
232
225
|
if (!this.state.traficLimit) {
|
|
233
226
|
// Initialize an empty array to store detailed page information
|
|
@@ -251,45 +244,43 @@ class PageApi extends asyncModules_1.default {
|
|
|
251
244
|
}
|
|
252
245
|
/**
|
|
253
246
|
* Add template data to pages
|
|
254
|
-
*
|
|
255
247
|
* @handleName addTemplateToPages
|
|
256
|
-
*
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
* @return {any} An array of page objects with template data added
|
|
248
|
+
* @param {IPagesEntity[]} data - An array of page objects (IPagesEntity[]) to which template data will be added. Example:
|
|
249
|
+
[
|
|
250
|
+
{
|
|
251
|
+
id: 8,
|
|
252
|
+
parentId: null,
|
|
253
|
+
moduleFormConfigs: [],
|
|
254
|
+
pageUrl: 'blog',
|
|
255
|
+
depth: 0,
|
|
256
|
+
localizeInfos: {
|
|
257
|
+
title: 'Blog',
|
|
258
|
+
menuTitle: 'Blog',
|
|
259
|
+
htmlContent: '',
|
|
260
|
+
plainContent: '',
|
|
261
|
+
},
|
|
262
|
+
isVisible: true,
|
|
263
|
+
forms: [],
|
|
264
|
+
blocks: [],
|
|
265
|
+
type: 'common_page',
|
|
266
|
+
templateIdentifier: 'template',
|
|
267
|
+
attributeSetIdentifier: 'page',
|
|
268
|
+
attributeValues: {},
|
|
269
|
+
isSync: true,
|
|
270
|
+
template: {
|
|
271
|
+
id: 4,
|
|
272
|
+
attributeSetIdentifier: null,
|
|
273
|
+
title: 'Template',
|
|
274
|
+
generalTypeId: 4,
|
|
275
|
+
identifier: 'template',
|
|
276
|
+
version: 0,
|
|
277
|
+
generalTypeName: 'catalog_page',
|
|
278
|
+
attributeValues: {},
|
|
279
|
+
position: 1,
|
|
280
|
+
},
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
* @returns {any} An array of page objects with template data added
|
|
293
284
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
294
285
|
* @description Add template data to pages
|
|
295
286
|
*/
|
|
@@ -304,11 +295,9 @@ class PageApi extends asyncModules_1.default {
|
|
|
304
295
|
}
|
|
305
296
|
/**
|
|
306
297
|
* Add template data to page by page templateIdentifier
|
|
307
|
-
*
|
|
308
298
|
* @handleName addTemplateToPage
|
|
309
|
-
*
|
|
310
|
-
* @
|
|
311
|
-
* @return {any} An array of page objects with template data added
|
|
299
|
+
* @param {IPagesEntity} data - Page object (IPagesEntity) to which template data will be added.
|
|
300
|
+
* @returns {any} An array of page objects with template data added
|
|
312
301
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
313
302
|
* @description Add template data to page by page templateIdentifier
|
|
314
303
|
*/
|
|
@@ -332,6 +321,7 @@ class PageApi extends asyncModules_1.default {
|
|
|
332
321
|
}
|
|
333
322
|
catch (error) {
|
|
334
323
|
// Log any errors that occur during the template fetching process
|
|
324
|
+
// eslint-disable-next-line no-undef, no-console
|
|
335
325
|
console.error('Template fetch error: ', error);
|
|
336
326
|
// Return the original data object unchanged if an error occurs
|
|
337
327
|
return data;
|