oneentry 1.0.66 → 1.0.68

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.
Files changed (61) hide show
  1. package/README.md +394 -379
  2. package/dist/_cjs/admins/adminsApi.d.ts +1 -1
  3. package/dist/admins/adminsApi.d.ts +6 -4
  4. package/dist/admins/adminsApi.js +6 -6
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +6 -4
  6. package/dist/attribute-sets/attributeSetsApi.js +7 -7
  7. package/dist/auth-provider/authProviderApi.d.ts +9 -7
  8. package/dist/auth-provider/authProviderApi.js +18 -13
  9. package/dist/auth-provider/authProvidersInterfaces.d.ts +3 -2
  10. package/dist/base/asyncModules.d.ts +16 -0
  11. package/dist/base/asyncModules.js +164 -0
  12. package/dist/base/modules.d.ts +14 -0
  13. package/dist/base/modules.js +173 -0
  14. package/dist/base/oneEntry.d.ts +0 -23
  15. package/dist/base/oneEntry.js +74 -236
  16. package/dist/base/stateModule.d.ts +10 -0
  17. package/dist/base/stateModule.js +13 -0
  18. package/dist/base/syncModules.d.ts +14 -0
  19. package/dist/base/syncModules.js +72 -0
  20. package/dist/base/utils.d.ts +1 -1
  21. package/dist/blocks/blocksApi.d.ts +9 -6
  22. package/dist/blocks/blocksApi.js +17 -16
  23. package/dist/blocks/blocksInterfaces.d.ts +3 -2
  24. package/dist/events/eventsApi.d.ts +6 -4
  25. package/dist/events/eventsApi.js +5 -5
  26. package/dist/file-uploding/fileUploadingApi.d.ts +6 -4
  27. package/dist/file-uploding/fileUploadingApi.js +6 -6
  28. package/dist/forms/formsApi.d.ts +7 -5
  29. package/dist/forms/formsApi.js +8 -8
  30. package/dist/formsData/formsDataApi.d.ts +8 -6
  31. package/dist/formsData/formsDataApi.js +10 -10
  32. package/dist/general-types/typesApi.d.ts +6 -4
  33. package/dist/general-types/typesApi.js +5 -5
  34. package/dist/index.js +22 -20
  35. package/dist/locales/localesApi.d.ts +6 -4
  36. package/dist/locales/localesApi.js +5 -5
  37. package/dist/menus/menusApi.d.ts +7 -5
  38. package/dist/menus/menusApi.js +7 -7
  39. package/dist/orders/ordersApi.d.ts +17 -14
  40. package/dist/orders/ordersApi.js +21 -20
  41. package/dist/orders/ordersInterfaces.d.ts +32 -38
  42. package/dist/pages/pagesApi.d.ts +6 -4
  43. package/dist/pages/pagesApi.js +16 -19
  44. package/dist/payments/paymentsApi.d.ts +6 -10
  45. package/dist/payments/paymentsApi.js +5 -14
  46. package/dist/payments/paymentsInterfaces.d.ts +0 -2
  47. package/dist/product-statuses/productStatusesApi.d.ts +6 -4
  48. package/dist/product-statuses/productStatusesApi.js +8 -8
  49. package/dist/products/productsApi.d.ts +107 -52
  50. package/dist/products/productsApi.js +120 -66
  51. package/dist/products/productsInterfaces.d.ts +16 -8
  52. package/dist/system/systemApi.d.ts +6 -4
  53. package/dist/system/systemApi.js +5 -5
  54. package/dist/templates/templatesApi.d.ts +9 -6
  55. package/dist/templates/templatesApi.js +9 -9
  56. package/dist/templates/templatesInterfaces.d.ts +2 -1
  57. package/dist/templates-preview/templatesPreviewApi.d.ts +8 -6
  58. package/dist/templates-preview/templatesPreviewApi.js +10 -10
  59. package/dist/users/usersApi.d.ts +6 -4
  60. package/dist/users/usersApi.js +8 -8
  61. package/package.json +1 -1
package/README.md CHANGED
@@ -1,18 +1,18 @@
1
- # OneEntry SDK
1
+ # AsyncModules SDK
2
2
 
3
- OneEntry Headless CMS SDK is an SDK that provides an easy way to interact with the OneEntry Headless CMS API.
3
+ AsyncModules Headless CMS SDK is an SDK that provides an easy way to interact with the AsyncModules Headless CMS API.
4
4
 
5
5
  ## Official Site
6
6
 
7
- Visit the official OneEntry website at [https://oneentry.cloud](https://oneentry.cloud) to learn more about the OneEntry Headless CMS.
7
+ Visit the official AsyncModules website at [https://oneentry.cloud](https://oneentry.cloud) to learn more about the AsyncModules Headless CMS.
8
8
 
9
9
  ## Sign Up
10
10
 
11
- To get started with OneEntry, sign up for an account at [https://account.oneentry.cloud/authentication/register](https://account.oneentry.cloud/authentication/register).
11
+ To get started with AsyncModules, sign up for an account at [https://account.oneentry.cloud/authentication/register](https://account.oneentry.cloud/authentication/register).
12
12
 
13
13
  # Installation
14
14
 
15
- To install the OneEntry Headless CMS SDK in your project, run the following command:
15
+ To install the AsyncModules Headless CMS SDK in your project, run the following command:
16
16
 
17
17
  ```bash
18
18
  npm install oneentry
@@ -20,7 +20,7 @@ npm install oneentry
20
20
 
21
21
  # Usage
22
22
 
23
- To use the OneEntry Headless CMS SDK in your project, import the defineOneEntry function:
23
+ To use the AsyncModules Headless CMS SDK in your project, import the defineOneEntry function:
24
24
  ```js
25
25
  import { defineOneEntry } from 'oneentry'
26
26
 
@@ -55,7 +55,7 @@ const api = defineOneEntry('your-url');
55
55
 
56
56
  The second parameter of the function takes a configuration object with the keys "token", "langCode" and "multipleResponse".
57
57
  Set the token key if your project secure "Security API Token"
58
- If your project uses user authorization, pass the user access token to the "userToken" variable to use methods that require authorization.
58
+ If your project uses user authorization, pass the user REFRESH TOKEN to the "userToken" variable to use methods that require authorization.
59
59
  Set the "langCode" to set the default language. By specifying this parameter once, you don't have to pass the langCode to the methods ONEENTRY API. If you have not passed the default language, it will be set "en_US"
60
60
  Some methods use more than one request to the CMS so that the data you receive is complete and easy to work with. Pass the value "false" for this parameter to save traffic and decide for yourself what data you need. The default value "true"
61
61
 
@@ -76,7 +76,7 @@ You can also connect a tls certificate to protect your project. In this case, do
76
76
  ```js
77
77
  const api = defineOneEntry('your-url', {
78
78
  token: 'my-token',
79
- userToken: 'user.token',
79
+ userToken: 'rerfesh.token',
80
80
  langCode:'my-langCode',
81
81
  })
82
82
  ```
@@ -773,13 +773,13 @@ example: email <br>
773
773
  const { Blocks } = defineOneEntry('your-url');
774
774
  ```
775
775
 
776
- ### Blocks.getBlocks(langCode, offset, limit)
776
+ ### Blocks.getBlocks(type, langCode, offset, limit)
777
777
 
778
778
  ```js
779
- const value = await Blocks.getBlocks('en_US', 0, 30)
779
+ const value = await Blocks.getBlocks()
780
780
  ```
781
781
 
782
- > This method return array of all blocks object.
782
+ > This method return array of all blocks object. Available values of type : forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service
783
783
 
784
784
  Example return:
785
785
 
@@ -1882,7 +1882,7 @@ const { Orders } = defineOneEntry('your-url');
1882
1882
  ### Orders.getOrderByMarker(marker, langCode)
1883
1883
 
1884
1884
  ```js
1885
- const value = await Orders.getOrderByMarker('my-order', 'en_US')
1885
+ const value = await Orders.getOrderByMarker('my-order')
1886
1886
  ```
1887
1887
 
1888
1888
  > This method retrieves one order storage object by marker.
@@ -1940,31 +1940,31 @@ example: [{ "identifier": "p1" }] <br>
1940
1940
  const body = {
1941
1941
  "formIdentifier": "order_form",
1942
1942
  "paymentAccountIdentifier": "stripe",
1943
- "currency": "USD",
1944
1943
  "formData": [
1945
1944
  {
1946
1945
  "marker": "name_order",
1947
- "value": "Alex"
1946
+ "value": "Alex",
1947
+ "type": "string"
1948
1948
  },
1949
1949
  {
1950
1950
  "marker": "phone_order",
1951
- "value": "+19999999999"
1951
+ "value": "+19999999999",
1952
+ "type": "string"
1952
1953
  },
1953
1954
  {
1954
1955
  "marker": "email_order",
1955
- "value": "example@oneentry.cloud"
1956
+ "value": "example@oneentry.cloud",
1957
+ "type": "string"
1956
1958
  }
1957
1959
  ],
1958
1960
  "products": [
1959
1961
  {
1960
1962
  "productId": 444,
1961
1963
  "quantity": 1,
1962
- "price": "0.1"
1963
1964
  },
1964
1965
  {
1965
1966
  "productId": 446,
1966
1967
  "quantity": 3,
1967
- "price": "123"
1968
1968
  }
1969
1969
  ]
1970
1970
  }
@@ -1977,40 +1977,28 @@ const value = await Orders.createOrder('my-order', body)
1977
1977
  Example return:
1978
1978
  ```json
1979
1979
  {
1980
- "id": 17,
1980
+ "formIdentifier": "bars",
1981
+ "paymentAccountIdentifier": "payment1",
1981
1982
  "statusIdentifier": "inprogress",
1982
- "formIdentifier": "order-form",
1983
- "paymentIdentifier": "payment-1",
1984
1983
  "formData": [
1985
- {
1986
- "marker": "name_1",
1987
- "value": "Name"
1988
- }
1989
- ],
1984
+ {
1985
+ "marker": "Name",
1986
+ "value": "Name"
1987
+ }
1988
+ ],
1990
1989
  "products": [
1991
1990
  {
1992
- "id": 1,
1993
- "title": "Floorwood Maxima Laminate, 9811 Oak Mistral",
1994
- "sku": null,
1995
- "price": "1.00",
1996
- "quantity": 10,
1997
- "previewImage": [
1998
- {
1999
- "filename": "files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
2000
- "downloadLink": "http://my-site.com/files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
2001
- "size": 296391,
2002
- "previewLink": ""
2003
- }
2004
- ]
1991
+ "productId": 1,
1992
+ "quantity": 2
1993
+ },
1994
+ {
1995
+ "productId": 2,
1996
+ "quantity": 3
2005
1997
  }
2006
1998
  ],
2007
- "totalSum": "12.00",
1999
+ "createdDate": "2024-06-04T09:57:38.328Z",
2008
2000
  "currency": "USD",
2009
- "createdDate": "2023-01-01 12:12",
2010
- "paymentAccountIdentifier": "payment-1",
2011
- "paymentAccountLocalizeInfos": {
2012
- "title": "Account 1"
2013
- }
2001
+ "totalSum": 345
2014
2002
  }
2015
2003
  ```
2016
2004
  <details>
@@ -2024,7 +2012,7 @@ example: inprogress <br>
2024
2012
  *text identifier of the form status* <br>
2025
2013
  example: order-form <br>
2026
2014
 
2027
- **paymentIdentifier** string <br>
2015
+ **paymentAccountIdentifier** string <br>
2028
2016
  *text identifier of the order payment* <br>
2029
2017
  example: payment-1 <br>
2030
2018
 
@@ -2047,17 +2035,6 @@ example: USD <br>
2047
2035
  *date when the order was created* <br>
2048
2036
  example: 2023-01-01 12:12 <br>
2049
2037
 
2050
- **price** number <br>
2051
- *price of the product per unit (at the time of ordering)* <br>
2052
- example: 20.00 <br>
2053
-
2054
- **paymentAccountIdentifier** string <br>
2055
- *textual identifier for the order payment* <br>
2056
- example: payment-1 <br>
2057
-
2058
- **paymentAccountLocalizeInfos** CommonLocalizeInfos <br>
2059
- *payment account name considering localization* <br>
2060
- example: { "title": "Account 1" } <br>
2061
2038
  </details>
2062
2039
 
2063
2040
 
@@ -2067,31 +2044,31 @@ example: { "title": "Account 1" } <br>
2067
2044
  const body = {
2068
2045
  "formIdentifier": "order_form",
2069
2046
  "paymentAccountIdentifier": "stripe",
2070
- "currency": "USD",
2071
2047
  "formData": [
2072
2048
  {
2073
2049
  "marker": "name_order",
2074
- "value": "Alex"
2050
+ "value": "Alex",
2051
+ "type": "string"
2075
2052
  },
2076
2053
  {
2077
2054
  "marker": "phone_order",
2078
- "value": "+19999999999"
2055
+ "value": "+19999999999",
2056
+ "type": "string"
2079
2057
  },
2080
2058
  {
2081
2059
  "marker": "email_order",
2082
- "value": "example@oneentry.cloud"
2060
+ "value": "example@oneentry.cloud",
2061
+ "type": "string"
2083
2062
  }
2084
2063
  ],
2085
2064
  "products": [
2086
2065
  {
2087
2066
  "productId": 444,
2088
2067
  "quantity": 1,
2089
- "price": "0.1"
2090
2068
  },
2091
2069
  {
2092
2070
  "productId": 446,
2093
2071
  "quantity": 3,
2094
- "price": "123"
2095
2072
  }
2096
2073
  ]
2097
2074
  }
@@ -2104,40 +2081,28 @@ const value = await Orders.updateOrderByMarkerAndId('my-order', body)
2104
2081
  Example return:
2105
2082
  ```json
2106
2083
  {
2107
- "id": 17,
2084
+ "formIdentifier": "bars",
2085
+ "paymentAccountIdentifier": "payment1",
2108
2086
  "statusIdentifier": "inprogress",
2109
- "formIdentifier": "order-form",
2110
- "paymentIdentifier": "payment-1",
2111
2087
  "formData": [
2112
- {
2113
- "marker": "name_1",
2114
- "value": "Name"
2115
- }
2116
- ],
2088
+ {
2089
+ "marker": "Name",
2090
+ "value": "Name"
2091
+ }
2092
+ ],
2117
2093
  "products": [
2118
2094
  {
2119
- "id": 1,
2120
- "title": "Floorwood Maxima Laminate, 9811 Oak Mistral",
2121
- "sku": null,
2122
- "price": "1.00",
2123
- "quantity": 10,
2124
- "previewImage": [
2125
- {
2126
- "filename": "files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
2127
- "downloadLink": "http://my-site.com/files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
2128
- "size": 296391,
2129
- "previewLink": ""
2130
- }
2131
- ]
2095
+ "productId": 1,
2096
+ "quantity": 2
2097
+ },
2098
+ {
2099
+ "productId": 2,
2100
+ "quantity": 3
2132
2101
  }
2133
2102
  ],
2134
- "totalSum": "12.00",
2103
+ "createdDate": "2024-06-04T09:57:38.328Z",
2135
2104
  "currency": "USD",
2136
- "createdDate": "2023-01-01 12:12",
2137
- "paymentAccountIdentifier": "payment-1",
2138
- "paymentAccountLocalizeInfos": {
2139
- "title": "Account 1"
2140
- }
2105
+ "totalSum": 345
2141
2106
  }
2142
2107
  ```
2143
2108
  <details>
@@ -2151,7 +2116,7 @@ example: inprogress <br>
2151
2116
  *text identifier of the form status* <br>
2152
2117
  example: order-form <br>
2153
2118
 
2154
- **paymentIdentifier** string <br>
2119
+ **paymentAccountIdentifier** string <br>
2155
2120
  *text identifier of the order payment* <br>
2156
2121
  example: payment-1 <br>
2157
2122
 
@@ -2174,17 +2139,6 @@ example: USD <br>
2174
2139
  *date when the order was created* <br>
2175
2140
  example: 2023-01-01 12:12 <br>
2176
2141
 
2177
- **price** number <br>
2178
- *price of the product per unit (at the time of ordering)* <br>
2179
- example: 20.00 <br>
2180
-
2181
- **paymentAccountIdentifier** string <br>
2182
- *textual identifier for the order payment* <br>
2183
- example: payment-1 <br>
2184
-
2185
- **paymentAccountLocalizeInfos** CommonLocalizeInfos <br>
2186
- *payment account name considering localization* <br>
2187
- example: { "title": "Account 1" } <br>
2188
2142
  </details>
2189
2143
 
2190
2144
 
@@ -2245,7 +2199,7 @@ example: [{ "identifier": "p1" }] <br>
2245
2199
  </details>
2246
2200
 
2247
2201
 
2248
- ### Orders.getAllOrdersByMarker(marker, langCode)
2202
+ ### Orders.getAllOrdersByMarker(marker, langCode, limit, offset)
2249
2203
 
2250
2204
  ```js
2251
2205
  const value = await Orders.getAllOrdersByMarker('my-order')
@@ -2254,45 +2208,48 @@ const value = await Orders.getAllOrdersByMarker('my-order')
2254
2208
  > This method getting all order storage object by marker. The method will add the default language to the request body. If you want to change the language, just pass it with the second argument
2255
2209
 
2256
2210
  Example return:
2211
+
2257
2212
  ```json
2258
- {
2259
- "id": 17,
2260
- "statusIdentifier": "inprogress",
2261
- "formIdentifier": "order-form",
2262
- "paymentIdentifier": "payment-1",
2263
- "formData": [
2264
- {
2265
- "marker": "name_1",
2266
- "value": "Name"
2267
- }
2268
- ],
2269
- "products": [
2270
- {
2271
- "id": 1,
2272
- "title": "Floorwood Maxima Laminate, 9811 Oak Mistral",
2273
- "sku": null,
2274
- "price": "1.00",
2275
- "quantity": 10,
2276
- "previewImage": [
2277
- {
2278
- "filename": "files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
2279
- "downloadLink": "http://my-site.com/files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
2280
- "size": 296391,
2281
- "previewLink": ""
2282
- }
2283
- ]
2284
- }
2285
- ],
2286
- "totalSum": "12.00",
2287
- "currency": "USD",
2288
- "createdDate": "2023-01-01 12:12",
2289
- "price": 20,
2290
- "paymentAccountIdentifier": "payment-1",
2291
- "paymentAccountLocalizeInfos": {
2292
- "title": "Account 1"
2293
- },
2294
- "isHistory": true
2295
- }
2213
+ [
2214
+ {
2215
+ "id": 17,
2216
+ "statusIdentifier": "inprogress",
2217
+ "paymentIdentifier": "payment-1",
2218
+ "formData": [
2219
+ {
2220
+ "marker": "name_1",
2221
+ "value": "Name",
2222
+ "type": "string"
2223
+ }
2224
+ ],
2225
+ "products": [
2226
+ {
2227
+ "id": 1,
2228
+ "title": "Floorwood Maxima Laminate, 9811 Oak Mistral",
2229
+ "sku": null,
2230
+ "price": "1.00",
2231
+ "quantity": 10,
2232
+ "previewImage": [
2233
+ {
2234
+ "filename": "files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
2235
+ "downloadLink": "http://my-site.com/files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
2236
+ "size": 296391,
2237
+ "previewLink": ""
2238
+ }
2239
+ ]
2240
+ }
2241
+ ],
2242
+ "totalSum": "12.00",
2243
+ "currency": "USD",
2244
+ "createdDate": "2023-01-01 12:12",
2245
+ "price": 20,
2246
+ "paymentAccountIdentifier": "payment-1",
2247
+ "paymentAccountLocalizeInfos": {
2248
+ "title": "Account 1"
2249
+ },
2250
+ "isHistory": true
2251
+ }
2252
+ ]
2296
2253
  ```
2297
2254
  <details>
2298
2255
  <summary>Schema</summary>
@@ -2305,9 +2262,6 @@ example: inprogress <br>
2305
2262
  *text identifier of the form status* <br>
2306
2263
  example: order-form <br>
2307
2264
 
2308
- **paymentIdentifier** string <br>
2309
- *text identifier of the order payment* <br>
2310
- example: payment-1 <br>
2311
2265
 
2312
2266
  **formData** FormDataType <br>
2313
2267
  *data submitted by the form linked to the order store* <br>
@@ -3838,7 +3792,7 @@ const { Products } = defineOneEntry('your-url');
3838
3792
  ```
3839
3793
 
3840
3794
  >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.
3841
-
3795
+ >Some methods accept the body as a parameter for filtering. If you don't want to set up sorting, pass an empty array or don't pass anything.
3842
3796
  Parameters:
3843
3797
 
3844
3798
  ```js
@@ -3872,13 +3826,33 @@ const userQuery = {
3872
3826
  > 'nexs' - Does not exist
3873
3827
 
3874
3828
 
3875
- ### Products.getProducts(langCode, userQuery)
3829
+ ### Products.getProducts(body, langCode, userQuery)
3876
3830
 
3877
3831
  ```js
3878
- const value = await Products.getProducts('en_US', userQuery)
3832
+ const body = [
3833
+ {
3834
+ "attributeMarker": "price",
3835
+ "conditionMarker": "mth",
3836
+ "statusMarker": "waiting",
3837
+ "conditionValue": 1,
3838
+ "pageUrls": [
3839
+ "23-laminat-floorwood-maxima"
3840
+ ]
3841
+ },
3842
+ {
3843
+ "attributeMarker": "price",
3844
+ "conditionMarker": "lth",
3845
+ "conditionValue": 3,
3846
+ "pageUrls": [
3847
+ "23-laminat-floorwood-maxima"
3848
+ ]
3849
+ }
3850
+ ]
3851
+
3852
+ const value = await Products.getProducts(body)
3879
3853
  ```
3880
3854
 
3881
- > 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[]).
3855
+ > This method searches for all products 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.
3882
3856
 
3883
3857
  Example return:
3884
3858
 
@@ -3922,18 +3896,17 @@ Example return:
3922
3896
  "templateIdentifier": "my-template",
3923
3897
  "shortDescTemplateIdentifier": "my-template-short",
3924
3898
  "attributeValues": {
3925
- "marker": {
3926
- "value": "",
3927
- "type": "string",
3928
- "position": 1,
3929
- "isProductPreview": false
3899
+ "marker": {
3900
+ "value": "",
3901
+ "type": "string",
3902
+ "position": 1,
3903
+ "isProductPreview": false
3930
3904
  }
3931
3905
  },
3932
3906
  "position": 1
3933
3907
  }
3934
3908
  ]
3935
3909
  ```
3936
-
3937
3910
  <details>
3938
3911
  <summary>Schema</summary>
3939
3912
 
@@ -3969,6 +3942,10 @@ example: my-template <br>
3969
3942
  *attribute set identifier* <br>
3970
3943
  example: 7 <br>
3971
3944
 
3945
+ **blocks:** array <br>
3946
+ *product blocks* <br>
3947
+ example: ['product_block'] <br>
3948
+
3972
3949
  **isSync:** boolean <br>
3973
3950
  *indicator of page indexing (true or false)* <br>
3974
3951
  example: false <br>
@@ -4139,64 +4116,86 @@ example: my-template-short <br>
4139
4116
  </details>
4140
4117
 
4141
4118
 
4142
- ### Products.getProductsPageById(id, langCode, userQuery)
4119
+ ### Products.getProductsByPageId(id, body, langCode, userQuery)
4143
4120
 
4144
4121
  ```js
4145
- const value = await Products.getProductsPageById(1, 'en_US', userQuery)
4122
+ const body = [
4123
+ {
4124
+ "attributeMarker": "price",
4125
+ "conditionMarker": "mth",
4126
+ "statusMarker": "waiting",
4127
+ "conditionValue": 1,
4128
+ "pageUrls": [
4129
+ "23-laminat-floorwood-maxima"
4130
+ ]
4131
+ },
4132
+ {
4133
+ "attributeMarker": "price",
4134
+ "conditionMarker": "lth",
4135
+ "conditionValue": 3,
4136
+ "pageUrls": [
4137
+ "23-laminat-floorwood-maxima"
4138
+ ]
4139
+ }
4140
+ ]
4141
+
4142
+ const value = await Products.getProductsByPageId(1764, body)
4146
4143
  ```
4147
4144
 
4148
- > 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.
4145
+ > This method searches for all products objects with pagination for the selected 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.
4149
4146
 
4150
4147
  Example return:
4151
4148
 
4152
4149
  ```json
4153
- {
4154
- "id": 1764,
4155
- "localizeInfos": {
4156
- "title": "Product"
4157
- },
4158
- "isVisible": true,
4159
- "statusId": 1,
4160
- "relatedIds": [
4161
- 1,
4162
- 2,
4163
- 3
4164
- ],
4165
- "attributeSetId": 7,
4166
- "isSync": true,
4167
- "price": 0,
4168
- "additional": {
4169
- "prices": {
4170
- "min": 0,
4171
- "max": 100
4172
- }
4173
- },
4174
- "blocks": [
4175
- null
4176
- ],
4177
- "sku": "0-123",
4178
- "productPages": [
4179
- {
4180
- "id": 8997,
4181
- "pageId": 1176,
4182
- "productId": 8872
4183
- }
4184
- ],
4185
- "statusLocalizeInfos": {
4186
- "title": "Product"
4187
- },
4188
- "templateIdentifier": "my-template",
4189
- "shortDescTemplateIdentifier": "my-template-short",
4190
- "attributeValues": {
4191
- "marker": {
4192
- "value": "",
4193
- "type": "string",
4194
- "position": 1,
4195
- "isProductPreview": false
4196
- }
4197
- },
4198
- "position": 1
4199
- }
4150
+ [
4151
+ {
4152
+ "id": 1764,
4153
+ "localizeInfos": {
4154
+ "title": "Product"
4155
+ },
4156
+ "isVisible": true,
4157
+ "statusId": 1,
4158
+ "relatedIds": [
4159
+ 1,
4160
+ 2,
4161
+ 3
4162
+ ],
4163
+ "attributeSetId": 7,
4164
+ "isSync": true,
4165
+ "price": 0,
4166
+ "additional": {
4167
+ "prices": {
4168
+ "min": 0,
4169
+ "max": 100
4170
+ }
4171
+ },
4172
+ "blocks": [
4173
+ null
4174
+ ],
4175
+ "sku": "0-123",
4176
+ "productPages": [
4177
+ {
4178
+ "id": 8997,
4179
+ "pageId": 1176,
4180
+ "productId": 8872
4181
+ }
4182
+ ],
4183
+ "statusLocalizeInfos": {
4184
+ "title": "Product"
4185
+ },
4186
+ "templateIdentifier": "my-template",
4187
+ "shortDescTemplateIdentifier": "my-template-short",
4188
+ "attributeValues": {
4189
+ "marker": {
4190
+ "value": "",
4191
+ "type": "string",
4192
+ "position": 1,
4193
+ "isProductPreview": false
4194
+ }
4195
+ },
4196
+ "position": 1
4197
+ }
4198
+ ]
4200
4199
  ```
4201
4200
  <details>
4202
4201
  <summary>Schema</summary>
@@ -4271,64 +4270,119 @@ example: my-template-short <br>
4271
4270
 
4272
4271
  </details>
4273
4272
 
4274
- ### Products.getProductsPageByUrl(url, langCode, userQuery)
4273
+
4274
+ ### Products.getProductsPriceByPageUrl(url, userQuery)
4275
4275
 
4276
4276
  ```js
4277
- const value = await Products.getProductsPageByUrl('cup', 'en_US', userQuery)
4277
+ const value = await Products.getProductsPriceByPageUrl('catalog')
4278
4278
  ```
4279
4279
 
4280
- > 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.
4280
+ > This method searches for information about products and prices for the selected 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.
4281
4281
 
4282
4282
  Example return:
4283
4283
 
4284
4284
  ```json
4285
- {
4286
- "id": 1764,
4287
- "localizeInfos": {
4288
- "title": "Product"
4289
- },
4290
- "isVisible": true,
4291
- "statusId": 1,
4292
- "relatedIds": [
4293
- 1,
4294
- 2,
4295
- 3
4296
- ],
4297
- "attributeSetId": 7,
4298
- "isSync": true,
4299
- "price": 0,
4300
- "additional": {
4301
- "prices": {
4302
- "min": 0,
4303
- "max": 100
4285
+ [
4286
+ {
4287
+ "id": 1764,
4288
+ "price": 0
4289
+ }
4290
+ ]
4291
+ ```
4292
+ <details>
4293
+ <summary>Schema</summary>
4294
+
4295
+ **id:** number <br>
4296
+ *object identifier* <br>
4297
+ example: 1764 <br>
4298
+
4299
+ **price:** number <br>
4300
+ *price value of the product page taken from the index* <br>
4301
+ example: 0 <br>
4302
+
4303
+ </details>
4304
+
4305
+
4306
+ ### Products.getProductsByPageUrl(url, body, langCode, userQuery)
4307
+
4308
+ ```js
4309
+ const body = [
4310
+ {
4311
+ "attributeMarker": "price",
4312
+ "conditionMarker": "mth",
4313
+ "statusMarker": "waiting",
4314
+ "conditionValue": 1,
4315
+ "pageUrls": [
4316
+ "23-laminat-floorwood-maxima"
4317
+ ]
4318
+ },
4319
+ {
4320
+ "attributeMarker": "price",
4321
+ "conditionMarker": "lth",
4322
+ "conditionValue": 3,
4323
+ "pageUrls": [
4324
+ "23-laminat-floorwood-maxima"
4325
+ ]
4304
4326
  }
4305
- },
4306
- "blocks": [
4307
- null
4308
- ],
4309
- "sku": "0-123",
4310
- "productPages": [
4311
- {
4312
- "id": 8997,
4313
- "pageId": 1176,
4314
- "productId": 8872
4315
- }
4316
- ],
4317
- "statusLocalizeInfos": {
4318
- "title": "Product"
4319
- },
4320
- "templateIdentifier": "my-template",
4321
- "shortDescTemplateIdentifier": "my-template-short",
4322
- "attributeValues": {
4323
- "marker": {
4324
- "value": "",
4325
- "type": "string",
4326
- "position": 1,
4327
- "isProductPreview": false
4328
- }
4329
- },
4330
- "position": 1
4331
- }
4327
+ ]
4328
+
4329
+ const value = await Products.getProductsByPageUrl('catalog', body)
4330
+ ```
4331
+
4332
+ > This method searches for all products objects with pagination for the selected 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.
4333
+
4334
+ Example return:
4335
+
4336
+ ```json
4337
+ [
4338
+ {
4339
+ "id": 1764,
4340
+ "localizeInfos": {
4341
+ "title": "Product"
4342
+ },
4343
+ "isVisible": true,
4344
+ "statusId": 1,
4345
+ "relatedIds": [
4346
+ 1,
4347
+ 2,
4348
+ 3
4349
+ ],
4350
+ "attributeSetId": 7,
4351
+ "isSync": true,
4352
+ "price": 0,
4353
+ "additional": {
4354
+ "prices": {
4355
+ "min": 0,
4356
+ "max": 100
4357
+ }
4358
+ },
4359
+ "blocks": [
4360
+ null
4361
+ ],
4362
+ "sku": "0-123",
4363
+ "productPages": [
4364
+ {
4365
+ "id": 8997,
4366
+ "pageId": 1176,
4367
+ "productId": 8872
4368
+ }
4369
+ ],
4370
+ "statusLocalizeInfos": {
4371
+ "title": "Product"
4372
+ },
4373
+ "templateIdentifier": "my-template",
4374
+ "shortDescTemplateIdentifier": "my-template-short",
4375
+ "attributeValues": {
4376
+ "marker": {
4377
+ "value": "",
4378
+ "type": "string",
4379
+ "position": 1,
4380
+ "isProductPreview": false
4381
+ }
4382
+ },
4383
+ "position": 1
4384
+ }
4385
+ ]
4332
4386
  ```
4333
4387
  <details>
4334
4388
  <summary>Schema</summary>
@@ -4345,7 +4399,6 @@ example: OrderedMap { "prices": OrderedMap { "min": 0, "max": 100 } } <br>
4345
4399
  *json description of the item status object, taking into account the language* <br>
4346
4400
  example: { "title": "Product" <br>
4347
4401
 
4348
-
4349
4402
  **localizeInfos:** Record<string, any> <br>
4350
4403
  *json description of the main page data object taking into account the language "en_US" (for example)* <br>
4351
4404
  example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "<b>Content for catalog</b>", "menuTitle": "Catalog" } } <br>
@@ -4404,6 +4457,7 @@ example: my-template-short <br>
4404
4457
 
4405
4458
  </details>
4406
4459
 
4460
+
4407
4461
  ### Products.getRelatedProductsById(id, langCode, userQuery)
4408
4462
 
4409
4463
  ```js
@@ -4669,162 +4723,123 @@ example: my-template-short <br>
4669
4723
  </details>
4670
4724
 
4671
4725
 
4672
- ### Products.filterProduct(data, langCode, userQuery)
4726
+ ### Products.getProductBlockById(id)
4673
4727
 
4674
4728
  ```js
4675
- const data = {
4676
- attributeMarker: "price",
4677
- conditionMarker: "lth",
4678
- conditionValue: "200",
4679
- }
4680
-
4681
- const value = await Products.filterProduct(data, 'en_US', userQuery)
4729
+ const value = await Products.getProductBlockById(1764)
4682
4730
  ```
4683
4731
 
4684
- Example body:
4732
+ > This method Getting a product block object by product id.
4685
4733
 
4686
- ```js
4734
+ Example return:
4735
+
4736
+ ```json
4687
4737
  [
4688
4738
  {
4689
- "attributeMarker": "price",
4690
- "conditionMarker": "mth",
4691
- "conditionValue": 1,
4692
- "pageId": 0
4693
- },
4694
- {
4695
- "attributeMarker": "price",
4696
- "conditionMarker": "lth",
4697
- "conditionValue": 3,
4698
- "pageId": 0
4739
+ "id": 4,
4740
+ "localizeInfos": {
4741
+ "title": "Name"
4742
+ },
4743
+ "version": 0,
4744
+ "position": 3,
4745
+ "identifier": "product",
4746
+ "type": "forProductBlock",
4747
+ "templateIdentifier": null,
4748
+ "isVisible": true,
4749
+ "attributeValues": {
4750
+ "attr": {
4751
+ "type": "string",
4752
+ "value": "",
4753
+ "position": 0,
4754
+ "isProductPreview": false
4755
+ }
4756
+ },
4757
+ "countElementsPerRow": 3,
4758
+ "products": [
4759
+ {
4760
+ "id": 446,
4761
+ "localizeInfos": {
4762
+ "title": "new product 3"
4763
+ },
4764
+ "relatedIds": [1, 2],
4765
+ "statusId": null,
4766
+ "attributeSetId": 11,
4767
+ "position": 3,
4768
+ "templateIdentifier": null,
4769
+ "shortDescTemplateIdentifier": null,
4770
+ "price": 543,
4771
+ "sku": "ggg",
4772
+ "isSync": true,
4773
+ "attributeValues": {
4774
+ "sku": {
4775
+ "type": "string",
4776
+ "value": "ggg",
4777
+ "position": 0,
4778
+ "isProductPreview": false
4779
+ },
4780
+ "images": {
4781
+ "type": "groupOfImages",
4782
+ "value": {},
4783
+ "position": 3,
4784
+ "isProductPreview": false
4785
+ }
4786
+ },
4787
+ "isVisible": true
4788
+ }
4789
+ ]
4699
4790
  }
4700
4791
  ]
4701
4792
  ```
4702
4793
 
4703
- > 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}.
4704
-
4705
- Example return:
4706
-
4707
- ```json
4708
- {
4709
- "id": 1764,
4710
- "localizeInfos": {
4711
- "title": "Product"
4712
- },
4713
- "isVisible": true,
4714
- "statusId": 1,
4715
- "relatedIds": [
4716
- 1,
4717
- 2,
4718
- 3
4719
- ],
4720
- "attributeSetId": 7,
4721
- "isSync": true,
4722
- "price": 0,
4723
- "additional": {
4724
- "prices": {
4725
- "min": 0,
4726
- "max": 100
4727
- }
4728
- },
4729
- "blocks": [
4730
- null
4731
- ],
4732
- "sku": "0-123",
4733
- "productPages": [
4734
- {
4735
- "id": 8997,
4736
- "pageId": 1176,
4737
- "productId": 8872
4738
- }
4739
- ],
4740
- "statusLocalizeInfos": {
4741
- "title": "Product"
4742
- },
4743
- "templateIdentifier": "my-template",
4744
- "shortDescTemplateIdentifier": "my-template-short",
4745
- "attributeValues": {
4746
- "marker": {
4747
- "value": "",
4748
- "type": "string",
4749
- "position": 1,
4750
- "isProductPreview": false
4751
- }
4752
- },
4753
- "position": 1
4754
- }
4755
- ```
4756
4794
  <details>
4757
4795
  <summary>Schema</summary>
4758
4796
 
4759
4797
  **id:** number <br>
4760
- *object identifier* <br>
4798
+ *object identifier*
4761
4799
  example: 1764 <br>
4762
4800
 
4763
- **additional:** Record<string, any> <br>
4764
- *additional value from the index* <br>
4765
- example: OrderedMap { "prices": OrderedMap { "min": 0, "max": 100 } } <br>
4801
+ **attributeSetId:** number <br>
4802
+ *identifier for the used attribute set* <br>
4803
+ example: 7 <br>
4766
4804
 
4767
- **statusLocalizeInfos:** CommonLocalizeInfos <br>
4768
- *json description of the item status object, taking into account the language* <br>
4769
- example: { "title": "Product" <br>
4805
+ **localizeInfos:** CommonLocalizeInfos <br>
4806
+ *block name with localization* <br>
4807
+ example: OrderedMap { "en_US": OrderedMap { "title": "My block" } } <br>
4770
4808
 
4771
- **localizeInfos:** Record<string, any> <br>
4772
- *json description of the main page data object taking into account the language "en_US" (for example)* <br>
4773
- example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "<b>Content for catalog</b>", "menuTitle": "Catalog" } } <br>
4809
+ **customSettings:** BlockCustomSettings <br>
4810
+ *custom settings for different block types* <br>
4811
+ example: OrderedMap { "sliderDelay": 0, "sliderDelayType": "", "productQuantity": 4, "productSortType": "By_ID", "productSortOrder": "Descending", "productCountElementsPerRow": 10, "similarProductRules": List [ OrderedMap { "property": "Descending", "includes": "", "keywords": "", "strict": "" } ] } <br>
4774
4812
 
4775
- **isVisible:** boolean <br>
4776
- *Page visibility flag* <br>
4777
- example: true <br>
4813
+ **version:** number <br>
4814
+ *object version number* <br>
4815
+ example: 10 <br>
4778
4816
 
4779
- **position:** number <br>
4817
+ **identifier:** string <br>
4818
+ *textual identifier for the field record* <br>
4819
+ example: catalog <br>
4820
+ default: marker <br>
4821
+
4822
+ **position:** number <br>
4780
4823
  *position number (for sorting)* <br>
4781
4824
  example: 192 <br>
4782
4825
 
4783
- **templateIdentifier:** string <br>
4784
- *custom identifier of the associated template* <br>
4785
- example: my-template <br>
4786
-
4787
- **attributeSetId:** number <br>
4788
- *attribute set identifier* <br>
4789
- example: 7 <br>
4790
-
4791
- **blocks:** array <br>
4792
- *product blocks* <br>
4793
- example: ['product_block'] <br>
4794
-
4795
- **isSync:** boolean <br>
4796
- *indicator of page indexing (true or false)* <br>
4797
- example: false <br>
4798
-
4799
4826
  **attributeValues:** Record<string, string> <br>
4800
- *Array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value)* <br>
4827
+ *array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value)* <br>
4801
4828
  example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } } <br>
4802
4829
 
4803
- **statusId:** number <br>
4804
- *status identifiers of the product page (can be null)* <br>
4805
- example: 1 <br>
4806
-
4807
- **sku:** string <br>
4808
- *product SKU value taken from the index* <br>
4809
- example: 1 <br>
4810
-
4811
- **relatedIds:** array <br>
4812
- *identifiers of related product pages* <br>
4813
- example: List [ 1, 2, 3 ] <br>
4830
+ **type:** string <br>
4831
+ *block type* <br>
4832
+ example: forNewsPage <br>
4814
4833
 
4815
- **price:** number <br>
4816
- *price value of the product page taken from the index* <br>
4817
- example: 0 <br>
4834
+ **templateIdentifier:** string <br>
4835
+ *template marker used by the block (can be null)* <br>
4836
+ Enum:
4837
+ [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service ] <br>
4838
+ example: null <br>
4818
4839
 
4819
- **templateIdentifier** string <br>
4820
- *custom identifier of the associated template* <br>
4821
- example: my-template <br>
4840
+ </details>
4822
4841
 
4823
- **shortDescTemplateIdentifier** string <br>
4824
- *custom identifier of the associated template for short description* <br>
4825
- example: my-template-short <br>
4826
4842
 
4827
- </details>
4828
4843
 
4829
4844
  ### Products.searchProduct(name, langCode)
4830
4845