oneentry 1.0.32 → 1.0.33
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
|
@@ -1712,10 +1712,10 @@ Example return:
|
|
|
1712
1712
|
const { TemplatePreviews } = defineOneEntry('your-url')
|
|
1713
1713
|
```
|
|
1714
1714
|
|
|
1715
|
-
###
|
|
1715
|
+
### TemplatePreviews.getTemplatePreviews()
|
|
1716
1716
|
|
|
1717
1717
|
```
|
|
1718
|
-
const value = await TemplatePreviews.
|
|
1718
|
+
const value = await TemplatePreviews.getTemplatePreviews()
|
|
1719
1719
|
```
|
|
1720
1720
|
|
|
1721
1721
|
> This method retrieves all template objects from the API. It returns a Promise that resolves to an array of TemplatePreviewsEntity template objects.
|
|
@@ -1764,7 +1764,7 @@ Example return:
|
|
|
1764
1764
|
### TemplatePreviews.getTemplatesPreviewById(id)
|
|
1765
1765
|
|
|
1766
1766
|
```
|
|
1767
|
-
const value = await TemplatePreviews.
|
|
1767
|
+
const value = await TemplatePreviews.getTemplatePreviewById(1)
|
|
1768
1768
|
```
|
|
1769
1769
|
|
|
1770
1770
|
> 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.
|
|
@@ -1811,7 +1811,7 @@ Example return:
|
|
|
1811
1811
|
### TemplatePreviews.getTemplatesPreviewByMarker(marker)
|
|
1812
1812
|
|
|
1813
1813
|
```
|
|
1814
|
-
const value = await TemplatePreviews.
|
|
1814
|
+
const value = await TemplatePreviews.getTemplatePreviewByMarker('my-marker')
|
|
1815
1815
|
```
|
|
1816
1816
|
|
|
1817
1817
|
> 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.
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import ProductApi from './products/productsApi';
|
|
|
2
2
|
import PageApi from "./pages/pagesApi";
|
|
3
3
|
import ProductStatusesApi from "./product-statuses/productStatusesApi";
|
|
4
4
|
import TemplatesApi from "./templates/templatesApi";
|
|
5
|
-
import
|
|
5
|
+
import TemplatePreviewsApi from "./templates-preview/templatesPreviewApi";
|
|
6
6
|
import AdminsApi from "./admins/adminsApi";
|
|
7
7
|
import GeneralTypesApi from "./general-types/GeneralTypesApi";
|
|
8
8
|
import LocalesApi from "./locales/localesApi";
|
|
@@ -26,7 +26,7 @@ interface IDefineApi {
|
|
|
26
26
|
ProductStatuses: ProductStatusesApi;
|
|
27
27
|
System: SystemApi;
|
|
28
28
|
Templates: TemplatesApi;
|
|
29
|
-
TemplatePreviews:
|
|
29
|
+
TemplatePreviews: TemplatePreviewsApi;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Define API.
|
|
@@ -3,14 +3,14 @@ import { ITemplatesPreview, ITemplatesPreviewEntity } from "./templatesPreviewIn
|
|
|
3
3
|
/**
|
|
4
4
|
* Controllers for working with template objects for preview
|
|
5
5
|
*/
|
|
6
|
-
export default class
|
|
6
|
+
export default class TemplatePreviewsApi extends OneEntry implements ITemplatesPreview {
|
|
7
7
|
constructor(url: string, token: string);
|
|
8
8
|
/**
|
|
9
9
|
* Get all template objects.
|
|
10
10
|
*
|
|
11
11
|
* @returns Returns all TemplatePreviewsEntity template objects
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
getTemplatePreviews(): Promise<Array<ITemplatesPreviewEntity>>;
|
|
14
14
|
/**
|
|
15
15
|
* Get one template object by id.
|
|
16
16
|
*
|
|
@@ -18,7 +18,7 @@ export default class PageApi extends OneEntry implements ITemplatesPreview {
|
|
|
18
18
|
*
|
|
19
19
|
* @returns Returns a TemplatePreviewsEntity object
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
getTemplatePreviewById(id: number): Promise<ITemplatesPreviewEntity>;
|
|
22
22
|
/**
|
|
23
23
|
* Get one template object by marker.
|
|
24
24
|
*
|
|
@@ -26,5 +26,5 @@ export default class PageApi extends OneEntry implements ITemplatesPreview {
|
|
|
26
26
|
*
|
|
27
27
|
* @returns Returns a TemplatePreviewsEntity object
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
getTemplatePreviewByMarker(marker: string): Promise<ITemplatesPreviewEntity>;
|
|
30
30
|
}
|
|
@@ -4,7 +4,7 @@ const oneEntry_1 = require("../base/oneEntry");
|
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with template objects for preview
|
|
6
6
|
*/
|
|
7
|
-
class
|
|
7
|
+
class TemplatePreviewsApi extends oneEntry_1.default {
|
|
8
8
|
constructor(url, token) {
|
|
9
9
|
super(url, token);
|
|
10
10
|
this._url += '/api/content/template-previews';
|
|
@@ -14,7 +14,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
14
14
|
*
|
|
15
15
|
* @returns Returns all TemplatePreviewsEntity template objects
|
|
16
16
|
*/
|
|
17
|
-
async
|
|
17
|
+
async getTemplatePreviews() {
|
|
18
18
|
const result = await this._fetchGet('');
|
|
19
19
|
return result;
|
|
20
20
|
}
|
|
@@ -25,7 +25,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns Returns a TemplatePreviewsEntity object
|
|
27
27
|
*/
|
|
28
|
-
async
|
|
28
|
+
async getTemplatePreviewById(id) {
|
|
29
29
|
const result = await this._fetchGet(`/${id}`);
|
|
30
30
|
return result;
|
|
31
31
|
}
|
|
@@ -36,9 +36,9 @@ class PageApi extends oneEntry_1.default {
|
|
|
36
36
|
*
|
|
37
37
|
* @returns Returns a TemplatePreviewsEntity object
|
|
38
38
|
*/
|
|
39
|
-
async
|
|
39
|
+
async getTemplatePreviewByMarker(marker) {
|
|
40
40
|
const result = await this._fetchGet(`/marker/${marker}`);
|
|
41
41
|
return result;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
exports.default =
|
|
44
|
+
exports.default = TemplatePreviewsApi;
|
|
@@ -9,9 +9,9 @@ import { ILocalizeInfos } from "../base/utils";
|
|
|
9
9
|
* @property {function} getTemplatesPreviewByMarker - Get one template object by marker.
|
|
10
10
|
*/
|
|
11
11
|
interface ITemplatesPreview {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
getTemplatePreviews(): Promise<Array<ITemplatesPreviewEntity>>;
|
|
13
|
+
getTemplatePreviewById(id: number): Promise<ITemplatesPreviewEntity>;
|
|
14
|
+
getTemplatePreviewByMarker(marker: string): Promise<ITemplatesPreviewEntity>;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Represents a template preview entity object.
|