oneentry 1.0.33 → 1.0.35

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 CHANGED
@@ -21,12 +21,13 @@ npm install oneentry
21
21
  # Usage
22
22
 
23
23
  To use the OneEntry Headless CMS SDK in your project, import the defineOneEntry function:
24
- ```
24
+ ```js
25
25
  import { defineOneEntry } from 'oneentry'
26
26
 
27
27
  const {
28
28
  Admins,
29
- Blocks
29
+ AttributesSets,
30
+ Blocks,
30
31
  Forms,
31
32
  FormData,
32
33
  FileUploading,
@@ -44,34 +45,51 @@ const {
44
45
 
45
46
  Or
46
47
 
47
- ```
48
+ ```js
48
49
  const api = defineOneEntry('your-url')
49
50
  ```
50
51
 
51
52
  >If you chose token protection to ensure connection security, just pass your token to the function as an optional parameter.
52
53
 
53
- ```
54
+ You can get a token as follows
55
+ 1) Log in to your personal account
56
+ 2) Go to the "Projects" tab and select a project
57
+ 3) Go to the "Access" tab
58
+ 4) Set the switch to "Security API Token"
59
+ 5) Log in to the project, go to the settings section and open the token tab
60
+ 6) Get and copy the token of your project
61
+
62
+ [Learn more about security](https://oneentry.ru/instructions.html#START)
63
+
64
+
65
+ ```js
54
66
  const api = defineOneEntry('your-url', 'your-token')
55
67
  ```
56
68
 
69
+
70
+
57
71
  ## Admins
58
72
 
59
- ```
73
+
74
+ ```js
60
75
  const { Admins } = defineOneEntry('your-url')
61
76
  ```
62
77
 
63
78
  ### Admins.getAdminsInfo(langCode, offset, limit)
64
79
 
65
- ```
80
+
81
+ ```js
66
82
  const value = await Admins.getAdminsInfo('en_US', 0, 30)
67
83
  ```
68
84
 
69
85
 
70
86
  > This method retrieves all user objects of type admin from the API. It returns a Promise that resolves to an array of AdminEntity objects.
71
87
 
72
- Example return:
88
+ <details>
73
89
 
74
- ```
90
+ <summary>Example return:</summary>
91
+
92
+ ```json
75
93
  [
76
94
  {
77
95
  "id": 1764,
@@ -90,73 +108,143 @@ Example return:
90
108
  }
91
109
  ]
92
110
  ```
111
+ </details>
93
112
 
94
- ## Blocks
113
+ ---
95
114
 
96
- const { Blocks } = defineOneEntry('your-url');
97
115
 
98
- ### Blocks.getBlocks(langCode, offset, limit)
99
116
 
100
- ```
101
- const value = await Blocks.getBlocks('en_US', 0, 30)
117
+ ## AttributesSets
118
+
119
+ ```js
120
+ const { AttributesSets } = defineOneEntry('your-url');
102
121
  ```
103
122
 
104
- > This method return all blocks objects.
123
+ ### AttributesSets.getAttributesByMarker(marker, langCode)
105
124
 
106
- Example return:
125
+ ```js
126
+ const value = await AttributesSets.getAttributesByMarker('my-marker', 'en_US')
107
127
  ```
128
+
129
+ > This method return all attributes with data from the attribute sets.
130
+
131
+ <details>
132
+
133
+ <summary>Example return:</summary>
134
+
135
+
136
+ ```json
108
137
  [
109
138
  {
110
- "id": 1764,
111
- "attributeSetId": 7,
112
- "localizeInfos": {
113
- "en_US": {
114
- "title": "My block"
139
+ "type": "list",
140
+ "marker": "list1",
141
+ "position": 192,
142
+ "validators": {
143
+ "requiredValidator": {
144
+ "strict": true
145
+ },
146
+ "defaultValueValidator": {
147
+ "fieldDefaultValue": 11
115
148
  }
116
149
  },
117
- "customSettings": {
118
- "sliderDelay": 0,
119
- "sliderDelayType": "",
120
- "productQuantity": 4,
121
- "productSortType": "By_ID",
122
- "productSortOrder": "Descending",
123
- "productCountElementsPerRow": 10,
124
- "similarProductRules": [
125
- {
126
- "property": "Descending",
127
- "includes": "",
128
- "keywords": "",
129
- "strict": ""
130
- }
131
- ]
150
+ "localizeInfos": {
151
+ "title": "My attribute"
132
152
  },
133
- "version": 10,
134
- "identifier": "catalog",
135
- "position": 192,
136
- "attributeValues": {
137
- "en_US": {
138
- "marker": {
139
- "value": "",
140
- "type": "string"
141
- }
153
+ "listTitles": [
154
+ {
155
+ "title": "red",
156
+ "value": 1,
157
+ "position": 1,
158
+ "extendedValue": null,
159
+ "extendedValueType": null
160
+ },
161
+ {
162
+ "title": "yellow",
163
+ "value": 2,
164
+ "position": 2,
165
+ "extendedValue": null,
166
+ "extendedValueType": null
142
167
  }
143
- },
144
- "type": "forNewsPage",
145
- "templateIdentifier": null
168
+ ]
146
169
  }
147
170
  ]
148
171
  ```
172
+ </details>
149
173
 
150
- ### Blocks.getBlockByMarker(marker, langCode)
151
174
 
175
+
176
+ ### AttributesSets.getSingleAttributeByMarkerSet(attributeMarker, setMarker, langCode)
177
+
178
+ ```js
179
+ const value = await AttributesSets.getSingleAttributeByMarkerSet('list1', 'list1', 'en_US')
180
+ ```
181
+
182
+ > This method return a single attribute with data from the attribute sets.
183
+
184
+ <details>
185
+
186
+ <summary>Example return:</summary>
187
+
188
+ ```json
189
+ {
190
+ "type": "list",
191
+ "marker": "list1",
192
+ "position": 192,
193
+ "validators": {
194
+ "requiredValidator": {
195
+ "strict": true
196
+ },
197
+ "defaultValueValidator": {
198
+ "fieldDefaultValue": 11
199
+ }
200
+ },
201
+ "localizeInfos": {
202
+ "title": "My attribute"
203
+ },
204
+ "listTitles": [
205
+ {
206
+ "title": "red",
207
+ "value": 1,
208
+ "position": 1,
209
+ "extendedValue": null,
210
+ "extendedValueType": null
211
+ },
212
+ {
213
+ "title": "yellow",
214
+ "value": 2,
215
+ "position": 2,
216
+ "extendedValue": null,
217
+ "extendedValueType": null
218
+ }
219
+ ]
220
+ }
221
+ ```
222
+ </details>
223
+
224
+ ---
225
+
226
+
227
+
228
+
229
+ ## Blocks
230
+
231
+ ```js
232
+ const { Blocks } = defineOneEntry('your-url');
152
233
  ```
234
+
235
+ ### Blocks.getBlockByMarker(marker, langCode)
236
+
237
+ ```js
153
238
  const value = await Blocks.getBlockByMarker('my-marker', 'en_US')
154
239
  ```
155
240
 
156
241
  > This method return one blocks object by marker.
157
242
 
158
- Example return:
159
- ```
243
+ <details>
244
+
245
+ <summary>Example return:</summary>
246
+
247
+ ```json
160
248
  {
161
249
  "id": 1764,
162
250
  "attributeSetId": 7,
@@ -196,6 +284,13 @@ Example return:
196
284
  "templateIdentifier": null
197
285
  }
198
286
  ```
287
+ </details>
288
+
289
+ ---
290
+
291
+
292
+
293
+
199
294
 
200
295
  ## FileUploading
201
296
 
@@ -203,7 +298,7 @@ const { FileUploading } = defineOneEntry('your-url');
203
298
 
204
299
  ### FileUploading.upload(data, fileQuery)
205
300
 
206
- ```
301
+ ```js
207
302
  const query = {
208
303
  type:"page",
209
304
  entity:"editor",
@@ -219,9 +314,11 @@ const value = await FileUploading.upload(data, query)
219
314
  > This method uploads a file to a cloud file storage. Pass to the date the value obtained from input type "file".
220
315
  > Data is file object (or array), learn more - [File Object](https://developer.mozilla.org/en-US/docs/Web/API/File)
221
316
 
222
- Example return:
317
+ <details>
223
318
 
224
- ```
319
+ <summary>Example return:</summary>
320
+
321
+ ```json
225
322
  [
226
323
  {
227
324
  "filename": "string",
@@ -230,10 +327,12 @@ Example return:
230
327
  }
231
328
  ]
232
329
  ```
330
+ </details>
331
+
233
332
 
234
333
  ### FileUploading.delete(filename, fileQuery)
235
334
 
236
- ```
335
+ ```js
237
336
  const query = {
238
337
  type:"page",
239
338
  entity:"editor",
@@ -247,19 +346,28 @@ const value = await FileUploading.delete("file.png", query)
247
346
  > This void method delete a file from the cloud file storage.
248
347
 
249
348
  ### FileUploading.getFile(id, type, entity, filename)
250
- ```
349
+
350
+ ```js
251
351
  const value = await FileUploading.getFile(123, 'page', 'editor', 'file.png')
252
352
  ```
253
353
 
254
354
  > This method return file object by parameters.
255
355
 
256
- Example return:
356
+ <details>
257
357
 
258
- ```
358
+ <summary>Example return:</summary>
359
+
360
+ ```json
259
361
  {
260
- "file": File,
362
+ "file": "string"
261
363
  }
262
364
  ```
365
+ </details>
366
+
367
+ ---
368
+
369
+
370
+
263
371
 
264
372
  ## Forms
265
373
 
@@ -267,15 +375,17 @@ const { Forms } = defineOneEntry('your-url');
267
375
 
268
376
  ### Forms.getAllForms(langCode, offset, limit)
269
377
 
270
- ```
378
+ ```js
271
379
  const value = await Forms.getAllForms('en_US', 0, 30)
272
380
  ```
273
381
 
274
382
  > This method retrieves all form objects from the API. It returns a Promise that resolves to an array of FormEntity objects.
275
383
 
276
- Example return:
384
+ <details>
277
385
 
278
- ```
386
+ <summary>Example return:</summary>
387
+
388
+ ```json
279
389
  [
280
390
  {
281
391
  "id": 1764,
@@ -326,18 +436,23 @@ Example return:
326
436
  }
327
437
  ]
328
438
  ```
439
+ </details>
440
+
441
+
329
442
 
330
443
  ### Forms.getFormByMarker(marker, langCode)
331
444
 
332
- ```
445
+ ```js
333
446
  const value = await Forms.getFormByMarker('My form', 'en_US')
334
447
  ```
335
448
 
336
449
  > 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.
337
450
 
338
- Example return:
451
+ <details>
339
452
 
340
- ```
453
+ <summary>Example return:</summary>
454
+
455
+ ```json
341
456
  {
342
457
  "id": 1764,
343
458
  "attributeSetId": 0,
@@ -386,6 +501,11 @@ Example return:
386
501
  ]
387
502
  }
388
503
  ```
504
+ </details>
505
+
506
+ ---
507
+
508
+
389
509
 
390
510
  ## FormData
391
511
 
@@ -393,15 +513,17 @@ const { FormData } = defineOneEntry('your-url');
393
513
 
394
514
  ### FormData.postFormsData(data)
395
515
 
396
- ```
516
+ ```js
397
517
  const value = await FormData.postFormsData(data)
398
518
  ```
399
519
 
400
520
  > This method retrieves all form data objects from the API. It returns a Promise that resolves to an array of objects of type CreateFormDataDto.
401
521
 
402
- Example return:
522
+ <details>
403
523
 
404
- ```
524
+ <summary>Example return:</summary>
525
+
526
+ ```json
405
527
  {
406
528
  "id": 1764,
407
529
  "formIdentifier": "my-form",
@@ -416,18 +538,22 @@ Example return:
416
538
  }
417
539
  }
418
540
  ```
541
+ </details>
542
+
419
543
 
420
544
  ### FormData.getFormsData(langCode, offset, limit)
421
545
 
422
- ```
546
+ ```js
423
547
  const value = await FormData.getFormsData('en_US', 0, 30)
424
548
  ```
425
549
 
426
550
  > 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.
427
551
 
428
- Example return:
552
+ <details>
429
553
 
430
- ```
554
+ <summary>Example return:</summary>
555
+
556
+ ```json
431
557
  {
432
558
  "id": 1764,
433
559
  "formIdentifier": "my-form",
@@ -443,18 +569,23 @@ Example return:
443
569
  "attributeSetIdentifier": "test-form"
444
570
  }
445
571
  ```
572
+ </details>
573
+
574
+
446
575
 
447
576
  ### FormData.getFormsDataByMarker(marker, langCode, offset, limit)
448
577
 
449
- ```
578
+ ```js
450
579
  const value = await FormData.getFormsDataByMarker('my-marker', 'en_US', 0, 30)
451
580
  ```
452
581
 
453
582
  > 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.
454
583
 
455
- Example return:
584
+ <details>
456
585
 
457
- ```
586
+ <summary>Example return:</summary>
587
+
588
+ ```json
458
589
  {
459
590
  "id": 1764,
460
591
  "formIdentifier": "my-form",
@@ -470,6 +601,11 @@ Example return:
470
601
  "attributeSetIdentifier": "test-form"
471
602
  }
472
603
  ```
604
+ </details>
605
+
606
+ ---
607
+
608
+
473
609
 
474
610
  ## GeneralTypes
475
611
 
@@ -477,15 +613,17 @@ const { GeneralTypes } = defineOneEntry('your-url');
477
613
 
478
614
  ### GeneralTypes.getAllTypes()
479
615
 
480
- ```
616
+ ```js
481
617
  const value = await GeneralTypes.getAllTypes()
482
618
  ```
483
619
 
484
620
  > This method retrieves all objects of type GeneralTypeEntity from the API. It returns a Promise that resolves to an array of GeneralTypeEntity objects.
485
621
 
486
- Example return:
622
+ <details>
487
623
 
488
- ```
624
+ <summary>Example return:</summary>
625
+
626
+ ```json
489
627
  [
490
628
  {
491
629
  "id": 1,
@@ -493,24 +631,31 @@ Example return:
493
631
  }
494
632
  ]
495
633
  ```
634
+ </details>
635
+
636
+ ---
637
+
638
+
496
639
 
497
640
  ## Locales
498
641
 
499
- ```
642
+ ```js
500
643
  const { Locales } = defineOneEntry('your-url')
501
644
  ```
502
645
 
503
646
  ### Locales.getLocales()
504
647
 
505
- ```
648
+ ```js
506
649
  const value = await Locales.getLocales()
507
650
  ```
508
651
 
509
652
  > This method retrieves all active language localization objects from the API. It returns a Promise that resolves to an array of LocaleEntity objects.
510
653
 
511
- Example return:
654
+ <details>
512
655
 
513
- ```
656
+ <summary>Example return:</summary>
657
+
658
+ ```json
514
659
  [
515
660
  {
516
661
  "id": 1764,
@@ -524,24 +669,31 @@ Example return:
524
669
  }
525
670
  ]
526
671
  ```
672
+ </details>
673
+
674
+ ---
675
+
676
+
527
677
 
528
678
  ## Menus
529
679
 
530
- ```
680
+ ```js
531
681
  const { Menus } = defineOneEntry('your-url')
532
682
  ```
533
683
 
534
684
  ### Menus.getMenusByMarker(marker)
535
685
 
536
- ```
686
+ ```js
537
687
  const value = await Menus.getMenusByMarker('my-marker')
538
688
  ```
539
689
 
540
690
  > 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.
541
691
 
542
- Example return:
692
+ <details>
543
693
 
544
- ```
694
+ <summary>Example return:</summary>
695
+
696
+ ```json
545
697
  {
546
698
  "id": 1764,
547
699
  "identifier": "catalog",
@@ -567,10 +719,15 @@ Example return:
567
719
  ]
568
720
  }
569
721
  ```
722
+ </details>
723
+
724
+ ---
725
+
726
+
570
727
 
571
728
  ## Pages
572
729
 
573
- ```
730
+ ```js
574
731
  const { Pages } = defineOneEntry('your-url')
575
732
  ```
576
733
 
@@ -633,15 +790,17 @@ const value = await Pages.getRootPages([ 'en_US', 'it_IT' ])
633
790
 
634
791
  ### Pages.getRootPages(langCode)
635
792
 
636
- ```
793
+ ```js
637
794
  const value = await Pages.getRootPages('en_US')
638
795
  ```
639
796
 
640
797
  > 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.
641
798
 
642
- Example return:
799
+ <details>
643
800
 
644
- ```
801
+ <summary>Example return:</summary>
802
+
803
+ ```json
645
804
  [
646
805
  {
647
806
  "id": 1764,
@@ -678,18 +837,22 @@ Example return:
678
837
  }
679
838
  ]
680
839
  ```
840
+ </details>
841
+
681
842
 
682
843
  ### Pages.getCatalogPages(langCode, limit, offset)
683
844
 
684
- ```
845
+ ```js
685
846
  const value = await Pages.getCatalogPages('en_US', 0, 30)
686
847
  ```
687
848
 
688
849
  > 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.
689
850
 
690
- Example return:
851
+ <details>
691
852
 
692
- ```
853
+ <summary>Example return:</summary>
854
+
855
+ ```json
693
856
  [
694
857
  {
695
858
  "id": 1764,
@@ -726,18 +889,22 @@ Example return:
726
889
  }
727
890
  ]
728
891
  ```
892
+ </details>
893
+
729
894
 
730
895
  ### Pages.getPages(langCode)
731
896
 
732
- ```
897
+ ```js
733
898
  const value = await Pages.getPages('en_US')
734
899
  ```
735
900
 
736
901
  > 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.
737
902
 
738
- Example return:
903
+ <details>
739
904
 
740
- ```
905
+ <summary>Example return:</summary>
906
+
907
+ ```json
741
908
  [
742
909
  {
743
910
  "id": 1764,
@@ -774,18 +941,22 @@ Example return:
774
941
  }
775
942
  ]
776
943
  ```
944
+ </details>
945
+
777
946
 
778
947
  ### Pages.getPageById(id, langCode)
779
948
 
780
- ```
949
+ ```js
781
950
  const value = await Pages.getPageById(1, 'en_US')
782
951
  ```
783
952
 
784
953
  > 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.
785
954
 
786
- Example return:
955
+ <details>
787
956
 
788
- ```
957
+ <summary>Example return:</summary>
958
+
959
+ ```json
789
960
  {
790
961
  "id": 1764,
791
962
  "parentId": null,
@@ -814,18 +985,22 @@ Example return:
814
985
  "products": 0
815
986
  }
816
987
  ```
988
+ </details>
989
+
817
990
 
818
991
  ### Pages.getPageByUrl(url, langCode)
819
992
 
820
- ```
993
+ ```js
821
994
  const value = await Pages.getPageByUrl('shop', 'en_US')
822
995
  ```
823
996
 
824
997
  > 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.
825
998
 
826
- Example return:
999
+ <details>
827
1000
 
828
- ```
1001
+ <summary>Example return:</summary>
1002
+
1003
+ ```json
829
1004
  {
830
1005
  "id": 1764,
831
1006
  "parentId": null,
@@ -854,18 +1029,22 @@ Example return:
854
1029
  "products": 0
855
1030
  }
856
1031
  ```
1032
+ </details>
1033
+
857
1034
 
858
1035
  ### Pages.getChildPagesByParentUrl(url, langCode)
859
1036
 
860
- ```
1037
+ ```js
861
1038
  const value = await Pages.getChildPagesByParentUrl('shop', 'en_US')
862
1039
  ```
863
1040
 
864
1041
  > 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.
865
1042
 
866
- Example return:
1043
+ <details>
867
1044
 
868
- ```
1045
+ <summary>Example return:</summary>
1046
+
1047
+ ```json
869
1048
  [
870
1049
  {
871
1050
  "id": 1764,
@@ -896,18 +1075,80 @@ Example return:
896
1075
  }
897
1076
  ]
898
1077
  ```
1078
+ </details>
899
1079
 
900
- ### Pages.getFormsByPageUrl(url, langCode)
901
1080
 
902
- ```
1081
+ ### Pages.getBlocksByPageUrl(url, langCode)
1082
+
1083
+ ```js
903
1084
  const value = await Pages.getFormsByPageUrl('shop', 'en_US')
904
1085
  ```
905
1086
 
906
- > Get PositionFormDto objects for a related form by url. Returns an array of PositionFormDto objects.
1087
+ > Get PositionBlock objects for a related form by url. Returns an array of PositionBlock objects.
1088
+
1089
+ <details>
907
1090
 
908
- Example return:
1091
+ <summary>Example return:</summary>
909
1092
 
1093
+ ```json
1094
+ [
1095
+ {
1096
+ "id": 1764,
1097
+ "version": 10,
1098
+ "identifier": "catalog",
1099
+ "attributeSetId": 0,
1100
+ "localizeInfos": {
1101
+ "en_US": {
1102
+ "title": "My block"
1103
+ }
1104
+ },
1105
+ "customSettings": {
1106
+ "sliderDelay": 0,
1107
+ "sliderDelayType": "",
1108
+ "productQuantity": 4,
1109
+ "productSortType": "By_ID",
1110
+ "productSortOrder": "Descending",
1111
+ "productCountElementsPerRow": 10,
1112
+ "similarProductRules": [
1113
+ {
1114
+ "property": "Descending",
1115
+ "includes": "",
1116
+ "keywords": "",
1117
+ "strict": ""
1118
+ }
1119
+ ]
1120
+ },
1121
+ "position": 0,
1122
+ "isSync": false,
1123
+ "attributeValues": {
1124
+ "en_US": {
1125
+ "marker": {
1126
+ "value": "",
1127
+ "type": "string"
1128
+ }
1129
+ }
1130
+ },
1131
+ "type": "forNewsPage",
1132
+ "templateIdentifier": null
1133
+ }
1134
+ ]
910
1135
  ```
1136
+ </details>
1137
+
1138
+
1139
+ ### Pages.getFormsByPageUrl(url, langCode)
1140
+
1141
+ ```js
1142
+ const value = await Pages.getFormsByPageUrl('shop', 'en_US')
1143
+ ```
1144
+
1145
+ > Get PositionForm objects for a related form by url. Returns an array of PositionForm objects.
1146
+
1147
+ <details>
1148
+
1149
+ <summary>Example return:</summary>
1150
+
1151
+ ```json
911
1152
  [
912
1153
  {
913
1154
  "id": 1764,
@@ -958,35 +1199,43 @@ Example return:
958
1199
  }
959
1200
  ]
960
1201
  ```
1202
+ </details>
1203
+
961
1204
 
962
1205
  ### Pages.getConfigPageByUrl(url)
963
1206
 
964
- ```
1207
+ ```js
965
1208
  const value = await Pages.getConfigPageByUrl('shop')
966
1209
  ```
967
1210
 
968
1211
  > 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.
969
1212
 
970
- Example return:
1213
+ <details>
971
1214
 
972
- ```
1215
+ <summary>Example return:</summary>
1216
+
1217
+ ```json
973
1218
  {
974
1219
  "rowsPerPage": 10,
975
1220
  "productsPerRow": 10
976
1221
  }
977
1222
  ```
1223
+ </details>
1224
+
978
1225
 
979
1226
  ### Pages.searchPage(name, langCode)
980
1227
 
981
- ```
1228
+ ```js
982
1229
  const value = await Pages.searchPage('cup', 'en_US')
983
1230
  ```
984
1231
 
985
1232
  > 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.
986
1233
 
987
- Example return:
1234
+ <details>
988
1235
 
989
- ```
1236
+ <summary>Example return:</summary>
1237
+
1238
+ ```json
990
1239
  [
991
1240
  {
992
1241
  "id": 1764,
@@ -1017,10 +1266,15 @@ Example return:
1017
1266
  }
1018
1267
  ]
1019
1268
  ```
1269
+ </details>
1270
+
1271
+ ---
1272
+
1273
+
1020
1274
 
1021
1275
  ## Products
1022
1276
 
1023
- ```
1277
+ ```js
1024
1278
  const { Products } = defineOneEntry('your-url')
1025
1279
  ```
1026
1280
 
@@ -1028,7 +1282,7 @@ const { Products } = defineOneEntry('your-url')
1028
1282
 
1029
1283
  Parameters:
1030
1284
 
1031
- ```
1285
+ ```js
1032
1286
  const userQuery = {
1033
1287
  offset: 0,
1034
1288
  limit: 30,
@@ -1117,15 +1371,17 @@ const value = await Products.getProducts([ 'en_US', 'it_IT' ])
1117
1371
 
1118
1372
  ### Products.getProducts(langCode, userQuery)
1119
1373
 
1120
- ```
1374
+ ```js
1121
1375
  const value = await Products.getProducts('en_US', userQuery)
1122
1376
  ```
1123
1377
 
1124
1378
  > 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[]).
1125
1379
 
1126
- Example return:
1380
+ <details>
1127
1381
 
1128
- ```
1382
+ <summary>Example return:</summary>
1383
+
1384
+ ```json
1129
1385
  [
1130
1386
  {
1131
1387
  "id": 1764,
@@ -1158,18 +1414,22 @@ Example return:
1158
1414
  }
1159
1415
  ]
1160
1416
  ```
1417
+ </details>
1418
+
1161
1419
 
1162
1420
  ### Products.getProductsEmptyPage(langCode, userQuery)
1163
1421
 
1164
- ```
1422
+ ```js
1165
1423
  const value = await Products.getProductsEmptyPage('en_US', userQuery)
1166
1424
  ```
1167
1425
 
1168
1426
  > 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.
1169
1427
 
1170
- Example return:
1428
+ <details>
1171
1429
 
1172
- ```
1430
+ <summary>Example return:</summary>
1431
+
1432
+ ```json
1173
1433
  [
1174
1434
  {
1175
1435
  "id": 1764,
@@ -1202,24 +1462,26 @@ Example return:
1202
1462
  }
1203
1463
  ]
1204
1464
  ```
1465
+ </details>
1466
+
1205
1467
 
1206
1468
  ### Products.getProductsPageById(id, langCode, userQuery)
1207
1469
 
1208
- ```
1470
+ ```js
1209
1471
  const value = await Products.getProductsPageById(1, 'en_US', userQuery)
1210
1472
  ```
1211
1473
 
1212
1474
  > 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.
1213
1475
 
1214
- Example return:
1476
+ <details>
1215
1477
 
1216
- ```
1478
+ <summary>Example return:</summary>
1479
+
1480
+ ```json
1217
1481
  {
1218
1482
  "id": 1764,
1219
1483
  "localizeInfos": {
1220
- {
1221
- "title": "Product"
1222
- }
1484
+ "title": "Product"
1223
1485
  },
1224
1486
  "isVisible": true,
1225
1487
  "statusId": 1,
@@ -1242,34 +1504,33 @@ Example return:
1242
1504
  "templateIdentifier": "my-template",
1243
1505
  "shortDescTemplateIdentifier": "my-template-short",
1244
1506
  "attributeValues": {
1245
- {
1246
- "marker": {
1247
- "value": "",
1248
- "type": "string"
1249
- }
1507
+ "marker": {
1508
+ "value": "",
1509
+ "type": "string"
1250
1510
  }
1251
1511
  },
1252
1512
  "position": 1
1253
1513
  }
1254
1514
  ```
1515
+ </details>
1516
+
1255
1517
 
1256
1518
  ### Products.getProductsPageByUrl(url, langCode, userQuery)
1257
1519
 
1258
- ```
1520
+ ```js
1259
1521
  const value = await Products.getProductsPageByUrl('cup', 'en_US', userQuery)
1260
1522
  ```
1261
1523
 
1262
1524
  > 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.
1263
1525
 
1264
- Example return:
1526
+ <details>
1265
1527
 
1266
- ```
1528
+ <summary>Example return:</summary>
1529
+
1530
+ ```json
1267
1531
  {
1268
1532
  "id": 1764,
1269
- "localizeInfos": {
1270
- {
1271
- "title": "Product"
1272
- }
1533
+ "localizeInfos": {"title": "Product"
1273
1534
  },
1274
1535
  "isVisible": true,
1275
1536
  "statusId": 1,
@@ -1292,28 +1553,30 @@ Example return:
1292
1553
  "templateIdentifier": "my-template",
1293
1554
  "shortDescTemplateIdentifier": "my-template-short",
1294
1555
  "attributeValues": {
1295
- {
1296
- "marker": {
1297
- "value": "",
1298
- "type": "string"
1299
- }
1556
+ "marker": {
1557
+ "value": "",
1558
+ "type": "string"
1300
1559
  }
1301
1560
  },
1302
1561
  "position": 1
1303
1562
  }
1304
1563
  ```
1564
+ </details>
1565
+
1305
1566
 
1306
1567
  ### Products.getRelatedProductsById(id, langCode, userQuery)
1307
1568
 
1308
- ```
1569
+ ```js
1309
1570
  const value = await Products.getRelatedProductsById(1, 'en_US', {limit:20, offset:1})
1310
1571
  ```
1311
1572
 
1312
1573
  > 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.
1313
1574
 
1314
- Example return:
1575
+ <details>
1315
1576
 
1316
- ```
1577
+ <summary>Example return:</summary>
1578
+
1579
+ ```json
1317
1580
  {
1318
1581
  "id": 1764,
1319
1582
  "localizeInfos": {
@@ -1344,18 +1607,22 @@ Example return:
1344
1607
  "position": 1
1345
1608
  }
1346
1609
  ```
1610
+ </details>
1611
+
1347
1612
 
1348
1613
  ### Products.getProductById(id, langCode)
1349
1614
 
1350
- ```
1615
+ ```js
1351
1616
  const value = await Products.getProductById(1, 'en_US')
1352
1617
  ```
1353
1618
 
1354
1619
  > 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.
1355
1620
 
1356
- Example return:
1621
+ <details>
1357
1622
 
1358
- ```
1623
+ <summary>Example return:</summary>
1624
+
1625
+ ```json
1359
1626
  {
1360
1627
  "id": 1764,
1361
1628
  "localizeInfos": {
@@ -1385,12 +1652,13 @@ Example return:
1385
1652
  },
1386
1653
  "position": 1
1387
1654
  }
1388
-
1389
1655
  ```
1656
+ </details>
1657
+
1390
1658
 
1391
1659
  ### Products.filterProduct(data, langCode, userQuery)
1392
1660
 
1393
- ```
1661
+ ```js
1394
1662
  const data = {
1395
1663
  attributeMarker: "price",
1396
1664
  conditionMarker: "lth",
@@ -1402,7 +1670,7 @@ const value = await Products.filterProduct(data, 'en_US', userQuery)
1402
1670
 
1403
1671
  Example body:
1404
1672
 
1405
- ```
1673
+ ```js
1406
1674
  [
1407
1675
  {
1408
1676
  "attributeMarker": "price",
@@ -1421,15 +1689,15 @@ Example body:
1421
1689
 
1422
1690
  > 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}.
1423
1691
 
1424
- Example return:
1692
+ <details>
1425
1693
 
1426
- ```
1694
+ <summary>Example return:</summary>
1695
+
1696
+ ```json
1427
1697
  {
1428
1698
  "id": 1764,
1429
1699
  "localizeInfos": {
1430
- {
1431
- "title": "Product"
1432
- }
1700
+ "title": "Product"
1433
1701
  },
1434
1702
  "isVisible": true,
1435
1703
  "statusId": 1,
@@ -1452,35 +1720,35 @@ Example return:
1452
1720
  "templateIdentifier": "my-template",
1453
1721
  "shortDescTemplateIdentifier": "my-template-short",
1454
1722
  "attributeValues": {
1455
- {
1456
- "marker": {
1457
- "value": "",
1458
- "type": "string"
1459
- }
1723
+ "marker": {
1724
+ "value": "",
1725
+ "type": "string"
1460
1726
  }
1461
1727
  },
1462
1728
  "position": 1
1463
1729
  }
1464
1730
  ```
1731
+ </details>
1732
+
1465
1733
 
1466
1734
  ### Products.searchProduct(name, langCode)
1467
1735
 
1468
- ```
1736
+ ```js
1469
1737
  const value = await Products.searchProduct('cup', 'en_US')
1470
1738
  ```
1471
1739
 
1472
1740
  > 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.
1473
1741
 
1474
- Example return:
1742
+ <details>
1475
1743
 
1476
- ```
1744
+ <summary>Example return:</summary>
1745
+
1746
+ ```json
1477
1747
  [
1478
1748
  {
1479
1749
  "id": 1764,
1480
1750
  "localizeInfos": {
1481
- {
1482
- "title": "Product"
1483
- }
1751
+ "title": "Product"
1484
1752
  },
1485
1753
  "isVisible": true,
1486
1754
  "statusId": 1,
@@ -1503,35 +1771,40 @@ Example return:
1503
1771
  "templateIdentifier": "my-template",
1504
1772
  "shortDescTemplateIdentifier": "my-template-short",
1505
1773
  "attributeValues": {
1506
- {
1507
- "marker": {
1508
- "value": "",
1509
- "type": "string"
1510
- }
1774
+ "marker": {
1775
+ "value": "",
1776
+ "type": "string"
1511
1777
  }
1512
1778
  },
1513
1779
  "position": 1
1514
1780
  }
1515
1781
  ]
1516
1782
  ```
1783
+ </details>
1784
+
1785
+ ---
1786
+
1787
+
1517
1788
 
1518
1789
  ## ProductStatuses
1519
1790
 
1520
- ```
1791
+ ```js
1521
1792
  const { ProductStatuses } = defineOneEntry('your-url');
1522
1793
  ```
1523
1794
 
1524
1795
  ### ProductStatuses.getProductStatuses()
1525
1796
 
1526
- ```
1797
+ ```js
1527
1798
  const value = await ProductStatuses.getProductStatuses()
1528
1799
  ```
1529
1800
 
1530
1801
  > This method searches for all product status objects from the API. It returns a Promise that resolves to an array of product status objects.
1531
1802
 
1532
- Example return:
1803
+ <details>
1533
1804
 
1534
- ```
1805
+ <summary>Example return:</summary>
1806
+
1807
+ ```json
1535
1808
  [
1536
1809
  {
1537
1810
  "id": 1764,
@@ -1546,18 +1819,22 @@ Example return:
1546
1819
  }
1547
1820
  ]
1548
1821
  ```
1822
+ </details>
1823
+
1549
1824
 
1550
1825
  ### ProductStatuses.getProductStatusesById(id)
1551
1826
 
1552
- ```
1827
+ ```js
1553
1828
  const value = await ProductStatuses.getProductStatusesById(1)
1554
1829
  ```
1555
1830
 
1556
1831
  > 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.
1557
1832
 
1558
- Example return:
1833
+ <details>
1559
1834
 
1560
- ```
1835
+ <summary>Example return:</summary>
1836
+
1837
+ ```json
1561
1838
  {
1562
1839
  "id": 1764,
1563
1840
  "updatedDate": "2023-09-25T13:36:05.907Z",
@@ -1570,18 +1847,22 @@ Example return:
1570
1847
  }
1571
1848
  }
1572
1849
  ```
1850
+ </details>
1851
+
1573
1852
 
1574
1853
  ### ProductStatuses.getProductsByStatusMarker(marker)
1575
1854
 
1576
- ```
1855
+ ```js
1577
1856
  const value = await ProductStatuses.getProductsByStatusMarker('my-marker')
1578
1857
  ```
1579
1858
 
1580
1859
  > 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.
1581
1860
 
1582
- Example return:
1861
+ <details>
1583
1862
 
1584
- ```
1863
+ <summary>Example return:</summary>
1864
+
1865
+ ```json
1585
1866
  {
1586
1867
  "id": 1764,
1587
1868
  "updatedDate": "2023-09-25T13:39:19.384Z",
@@ -1594,30 +1875,39 @@ Example return:
1594
1875
  }
1595
1876
  }
1596
1877
  ```
1878
+ </details>
1879
+
1597
1880
 
1598
1881
  ### ProductStatuses.validateMarker(marker)
1599
1882
 
1600
- ```
1883
+ ```js
1601
1884
  const value = await ProductStatuses.validateMarker('marker')
1602
1885
  ```
1603
1886
 
1604
1887
  > 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.
1605
1888
 
1606
- Example return:
1889
+ <details>
1607
1890
 
1608
- ```
1891
+ <summary>Example return:</summary>
1892
+
1893
+ ```json
1609
1894
  true
1610
1895
  ```
1896
+ </details>
1897
+
1898
+ ---
1899
+
1900
+
1611
1901
 
1612
1902
  ## System
1613
1903
 
1614
- ```
1904
+ ```js
1615
1905
  const { System } = defineOneEntry('your-url')
1616
1906
  ```
1617
1907
 
1618
1908
  ### System.test404()
1619
1909
 
1620
- ```
1910
+ ```js
1621
1911
  const value = await System.test404()
1622
1912
  ```
1623
1913
 
@@ -1625,7 +1915,7 @@ const value = await System.test404()
1625
1915
 
1626
1916
  ### System.test500()
1627
1917
 
1628
- ```
1918
+ ```js
1629
1919
  const value = await System.test500()
1630
1920
  ```
1631
1921
 
@@ -1634,21 +1924,23 @@ const value = await System.test500()
1634
1924
 
1635
1925
  ## Templates
1636
1926
 
1637
- ```
1927
+ ```js
1638
1928
  const { Templates } = defineOneEntry('your-url')
1639
1929
  ```
1640
1930
 
1641
1931
  ### Templates.getAllTemplates()
1642
1932
 
1643
- ```
1933
+ ```js
1644
1934
  const value = await Templates.getAllTemplates()
1645
1935
  ```
1646
1936
 
1647
1937
  > 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.
1648
1938
 
1649
- Example return:
1939
+ <details>
1650
1940
 
1651
- ```
1941
+ <summary>Example return:</summary>
1942
+
1943
+ ```json
1652
1944
  [
1653
1945
  {
1654
1946
  "id": 1764,
@@ -1671,18 +1963,22 @@ Example return:
1671
1963
  }
1672
1964
  ]
1673
1965
  ```
1966
+ </details>
1967
+
1674
1968
 
1675
1969
  ### Templates.getTemplateByType(type)
1676
1970
 
1677
- ```
1971
+ ```js
1678
1972
  const value = await Templates.getTemplateByType('forCatalogProducts')
1679
1973
  ```
1680
1974
 
1681
1975
  > 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.
1682
1976
 
1683
- Example return:
1977
+ <details>
1684
1978
 
1685
- ```
1979
+ <summary>Example return:</summary>
1980
+
1981
+ ```json
1686
1982
  [
1687
1983
  {
1688
1984
  "id": 1764,
@@ -1705,24 +2001,28 @@ Example return:
1705
2001
  }
1706
2002
  ]
1707
2003
  ```
2004
+ </details>
2005
+
1708
2006
 
1709
2007
  ## TemplatePreviews
1710
2008
 
1711
- ```
2009
+ ```js
1712
2010
  const { TemplatePreviews } = defineOneEntry('your-url')
1713
2011
  ```
1714
2012
 
1715
2013
  ### TemplatePreviews.getTemplatePreviews()
1716
2014
 
1717
- ```
2015
+ ```js
1718
2016
  const value = await TemplatePreviews.getTemplatePreviews()
1719
2017
  ```
1720
2018
 
1721
2019
  > This method retrieves all template objects from the API. It returns a Promise that resolves to an array of TemplatePreviewsEntity template objects.
1722
2020
 
1723
- Example return:
2021
+ <details>
1724
2022
 
1725
- ```
2023
+ <summary>Example return:</summary>
2024
+
2025
+ ```json
1726
2026
  [
1727
2027
  {
1728
2028
  "id": 1764,
@@ -1760,18 +2060,22 @@ Example return:
1760
2060
  }
1761
2061
  ]
1762
2062
  ```
2063
+ </details>
2064
+
1763
2065
 
1764
2066
  ### TemplatePreviews.getTemplatesPreviewById(id)
1765
2067
 
1766
- ```
2068
+ ```js
1767
2069
  const value = await TemplatePreviews.getTemplatePreviewById(1)
1768
2070
  ```
1769
2071
 
1770
2072
  > 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.
1771
2073
 
1772
- Example return:
2074
+ <details>
1773
2075
 
1774
- ```
2076
+ <summary>Example return:</summary>
2077
+
2078
+ ```json
1775
2079
  {
1776
2080
  "id": 1764,
1777
2081
  "updatedDate": "2023-12-05T12:44:37.348Z",
@@ -1807,18 +2111,24 @@ Example return:
1807
2111
  "position": 0
1808
2112
  }
1809
2113
  ```
2114
+ </details>
2115
+
1810
2116
 
1811
2117
  ### TemplatePreviews.getTemplatesPreviewByMarker(marker)
1812
2118
 
1813
- ```
2119
+ ```js
1814
2120
  const value = await TemplatePreviews.getTemplatePreviewByMarker('my-marker')
1815
2121
  ```
1816
2122
 
1817
2123
  > 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.
1818
2124
 
1819
- Example return:
2125
+ <details>
1820
2126
 
1821
- ```
2127
+ <summary>Example return:</summary>
2128
+
2129
+
2130
+
2131
+ ```json
1822
2132
  {
1823
2133
  "id": 1764,
1824
2134
  "updatedDate": "2023-12-05T12:44:20.008Z",
@@ -1853,4 +2163,5 @@ Example return:
1853
2163
  },
1854
2164
  "position": 0
1855
2165
  }
1856
- ```
2166
+ ```
2167
+ </details>