oneentry 1.0.141 → 1.0.143
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/configure.js +107 -15
- package/dist/admins/adminsInterfaces.d.ts +1 -2
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +11 -13
- package/dist/auth-provider/authProviderApi.d.ts +1 -1
- package/dist/auth-provider/authProviderApi.js +13 -10
- package/dist/auth-provider/authProvidersInterfaces.d.ts +4 -17
- package/dist/base/asyncModules.js +8 -0
- package/dist/base/stateModule.js +1 -1
- package/dist/base/syncModules.d.ts +139 -2
- package/dist/base/syncModules.js +188 -21
- package/dist/base/utils.d.ts +1 -1
- package/dist/blocks/blocksInterfaces.d.ts +0 -5
- package/dist/blocks/blocksSchemas.d.ts +8 -0
- package/dist/file-uploading/fileUploadingApi.d.ts +5 -5
- package/dist/file-uploading/fileUploadingApi.js +3 -6
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +5 -8
- package/dist/forms/formsInterfaces.d.ts +4 -2
- package/dist/forms-data/formsDataInterfaces.d.ts +0 -3
- package/dist/general-types/generalTypesInterfaces.d.ts +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +3 -13
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +26 -26
- package/dist/locales/localesInterfaces.d.ts +0 -1
- package/dist/menus/menusInterfaces.d.ts +0 -1
- package/dist/menus/menusInterfaces.js +0 -1
- package/dist/orders/ordersInterfaces.d.ts +8 -15
- package/dist/pages/pagesInterfaces.d.ts +0 -8
- package/dist/payments/paymentsInterfaces.d.ts +0 -6
- package/dist/product-statuses/productStatusesInterfaces.d.ts +0 -4
- package/dist/products/productsInterfaces.d.ts +10 -19
- package/dist/products/productsSchemas.d.ts +8 -0
- package/dist/products/productsSchemas.js +2 -0
- package/dist/system/systemApi.d.ts +6 -6
- package/dist/system/systemApi.js +3 -5
- package/dist/system/systemInterfaces.d.ts +6 -8
- package/dist/system/systemInterfaces.js +0 -3
- package/dist/templates/templatesInterfaces.d.ts +0 -3
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +0 -2
- package/dist/users/usersApi.js +1 -3
- package/dist/users/usersInterfaces.d.ts +1 -7
- package/dist/web-socket/wsInterfaces.d.ts +0 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import AsyncModules from '../base/asyncModules';
|
|
2
2
|
import type StateModule from '../base/stateModule';
|
|
3
3
|
import type { IError } from '../base/utils';
|
|
4
|
-
import type { ICollectionEntity, ICollectionFormObject, ICollectionIsValid, ICollectionRow, ICollectionRowsResponce, ICollectionsApi } from './integrationCollectionsInterfaces';
|
|
4
|
+
import type { ICollectionEntity, ICollectionFormObject, ICollectionIsValid, ICollectionQuery, ICollectionRow, ICollectionRowsResponce, ICollectionsApi } from './integrationCollectionsInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with attributes.
|
|
7
7
|
* @handle /api/content/integration-collections
|
|
@@ -36,12 +36,7 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
36
36
|
* @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
|
|
37
37
|
* @returns {Promise<ICollectionEntity[] | IError>} Returns an array of ICollection objects or an error object if there was an issue.
|
|
38
38
|
*/
|
|
39
|
-
getICollections(langCode?: string, userQuery?:
|
|
40
|
-
limit: number;
|
|
41
|
-
offset: number;
|
|
42
|
-
entityType: string;
|
|
43
|
-
entityId: number;
|
|
44
|
-
}): Promise<ICollectionEntity[] | IError>;
|
|
39
|
+
getICollections(langCode?: string, userQuery?: ICollectionQuery): Promise<ICollectionEntity[] | IError>;
|
|
45
40
|
/**
|
|
46
41
|
* Get a single collection object by id.
|
|
47
42
|
* @handleName getICollectionById
|
|
@@ -72,12 +67,7 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
72
67
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
73
68
|
* @description Get all records belonging to the collection by collection id.
|
|
74
69
|
*/
|
|
75
|
-
getICollectionRowsById(id: number, langCode?: string, userQuery?:
|
|
76
|
-
limit: number;
|
|
77
|
-
offset: number;
|
|
78
|
-
entityType: string;
|
|
79
|
-
entityId: number;
|
|
80
|
-
}): Promise<ICollectionRowsResponce | IError>;
|
|
70
|
+
getICollectionRowsById(id: number, langCode?: string, userQuery?: ICollectionQuery): Promise<ICollectionRowsResponce | IError>;
|
|
81
71
|
/**
|
|
82
72
|
* Check for the existence of a text identifier (marker).
|
|
83
73
|
* @handleName validateICollectionMarker
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface ICollectionsApi
|
|
4
|
-
* @property {Function} getICollections - Get all collections.
|
|
5
|
-
* @property {Function} getICollectionById - Get a single collection object.
|
|
6
|
-
* @property {Function} getICollectionRowsById - Get all records belonging to the collection by collection id.
|
|
7
|
-
* @property {Function} validateICollectionMarker - Check for the existence of a text identifier (marker).
|
|
8
|
-
* @property {Function} getICollectionRowsByMarker - Getting all records (row) from the collection.
|
|
9
|
-
* @property {Function} getICollectionRowByMarkerAndId - Getting one record (rows) from the collection.
|
|
10
|
-
* @property {Function} createICollectionRow - Create a record (row) in the collection.
|
|
11
|
-
* @property {Function} updateICollectionRow - Edit a record (row) in the collection.
|
|
12
|
-
* @property {Function} deleteICollectionRowByMarkerAndId - Deletion of collection record object (row).
|
|
13
4
|
* @description This interface defines methods for managing collections and their records in the system.
|
|
14
5
|
*/
|
|
15
6
|
interface ICollectionsApi {
|
|
@@ -17,7 +8,7 @@ interface ICollectionsApi {
|
|
|
17
8
|
* Get all collections.
|
|
18
9
|
* @handleName getICollections
|
|
19
10
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
20
|
-
* @param {
|
|
11
|
+
* @param {ICollectionQuery} [userQuery] - Query parameters.
|
|
21
12
|
* @example
|
|
22
13
|
{
|
|
23
14
|
"limit": 30,
|
|
@@ -33,12 +24,7 @@ interface ICollectionsApi {
|
|
|
33
24
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
34
25
|
* @description This method gets all collections.
|
|
35
26
|
*/
|
|
36
|
-
getICollections(langCode: string, userQuery?:
|
|
37
|
-
limit: number;
|
|
38
|
-
offset: number;
|
|
39
|
-
entityType: string;
|
|
40
|
-
entityId: number;
|
|
41
|
-
}): Promise<ICollectionEntity[] | IError>;
|
|
27
|
+
getICollections(langCode: string, userQuery?: ICollectionQuery): Promise<ICollectionEntity[] | IError>;
|
|
42
28
|
/**
|
|
43
29
|
* Get a single collection object by id.
|
|
44
30
|
* @handleName getICollectionById
|
|
@@ -54,7 +40,7 @@ interface ICollectionsApi {
|
|
|
54
40
|
* @handleName getICollectionRowsById
|
|
55
41
|
* @param {number} id - Collection id.
|
|
56
42
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
57
|
-
* @param {
|
|
43
|
+
* @param {ICollectionQuery} [userQuery] - Optional set query parameters.
|
|
58
44
|
* @example
|
|
59
45
|
{
|
|
60
46
|
"limit": 30,
|
|
@@ -70,7 +56,7 @@ interface ICollectionsApi {
|
|
|
70
56
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
71
57
|
* @description This method gets all records belonging to the collection by collection id.
|
|
72
58
|
*/
|
|
73
|
-
getICollectionRowsById(id: number, langCode: string, userQuery?:
|
|
59
|
+
getICollectionRowsById(id: number, langCode: string, userQuery?: ICollectionQuery): Promise<ICollectionRowsResponce | IError>;
|
|
74
60
|
/**
|
|
75
61
|
* Check for the existence of a text identifier (marker).
|
|
76
62
|
* @handleName validateICollectionMarker
|
|
@@ -122,11 +108,11 @@ interface ICollectionsApi {
|
|
|
122
108
|
]
|
|
123
109
|
}
|
|
124
110
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
125
|
-
* @returns {
|
|
111
|
+
* @returns {ICollectionRow} Returns object of type ICollectionRow.
|
|
126
112
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
127
113
|
* @description This method creates a record in the collection.
|
|
128
114
|
*/
|
|
129
|
-
createICollectionRow(marker: string, body: ICollectionFormObject, langCode: string): Promise<
|
|
115
|
+
createICollectionRow(marker: string, body: ICollectionFormObject, langCode: string): Promise<ICollectionRow | IError>;
|
|
130
116
|
/**
|
|
131
117
|
* Edit a record in the collection.
|
|
132
118
|
* @handleName updateICollectionRow
|
|
@@ -149,7 +135,7 @@ interface ICollectionsApi {
|
|
|
149
135
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
150
136
|
* @description This method edits a record in the collection.
|
|
151
137
|
*/
|
|
152
|
-
updateICollectionRow(marker: string, id: number, body: ICollectionFormObject, langCode: string): Promise<
|
|
138
|
+
updateICollectionRow(marker: string, id: number, body: ICollectionFormObject, langCode: string): Promise<ICollectionRow | IError>;
|
|
153
139
|
/**
|
|
154
140
|
* Deletion of collection record object
|
|
155
141
|
* @handleName deleteICollectionRowByMarkerAndId
|
|
@@ -159,7 +145,7 @@ interface ICollectionsApi {
|
|
|
159
145
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
160
146
|
* @description This method deletes a collection record object.
|
|
161
147
|
*/
|
|
162
|
-
deleteICollectionRowByMarkerAndId(marker: string, id: number): Promise<
|
|
148
|
+
deleteICollectionRowByMarkerAndId(marker: string, id: number): Promise<boolean | IError>;
|
|
163
149
|
}
|
|
164
150
|
/**
|
|
165
151
|
* Collection object
|
|
@@ -228,9 +214,9 @@ interface ICollectionFormData {
|
|
|
228
214
|
"value": "Value"
|
|
229
215
|
}
|
|
230
216
|
]
|
|
231
|
-
* @property {string} formData[
|
|
232
|
-
* @property {string} formData[
|
|
233
|
-
* @property {string} formData[
|
|
217
|
+
* @property {string} formData[].marker - Text identifier (marker) of the form field. Example: "name_1".
|
|
218
|
+
* @property {string} formData[].type - Type of the form field. Example: "string".
|
|
219
|
+
* @property {string} formData[].value - Value of the form field. Example: "Value".
|
|
234
220
|
* @description Represents a collection form object that contains a form identifier and associated form data. This interface defines the structure of a collection form object, which includes a form identifier and a set of form data organized by markers.
|
|
235
221
|
*/
|
|
236
222
|
interface ICollectionFormObject {
|
|
@@ -310,4 +296,18 @@ interface ICollectionRowsResponce {
|
|
|
310
296
|
interface ICollectionIsValid {
|
|
311
297
|
valid: boolean;
|
|
312
298
|
}
|
|
313
|
-
|
|
299
|
+
/**
|
|
300
|
+
* Query parameters for collection requests.
|
|
301
|
+
* @interface ICollectionQuery
|
|
302
|
+
* @property {number} limit - Parameter for pagination. Default: 30.
|
|
303
|
+
* @property {number} offset - Parameter for pagination. Default: 0.
|
|
304
|
+
* @property {string} entityType - Entity type. Example: "orders".
|
|
305
|
+
* @property {number} entityId - Entity identifier. Example: 1.
|
|
306
|
+
*/
|
|
307
|
+
interface ICollectionQuery {
|
|
308
|
+
limit: number;
|
|
309
|
+
offset: number;
|
|
310
|
+
entityType: string;
|
|
311
|
+
entityId: number;
|
|
312
|
+
}
|
|
313
|
+
export type { ICollectionEntity, ICollectionFormObject, ICollectionIsValid, ICollectionQuery, ICollectionResponce, ICollectionRow, ICollectionRowsResponce, ICollectionsApi, };
|
|
@@ -2,7 +2,6 @@ import type { IError } from '../base/utils';
|
|
|
2
2
|
/**
|
|
3
3
|
* The `ILocales` interface defines methods for working with language localization objects in the system.
|
|
4
4
|
* @interface ILocales
|
|
5
|
-
* @property {Function} getLocales - Find all active language localization objects.
|
|
6
5
|
* @description This interface defines a method for retrieving all active language localization objects in the system.
|
|
7
6
|
*/
|
|
8
7
|
interface ILocales {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { IAttributeValues, IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IMenus
|
|
4
|
-
* @property {Function} getMenusByMarker - Get pages includes in menu by marker.
|
|
5
4
|
* @description This interface defines a method for retrieving menu pages by a specific marker and language code.
|
|
6
5
|
*/
|
|
7
6
|
interface IMenus {
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IOrdersApi
|
|
4
|
-
* @property {Function} getOrdersStorageByMarker - Retrieve one order storage object by marker.
|
|
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} getOrderByMarkerAndId - Getting a single order from the order storage object created by the user.
|
|
8
|
-
* @property {Function} getAllOrders - Getting all the order storage objects.
|
|
9
|
-
* @property {Function} getAllOrdersByMarker - Getting one order storage object by marker.
|
|
10
|
-
* @property {Function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
|
|
11
4
|
* @description Represents the API for managing orders in the order storage.
|
|
12
5
|
*/
|
|
13
6
|
interface IOrdersApi {
|
|
@@ -209,7 +202,7 @@ interface IPicture {
|
|
|
209
202
|
* @property {number} quantity - Product quantity. Example: 1.
|
|
210
203
|
* @property {string} title - Product title. Example: "Cosmo".
|
|
211
204
|
* @property {string | null} sku - Product sku. Example: "SKU".
|
|
212
|
-
* @property {
|
|
205
|
+
* @property {IPicture | null} previewImage - Product previewImage.
|
|
213
206
|
* @example
|
|
214
207
|
{
|
|
215
208
|
"filename": "image.jpg",
|
|
@@ -226,7 +219,7 @@ interface IOrderProducts {
|
|
|
226
219
|
quantity: number;
|
|
227
220
|
title: string;
|
|
228
221
|
sku: string | null;
|
|
229
|
-
previewImage:
|
|
222
|
+
previewImage: IPicture | null;
|
|
230
223
|
price: number;
|
|
231
224
|
isGift: boolean;
|
|
232
225
|
}
|
|
@@ -241,7 +234,7 @@ interface IOrderProducts {
|
|
|
241
234
|
interface IOrdersFormData {
|
|
242
235
|
marker: string;
|
|
243
236
|
type: string;
|
|
244
|
-
value:
|
|
237
|
+
value: unknown;
|
|
245
238
|
}
|
|
246
239
|
/**
|
|
247
240
|
* Interface representing product data in an order.
|
|
@@ -424,7 +417,7 @@ interface IOrderData {
|
|
|
424
417
|
* @property {string} totalSum - Total order amount. Example: "100.00".
|
|
425
418
|
* @property {string} currency - Currency used to pay for the order. Example: "USD".
|
|
426
419
|
* @property {string | null} [paymentAccountIdentifier] - Textual identifier for the order payment. Example: "payment-1".
|
|
427
|
-
* @property {Record<string,
|
|
420
|
+
* @property {Record<string, unknown>} paymentAccountLocalizeInfos - Payment account name considering localization.
|
|
428
421
|
* @example
|
|
429
422
|
{
|
|
430
423
|
"en_US": "USD Payment",
|
|
@@ -455,7 +448,7 @@ interface IOrderByMarkerEntity {
|
|
|
455
448
|
totalSum: string;
|
|
456
449
|
currency: string;
|
|
457
450
|
paymentAccountIdentifier?: string;
|
|
458
|
-
paymentAccountLocalizeInfos?: Record<string,
|
|
451
|
+
paymentAccountLocalizeInfos?: Record<string, unknown>;
|
|
459
452
|
paymentUrl: string | null;
|
|
460
453
|
products: IOrderProducts[];
|
|
461
454
|
isCompleted: boolean | null;
|
|
@@ -486,7 +479,7 @@ interface IOrderStatus {
|
|
|
486
479
|
interface IPreviewOrderProduct {
|
|
487
480
|
productId?: number;
|
|
488
481
|
quantity?: number;
|
|
489
|
-
[key: string]:
|
|
482
|
+
[key: string]: unknown;
|
|
490
483
|
}
|
|
491
484
|
/**
|
|
492
485
|
* Interface representing the body for order preview calculation.
|
|
@@ -499,14 +492,14 @@ interface ICreateOrderPreview {
|
|
|
499
492
|
products?: IPreviewOrderProduct[];
|
|
500
493
|
couponCode?: string;
|
|
501
494
|
additionalDiscountsMarkers?: string[];
|
|
502
|
-
[key: string]:
|
|
495
|
+
[key: string]: unknown;
|
|
503
496
|
}
|
|
504
497
|
/**
|
|
505
498
|
* Interface representing a single item in an order preview.
|
|
506
499
|
* @interface IOrderPreviewItem
|
|
507
500
|
*/
|
|
508
501
|
interface IOrderPreviewItem {
|
|
509
|
-
[key: string]:
|
|
502
|
+
[key: string]: unknown;
|
|
510
503
|
}
|
|
511
504
|
/**
|
|
512
505
|
* Interface representing the response from an order preview calculation.
|
|
@@ -4,14 +4,6 @@ import type { IFormConfig } from '../forms/formsInterfaces';
|
|
|
4
4
|
import type { ITemplateEntity } from '../templates/templatesInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* @interface IPagesApi
|
|
7
|
-
* @property {Function} getRootPages - Get all top-level page objects.
|
|
8
|
-
* @property {Function} getCatalogPages - Get all page objects with product information as an array.
|
|
9
|
-
* @property {Function} getPages - Get all page objects with product information as an array.
|
|
10
|
-
* @property {Function} getPageById - Get page object with information about forms, blocks, menus, linked to the page.
|
|
11
|
-
* @property {Function} getPageByUrl - Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
12
|
-
* @property {Function} getChildPagesByParentUrl - Get child pages object with information as an array.
|
|
13
|
-
* @property {Function} getConfigPageByUrl - Get settings for the page.
|
|
14
|
-
* @property {Function} searchPage - Quick search for page objects with limited output.
|
|
15
7
|
* @description This interface defines methods for retrieving and managing pages in the system.
|
|
16
8
|
*/
|
|
17
9
|
interface IPagesApi {
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IPaymentsApi
|
|
4
|
-
* @property {Function} getSessions - Get list of payment sessions.
|
|
5
|
-
* @property {Function} getSessionById - Get a single payment session object by its identifier.
|
|
6
|
-
* @property {Function} createSession - Creation of payment session.
|
|
7
|
-
* @property {Function} getAccounts - Get all payment accounts as an array.
|
|
8
|
-
* @property {Function} getAccountById - Get a single payment account object by its identifier.
|
|
9
|
-
* @property {Function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
|
|
10
4
|
* @description This interface defines methods for managing payment sessions, accounts, and connected payment settings in the system.
|
|
11
5
|
*/
|
|
12
6
|
interface IPaymentsApi {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IProductStatuses
|
|
4
|
-
* @property {Function} getProductStatuses - Search for all product status objects.
|
|
5
|
-
* @property {Function} getProductStatusesById - Search for a product status object by identifier.
|
|
6
|
-
* @property {Function} getProductsByStatusMarker - Search for a product status object by its textual identifier (marker).
|
|
7
|
-
* @property {Function} validateMarker - Check the existence of a textual identifier.
|
|
8
4
|
* @description This interface defines methods for retrieving and managing product statuses in the system.
|
|
9
5
|
*/
|
|
10
6
|
interface IProductStatusesApi {
|
|
@@ -2,19 +2,6 @@ import type { AttributeType, IError, ILocalizeInfo, LangType, Types } from '../b
|
|
|
2
2
|
import type { IFormConfig } from '../forms/formsInterfaces';
|
|
3
3
|
/**
|
|
4
4
|
* @interface IProductsApi
|
|
5
|
-
* @property {Function} getProducts - Search for all product page objects with pagination and filtering.
|
|
6
|
-
* @property {Function} getProductsEmptyPage - Search for all product page objects with pagination that do not have a category.
|
|
7
|
-
* @property {Function} getProductsByPageId - Search for all products with pagination for the selected category.
|
|
8
|
-
* @property {Function} getProductsPriceByPageUrl - Search for information about products and prices for the selected category.
|
|
9
|
-
* @property {Function} getProductsByPageUrl - Search for all products with pagination for the selected category.
|
|
10
|
-
* @property {Function} getRelatedProductsById - Find all related product page objects.
|
|
11
|
-
* @property {Function} getProductsByIds - Find products by its ids.
|
|
12
|
-
* @property {Function} getProductById - Retrieve one product object.
|
|
13
|
-
* @property {Function} getProductBlockById - Getting a product block object by product id.
|
|
14
|
-
* @property {Function} searchProduct - Quick search for product page objects with limited output.
|
|
15
|
-
* @property {Function} getProductsCount - Retrieves the total number of products available in the entire catalog.
|
|
16
|
-
* @property {Function} getProductsCountByPageId - Retrieves the number of products on a specific catalog page identified by its page ID.
|
|
17
|
-
* @property {Function} getProductsCountByPageUrl - Retrieves the number of products on a specific catalog page identified by its URL.
|
|
18
5
|
* @description This interface defines methods for retrieving and managing products in the system.
|
|
19
6
|
*/
|
|
20
7
|
interface IProductsApi {
|
|
@@ -357,7 +344,7 @@ interface IProductsQuery {
|
|
|
357
344
|
conditionValue?: string | null;
|
|
358
345
|
attributeMarker?: string | null;
|
|
359
346
|
conditionMarker?: 'in' /** in - Contains */ | 'nin' /** nin - Does not contain */ | 'eq' /** 'eq' - Equal */ | 'neq' /** 'neq' - Not equal */ | 'mth' /** 'mth' - Greater than */ | 'lth' /** 'lth' - Less than */ | 'exs' /** 'exs' - Exists */ | 'nexs' /** 'nexs' - Does not exist */ | null;
|
|
360
|
-
[key: string]:
|
|
347
|
+
[key: string]: unknown;
|
|
361
348
|
}
|
|
362
349
|
/**
|
|
363
350
|
* @interface IFilterParams
|
|
@@ -386,7 +373,7 @@ interface IFilterParams {
|
|
|
386
373
|
* @property {number} id - The unique identifier. Example: 12345.
|
|
387
374
|
* @property {ILocalizeInfo} localizeInfos - The name of the products, taking into account localization. Example: {}.
|
|
388
375
|
* @property {string | null} statusIdentifier - Product page status identifiers (may be null). Example: "in_stock".
|
|
389
|
-
* @property {Record<string,
|
|
376
|
+
* @property {Record<string, unknown>} statusLocalizeInfos - JSON description of the item status object, taking into account the language. Example: {}.
|
|
390
377
|
* @property {string | null} attributeSetIdentifier - Set of attributes id. Example: "set_12345".
|
|
391
378
|
* @property {number} position - Item number (for sorting). Example: 1.
|
|
392
379
|
* @property {number | null} price - The value of the product page price taken from the index. Example: 150.00.
|
|
@@ -422,10 +409,12 @@ interface IFilterParams {
|
|
|
422
409
|
12345,
|
|
423
410
|
67890
|
|
424
411
|
]
|
|
412
|
+
* @property {unknown} [paymentStages] - Payment stages data (may be null). Example: null.
|
|
413
|
+
* @property {Record<string, unknown>} [discountConfig] - Discount configuration object. Example: {}.
|
|
425
414
|
* @property {string | null} [templateIdentifier] - User id of the linked template. Example: "template_12345".
|
|
426
415
|
* @property {string | null} [shortDescTemplateIdentifier] - User id of the linked template for a short description. Example: "short_desc_template_12345".
|
|
427
416
|
* @property {string} [signedPrice] - Price sign.
|
|
428
|
-
* @property {Array<Record<string,
|
|
417
|
+
* @property {Array<Record<string, unknown>> | Record<string, unknown>} [productPages] - Array of product pages or a single product page object. Example: [].
|
|
429
418
|
* @property {string[]} [blocks] - Array of block identifiers.
|
|
430
419
|
* @example
|
|
431
420
|
[
|
|
@@ -438,7 +427,7 @@ interface IProductsEntity {
|
|
|
438
427
|
id: number;
|
|
439
428
|
localizeInfos: ILocalizeInfo;
|
|
440
429
|
statusIdentifier: string | null;
|
|
441
|
-
statusLocalizeInfos: Record<string,
|
|
430
|
+
statusLocalizeInfos: Record<string, unknown>;
|
|
442
431
|
attributeSetIdentifier: string | null;
|
|
443
432
|
position: number;
|
|
444
433
|
price: number | null;
|
|
@@ -457,10 +446,12 @@ interface IProductsEntity {
|
|
|
457
446
|
templateIdentifier?: string | null;
|
|
458
447
|
shortDescTemplateIdentifier?: string | null;
|
|
459
448
|
signedPrice?: string;
|
|
460
|
-
productPages?: Array<Record<string,
|
|
449
|
+
productPages?: Array<Record<string, unknown>> | Record<string, unknown>;
|
|
461
450
|
blocks?: string[];
|
|
462
451
|
isPositionLocked?: boolean;
|
|
463
452
|
relatedIds?: number[];
|
|
453
|
+
paymentStages?: unknown;
|
|
454
|
+
discountConfig?: Record<string, unknown>;
|
|
464
455
|
}
|
|
465
456
|
/**
|
|
466
457
|
* @interface IProductsResponse
|
|
@@ -576,7 +567,7 @@ interface IProductBlock {
|
|
|
576
567
|
keywords: string;
|
|
577
568
|
strict: string;
|
|
578
569
|
}>;
|
|
579
|
-
condition: Record<string,
|
|
570
|
+
condition: Record<string, unknown>;
|
|
580
571
|
};
|
|
581
572
|
templateIdentifier: string | null;
|
|
582
573
|
isVisible: boolean;
|
|
@@ -56,6 +56,8 @@ export declare const ProductEntitySchema: z.ZodObject<{
|
|
|
56
56
|
}, z.core.$strip>>>;
|
|
57
57
|
relatedProducts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
58
58
|
pageId: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
paymentStages: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
60
|
+
discountConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
59
61
|
}, z.core.$strip>;
|
|
60
62
|
/**
|
|
61
63
|
* Products response schema
|
|
@@ -92,6 +94,8 @@ export declare const ProductsResponseSchema: z.ZodObject<{
|
|
|
92
94
|
}, z.core.$strip>>>;
|
|
93
95
|
relatedProducts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
94
96
|
pageId: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
paymentStages: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
98
|
+
discountConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
95
99
|
}, z.core.$strip>>;
|
|
96
100
|
total: z.ZodNumber;
|
|
97
101
|
}, z.core.$strip>;
|
|
@@ -129,6 +133,8 @@ export declare const SingleProductSchema: z.ZodObject<{
|
|
|
129
133
|
}, z.core.$strip>>>;
|
|
130
134
|
relatedProducts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
131
135
|
pageId: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
paymentStages: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
137
|
+
discountConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
132
138
|
}, z.core.$strip>;
|
|
133
139
|
/**
|
|
134
140
|
* Products count schema
|
|
@@ -189,4 +195,6 @@ export declare const RelatedProductsSchema: z.ZodArray<z.ZodObject<{
|
|
|
189
195
|
}, z.core.$strip>>>;
|
|
190
196
|
relatedProducts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
191
197
|
pageId: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
paymentStages: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
199
|
+
discountConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
192
200
|
}, z.core.$strip>>;
|
|
@@ -53,6 +53,8 @@ exports.ProductEntitySchema = zod_1.z.object({
|
|
|
53
53
|
images: zod_1.z.array(exports.ProductImageSchema).optional(),
|
|
54
54
|
relatedProducts: zod_1.z.array(zod_1.z.number()).optional(),
|
|
55
55
|
pageId: zod_1.z.number().optional(),
|
|
56
|
+
paymentStages: zod_1.z.any().optional().nullable(),
|
|
57
|
+
discountConfig: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
56
58
|
});
|
|
57
59
|
/**
|
|
58
60
|
* Products response schema
|
|
@@ -19,25 +19,25 @@ export default class SystemApi extends AsyncModules implements ISystemApi {
|
|
|
19
19
|
/**
|
|
20
20
|
* Sends a GET request to the '/test404' endpoint and returns the result.
|
|
21
21
|
* @handleName test404
|
|
22
|
-
* @returns {Promise<
|
|
22
|
+
* @returns {Promise<unknown | IError>} The response from the server after fetching data from the '/test404' endpoint.
|
|
23
23
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
24
24
|
* @description This method is used to test the 404 error handling by sending a GET request to a specific endpoint.
|
|
25
25
|
*/
|
|
26
|
-
test404(): Promise<
|
|
26
|
+
test404(): Promise<unknown | IError>;
|
|
27
27
|
/**
|
|
28
28
|
* Sends a GET request to the '/test500' endpoint and returns the result.
|
|
29
29
|
* @handleName test500
|
|
30
|
-
* @returns {Promise<
|
|
30
|
+
* @returns {Promise<unknown | IError>} The response from the server after fetching data from the '/test500' endpoint.
|
|
31
31
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
32
32
|
* @description This method is used to test the 500 error handling by sending a GET request to a specific endpoint.
|
|
33
33
|
*/
|
|
34
|
-
test500(): Promise<
|
|
34
|
+
test500(): Promise<unknown | IError>;
|
|
35
35
|
/**
|
|
36
36
|
* Getting the number of requests to API.
|
|
37
37
|
* @handleName getApiStat
|
|
38
|
-
* @returns {Promise<
|
|
38
|
+
* @returns {Promise<unknown | IError>} Return object with date and count.
|
|
39
39
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
40
40
|
* @description Getting the number of requests to API.
|
|
41
41
|
*/
|
|
42
|
-
getApiStat(): Promise<
|
|
42
|
+
getApiStat(): Promise<unknown>;
|
|
43
43
|
}
|
package/dist/system/systemApi.js
CHANGED
|
@@ -3,8 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
/* eslint-disable jsdoc/reject-any-type */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
6
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
9
7
|
/**
|
|
10
8
|
* Controllers for working with system - system
|
|
@@ -24,7 +22,7 @@ class SystemApi extends asyncModules_1.default {
|
|
|
24
22
|
/**
|
|
25
23
|
* Sends a GET request to the '/test404' endpoint and returns the result.
|
|
26
24
|
* @handleName test404
|
|
27
|
-
* @returns {Promise<
|
|
25
|
+
* @returns {Promise<unknown | IError>} The response from the server after fetching data from the '/test404' endpoint.
|
|
28
26
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
29
27
|
* @description This method is used to test the 404 error handling by sending a GET request to a specific endpoint.
|
|
30
28
|
*/
|
|
@@ -35,7 +33,7 @@ class SystemApi extends asyncModules_1.default {
|
|
|
35
33
|
/**
|
|
36
34
|
* Sends a GET request to the '/test500' endpoint and returns the result.
|
|
37
35
|
* @handleName test500
|
|
38
|
-
* @returns {Promise<
|
|
36
|
+
* @returns {Promise<unknown | IError>} The response from the server after fetching data from the '/test500' endpoint.
|
|
39
37
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
40
38
|
* @description This method is used to test the 500 error handling by sending a GET request to a specific endpoint.
|
|
41
39
|
*/
|
|
@@ -46,7 +44,7 @@ class SystemApi extends asyncModules_1.default {
|
|
|
46
44
|
/**
|
|
47
45
|
* Getting the number of requests to API.
|
|
48
46
|
* @handleName getApiStat
|
|
49
|
-
* @returns {Promise<
|
|
47
|
+
* @returns {Promise<unknown | IError>} Return object with date and count.
|
|
50
48
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
51
49
|
* @description Getting the number of requests to API.
|
|
52
50
|
*/
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import type { IError } from 'base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface ISystemApi
|
|
4
|
-
* @property {Function} test404 - Test 404 error.
|
|
5
|
-
* @property {Function} test500 - Test 500 error.
|
|
6
4
|
* @description Represents a interface object of System Api.
|
|
7
5
|
*/
|
|
8
6
|
interface ISystemApi {
|
|
9
7
|
/**
|
|
10
8
|
* Test 404 error.
|
|
11
9
|
* @handleName test404
|
|
12
|
-
* @returns {
|
|
10
|
+
* @returns {unknown} Returns a Promise that resolves with any data.
|
|
13
11
|
* @description This method tests 404 error.
|
|
14
12
|
*/
|
|
15
|
-
test404(): Promise<
|
|
13
|
+
test404(): Promise<unknown | IError>;
|
|
16
14
|
/**
|
|
17
15
|
* Test 500 error.
|
|
18
16
|
* @handleName test500
|
|
19
|
-
* @returns {
|
|
17
|
+
* @returns {unknown} Returns a Promise that resolves with any data.
|
|
20
18
|
* @description This method tests 500 error.
|
|
21
19
|
*/
|
|
22
|
-
test500(): Promise<
|
|
20
|
+
test500(): Promise<unknown | IError>;
|
|
23
21
|
/**
|
|
24
22
|
* getApiStat
|
|
25
23
|
* @handleName getApiStat
|
|
26
|
-
* @returns {
|
|
24
|
+
* @returns {unknown} Returns a Promise that resolves with any data.
|
|
27
25
|
* @description This method getApiStat.
|
|
28
26
|
*/
|
|
29
|
-
getApiStat(): Promise<
|
|
27
|
+
getApiStat(): Promise<unknown>;
|
|
30
28
|
}
|
|
31
29
|
export type { ISystemApi };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { AttributeType, IError, Types } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface ITemplatesApi
|
|
4
|
-
* @property {Function} getAllTemplates - Get all template objects grouped by types.
|
|
5
|
-
* @property {Function} getTemplateByType - Get template objects by type.
|
|
6
|
-
* @property {Function} getTemplateByMarker - Getting a single template object.
|
|
7
4
|
* @description This interface defines methods for retrieving templates in the system, including fetching all templates, specific templates by type or ID, and by marker.
|
|
8
5
|
*/
|
|
9
6
|
interface ITemplatesApi {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { AttributeType, IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface ITemplatesPreviewApi
|
|
4
|
-
* @property {Function} getTemplatePreviews - Get all template preview objects.
|
|
5
|
-
* @property {Function} getTemplatePreviewByMarker - Get one template preview object by marker.
|
|
6
4
|
* @description This interface defines methods for retrieving template previews in the system, including fetching all previews, specific previews by marker.
|
|
7
5
|
*/
|
|
8
6
|
interface ITemplatesPreviewApi {
|
package/dist/users/usersApi.js
CHANGED
|
@@ -113,9 +113,7 @@ class UsersApi extends asyncModules_1.default {
|
|
|
113
113
|
async updateUser(body, langCode = this.state.lang) {
|
|
114
114
|
if (!('langCode' in body))
|
|
115
115
|
body['langCode'] = langCode;
|
|
116
|
-
const result = await this._fetchPut('/me',
|
|
117
|
-
? this._normalizePostBody(body, langCode)
|
|
118
|
-
: body);
|
|
116
|
+
const result = await this._fetchPut('/me', this._normalizePostBody(body, langCode));
|
|
119
117
|
const validated = this._validateResponse(result, usersSchemas_1.UpdateUserResponseSchema);
|
|
120
118
|
return validated;
|
|
121
119
|
}
|
|
@@ -5,12 +5,6 @@ import type { FormDataType } from '../forms-data/formsDataInterfaces';
|
|
|
5
5
|
/**
|
|
6
6
|
* Interface representing user-related operations.
|
|
7
7
|
* @interface IUsersApi
|
|
8
|
-
* @property {Function} getUser - Retrieves the data of an authorized user, optionally based on a language code.
|
|
9
|
-
* @property {Function} updateUser - Updates the user's data with the provided information.
|
|
10
|
-
* @property {Function} archiveUser - Archiving one user object (marked for deletion).
|
|
11
|
-
* @property {Function} deleteUser - Deletes the user from the system.
|
|
12
|
-
* @property {Function} addFCMToken - Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
|
|
13
|
-
* @property {Function} deleteFCMToken - Deletes an existing FCM token.
|
|
14
8
|
* @description This interface defines methods for managing user data and handling Firebase Cloud Messaging tokens.
|
|
15
9
|
*/
|
|
16
10
|
interface IUsersApi {
|
|
@@ -228,7 +222,7 @@ interface IUserBody {
|
|
|
228
222
|
notificationData?: {
|
|
229
223
|
email: string;
|
|
230
224
|
phonePush: string[];
|
|
231
|
-
phoneSMS
|
|
225
|
+
phoneSMS?: string;
|
|
232
226
|
};
|
|
233
227
|
state?: Record<string, any>;
|
|
234
228
|
}
|