oneentry 1.0.62 → 1.0.64
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 +1972 -888
- package/dist/auth-provider/authProviderApi.d.ts +104 -0
- package/dist/auth-provider/authProviderApi.js +162 -0
- package/dist/auth-provider/authProvidersInterfaces.d.ts +81 -0
- package/dist/auth-provider/authProvidersInterfaces.js +2 -0
- package/dist/base/oneEntry.d.ts +3 -1
- package/dist/base/oneEntry.js +50 -2
- package/dist/blocks/blocksApi.d.ts +7 -1
- package/dist/blocks/blocksApi.js +9 -0
- package/dist/blocks/blocksInterfaces.d.ts +8 -1
- package/dist/events/eventsApi.d.ts +23 -0
- package/dist/events/eventsApi.js +39 -0
- package/dist/events/eventsInterfaces.d.ts +11 -0
- package/dist/events/eventsInterfaces.js +2 -0
- package/dist/formsData/formsDataApi.d.ts +2 -2
- package/dist/formsData/formsDataApi.js +2 -2
- package/dist/formsData/formsDataInterfaces.d.ts +118 -4
- package/dist/index.d.ts +6 -2
- package/dist/index.js +10 -4
- package/dist/orders/ordersApi.d.ts +49 -10
- package/dist/orders/ordersApi.js +61 -13
- package/dist/orders/ordersInterfaces.d.ts +36 -1
- package/dist/products/productsInterfaces.d.ts +9 -0
- package/dist/templates/templatesApi.d.ts +8 -0
- package/dist/templates/templatesApi.js +11 -0
- package/dist/templates/templatesInterfaces.d.ts +4 -3
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +1 -1
- package/dist/users/usersApi.d.ts +41 -0
- package/dist/users/usersApi.js +51 -0
- package/dist/users/usersInterfaces.d.ts +30 -0
- package/dist/users/usersInterfaces.js +2 -0
- package/package.json +1 -1
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
* Represents a interface object of Forms Api.
|
|
3
3
|
*
|
|
4
4
|
* @property {function} getFormsData - Get all forms data.
|
|
5
|
-
*
|
|
6
5
|
* @property {function} postFormsData - Find all product page objects with pagination and multiple filtering.
|
|
7
|
-
*
|
|
8
6
|
* @property {function} getFormsDataByMarker - Get one object of form data by marker.
|
|
9
7
|
*/
|
|
10
8
|
interface IFormsData {
|
|
@@ -52,6 +50,122 @@ interface IFormsPost {
|
|
|
52
50
|
id?: number;
|
|
53
51
|
formIdentifier: string;
|
|
54
52
|
time?: Date | string;
|
|
55
|
-
formData:
|
|
53
|
+
formData: Array<IBodyTypeStringNumberFloat | IBodyTypeTimeDate | IBodyTypeText | IBodyTypeTextWithHeader | IBodyTypeImageGroupOfImages | IBodyTypeFile | IBodyTypeRadioButtonList | Record<string, any>>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @property {string} marker - marker name
|
|
57
|
+
* @property {'string' | 'number' | 'float'} type - Type value
|
|
58
|
+
* @property {string} value
|
|
59
|
+
*/
|
|
60
|
+
interface IBodyTypeStringNumberFloat {
|
|
61
|
+
marker: string;
|
|
62
|
+
type: 'string' | 'number' | 'float';
|
|
63
|
+
value: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @property {string} marker - marker name
|
|
67
|
+
* @property {'date' | 'dateTime' | 'time'} type - Type value
|
|
68
|
+
* @property {object} value - Date object. Contains fullDate, formattedValue, formatString
|
|
69
|
+
*/
|
|
70
|
+
interface IBodyTypeTimeDate {
|
|
71
|
+
marker: string;
|
|
72
|
+
type: 'date' | 'dateTime' | 'time';
|
|
73
|
+
value: {
|
|
74
|
+
fullDate: string;
|
|
75
|
+
formattedValue: string;
|
|
76
|
+
formatString: string;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @property {string} marker - marker name
|
|
81
|
+
* @property {'text'} type - Type value
|
|
82
|
+
* @property {object} value - Text Object. Contains html as string and params
|
|
83
|
+
*/
|
|
84
|
+
interface IBodyTypeText {
|
|
85
|
+
marker: string;
|
|
86
|
+
type: 'text';
|
|
87
|
+
value: {
|
|
88
|
+
htmlValue: string;
|
|
89
|
+
plainValue: string;
|
|
90
|
+
params: {
|
|
91
|
+
isEditorDisabled: boolean;
|
|
92
|
+
isImageCompressed: boolean;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @property {string} marker - marker name
|
|
98
|
+
* @property {'textWithHeader'} type - Type value
|
|
99
|
+
* @property {object} value - Text Object. Contains html as string, header and params
|
|
100
|
+
*/
|
|
101
|
+
interface IBodyTypeTextWithHeader {
|
|
102
|
+
marker: string;
|
|
103
|
+
type: 'textWithHeader';
|
|
104
|
+
value: {
|
|
105
|
+
header: string;
|
|
106
|
+
htmlValue: string;
|
|
107
|
+
plainValue: string;
|
|
108
|
+
params: {
|
|
109
|
+
isEditorDisabled: boolean;
|
|
110
|
+
isImageCompressed: boolean;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* @property {string} marker - marker name
|
|
116
|
+
* @property {'image' | 'groupOfImage'} type - Type value
|
|
117
|
+
* @property {object} value - Image Object. Contains image information
|
|
118
|
+
*/
|
|
119
|
+
interface IBodyTypeImageGroupOfImages {
|
|
120
|
+
marker: string;
|
|
121
|
+
type: 'image' | 'groupOfImage';
|
|
122
|
+
value: {
|
|
123
|
+
filename: string;
|
|
124
|
+
downloadLink: string;
|
|
125
|
+
size: number;
|
|
126
|
+
previewLink: string;
|
|
127
|
+
params: {
|
|
128
|
+
isImageCompressed: boolean;
|
|
129
|
+
};
|
|
130
|
+
} | Array<{
|
|
131
|
+
filename: string;
|
|
132
|
+
downloadLink: string;
|
|
133
|
+
size: number;
|
|
134
|
+
previewLink: string;
|
|
135
|
+
params: {
|
|
136
|
+
isImageCompressed: boolean;
|
|
137
|
+
};
|
|
138
|
+
}>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @property {string} marker - marker name
|
|
142
|
+
* @property {'file'} type - Type value
|
|
143
|
+
* @property {object} value - File Object. Contains file information
|
|
144
|
+
*/
|
|
145
|
+
interface IBodyTypeFile {
|
|
146
|
+
marker: string;
|
|
147
|
+
type: 'file';
|
|
148
|
+
value: {
|
|
149
|
+
filename: string;
|
|
150
|
+
downloadLink: string;
|
|
151
|
+
size: number;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @property {string} marker - marker name
|
|
156
|
+
* @property {'file'} type - Type value
|
|
157
|
+
* @property {array} value - Array of list or radioButton bojects.
|
|
158
|
+
*/
|
|
159
|
+
interface IBodyTypeRadioButtonList {
|
|
160
|
+
marker: string;
|
|
161
|
+
type: 'list' | 'radioButton';
|
|
162
|
+
value: Array<{
|
|
163
|
+
title: string;
|
|
164
|
+
value: string;
|
|
165
|
+
extended: {
|
|
166
|
+
value: string;
|
|
167
|
+
type: string;
|
|
168
|
+
};
|
|
169
|
+
}>;
|
|
56
170
|
}
|
|
57
|
-
export { IFormsPost, IFormsData, IFormData, IFormsDataEntity };
|
|
171
|
+
export { IFormsPost, IFormsData, IFormData, IFormsDataEntity, IBodyTypeStringNumberFloat, IBodyTypeTimeDate, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeImageGroupOfImages, IBodyTypeFile, IBodyTypeRadioButtonList };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,20 +13,23 @@ import FileUploadingApi from "./file-uploding/fileUploadingApi";
|
|
|
13
13
|
import SystemApi from "./system/systemApi";
|
|
14
14
|
import BlocksApi from "./blocks/blocksApi";
|
|
15
15
|
import AttributesSetsApi from "./attribute-sets/attributeSetsApi";
|
|
16
|
-
import MarkersApi from "./markers/markersApi";
|
|
17
16
|
import { IConfig } from "./base/utils";
|
|
18
17
|
import OrdersApi from "./orders/ordersApi";
|
|
19
18
|
import PaymentsApi from "./payments/paymentsApi";
|
|
19
|
+
import AuthProviderApi from "./auth-provider/authProviderApi";
|
|
20
|
+
import EventsApi from "./events/eventsApi";
|
|
21
|
+
import UsersApi from "./users/usersApi";
|
|
20
22
|
interface IDefineApi {
|
|
21
23
|
Admins: AdminsApi;
|
|
22
24
|
AttributesSets: AttributesSetsApi;
|
|
25
|
+
AuthProvider: AuthProviderApi;
|
|
23
26
|
Blocks: BlocksApi;
|
|
27
|
+
Events: EventsApi;
|
|
24
28
|
FileUploading: FileUploadingApi;
|
|
25
29
|
Forms: FormsApi;
|
|
26
30
|
FormData: FormsDataApi;
|
|
27
31
|
GeneralTypes: GeneralTypesApi;
|
|
28
32
|
Locales: LocalesApi;
|
|
29
|
-
Markers: MarkersApi;
|
|
30
33
|
Menus: MenusApi;
|
|
31
34
|
Orders: OrdersApi;
|
|
32
35
|
Pages: PageApi;
|
|
@@ -36,6 +39,7 @@ interface IDefineApi {
|
|
|
36
39
|
System: SystemApi;
|
|
37
40
|
Templates: TemplatesApi;
|
|
38
41
|
TemplatePreviews: TemplatePreviewsApi;
|
|
42
|
+
Users: UsersApi;
|
|
39
43
|
}
|
|
40
44
|
/**
|
|
41
45
|
* Define API.
|
package/dist/index.js
CHANGED
|
@@ -16,9 +16,11 @@ const fileUploadingApi_1 = require("./file-uploding/fileUploadingApi");
|
|
|
16
16
|
const systemApi_1 = require("./system/systemApi");
|
|
17
17
|
const blocksApi_1 = require("./blocks/blocksApi");
|
|
18
18
|
const attributeSetsApi_1 = require("./attribute-sets/attributeSetsApi");
|
|
19
|
-
const markersApi_1 = require("./markers/markersApi");
|
|
20
19
|
const ordersApi_1 = require("./orders/ordersApi");
|
|
21
20
|
const paymentsApi_1 = require("./payments/paymentsApi");
|
|
21
|
+
const authProviderApi_1 = require("./auth-provider/authProviderApi");
|
|
22
|
+
const eventsApi_1 = require("./events/eventsApi");
|
|
23
|
+
const usersApi_1 = require("./users/usersApi");
|
|
22
24
|
/**
|
|
23
25
|
* Define API.
|
|
24
26
|
* @param {string} url - URl of your project.
|
|
@@ -30,13 +32,14 @@ const paymentsApi_1 = require("./payments/paymentsApi");
|
|
|
30
32
|
function defineOneEntry(url, config) {
|
|
31
33
|
const Admins = new adminsApi_1.default(url, config);
|
|
32
34
|
const AttributesSets = new attributeSetsApi_1.default(url, config);
|
|
35
|
+
const AuthProvider = new authProviderApi_1.default(url, config);
|
|
33
36
|
const Blocks = new blocksApi_1.default(url, config);
|
|
37
|
+
const Events = new eventsApi_1.default(url, config);
|
|
34
38
|
const FileUploading = new fileUploadingApi_1.default(url, config);
|
|
35
39
|
const Forms = new formsApi_1.default(url, config);
|
|
36
40
|
const FormData = new formsDataApi_1.default(url, config);
|
|
37
41
|
const GeneralTypes = new typesApi_1.default(url, config);
|
|
38
42
|
const Locales = new localesApi_1.default(url, config);
|
|
39
|
-
const Markers = new markersApi_1.default(url, config);
|
|
40
43
|
const Menus = new menusApi_1.default(url, config);
|
|
41
44
|
const Orders = new ordersApi_1.default(url, config);
|
|
42
45
|
const Pages = new pagesApi_1.default(url, config);
|
|
@@ -46,16 +49,18 @@ function defineOneEntry(url, config) {
|
|
|
46
49
|
const System = new systemApi_1.default(url, config);
|
|
47
50
|
const Templates = new templatesApi_1.default(url, config);
|
|
48
51
|
const TemplatePreviews = new templatesPreviewApi_1.default(url, config);
|
|
52
|
+
const Users = new usersApi_1.default(url, config);
|
|
49
53
|
return {
|
|
50
54
|
Admins,
|
|
51
55
|
AttributesSets,
|
|
56
|
+
AuthProvider,
|
|
52
57
|
Blocks,
|
|
58
|
+
Events,
|
|
53
59
|
FileUploading,
|
|
54
60
|
Forms,
|
|
55
61
|
FormData,
|
|
56
62
|
GeneralTypes,
|
|
57
63
|
Locales,
|
|
58
|
-
Markers,
|
|
59
64
|
Menus,
|
|
60
65
|
Orders,
|
|
61
66
|
Pages,
|
|
@@ -64,7 +69,8 @@ function defineOneEntry(url, config) {
|
|
|
64
69
|
ProductStatuses,
|
|
65
70
|
System,
|
|
66
71
|
Templates,
|
|
67
|
-
TemplatePreviews
|
|
72
|
+
TemplatePreviews,
|
|
73
|
+
Users
|
|
68
74
|
};
|
|
69
75
|
}
|
|
70
76
|
exports.defineOneEntry = defineOneEntry;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import OneEntry from "../base/oneEntry";
|
|
2
2
|
import { IConfig } from "../base/utils";
|
|
3
|
-
import { IOrdersApi, IOrdersEntity, IBaseOrdersEntity, IOrderData } from "./ordersInterfaces";
|
|
3
|
+
import { IOrdersApi, IOrdersEntity, IBaseOrdersEntity, IOrderData, IOrdersByMarkersEntity } from "./ordersInterfaces";
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with orders
|
|
6
6
|
*/
|
|
7
7
|
export default class OrdersApi extends OneEntry implements IOrdersApi {
|
|
8
8
|
constructor(url: string, config: IConfig);
|
|
9
|
-
/**
|
|
10
|
-
* Retrieve one order storage object by marker.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} marker - Marker of the order object
|
|
13
|
-
* @param {string} [langCode] - Language code
|
|
14
|
-
*
|
|
15
|
-
* @returns Return object of order information.
|
|
16
|
-
*/
|
|
17
|
-
getOrderByMarker(marker: string, langCode?: string): Promise<IOrdersEntity>;
|
|
18
9
|
/**
|
|
19
10
|
* Creation of an order in the order storage.
|
|
20
11
|
*
|
|
@@ -43,4 +34,52 @@ export default class OrdersApi extends OneEntry implements IOrdersApi {
|
|
|
43
34
|
* @returns Returns object for creating an order.
|
|
44
35
|
*/
|
|
45
36
|
createOrder(marker: string, data: IOrderData, langCode?: string): Promise<IBaseOrdersEntity>;
|
|
37
|
+
/**
|
|
38
|
+
* Getting all order storage object by marker
|
|
39
|
+
* @param {number} marker - Textual identifier of the order storage object
|
|
40
|
+
* @param {number} [langCode] Optional language field
|
|
41
|
+
*/
|
|
42
|
+
getAllOrdersByMarker(marker: string, langCode?: string): Promise<Array<IOrdersByMarkersEntity>>;
|
|
43
|
+
/**
|
|
44
|
+
* Changing an order in the order store
|
|
45
|
+
* @param marker - The text identifier of the order storage object
|
|
46
|
+
* @param id - ID of the order object
|
|
47
|
+
* @param data Object for updating an order
|
|
48
|
+
* @param langCode Optional language field
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const body = {
|
|
52
|
+
* "formIdentifier": "bar-orders-form",
|
|
53
|
+
* "paymentIdentifier": "usd-payment",
|
|
54
|
+
* "formData": {
|
|
55
|
+
* "marker": "name_1",
|
|
56
|
+
* "value": "Name"
|
|
57
|
+
* },
|
|
58
|
+
* "products": [
|
|
59
|
+
* {
|
|
60
|
+
* "productId": 1,
|
|
61
|
+
* "quantity": 2,
|
|
62
|
+
* "price": "23.02"
|
|
63
|
+
* }
|
|
64
|
+
* ],
|
|
65
|
+
* "currency": "USD"
|
|
66
|
+
* }
|
|
67
|
+
*/
|
|
68
|
+
updateOrderByMarkerAndId(marker: string, id: string, data: IOrderData, langCode?: string): Promise<IBaseOrdersEntity>;
|
|
69
|
+
/**
|
|
70
|
+
* Getting all the order storage objects
|
|
71
|
+
* @param {number} [langCode] Optional language field
|
|
72
|
+
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
73
|
+
* @param {number} [offset] - Optional parameter for pagination, default is 30
|
|
74
|
+
*/
|
|
75
|
+
getAllOrders(langCode?: string, limit?: number, offset?: number): Promise<Array<IOrdersEntity>>;
|
|
76
|
+
/**
|
|
77
|
+
* Retrieve one order storage object by marker.
|
|
78
|
+
*
|
|
79
|
+
* @param {string} marker - Marker of the order object
|
|
80
|
+
* @param {string} [langCode] - Language code
|
|
81
|
+
*
|
|
82
|
+
* @returns Return object of order information.
|
|
83
|
+
*/
|
|
84
|
+
getOrderByMarker(marker: string, langCode?: string): Promise<IOrdersEntity>;
|
|
46
85
|
}
|
package/dist/orders/ordersApi.js
CHANGED
|
@@ -9,18 +9,6 @@ class OrdersApi extends oneEntry_1.default {
|
|
|
9
9
|
super(url, config);
|
|
10
10
|
this._url += '/api/content/orders-storage';
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
13
|
-
* Retrieve one order storage object by marker.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} marker - Marker of the order object
|
|
16
|
-
* @param {string} [langCode] - Language code
|
|
17
|
-
*
|
|
18
|
-
* @returns Return object of order information.
|
|
19
|
-
*/
|
|
20
|
-
async getOrderByMarker(marker, langCode = this._defaultLangCode) {
|
|
21
|
-
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
22
|
-
return this._normalizeData(result);
|
|
23
|
-
}
|
|
24
12
|
/**
|
|
25
13
|
* Creation of an order in the order storage.
|
|
26
14
|
*
|
|
@@ -52,7 +40,67 @@ class OrdersApi extends oneEntry_1.default {
|
|
|
52
40
|
const formData = {};
|
|
53
41
|
formData[langCode] = Array.isArray(data.formData) ? data.formData : [data.formData];
|
|
54
42
|
data.formData = formData;
|
|
55
|
-
const result = await this._fetchPost(`/marker/${marker}/
|
|
43
|
+
const result = await this._fetchPost(`/marker/${marker}/orders`, data);
|
|
44
|
+
return this._normalizeData(result);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Getting all order storage object by marker
|
|
48
|
+
* @param {number} marker - Textual identifier of the order storage object
|
|
49
|
+
* @param {number} [langCode] Optional language field
|
|
50
|
+
*/
|
|
51
|
+
async getAllOrdersByMarker(marker, langCode = this._defaultLangCode) {
|
|
52
|
+
const result = this._fetchGet(`/marker/${marker}/orders?langCode=${langCode}`);
|
|
53
|
+
return this._normalizeData(result.items);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Changing an order in the order store
|
|
57
|
+
* @param marker - The text identifier of the order storage object
|
|
58
|
+
* @param id - ID of the order object
|
|
59
|
+
* @param data Object for updating an order
|
|
60
|
+
* @param langCode Optional language field
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* const body = {
|
|
64
|
+
* "formIdentifier": "bar-orders-form",
|
|
65
|
+
* "paymentIdentifier": "usd-payment",
|
|
66
|
+
* "formData": {
|
|
67
|
+
* "marker": "name_1",
|
|
68
|
+
* "value": "Name"
|
|
69
|
+
* },
|
|
70
|
+
* "products": [
|
|
71
|
+
* {
|
|
72
|
+
* "productId": 1,
|
|
73
|
+
* "quantity": 2,
|
|
74
|
+
* "price": "23.02"
|
|
75
|
+
* }
|
|
76
|
+
* ],
|
|
77
|
+
* "currency": "USD"
|
|
78
|
+
* }
|
|
79
|
+
*/
|
|
80
|
+
async updateOrderByMarkerAndId(marker, id, data, langCode = this._defaultLangCode) {
|
|
81
|
+
const result = await this._fetchPut(`/marker/${marker}/orders/${id}?langCode=${langCode}`, data);
|
|
82
|
+
return this._normalizeData(result);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Getting all the order storage objects
|
|
86
|
+
* @param {number} [langCode] Optional language field
|
|
87
|
+
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
88
|
+
* @param {number} [offset] - Optional parameter for pagination, default is 30
|
|
89
|
+
*/
|
|
90
|
+
async getAllOrders(langCode = this._defaultLangCode, limit = 30, offset = 0) {
|
|
91
|
+
const result = await this._fetchGet(`?langCode=${langCode}&limit=${limit}&offset=${offset}`);
|
|
92
|
+
return this._normalizeData(result);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Retrieve one order storage object by marker.
|
|
96
|
+
*
|
|
97
|
+
* @param {string} marker - Marker of the order object
|
|
98
|
+
* @param {string} [langCode] - Language code
|
|
99
|
+
*
|
|
100
|
+
* @returns Return object of order information.
|
|
101
|
+
*/
|
|
102
|
+
async getOrderByMarker(marker, langCode = this._defaultLangCode) {
|
|
103
|
+
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
56
104
|
return this._normalizeData(result);
|
|
57
105
|
}
|
|
58
106
|
}
|
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @property {function} getOrderByMarker - Retrieve one order storage object by marker.
|
|
5
5
|
* @property {function} createOrder - Creation of an order in the order storage.
|
|
6
|
+
* @property {function} updateOrderByMarkerAndId - Changing an order in the order store.
|
|
7
|
+
* @property {function} getAllOrders - Getting all the order storage objects.
|
|
8
|
+
* @property {function} getAllOrdersByMarker - Getting one order storage object by marker.
|
|
6
9
|
|
|
7
10
|
*/
|
|
8
11
|
interface IOrdersApi {
|
|
9
12
|
getOrderByMarker(marker: string, langCode?: string): Promise<IOrdersEntity>;
|
|
10
13
|
createOrder(marker: string, data: IOrderData): Promise<IBaseOrdersEntity>;
|
|
14
|
+
updateOrderByMarkerAndId(marker: string, id: string, data: IOrderData, langCode?: string): Promise<IBaseOrdersEntity>;
|
|
15
|
+
getAllOrders(langCode?: string, limit?: number, offset?: number): Promise<Array<IOrdersEntity>>;
|
|
16
|
+
getAllOrdersByMarker(marker: string, langCode?: string): Promise<Array<IOrdersByMarkersEntity>>;
|
|
11
17
|
}
|
|
12
18
|
interface IPicture {
|
|
13
19
|
filename: string;
|
|
@@ -105,4 +111,33 @@ interface IOrderData {
|
|
|
105
111
|
products: Array<IOrderProductData>;
|
|
106
112
|
currency: string;
|
|
107
113
|
}
|
|
108
|
-
|
|
114
|
+
/**
|
|
115
|
+
* @interface
|
|
116
|
+
* @property {string} statusIdentifier - Text identifier of the order status.
|
|
117
|
+
* @property {string} formIdentifier - Text identifier of the form status.
|
|
118
|
+
* @property {string} paymentIdentifier - Text identifier of the order payment.
|
|
119
|
+
* @property {Array<IOrdersFormData>} formData - Data submitted by the form linked to the order store.
|
|
120
|
+
* @property {Array<IOrderProducts>} products - Array of products added to order.
|
|
121
|
+
* @property {string} totalSum - Total order amount.
|
|
122
|
+
* @property {number} price - Price order.
|
|
123
|
+
* @property {string} currency - Currency used to pay for the order.
|
|
124
|
+
* @property {string} createdDate - Date when the order was created.
|
|
125
|
+
* @property {string} paymentAccountIdentifier - Textual identifier for the order payment.
|
|
126
|
+
* @property {Record<string, any>} paymentAccountLocalizeInfos - Payment account name considering localization.
|
|
127
|
+
* @property {boolean} isHistory - Indicates that the order has been saved in the order history.
|
|
128
|
+
*/
|
|
129
|
+
interface IOrdersByMarkersEntity {
|
|
130
|
+
statusIdentifier: string;
|
|
131
|
+
formIdentifier: string;
|
|
132
|
+
paymentIdentifier: string;
|
|
133
|
+
formData: Array<IOrdersFormData>;
|
|
134
|
+
products: Array<IOrderProducts>;
|
|
135
|
+
totalSum: string;
|
|
136
|
+
currency: string;
|
|
137
|
+
createdDate: string;
|
|
138
|
+
price: number;
|
|
139
|
+
paymentAccountIdentifier: string;
|
|
140
|
+
paymentAccountLocalizeInfos: Record<string, any>;
|
|
141
|
+
isHistory: boolean;
|
|
142
|
+
}
|
|
143
|
+
export { IOrdersEntity, IBaseOrdersEntity, IOrderProducts, IPicture, IOrdersApi, IOrderData, IOrderProductData, IOrderMarkerData, IOrdersFormData, IOrdersByMarkersEntity };
|
|
@@ -93,6 +93,7 @@ interface IFilterParams {
|
|
|
93
93
|
*
|
|
94
94
|
* @interface
|
|
95
95
|
* @property {number} id - The unique identifier.
|
|
96
|
+
* @property {object} additional - Additional value from the index.
|
|
96
97
|
* @property {Record<string, any>} localizeInfos - The name of the products, taking into account localization.
|
|
97
98
|
* @property {boolean} isVisible - A sign of page visibility.
|
|
98
99
|
* @property {number | null} statusId - Product page status identifiers (may be null).
|
|
@@ -102,10 +103,17 @@ interface IFilterParams {
|
|
|
102
103
|
* @property {number} price - The value of the product page price taken from the index.
|
|
103
104
|
* @property {string} templateIdentifier - User id of the linked template.
|
|
104
105
|
* @property {string} shortDescTemplateIdentifier - User id of the linked template for a short description.
|
|
106
|
+
* @property {Record<string, any>} statusLocalizeInfos - JSON description of the item status object, taking into account the language.
|
|
105
107
|
* @property {number} position - Item number (for sorting).
|
|
106
108
|
*/
|
|
107
109
|
interface IProductsEntity {
|
|
108
110
|
id: number;
|
|
111
|
+
additional: {
|
|
112
|
+
prices: {
|
|
113
|
+
min: number;
|
|
114
|
+
max: number;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
109
117
|
localizeInfos: Record<string, any>;
|
|
110
118
|
blocks?: string | Array<string>;
|
|
111
119
|
isVisible: boolean;
|
|
@@ -116,6 +124,7 @@ interface IProductsEntity {
|
|
|
116
124
|
price: number;
|
|
117
125
|
templateIdentifier: string | null;
|
|
118
126
|
shortDescTemplateIdentifier: string;
|
|
127
|
+
statusLocalizeInfos: Record<string, any>;
|
|
119
128
|
attributeValues: Record<string, any>;
|
|
120
129
|
position: number;
|
|
121
130
|
sku: string | null;
|
|
@@ -22,4 +22,12 @@ export default class TemplatesPreviewApi extends OneEntry implements ITemplatesA
|
|
|
22
22
|
* @returns Returns a TemplateEntity object
|
|
23
23
|
*/
|
|
24
24
|
getTemplateByType(type: Types, langCode?: string): Promise<Array<ITemplateEntity>>;
|
|
25
|
+
/**
|
|
26
|
+
* Get one template object by id.
|
|
27
|
+
*
|
|
28
|
+
* @param {string} id - Template id
|
|
29
|
+
*
|
|
30
|
+
* @returns Returns a TemplateEntity object
|
|
31
|
+
*/
|
|
32
|
+
getTemplateById(id: string): Promise<ITemplateList>;
|
|
25
33
|
}
|
|
@@ -35,5 +35,16 @@ class TemplatesPreviewApi extends oneEntry_1.default {
|
|
|
35
35
|
const result = await this._fetchGet(`?type=${type}`);
|
|
36
36
|
return this._normalizeData(result, langCode);
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Get one template object by id.
|
|
40
|
+
*
|
|
41
|
+
* @param {string} id - Template id
|
|
42
|
+
*
|
|
43
|
+
* @returns Returns a TemplateEntity object
|
|
44
|
+
*/
|
|
45
|
+
async getTemplateById(id) {
|
|
46
|
+
const result = await this._fetchGet(`/${id}`);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
38
49
|
}
|
|
39
50
|
exports.default = TemplatesPreviewApi;
|
|
@@ -4,12 +4,13 @@ import { Types } from "../base/utils";
|
|
|
4
4
|
* Represents an interface object of Templates Api.
|
|
5
5
|
*
|
|
6
6
|
* @property {function} getAllTemplates - Get all template objects grouped by types.
|
|
7
|
-
*
|
|
8
7
|
* @property {function} getTemplateByType - Get template objects by type.
|
|
8
|
+
* @property {function} getTemplateById - Get one template object by id.
|
|
9
9
|
*/
|
|
10
10
|
interface ITemplatesApi {
|
|
11
11
|
getAllTemplates(langCode: string): Promise<ITemplateList>;
|
|
12
12
|
getTemplateByType(type: Types, langCode: string): Promise<Array<ITemplateEntity>>;
|
|
13
|
+
getTemplateById(id: string): Promise<ITemplateList>;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Represents a template entity object.
|
|
@@ -21,7 +22,7 @@ interface ITemplatesApi {
|
|
|
21
22
|
* @property {string} identifier - The textual identifier for the record field.
|
|
22
23
|
* @property {IGeneralTypesEntity} generalType - General type Entity object.
|
|
23
24
|
* @property {number} generalTypeId - General type Entity id.
|
|
24
|
-
* @property {
|
|
25
|
+
* @property {string} title - The name of the template.
|
|
25
26
|
* @property {number} position - The position of the object.
|
|
26
27
|
* @property {number | string} positionId - Id of the item object.
|
|
27
28
|
* @property {Types} generalTypeName - General type name.
|
|
@@ -34,7 +35,7 @@ interface ITemplateEntity {
|
|
|
34
35
|
identifier: string;
|
|
35
36
|
generalType?: IGeneralTypesEntity;
|
|
36
37
|
generalTypeId: number;
|
|
37
|
-
|
|
38
|
+
title: string;
|
|
38
39
|
position: number;
|
|
39
40
|
positionId?: number;
|
|
40
41
|
generalTypeName: Types;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import OneEntry from "../base/oneEntry";
|
|
2
|
+
import { IConfig } from "../base/utils";
|
|
3
|
+
import { IUserBody, IUserEntity, IUsers } from "./usersInterfaces";
|
|
4
|
+
/**
|
|
5
|
+
* Controllers for working with users
|
|
6
|
+
*/
|
|
7
|
+
export default class UsersApi extends OneEntry implements IUsers {
|
|
8
|
+
constructor(url: string, config: IConfig);
|
|
9
|
+
/**
|
|
10
|
+
* Getting the data of an authorized user.
|
|
11
|
+
* @param {string} [langCode] Required parameter lang code.
|
|
12
|
+
*/
|
|
13
|
+
getUser(langCode?: string): Promise<IUserEntity>;
|
|
14
|
+
/**
|
|
15
|
+
* Updating a single user object.
|
|
16
|
+
* @param {object} data - Request body.
|
|
17
|
+
* @param {string} langCode - Optional language field
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* {
|
|
21
|
+
* "formIdentifier": "reg",
|
|
22
|
+
* "authData": [
|
|
23
|
+
* {
|
|
24
|
+
* "marker": "password",
|
|
25
|
+
* "value": "12345"
|
|
26
|
+
* }
|
|
27
|
+
* ],
|
|
28
|
+
* "formData": {
|
|
29
|
+
* "marker": "last_name",
|
|
30
|
+
* "type": "string",
|
|
31
|
+
* "value": "Username"
|
|
32
|
+
* },
|
|
33
|
+
* "notificationData": {
|
|
34
|
+
* "email": "test@test.com",
|
|
35
|
+
* "phonePush": "",
|
|
36
|
+
* "phoneSMS": "+99999999999"
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
*/
|
|
40
|
+
updateUser(data: IUserBody, langCode?: string): Promise<any>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const oneEntry_1 = require("../base/oneEntry");
|
|
4
|
+
/**
|
|
5
|
+
* Controllers for working with users
|
|
6
|
+
*/
|
|
7
|
+
class UsersApi extends oneEntry_1.default {
|
|
8
|
+
constructor(url, config) {
|
|
9
|
+
super(url, config);
|
|
10
|
+
this._url += '/api/content/users';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Getting the data of an authorized user.
|
|
14
|
+
* @param {string} [langCode] Required parameter lang code.
|
|
15
|
+
*/
|
|
16
|
+
async getUser(langCode = this._defaultLangCode) {
|
|
17
|
+
const result = await this._fetchGet(`/me?langCode=${langCode}`);
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Updating a single user object.
|
|
22
|
+
* @param {object} data - Request body.
|
|
23
|
+
* @param {string} langCode - Optional language field
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* {
|
|
27
|
+
* "formIdentifier": "reg",
|
|
28
|
+
* "authData": [
|
|
29
|
+
* {
|
|
30
|
+
* "marker": "password",
|
|
31
|
+
* "value": "12345"
|
|
32
|
+
* }
|
|
33
|
+
* ],
|
|
34
|
+
* "formData": {
|
|
35
|
+
* "marker": "last_name",
|
|
36
|
+
* "type": "string",
|
|
37
|
+
* "value": "Username"
|
|
38
|
+
* },
|
|
39
|
+
* "notificationData": {
|
|
40
|
+
* "email": "test@test.com",
|
|
41
|
+
* "phonePush": "",
|
|
42
|
+
* "phoneSMS": "+99999999999"
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
45
|
+
*/
|
|
46
|
+
async updateUser(data, langCode = this._defaultLangCode) {
|
|
47
|
+
const result = await this._fetchPut('', this._normalizePostBody(data));
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = UsersApi;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IAuthFormData } from "../auth-provider/authProvidersInterfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a interface object of Users Api.
|
|
4
|
+
*
|
|
5
|
+
* @property {function} subscribeByMarker - Getting the data of an authorized user.
|
|
6
|
+
* @property {function} unsubscribeByMarker - Updating a single user object.
|
|
7
|
+
*/
|
|
8
|
+
interface IUsers {
|
|
9
|
+
getUser(langCode?: string): Promise<IUserEntity>;
|
|
10
|
+
updateUser(data: IUserBody, langCode?: string): Promise<any>;
|
|
11
|
+
}
|
|
12
|
+
interface IUserEntity {
|
|
13
|
+
id: number;
|
|
14
|
+
identifier: string;
|
|
15
|
+
formIdentifier: string;
|
|
16
|
+
authProviderIdentifier: string;
|
|
17
|
+
groups: Array<string>;
|
|
18
|
+
}
|
|
19
|
+
interface IUserBody {
|
|
20
|
+
formIdentifier: string;
|
|
21
|
+
authData: Array<{
|
|
22
|
+
marker: 'login' | 'password';
|
|
23
|
+
value: string;
|
|
24
|
+
}>;
|
|
25
|
+
formData: IAuthFormData | Array<IAuthFormData>;
|
|
26
|
+
notificationData: {
|
|
27
|
+
[key: string]: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export { IUsers, IUserEntity, IUserBody, };
|