oneentry 1.0.90 → 1.0.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/admins/adminsApi.d.ts +2 -1
  2. package/dist/admins/adminsInterfaces.d.ts +2 -2
  3. package/dist/attribute-sets/attributeSetsApi.d.ts +3 -2
  4. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +3 -2
  5. package/dist/auth-provider/authProviderApi.d.ts +11 -10
  6. package/dist/auth-provider/authProvidersInterfaces.d.ts +11 -11
  7. package/dist/blocks/blocksApi.d.ts +4 -3
  8. package/dist/blocks/blocksInterfaces.d.ts +4 -4
  9. package/dist/events/eventsApi.d.ts +3 -2
  10. package/dist/events/eventsInterfaces.d.ts +3 -2
  11. package/dist/file-uploding/fileUploadingApi.d.ts +4 -3
  12. package/dist/file-uploding/fileUploadingInterfaces.d.ts +4 -3
  13. package/dist/forms/formsApi.d.ts +3 -2
  14. package/dist/forms/formsInterfaces.d.ts +3 -3
  15. package/dist/formsData/formsDataApi.d.ts +4 -3
  16. package/dist/formsData/formsDataInterfaces.d.ts +4 -3
  17. package/dist/general-types/generalTypesInterfaces.d.ts +2 -2
  18. package/dist/general-types/typesApi.d.ts +2 -1
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +4 -1
  21. package/dist/locales/localesApi.d.ts +2 -1
  22. package/dist/locales/localesInterfaces.d.ts +2 -1
  23. package/dist/menus/menusApi.d.ts +2 -1
  24. package/dist/menus/menusInterfaces.d.ts +2 -1
  25. package/dist/orders/ordersApi.d.ts +7 -6
  26. package/dist/orders/ordersInterfaces.d.ts +7 -6
  27. package/dist/pages/pagesApi.d.ts +10 -9
  28. package/dist/pages/pagesInterfaces.d.ts +10 -10
  29. package/dist/payments/paymentsApi.d.ts +8 -7
  30. package/dist/payments/paymentsInterfaces.d.ts +8 -7
  31. package/dist/product-statuses/productStatusesApi.d.ts +5 -4
  32. package/dist/product-statuses/productStatusesInterfaces.d.ts +5 -4
  33. package/dist/products/productsApi.d.ts +10 -9
  34. package/dist/products/productsInterfaces.d.ts +10 -10
  35. package/dist/templates/templatesApi.d.ts +5 -5
  36. package/dist/templates/templatesInterfaces.d.ts +5 -5
  37. package/dist/templates-preview/templatesPreviewApi.d.ts +4 -3
  38. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +4 -4
  39. package/dist/users/usersApi.d.ts +5 -4
  40. package/dist/users/usersInterfaces.d.ts +5 -4
  41. package/dist/web-socket/wsApi.d.ts +3 -2
  42. package/dist/web-socket/wsApi.js +2 -2
  43. package/dist/web-socket/wsInterfaces.d.ts +9 -0
  44. package/dist/web-socket/wsInterfaces.js +2 -0
  45. package/package.json +2 -1
@@ -1,6 +1,7 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
2
  import { IPageApi, IPageConfig, IPagesEntity, IPositionForm, IPositionBlock } from "./pagesInterfaces";
3
3
  import StateModule from "../base/stateModule";
4
+ import { IError } from "../base/utils";
4
5
  /**
5
6
  * Controllers for working with page objects, including catalog pages
6
7
  */
@@ -15,7 +16,7 @@ export default class PageApi extends AsyncModules implements IPageApi {
15
16
  *
16
17
  * @returns Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
17
18
  */
18
- getRootPages(langCode?: string): Promise<Array<IPagesEntity>>;
19
+ getRootPages(langCode?: string): Promise<Array<IPagesEntity> | IError>;
19
20
  /**
20
21
  * Get all page objects with product information as an array.
21
22
  *
@@ -23,7 +24,7 @@ export default class PageApi extends AsyncModules implements IPageApi {
23
24
  *
24
25
  * @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
25
26
  */
26
- getPages(langCode?: string): Promise<Array<IPagesEntity>>;
27
+ getPages(langCode?: string): Promise<Array<IPagesEntity> | IError>;
27
28
  /**
28
29
  * Get page object with information about forms, blocks, menus, linked to the page.
29
30
  *
@@ -33,7 +34,7 @@ export default class PageApi extends AsyncModules implements IPageApi {
33
34
  *
34
35
  * @returns Returns PageEntity object
35
36
  */
36
- getPageById(id: number, langCode?: string): Promise<IPagesEntity>;
37
+ getPageById(id: number, langCode?: string): Promise<IPagesEntity | IError>;
37
38
  /**
38
39
  * Get page object with information about forms, blocks, menus, linked to the page by URL.
39
40
  *
@@ -43,7 +44,7 @@ export default class PageApi extends AsyncModules implements IPageApi {
43
44
  *
44
45
  * @returns Returns PageEntity object
45
46
  */
46
- getPageByUrl(url: string, langCode?: string): Promise<IPagesEntity>;
47
+ getPageByUrl(url: string, langCode?: string): Promise<IPagesEntity | IError>;
47
48
  /**
48
49
  * Get child pages object with information as an array.
49
50
  *
@@ -53,7 +54,7 @@ export default class PageApi extends AsyncModules implements IPageApi {
53
54
  *
54
55
  * @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
55
56
  */
56
- getChildPagesByParentUrl(url: string, langCode?: string): Promise<Array<IPagesEntity>>;
57
+ getChildPagesByParentUrl(url: string, langCode?: string): Promise<Array<IPagesEntity> | IError>;
57
58
  /**
58
59
  * Get all forms by page url.
59
60
  *
@@ -63,7 +64,7 @@ export default class PageApi extends AsyncModules implements IPageApi {
63
64
  *
64
65
  * @returns Returns all forms as an array of PositionForm objects or an empty array [] (if there is no data) for the selected parent
65
66
  */
66
- getFormsByPageUrl(url: string, langCode?: string): Promise<Array<IPositionForm>>;
67
+ getFormsByPageUrl(url: string, langCode?: string): Promise<Array<IPositionForm> | IError>;
67
68
  /**
68
69
  * Get all blocks by page url.
69
70
  *
@@ -73,7 +74,7 @@ export default class PageApi extends AsyncModules implements IPageApi {
73
74
  *
74
75
  * @returns Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
75
76
  */
76
- getBlocksByPageUrl(url: string, langCode?: string): Promise<Array<IPositionBlock>>;
77
+ getBlocksByPageUrl(url: string, langCode?: string): Promise<Array<IPositionBlock> | IError>;
77
78
  /**
78
79
  * Get settings for the page.
79
80
  *
@@ -81,7 +82,7 @@ export default class PageApi extends AsyncModules implements IPageApi {
81
82
  *
82
83
  * @returns Returns a ConfigPage object with page display settings
83
84
  */
84
- getConfigPageByUrl(url: string): Promise<IPageConfig>;
85
+ getConfigPageByUrl(url: string): Promise<IPageConfig | IError>;
85
86
  /**
86
87
  * Quick search for page objects with limited output.
87
88
  *
@@ -91,5 +92,5 @@ export default class PageApi extends AsyncModules implements IPageApi {
91
92
  *
92
93
  * @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
93
94
  */
94
- searchPage(name: string, langCode?: string): Promise<Array<IPagesEntity>>;
95
+ searchPage(name: string, langCode?: string): Promise<Array<IPagesEntity> | IError>;
95
96
  }
@@ -1,4 +1,4 @@
1
- import { AttributeType, IAttributes, LangType, Types } from "../base/utils";
1
+ import { AttributeType, IAttributes, IError, LangType, Types } from "../base/utils";
2
2
  /**
3
3
  * Represents an interface object of Pages Api.
4
4
  *
@@ -21,15 +21,15 @@ import { AttributeType, IAttributes, LangType, Types } from "../base/utils";
21
21
  * @property {function} searchPage - Quick search for page objects with limited output.
22
22
  */
23
23
  interface IPageApi {
24
- getRootPages(langCode?: LangType): Promise<Array<IPagesEntity>>;
25
- getPages(langCode: LangType): Promise<Array<IPagesEntity>>;
26
- getPageById(id: number, langCode: LangType): Promise<IPagesEntity>;
27
- getPageByUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
28
- getChildPagesByParentUrl(url: string, langCode: LangType): Promise<Array<IPagesEntity>>;
29
- getFormsByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionForm>>;
30
- getBlocksByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionBlock>>;
31
- getConfigPageByUrl(url: string): Promise<IPageConfig>;
32
- searchPage(name: string, langCode: LangType): Promise<Array<IPagesEntity>>;
24
+ getRootPages(langCode?: LangType): Promise<Array<IPagesEntity> | IError>;
25
+ getPages(langCode: LangType): Promise<Array<IPagesEntity> | IError>;
26
+ getPageById(id: number, langCode: LangType): Promise<IPagesEntity | IError>;
27
+ getPageByUrl(url: string, langCode: LangType): Promise<IPagesEntity | IError>;
28
+ getChildPagesByParentUrl(url: string, langCode: LangType): Promise<Array<IPagesEntity> | IError>;
29
+ getFormsByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionForm> | IError>;
30
+ getBlocksByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionBlock> | IError>;
31
+ getConfigPageByUrl(url: string): Promise<IPageConfig | IError>;
32
+ searchPage(name: string, langCode: LangType): Promise<Array<IPagesEntity> | IError>;
33
33
  }
34
34
  /**
35
35
  * Represents a config object.
@@ -1,4 +1,5 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
+ import { IError } from "../base/utils";
2
3
  import { IPaymentsApi, ISessionEntity, IConnectedEntity, IAccountsEntity, ICreateSessionEntity, ISessionsEntity } from "./paymentsInterfaces";
3
4
  import StateModule from "../base/stateModule";
4
5
  /**
@@ -17,7 +18,7 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
17
18
  *
18
19
  * @returns Returns an array of SessionEntity objects.
19
20
  */
20
- getSessions(limit?: number, offset?: number): Promise<ISessionsEntity>;
21
+ getSessions(limit?: number, offset?: number): Promise<ISessionsEntity | IError>;
21
22
  /**
22
23
  * Get a single payment session object by its identifier.
23
24
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
@@ -26,7 +27,7 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
26
27
  *
27
28
  * @returns Returns a single payment session object.
28
29
  */
29
- getSessionById(id: number): Promise<ISessionEntity>;
30
+ getSessionById(id: number): Promise<ISessionEntity | IError>;
30
31
  /**
31
32
  * Creation of payment session.
32
33
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
@@ -37,21 +38,21 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
37
38
  *
38
39
  * @returns Returns a single payment session object.
39
40
  */
40
- createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<ICreateSessionEntity>;
41
+ createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<ICreateSessionEntity | IError>;
41
42
  /**
42
43
  * Get payment settings.
43
44
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
44
45
  *
45
46
  * @returns Returns object PaymentsConnected or null.
46
47
  */
47
- getConnected(): Promise<IConnectedEntity | null>;
48
+ getConnected(): Promise<IConnectedEntity | null | IError>;
48
49
  /**
49
50
  * Get all payment accounts as an array.
50
51
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
51
52
  *
52
53
  * @returns Returns all created payment accounts as an array of PaymentAccountEntity objects.
53
54
  */
54
- getAccounts(): Promise<Array<IAccountsEntity>>;
55
+ getAccounts(): Promise<Array<IAccountsEntity> | IError>;
55
56
  /**
56
57
  * Get a single payment account object by its identifier.
57
58
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
@@ -60,12 +61,12 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
60
61
  *
61
62
  * @returns Returns a single payment account object.
62
63
  */
63
- getAccountById(id: number): Promise<IAccountsEntity>;
64
+ getAccountById(id: number): Promise<IAccountsEntity | IError>;
64
65
  /**
65
66
  * Webhook for Stripe.
66
67
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
67
68
  *
68
69
  * @returns Returns true (in case of successful execution) or false (in case of unsuccessful execution)
69
70
  */
70
- webhookStripe(): Promise<boolean>;
71
+ webhookStripe(): Promise<boolean | IError>;
71
72
  }
@@ -1,3 +1,4 @@
1
+ import { IError } from "../base/utils";
1
2
  /**
2
3
  * Represents an interface object of Orders Api.
3
4
  *
@@ -11,13 +12,13 @@
11
12
  * @property {function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
12
13
  */
13
14
  interface IPaymentsApi {
14
- getSessions(limit: number, offset: number): Promise<ISessionsEntity>;
15
- getSessionById(id: number): Promise<ISessionEntity>;
16
- createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<ICreateSessionEntity>;
17
- getConnected(): Promise<IConnectedEntity | null>;
18
- getAccounts(): Promise<Array<IAccountsEntity>>;
19
- getAccountById(id: number): Promise<IAccountsEntity>;
20
- webhookStripe(): Promise<boolean>;
15
+ getSessions(limit: number, offset: number): Promise<ISessionsEntity | IError>;
16
+ getSessionById(id: number): Promise<ISessionEntity | IError>;
17
+ createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<ICreateSessionEntity | IError>;
18
+ getConnected(): Promise<IConnectedEntity | null | IError>;
19
+ getAccounts(): Promise<Array<IAccountsEntity> | IError>;
20
+ getAccountById(id: number): Promise<IAccountsEntity | IError>;
21
+ webhookStripe(): Promise<boolean | IError>;
21
22
  }
22
23
  interface ISessionsEntity {
23
24
  total: number;
@@ -1,5 +1,6 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
2
  import { IProductStatusEntity, IProductStatuses } from "./productStatusesInterfaces";
3
+ import { IError } from "../base/utils";
3
4
  import StateModule from "../base/stateModule";
4
5
  /**
5
6
  * Controllers for working with product statuses
@@ -14,7 +15,7 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
14
15
  *
15
16
  * @returns Returns an array of product status objects
16
17
  */
17
- getProductStatuses(langCode?: string): Promise<Array<IProductStatusEntity>>;
18
+ getProductStatuses(langCode?: string): Promise<Array<IProductStatusEntity> | IError>;
18
19
  /**
19
20
  * Search for a product status object by identifier.
20
21
  *
@@ -23,7 +24,7 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
23
24
  *
24
25
  * @returns Returns a product status object
25
26
  */
26
- getProductStatusesById(id: number, langCode?: string): Promise<IProductStatusEntity>;
27
+ getProductStatusesById(id: number, langCode?: string): Promise<IProductStatusEntity | IError>;
27
28
  /**
28
29
  * Search for a product status object by its textual identifier (marker).
29
30
  *
@@ -32,7 +33,7 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
32
33
  *
33
34
  * @returns Returns a product status object
34
35
  */
35
- getProductsByStatusMarker(marker: string, langCode?: string): Promise<IProductStatusEntity>;
36
+ getProductsByStatusMarker(marker: string, langCode?: string): Promise<IProductStatusEntity | IError>;
36
37
  /**
37
38
  * Check the existence of a textual identifier.
38
39
  *
@@ -40,5 +41,5 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
40
41
  *
41
42
  * @returns Returns true if the textual identifier (marker) exists or false if it doesn't
42
43
  */
43
- validateMarker(marker: string): Promise<boolean>;
44
+ validateMarker(marker: string): Promise<boolean | IError>;
44
45
  }
@@ -1,3 +1,4 @@
1
+ import { IError } from "../base/utils";
1
2
  /**
2
3
  * Represents an interface object of Product Statuses Api.
3
4
  *
@@ -10,10 +11,10 @@
10
11
  * @property {function} validateMarker - Check the existence of a textual identifier.
11
12
  */
12
13
  interface IProductStatuses {
13
- getProductStatuses(langCode: string): Promise<Array<IProductStatusEntity>>;
14
- getProductStatusesById(id: number, langCode: string): Promise<IProductStatusEntity>;
15
- getProductsByStatusMarker(marker: string, langCode: string): Promise<IProductStatusEntity>;
16
- validateMarker(marker: string): Promise<boolean>;
14
+ getProductStatuses(langCode: string): Promise<Array<IProductStatusEntity> | IError>;
15
+ getProductStatusesById(id: number, langCode: string): Promise<IProductStatusEntity | IError>;
16
+ getProductsByStatusMarker(marker: string, langCode: string): Promise<IProductStatusEntity | IError>;
17
+ validateMarker(marker: string): Promise<boolean | IError>;
17
18
  }
18
19
  /**
19
20
  * Represents a position object.
@@ -1,6 +1,7 @@
1
1
  import { IProductsQuery, IFilterParams, IProductApi, IProductsEntity, IProductBlock, IProductEntity, IProductsResponse, IProductsInfo } from './productsInterfaces';
2
2
  import AsyncModules from '../base/asyncModules';
3
3
  import StateModule from "../base/stateModule";
4
+ import { IError } from "../base/utils";
4
5
  /**
5
6
  * Controllers for working with product pages
6
7
  */
@@ -53,7 +54,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
53
54
  *
54
55
  * @returns Array with ProductEntity objects
55
56
  */
56
- getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
57
+ getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
57
58
  /**
58
59
  * Search for all product page objects with pagination that do not have a category.
59
60
  *
@@ -77,7 +78,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
77
78
  *
78
79
  * @returns Array with ProductEntity objects
79
80
  */
80
- getProductsEmptyPage(langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
81
+ getProductsEmptyPage(langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
81
82
  /**
82
83
  * Search for all products with pagination for the selected category.
83
84
  * @param {Array<IFilterParams>} body - Request body.
@@ -123,7 +124,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
123
124
  *
124
125
  * @returns Array with ProductEntity objects
125
126
  */
126
- getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
127
+ getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
127
128
  /**
128
129
  * Search for information about products and prices for the selected category.
129
130
  * @param {string} url - Page url.
@@ -147,7 +148,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
147
148
  *
148
149
  * @returns Array with ProductInformation objects
149
150
  */
150
- getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo>;
151
+ getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo | IError>;
151
152
  /**
152
153
  * Search for all products with pagination for the selected category.
153
154
  * @param {Array<IFilterParams>} body - Request body.
@@ -193,7 +194,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
193
194
  *
194
195
  * @returns Array with ProductEntity objects
195
196
  */
196
- getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
197
+ getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
197
198
  /**
198
199
  * Find all related product page objects.
199
200
  *
@@ -212,7 +213,7 @@ export default class ProductApi extends AsyncModules implements IProductApi {
212
213
  *
213
214
  * @returns Array with ProductEntity objects
214
215
  */
215
- getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
216
+ getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
216
217
  /**
217
218
  * Retrieve one product object.
218
219
  *
@@ -222,13 +223,13 @@ export default class ProductApi extends AsyncModules implements IProductApi {
222
223
  *
223
224
  * @returns ProductEntity object.
224
225
  */
225
- getProductById(id: number, langCode?: string): Promise<IProductEntity>;
226
+ getProductById(id: number, langCode?: string): Promise<IProductEntity | IError>;
226
227
  /**
227
228
  * Getting a product block object by product id.
228
229
  * @param {number} id - Product id
229
230
  *
230
231
  */
231
- getProductBlockById(id: number): Promise<Array<IProductBlock>>;
232
+ getProductBlockById(id: number): Promise<Array<IProductBlock> | IError>;
232
233
  /**
233
234
  * Quick search for product page objects with limited output.
234
235
  *
@@ -238,5 +239,5 @@ export default class ProductApi extends AsyncModules implements IProductApi {
238
239
  *
239
240
  * @returns Array with ProductEntity objects
240
241
  */
241
- searchProduct(name: string, langCode?: string): Promise<Array<IProductsEntity>>;
242
+ searchProduct(name: string, langCode?: string): Promise<Array<IProductsEntity> | IError>;
242
243
  }
@@ -1,4 +1,4 @@
1
- import { AttributeType, LangType, Types } from "../base/utils";
1
+ import { AttributeType, IError, LangType, Types } from "../base/utils";
2
2
  /**
3
3
  * Represents an interface object of Products Api.
4
4
  *
@@ -13,15 +13,15 @@ import { AttributeType, LangType, Types } from "../base/utils";
13
13
  * @property {function} searchProduct - Quick search for product page objects with limited output.
14
14
  */
15
15
  interface IProductApi {
16
- getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
17
- getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<IProductsResponse>;
18
- getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
19
- getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo>;
20
- getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
21
- getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse>;
22
- getProductById(id: number, langCode: string): Promise<IProductEntity>;
23
- getProductBlockById(id: number): Promise<Array<IProductBlock>>;
24
- searchProduct(name: string, langCode: string): Promise<Array<IProductsEntity>>;
16
+ getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
17
+ getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
18
+ getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
19
+ getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo | IError>;
20
+ getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
21
+ getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
22
+ getProductById(id: number, langCode: string): Promise<IProductEntity | IError>;
23
+ getProductBlockById(id: number): Promise<Array<IProductBlock> | IError>;
24
+ searchProduct(name: string, langCode: string): Promise<Array<IProductsEntity> | IError>;
25
25
  }
26
26
  /**
27
27
  * Represents a product query parameters object.
@@ -1,6 +1,6 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
2
  import { ITemplatesApi, ITemplateEntity } from './templatesInterfaces';
3
- import { Types } from "../base/utils";
3
+ import { IError, Types } from "../base/utils";
4
4
  import StateModule from "../base/stateModule";
5
5
  /**
6
6
  * Controllers for working with template objects
@@ -15,7 +15,7 @@ export default class TemplatesPreviewApi extends AsyncModules implements ITempla
15
15
  *
16
16
  * @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
17
17
  */
18
- getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity>>;
18
+ getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity> | IError>;
19
19
  /**
20
20
  * Get template objects by type.
21
21
  *
@@ -24,7 +24,7 @@ export default class TemplatesPreviewApi extends AsyncModules implements ITempla
24
24
  *
25
25
  * @returns Returns a TemplateEntity object
26
26
  */
27
- getTemplateByType(type: Types, langCode?: string): Promise<Array<ITemplateEntity>>;
27
+ getTemplateByType(type: Types, langCode?: string): Promise<Array<ITemplateEntity> | IError>;
28
28
  /**
29
29
  * Get one template object by id.
30
30
  *
@@ -32,7 +32,7 @@ export default class TemplatesPreviewApi extends AsyncModules implements ITempla
32
32
  * @param {string} [langCode] - Optional parameter language code
33
33
  * @returns Returns a TemplateEntity object
34
34
  */
35
- getTemplateById(id: number, langCode?: string): Promise<ITemplateEntity>;
35
+ getTemplateById(id: number, langCode?: string): Promise<ITemplateEntity | IError>;
36
36
  /**
37
37
  * Get one template object by id.
38
38
  *
@@ -40,5 +40,5 @@ export default class TemplatesPreviewApi extends AsyncModules implements ITempla
40
40
  * @param {string} [langCode] - Optional parameter language code
41
41
  * @returns Returns a TemplateEntity object
42
42
  */
43
- getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity>;
43
+ getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity | IError>;
44
44
  }
@@ -1,4 +1,4 @@
1
- import { AttributeType, Types } from "../base/utils";
1
+ import { AttributeType, IError, Types } from "../base/utils";
2
2
  /**
3
3
  * Represents an interface object of Templates Api.
4
4
  *
@@ -8,10 +8,10 @@ import { AttributeType, Types } from "../base/utils";
8
8
  * @property {function} getTemplateByMarker - Getting a single template object.
9
9
  */
10
10
  interface ITemplatesApi {
11
- getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity>>;
12
- getTemplateByType(type: Types, langCode: string): Promise<Array<ITemplateEntity>>;
13
- getTemplateById(id: number): Promise<ITemplateEntity>;
14
- getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity>;
11
+ getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity> | IError>;
12
+ getTemplateByType(type: Types, langCode: string): Promise<Array<ITemplateEntity> | IError>;
13
+ getTemplateById(id: number): Promise<ITemplateEntity | IError>;
14
+ getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity | IError>;
15
15
  }
16
16
  /**
17
17
  * Represents a template entity object.
@@ -1,6 +1,7 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
2
  import { ITemplatesPreview, ITemplatesPreviewEntity } from "./templatesPreviewInterfaces";
3
3
  import StateModule from "../base/stateModule";
4
+ import { IError } from "../base/utils";
4
5
  /**
5
6
  * Controllers for working with template objects for preview
6
7
  */
@@ -14,7 +15,7 @@ export default class TemplatePreviewsApi extends AsyncModules implements ITempla
14
15
  *
15
16
  * @returns Returns all TemplatePreviewsEntity template objects
16
17
  */
17
- getTemplatePreviews(langCode?: string): Promise<Array<ITemplatesPreviewEntity>>;
18
+ getTemplatePreviews(langCode?: string): Promise<Array<ITemplatesPreviewEntity> | IError>;
18
19
  /**
19
20
  * Get one template object by id.
20
21
  *
@@ -23,7 +24,7 @@ export default class TemplatePreviewsApi extends AsyncModules implements ITempla
23
24
  *
24
25
  * @returns Returns a TemplatePreviewsEntity object
25
26
  */
26
- getTemplatePreviewById(id: number, langCode?: string): Promise<ITemplatesPreviewEntity>;
27
+ getTemplatePreviewById(id: number, langCode?: string): Promise<ITemplatesPreviewEntity | IError>;
27
28
  /**
28
29
  * Get one template object by marker.
29
30
  *
@@ -32,5 +33,5 @@ export default class TemplatePreviewsApi extends AsyncModules implements ITempla
32
33
  *
33
34
  * @returns Returns a TemplatePreviewsEntity object
34
35
  */
35
- getTemplatePreviewByMarker(marker: string, langCode?: string): Promise<ITemplatesPreviewEntity>;
36
+ getTemplatePreviewByMarker(marker: string, langCode?: string): Promise<ITemplatesPreviewEntity | IError>;
36
37
  }
@@ -1,4 +1,4 @@
1
- import { AttributeType } from "../base/utils";
1
+ import { AttributeType, IError } from "../base/utils";
2
2
  /**
3
3
  * Represents an interface object of Templates Preview Api.
4
4
  *
@@ -9,9 +9,9 @@ import { AttributeType } from "../base/utils";
9
9
  * @property {function} getTemplatesPreviewByMarker - Get one template object by marker.
10
10
  */
11
11
  interface ITemplatesPreview {
12
- getTemplatePreviews(langCode: string): Promise<Array<ITemplatesPreviewEntity>>;
13
- getTemplatePreviewById(id: number, langCode: string): Promise<ITemplatesPreviewEntity>;
14
- getTemplatePreviewByMarker(marker: string, langCode: string): Promise<ITemplatesPreviewEntity>;
12
+ getTemplatePreviews(langCode: string): Promise<Array<ITemplatesPreviewEntity> | IError>;
13
+ getTemplatePreviewById(id: number, langCode: string): Promise<ITemplatesPreviewEntity | IError>;
14
+ getTemplatePreviewByMarker(marker: string, langCode: string): Promise<ITemplatesPreviewEntity | IError>;
15
15
  }
16
16
  /**
17
17
  * Represents a template preview entity object.
@@ -1,6 +1,7 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
2
  import { IUserBody, IUserEntity, IUsers } from "./usersInterfaces";
3
3
  import StateModule from "../base/stateModule";
4
+ import { IError } from "../base/utils";
4
5
  /**
5
6
  * Controllers for working with users
6
7
  */
@@ -15,7 +16,7 @@ export default class UsersApi extends AsyncModules implements IUsers {
15
16
  *
16
17
  * @param {string} [langCode] Required parameter lang code.
17
18
  */
18
- getUser(langCode?: string): Promise<IUserEntity>;
19
+ getUser(langCode?: string): Promise<IUserEntity | IError>;
19
20
  /**
20
21
  * Updating a single user object.
21
22
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
@@ -45,19 +46,19 @@ export default class UsersApi extends AsyncModules implements IUsers {
45
46
  * "state": {}
46
47
  * }
47
48
  */
48
- updateUser(data: IUserBody, langCode?: string): Promise<boolean>;
49
+ updateUser(data: IUserBody, langCode?: string): Promise<boolean | IError>;
49
50
  /**
50
51
  * Adds FCM token for sending Push notification.
51
52
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
52
53
  *
53
54
  * @param {string} token - Cloud messaging token.
54
55
  */
55
- addFCMToken(token: string): Promise<boolean>;
56
+ addFCMToken(token: string): Promise<boolean | IError>;
56
57
  /**
57
58
  * Delete FCM token.
58
59
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
59
60
  *
60
61
  * @param {string} token - Cloud messaging token.
61
62
  */
62
- deleteFCMToken(token: string): Promise<boolean>;
63
+ deleteFCMToken(token: string): Promise<boolean | IError>;
63
64
  }
@@ -1,5 +1,6 @@
1
1
  import { IAuthFormData } from "../auth-provider/authProvidersInterfaces";
2
2
  import { FormDataType } from "../formsData/formsDataInterfaces";
3
+ import { IError } from "../base/utils";
3
4
  /**
4
5
  * Represents a interface object of Users Api.
5
6
  *
@@ -10,10 +11,10 @@ import { FormDataType } from "../formsData/formsDataInterfaces";
10
11
  * @property {function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
11
12
  */
12
13
  interface IUsers {
13
- getUser(langCode?: string): Promise<IUserEntity>;
14
- updateUser(data: IUserBody, langCode?: string): Promise<boolean>;
15
- addFCMToken(token: string): Promise<boolean>;
16
- deleteFCMToken(token: string): Promise<boolean>;
14
+ getUser(langCode?: string): Promise<IUserEntity | IError>;
15
+ updateUser(data: IUserBody, langCode?: string): Promise<boolean | IError>;
16
+ addFCMToken(token: string): Promise<boolean | IError>;
17
+ deleteFCMToken(token: string): Promise<boolean | IError>;
17
18
  }
18
19
  interface IUserEntity {
19
20
  id: number;
@@ -1,11 +1,12 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
2
  import StateModule from "../base/stateModule";
3
+ import { IWS } from "./wsInterfaces";
3
4
  /**
4
5
  * Controllers for working with users
5
6
  */
6
- export default class UsersApi extends AsyncModules {
7
+ export default class WsApi extends AsyncModules implements IWS {
7
8
  protected state: StateModule;
8
9
  protected _url: string;
9
10
  constructor(state: StateModule);
10
- connect(): Promise<import("socket.io-client").Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap>>;
11
+ connect(): Promise<any>;
11
12
  }
@@ -5,7 +5,7 @@ const socket_io_client_1 = require("socket.io-client");
5
5
  /**
6
6
  * Controllers for working with users
7
7
  */
8
- class UsersApi extends asyncModules_1.default {
8
+ class WsApi extends asyncModules_1.default {
9
9
  constructor(state) {
10
10
  super(state);
11
11
  this._url = state.url + '/api/content/ws';
@@ -20,4 +20,4 @@ class UsersApi extends asyncModules_1.default {
20
20
  return socket;
21
21
  }
22
22
  }
23
- exports.default = UsersApi;
23
+ exports.default = WsApi;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Represents a interface object of WebSocket IO.
3
+ *
4
+ * @property {function} connect - WebSocket Connection.
5
+ */
6
+ interface IWS {
7
+ connect(): Promise<any>;
8
+ }
9
+ export { IWS };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.90",
3
+ "version": "1.0.91",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,6 +16,7 @@
16
16
  "author": "ONEENTRY PORTAL CO.",
17
17
  "license": "ISC",
18
18
  "dependencies": {
19
+ "io": "^1.5.3",
19
20
  "jsdoc": "^4.0.2"
20
21
  },
21
22
  "devDependencies": {