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