oneentry 1.0.24 → 1.0.26
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 +508 -495
- package/dist/admins/adminsApi.d.ts +1 -1
- package/dist/admins/adminsApi.js +2 -2
- package/dist/admins/adminsApi.js.map +1 -1
- package/dist/base/oneEntry.d.ts +2 -1
- package/dist/base/oneEntry.js +10 -4
- package/dist/base/oneEntry.js.map +1 -1
- package/dist/file-uploding/fileUploadingApi.d.ts +14 -28
- package/dist/file-uploding/fileUploadingApi.js +13 -27
- package/dist/file-uploding/fileUploadingApi.js.map +1 -1
- package/dist/file-uploding/fileUploadingInterfaces.d.ts +2 -10
- package/dist/forms/formsApi.d.ts +1 -1
- package/dist/forms/formsApi.js +2 -2
- package/dist/forms/formsApi.js.map +1 -1
- package/dist/formsData/formsDataApi.d.ts +3 -3
- package/dist/formsData/formsDataApi.js +4 -4
- package/dist/formsData/formsDataApi.js.map +1 -1
- package/dist/general-types/GeneralTypesApi.d.ts +1 -1
- package/dist/general-types/GeneralTypesApi.js +2 -2
- package/dist/general-types/GeneralTypesApi.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/locales/localesApi.d.ts +1 -1
- package/dist/locales/localesApi.js +2 -2
- package/dist/locales/localesApi.js.map +1 -1
- package/dist/menus/menusApi.d.ts +1 -1
- package/dist/menus/menusApi.js +2 -2
- package/dist/menus/menusApi.js.map +1 -1
- package/dist/modules/modulesApi.d.ts +1 -1
- package/dist/modules/modulesApi.js +2 -2
- package/dist/modules/modulesApi.js.map +1 -1
- package/dist/pages/pagesApi.d.ts +1 -1
- package/dist/pages/pagesApi.js +3 -3
- package/dist/pages/pagesApi.js.map +1 -1
- package/dist/product-statuses/productStatusesApi.d.ts +1 -1
- package/dist/product-statuses/productStatusesApi.js +2 -2
- package/dist/product-statuses/productStatusesApi.js.map +1 -1
- package/dist/products/productsApi.d.ts +5 -5
- package/dist/products/productsApi.js +7 -7
- package/dist/products/productsApi.js.map +1 -1
- package/dist/products/productsInterfaces.d.ts +2 -2
- package/dist/system/systemApi.d.ts +1 -1
- package/dist/system/systemApi.js +2 -2
- package/dist/system/systemApi.js.map +1 -1
- package/dist/templates/templatesApi.d.ts +1 -1
- package/dist/templates/templatesApi.js +2 -2
- package/dist/templates/templatesApi.js.map +1 -1
- package/dist/templates-preview/templatesPreviewApi.d.ts +1 -1
- package/dist/templates-preview/templatesPreviewApi.js +2 -2
- package/dist/templates-preview/templatesPreviewApi.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,11 +14,9 @@ To get started with OneEntry, sign up for an account at [https://account.oneentr
|
|
|
14
14
|
|
|
15
15
|
To install the OneEntry Headless CMS SDK in your project, run the following command:
|
|
16
16
|
|
|
17
|
-
>
|
|
18
17
|
```
|
|
19
18
|
npm install oneentry
|
|
20
19
|
```
|
|
21
|
-
>
|
|
22
20
|
|
|
23
21
|
# Usage
|
|
24
22
|
|
|
@@ -30,30 +28,38 @@ const {
|
|
|
30
28
|
Admins,
|
|
31
29
|
Forms,
|
|
32
30
|
FormData,
|
|
31
|
+
FileUploading,
|
|
33
32
|
GeneralTypes,
|
|
34
33
|
Locales,
|
|
35
34
|
Menus,
|
|
36
35
|
Pages,
|
|
37
36
|
Products,
|
|
38
37
|
ProductStatuses,
|
|
38
|
+
System,
|
|
39
39
|
Templates,
|
|
40
40
|
TemplatePreviews
|
|
41
41
|
} = defineOneEntry('your-url')
|
|
42
42
|
```
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
|
|
44
|
+
Or
|
|
45
|
+
|
|
46
46
|
```
|
|
47
47
|
const api = defineOneEntry('your-url')
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
>If you chose token protection to ensure connection security, just pass your token to the function as an optional parameter.
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
const api = defineOneEntry('your-url', 'your-token')
|
|
54
|
+
```
|
|
55
|
+
|
|
50
56
|
## Admins
|
|
51
57
|
|
|
52
58
|
```
|
|
53
59
|
const { Admins } = defineOneEntry('your-url')
|
|
54
60
|
```
|
|
55
61
|
|
|
56
|
-
### getAdminsInfo
|
|
62
|
+
### Admins.getAdminsInfo()
|
|
57
63
|
|
|
58
64
|
```
|
|
59
65
|
const value = await Admins.getAdminsInfo()
|
|
@@ -63,46 +69,32 @@ const value = await Admins.getAdminsInfo()
|
|
|
63
69
|
> This method retrieves all user objects of type admin from the API. It returns a Promise that resolves to an array of AdminEntity objects.
|
|
64
70
|
|
|
65
71
|
Example return:
|
|
72
|
+
|
|
66
73
|
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"marker": {
|
|
78
|
-
"value": "",
|
|
79
|
-
"type": "string"
|
|
80
|
-
}
|
|
74
|
+
{
|
|
75
|
+
"id": 1764,
|
|
76
|
+
"identifier": "admin1",
|
|
77
|
+
"attributeSetId": 7,
|
|
78
|
+
"isSync": false,
|
|
79
|
+
"attributeValues": {
|
|
80
|
+
"en_US": {
|
|
81
|
+
"marker": {
|
|
82
|
+
"value": "",
|
|
83
|
+
"type": "string"
|
|
81
84
|
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"position": 192
|
|
88
|
+
}
|
|
86
89
|
```
|
|
87
90
|
|
|
88
91
|
## FileUploading
|
|
89
92
|
|
|
90
93
|
const { FileUploading } = defineOneEntry('your-url');
|
|
91
94
|
|
|
92
|
-
### upload
|
|
95
|
+
### FileUploading.upload()
|
|
93
96
|
|
|
94
97
|
```
|
|
95
|
-
const data = [
|
|
96
|
-
{
|
|
97
|
-
"fieldname": "file",
|
|
98
|
-
"originalname": "myFile.pdf",
|
|
99
|
-
"mimetype": "application/pdf",
|
|
100
|
-
"size": 234,
|
|
101
|
-
"filename": "myFile.pdf",
|
|
102
|
-
"path": "/myFile.pdf"
|
|
103
|
-
}
|
|
104
|
-
]
|
|
105
|
-
|
|
106
98
|
const query = {
|
|
107
99
|
type:"page",
|
|
108
100
|
entity:"editor",
|
|
@@ -115,9 +107,11 @@ const query = {
|
|
|
115
107
|
const value = await FileUploading.upload(data, query)
|
|
116
108
|
```
|
|
117
109
|
|
|
118
|
-
> This method uploads a file to a cloud file storage
|
|
110
|
+
> This method uploads a file to a cloud file storage. Pass to the date the value obtained from input type "file".
|
|
111
|
+
> Data is file object (or array), learn more - [File Object](https://developer.mozilla.org/en-US/docs/Web/API/File)
|
|
119
112
|
|
|
120
113
|
Example return:
|
|
114
|
+
|
|
121
115
|
```
|
|
122
116
|
{
|
|
123
117
|
"filename": "string",
|
|
@@ -126,7 +120,7 @@ Example return:
|
|
|
126
120
|
}
|
|
127
121
|
```
|
|
128
122
|
|
|
129
|
-
### delete
|
|
123
|
+
### FileUploading.delete()
|
|
130
124
|
|
|
131
125
|
```
|
|
132
126
|
const query = {
|
|
@@ -141,12 +135,11 @@ const value = await FileUploading.delete("file.png", query)
|
|
|
141
135
|
|
|
142
136
|
> This void method delete a file from the cloud file storage.
|
|
143
137
|
|
|
144
|
-
|
|
145
138
|
## Forms
|
|
146
139
|
|
|
147
140
|
const { Forms } = defineOneEntry('your-url');
|
|
148
141
|
|
|
149
|
-
### getAllForms
|
|
142
|
+
### Forms.getAllForms()
|
|
150
143
|
|
|
151
144
|
```
|
|
152
145
|
const value = await Forms.getAllForms()
|
|
@@ -155,6 +148,7 @@ const value = await Forms.getAllForms()
|
|
|
155
148
|
> This method retrieves all form objects from the API. It returns a Promise that resolves to an array of FormEntity objects.
|
|
156
149
|
|
|
157
150
|
Example return:
|
|
151
|
+
|
|
158
152
|
```
|
|
159
153
|
[
|
|
160
154
|
{
|
|
@@ -188,7 +182,7 @@ Example return:
|
|
|
188
182
|
]
|
|
189
183
|
```
|
|
190
184
|
|
|
191
|
-
### getFormByMarker
|
|
185
|
+
### Forms.getFormByMarker()
|
|
192
186
|
|
|
193
187
|
```
|
|
194
188
|
const value = await Forms.getFormByMarker('My form')
|
|
@@ -233,28 +227,12 @@ Example return:
|
|
|
233
227
|
|
|
234
228
|
const { FormData } = defineOneEntry('your-url');
|
|
235
229
|
|
|
236
|
-
### postFormsData
|
|
230
|
+
### FormData.postFormsData()
|
|
237
231
|
|
|
238
232
|
```
|
|
239
233
|
const value = await FormData.postFormsData(data)
|
|
240
234
|
```
|
|
241
235
|
|
|
242
|
-
>The method takes as a parameter request body
|
|
243
|
-
|
|
244
|
-
Example body:
|
|
245
|
-
```
|
|
246
|
-
{
|
|
247
|
-
"formIdentifier": "my-form",
|
|
248
|
-
"formData": [
|
|
249
|
-
{
|
|
250
|
-
"marker": "name_1",
|
|
251
|
-
"value": "Name",
|
|
252
|
-
"langCode": "en_US"
|
|
253
|
-
}
|
|
254
|
-
]
|
|
255
|
-
}
|
|
256
|
-
```
|
|
257
|
-
|
|
258
236
|
> This method retrieves all form data objects from the API. It returns a Promise that resolves to an array of objects of type CreateFormDataDto.
|
|
259
237
|
|
|
260
238
|
Example return:
|
|
@@ -275,7 +253,7 @@ Example return:
|
|
|
275
253
|
}
|
|
276
254
|
```
|
|
277
255
|
|
|
278
|
-
### getFormsData
|
|
256
|
+
### FormData.getFormsData()
|
|
279
257
|
|
|
280
258
|
```
|
|
281
259
|
const value = await FormData.getFormsData()
|
|
@@ -287,23 +265,23 @@ Example return:
|
|
|
287
265
|
|
|
288
266
|
```
|
|
289
267
|
[
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
268
|
+
{
|
|
269
|
+
"id": 1764,
|
|
270
|
+
"formIdentifier": "my-form",
|
|
271
|
+
"time": "2023-02-12 10:56",
|
|
272
|
+
"formData": {
|
|
273
|
+
"en_US": [
|
|
274
|
+
{
|
|
275
|
+
"marker": "naimenovanie_1",
|
|
276
|
+
"value": "Name"
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
}
|
|
301
280
|
}
|
|
302
|
-
}
|
|
303
281
|
]
|
|
304
282
|
```
|
|
305
283
|
|
|
306
|
-
### getFormsDataByMarker
|
|
284
|
+
### FormData.getFormsDataByMarker()
|
|
307
285
|
|
|
308
286
|
```
|
|
309
287
|
const value = await FormData.getFormsDataByMarker('my-marker')
|
|
@@ -333,7 +311,7 @@ Example return:
|
|
|
333
311
|
|
|
334
312
|
const { GeneralTypes } = defineOneEntry('your-url');
|
|
335
313
|
|
|
336
|
-
### getAllTypes
|
|
314
|
+
### GeneralTypes.getAllTypes()
|
|
337
315
|
|
|
338
316
|
```
|
|
339
317
|
const value = await GeneralTypes.getAllTypes()
|
|
@@ -342,6 +320,7 @@ const value = await GeneralTypes.getAllTypes()
|
|
|
342
320
|
> This method retrieves all objects of type GeneralTypeEntity from the API. It returns a Promise that resolves to an array of GeneralTypeEntity objects.
|
|
343
321
|
|
|
344
322
|
Example return:
|
|
323
|
+
|
|
345
324
|
```
|
|
346
325
|
[
|
|
347
326
|
{
|
|
@@ -357,7 +336,7 @@ Example return:
|
|
|
357
336
|
const { Locales } = defineOneEntry('your-url')
|
|
358
337
|
```
|
|
359
338
|
|
|
360
|
-
### getLocales
|
|
339
|
+
### Locales.getLocales()
|
|
361
340
|
|
|
362
341
|
```
|
|
363
342
|
const value = await Locales.getLocales()
|
|
@@ -366,18 +345,19 @@ const value = await Locales.getLocales()
|
|
|
366
345
|
> This method retrieves all active language localization objects from the API. It returns a Promise that resolves to an array of LocaleEntity objects.
|
|
367
346
|
|
|
368
347
|
Example return:
|
|
348
|
+
|
|
369
349
|
```
|
|
370
350
|
[
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
351
|
+
{
|
|
352
|
+
"id": 1764,
|
|
353
|
+
"shortCode": "en",
|
|
354
|
+
"code": "en_US",
|
|
355
|
+
"name": "Bengali",
|
|
356
|
+
"nativeName": "বাংলা",
|
|
357
|
+
"isActive": false,
|
|
358
|
+
"image": "🇦🇨",
|
|
359
|
+
"position": 1
|
|
360
|
+
}
|
|
381
361
|
]
|
|
382
362
|
```
|
|
383
363
|
|
|
@@ -387,7 +367,7 @@ Example return:
|
|
|
387
367
|
const { Menus } = defineOneEntry('your-url')
|
|
388
368
|
```
|
|
389
369
|
|
|
390
|
-
### getMenusByMarker
|
|
370
|
+
### Menus.getMenusByMarker()
|
|
391
371
|
|
|
392
372
|
```
|
|
393
373
|
const value = await Menus.getMenusByMarker('marker')
|
|
@@ -403,7 +383,7 @@ Example return:
|
|
|
403
383
|
"identifier": "catalog",
|
|
404
384
|
"localizeInfos": {
|
|
405
385
|
"en_US": {
|
|
406
|
-
"title": "Main
|
|
386
|
+
"title": "Main Menu"
|
|
407
387
|
}
|
|
408
388
|
},
|
|
409
389
|
"pages": [
|
|
@@ -429,6 +409,7 @@ Example return:
|
|
|
429
409
|
```
|
|
430
410
|
const { Pages } = defineOneEntry('your-url')
|
|
431
411
|
```
|
|
412
|
+
|
|
432
413
|
> In some methods, the langcode parameter can be either a string or an array of strings. It depends on which set of values will contain "attributeValues" and "localizeInfos"
|
|
433
414
|
|
|
434
415
|
Example:
|
|
@@ -452,7 +433,9 @@ Example:
|
|
|
452
433
|
}
|
|
453
434
|
}
|
|
454
435
|
```
|
|
436
|
+
|
|
455
437
|
Or
|
|
438
|
+
|
|
456
439
|
```
|
|
457
440
|
const value = await Pages.getRootPages([ 'en_US', 'it_IT' ])
|
|
458
441
|
|
|
@@ -484,9 +467,7 @@ const value = await Pages.getRootPages([ 'en_US', 'it_IT' ])
|
|
|
484
467
|
}
|
|
485
468
|
```
|
|
486
469
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
### getRootPages
|
|
470
|
+
### Pages.getRootPages()
|
|
490
471
|
|
|
491
472
|
```
|
|
492
473
|
const value = await Pages.getRootPages('en_US')
|
|
@@ -495,49 +476,46 @@ const value = await Pages.getRootPages('en_US')
|
|
|
495
476
|
> 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.
|
|
496
477
|
|
|
497
478
|
Example return:
|
|
479
|
+
|
|
498
480
|
```
|
|
499
481
|
[
|
|
500
482
|
{
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
515
|
-
},
|
|
516
|
-
"isVisible": true,
|
|
517
|
-
"isEditorDisabled": false,
|
|
518
|
-
"products": 0,
|
|
519
|
-
"attributeSetId": 7,
|
|
520
|
-
"forms": [
|
|
521
|
-
null
|
|
522
|
-
],
|
|
523
|
-
"blocks": [
|
|
524
|
-
null
|
|
525
|
-
],
|
|
526
|
-
"templateIdentifier": "my-template",
|
|
527
|
-
"attributeValues": {
|
|
528
|
-
{
|
|
529
|
-
"marker": {
|
|
530
|
-
"value": "",
|
|
531
|
-
"type": "string"
|
|
483
|
+
"id": 1764,
|
|
484
|
+
"parentId": null,
|
|
485
|
+
"config": {
|
|
486
|
+
"rowsPerPage": 1,
|
|
487
|
+
"productsPerRow": 1
|
|
488
|
+
},
|
|
489
|
+
"pageUrl": "string",
|
|
490
|
+
"depth": 3,
|
|
491
|
+
"localizeInfos": {
|
|
492
|
+
"en_US": {
|
|
493
|
+
"title": "Catalog",
|
|
494
|
+
"content": "Content for catalog",
|
|
495
|
+
"menuTitle": "Catalog"
|
|
532
496
|
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
497
|
+
},
|
|
498
|
+
"isVisible": true,
|
|
499
|
+
"products": 0,
|
|
500
|
+
"attributeSetId": 7,
|
|
501
|
+
"isSync": false,
|
|
502
|
+
"templateIdentifier": "my-template",
|
|
503
|
+
"attributeValues": {
|
|
504
|
+
"en_US": {
|
|
505
|
+
"marker": {
|
|
506
|
+
"value": "",
|
|
507
|
+
"type": "string"
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
"position": 192,
|
|
512
|
+
"type": "forNewsPage",
|
|
513
|
+
"childrenCount": 0
|
|
537
514
|
}
|
|
538
515
|
]
|
|
539
516
|
```
|
|
540
|
-
|
|
517
|
+
|
|
518
|
+
### Pages.getCatalogPages()
|
|
541
519
|
|
|
542
520
|
```
|
|
543
521
|
const value = await Pages.getCatalogPages(langCode = 'en_US', limit = 20, offset = 5)
|
|
@@ -550,46 +528,42 @@ Example return:
|
|
|
550
528
|
```
|
|
551
529
|
[
|
|
552
530
|
{
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
}
|
|
567
|
-
},
|
|
568
|
-
"isVisible": true,
|
|
569
|
-
"isEditorDisabled": false,
|
|
570
|
-
"products": 0,
|
|
571
|
-
"attributeSetId": 7,
|
|
572
|
-
"forms": [
|
|
573
|
-
null
|
|
574
|
-
],
|
|
575
|
-
"blocks": [
|
|
576
|
-
null
|
|
577
|
-
],
|
|
578
|
-
"templateIdentifier": "my-template",
|
|
579
|
-
"attributeValues": {
|
|
580
|
-
{
|
|
581
|
-
"marker": {
|
|
582
|
-
"value": "",
|
|
583
|
-
"type": "string"
|
|
531
|
+
"id": 1764,
|
|
532
|
+
"parentId": null,
|
|
533
|
+
"config": {
|
|
534
|
+
"rowsPerPage": 1,
|
|
535
|
+
"productsPerRow": 1
|
|
536
|
+
},
|
|
537
|
+
"pageUrl": "string",
|
|
538
|
+
"depth": 3,
|
|
539
|
+
"localizeInfos": {
|
|
540
|
+
"en_US": {
|
|
541
|
+
"title": "Catalog",
|
|
542
|
+
"content": "Content for catalog",
|
|
543
|
+
"menuTitle": "Catalog"
|
|
584
544
|
}
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
545
|
+
},
|
|
546
|
+
"isVisible": true,
|
|
547
|
+
"products": 0,
|
|
548
|
+
"attributeSetId": 7,
|
|
549
|
+
"isSync": false,
|
|
550
|
+
"templateIdentifier": "my-template",
|
|
551
|
+
"attributeValues": {
|
|
552
|
+
"en_US": {
|
|
553
|
+
"marker": {
|
|
554
|
+
"value": "",
|
|
555
|
+
"type": "string"
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
"position": 192,
|
|
560
|
+
"type": "forNewsPage",
|
|
561
|
+
"childrenCount": 0
|
|
589
562
|
}
|
|
590
563
|
]
|
|
591
564
|
```
|
|
592
|
-
|
|
565
|
+
|
|
566
|
+
### Pages.getPages()
|
|
593
567
|
|
|
594
568
|
```
|
|
595
569
|
const value = await Pages.getPages('en_US')
|
|
@@ -598,49 +572,46 @@ const value = await Pages.getPages('en_US')
|
|
|
598
572
|
> 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.
|
|
599
573
|
|
|
600
574
|
Example return:
|
|
575
|
+
|
|
601
576
|
```
|
|
602
577
|
[
|
|
603
578
|
{
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
}
|
|
618
|
-
},
|
|
619
|
-
"isVisible": true,
|
|
620
|
-
"isEditorDisabled": false,
|
|
621
|
-
"products": 0,
|
|
622
|
-
"attributeSetId": 7,
|
|
623
|
-
"forms": [
|
|
624
|
-
null
|
|
625
|
-
],
|
|
626
|
-
"blocks": [
|
|
627
|
-
null
|
|
628
|
-
],
|
|
629
|
-
"templateIdentifier": "my-template",
|
|
630
|
-
"attributeValues": {
|
|
631
|
-
{
|
|
632
|
-
"marker": {
|
|
633
|
-
"value": "",
|
|
634
|
-
"type": "string"
|
|
579
|
+
"id": 1764,
|
|
580
|
+
"parentId": null,
|
|
581
|
+
"config": {
|
|
582
|
+
"rowsPerPage": 1,
|
|
583
|
+
"productsPerRow": 1
|
|
584
|
+
},
|
|
585
|
+
"pageUrl": "string",
|
|
586
|
+
"depth": 3,
|
|
587
|
+
"localizeInfos": {
|
|
588
|
+
"en_US": {
|
|
589
|
+
"title": "Catalog",
|
|
590
|
+
"content": "Content for catalog",
|
|
591
|
+
"menuTitle": "Catalog"
|
|
635
592
|
}
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
593
|
+
},
|
|
594
|
+
"isVisible": true,
|
|
595
|
+
"products": 0,
|
|
596
|
+
"attributeSetId": 7,
|
|
597
|
+
"isSync": false,
|
|
598
|
+
"templateIdentifier": "my-template",
|
|
599
|
+
"attributeValues": {
|
|
600
|
+
"en_US": {
|
|
601
|
+
"marker": {
|
|
602
|
+
"value": "",
|
|
603
|
+
"type": "string"
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
"position": 192,
|
|
608
|
+
"type": "forNewsPage",
|
|
609
|
+
"childrenCount": 0
|
|
640
610
|
}
|
|
641
611
|
]
|
|
642
612
|
```
|
|
643
|
-
|
|
613
|
+
|
|
614
|
+
### Pages.getPageById()
|
|
644
615
|
|
|
645
616
|
```
|
|
646
617
|
const value = await Pages.getPageById(1, 'en_US')
|
|
@@ -657,42 +628,39 @@ Example return:
|
|
|
657
628
|
"pageUrl": "string",
|
|
658
629
|
"depth": 3,
|
|
659
630
|
"localizeInfos": {
|
|
660
|
-
{
|
|
631
|
+
"en_US": {
|
|
661
632
|
"title": "Catalog",
|
|
662
|
-
"content": "Content
|
|
633
|
+
"content": "Content for catalog",
|
|
663
634
|
"menuTitle": "Catalog"
|
|
664
635
|
}
|
|
665
636
|
},
|
|
666
637
|
"isVisible": true,
|
|
667
|
-
"forms": [
|
|
668
|
-
null
|
|
669
|
-
],
|
|
670
|
-
"blocks": [
|
|
671
|
-
null
|
|
672
|
-
],
|
|
673
638
|
"position": 192,
|
|
674
639
|
"type": "forNewsPage",
|
|
675
640
|
"templateIdentifier": "my-template",
|
|
676
641
|
"attributeSetId": 7,
|
|
677
642
|
"attributeValues": {
|
|
678
|
-
{
|
|
679
|
-
"marker": "
|
|
643
|
+
"en_US": {
|
|
644
|
+
"marker": "description",
|
|
680
645
|
"type": "string",
|
|
681
646
|
"value": ""
|
|
682
647
|
}
|
|
683
648
|
},
|
|
649
|
+
"isSync": false,
|
|
684
650
|
"products": 0
|
|
685
651
|
}
|
|
686
652
|
```
|
|
687
|
-
|
|
653
|
+
|
|
654
|
+
### Pages.getPageByUrl()
|
|
688
655
|
|
|
689
656
|
```
|
|
690
|
-
const value = await Pages.
|
|
657
|
+
const value = await Pages.getPageByUrl('shop', 'en_US')
|
|
691
658
|
```
|
|
692
659
|
|
|
693
660
|
> 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.
|
|
694
661
|
|
|
695
662
|
Example return:
|
|
663
|
+
|
|
696
664
|
```
|
|
697
665
|
{
|
|
698
666
|
"id": 1764,
|
|
@@ -700,97 +668,88 @@ Example return:
|
|
|
700
668
|
"pageUrl": "string",
|
|
701
669
|
"depth": 3,
|
|
702
670
|
"localizeInfos": {
|
|
703
|
-
{
|
|
671
|
+
"en_US": {
|
|
704
672
|
"title": "Catalog",
|
|
705
|
-
"content": "Content
|
|
673
|
+
"content": "Content for catalog",
|
|
706
674
|
"menuTitle": "Catalog"
|
|
707
675
|
}
|
|
708
676
|
},
|
|
709
677
|
"isVisible": true,
|
|
710
|
-
"forms": [
|
|
711
|
-
null
|
|
712
|
-
],
|
|
713
|
-
"blocks": [
|
|
714
|
-
null
|
|
715
|
-
],
|
|
716
678
|
"position": 192,
|
|
717
679
|
"type": "forNewsPage",
|
|
718
680
|
"templateIdentifier": "my-template",
|
|
719
681
|
"attributeSetId": 7,
|
|
720
682
|
"attributeValues": {
|
|
721
|
-
{
|
|
722
|
-
"marker": "
|
|
683
|
+
"en_US": {
|
|
684
|
+
"marker": "description",
|
|
723
685
|
"type": "string",
|
|
724
686
|
"value": ""
|
|
725
687
|
}
|
|
726
688
|
},
|
|
689
|
+
"isSync": false,
|
|
727
690
|
"products": 0
|
|
728
691
|
}
|
|
729
692
|
```
|
|
730
693
|
|
|
731
|
-
### getChildPagesByParentUrl
|
|
694
|
+
### Pages.getChildPagesByParentUrl()
|
|
732
695
|
|
|
733
696
|
```
|
|
734
697
|
const value = await Pages.getChildPagesByParentUrl('shop', 'en_US')
|
|
735
698
|
```
|
|
699
|
+
|
|
736
700
|
> Getting child pages with information about products in the form of an array. Returns all created pages as an array of AdminIndexedPageDto objects or an empty array [] (if there is no data) for the selected parent.
|
|
737
701
|
|
|
738
702
|
Example return:
|
|
703
|
+
|
|
739
704
|
```
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
"
|
|
705
|
+
[
|
|
706
|
+
{
|
|
707
|
+
"id": 1764,
|
|
708
|
+
"parentId": null,
|
|
709
|
+
"pageUrl": "string",
|
|
710
|
+
"depth": 3,
|
|
711
|
+
"localizeInfos": {
|
|
712
|
+
"en_US": {
|
|
713
|
+
"title": "Catalog",
|
|
714
|
+
"content": "Content for catalog",
|
|
715
|
+
"menuTitle": "Catalog"
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
"isVisible": true,
|
|
719
|
+
"position": 192,
|
|
720
|
+
"type": "forNewsPage",
|
|
721
|
+
"templateIdentifier": "my-template",
|
|
722
|
+
"attributeSetId": 7,
|
|
723
|
+
"attributeValues": {
|
|
724
|
+
"en_US": {
|
|
725
|
+
"marker": "description",
|
|
726
|
+
"type": "string",
|
|
727
|
+
"value": ""
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
"isSync": false,
|
|
731
|
+
"products": 0
|
|
754
732
|
}
|
|
755
|
-
|
|
756
|
-
"isVisible": true,
|
|
757
|
-
"products": 0,
|
|
758
|
-
"attributeSetId": 7,
|
|
759
|
-
"isSync": true,
|
|
760
|
-
"isEdit": true,
|
|
761
|
-
"userEditId": 0,
|
|
762
|
-
"position": 0,
|
|
763
|
-
"generalTypeId": 2,
|
|
764
|
-
"templateId": 0,
|
|
765
|
-
"attributesSets": {
|
|
766
|
-
"id7": 7,
|
|
767
|
-
"string_id18": ""
|
|
768
|
-
},
|
|
769
|
-
"childrenCount": 0,
|
|
770
|
-
"showChildren": true,
|
|
771
|
-
"version": 10
|
|
772
|
-
}
|
|
733
|
+
]
|
|
773
734
|
```
|
|
774
735
|
|
|
775
|
-
### getFormsByPageUrl
|
|
736
|
+
### Pages.getFormsByPageUrl()
|
|
737
|
+
|
|
776
738
|
```
|
|
777
739
|
const value = await Pages.getFormsByPageUrl('shop', 'en_US')
|
|
778
740
|
```
|
|
741
|
+
|
|
779
742
|
> Get PositionFormDto objects for a related form by url. Returns an array of PositionFormDto objects.
|
|
780
743
|
|
|
781
744
|
Example return:
|
|
745
|
+
|
|
782
746
|
```
|
|
783
747
|
{
|
|
784
748
|
"id": 1764,
|
|
785
|
-
"updatedDate": "2023-11-12T12:51:45.623Z",
|
|
786
749
|
"version": 10,
|
|
787
|
-
"identifier": "
|
|
788
|
-
"attributesSets": {
|
|
789
|
-
"string_id19": "",
|
|
790
|
-
"string_id18": ""
|
|
791
|
-
},
|
|
750
|
+
"identifier": "catalog",
|
|
792
751
|
"attributeSetId": 0,
|
|
793
|
-
"processingType": "
|
|
752
|
+
"processingType": "email",
|
|
794
753
|
"localizeInfos": {
|
|
795
754
|
"en_US": {
|
|
796
755
|
"title": "My form",
|
|
@@ -804,12 +763,19 @@ Example return:
|
|
|
804
763
|
},
|
|
805
764
|
"processingData": {},
|
|
806
765
|
"position": 0,
|
|
807
|
-
"
|
|
766
|
+
"isSync": false,
|
|
767
|
+
"attributeValues": {
|
|
768
|
+
"en_US": {
|
|
769
|
+
"marker": {
|
|
770
|
+
"value": "",
|
|
771
|
+
"type": "string"
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
808
775
|
}
|
|
809
776
|
```
|
|
810
777
|
|
|
811
|
-
|
|
812
|
-
### getConfigPageByUrl
|
|
778
|
+
### Pages.getConfigPageByUrl()
|
|
813
779
|
|
|
814
780
|
```
|
|
815
781
|
const value = await Pages.getConfigPageByUrl('shop')
|
|
@@ -818,13 +784,15 @@ const value = await Pages.getConfigPageByUrl('shop')
|
|
|
818
784
|
> 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.
|
|
819
785
|
|
|
820
786
|
Example return:
|
|
787
|
+
|
|
821
788
|
```
|
|
822
789
|
{
|
|
823
790
|
"rowsPerPage": 10,
|
|
824
791
|
"productsPerRow": 10
|
|
825
792
|
}
|
|
826
793
|
```
|
|
827
|
-
|
|
794
|
+
|
|
795
|
+
### Pages.searchPage()
|
|
828
796
|
|
|
829
797
|
```
|
|
830
798
|
const value = await Pages.searchPage('cup', 'en_US')
|
|
@@ -833,45 +801,36 @@ const value = await Pages.searchPage('cup', 'en_US')
|
|
|
833
801
|
> 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.
|
|
834
802
|
|
|
835
803
|
Example return:
|
|
804
|
+
|
|
836
805
|
```
|
|
837
806
|
[
|
|
838
807
|
{
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
"
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
"
|
|
855
|
-
"
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
"shortDescTemplateIdentifier": "my-template-short",
|
|
865
|
-
"attributeValues": {
|
|
866
|
-
{
|
|
867
|
-
"marker": {
|
|
868
|
-
"value": "",
|
|
869
|
-
"type": "string"
|
|
870
|
-
}
|
|
808
|
+
"id": 1764,
|
|
809
|
+
"parentId": null,
|
|
810
|
+
"pageUrl": "string",
|
|
811
|
+
"depth": 3,
|
|
812
|
+
"localizeInfos": {
|
|
813
|
+
"en_US": {
|
|
814
|
+
"title": "Catalog",
|
|
815
|
+
"content": "Content for catalog",
|
|
816
|
+
"menuTitle": "Catalog"
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
"isVisible": true,
|
|
820
|
+
"position": 192,
|
|
821
|
+
"type": "forNewsPage",
|
|
822
|
+
"templateIdentifier": "my-template",
|
|
823
|
+
"attributeSetId": 7,
|
|
824
|
+
"attributeValues": {
|
|
825
|
+
"en_US": {
|
|
826
|
+
"marker": "description",
|
|
827
|
+
"type": "string",
|
|
828
|
+
"value": ""
|
|
829
|
+
}
|
|
830
|
+
},
|
|
831
|
+
"isSync": false,
|
|
832
|
+
"products": 0
|
|
871
833
|
}
|
|
872
|
-
},
|
|
873
|
-
"position": 1
|
|
874
|
-
}
|
|
875
834
|
]
|
|
876
835
|
```
|
|
877
836
|
|
|
@@ -881,7 +840,7 @@ Example return:
|
|
|
881
840
|
const { Products } = defineOneEntry('your-url')
|
|
882
841
|
```
|
|
883
842
|
|
|
884
|
-
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.
|
|
843
|
+
>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.
|
|
885
844
|
|
|
886
845
|
Parameters:
|
|
887
846
|
|
|
@@ -938,7 +897,9 @@ Example
|
|
|
938
897
|
}
|
|
939
898
|
}
|
|
940
899
|
```
|
|
900
|
+
|
|
941
901
|
Or
|
|
902
|
+
|
|
942
903
|
```
|
|
943
904
|
const value = await Products.getProducts([ 'en_US', 'it_IT' ])
|
|
944
905
|
|
|
@@ -970,8 +931,7 @@ const value = await Products.getProducts([ 'en_US', 'it_IT' ])
|
|
|
970
931
|
}
|
|
971
932
|
```
|
|
972
933
|
|
|
973
|
-
|
|
974
|
-
### getProducts
|
|
934
|
+
### Products.getProducts()
|
|
975
935
|
|
|
976
936
|
```
|
|
977
937
|
const value = await Products.getProducts('en_US')
|
|
@@ -980,46 +940,42 @@ const value = await Products.getProducts('en_US')
|
|
|
980
940
|
> 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[]).
|
|
981
941
|
|
|
982
942
|
Example return:
|
|
943
|
+
|
|
983
944
|
```
|
|
984
|
-
|
|
985
|
-
"id": 1764,
|
|
986
|
-
"localizeInfos": {
|
|
987
|
-
{
|
|
988
|
-
"title": "Product"
|
|
989
|
-
}
|
|
990
|
-
},
|
|
991
|
-
"isVisible": true,
|
|
992
|
-
"statusId": 1,
|
|
993
|
-
"relatedIds": [
|
|
994
|
-
1,
|
|
995
|
-
2,
|
|
996
|
-
3
|
|
997
|
-
],
|
|
998
|
-
"productPages": [
|
|
999
|
-
{
|
|
1000
|
-
"id": 8997,
|
|
1001
|
-
"pageId": 1176,
|
|
1002
|
-
"productId": 8872
|
|
1003
|
-
}
|
|
1004
|
-
],
|
|
1005
|
-
"attributeSetId": 7,
|
|
1006
|
-
"version": 10,
|
|
1007
|
-
"isSync": 0,
|
|
1008
|
-
"price": 0,
|
|
1009
|
-
"templateIdentifier": "my-template",
|
|
1010
|
-
"shortDescTemplateIdentifier": "my-template-short",
|
|
1011
|
-
"attributeValues": {
|
|
945
|
+
[
|
|
1012
946
|
{
|
|
1013
|
-
"
|
|
1014
|
-
|
|
1015
|
-
"
|
|
1016
|
-
|
|
947
|
+
"id": 1764,
|
|
948
|
+
"localizeInfos": {
|
|
949
|
+
"en_US": {
|
|
950
|
+
"title": "Product"
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
"isVisible": true,
|
|
954
|
+
"statusId": 1,
|
|
955
|
+
"relatedIds": [
|
|
956
|
+
1,
|
|
957
|
+
2,
|
|
958
|
+
3
|
|
959
|
+
],
|
|
960
|
+
"attributeSetId": 7,
|
|
961
|
+
"isSync": true,
|
|
962
|
+
"price": 0,
|
|
963
|
+
"templateIdentifier": "my-template",
|
|
964
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
965
|
+
"attributeValues": {
|
|
966
|
+
"en_US": {
|
|
967
|
+
"marker": {
|
|
968
|
+
"value": "",
|
|
969
|
+
"type": "string"
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
},
|
|
973
|
+
"position": 1
|
|
1017
974
|
}
|
|
1018
|
-
|
|
1019
|
-
"position": 1
|
|
1020
|
-
}
|
|
975
|
+
]
|
|
1021
976
|
```
|
|
1022
|
-
|
|
977
|
+
|
|
978
|
+
### Products.getProductsEmptyPage()
|
|
1023
979
|
|
|
1024
980
|
```
|
|
1025
981
|
const value = await Products.getProductsEmptyPage('en_US')
|
|
@@ -1030,46 +986,40 @@ const value = await Products.getProductsEmptyPage('en_US')
|
|
|
1030
986
|
Example return:
|
|
1031
987
|
|
|
1032
988
|
```
|
|
1033
|
-
|
|
1034
|
-
"id": 1764,
|
|
1035
|
-
"localizeInfos": {
|
|
1036
|
-
{
|
|
1037
|
-
"title": "Product"
|
|
1038
|
-
}
|
|
1039
|
-
},
|
|
1040
|
-
"isVisible": true,
|
|
1041
|
-
"statusId": 1,
|
|
1042
|
-
"relatedIds": [
|
|
1043
|
-
1,
|
|
1044
|
-
2,
|
|
1045
|
-
3
|
|
1046
|
-
],
|
|
1047
|
-
"productPages": [
|
|
1048
|
-
{
|
|
1049
|
-
"id": 8997,
|
|
1050
|
-
"pageId": 1176,
|
|
1051
|
-
"productId": 8872
|
|
1052
|
-
}
|
|
1053
|
-
],
|
|
1054
|
-
"attributeSetId": 7,
|
|
1055
|
-
"version": 10,
|
|
1056
|
-
"isSync": 0,
|
|
1057
|
-
"price": 0,
|
|
1058
|
-
"templateIdentifier": "my-template",
|
|
1059
|
-
"shortDescTemplateIdentifier": "my-template-short",
|
|
1060
|
-
"attributeValues": {
|
|
989
|
+
[
|
|
1061
990
|
{
|
|
1062
|
-
"
|
|
1063
|
-
|
|
1064
|
-
"
|
|
1065
|
-
|
|
991
|
+
"id": 1764,
|
|
992
|
+
"localizeInfos": {
|
|
993
|
+
"en_US": {
|
|
994
|
+
"title": "Product"
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
"isVisible": true,
|
|
998
|
+
"statusId": 1,
|
|
999
|
+
"relatedIds": [
|
|
1000
|
+
1,
|
|
1001
|
+
2,
|
|
1002
|
+
3
|
|
1003
|
+
],
|
|
1004
|
+
"attributeSetId": 7,
|
|
1005
|
+
"isSync": true,
|
|
1006
|
+
"price": 0,
|
|
1007
|
+
"templateIdentifier": "my-template",
|
|
1008
|
+
"shortDescTemplateIdentifier": "my-template-short",
|
|
1009
|
+
"attributeValues": {
|
|
1010
|
+
"en_US": {
|
|
1011
|
+
"marker": {
|
|
1012
|
+
"value": "",
|
|
1013
|
+
"type": "string"
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
"position": 1
|
|
1066
1018
|
}
|
|
1067
|
-
|
|
1068
|
-
"position": 1
|
|
1069
|
-
}
|
|
1019
|
+
]
|
|
1070
1020
|
```
|
|
1071
1021
|
|
|
1072
|
-
### getProductsPageById
|
|
1022
|
+
### Products.getProductsPageById()
|
|
1073
1023
|
|
|
1074
1024
|
```
|
|
1075
1025
|
const value = await Products.getProductsPageById(1, 'en_US')
|
|
@@ -1078,6 +1028,7 @@ const value = await Products.getProductsPageById(1, 'en_US')
|
|
|
1078
1028
|
> 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.
|
|
1079
1029
|
|
|
1080
1030
|
Example return:
|
|
1031
|
+
|
|
1081
1032
|
```
|
|
1082
1033
|
{
|
|
1083
1034
|
"id": 1764,
|
|
@@ -1118,7 +1069,7 @@ Example return:
|
|
|
1118
1069
|
}
|
|
1119
1070
|
```
|
|
1120
1071
|
|
|
1121
|
-
### getProductsPageByUrl
|
|
1072
|
+
### Products.getProductsPageByUrl()
|
|
1122
1073
|
|
|
1123
1074
|
```
|
|
1124
1075
|
const value = await Products.getProductsPageByUrl('cup', 'en_US')
|
|
@@ -1127,6 +1078,7 @@ const value = await Products.getProductsPageByUrl('cup', 'en_US')
|
|
|
1127
1078
|
> 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.
|
|
1128
1079
|
|
|
1129
1080
|
Example return:
|
|
1081
|
+
|
|
1130
1082
|
```
|
|
1131
1083
|
{
|
|
1132
1084
|
"id": 1764,
|
|
@@ -1167,7 +1119,7 @@ Example return:
|
|
|
1167
1119
|
}
|
|
1168
1120
|
```
|
|
1169
1121
|
|
|
1170
|
-
### getRelatedProductsById
|
|
1122
|
+
### Products.getRelatedProductsById()
|
|
1171
1123
|
|
|
1172
1124
|
```
|
|
1173
1125
|
const value = await Products.getRelatedProductsById(1, ''en_US'', {limit:20, offset:1})
|
|
@@ -1176,11 +1128,12 @@ const value = await Products.getRelatedProductsById(1, ''en_US'', {limit:20, off
|
|
|
1176
1128
|
> 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.
|
|
1177
1129
|
|
|
1178
1130
|
Example return:
|
|
1131
|
+
|
|
1179
1132
|
```
|
|
1180
1133
|
{
|
|
1181
1134
|
"id": 1764,
|
|
1182
1135
|
"localizeInfos": {
|
|
1183
|
-
{
|
|
1136
|
+
"en_US": {
|
|
1184
1137
|
"title": "Product"
|
|
1185
1138
|
}
|
|
1186
1139
|
},
|
|
@@ -1191,21 +1144,13 @@ Example return:
|
|
|
1191
1144
|
2,
|
|
1192
1145
|
3
|
|
1193
1146
|
],
|
|
1194
|
-
"productPages": [
|
|
1195
|
-
{
|
|
1196
|
-
"id": 8997,
|
|
1197
|
-
"pageId": 1176,
|
|
1198
|
-
"productId": 8872
|
|
1199
|
-
}
|
|
1200
|
-
],
|
|
1201
1147
|
"attributeSetId": 7,
|
|
1202
|
-
"
|
|
1203
|
-
"isSync": 0,
|
|
1148
|
+
"isSync": true,
|
|
1204
1149
|
"price": 0,
|
|
1205
1150
|
"templateIdentifier": "my-template",
|
|
1206
1151
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
1207
1152
|
"attributeValues": {
|
|
1208
|
-
{
|
|
1153
|
+
"en_US": {
|
|
1209
1154
|
"marker": {
|
|
1210
1155
|
"value": "",
|
|
1211
1156
|
"type": "string"
|
|
@@ -1215,7 +1160,8 @@ Example return:
|
|
|
1215
1160
|
"position": 1
|
|
1216
1161
|
}
|
|
1217
1162
|
```
|
|
1218
|
-
|
|
1163
|
+
|
|
1164
|
+
### Products.getProductById()
|
|
1219
1165
|
|
|
1220
1166
|
```
|
|
1221
1167
|
const value = await Products.getProductById(1, 'en_US')
|
|
@@ -1224,11 +1170,12 @@ const value = await Products.getProductById(1, 'en_US')
|
|
|
1224
1170
|
> 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.
|
|
1225
1171
|
|
|
1226
1172
|
Example return:
|
|
1173
|
+
|
|
1227
1174
|
```
|
|
1228
1175
|
{
|
|
1229
1176
|
"id": 1764,
|
|
1230
1177
|
"localizeInfos": {
|
|
1231
|
-
{
|
|
1178
|
+
"en_US": {
|
|
1232
1179
|
"title": "Product"
|
|
1233
1180
|
}
|
|
1234
1181
|
},
|
|
@@ -1239,21 +1186,13 @@ Example return:
|
|
|
1239
1186
|
2,
|
|
1240
1187
|
3
|
|
1241
1188
|
],
|
|
1242
|
-
"productPages": [
|
|
1243
|
-
{
|
|
1244
|
-
"id": 8997,
|
|
1245
|
-
"pageId": 1176,
|
|
1246
|
-
"productId": 8872
|
|
1247
|
-
}
|
|
1248
|
-
],
|
|
1249
1189
|
"attributeSetId": 7,
|
|
1250
|
-
"
|
|
1251
|
-
"isSync": 0,
|
|
1190
|
+
"isSync": true,
|
|
1252
1191
|
"price": 0,
|
|
1253
1192
|
"templateIdentifier": "my-template",
|
|
1254
1193
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
1255
1194
|
"attributeValues": {
|
|
1256
|
-
{
|
|
1195
|
+
"en_US": {
|
|
1257
1196
|
"marker": {
|
|
1258
1197
|
"value": "",
|
|
1259
1198
|
"type": "string"
|
|
@@ -1262,14 +1201,17 @@ Example return:
|
|
|
1262
1201
|
},
|
|
1263
1202
|
"position": 1
|
|
1264
1203
|
}
|
|
1204
|
+
|
|
1265
1205
|
```
|
|
1266
|
-
|
|
1206
|
+
|
|
1207
|
+
### Products.filterProduct()
|
|
1267
1208
|
|
|
1268
1209
|
```
|
|
1269
1210
|
const value = await Products.filterProduct({conditionValue:1})
|
|
1270
1211
|
```
|
|
1271
1212
|
|
|
1272
1213
|
Example body:
|
|
1214
|
+
|
|
1273
1215
|
```
|
|
1274
1216
|
[
|
|
1275
1217
|
{
|
|
@@ -1290,6 +1232,7 @@ Example body:
|
|
|
1290
1232
|
> 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}.
|
|
1291
1233
|
|
|
1292
1234
|
Example return:
|
|
1235
|
+
|
|
1293
1236
|
```
|
|
1294
1237
|
{
|
|
1295
1238
|
"id": 1764,
|
|
@@ -1329,7 +1272,8 @@ Example return:
|
|
|
1329
1272
|
"position": 1
|
|
1330
1273
|
}
|
|
1331
1274
|
```
|
|
1332
|
-
|
|
1275
|
+
|
|
1276
|
+
### Products.searchProduct()
|
|
1333
1277
|
|
|
1334
1278
|
```
|
|
1335
1279
|
const value = await Products.searchProduct('cup', 'en_US')
|
|
@@ -1338,6 +1282,7 @@ const value = await Products.searchProduct('cup', 'en_US')
|
|
|
1338
1282
|
> 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.
|
|
1339
1283
|
|
|
1340
1284
|
Example return:
|
|
1285
|
+
|
|
1341
1286
|
```
|
|
1342
1287
|
[
|
|
1343
1288
|
{
|
|
@@ -1386,7 +1331,7 @@ Example return:
|
|
|
1386
1331
|
const { ProductStatuses } = defineOneEntry('your-url');
|
|
1387
1332
|
```
|
|
1388
1333
|
|
|
1389
|
-
### getProductStatuses
|
|
1334
|
+
### ProductStatuses.getProductStatuses()
|
|
1390
1335
|
|
|
1391
1336
|
```
|
|
1392
1337
|
const value = await ProductStatuses.getProductStatuses()
|
|
@@ -1395,22 +1340,24 @@ const value = await ProductStatuses.getProductStatuses()
|
|
|
1395
1340
|
> This method searches for all product status objects from the API. It returns a Promise that resolves to an array of product status objects.
|
|
1396
1341
|
|
|
1397
1342
|
Example return:
|
|
1343
|
+
|
|
1398
1344
|
```
|
|
1399
1345
|
[
|
|
1400
1346
|
{
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1347
|
+
"id": 1764,
|
|
1348
|
+
"updatedDate": "2023-11-20T22:14:19.438Z",
|
|
1349
|
+
"version": 10,
|
|
1350
|
+
"identifier": "catalog",
|
|
1351
|
+
"localizeInfos": {
|
|
1352
|
+
"en_US": {
|
|
1353
|
+
"title": "Status 1"
|
|
1354
|
+
}
|
|
1408
1355
|
}
|
|
1409
|
-
}
|
|
1410
1356
|
}
|
|
1411
1357
|
]
|
|
1412
1358
|
```
|
|
1413
|
-
|
|
1359
|
+
|
|
1360
|
+
### ProductStatuses.getProductStatusesById()
|
|
1414
1361
|
|
|
1415
1362
|
```
|
|
1416
1363
|
const value = await ProductStatuses.getProductStatusesById(1)
|
|
@@ -1419,6 +1366,7 @@ const value = await ProductStatuses.getProductStatusesById(1)
|
|
|
1419
1366
|
> 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.
|
|
1420
1367
|
|
|
1421
1368
|
Example return:
|
|
1369
|
+
|
|
1422
1370
|
```
|
|
1423
1371
|
{
|
|
1424
1372
|
"id": 1764,
|
|
@@ -1432,7 +1380,8 @@ Example return:
|
|
|
1432
1380
|
}
|
|
1433
1381
|
}
|
|
1434
1382
|
```
|
|
1435
|
-
|
|
1383
|
+
|
|
1384
|
+
### ProductStatuses.getProductsByStatusMarker()
|
|
1436
1385
|
|
|
1437
1386
|
```
|
|
1438
1387
|
const value = await ProductStatuses.getProductsByStatusMarker('marker')
|
|
@@ -1441,6 +1390,7 @@ const value = await ProductStatuses.getProductsByStatusMarker('marker')
|
|
|
1441
1390
|
> 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.
|
|
1442
1391
|
|
|
1443
1392
|
Example return:
|
|
1393
|
+
|
|
1444
1394
|
```
|
|
1445
1395
|
{
|
|
1446
1396
|
"id": 1764,
|
|
@@ -1454,7 +1404,8 @@ Example return:
|
|
|
1454
1404
|
}
|
|
1455
1405
|
}
|
|
1456
1406
|
```
|
|
1457
|
-
|
|
1407
|
+
|
|
1408
|
+
### ProductStatuses.validateMarker()
|
|
1458
1409
|
|
|
1459
1410
|
```
|
|
1460
1411
|
const value = await ProductStatuses.validateMarker('marker')
|
|
@@ -1463,16 +1414,41 @@ const value = await ProductStatuses.validateMarker('marker')
|
|
|
1463
1414
|
> 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.
|
|
1464
1415
|
|
|
1465
1416
|
Example return:
|
|
1417
|
+
|
|
1466
1418
|
```
|
|
1467
1419
|
true
|
|
1468
1420
|
```
|
|
1421
|
+
|
|
1422
|
+
## System
|
|
1423
|
+
|
|
1424
|
+
```
|
|
1425
|
+
const { System } = defineOneEntry('your-url')
|
|
1426
|
+
```
|
|
1427
|
+
|
|
1428
|
+
### System.test404()
|
|
1429
|
+
|
|
1430
|
+
```
|
|
1431
|
+
const value = await System.test404()
|
|
1432
|
+
```
|
|
1433
|
+
|
|
1434
|
+
> This method allows you to redirect to the error page.
|
|
1435
|
+
|
|
1436
|
+
### System.test500()
|
|
1437
|
+
|
|
1438
|
+
```
|
|
1439
|
+
const value = await System.test500()
|
|
1440
|
+
```
|
|
1441
|
+
|
|
1442
|
+
> This method allows you to redirect to the error page.
|
|
1443
|
+
|
|
1444
|
+
|
|
1469
1445
|
## Templates
|
|
1470
1446
|
|
|
1471
1447
|
```
|
|
1472
1448
|
const { Templates } = defineOneEntry('your-url')
|
|
1473
1449
|
```
|
|
1474
1450
|
|
|
1475
|
-
### getAllTemplates
|
|
1451
|
+
### Templates.getAllTemplates()
|
|
1476
1452
|
|
|
1477
1453
|
```
|
|
1478
1454
|
const value = await Templates.getAllTemplates()
|
|
@@ -1481,41 +1457,41 @@ const value = await Templates.getAllTemplates()
|
|
|
1481
1457
|
> 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.
|
|
1482
1458
|
|
|
1483
1459
|
Example return:
|
|
1460
|
+
|
|
1484
1461
|
```
|
|
1485
1462
|
[
|
|
1486
1463
|
{
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
"en_US": {
|
|
1500
|
-
"marker": {
|
|
1501
|
-
"value": "",
|
|
1502
|
-
"type": "string"
|
|
1464
|
+
"id": 1764,
|
|
1465
|
+
"updatedDate": "2023-11-20T22:16:17.531Z",
|
|
1466
|
+
"version": 10,
|
|
1467
|
+
"identifier": "marker",
|
|
1468
|
+
"generalType": {
|
|
1469
|
+
"id": 4,
|
|
1470
|
+
"type": "forCatalogPages"
|
|
1471
|
+
},
|
|
1472
|
+
"generalTypeId": 4,
|
|
1473
|
+
"localizeInfos": {
|
|
1474
|
+
"en_US": {
|
|
1475
|
+
"title": "Page template"
|
|
1503
1476
|
}
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
|
-
|
|
1477
|
+
},
|
|
1478
|
+
"position": 0,
|
|
1479
|
+
"positionId": 12,
|
|
1480
|
+
"generalTypeName": "forProductPreview"
|
|
1507
1481
|
}
|
|
1508
1482
|
]
|
|
1509
1483
|
```
|
|
1510
|
-
|
|
1484
|
+
|
|
1485
|
+
### Templates.getTemplateByType()
|
|
1511
1486
|
|
|
1512
1487
|
```
|
|
1513
|
-
const value = await Templates.
|
|
1488
|
+
const value = await Templates.getTemplateByType('forCatalogProducts')
|
|
1514
1489
|
```
|
|
1515
1490
|
|
|
1516
1491
|
> 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.
|
|
1517
1492
|
|
|
1518
1493
|
Example return:
|
|
1494
|
+
|
|
1519
1495
|
```
|
|
1520
1496
|
[
|
|
1521
1497
|
{
|
|
@@ -1558,34 +1534,47 @@ const value = await TemplatePreviews.getTemplatesPreview()
|
|
|
1558
1534
|
> This method retrieves all template objects from the API. It returns a Promise that resolves to an array of TemplatePreviewsEntity template objects.
|
|
1559
1535
|
|
|
1560
1536
|
Example return:
|
|
1537
|
+
|
|
1561
1538
|
```
|
|
1562
1539
|
[
|
|
1563
1540
|
{
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1541
|
+
"id": 1764,
|
|
1542
|
+
"updatedDate": "2023-11-20T22:18:25.344Z",
|
|
1543
|
+
"version": 10,
|
|
1544
|
+
"identifier": "marker",
|
|
1545
|
+
"proportion": {
|
|
1546
|
+
"horizontal": {
|
|
1547
|
+
"height": 200,
|
|
1548
|
+
"weight": 10,
|
|
1549
|
+
"marker": "horizontal",
|
|
1550
|
+
"title": "Horizontal",
|
|
1551
|
+
"alignmentType": "left"
|
|
1552
|
+
},
|
|
1553
|
+
"vertical": {
|
|
1554
|
+
"height": 10,
|
|
1555
|
+
"weight": 200,
|
|
1556
|
+
"marker": "vertical",
|
|
1557
|
+
"title": "Vertical",
|
|
1558
|
+
"alignmentType": "left"
|
|
1559
|
+
},
|
|
1560
|
+
"square": {
|
|
1561
|
+
"marker": "square",
|
|
1562
|
+
"title": "Square",
|
|
1563
|
+
"slide": 3,
|
|
1564
|
+
"alignmentType": "center"
|
|
1565
|
+
}
|
|
1566
|
+
},
|
|
1567
|
+
"localizeInfos": {
|
|
1568
|
+
"en_US": {
|
|
1569
|
+
"title": "Page Template"
|
|
1570
|
+
}
|
|
1571
|
+
},
|
|
1572
|
+
"position": 0
|
|
1585
1573
|
}
|
|
1586
1574
|
]
|
|
1587
1575
|
```
|
|
1588
|
-
|
|
1576
|
+
|
|
1577
|
+
### TemplatePreviews.getTemplatesPreviewById()
|
|
1589
1578
|
|
|
1590
1579
|
```
|
|
1591
1580
|
const value = await TemplatePreviews.getTemplatesPreviewById(1)
|
|
@@ -1596,31 +1585,44 @@ const value = await TemplatePreviews.getTemplatesPreviewById(1)
|
|
|
1596
1585
|
Example return:
|
|
1597
1586
|
|
|
1598
1587
|
```
|
|
1599
|
-
{
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1588
|
+
{
|
|
1589
|
+
"id": 1764,
|
|
1590
|
+
"updatedDate": "2023-11-20T22:18:25.344Z",
|
|
1591
|
+
"version": 10,
|
|
1592
|
+
"identifier": "marker",
|
|
1593
|
+
"proportion": {
|
|
1594
|
+
"horizontal": {
|
|
1595
|
+
"height": 200,
|
|
1596
|
+
"weight": 10,
|
|
1597
|
+
"marker": "horizontal",
|
|
1598
|
+
"title": "Horizontal",
|
|
1599
|
+
"alignmentType": "left"
|
|
1600
|
+
},
|
|
1601
|
+
"vertical": {
|
|
1602
|
+
"height": 10,
|
|
1603
|
+
"weight": 200,
|
|
1604
|
+
"marker": "vertical",
|
|
1605
|
+
"title": "Vertical",
|
|
1606
|
+
"alignmentType": "left"
|
|
1607
|
+
},
|
|
1608
|
+
"square": {
|
|
1609
|
+
"marker": "square",
|
|
1610
|
+
"title": "Square",
|
|
1611
|
+
"slide": 3,
|
|
1612
|
+
"alignmentType": "center"
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
"localizeInfos": {
|
|
1616
|
+
"en_US": {
|
|
1617
|
+
"title": "Page Template"
|
|
1618
|
+
}
|
|
1619
|
+
},
|
|
1620
|
+
"position": 0
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1622
1623
|
```
|
|
1623
|
-
|
|
1624
|
+
|
|
1625
|
+
### TemplatePreviews.getTemplatesPreviewByMarker()
|
|
1624
1626
|
|
|
1625
1627
|
```
|
|
1626
1628
|
const value = await TemplatePreviews.getTemplatesPreviewByMarker('marker')
|
|
@@ -1633,25 +1635,36 @@ Example return:
|
|
|
1633
1635
|
```
|
|
1634
1636
|
{
|
|
1635
1637
|
"id": 1764,
|
|
1636
|
-
"updatedDate": "2023-
|
|
1638
|
+
"updatedDate": "2023-11-20T22:18:25.344Z",
|
|
1637
1639
|
"version": 10,
|
|
1638
|
-
"identifier": "
|
|
1639
|
-
"
|
|
1640
|
-
"
|
|
1641
|
-
|
|
1640
|
+
"identifier": "marker",
|
|
1641
|
+
"proportion": {
|
|
1642
|
+
"horizontal": {
|
|
1643
|
+
"height": 200,
|
|
1644
|
+
"weight": 10,
|
|
1645
|
+
"marker": "horizontal",
|
|
1646
|
+
"title": "Horizontal",
|
|
1647
|
+
"alignmentType": "left"
|
|
1648
|
+
},
|
|
1649
|
+
"vertical": {
|
|
1650
|
+
"height": 10,
|
|
1651
|
+
"weight": 200,
|
|
1652
|
+
"marker": "vertical",
|
|
1653
|
+
"title": "Vertical",
|
|
1654
|
+
"alignmentType": "left"
|
|
1655
|
+
},
|
|
1656
|
+
"square": {
|
|
1657
|
+
"marker": "square",
|
|
1658
|
+
"title": "Square",
|
|
1659
|
+
"slide": 3,
|
|
1660
|
+
"alignmentType": "center"
|
|
1661
|
+
}
|
|
1642
1662
|
},
|
|
1643
|
-
"attributeSetId": 0,
|
|
1644
1663
|
"localizeInfos": {
|
|
1645
1664
|
"en_US": {
|
|
1646
|
-
"title": "Page
|
|
1665
|
+
"title": "Page Template"
|
|
1647
1666
|
}
|
|
1648
1667
|
},
|
|
1649
|
-
"position":
|
|
1650
|
-
"id": 12,
|
|
1651
|
-
"objectId": 1,
|
|
1652
|
-
"objectType": "module",
|
|
1653
|
-
"position": 1
|
|
1654
|
-
},
|
|
1655
|
-
"positionId": 1
|
|
1668
|
+
"position": 0
|
|
1656
1669
|
}
|
|
1657
1670
|
```
|