oneentry 1.0.117 → 1.0.119
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 +157 -41
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -200,6 +200,9 @@ Now you can use the following links to jump to specific entries:
|
|
|
200
200
|
|
|
201
201
|
## <h2 id="admins"> Admins </h2>
|
|
202
202
|
|
|
203
|
+
The "Administrators" module is designed for creating and managing administrators.
|
|
204
|
+
An administrator is a user who can add, update, and edit information on the website or in the mobile application.
|
|
205
|
+
|
|
203
206
|
```js
|
|
204
207
|
const { Admins } = defineOneEntry('your-url');
|
|
205
208
|
```
|
|
@@ -354,6 +357,54 @@ const result = await Admins.getAdminsInfo(body, 'en_US', 0, 30);
|
|
|
354
357
|
|
|
355
358
|
## <h2 id="attributesets"> AttributesSets </h2>
|
|
356
359
|
|
|
360
|
+
Attributes are an entity that allows you to configure the structure of your application. With them, you can achieve maximum flexibility and eliminate hardcoding.
|
|
361
|
+
|
|
362
|
+
Attribute sets are similar to a collection of properties, the values of which you can manage through the admin panel. They differ by the type of binding to various entities. You can read more about the types in the section "Types".
|
|
363
|
+
|
|
364
|
+
An attribute set forms the data structure that can then be used within your project. For example, for a product, you can define that its structure should contain a name, image, price, and text description. At the same time, the structure of a blog post may contain text with a title and a set of images.
|
|
365
|
+
|
|
366
|
+
Some attributes may be similar in structure and used in different entities, so you can reuse attribute sets for different entities.
|
|
367
|
+
|
|
368
|
+
Structure
|
|
369
|
+
Each attribute set contains a customizable collection of attributes that store the content of your project. You can manage these attributes from the management system. This is convenient, as you no longer need to edit the application code to change your project. Just move all content components that can be changed into attributes.
|
|
370
|
+
|
|
371
|
+
Markers
|
|
372
|
+
Markers cannot contain spaces and cannot start with a digit. If you attempt to enter invalid values in the marker field, the system will ignore the input.
|
|
373
|
+
|
|
374
|
+
Name
|
|
375
|
+
To make it easier for you to navigate, each attribute has a required name parameter, which is a non-unique string. Name the attributes in a way that makes it easy for you to work with them.
|
|
376
|
+
|
|
377
|
+
Marker
|
|
378
|
+
As an identifier, each attribute has a required parameter - "marker", which is a unique string. The marker is also used as a key to access the attributes in your project code. Keep this in mind when setting the attribute marker to avoid syntax conflicts.
|
|
379
|
+
|
|
380
|
+
Data Type
|
|
381
|
+
Choose the data type for each attribute field that it will store.
|
|
382
|
+
|
|
383
|
+
Data types can be of the following types:
|
|
384
|
+
|
|
385
|
+
String: Simple text, for example, "Hello, world!".
|
|
386
|
+
Text: Longer text, often formatted, for example, an article or a letter.
|
|
387
|
+
Text with Header: Text with a header that can be used to denote a topic or category.
|
|
388
|
+
Integer: An integer, for example, 5, 100, -2.
|
|
389
|
+
Float: A data type for floating-point numbers that can have a decimal part, for example, 3.14, 1.5, -0.25.
|
|
390
|
+
Real: The same as Float, but with higher precision.
|
|
391
|
+
Date and Time: A combination of date and time, for example, 2023-10-27 10:00:00.
|
|
392
|
+
Date: A date, for example, 2023-10-27.
|
|
393
|
+
Time: A time, for example, 10:00:00.
|
|
394
|
+
File: Any file on your computer, for example, a document, image, music.
|
|
395
|
+
Image: An image, for example, a photograph, drawing.
|
|
396
|
+
Group of Images: A collection of images, for example, a photo album.
|
|
397
|
+
Radio Button: A selection button from which only one option can be chosen.
|
|
398
|
+
List: A list of items, for example, a shopping list.
|
|
399
|
+
Entity: An entity representing an object from the real world, for example, a person, place, organization.
|
|
400
|
+
The content filling interface will correspond to the selected data type for each attribute field.
|
|
401
|
+
|
|
402
|
+
Opportunities
|
|
403
|
+
You can add validators for attributes. This mechanism is discussed in more detail in the section "Validators".
|
|
404
|
+
|
|
405
|
+
Attributes
|
|
406
|
+
If one attribute set is used by several entities at once, you need to be careful when changing the attributes of that set. For example, if you delete one of the attributes, that attribute will be removed everywhere it is used along with the content. If you add a new attribute to the set, that attribute will also be added everywhere the attribute set is used.
|
|
407
|
+
|
|
357
408
|
```js
|
|
358
409
|
const { AttributesSets } = defineOneEntry('your-url');
|
|
359
410
|
```
|
|
@@ -793,6 +844,8 @@ Example return:
|
|
|
793
844
|
|
|
794
845
|
## <h2 id="authprovider"> User Auth Provider </h2>
|
|
795
846
|
|
|
847
|
+
The User Auth Provider in OneEntry Headless CMS facilitates user authentication and registration through various methods, such as email. By using the AuthProvider object, developers can handle user registration, including sending activation codes when necessary. The system supports diverse data types for form attributes, allowing comprehensive user data management. Key functionalities include user authentication, token management (access and refresh tokens), password changes, and logout. Additionally, it provides methods to manage authentication providers and retrieve specific details by marker or language code, ensuring secure and efficient user management across applications.
|
|
848
|
+
|
|
796
849
|
```js
|
|
797
850
|
const { AuthProvider } = defineOneEntry('your-url');
|
|
798
851
|
```
|
|
@@ -1900,6 +1953,10 @@ Example return:
|
|
|
1900
1953
|
|
|
1901
1954
|
## <h2 id="blocks"> Blocks </h2>
|
|
1902
1955
|
|
|
1956
|
+
The "Blocks" module is designed to create structures that contain sets of attributes. The Headless CMS OneEntry provides users with very flexible tools, and you can use the "Blocks" module as you see fit for your specific case. The main concept of the "Blocks" module is to create reusable entities (blocks) that contain sets of attributes and additional content.
|
|
1957
|
+
|
|
1958
|
+
For example, you can create a block - "footer" and use it on all pages of your project.
|
|
1959
|
+
|
|
1903
1960
|
```js
|
|
1904
1961
|
const { Blocks } = defineOneEntry('your-url');
|
|
1905
1962
|
```
|
|
@@ -2206,10 +2263,17 @@ Example return:
|
|
|
2206
2263
|
|
|
2207
2264
|
## <h2 id="events"> Events </h2>
|
|
2208
2265
|
|
|
2266
|
+
The "Events" module allows you to create and edit events, through which you can interact with the users of your system. In this module, you select an event that the system will respond to and send notifications to the users of your system. For example, you have statuses for catalog items "In stock" and "Out of stock," and you want to send users a notification about the status change from "Out of stock" to "In stock"
|
|
2267
|
+
|
|
2209
2268
|
```js
|
|
2210
2269
|
const { Events } = defineOneEntry('your-url');
|
|
2211
2270
|
```
|
|
2212
2271
|
|
|
2272
|
+
In the Headless CMS OneEntry, there are three ways to interact with the users of your system through the "Events" module: <br/>
|
|
2273
|
+
Push Notification <br/>
|
|
2274
|
+
Email <br/>
|
|
2275
|
+
Socket IO <br/>
|
|
2276
|
+
|
|
2213
2277
|
### Events.getAllSubscriptions(offset, limit)
|
|
2214
2278
|
|
|
2215
2279
|
Returns all subscriptions to products 🔐 This method requires authorization.
|
|
@@ -2327,6 +2391,8 @@ This method unsubscribes to the product event. Returns nothing if the unsubscrip
|
|
|
2327
2391
|
|
|
2328
2392
|
## <h2 id="fileuploading"> FileUploading </h2>
|
|
2329
2393
|
|
|
2394
|
+
FileUploading in OneEntry Headless CMS provides methods for managing files in cloud storage. The upload method allows uploading files with optional parameters such as type, entity, ID, and image optimization options. It returns information about the uploaded file, including its name and download link. The delete method removes a file from storage by its name and specified parameters. The getFile method searches for and returns a file object based on provided parameters such as ID, type, entity, and filename.
|
|
2395
|
+
|
|
2330
2396
|
```js
|
|
2331
2397
|
const { FileUploading } = defineOneEntry('your-url');
|
|
2332
2398
|
```
|
|
@@ -2513,6 +2579,8 @@ Example return:
|
|
|
2513
2579
|
|
|
2514
2580
|
## <h2 id="forms"> Forms </h2>
|
|
2515
2581
|
|
|
2582
|
+
The "Forms" module is a user-friendly tool for creating and managing various forms, such as contact forms, surveys, and registration sheets. With an intuitive interface, users can add form elements, customize layouts, and apply themes. The module supports organizing and categorizing forms, setting access permissions, and tracking responses in real-time. Automation features include notifications upon form submissions and integration with applications.
|
|
2583
|
+
|
|
2516
2584
|
```js
|
|
2517
2585
|
const { Forms } = defineOneEntry('your-url');
|
|
2518
2586
|
```
|
|
@@ -2769,6 +2837,8 @@ Example return:
|
|
|
2769
2837
|
|
|
2770
2838
|
## <h2 id="formsdata"> FormData </h2>
|
|
2771
2839
|
|
|
2840
|
+
The FormData module in OneEntry Headless CMS allows for managing and interacting with form data. By using the defineOneEntry function, you can create a FormData object to handle various operations. The module supports different data types such as strings, numbers, dates, text, images, files, lists, and nested entities. It provides methods like getFormsData, postFormsData, and getFormsDataByMarker for retrieving, creating, and searching form data. Each method interacts with the API to perform these tasks, returning structured JSON objects with detailed information about the form data, including identifiers, timestamps, and language-specific data.
|
|
2841
|
+
|
|
2772
2842
|
```js
|
|
2773
2843
|
const { FormData } = defineOneEntry('your-url');
|
|
2774
2844
|
```
|
|
@@ -2823,25 +2893,6 @@ Example with a simple type attribute "text"
|
|
|
2823
2893
|
|
|
2824
2894
|
---
|
|
2825
2895
|
|
|
2826
|
-
Example with a simple type attribute "text"
|
|
2827
|
-
|
|
2828
|
-
```json
|
|
2829
|
-
{
|
|
2830
|
-
"marker": "about",
|
|
2831
|
-
"type": "text",
|
|
2832
|
-
"value": {
|
|
2833
|
-
"htmlValue": "<p>Hello world</p>",
|
|
2834
|
-
"plainValue": "",
|
|
2835
|
-
"params": {
|
|
2836
|
-
"isEditorDisabled": false,
|
|
2837
|
-
"isImageCompressed": true
|
|
2838
|
-
}
|
|
2839
|
-
}
|
|
2840
|
-
}
|
|
2841
|
-
```
|
|
2842
|
-
|
|
2843
|
-
---
|
|
2844
|
-
|
|
2845
2896
|
Example with a simple type attribute "textWithHeader"
|
|
2846
2897
|
|
|
2847
2898
|
```json
|
|
@@ -2933,14 +2984,34 @@ Example with attribute type "entity" (nested list)
|
|
|
2933
2984
|
{
|
|
2934
2985
|
"marker": "entity-marker",
|
|
2935
2986
|
"type": "entity",
|
|
2987
|
+
"value": [25, 32, 24]
|
|
2988
|
+
}
|
|
2989
|
+
]
|
|
2990
|
+
}
|
|
2991
|
+
}
|
|
2992
|
+
```
|
|
2993
|
+
|
|
2994
|
+
Value - numerical identifiers for pages and string identifiers for products.
|
|
2995
|
+
Identifiers for products should include the prefix 'p-', for example, 'p-1-', 'p-2-', etc.
|
|
2996
|
+
p-[parentId]-[productId]
|
|
2997
|
+
|
|
2998
|
+
---
|
|
2999
|
+
|
|
3000
|
+
Example with attribute type "timeInterval"
|
|
3001
|
+
|
|
3002
|
+
```json
|
|
3003
|
+
{
|
|
3004
|
+
"formIdentifier": "reg",
|
|
3005
|
+
"formData": {
|
|
3006
|
+
"en_US": [
|
|
3007
|
+
{
|
|
3008
|
+
"marker": "interval",
|
|
3009
|
+
"type": "timeInterval",
|
|
2936
3010
|
"value": [
|
|
2937
|
-
|
|
2938
|
-
"
|
|
2939
|
-
"
|
|
2940
|
-
|
|
2941
|
-
"parentId": null,
|
|
2942
|
-
"depth": 0,
|
|
2943
|
-
}
|
|
3011
|
+
[
|
|
3012
|
+
"2025-02-11T16:00:00:000Z",
|
|
3013
|
+
"2025-02-13T16:00:00:000Z",
|
|
3014
|
+
]
|
|
2944
3015
|
]
|
|
2945
3016
|
}
|
|
2946
3017
|
]
|
|
@@ -2948,11 +3019,22 @@ Example with attribute type "entity" (nested list)
|
|
|
2948
3019
|
}
|
|
2949
3020
|
```
|
|
2950
3021
|
|
|
3022
|
+
value — array of interval arrays in ISO 8601 format.
|
|
3023
|
+
for example 2025-02-11T16:00:00:000Z
|
|
3024
|
+
|
|
3025
|
+
2025 — year;
|
|
3026
|
+
02 — month;
|
|
3027
|
+
11 — day of the month;
|
|
3028
|
+
T — separator between date and time;
|
|
3029
|
+
16:00:00 — time in hours:minutes:seconds format;
|
|
3030
|
+
000Z — milliseconds and time zone indication.
|
|
3031
|
+
Z means that the time is specified in UTC format.
|
|
3032
|
+
|
|
2951
3033
|
---
|
|
2952
3034
|
|
|
2953
3035
|
### FormData.getFormsData(langCode, offset, limit)
|
|
2954
3036
|
|
|
2955
|
-
|
|
3037
|
+
Searching for all form data
|
|
2956
3038
|
|
|
2957
3039
|
```js
|
|
2958
3040
|
const value = await FormData.getFormsData()
|
|
@@ -3029,7 +3111,7 @@ Example return:
|
|
|
3029
3111
|
|
|
3030
3112
|
### FormData.postFormsData(data, langCode)
|
|
3031
3113
|
|
|
3032
|
-
|
|
3114
|
+
Creating an object of form data saving information
|
|
3033
3115
|
|
|
3034
3116
|
```js
|
|
3035
3117
|
const body = {
|
|
@@ -3051,14 +3133,6 @@ const value = await FormData.postFormsData(body)
|
|
|
3051
3133
|
><details>
|
|
3052
3134
|
><summary>Schema (body)</summary>
|
|
3053
3135
|
>
|
|
3054
|
-
<!-- >**id:** number <br>
|
|
3055
|
-
>*Data object identifier* <br>
|
|
3056
|
-
>example: 1764 <br>
|
|
3057
|
-
>
|
|
3058
|
-
>**time:** Date <br>
|
|
3059
|
-
>*Form modification date and time* <br>
|
|
3060
|
-
>example: 2023-02-12 10:56 <br> -->
|
|
3061
|
-
>
|
|
3062
3136
|
>**formIdentifier:** string <br>
|
|
3063
3137
|
>*Text identifier of the form object (marker)* <br>
|
|
3064
3138
|
>example: my-form <br>
|
|
@@ -3193,6 +3267,8 @@ Example return:
|
|
|
3193
3267
|
|
|
3194
3268
|
## <h2 id="generaltypes"> GeneralTypes </h2>
|
|
3195
3269
|
|
|
3270
|
+
The `GeneralTypes` module in OneEntry Headless CMS is designed to manage and retrieve general types used within the system. By using the `defineOneEntry` function, you can create a `GeneralTypes` object to interact with these types. The primary method available is `getAllTypes`, which retrieves all objects of type `GeneralTypeEntity` from the API. This method returns a Promise that resolves to an array of `GeneralTypeEntity` objects, each containing an `id` and a `type`. The types cover various purposes, such as page layouts, forms, product blocks, and more, providing flexibility for different content management needs.
|
|
3271
|
+
|
|
3196
3272
|
```js
|
|
3197
3273
|
const { GeneralTypes } = defineOneEntry('your-url');
|
|
3198
3274
|
```
|
|
@@ -3237,6 +3313,8 @@ Example return:
|
|
|
3237
3313
|
|
|
3238
3314
|
## <h2 id="integrationcollections">IntegrationCollections</h2>
|
|
3239
3315
|
|
|
3316
|
+
Integration Collections is a module for storing various data that can be used for integrating different services and systems. To integrate third-party services, it is necessary to create and configure collections.
|
|
3317
|
+
|
|
3240
3318
|
```js
|
|
3241
3319
|
const { IntegrationCollections } = defineOneEntry('your-url');
|
|
3242
3320
|
```
|
|
@@ -3845,6 +3923,8 @@ Returns true (in case of successful deletion) or false (in case of unsuccessful
|
|
|
3845
3923
|
|
|
3846
3924
|
## <h2 id="locales"> Locales </h2>
|
|
3847
3925
|
|
|
3926
|
+
Thanks to the support of multiple languages in Oneentry Headless CMS, you can flexibly customize the interface of your dashboard and conveniently manage languages in your project. In this section, you can learn about the principles of working with languages.
|
|
3927
|
+
|
|
3848
3928
|
```js
|
|
3849
3929
|
const { Locales } = defineOneEntry('your-url');
|
|
3850
3930
|
```
|
|
@@ -3917,6 +3997,24 @@ Example return:
|
|
|
3917
3997
|
|
|
3918
3998
|
## <h2 id="menus"> Menus </h2>
|
|
3919
3999
|
|
|
4000
|
+
The menu is a key element of the structure and navigation of your site. With the menu, you provide visitors with a convenient way to navigate through different sections of your application and find the information they need.
|
|
4001
|
+
|
|
4002
|
+
In OneEntry Headless CMS, you can create the menu structure directly from your personal account. This allows you to change the set of pages included in the menu, their order, and titles without modifying the source code of your application.
|
|
4003
|
+
|
|
4004
|
+
Additionally, if necessary, you can create nested levels in the menu, allowing for a tree-like structure with sections and subsections.
|
|
4005
|
+
|
|
4006
|
+
All of this enables you to work conveniently and flexibly with the navigation of your application directly from your personal account.
|
|
4007
|
+
|
|
4008
|
+
At the core of the menu are pages. The menu structure is created from pages.
|
|
4009
|
+
|
|
4010
|
+
You can define:
|
|
4011
|
+
|
|
4012
|
+
Which pages will be included in the menu
|
|
4013
|
+
In what order they will be presented to the user
|
|
4014
|
+
What title will be given to the menu item leading to a specific page
|
|
4015
|
+
The nesting of menu items (Tree structure)
|
|
4016
|
+
Some of these concepts were discussed in the pages section, and some page settings affect the menu structure you can create from these pages.
|
|
4017
|
+
|
|
3920
4018
|
```js
|
|
3921
4019
|
const { Menus } = defineOneEntry('your-url')
|
|
3922
4020
|
```
|
|
@@ -3994,6 +4092,8 @@ Example return:
|
|
|
3994
4092
|
|
|
3995
4093
|
## <h2 id="orders"> Orders </h2>
|
|
3996
4094
|
|
|
4095
|
+
The ability to make and pay for goods or services is an integral part of the E-commerce application. In this section, you can familiarize yourself with the principles of working with orders.
|
|
4096
|
+
|
|
3997
4097
|
```js
|
|
3998
4098
|
const { Orders } = defineOneEntry('your-url');
|
|
3999
4099
|
```
|
|
@@ -4673,6 +4773,8 @@ Example return:
|
|
|
4673
4773
|
|
|
4674
4774
|
## <h2 id="pages"> Pages </h2>
|
|
4675
4775
|
|
|
4776
|
+
The Pages module in the Headless CMS OneEntry interface allows you to manage pages if it is a web application, or screens if it is a mobile application.
|
|
4777
|
+
|
|
4676
4778
|
```js
|
|
4677
4779
|
const { Pages } = defineOneEntry('your-url');
|
|
4678
4780
|
```
|
|
@@ -4694,7 +4796,7 @@ const value = await Pages.getRootPages()
|
|
|
4694
4796
|
><br>
|
|
4695
4797
|
></details>
|
|
4696
4798
|
|
|
4697
|
-
This method retrieves all top-level page objects from the API. It returns a Promise that resolves to an array of
|
|
4799
|
+
This method retrieves all top-level page objects from the API. It returns a Promise that resolves to an array of top-level page objects or an empty array [] if there is no data.
|
|
4698
4800
|
|
|
4699
4801
|
Example return:
|
|
4700
4802
|
|
|
@@ -4820,7 +4922,7 @@ const value = await Pages.getPages();
|
|
|
4820
4922
|
><br>
|
|
4821
4923
|
></details>
|
|
4822
4924
|
|
|
4823
|
-
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.
|
|
4925
|
+
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.
|
|
4824
4926
|
|
|
4825
4927
|
Example return:
|
|
4826
4928
|
|
|
@@ -4952,7 +5054,7 @@ const value = await Pages.getPageById(1);
|
|
|
4952
5054
|
><br>
|
|
4953
5055
|
></details>
|
|
4954
5056
|
|
|
4955
|
-
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.
|
|
5057
|
+
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.
|
|
4956
5058
|
|
|
4957
5059
|
Example return:
|
|
4958
5060
|
|
|
@@ -5068,7 +5170,7 @@ const value = await Pages.getPageByUrl('shop');
|
|
|
5068
5170
|
><br>
|
|
5069
5171
|
></details>
|
|
5070
5172
|
|
|
5071
|
-
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.
|
|
5173
|
+
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.
|
|
5072
5174
|
|
|
5073
5175
|
Example return:
|
|
5074
5176
|
|
|
@@ -5554,7 +5656,7 @@ const value = await Pages.searchPage('cup')
|
|
|
5554
5656
|
><br>
|
|
5555
5657
|
></details>
|
|
5556
5658
|
|
|
5557
|
-
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 [].
|
|
5659
|
+
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 [].
|
|
5558
5660
|
|
|
5559
5661
|
Example return:
|
|
5560
5662
|
|
|
@@ -5596,6 +5698,8 @@ Example return:
|
|
|
5596
5698
|
|
|
5597
5699
|
## <h2 id="payments"> Payments </h2>
|
|
5598
5700
|
|
|
5701
|
+
An important part of the E-commerce application is working with payments. In this section, you can learn about the principles of working with payments.
|
|
5702
|
+
|
|
5599
5703
|
```js
|
|
5600
5704
|
const { Payments } = defineOneEntry('your-url');
|
|
5601
5705
|
```
|
|
@@ -6244,6 +6348,8 @@ This method use webhook for Stripe. Returns true (in case of successful executio
|
|
|
6244
6348
|
|
|
6245
6349
|
## <h2 id="products"> Products </h2>
|
|
6246
6350
|
|
|
6351
|
+
Products is a separate module in the Headless CMS OneEntry interface that allows you to create a product catalog or a set of multimedia elements, such as a gallery.
|
|
6352
|
+
|
|
6247
6353
|
```js
|
|
6248
6354
|
const { Products } = defineOneEntry('your-url');
|
|
6249
6355
|
```
|
|
@@ -8092,6 +8198,8 @@ Example return:
|
|
|
8092
8198
|
|
|
8093
8199
|
## <h2 id="productstatuses"> ProductStatuses </h2>
|
|
8094
8200
|
|
|
8201
|
+
To create additional filtering conditions for catalog items in Headless CMS OneEntry, the functionality of Product Statuses has been added. In this tab, you can create a status that will serve as an additional filter alongside the existing conditions from attributes.
|
|
8202
|
+
|
|
8095
8203
|
```js
|
|
8096
8204
|
const { ProductStatuses } = defineOneEntry('your-url');
|
|
8097
8205
|
```
|
|
@@ -8297,6 +8405,8 @@ true
|
|
|
8297
8405
|
|
|
8298
8406
|
## <h2 id="system"> System </h2>
|
|
8299
8407
|
|
|
8408
|
+
The System module in OneEntry Headless CMS provides methods for testing error page redirections, allowing developers to ensure that their error handling mechanisms are functioning correctly. By using the defineOneEntry function, you can create a System object to access these functionalities. The module offers two primary methods: test404 and test500. Both methods simulate scenarios where the user is redirected to an error page, specifically 404 (Not Found) and 500 (Internal Server Error) pages, respectively. These tools are essential for verifying that the system's error pages are correctly implemented and displayed to users when needed.
|
|
8409
|
+
|
|
8300
8410
|
```js
|
|
8301
8411
|
const { System } = defineOneEntry('your-url');
|
|
8302
8412
|
```
|
|
@@ -8321,6 +8431,8 @@ const value = await System.test500()
|
|
|
8321
8431
|
|
|
8322
8432
|
## <h2 id="templates"> Templates </h2>
|
|
8323
8433
|
|
|
8434
|
+
Templates help configure the display of the content part of your application. Some templates affect the images stored in the CMS system, while others influence the appearance of other entities, such as blocks, pages, products, etc. In this section, you can familiarize yourself with the principles of working with templates.
|
|
8435
|
+
|
|
8324
8436
|
```js
|
|
8325
8437
|
const { Templates } = defineOneEntry('your-url');
|
|
8326
8438
|
```
|
|
@@ -8679,6 +8791,8 @@ Example return:
|
|
|
8679
8791
|
|
|
8680
8792
|
## <h2 id="templatepreviews"> TemplatePreviews </h2>
|
|
8681
8793
|
|
|
8794
|
+
Preview templates allow you to configure the image parameters used in attributes. By applying a template to an attribute of type "Image" or "Image Group," you will get images standardized according to the specifications in the preview template. This is convenient if the design of your project is sensitive to image sizes. By configuring the preview template, you can change the image parameters that the end user will see.
|
|
8795
|
+
|
|
8682
8796
|
```js
|
|
8683
8797
|
const { TemplatePreviews } = defineOneEntry('your-url');
|
|
8684
8798
|
```
|
|
@@ -8998,6 +9112,8 @@ Example return:
|
|
|
8998
9112
|
|
|
8999
9113
|
## <h2 id="users"> Users </h2>
|
|
9000
9114
|
|
|
9115
|
+
In Headless CMS OneEntry, there are the necessary tools for working with registered users. In this section, you can familiarize yourself with the principles of working with users.
|
|
9116
|
+
|
|
9001
9117
|
You can store the data necessary for your application to work in a state object. When changing the user, add the necessary data to the state. When the user's data is subsequently received, it will contain a state object.
|
|
9002
9118
|
|
|
9003
9119
|
An example in which we add information to the user about how many orders he has made. Add a field "orderCount" with the value to the state object.
|