oneentry 1.0.0 → 1.0.8
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 +1653 -190
- package/dist/admins/adminsApi.d.ts +2 -2
- package/dist/admins/adminsInterfaces.d.ts +30 -2
- package/dist/attribute-set/AttributeSetApi.d.ts +3 -3
- package/dist/attribute-set/attributeSetInterfaces.d.ts +21 -3
- package/dist/base/utils.d.ts +32 -0
- package/dist/base/utils.js +32 -0
- package/dist/base/utils.js.map +1 -0
- package/dist/forms/formsApi.d.ts +26 -0
- package/dist/forms/formsApi.js +56 -0
- package/dist/forms/formsApi.js.map +1 -0
- package/dist/forms/formsInterfaces.d.ts +28 -0
- package/dist/forms/formsInterfaces.js +3 -0
- package/dist/forms/formsInterfaces.js.map +1 -0
- package/dist/formsData/formsDataApi.d.ts +41 -0
- package/dist/formsData/formsDataApi.js +71 -0
- package/dist/formsData/formsDataApi.js.map +1 -0
- package/dist/formsData/formsDataInterfaces.d.ts +25 -0
- package/dist/formsData/formsDataInterfaces.js +3 -0
- package/dist/formsData/formsDataInterfaces.js.map +1 -0
- package/dist/general-types/GeneralTypesApi.d.ts +2 -2
- package/dist/general-types/generalTypesInterfaces.d.ts +7 -2
- package/dist/index.d.ts +11 -7
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/dist/locales/localesApi.d.ts +2 -2
- package/dist/locales/localesInterfaces.d.ts +13 -2
- package/dist/markers/markersApi.d.ts +4 -4
- package/dist/markers/markersApi.js +1 -1
- package/dist/markers/markersApi.js.map +1 -1
- package/dist/markers/markersInterfaces.d.ts +14 -4
- package/dist/menus/menusApi.d.ts +2 -2
- package/dist/menus/menusInterfaces.d.ts +16 -2
- package/dist/modules/modulesApi.d.ts +2 -2
- package/dist/modules/modulesInterfaces.d.ts +17 -2
- package/dist/pages/pagesApi.d.ts +21 -9
- package/dist/pages/pagesApi.js +27 -15
- package/dist/pages/pagesApi.js.map +1 -1
- package/dist/pages/pagesInterfaces.d.ts +26 -9
- package/dist/product-statuses/productStatusesApi.d.ts +5 -5
- package/dist/product-statuses/productStatusesInterfaces.d.ts +13 -5
- package/dist/products/productsApi.d.ts +22 -10
- package/dist/products/productsApi.js +18 -5
- package/dist/products/productsApi.js.map +1 -1
- package/dist/products/productsInterfaces.d.ts +30 -9
- package/dist/templates/templatesApi.d.ts +5 -5
- package/dist/templates/templatesInterfaces.d.ts +29 -5
- package/dist/templates-preview/templatesPreviewApi.d.ts +4 -4
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +25 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,323 +2,1786 @@
|
|
|
2
2
|
|
|
3
3
|
OneEntry Headless CMS SDK is an SDK that provides an easy way to interact with the OneEntry Headless CMS API.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# Installation
|
|
6
6
|
|
|
7
7
|
To install the OneEntry Headless CMS SDK in your project, run the following command:
|
|
8
8
|
|
|
9
|
-
>
|
|
9
|
+
>
|
|
10
|
+
> ```npm install oneentry```
|
|
11
|
+
>
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
# Usage
|
|
12
14
|
|
|
13
15
|
To use the OneEntry Headless CMS SDK in your project, import the defineOneEntry function:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
```
|
|
17
|
+
import { defineOneEntry } from 'oneentry';
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
Product,
|
|
21
|
+
Page,
|
|
22
|
+
ProductStatus,
|
|
23
|
+
Templates,
|
|
24
|
+
TemplatesPreview,
|
|
25
|
+
Markers,
|
|
26
|
+
AttributeSet,
|
|
27
|
+
Admins,
|
|
28
|
+
GeneralTypes,
|
|
29
|
+
Locales,
|
|
30
|
+
Menus,
|
|
31
|
+
Modules
|
|
32
|
+
} = defineOneEntry('your-url');
|
|
33
|
+
```
|
|
31
34
|
>
|
|
32
|
-
>
|
|
35
|
+
>Or
|
|
33
36
|
>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
```
|
|
38
|
+
const api = defineOneEntry('your-url')
|
|
39
|
+
```
|
|
40
|
+
# Classes and Methods
|
|
37
41
|
|
|
38
42
|
The OneEntry Headless CMS SDK contains two classes: ProductApi and PageApi.
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
## AdminsApi
|
|
41
45
|
|
|
46
|
+
```
|
|
42
47
|
const { Admins } = defineOneEntry('your-url');
|
|
48
|
+
```
|
|
43
49
|
|
|
44
|
-
|
|
50
|
+
### getAdminsInfo
|
|
45
51
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
```
|
|
53
|
+
const value = await Admins.getAdminsInfo()
|
|
54
|
+
```
|
|
49
55
|
|
|
50
|
-
### AttributeSetApi
|
|
51
56
|
|
|
57
|
+
> This method retrieves all user objects of type admin from the API. It returns a Promise that resolves to an array of AdminEntity objects.
|
|
58
|
+
|
|
59
|
+
Example return:
|
|
60
|
+
```
|
|
61
|
+
[
|
|
62
|
+
{
|
|
63
|
+
"id": 1764,
|
|
64
|
+
"updatedDate": "2023-09-23T12:06:18.345Z",
|
|
65
|
+
"version": 10,
|
|
66
|
+
"identifier": "catalog",
|
|
67
|
+
"attributesSets": {
|
|
68
|
+
"string_id19": "",
|
|
69
|
+
"string_id18": ""
|
|
70
|
+
},
|
|
71
|
+
"attributeSetId": 0,
|
|
72
|
+
"login": "meteor",
|
|
73
|
+
"email": "meteor@mydomen.ru",
|
|
74
|
+
"restorePasswordCode": "",
|
|
75
|
+
"position": {
|
|
76
|
+
"id": 12,
|
|
77
|
+
"objectId": 1,
|
|
78
|
+
"objectType": "module",
|
|
79
|
+
"position": "0|hzzzzz:"
|
|
80
|
+
},
|
|
81
|
+
"positionId": "0|hzzzzz:",
|
|
82
|
+
"permissions": {
|
|
83
|
+
"menu.create": true
|
|
84
|
+
},
|
|
85
|
+
"selectedLanguage": "ru_RU",
|
|
86
|
+
"selectedContentLanguage": "ru_RU",
|
|
87
|
+
"selectedUITheme": "DARK"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## AttributeSetApi
|
|
93
|
+
|
|
94
|
+
```
|
|
52
95
|
const { AttributeSet } = defineOneEntry('your-url');
|
|
96
|
+
```
|
|
53
97
|
|
|
54
|
-
|
|
98
|
+
### getAttributeSetById
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
const value = await AttributeSet.getAttributeSetById(1)
|
|
102
|
+
```
|
|
55
103
|
|
|
56
|
-
> > const value = await getAttributeSetById(1)
|
|
57
|
-
>
|
|
58
104
|
> This method retrieves a single attribute set object based on its identifier (id) from the API. It returns a Promise that resolves to the attribute set object.
|
|
59
105
|
|
|
60
|
-
|
|
106
|
+
Example return:
|
|
107
|
+
```
|
|
108
|
+
{
|
|
109
|
+
"id": 1764,
|
|
110
|
+
"updatedDate": "2023-09-23T12:19:44.803Z",
|
|
111
|
+
"version": 10,
|
|
112
|
+
"identifier": "catalog",
|
|
113
|
+
"typeId": 1,
|
|
114
|
+
"localizeInfos": {
|
|
115
|
+
"ru_RU": {
|
|
116
|
+
"title": "Набор для страниц"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"schema": {
|
|
120
|
+
"attribute1": {
|
|
121
|
+
"id": 1,
|
|
122
|
+
"type": "string",
|
|
123
|
+
"isPrice": false,
|
|
124
|
+
"original": true,
|
|
125
|
+
"identifier": "stroka",
|
|
126
|
+
"localizeInfos": {
|
|
127
|
+
"ru_RU": {
|
|
128
|
+
"title": "Строка"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"position": {
|
|
134
|
+
"id": 12,
|
|
135
|
+
"objectId": 1,
|
|
136
|
+
"objectType": "attribute-set",
|
|
137
|
+
"position": "0|hzzzzz:"
|
|
138
|
+
},
|
|
139
|
+
"positionId": "0|hzzzzz:",
|
|
140
|
+
"isVisible": true
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### getAttributeSetByMarker
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
const value = await AttributeSet.getAttributeSetByMarker('marker')
|
|
148
|
+
```
|
|
61
149
|
|
|
62
|
-
> > const value = await getAttributeSetByMarker('marker')
|
|
63
|
-
>
|
|
64
150
|
> This method retrieves a single attribute set object based on its marker (marker) from the API. It returns a Promise that resolves to the attribute set object.
|
|
65
151
|
|
|
66
|
-
|
|
152
|
+
Example return:
|
|
153
|
+
```
|
|
154
|
+
{
|
|
155
|
+
"id": 1764,
|
|
156
|
+
"updatedDate": "2023-09-23T12:21:39.906Z",
|
|
157
|
+
"version": 10,
|
|
158
|
+
"identifier": "catalog",
|
|
159
|
+
"typeId": 1,
|
|
160
|
+
"localizeInfos": {
|
|
161
|
+
"ru_RU": {
|
|
162
|
+
"title": "Набор для страниц"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"schema": {
|
|
166
|
+
"attribute1": {
|
|
167
|
+
"id": 1,
|
|
168
|
+
"type": "string",
|
|
169
|
+
"isPrice": false,
|
|
170
|
+
"original": true,
|
|
171
|
+
"identifier": "stroka",
|
|
172
|
+
"localizeInfos": {
|
|
173
|
+
"ru_RU": {
|
|
174
|
+
"title": "Строка"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"position": {
|
|
180
|
+
"id": 12,
|
|
181
|
+
"objectId": 1,
|
|
182
|
+
"objectType": "attribute-set",
|
|
183
|
+
"position": "0|hzzzzz:"
|
|
184
|
+
},
|
|
185
|
+
"positionId": "0|hzzzzz:",
|
|
186
|
+
"isVisible": true
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## FormApi
|
|
191
|
+
|
|
192
|
+
const { Forms } = defineOneEntry('your-url');
|
|
193
|
+
|
|
194
|
+
### getAllForms
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
const value = await Forms.getAllForms()
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
> This method retrieves all form objects from the API. It returns a Promise that resolves to an array of FormEntity objects.
|
|
201
|
+
|
|
202
|
+
Example return:
|
|
203
|
+
```
|
|
204
|
+
{
|
|
205
|
+
"id": 1764,
|
|
206
|
+
"updatedDate": "2023-09-27T20:07:14.793Z",
|
|
207
|
+
"version": 10,
|
|
208
|
+
"identifier": "catalog",
|
|
209
|
+
"attributesSets": {
|
|
210
|
+
"string_id19": "",
|
|
211
|
+
"string_id18": ""
|
|
212
|
+
},
|
|
213
|
+
"attributeSetId": 0,
|
|
214
|
+
"processingType": "email",
|
|
215
|
+
"localizeInfos": {
|
|
216
|
+
"ru_RU": {
|
|
217
|
+
"title": "Моя форма",
|
|
218
|
+
"titleForSite": "",
|
|
219
|
+
"successMessage": "",
|
|
220
|
+
"unsuccessMessage": "",
|
|
221
|
+
"urlAddress": "",
|
|
222
|
+
"database": "0",
|
|
223
|
+
"script": "0"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"processingData": {},
|
|
227
|
+
"formPages": [
|
|
228
|
+
{
|
|
229
|
+
"id": 1764,
|
|
230
|
+
"pageId": 1764,
|
|
231
|
+
"formId": 164,
|
|
232
|
+
"positionId": null,
|
|
233
|
+
"position": {
|
|
234
|
+
"id": 12,
|
|
235
|
+
"objectId": 1,
|
|
236
|
+
"objectType": "page",
|
|
237
|
+
"position": "0|hzzzzz:"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### getFormById
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
const value = await Forms.getFormById(1)
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
> This method retrieves a single form object based on its identifier (id) from the API. It returns a Promise that resolves to a FormEntity object.
|
|
251
|
+
|
|
252
|
+
Example return:
|
|
253
|
+
```
|
|
254
|
+
{
|
|
255
|
+
"id": 1764,
|
|
256
|
+
"updatedDate": "2023-09-27T20:10:37.321Z",
|
|
257
|
+
"version": 10,
|
|
258
|
+
"identifier": "catalog",
|
|
259
|
+
"attributesSets": {
|
|
260
|
+
"string_id19": "",
|
|
261
|
+
"string_id18": ""
|
|
262
|
+
},
|
|
263
|
+
"attributeSetId": 0,
|
|
264
|
+
"processingType": "email",
|
|
265
|
+
"localizeInfos": {
|
|
266
|
+
"ru_RU": {
|
|
267
|
+
"title": "Моя форма",
|
|
268
|
+
"titleForSite": "",
|
|
269
|
+
"successMessage": "",
|
|
270
|
+
"unsuccessMessage": "",
|
|
271
|
+
"urlAddress": "",
|
|
272
|
+
"database": "0",
|
|
273
|
+
"script": "0"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"processingData": {},
|
|
277
|
+
"formPages": [
|
|
278
|
+
{
|
|
279
|
+
"id": 1764,
|
|
280
|
+
"pageId": 1764,
|
|
281
|
+
"formId": 164,
|
|
282
|
+
"positionId": null,
|
|
283
|
+
"position": {
|
|
284
|
+
"id": 12,
|
|
285
|
+
"objectId": 1,
|
|
286
|
+
"objectType": "page",
|
|
287
|
+
"position": "0|hzzzzz:"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### getFormByMarker
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
const value = await Forms.getFormByMarker('My form')
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
> 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.
|
|
301
|
+
|
|
302
|
+
Example return:
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
{
|
|
306
|
+
"id": 1764,
|
|
307
|
+
"updatedDate": "2023-09-27T20:14:05.333Z",
|
|
308
|
+
"version": 10,
|
|
309
|
+
"identifier": "catalog",
|
|
310
|
+
"attributesSets": {
|
|
311
|
+
"string_id19": "",
|
|
312
|
+
"string_id18": ""
|
|
313
|
+
},
|
|
314
|
+
"attributeSetId": 0,
|
|
315
|
+
"processingType": "email",
|
|
316
|
+
"localizeInfos": {
|
|
317
|
+
"ru_RU": {
|
|
318
|
+
"title": "Моя форма",
|
|
319
|
+
"titleForSite": "",
|
|
320
|
+
"successMessage": "",
|
|
321
|
+
"unsuccessMessage": "",
|
|
322
|
+
"urlAddress": "",
|
|
323
|
+
"database": "0",
|
|
324
|
+
"script": "0"
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"processingData": {},
|
|
328
|
+
"formPages": [
|
|
329
|
+
{
|
|
330
|
+
"id": 1764,
|
|
331
|
+
"pageId": 1764,
|
|
332
|
+
"formId": 164,
|
|
333
|
+
"positionId": null,
|
|
334
|
+
"position": {
|
|
335
|
+
"id": 12,
|
|
336
|
+
"objectId": 1,
|
|
337
|
+
"objectType": "page",
|
|
338
|
+
"position": "0|hzzzzz:"
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
## FormsDataApi
|
|
346
|
+
|
|
347
|
+
const { FormsData } = defineOneEntry('your-url');
|
|
348
|
+
|
|
349
|
+
### postFormsData
|
|
350
|
+
|
|
351
|
+
```
|
|
352
|
+
const value = await FormsData.postFormsData()
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
> This method retrieves all form data objects from the API. It returns a Promise that resolves to an array of objects of type CreateFormDataDto.
|
|
356
|
+
|
|
357
|
+
Example return:
|
|
358
|
+
|
|
359
|
+
```
|
|
360
|
+
{
|
|
361
|
+
"id": 1764,
|
|
362
|
+
"formIdentifier": "my-form",
|
|
363
|
+
"time": "2023-02-12 10:56",
|
|
364
|
+
"formData": [
|
|
365
|
+
{
|
|
366
|
+
"marker": "naimenovanie_1",
|
|
367
|
+
"value": "Наименование",
|
|
368
|
+
"langCode": "ru_RU"
|
|
369
|
+
}
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### getFormsData
|
|
375
|
+
|
|
376
|
+
```
|
|
377
|
+
const value = await FormsData.getFormsData()
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
> 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.
|
|
381
|
+
|
|
382
|
+
Example return:
|
|
383
|
+
|
|
384
|
+
```
|
|
385
|
+
[
|
|
386
|
+
{
|
|
387
|
+
"id": 1764,
|
|
388
|
+
"formIdentifier": "my-form",
|
|
389
|
+
"time": "2023-02-12 10:56",
|
|
390
|
+
"formData": [
|
|
391
|
+
{
|
|
392
|
+
"marker": "naimenovanie_1",
|
|
393
|
+
"value": "Наименование",
|
|
394
|
+
"langCode": "ru_RU"
|
|
395
|
+
}
|
|
396
|
+
]
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### getFormsDataByMarker
|
|
402
|
+
|
|
403
|
+
```
|
|
404
|
+
const value = await FormsData.getFormsDataByMarker('my-marker')
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
> 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.
|
|
408
|
+
|
|
409
|
+
Example return:
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
[
|
|
413
|
+
{
|
|
414
|
+
"id": 1764,
|
|
415
|
+
"formIdentifier": "my-form",
|
|
416
|
+
"time": "2023-02-12 10:56",
|
|
417
|
+
"formData": [
|
|
418
|
+
{
|
|
419
|
+
"marker": "naimenovanie_1",
|
|
420
|
+
"value": "Наименование",
|
|
421
|
+
"langCode": "ru_RU"
|
|
422
|
+
}
|
|
423
|
+
]
|
|
424
|
+
}
|
|
425
|
+
]
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
## GeneralTypesApi
|
|
67
429
|
|
|
68
430
|
const { GeneralTypes } = defineOneEntry('your-url');
|
|
69
431
|
|
|
70
|
-
|
|
432
|
+
### getAllTypes
|
|
71
433
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
434
|
+
```
|
|
435
|
+
const value = await GeneralTypes.getAllTypes()
|
|
436
|
+
```
|
|
75
437
|
|
|
76
|
-
|
|
438
|
+
> This method retrieves all objects of type GeneralTypeEntity from the API. It returns a Promise that resolves to an array of GeneralTypeEntity objects.
|
|
77
439
|
|
|
440
|
+
Example return:
|
|
441
|
+
```
|
|
442
|
+
[
|
|
443
|
+
{
|
|
444
|
+
"id": 1,
|
|
445
|
+
"type": "forNewsPage"
|
|
446
|
+
}
|
|
447
|
+
]
|
|
448
|
+
```
|
|
449
|
+
## LocalesApi
|
|
450
|
+
|
|
451
|
+
```
|
|
78
452
|
const { Locales } = defineOneEntry('your-url');
|
|
453
|
+
```
|
|
79
454
|
|
|
80
|
-
|
|
455
|
+
### getLocales
|
|
81
456
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
457
|
+
```
|
|
458
|
+
const value = Locales.await getLocales()
|
|
459
|
+
```
|
|
85
460
|
|
|
86
|
-
|
|
461
|
+
> This method retrieves all active language localization objects from the API. It returns a Promise that resolves to an array of LocaleEntity objects.
|
|
87
462
|
|
|
463
|
+
Example return:
|
|
464
|
+
```
|
|
465
|
+
[
|
|
466
|
+
{
|
|
467
|
+
"id": 1764,
|
|
468
|
+
"shortCode": "ru",
|
|
469
|
+
"code": "ru_RU",
|
|
470
|
+
"name": "Bengali",
|
|
471
|
+
"nativeName": "বাংলা",
|
|
472
|
+
"isActive": false,
|
|
473
|
+
"image": "🇦🇨",
|
|
474
|
+
"position": "0|hzzzzz:"
|
|
475
|
+
}
|
|
476
|
+
]
|
|
477
|
+
```
|
|
478
|
+
## MarkersApi
|
|
479
|
+
|
|
480
|
+
```
|
|
88
481
|
const { Markers } = defineOneEntry('your-url');
|
|
482
|
+
```
|
|
89
483
|
|
|
90
|
-
|
|
484
|
+
### getMarker
|
|
485
|
+
|
|
486
|
+
```
|
|
487
|
+
const value = await Markers.getMarker('marker')
|
|
488
|
+
```
|
|
91
489
|
|
|
92
|
-
> > const value = await getMarker('marker')
|
|
93
|
-
>
|
|
94
490
|
> This method retrieves a single marker object based on its marker identifier (marker) from the API. It returns a Promise that resolves to the marker object of type MarkerEntity.
|
|
95
491
|
|
|
96
|
-
|
|
492
|
+
Example return:
|
|
493
|
+
```
|
|
494
|
+
{
|
|
495
|
+
"id": 17,
|
|
496
|
+
"updatedDate": "2023-09-23T12:30:08.153Z",
|
|
497
|
+
"version": 10,
|
|
498
|
+
"identifier": "catalog",
|
|
499
|
+
"name": "string",
|
|
500
|
+
"marker": "string",
|
|
501
|
+
"localizeInfos": {
|
|
502
|
+
"ru_RU": {
|
|
503
|
+
"title": "Мой маркер"
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
```
|
|
508
|
+
### getMarkers
|
|
509
|
+
|
|
510
|
+
```
|
|
511
|
+
const value = await Markers.getMarkers({limit:20, offset:5})
|
|
512
|
+
```
|
|
97
513
|
|
|
98
|
-
> > const value = await getMarkers({limit:20, offset:5})
|
|
99
|
-
>
|
|
100
514
|
> This method retrieves all marker objects from the API. It accepts two optional parameters limit (default 30) and offset (default 0) that allow you to limit the selection of records and offset the records selection, respectively. It returns a Promise that resolves to an object of type ItemsWithTotal, where items is an array of MarkerEntity objects and total is the total number of markers found.
|
|
101
515
|
|
|
102
|
-
|
|
516
|
+
Example return:
|
|
517
|
+
```
|
|
518
|
+
{
|
|
519
|
+
"id": 17,
|
|
520
|
+
"updatedDate": "2023-09-23T12:31:19.409Z",
|
|
521
|
+
"version": 10,
|
|
522
|
+
"identifier": "catalog",
|
|
523
|
+
"name": "string",
|
|
524
|
+
"marker": "string",
|
|
525
|
+
"localizeInfos": {
|
|
526
|
+
"ru_RU": {
|
|
527
|
+
"title": "Мой маркер"
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
```
|
|
532
|
+
### getMarkersById
|
|
533
|
+
|
|
534
|
+
```
|
|
535
|
+
const value = await Markers.getMarkersById(1)
|
|
536
|
+
```
|
|
103
537
|
|
|
104
|
-
> > const value = await getMarkersById(1)
|
|
105
|
-
>
|
|
106
538
|
> This method retrieves a single marker object based on its identifier (id) from the API. It returns a Promise that resolves to the marker object of type MarkerEntity.
|
|
107
539
|
|
|
108
|
-
|
|
109
|
-
|
|
540
|
+
Example return:
|
|
541
|
+
```
|
|
542
|
+
{
|
|
543
|
+
"id": 17,
|
|
544
|
+
"updatedDate": "2023-09-23T12:32:47.591Z",
|
|
545
|
+
"version": 10,
|
|
546
|
+
"identifier": "catalog",
|
|
547
|
+
"name": "string",
|
|
548
|
+
"marker": "string",
|
|
549
|
+
"localizeInfos": {
|
|
550
|
+
"ru_RU": {
|
|
551
|
+
"title": "Мой маркер"
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
```
|
|
556
|
+
## MenusApi
|
|
557
|
+
|
|
558
|
+
```
|
|
110
559
|
const { Menus } = defineOneEntry('your-url');
|
|
560
|
+
```
|
|
111
561
|
|
|
112
|
-
|
|
562
|
+
### getMenusByMarker
|
|
113
563
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
564
|
+
```
|
|
565
|
+
const value = await Menus.getMenusByMarker('marker')
|
|
566
|
+
```
|
|
117
567
|
|
|
118
|
-
|
|
568
|
+
> This method retrieves a single menu object based on its marker (marker) from the API. It returns a Promise that resolves to a single menu object as a ContentMenuDto object with included pages.
|
|
119
569
|
|
|
570
|
+
Example return:
|
|
571
|
+
|
|
572
|
+
```
|
|
573
|
+
{
|
|
574
|
+
"id": 1764,
|
|
575
|
+
"identifier": "catalog",
|
|
576
|
+
"localizeInfos": {
|
|
577
|
+
"ru_RU": {
|
|
578
|
+
"title": "Главное меню"
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
"pages": [
|
|
582
|
+
{
|
|
583
|
+
"id": 11,
|
|
584
|
+
"pageUrl": "122",
|
|
585
|
+
"localizeInfos": {
|
|
586
|
+
"en_US": {
|
|
587
|
+
"title": "12",
|
|
588
|
+
"content": "",
|
|
589
|
+
"menuTitle": "12"
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
"position": 0,
|
|
593
|
+
"parentId": null
|
|
594
|
+
}
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
```
|
|
598
|
+
## ModulesApi
|
|
599
|
+
|
|
600
|
+
```
|
|
120
601
|
const { Modules } = defineOneEntry('your-url');
|
|
602
|
+
```
|
|
121
603
|
|
|
122
|
-
|
|
604
|
+
### getAllModules
|
|
123
605
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
606
|
+
```
|
|
607
|
+
const value = await Modules.getAllModules()
|
|
608
|
+
```
|
|
127
609
|
|
|
128
|
-
|
|
610
|
+
> This method retrieves all modules from the API. It returns a Promise that resolves to an array of BaseModuleDto objects or an empty array [] if there is no data.
|
|
129
611
|
|
|
612
|
+
Example return:
|
|
613
|
+
```
|
|
614
|
+
[
|
|
615
|
+
{
|
|
616
|
+
"identifier": "catalog",
|
|
617
|
+
"isVisible": true,
|
|
618
|
+
"type": null,
|
|
619
|
+
"localizeInfos": {
|
|
620
|
+
"ru_RU": {
|
|
621
|
+
"title": "Каталог"
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
"icon": "mdi mdi-account-key",
|
|
625
|
+
"generalTypes": [
|
|
626
|
+
{
|
|
627
|
+
"id": 1,
|
|
628
|
+
"type": "service"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"id": 2,
|
|
632
|
+
"type": "forCatalogPages"
|
|
633
|
+
}
|
|
634
|
+
],
|
|
635
|
+
"attributeSetTypes": [],
|
|
636
|
+
"position": "0|hzzzzz:",
|
|
637
|
+
"positionId": 12
|
|
638
|
+
}
|
|
639
|
+
]
|
|
640
|
+
```
|
|
641
|
+
## PagesApi
|
|
642
|
+
|
|
643
|
+
```
|
|
130
644
|
const { Pages } = defineOneEntry('your-url');
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
### getRootPages
|
|
648
|
+
|
|
649
|
+
```
|
|
650
|
+
const value = await Pages.getRootPages('en_US')
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
> This method retrieves all top-level page objects from the API. It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data. Get required language parameter.
|
|
654
|
+
|
|
655
|
+
Example return:
|
|
656
|
+
```
|
|
657
|
+
[
|
|
658
|
+
{
|
|
659
|
+
"id": 1764,
|
|
660
|
+
"parentId": null,
|
|
661
|
+
"config": {
|
|
662
|
+
"rowsPerPage": 1,
|
|
663
|
+
"productsPerRow": 1
|
|
664
|
+
},
|
|
665
|
+
"pageUrl": "string",
|
|
666
|
+
"depth": 3,
|
|
667
|
+
"localizeInfos": {
|
|
668
|
+
"ru_RU": {
|
|
669
|
+
"title": "Каталог",
|
|
670
|
+
"content": "Контент для каталога",
|
|
671
|
+
"menuTitle": "Каталог"
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
"isVisible": true,
|
|
675
|
+
"isEditorDisabled": false,
|
|
676
|
+
"products": 0,
|
|
677
|
+
"attributeSetId": 7,
|
|
678
|
+
"forms": [
|
|
679
|
+
null
|
|
680
|
+
],
|
|
681
|
+
"blocks": [
|
|
682
|
+
null
|
|
683
|
+
],
|
|
684
|
+
"templateIdentifier": "my-template",
|
|
685
|
+
"attributeValues": {
|
|
686
|
+
"en_US": {
|
|
687
|
+
"marker": {
|
|
688
|
+
"value": "",
|
|
689
|
+
"type": "string"
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
"position": 192,
|
|
694
|
+
"type": "forNewsPage"
|
|
695
|
+
}
|
|
696
|
+
]
|
|
697
|
+
```
|
|
698
|
+
### getCatalogPages
|
|
699
|
+
|
|
700
|
+
```
|
|
701
|
+
const value = await Pages.getCatalogPages({langCode:'en_US', limit:20, offset:5})
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
> This method retrieves all page objects with product information as an array from the API. It accepts two optional parameters limit and offset for pagination and language code parameter. It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data.
|
|
705
|
+
|
|
706
|
+
Example return:
|
|
707
|
+
|
|
708
|
+
```
|
|
709
|
+
[
|
|
710
|
+
{
|
|
711
|
+
"id": 1764,
|
|
712
|
+
"parentId": null,
|
|
713
|
+
"config": {
|
|
714
|
+
"rowsPerPage": 1,
|
|
715
|
+
"productsPerRow": 1
|
|
716
|
+
},
|
|
717
|
+
"pageUrl": "string",
|
|
718
|
+
"depth": 3,
|
|
719
|
+
"localizeInfos": {
|
|
720
|
+
"ru_RU": {
|
|
721
|
+
"title": "Каталог",
|
|
722
|
+
"content": "Контент для каталога",
|
|
723
|
+
"menuTitle": "Каталог"
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
"isVisible": true,
|
|
727
|
+
"isEditorDisabled": false,
|
|
728
|
+
"products": 0,
|
|
729
|
+
"attributeSetId": 7,
|
|
730
|
+
"forms": [
|
|
731
|
+
null
|
|
732
|
+
],
|
|
733
|
+
"blocks": [
|
|
734
|
+
null
|
|
735
|
+
],
|
|
736
|
+
"templateIdentifier": "my-template",
|
|
737
|
+
"attributeValues": {
|
|
738
|
+
"en_US": {
|
|
739
|
+
"marker": {
|
|
740
|
+
"value": "",
|
|
741
|
+
"type": "string"
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
"position": 192,
|
|
746
|
+
"type": "forNewsPage"
|
|
747
|
+
}
|
|
748
|
+
]
|
|
749
|
+
```
|
|
750
|
+
### getPages
|
|
751
|
+
|
|
752
|
+
```
|
|
753
|
+
const value = await Pages.getPages('en_US')
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
> This method retrieves all created pages as an array from the API. It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data. Get required language parameter.
|
|
757
|
+
|
|
758
|
+
Example return:
|
|
759
|
+
```
|
|
760
|
+
[
|
|
761
|
+
{
|
|
762
|
+
"id": 1764,
|
|
763
|
+
"parentId": null,
|
|
764
|
+
"config": {
|
|
765
|
+
"rowsPerPage": 1,
|
|
766
|
+
"productsPerRow": 1
|
|
767
|
+
},
|
|
768
|
+
"pageUrl": "string",
|
|
769
|
+
"depth": 3,
|
|
770
|
+
"localizeInfos": {
|
|
771
|
+
"ru_RU": {
|
|
772
|
+
"title": "Каталог",
|
|
773
|
+
"content": "Контент для каталога",
|
|
774
|
+
"menuTitle": "Каталог"
|
|
775
|
+
}
|
|
776
|
+
},
|
|
777
|
+
"isVisible": true,
|
|
778
|
+
"isEditorDisabled": false,
|
|
779
|
+
"products": 0,
|
|
780
|
+
"attributeSetId": 7,
|
|
781
|
+
"forms": [
|
|
782
|
+
null
|
|
783
|
+
],
|
|
784
|
+
"blocks": [
|
|
785
|
+
null
|
|
786
|
+
],
|
|
787
|
+
"templateIdentifier": "my-template",
|
|
788
|
+
"attributeValues": {
|
|
789
|
+
"en_US": {
|
|
790
|
+
"marker": {
|
|
791
|
+
"value": "",
|
|
792
|
+
"type": "string"
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
"position": 192,
|
|
797
|
+
"type": "forNewsPage"
|
|
798
|
+
}
|
|
799
|
+
]
|
|
800
|
+
```
|
|
801
|
+
### getPageById
|
|
802
|
+
|
|
803
|
+
```
|
|
804
|
+
const value = await Pages.getPageById(1, 'en_US')
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
> This method retrieves a single page object based on its identifier (id) from the API. It returns a Promise that resolves to the page object, with the specific DTO depending on the type of page being returned. Get required language parameter.
|
|
808
|
+
|
|
809
|
+
```
|
|
810
|
+
{
|
|
811
|
+
"id": 1764,
|
|
812
|
+
"parentId": null,
|
|
813
|
+
"pageUrl": "string",
|
|
814
|
+
"depth": 3,
|
|
815
|
+
"localizeInfos": {
|
|
816
|
+
"ru_RU": {
|
|
817
|
+
"title": "Каталог",
|
|
818
|
+
"content": "Контент для каталога",
|
|
819
|
+
"menuTitle": "Каталог"
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
"isVisible": true,
|
|
823
|
+
"forms": [
|
|
824
|
+
null
|
|
825
|
+
],
|
|
826
|
+
"blocks": [
|
|
827
|
+
null
|
|
828
|
+
],
|
|
829
|
+
"position": 192,
|
|
830
|
+
"type": "forNewsPage",
|
|
831
|
+
"templateIdentifier": "my-template",
|
|
832
|
+
"attributeSetId": 7,
|
|
833
|
+
"attributeValues": {
|
|
834
|
+
"en_US": {
|
|
835
|
+
"marker": "opisanine",
|
|
836
|
+
"type": "string",
|
|
837
|
+
"value": ""
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
"products": 0
|
|
841
|
+
}
|
|
842
|
+
```
|
|
843
|
+
### getPageByUrl
|
|
844
|
+
|
|
845
|
+
```
|
|
846
|
+
const value = await Pages.getPageById('shop', 'en_US')
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
> This method retrieves a single page object based on its URL (url) from the API. It returns a Promise that resolves to the page object, with the specific DTO depending on the type of page being returned. Get required language parameter.
|
|
850
|
+
|
|
851
|
+
Example return:
|
|
852
|
+
```
|
|
853
|
+
{
|
|
854
|
+
"id": 1764,
|
|
855
|
+
"parentId": null,
|
|
856
|
+
"pageUrl": "string",
|
|
857
|
+
"depth": 3,
|
|
858
|
+
"localizeInfos": {
|
|
859
|
+
"ru_RU": {
|
|
860
|
+
"title": "Каталог",
|
|
861
|
+
"content": "Контент для каталога",
|
|
862
|
+
"menuTitle": "Каталог"
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
"isVisible": true,
|
|
866
|
+
"forms": [
|
|
867
|
+
null
|
|
868
|
+
],
|
|
869
|
+
"blocks": [
|
|
870
|
+
null
|
|
871
|
+
],
|
|
872
|
+
"position": 192,
|
|
873
|
+
"type": "forNewsPage",
|
|
874
|
+
"templateIdentifier": "my-template",
|
|
875
|
+
"attributeSetId": 7,
|
|
876
|
+
"attributeValues": {
|
|
877
|
+
"en_US": {
|
|
878
|
+
"marker": "opisanine",
|
|
879
|
+
"type": "string",
|
|
880
|
+
"value": ""
|
|
881
|
+
}
|
|
882
|
+
},
|
|
883
|
+
"products": 0
|
|
884
|
+
}
|
|
885
|
+
```
|
|
886
|
+
### getChildPagesByParentUrl
|
|
887
|
+
|
|
888
|
+
```
|
|
889
|
+
const value = await Pages.getChildPagesByParentUrl('shop', 'en_US')
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
> This method retrieves child pages object with information as an array based on the parent page's URL (url). It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data for the selected parent. Get required language parameter.
|
|
893
|
+
|
|
894
|
+
Example return:
|
|
895
|
+
```
|
|
896
|
+
[
|
|
897
|
+
{
|
|
898
|
+
"id": 1764,
|
|
899
|
+
"parentId": null,
|
|
900
|
+
"config": {
|
|
901
|
+
"rowsPerPage": 1,
|
|
902
|
+
"productsPerRow": 1
|
|
903
|
+
},
|
|
904
|
+
"pageUrl": "string",
|
|
905
|
+
"depth": 3,
|
|
906
|
+
"localizeInfos": {
|
|
907
|
+
"ru_RU": {
|
|
908
|
+
"title": "Каталог",
|
|
909
|
+
"content": "Контент для каталога",
|
|
910
|
+
"menuTitle": "Каталог"
|
|
911
|
+
}
|
|
912
|
+
},
|
|
913
|
+
"isVisible": true,
|
|
914
|
+
"isEditorDisabled": false,
|
|
915
|
+
"products": 0,
|
|
916
|
+
"attributeSetId": 7,
|
|
917
|
+
"forms": [
|
|
918
|
+
null
|
|
919
|
+
],
|
|
920
|
+
"blocks": [
|
|
921
|
+
null
|
|
922
|
+
],
|
|
923
|
+
"templateIdentifier": "my-template",
|
|
924
|
+
"attributeValues": {
|
|
925
|
+
"en_US": {
|
|
926
|
+
"marker": {
|
|
927
|
+
"value": "",
|
|
928
|
+
"type": "string"
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
"position": 192,
|
|
933
|
+
"type": "forNewsPage"
|
|
934
|
+
}
|
|
935
|
+
]
|
|
936
|
+
```
|
|
937
|
+
### getConfigPageByUrl
|
|
938
|
+
|
|
939
|
+
```
|
|
940
|
+
const value = await Pages.getConfigPageByUrl('shop')
|
|
941
|
+
```
|
|
131
942
|
|
|
132
|
-
#### getRootPages
|
|
133
|
-
|
|
134
|
-
> > const value = await getRootPages()
|
|
135
|
-
>
|
|
136
|
-
> This method retrieves all top-level page objects from the API. It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data.
|
|
137
|
-
|
|
138
|
-
#### getCatalogPages
|
|
139
|
-
|
|
140
|
-
> > const value = await getCatalogPages({limit:20, offset:5})
|
|
141
|
-
>
|
|
142
|
-
> This method retrieves all page objects with product information as an array from the API. It accepts two optional parameters limit and offset for pagination. It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data.
|
|
143
|
-
|
|
144
|
-
#### getPages
|
|
145
|
-
|
|
146
|
-
> > const value = await getPages()
|
|
147
|
-
>
|
|
148
|
-
> This method retrieves all created pages as an array from the API. It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data.
|
|
149
|
-
|
|
150
|
-
#### getPageById
|
|
151
|
-
|
|
152
|
-
> > const value = await getPageById(1)
|
|
153
|
-
>
|
|
154
|
-
> This method retrieves a single page object based on its identifier (id) from the API. It returns a Promise that resolves to the page object, with the specific DTO depending on the type of page being returned.
|
|
155
|
-
|
|
156
|
-
#### getPageByUrl
|
|
157
|
-
|
|
158
|
-
> > const value = await getPageById('shop')
|
|
159
|
-
>
|
|
160
|
-
> This method retrieves a single page object based on its URL (url) from the API. It returns a Promise that resolves to the page object, with the specific DTO depending on the type of page being returned.
|
|
161
|
-
|
|
162
|
-
#### getChildPagesByParentUrl
|
|
163
|
-
|
|
164
|
-
> > const value = await getChildPagesByParentUrl('shop')
|
|
165
|
-
>
|
|
166
|
-
> This method retrieves child pages object with information as an array based on the parent page's URL (url). It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data for the selected parent.
|
|
167
|
-
|
|
168
|
-
#### getConfigPageByUrl
|
|
169
|
-
|
|
170
|
-
> > const value = await getConfigPageByUrl('shop')
|
|
171
|
-
>
|
|
172
943
|
> This method retrieves the settings for a specific page based on its URL (url). It returns a Promise that resolves to a ConfigPageDto object with page display settings.
|
|
173
944
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
945
|
+
Example return:
|
|
946
|
+
```
|
|
947
|
+
{
|
|
948
|
+
"rowsPerPage": 10,
|
|
949
|
+
"productsPerRow": 10
|
|
950
|
+
}
|
|
951
|
+
```
|
|
952
|
+
### searchPage
|
|
953
|
+
|
|
954
|
+
```
|
|
955
|
+
const value = await Pages.searchPage('cup', 'en_US')
|
|
956
|
+
```
|
|
957
|
+
|
|
958
|
+
> This method performs a quick search for page objects based on a text query (name). It returns a Promise that resolves to a ContentIndexedPageDto objects or an empty array []. Get required language parameter.
|
|
959
|
+
|
|
960
|
+
Example return:
|
|
961
|
+
```
|
|
962
|
+
[
|
|
963
|
+
{
|
|
964
|
+
"id": 1764,
|
|
965
|
+
"localizeInfos": {
|
|
966
|
+
"ru_RU": {
|
|
967
|
+
"title": "Товар"
|
|
968
|
+
}
|
|
969
|
+
},
|
|
970
|
+
"isVisible": true,
|
|
971
|
+
"statusId": 1,
|
|
972
|
+
"relatedIds": [
|
|
973
|
+
1,
|
|
974
|
+
2,
|
|
975
|
+
3
|
|
976
|
+
],
|
|
977
|
+
"productPages": [
|
|
978
|
+
{
|
|
979
|
+
"id": 8997,
|
|
980
|
+
"pageId": 1176,
|
|
981
|
+
"productId": 8872
|
|
982
|
+
}
|
|
983
|
+
],
|
|
984
|
+
"attributeSetId": 7,
|
|
985
|
+
"version": 10,
|
|
986
|
+
"isSync": 0,
|
|
987
|
+
"price": 0,
|
|
988
|
+
"templateIdentifier": "my-template",
|
|
989
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
990
|
+
"attributeValues": {
|
|
991
|
+
"en_US": {
|
|
992
|
+
"marker": {
|
|
993
|
+
"value": "",
|
|
994
|
+
"type": "string"
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
},
|
|
998
|
+
"position": 1
|
|
999
|
+
}
|
|
1000
|
+
]
|
|
1001
|
+
```
|
|
1002
|
+
|
|
1003
|
+
## ProductsApi
|
|
1004
|
+
|
|
1005
|
+
```
|
|
182
1006
|
const { Products } = defineOneEntry('your-url');
|
|
183
|
-
|
|
1007
|
+
```
|
|
184
1008
|
|
|
185
|
-
|
|
186
|
-
> limit: 30,
|
|
187
|
-
> statusMarker: null,
|
|
188
|
-
> conditionValue: null,
|
|
189
|
-
> conditionMarker: null,
|
|
190
|
-
> attributeMarker: null,
|
|
191
|
-
> sortOrder: 'DESC',
|
|
192
|
-
> sortKey: 'id'}
|
|
1009
|
+
This module accepts a set of user parameters called userQuery. If the parameters are not passed to the method, the default value will be applied.
|
|
193
1010
|
|
|
194
|
-
|
|
1011
|
+
```
|
|
1012
|
+
{
|
|
1013
|
+
offset: 0,
|
|
1014
|
+
limit: 30,
|
|
1015
|
+
statusMarker: null,
|
|
1016
|
+
conditionValue: null,
|
|
1017
|
+
conditionMarker: null,
|
|
1018
|
+
attributeMarker: null,
|
|
1019
|
+
langCode: 'en_US',
|
|
1020
|
+
sortOrder: 'DESC',
|
|
1021
|
+
sortKey: 'id'
|
|
1022
|
+
}
|
|
1023
|
+
```
|
|
1024
|
+
|
|
1025
|
+
### getProducts
|
|
1026
|
+
|
|
1027
|
+
```
|
|
1028
|
+
const value = await Products.getProducts()
|
|
1029
|
+
```
|
|
195
1030
|
|
|
196
|
-
> > const value = await getProducts()
|
|
197
|
-
>
|
|
198
1031
|
> This method searches for product page objects with pagination and filtering based on the provided query parameters (userQuery). It returns a Promise that resolves to a list of products (IProduct[]).
|
|
199
1032
|
|
|
200
|
-
|
|
1033
|
+
Example return:
|
|
1034
|
+
```
|
|
1035
|
+
{
|
|
1036
|
+
"id": 1764,
|
|
1037
|
+
"localizeInfos": {
|
|
1038
|
+
"ru_RU": {
|
|
1039
|
+
"title": "Товар"
|
|
1040
|
+
}
|
|
1041
|
+
},
|
|
1042
|
+
"isVisible": true,
|
|
1043
|
+
"statusId": 1,
|
|
1044
|
+
"relatedIds": [
|
|
1045
|
+
1,
|
|
1046
|
+
2,
|
|
1047
|
+
3
|
|
1048
|
+
],
|
|
1049
|
+
"productPages": [
|
|
1050
|
+
{
|
|
1051
|
+
"id": 8997,
|
|
1052
|
+
"pageId": 1176,
|
|
1053
|
+
"productId": 8872
|
|
1054
|
+
}
|
|
1055
|
+
],
|
|
1056
|
+
"attributeSetId": 7,
|
|
1057
|
+
"version": 10,
|
|
1058
|
+
"isSync": 0,
|
|
1059
|
+
"price": 0,
|
|
1060
|
+
"templateIdentifier": "my-template",
|
|
1061
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
1062
|
+
"attributeValues": {
|
|
1063
|
+
"en_US": {
|
|
1064
|
+
"marker": {
|
|
1065
|
+
"value": "",
|
|
1066
|
+
"type": "string"
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
},
|
|
1070
|
+
"position": 1
|
|
1071
|
+
}
|
|
1072
|
+
```
|
|
1073
|
+
### getProductsEmptyPage
|
|
1074
|
+
|
|
1075
|
+
```
|
|
1076
|
+
const value = await Products.getProductsEmptyPage()
|
|
1077
|
+
```
|
|
201
1078
|
|
|
202
|
-
> > const value = await getProductsEmptyPage()
|
|
203
|
-
>
|
|
204
1079
|
> This method searches for product page objects with pagination that do not have a category, based on the provided query parameters (userQuery). It returns a Promise that resolves to an array of items, where each item is a ContentIndexedProductDto object.
|
|
205
1080
|
|
|
206
|
-
|
|
1081
|
+
Example return:
|
|
1082
|
+
|
|
1083
|
+
```
|
|
1084
|
+
{
|
|
1085
|
+
"id": 1764,
|
|
1086
|
+
"localizeInfos": {
|
|
1087
|
+
"ru_RU": {
|
|
1088
|
+
"title": "Товар"
|
|
1089
|
+
}
|
|
1090
|
+
},
|
|
1091
|
+
"isVisible": true,
|
|
1092
|
+
"statusId": 1,
|
|
1093
|
+
"relatedIds": [
|
|
1094
|
+
1,
|
|
1095
|
+
2,
|
|
1096
|
+
3
|
|
1097
|
+
],
|
|
1098
|
+
"productPages": [
|
|
1099
|
+
{
|
|
1100
|
+
"id": 8997,
|
|
1101
|
+
"pageId": 1176,
|
|
1102
|
+
"productId": 8872
|
|
1103
|
+
}
|
|
1104
|
+
],
|
|
1105
|
+
"attributeSetId": 7,
|
|
1106
|
+
"version": 10,
|
|
1107
|
+
"isSync": 0,
|
|
1108
|
+
"price": 0,
|
|
1109
|
+
"templateIdentifier": "my-template",
|
|
1110
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
1111
|
+
"attributeValues": {
|
|
1112
|
+
"en_US": {
|
|
1113
|
+
"marker": {
|
|
1114
|
+
"value": "",
|
|
1115
|
+
"type": "string"
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
},
|
|
1119
|
+
"position": 1
|
|
1120
|
+
}
|
|
1121
|
+
```
|
|
1122
|
+
|
|
1123
|
+
### getProductsPageById
|
|
1124
|
+
|
|
1125
|
+
```
|
|
1126
|
+
const value = await Products.getProductsPageById(1)
|
|
1127
|
+
```
|
|
207
1128
|
|
|
208
|
-
> > const value = await getProductsPageById(1)
|
|
209
|
-
>
|
|
210
1129
|
> This method searches for all product page objects with pagination for the selected category based on the page identifier (id). It accepts an optional userQuery parameter to set query parameters for the search. The query parameters include limit, offset, statusMarker, conditionValue, conditionMarker, attributeMarker, sortOrder, and sortKey. It returns a Promise that resolves to an array of ContentIndexedProductDto objects.
|
|
211
1130
|
|
|
212
|
-
|
|
1131
|
+
Example return:
|
|
1132
|
+
```
|
|
1133
|
+
{
|
|
1134
|
+
"id": 1764,
|
|
1135
|
+
"localizeInfos": {
|
|
1136
|
+
"ru_RU": {
|
|
1137
|
+
"title": "Товар"
|
|
1138
|
+
}
|
|
1139
|
+
},
|
|
1140
|
+
"isVisible": true,
|
|
1141
|
+
"statusId": 1,
|
|
1142
|
+
"relatedIds": [
|
|
1143
|
+
1,
|
|
1144
|
+
2,
|
|
1145
|
+
3
|
|
1146
|
+
],
|
|
1147
|
+
"productPages": [
|
|
1148
|
+
{
|
|
1149
|
+
"id": 8997,
|
|
1150
|
+
"pageId": 1176,
|
|
1151
|
+
"productId": 8872
|
|
1152
|
+
}
|
|
1153
|
+
],
|
|
1154
|
+
"attributeSetId": 7,
|
|
1155
|
+
"version": 10,
|
|
1156
|
+
"isSync": 0,
|
|
1157
|
+
"price": 0,
|
|
1158
|
+
"templateIdentifier": "my-template",
|
|
1159
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
1160
|
+
"attributeValues": {
|
|
1161
|
+
"en_US": {
|
|
1162
|
+
"marker": {
|
|
1163
|
+
"value": "",
|
|
1164
|
+
"type": "string"
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
"position": 1
|
|
1169
|
+
}
|
|
1170
|
+
```
|
|
1171
|
+
|
|
1172
|
+
### getProductsPageByUrl
|
|
1173
|
+
|
|
1174
|
+
```
|
|
1175
|
+
const value = await Products.getProductsPageByUrl('cup')
|
|
1176
|
+
```
|
|
213
1177
|
|
|
214
|
-
> > const value = await getProductsPageByUrl('cup')
|
|
215
|
-
>
|
|
216
1178
|
> This method searches for all product page objects with pagination for the selected category based on the page URL (url). It accepts an optional userQuery parameter to set query parameters for the search. The query parameters include limit, offset, statusMarker, conditionValue, conditionMarker, attributeMarker, sortOrder, and sortKey. It returns a Promise that resolves to an array of ContentIndexedProductDto objects.
|
|
217
1179
|
|
|
218
|
-
|
|
1180
|
+
Example return:
|
|
1181
|
+
```
|
|
1182
|
+
{
|
|
1183
|
+
"id": 1764,
|
|
1184
|
+
"localizeInfos": {
|
|
1185
|
+
"ru_RU": {
|
|
1186
|
+
"title": "Товар"
|
|
1187
|
+
}
|
|
1188
|
+
},
|
|
1189
|
+
"isVisible": true,
|
|
1190
|
+
"statusId": 1,
|
|
1191
|
+
"relatedIds": [
|
|
1192
|
+
1,
|
|
1193
|
+
2,
|
|
1194
|
+
3
|
|
1195
|
+
],
|
|
1196
|
+
"productPages": [
|
|
1197
|
+
{
|
|
1198
|
+
"id": 8997,
|
|
1199
|
+
"pageId": 1176,
|
|
1200
|
+
"productId": 8872
|
|
1201
|
+
}
|
|
1202
|
+
],
|
|
1203
|
+
"attributeSetId": 7,
|
|
1204
|
+
"version": 10,
|
|
1205
|
+
"isSync": 0,
|
|
1206
|
+
"price": 0,
|
|
1207
|
+
"templateIdentifier": "my-template",
|
|
1208
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
1209
|
+
"attributeValues": {
|
|
1210
|
+
"en_US": {
|
|
1211
|
+
"marker": {
|
|
1212
|
+
"value": "",
|
|
1213
|
+
"type": "string"
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
"position": 1
|
|
1218
|
+
}
|
|
1219
|
+
```
|
|
1220
|
+
|
|
1221
|
+
### getRelatedProductsById
|
|
1222
|
+
|
|
1223
|
+
```
|
|
1224
|
+
const value = await Products.getRelatedProductsById(1)
|
|
1225
|
+
```
|
|
219
1226
|
|
|
220
|
-
> > const value = await getRelatedProductsById(1)
|
|
221
|
-
>
|
|
222
1227
|
> This method retrieves all related product page objects for a specific product based on its identifier (id) from the API. It accepts an optional userQuery parameter for additional query parameters such as limit, offset, sortOrder, and sortKey. It returns a Promise that resolves to an array of ContentIndexedProductDto objects.
|
|
223
1228
|
|
|
224
|
-
|
|
1229
|
+
Example return:
|
|
1230
|
+
```
|
|
1231
|
+
{
|
|
1232
|
+
"id": 1764,
|
|
1233
|
+
"localizeInfos": {
|
|
1234
|
+
"ru_RU": {
|
|
1235
|
+
"title": "Товар"
|
|
1236
|
+
}
|
|
1237
|
+
},
|
|
1238
|
+
"isVisible": true,
|
|
1239
|
+
"statusId": 1,
|
|
1240
|
+
"relatedIds": [
|
|
1241
|
+
1,
|
|
1242
|
+
2,
|
|
1243
|
+
3
|
|
1244
|
+
],
|
|
1245
|
+
"productPages": [
|
|
1246
|
+
{
|
|
1247
|
+
"id": 8997,
|
|
1248
|
+
"pageId": 1176,
|
|
1249
|
+
"productId": 8872
|
|
1250
|
+
}
|
|
1251
|
+
],
|
|
1252
|
+
"attributeSetId": 7,
|
|
1253
|
+
"version": 10,
|
|
1254
|
+
"isSync": 0,
|
|
1255
|
+
"price": 0,
|
|
1256
|
+
"templateIdentifier": "my-template",
|
|
1257
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
1258
|
+
"attributeValues": {
|
|
1259
|
+
"en_US": {
|
|
1260
|
+
"marker": {
|
|
1261
|
+
"value": "",
|
|
1262
|
+
"type": "string"
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
"position": 1
|
|
1267
|
+
}
|
|
1268
|
+
```
|
|
1269
|
+
### getProductById
|
|
1270
|
+
|
|
1271
|
+
```
|
|
1272
|
+
const value = await Products.getProductById(1)
|
|
1273
|
+
```
|
|
225
1274
|
|
|
226
|
-
> > const value = await getProductById(1)
|
|
227
|
-
>
|
|
228
1275
|
> This method retrieves a single product object based on its identifier (id) from the API. It returns a Promise that resolves to a ContentIndexedProductDto object for the product.
|
|
229
1276
|
|
|
230
|
-
|
|
1277
|
+
Example return:
|
|
1278
|
+
```
|
|
1279
|
+
{
|
|
1280
|
+
"id": 1764,
|
|
1281
|
+
"localizeInfos": {
|
|
1282
|
+
"ru_RU": {
|
|
1283
|
+
"title": "Товар"
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
"isVisible": true,
|
|
1287
|
+
"statusId": 1,
|
|
1288
|
+
"relatedIds": [
|
|
1289
|
+
1,
|
|
1290
|
+
2,
|
|
1291
|
+
3
|
|
1292
|
+
],
|
|
1293
|
+
"productPages": [
|
|
1294
|
+
{
|
|
1295
|
+
"id": 8997,
|
|
1296
|
+
"pageId": 1176,
|
|
1297
|
+
"productId": 8872
|
|
1298
|
+
}
|
|
1299
|
+
],
|
|
1300
|
+
"attributeSetId": 7,
|
|
1301
|
+
"version": 10,
|
|
1302
|
+
"isSync": 0,
|
|
1303
|
+
"price": 0,
|
|
1304
|
+
"templateIdentifier": "my-template",
|
|
1305
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
1306
|
+
"attributeValues": {
|
|
1307
|
+
"en_US": {
|
|
1308
|
+
"marker": {
|
|
1309
|
+
"value": "",
|
|
1310
|
+
"type": "string"
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
"position": 1
|
|
1315
|
+
}
|
|
1316
|
+
```
|
|
1317
|
+
### filterProduct
|
|
1318
|
+
|
|
1319
|
+
```
|
|
1320
|
+
const value = await Products.filterProduct({conditionValue:1})
|
|
1321
|
+
```
|
|
1322
|
+
|
|
1323
|
+
Example body:
|
|
1324
|
+
```
|
|
1325
|
+
[
|
|
1326
|
+
{
|
|
1327
|
+
"attributeMarker": "price",
|
|
1328
|
+
"conditionMarker": "mth",
|
|
1329
|
+
"conditionValue": 1,
|
|
1330
|
+
"pageId": 0
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
"attributeMarker": "price",
|
|
1334
|
+
"conditionMarker": "lth",
|
|
1335
|
+
"conditionValue": 3,
|
|
1336
|
+
"pageId": 0
|
|
1337
|
+
}
|
|
1338
|
+
]
|
|
1339
|
+
```
|
|
231
1340
|
|
|
232
|
-
> > const value = await filterProduct({conditionValue:1})
|
|
233
|
-
>
|
|
234
1341
|
> This method filters product page objects with pagination and multiple filtering based on the provided data request body. The data parameter should be an array of {attributeMarker:string,conditionMarker:string,conditionValue:number,pageId:number}.
|
|
235
1342
|
|
|
236
|
-
|
|
1343
|
+
Example return:
|
|
1344
|
+
```
|
|
1345
|
+
{
|
|
1346
|
+
"id": 1764,
|
|
1347
|
+
"localizeInfos": {
|
|
1348
|
+
"ru_RU": {
|
|
1349
|
+
"title": "Товар"
|
|
1350
|
+
}
|
|
1351
|
+
},
|
|
1352
|
+
"isVisible": true,
|
|
1353
|
+
"statusId": 1,
|
|
1354
|
+
"relatedIds": [
|
|
1355
|
+
1,
|
|
1356
|
+
2,
|
|
1357
|
+
3
|
|
1358
|
+
],
|
|
1359
|
+
"productPages": [
|
|
1360
|
+
{
|
|
1361
|
+
"id": 8997,
|
|
1362
|
+
"pageId": 1176,
|
|
1363
|
+
"productId": 8872
|
|
1364
|
+
}
|
|
1365
|
+
],
|
|
1366
|
+
"attributeSetId": 7,
|
|
1367
|
+
"version": 10,
|
|
1368
|
+
"isSync": 0,
|
|
1369
|
+
"price": 0,
|
|
1370
|
+
"templateIdentifier": "my-template",
|
|
1371
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
1372
|
+
"attributeValues": {
|
|
1373
|
+
"en_US": {
|
|
1374
|
+
"marker": {
|
|
1375
|
+
"value": "",
|
|
1376
|
+
"type": "string"
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
},
|
|
1380
|
+
"position": 1
|
|
1381
|
+
}
|
|
1382
|
+
```
|
|
1383
|
+
### searchProduct
|
|
1384
|
+
|
|
1385
|
+
```
|
|
1386
|
+
const value = await Products.searchProduct('cup')
|
|
1387
|
+
```
|
|
237
1388
|
|
|
238
|
-
> > const value = await searchProduct('cup')
|
|
239
|
-
>
|
|
240
1389
|
> This method performs a quick search for product page objects based on a text query name. The search is performed on the title field of the localizeInfos object, taking the specified lang language code into consideration. It returns a Promise that resolves to an array of ContentIndexedProductDto objects.
|
|
241
1390
|
|
|
242
|
-
|
|
1391
|
+
Example return:
|
|
1392
|
+
```
|
|
1393
|
+
[
|
|
1394
|
+
{
|
|
1395
|
+
"id": 1764,
|
|
1396
|
+
"localizeInfos": {
|
|
1397
|
+
"ru_RU": {
|
|
1398
|
+
"title": "Товар"
|
|
1399
|
+
}
|
|
1400
|
+
},
|
|
1401
|
+
"isVisible": true,
|
|
1402
|
+
"statusId": 1,
|
|
1403
|
+
"relatedIds": [
|
|
1404
|
+
1,
|
|
1405
|
+
2,
|
|
1406
|
+
3
|
|
1407
|
+
],
|
|
1408
|
+
"productPages": [
|
|
1409
|
+
{
|
|
1410
|
+
"id": 8997,
|
|
1411
|
+
"pageId": 1176,
|
|
1412
|
+
"productId": 8872
|
|
1413
|
+
}
|
|
1414
|
+
],
|
|
1415
|
+
"attributeSetId": 7,
|
|
1416
|
+
"version": 10,
|
|
1417
|
+
"isSync": 0,
|
|
1418
|
+
"price": 0,
|
|
1419
|
+
"templateIdentifier": "my-template",
|
|
1420
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
1421
|
+
"attributeValues": {
|
|
1422
|
+
"en_US": {
|
|
1423
|
+
"marker": {
|
|
1424
|
+
"value": "",
|
|
1425
|
+
"type": "string"
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
},
|
|
1429
|
+
"position": 1
|
|
1430
|
+
}
|
|
1431
|
+
]
|
|
1432
|
+
```
|
|
1433
|
+
### getAttributesByProductId
|
|
1434
|
+
|
|
1435
|
+
```
|
|
1436
|
+
const value = await Products.getAttributesByProductId(1)
|
|
1437
|
+
```
|
|
243
1438
|
|
|
244
|
-
> > const value = await getAttributesByProductId(1)
|
|
245
|
-
>
|
|
246
1439
|
> This method retrieves all attributes of a product based on its identifier (id) from the API. It returns a Promise that resolves to an array of set attributes for the product.
|
|
247
1440
|
|
|
248
|
-
|
|
249
|
-
|
|
1441
|
+
Example return:
|
|
1442
|
+
```
|
|
1443
|
+
{
|
|
1444
|
+
"en_US": {
|
|
1445
|
+
"marker": {
|
|
1446
|
+
"value": "",
|
|
1447
|
+
"type": "string"
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
```
|
|
1452
|
+
## ProductStatusApi
|
|
1453
|
+
|
|
1454
|
+
```
|
|
250
1455
|
const { ProductStatus } = defineOneEntry('your-url');
|
|
1456
|
+
```
|
|
251
1457
|
|
|
252
|
-
|
|
1458
|
+
### getProductStatuses
|
|
1459
|
+
|
|
1460
|
+
```
|
|
1461
|
+
const value = await ProductStatus.getProductStatuses()
|
|
1462
|
+
```
|
|
253
1463
|
|
|
254
|
-
> > const value = await getProductStatuses()
|
|
255
|
-
>
|
|
256
1464
|
> This method searches for all product status objects from the API. It returns a Promise that resolves to an array of product status objects.
|
|
257
1465
|
|
|
258
|
-
|
|
1466
|
+
Example return:
|
|
1467
|
+
```
|
|
1468
|
+
[
|
|
1469
|
+
{
|
|
1470
|
+
"id": 1764,
|
|
1471
|
+
"updatedDate": "2023-09-25T13:36:05.903Z",
|
|
1472
|
+
"version": 10,
|
|
1473
|
+
"identifier": "catalog",
|
|
1474
|
+
"localizeInfos": {
|
|
1475
|
+
"ru_RU": {
|
|
1476
|
+
"title": "Статус 1"
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
]
|
|
1481
|
+
```
|
|
1482
|
+
### getProductStatusesById
|
|
1483
|
+
|
|
1484
|
+
```
|
|
1485
|
+
const value = await ProductStatus.getProductStatusesById(1)
|
|
1486
|
+
```
|
|
259
1487
|
|
|
260
|
-
> > const value = await getProductStatusesById(1)
|
|
261
|
-
>
|
|
262
1488
|
> This method searches for a product status object based on its identifier (id) from the API. It returns a Promise that resolves to a product status object.
|
|
263
1489
|
|
|
264
|
-
|
|
1490
|
+
Example return:
|
|
1491
|
+
```
|
|
1492
|
+
{
|
|
1493
|
+
"id": 1764,
|
|
1494
|
+
"updatedDate": "2023-09-25T13:36:05.907Z",
|
|
1495
|
+
"version": 10,
|
|
1496
|
+
"identifier": "catalog",
|
|
1497
|
+
"localizeInfos": {
|
|
1498
|
+
"ru_RU": {
|
|
1499
|
+
"title": "Статус 1"
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
```
|
|
1504
|
+
### getProductsByStatusMarker
|
|
1505
|
+
|
|
1506
|
+
```
|
|
1507
|
+
const value = await ProductStatus.getProductsByStatusMarker('marker')
|
|
1508
|
+
```
|
|
265
1509
|
|
|
266
|
-
> > const value = await getProductsByStatusMarker('marker')
|
|
267
|
-
>
|
|
268
1510
|
> This method searches for a product status object based on its textual identifier (marker) from the API. It returns a Promise that resolves to a product status object.
|
|
269
1511
|
|
|
270
|
-
|
|
1512
|
+
Example return:
|
|
1513
|
+
```
|
|
1514
|
+
{
|
|
1515
|
+
"id": 1764,
|
|
1516
|
+
"updatedDate": "2023-09-25T13:39:19.384Z",
|
|
1517
|
+
"version": 10,
|
|
1518
|
+
"identifier": "catalog",
|
|
1519
|
+
"localizeInfos": {
|
|
1520
|
+
"ru_RU": {
|
|
1521
|
+
"title": "Статус 1"
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
```
|
|
1526
|
+
### validateMarker
|
|
1527
|
+
|
|
1528
|
+
```
|
|
1529
|
+
const value = await ProductStatus.validateMarker('marker')
|
|
1530
|
+
```
|
|
271
1531
|
|
|
272
|
-
> > const value = await validateMarker('marker')
|
|
273
|
-
>
|
|
274
1532
|
> This method checks the existence of a textual identifier (marker). It takes a marker parameter as input, representing the product marker to validate. It returns a Promise that resolves to true if the textual identifier (marker) exists or false if it doesn't.
|
|
275
1533
|
|
|
276
|
-
|
|
1534
|
+
Example return:
|
|
1535
|
+
```
|
|
1536
|
+
true
|
|
1537
|
+
```
|
|
1538
|
+
## TemplatesApi
|
|
277
1539
|
|
|
1540
|
+
```
|
|
278
1541
|
const { Templates } = defineOneEntry('your-url');
|
|
1542
|
+
```
|
|
279
1543
|
|
|
280
|
-
|
|
1544
|
+
### getTemplates
|
|
1545
|
+
|
|
1546
|
+
```
|
|
1547
|
+
const value = await Templates.getTemplates()
|
|
1548
|
+
```
|
|
281
1549
|
|
|
282
|
-
> > const value = await getTemplates()
|
|
283
|
-
>
|
|
284
1550
|
> This method retrieves all template objects of a specific type from the API. It returns a Promise that resolves to an array of template objects.
|
|
285
1551
|
|
|
286
|
-
|
|
1552
|
+
Example return:
|
|
1553
|
+
```
|
|
1554
|
+
[
|
|
1555
|
+
{
|
|
1556
|
+
"id": 1764,
|
|
1557
|
+
"updatedDate": "2023-09-25T13:47:05.811Z",
|
|
1558
|
+
"version": 10,
|
|
1559
|
+
"identifier": "catalog",
|
|
1560
|
+
"attributesSets": {
|
|
1561
|
+
"string_id19": "",
|
|
1562
|
+
"string_id18": ""
|
|
1563
|
+
},
|
|
1564
|
+
"attributeSetId": 0,
|
|
1565
|
+
"generalType": {
|
|
1566
|
+
"id": 4,
|
|
1567
|
+
"type": "forCatalogPages"
|
|
1568
|
+
},
|
|
1569
|
+
"generalTypeId": 4,
|
|
1570
|
+
"localizeInfos": {
|
|
1571
|
+
"ru_RU": {
|
|
1572
|
+
"title": "Шаблон страниц"
|
|
1573
|
+
}
|
|
1574
|
+
},
|
|
1575
|
+
"position": {
|
|
1576
|
+
"id": 12,
|
|
1577
|
+
"objectId": 1,
|
|
1578
|
+
"objectType": "module",
|
|
1579
|
+
"position": "0|hzzzzz:"
|
|
1580
|
+
},
|
|
1581
|
+
"positionId": "0|hzzzzz:"
|
|
1582
|
+
}
|
|
1583
|
+
]
|
|
1584
|
+
```
|
|
1585
|
+
### getAllTemplates
|
|
1586
|
+
|
|
1587
|
+
```
|
|
1588
|
+
const value = await Templates.getAllTemplates()
|
|
1589
|
+
```
|
|
287
1590
|
|
|
288
|
-
> > const value = await getAllTemplates()
|
|
289
|
-
>
|
|
290
1591
|
> This method retrieves all template objects grouped by types from the API. It returns a Promise that resolves to an object GroupedTemplatesObject, which contains an array of template objects.
|
|
291
1592
|
|
|
292
|
-
|
|
1593
|
+
Example return:
|
|
1594
|
+
```
|
|
1595
|
+
string
|
|
1596
|
+
```
|
|
1597
|
+
### getTemplateById
|
|
1598
|
+
|
|
1599
|
+
```
|
|
1600
|
+
const value = await Templates.getTemplateById(1)
|
|
1601
|
+
```
|
|
293
1602
|
|
|
294
|
-
> > const value = await getTemplateById(1)
|
|
295
|
-
>
|
|
296
1603
|
> This method retrieves a single template object based on its identifier (id) from the API. It returns a Promise that resolves to a template object.
|
|
297
1604
|
|
|
298
|
-
|
|
1605
|
+
Example return:
|
|
1606
|
+
```
|
|
1607
|
+
{
|
|
1608
|
+
"id": 1764,
|
|
1609
|
+
"updatedDate": "2023-09-25T13:49:05.070Z",
|
|
1610
|
+
"version": 10,
|
|
1611
|
+
"identifier": "catalog",
|
|
1612
|
+
"attributesSets": {
|
|
1613
|
+
"string_id19": "",
|
|
1614
|
+
"string_id18": ""
|
|
1615
|
+
},
|
|
1616
|
+
"attributeSetId": 0,
|
|
1617
|
+
"generalType": {
|
|
1618
|
+
"id": 4,
|
|
1619
|
+
"type": "forCatalogPages"
|
|
1620
|
+
},
|
|
1621
|
+
"generalTypeId": 4,
|
|
1622
|
+
"localizeInfos": {
|
|
1623
|
+
"ru_RU": {
|
|
1624
|
+
"title": "Шаблон страниц"
|
|
1625
|
+
}
|
|
1626
|
+
},
|
|
1627
|
+
"position": {
|
|
1628
|
+
"id": 12,
|
|
1629
|
+
"objectId": 1,
|
|
1630
|
+
"objectType": "module",
|
|
1631
|
+
"position": "0|hzzzzz:"
|
|
1632
|
+
},
|
|
1633
|
+
"positionId": "0|hzzzzz:"
|
|
1634
|
+
}
|
|
1635
|
+
```
|
|
1636
|
+
### getTemplateByMarker
|
|
1637
|
+
|
|
1638
|
+
```
|
|
1639
|
+
const value = await Templates.getTemplateByMarker(1)
|
|
1640
|
+
```
|
|
299
1641
|
|
|
300
|
-
> > const value = await getTemplateByMarker(1)
|
|
301
|
-
>
|
|
302
1642
|
> This method retrieves a single template object based on its textual identifier (marker) from the API. It returns a Promise that resolves to a template object.
|
|
303
1643
|
|
|
304
|
-
|
|
305
|
-
|
|
1644
|
+
Example return:
|
|
1645
|
+
|
|
1646
|
+
```
|
|
1647
|
+
{
|
|
1648
|
+
"id": 1764,
|
|
1649
|
+
"updatedDate": "2023-09-25T13:49:43.355Z",
|
|
1650
|
+
"version": 10,
|
|
1651
|
+
"identifier": "catalog",
|
|
1652
|
+
"attributesSets": {
|
|
1653
|
+
"string_id19": "",
|
|
1654
|
+
"string_id18": ""
|
|
1655
|
+
},
|
|
1656
|
+
"attributeSetId": 0,
|
|
1657
|
+
"generalType": {
|
|
1658
|
+
"id": 4,
|
|
1659
|
+
"type": "forCatalogPages"
|
|
1660
|
+
},
|
|
1661
|
+
"generalTypeId": 4,
|
|
1662
|
+
"localizeInfos": {
|
|
1663
|
+
"ru_RU": {
|
|
1664
|
+
"title": "Шаблон страниц"
|
|
1665
|
+
}
|
|
1666
|
+
},
|
|
1667
|
+
"position": {
|
|
1668
|
+
"id": 12,
|
|
1669
|
+
"objectId": 1,
|
|
1670
|
+
"objectType": "module",
|
|
1671
|
+
"position": "0|hzzzzz:"
|
|
1672
|
+
},
|
|
1673
|
+
"positionId": "0|hzzzzz:"
|
|
1674
|
+
}
|
|
1675
|
+
```
|
|
1676
|
+
## TemplatesPreviewApi
|
|
1677
|
+
|
|
1678
|
+
```
|
|
306
1679
|
const { TemplatesPreview } = defineOneEntry('your-url');
|
|
1680
|
+
```
|
|
307
1681
|
|
|
308
|
-
|
|
1682
|
+
### getTemplatesPreview
|
|
1683
|
+
|
|
1684
|
+
```
|
|
1685
|
+
const value = await TemplatesPreview.getTemplatesPreview()
|
|
1686
|
+
```
|
|
309
1687
|
|
|
310
|
-
> > const value = await getTemplatesPreview()
|
|
311
|
-
>
|
|
312
1688
|
> This method retrieves all template objects from the API. It returns a Promise that resolves to an array of TemplatePreviewsEntity template objects.
|
|
313
1689
|
|
|
314
|
-
|
|
1690
|
+
Example return:
|
|
1691
|
+
```
|
|
1692
|
+
[
|
|
1693
|
+
{
|
|
1694
|
+
"id": 1764,
|
|
1695
|
+
"updatedDate": "2023-09-25T13:50:39.310Z",
|
|
1696
|
+
"version": 10,
|
|
1697
|
+
"identifier": "catalog",
|
|
1698
|
+
"attributesSets": {
|
|
1699
|
+
"string_id19": "",
|
|
1700
|
+
"string_id18": ""
|
|
1701
|
+
},
|
|
1702
|
+
"attributeSetId": 0,
|
|
1703
|
+
"localizeInfos": {
|
|
1704
|
+
"ru_RU": {
|
|
1705
|
+
"title": "Шаблон страниц"
|
|
1706
|
+
}
|
|
1707
|
+
},
|
|
1708
|
+
"position": {
|
|
1709
|
+
"id": 12,
|
|
1710
|
+
"objectId": 1,
|
|
1711
|
+
"objectType": "module",
|
|
1712
|
+
"position": "0|hzzzzz:"
|
|
1713
|
+
},
|
|
1714
|
+
"positionId": "0|hzzzzz:"
|
|
1715
|
+
}
|
|
1716
|
+
]
|
|
1717
|
+
```
|
|
1718
|
+
### getTemplatesPreviewById
|
|
1719
|
+
|
|
1720
|
+
```
|
|
1721
|
+
const value = await TemplatesPreview.getTemplatesPreviewById(1)
|
|
1722
|
+
```
|
|
315
1723
|
|
|
316
|
-
> > const value = await getTemplatesPreviewById(1)
|
|
317
|
-
>
|
|
318
1724
|
> This method retrieves a single template object based on its identifier (id) from the API. It returns a Promise that resolves to a TemplatePreviewsEntity object.
|
|
319
1725
|
|
|
320
|
-
|
|
1726
|
+
Example return:
|
|
1727
|
+
|
|
1728
|
+
```
|
|
1729
|
+
{
|
|
1730
|
+
"id": 1764,
|
|
1731
|
+
"updatedDate": "2023-09-25T13:51:18.920Z",
|
|
1732
|
+
"version": 10,
|
|
1733
|
+
"identifier": "catalog",
|
|
1734
|
+
"attributesSets": {
|
|
1735
|
+
"string_id19": "",
|
|
1736
|
+
"string_id18": ""
|
|
1737
|
+
},
|
|
1738
|
+
"attributeSetId": 0,
|
|
1739
|
+
"localizeInfos": {
|
|
1740
|
+
"ru_RU": {
|
|
1741
|
+
"title": "Шаблон страниц"
|
|
1742
|
+
}
|
|
1743
|
+
},
|
|
1744
|
+
"position": {
|
|
1745
|
+
"id": 12,
|
|
1746
|
+
"objectId": 1,
|
|
1747
|
+
"objectType": "module",
|
|
1748
|
+
"position": "0|hzzzzz:"
|
|
1749
|
+
},
|
|
1750
|
+
"positionId": "0|hzzzzz:"
|
|
1751
|
+
}
|
|
1752
|
+
```
|
|
1753
|
+
### getTemplatesPreviewByMarker
|
|
1754
|
+
|
|
1755
|
+
```
|
|
1756
|
+
const value = await TemplatesPreview.getTemplatesPreviewByMarker('marker')
|
|
1757
|
+
```
|
|
321
1758
|
|
|
322
|
-
> > const value = await getTemplatesPreviewByMarker('marker')
|
|
323
|
-
>
|
|
324
1759
|
> This method retrieves a single template object based on its textual identifier (marker) from the API. It returns a Promise that resolves to a TemplatePreviewsEntity object.
|
|
1760
|
+
|
|
1761
|
+
Example return:
|
|
1762
|
+
|
|
1763
|
+
```
|
|
1764
|
+
{
|
|
1765
|
+
"id": 1764,
|
|
1766
|
+
"updatedDate": "2023-09-25T13:51:59.232Z",
|
|
1767
|
+
"version": 10,
|
|
1768
|
+
"identifier": "catalog",
|
|
1769
|
+
"attributesSets": {
|
|
1770
|
+
"string_id19": "",
|
|
1771
|
+
"string_id18": ""
|
|
1772
|
+
},
|
|
1773
|
+
"attributeSetId": 0,
|
|
1774
|
+
"localizeInfos": {
|
|
1775
|
+
"ru_RU": {
|
|
1776
|
+
"title": "Шаблон страниц"
|
|
1777
|
+
}
|
|
1778
|
+
},
|
|
1779
|
+
"position": {
|
|
1780
|
+
"id": 12,
|
|
1781
|
+
"objectId": 1,
|
|
1782
|
+
"objectType": "module",
|
|
1783
|
+
"position": "0|hzzzzz:"
|
|
1784
|
+
},
|
|
1785
|
+
"positionId": "0|hzzzzz:"
|
|
1786
|
+
}
|
|
1787
|
+
```
|