oneentry 1.0.31 → 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 +111 -4
- package/dist/formsData/formsDataApi.d.ts +1 -1
- package/dist/formsData/formsDataInterfaces.d.ts +14 -5
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -0
- package/dist/pages/pagesApi.d.ts +11 -1
- package/dist/pages/pagesApi.js +13 -0
- package/dist/pages/pagesInterfaces.d.ts +44 -1
- package/dist/products/productsInterfaces.d.ts +9 -2
- package/dist/products/productsInterfaces.js +8 -0
- package/dist/templates-preview/templatesPreviewApi.d.ts +4 -4
- package/dist/templates-preview/templatesPreviewApi.js +5 -5
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +3 -3
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ import { defineOneEntry } from 'oneentry'
|
|
|
26
26
|
|
|
27
27
|
const {
|
|
28
28
|
Admins,
|
|
29
|
+
Blocks
|
|
29
30
|
Forms,
|
|
30
31
|
FormData,
|
|
31
32
|
FileUploading,
|
|
@@ -90,6 +91,112 @@ Example return:
|
|
|
90
91
|
]
|
|
91
92
|
```
|
|
92
93
|
|
|
94
|
+
## Blocks
|
|
95
|
+
|
|
96
|
+
const { Blocks } = defineOneEntry('your-url');
|
|
97
|
+
|
|
98
|
+
### Blocks.getBlocks(langCode, offset, limit)
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
const value = await Blocks.getBlocks('en_US', 0, 30)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
> This method return all blocks objects.
|
|
105
|
+
|
|
106
|
+
Example return:
|
|
107
|
+
```
|
|
108
|
+
[
|
|
109
|
+
{
|
|
110
|
+
"id": 1764,
|
|
111
|
+
"attributeSetId": 7,
|
|
112
|
+
"localizeInfos": {
|
|
113
|
+
"en_US": {
|
|
114
|
+
"title": "My block"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
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
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"version": 10,
|
|
134
|
+
"identifier": "catalog",
|
|
135
|
+
"position": 192,
|
|
136
|
+
"attributeValues": {
|
|
137
|
+
"en_US": {
|
|
138
|
+
"marker": {
|
|
139
|
+
"value": "",
|
|
140
|
+
"type": "string"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"type": "forNewsPage",
|
|
145
|
+
"templateIdentifier": null
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Blocks.getBlockByMarker(marker, langCode)
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
const value = await Blocks.getBlockByMarker('my-marker', 'en_US')
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
> This method return one blocks object by marker.
|
|
157
|
+
|
|
158
|
+
Example return:
|
|
159
|
+
```
|
|
160
|
+
{
|
|
161
|
+
"id": 1764,
|
|
162
|
+
"attributeSetId": 7,
|
|
163
|
+
"localizeInfos": {
|
|
164
|
+
"en_US": {
|
|
165
|
+
"title": "My block"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"customSettings": {
|
|
169
|
+
"sliderDelay": 0,
|
|
170
|
+
"sliderDelayType": "",
|
|
171
|
+
"productQuantity": 4,
|
|
172
|
+
"productSortType": "By_ID",
|
|
173
|
+
"productSortOrder": "Descending",
|
|
174
|
+
"productCountElementsPerRow": 10,
|
|
175
|
+
"similarProductRules": [
|
|
176
|
+
{
|
|
177
|
+
"property": "Descending",
|
|
178
|
+
"includes": "",
|
|
179
|
+
"keywords": "",
|
|
180
|
+
"strict": ""
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
"version": 10,
|
|
185
|
+
"identifier": "catalog",
|
|
186
|
+
"position": 192,
|
|
187
|
+
"attributeValues": {
|
|
188
|
+
"en_US": {
|
|
189
|
+
"marker": {
|
|
190
|
+
"value": "",
|
|
191
|
+
"type": "string"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"type": "forNewsPage",
|
|
196
|
+
"templateIdentifier": null
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
93
200
|
## FileUploading
|
|
94
201
|
|
|
95
202
|
const { FileUploading } = defineOneEntry('your-url');
|
|
@@ -1605,10 +1712,10 @@ Example return:
|
|
|
1605
1712
|
const { TemplatePreviews } = defineOneEntry('your-url')
|
|
1606
1713
|
```
|
|
1607
1714
|
|
|
1608
|
-
###
|
|
1715
|
+
### TemplatePreviews.getTemplatePreviews()
|
|
1609
1716
|
|
|
1610
1717
|
```
|
|
1611
|
-
const value = await TemplatePreviews.
|
|
1718
|
+
const value = await TemplatePreviews.getTemplatePreviews()
|
|
1612
1719
|
```
|
|
1613
1720
|
|
|
1614
1721
|
> This method retrieves all template objects from the API. It returns a Promise that resolves to an array of TemplatePreviewsEntity template objects.
|
|
@@ -1657,7 +1764,7 @@ Example return:
|
|
|
1657
1764
|
### TemplatePreviews.getTemplatesPreviewById(id)
|
|
1658
1765
|
|
|
1659
1766
|
```
|
|
1660
|
-
const value = await TemplatePreviews.
|
|
1767
|
+
const value = await TemplatePreviews.getTemplatePreviewById(1)
|
|
1661
1768
|
```
|
|
1662
1769
|
|
|
1663
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.
|
|
@@ -1704,7 +1811,7 @@ Example return:
|
|
|
1704
1811
|
### TemplatePreviews.getTemplatesPreviewByMarker(marker)
|
|
1705
1812
|
|
|
1706
1813
|
```
|
|
1707
|
-
const value = await TemplatePreviews.
|
|
1814
|
+
const value = await TemplatePreviews.getTemplatePreviewByMarker('my-marker')
|
|
1708
1815
|
```
|
|
1709
1816
|
|
|
1710
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.
|
|
@@ -33,7 +33,7 @@ export default class FormsDataApi extends OneEntry implements IFormsData {
|
|
|
33
33
|
*
|
|
34
34
|
* @returns - Returns created FormData objects.
|
|
35
35
|
*/
|
|
36
|
-
postFormsData(data:
|
|
36
|
+
postFormsData(data: IFormsPost): Promise<IFormsDataEntity>;
|
|
37
37
|
/**
|
|
38
38
|
* Get one object of form data by marker.
|
|
39
39
|
*
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
interface IFormsData {
|
|
11
11
|
getFormsData(langCode: string, offset?: number, limit?: number): Promise<Array<IFormsDataEntity>>;
|
|
12
|
-
postFormsData(data:
|
|
12
|
+
postFormsData(data: IFormsPost): Promise<IFormsDataEntity>;
|
|
13
13
|
getFormsDataByMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<Array<IFormsDataEntity>>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
@@ -30,6 +30,8 @@ interface IFormsDataEntity {
|
|
|
30
30
|
attributeSetIdentifier: string;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
+
* @property {string} [formIdentifier] - Text identifier of the form object (marker)
|
|
34
|
+
*
|
|
33
35
|
* Form data get by langcode identifier
|
|
34
36
|
* @example formData['en_US']
|
|
35
37
|
*
|
|
@@ -42,19 +44,26 @@ interface IFormsDataEntity {
|
|
|
42
44
|
* @property {string} value Form data value.
|
|
43
45
|
*/
|
|
44
46
|
interface IFormData {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
formIdentifier?: string;
|
|
48
|
+
formData: {
|
|
49
|
+
[langcode: string]: Array<{
|
|
50
|
+
marker?: string;
|
|
51
|
+
value?: string;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
49
54
|
}
|
|
50
55
|
/**
|
|
51
56
|
* interface to create an object of information about saving data using the form
|
|
52
57
|
*
|
|
58
|
+
* @property {number} id
|
|
53
59
|
* @property {string} formIdentifier - The identifier of the page.
|
|
60
|
+
* @property {Date | string} time - Date and time of form modification
|
|
54
61
|
* @property {IFormData} formData - The identifier of the page.
|
|
55
62
|
*/
|
|
56
63
|
interface IFormsPost {
|
|
64
|
+
id: number;
|
|
57
65
|
formIdentifier: string;
|
|
66
|
+
time: Date | string;
|
|
58
67
|
formData: IFormData;
|
|
59
68
|
}
|
|
60
69
|
export { IFormsPost, IFormsData, IFormsDataEntity };
|
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";
|
|
@@ -11,8 +11,10 @@ import FormsApi from "./forms/formsApi";
|
|
|
11
11
|
import FormsDataApi from "./formsData/formsDataApi";
|
|
12
12
|
import FileUploadingApi from "./file-uploding/fileUploadingApi";
|
|
13
13
|
import SystemApi from "./system/systemApi";
|
|
14
|
+
import BlocksApi from "./blocks/blocksApi";
|
|
14
15
|
interface IDefineApi {
|
|
15
16
|
Admins: AdminsApi;
|
|
17
|
+
Blocks: BlocksApi;
|
|
16
18
|
FileUploading: FileUploadingApi;
|
|
17
19
|
Forms: FormsApi;
|
|
18
20
|
FormData: FormsDataApi;
|
|
@@ -24,7 +26,7 @@ interface IDefineApi {
|
|
|
24
26
|
ProductStatuses: ProductStatusesApi;
|
|
25
27
|
System: SystemApi;
|
|
26
28
|
Templates: TemplatesApi;
|
|
27
|
-
TemplatePreviews:
|
|
29
|
+
TemplatePreviews: TemplatePreviewsApi;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* Define API.
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ const formsApi_1 = require("./forms/formsApi");
|
|
|
14
14
|
const formsDataApi_1 = require("./formsData/formsDataApi");
|
|
15
15
|
const fileUploadingApi_1 = require("./file-uploding/fileUploadingApi");
|
|
16
16
|
const systemApi_1 = require("./system/systemApi");
|
|
17
|
+
const blocksApi_1 = require("./blocks/blocksApi");
|
|
17
18
|
/**
|
|
18
19
|
* Define API.
|
|
19
20
|
* @param {string} url - URl of your project.
|
|
@@ -21,6 +22,7 @@ const systemApi_1 = require("./system/systemApi");
|
|
|
21
22
|
*/
|
|
22
23
|
function defineOneEntry(url, token) {
|
|
23
24
|
const Admins = new adminsApi_1.default(url, token);
|
|
25
|
+
const Blocks = new blocksApi_1.default(url, token);
|
|
24
26
|
const FileUploading = new fileUploadingApi_1.default(url, token);
|
|
25
27
|
const Forms = new formsApi_1.default(url, token);
|
|
26
28
|
const FormData = new formsDataApi_1.default(url, token);
|
|
@@ -35,6 +37,7 @@ function defineOneEntry(url, token) {
|
|
|
35
37
|
const TemplatePreviews = new templatesPreviewApi_1.default(url, token);
|
|
36
38
|
return {
|
|
37
39
|
Admins,
|
|
40
|
+
Blocks,
|
|
38
41
|
FileUploading,
|
|
39
42
|
Forms,
|
|
40
43
|
FormData,
|
package/dist/pages/pagesApi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import OneEntry from "../base/oneEntry";
|
|
2
|
-
import { IPageApi, IPageConfig, IPagesEntity, IPositionForm } from "./pagesInterfaces";
|
|
2
|
+
import { IPageApi, IPageConfig, IPagesEntity, IPositionForm, IPositionBlock } from "./pagesInterfaces";
|
|
3
3
|
import { LangType } from "../base/utils";
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with page objects, including catalog pages
|
|
@@ -74,6 +74,16 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
74
74
|
* @returns Returns all forms as an array of PositionForm objects or an empty array [] (if there is no data) for the selected parent
|
|
75
75
|
*/
|
|
76
76
|
getFormsByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionForm>>;
|
|
77
|
+
/**
|
|
78
|
+
* Get all blocks by page url.
|
|
79
|
+
*
|
|
80
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
81
|
+
*
|
|
82
|
+
* @param {string} [url] - Page URL
|
|
83
|
+
*
|
|
84
|
+
* @returns Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
85
|
+
*/
|
|
86
|
+
getBlocksByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionBlock>>;
|
|
77
87
|
/**
|
|
78
88
|
* Get settings for the page.
|
|
79
89
|
*
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -98,6 +98,19 @@ class PageApi extends oneEntry_1.default {
|
|
|
98
98
|
const result = await this._fetchRequests(`/${url}/forms?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
99
99
|
return result;
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Get all blocks by page url.
|
|
103
|
+
*
|
|
104
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
105
|
+
*
|
|
106
|
+
* @param {string} [url] - Page URL
|
|
107
|
+
*
|
|
108
|
+
* @returns Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
109
|
+
*/
|
|
110
|
+
async getBlocksByPageUrl(url, langCode) {
|
|
111
|
+
const result = await this._fetchRequests(`/${url}/blocks?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
112
|
+
return result;
|
|
113
|
+
}
|
|
101
114
|
/**
|
|
102
115
|
* Get settings for the page.
|
|
103
116
|
*
|
|
@@ -28,6 +28,7 @@ interface IPageApi {
|
|
|
28
28
|
getPageByUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
29
29
|
getChildPagesByParentUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
30
30
|
getFormsByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionForm>>;
|
|
31
|
+
getBlocksByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionBlock>>;
|
|
31
32
|
getConfigPageByUrl(url: string): Promise<IPageConfig>;
|
|
32
33
|
searchPage(name: string, langCode: LangType): Promise<Array<IPagesEntity>>;
|
|
33
34
|
}
|
|
@@ -68,6 +69,48 @@ interface IPositionForm {
|
|
|
68
69
|
processingData: object;
|
|
69
70
|
position: number;
|
|
70
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Represents an object with various properties.
|
|
74
|
+
*
|
|
75
|
+
* @interface
|
|
76
|
+
* @property {number} id - The identifier of the object.
|
|
77
|
+
* @property {number} version - The version number of the object.
|
|
78
|
+
* @property {string} identifier - The textual identifier for the record field.
|
|
79
|
+
* @property {number} attributeSetId - The identifier of the attribute set being used.
|
|
80
|
+
* @property {LocalizeType} localizeInfos - The name of the page, taking into account localization.
|
|
81
|
+
* @property {object} customSettings - Custom settings for different types of blocks.
|
|
82
|
+
* @property {number} position - The position of the object.
|
|
83
|
+
* @property {boolean} isSync - Indication of page indexing.
|
|
84
|
+
* @property {AttributeType} attributeValues - Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
|
|
85
|
+
* @property {Types} type - Page type.
|
|
86
|
+
* @property {string} templateIdentifier - User id of the linked template.
|
|
87
|
+
*/
|
|
88
|
+
interface IPositionBlock {
|
|
89
|
+
id: number;
|
|
90
|
+
version: number;
|
|
91
|
+
identifier: string;
|
|
92
|
+
attributeSetId: number;
|
|
93
|
+
localizeInfos: LocalizeType;
|
|
94
|
+
customSettings: {
|
|
95
|
+
sliderDelay: number;
|
|
96
|
+
sliderDelayType: string;
|
|
97
|
+
productQuantity: number;
|
|
98
|
+
productSortType: string;
|
|
99
|
+
productSortOrder: string;
|
|
100
|
+
productCountElementsPerRow: number;
|
|
101
|
+
similarProductRules: Array<{
|
|
102
|
+
property: string;
|
|
103
|
+
includes: string;
|
|
104
|
+
keywords: string;
|
|
105
|
+
strict: string;
|
|
106
|
+
}>;
|
|
107
|
+
};
|
|
108
|
+
position: number;
|
|
109
|
+
isSync: boolean;
|
|
110
|
+
attributeValues: AttributeType;
|
|
111
|
+
type: string;
|
|
112
|
+
templateIdentifier: string | null;
|
|
113
|
+
}
|
|
71
114
|
/**
|
|
72
115
|
* Represents an object with various properties.
|
|
73
116
|
*
|
|
@@ -111,4 +154,4 @@ interface IPagesEntity {
|
|
|
111
154
|
templateIdentifier: string;
|
|
112
155
|
type: Types;
|
|
113
156
|
}
|
|
114
|
-
export { IPageApi, IPageConfig, IPagesEntity, IPositionForm };
|
|
157
|
+
export { IPageApi, IPageConfig, IPagesEntity, IPositionForm, IPositionBlock };
|
|
@@ -28,6 +28,13 @@ interface IProductApi {
|
|
|
28
28
|
filterProduct(data: Array<IFilterParams>, langCode: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
29
29
|
searchProduct(name: string, langCode: string): Promise<Array<IProductsEntity>>;
|
|
30
30
|
}
|
|
31
|
+
declare enum SortKey {
|
|
32
|
+
id = "id",
|
|
33
|
+
position = "position",
|
|
34
|
+
title = "title",
|
|
35
|
+
date = "date",
|
|
36
|
+
price = "price"
|
|
37
|
+
}
|
|
31
38
|
/**
|
|
32
39
|
* Represents a product query parameters object.
|
|
33
40
|
*
|
|
@@ -40,7 +47,7 @@ interface IProductApi {
|
|
|
40
47
|
* @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered, default null.
|
|
41
48
|
* @property {string} sortOrder - Sort order 'DESC' | 'ASC', default 'DESC'.
|
|
42
49
|
* @property {string} langCode - localization language code (used only when searching with a filter, default 'en_US'.
|
|
43
|
-
* @property {string} sortKey -
|
|
50
|
+
* @property {string} sortKey - Field for sorting (default - null)
|
|
44
51
|
*/
|
|
45
52
|
interface IProductsQuery {
|
|
46
53
|
offset?: number;
|
|
@@ -60,7 +67,7 @@ interface IProductsQuery {
|
|
|
60
67
|
conditionMarker?: 'in' | 'nin' | 'eq' | 'neq' | 'mth' | 'lth' | 'exs' | 'nexs' | null;
|
|
61
68
|
attributeMarker?: string | null;
|
|
62
69
|
sortOrder?: 'DESC' | 'ASC' | null;
|
|
63
|
-
sortKey?:
|
|
70
|
+
sortKey?: SortKey | null;
|
|
64
71
|
[key: string]: string | number | null;
|
|
65
72
|
}
|
|
66
73
|
/**
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var SortKey;
|
|
4
|
+
(function (SortKey) {
|
|
5
|
+
SortKey["id"] = "id";
|
|
6
|
+
SortKey["position"] = "position";
|
|
7
|
+
SortKey["title"] = "title";
|
|
8
|
+
SortKey["date"] = "date";
|
|
9
|
+
SortKey["price"] = "price";
|
|
10
|
+
})(SortKey || (SortKey = {}));
|
|
@@ -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.
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oneentry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"/dist"
|
|
9
9
|
],
|
|
10
|
-
|
|
11
10
|
"author": "ONEENTRY PORTAL CO.",
|
|
12
11
|
"license": "ISC",
|
|
13
12
|
"dependencies": {
|