oneentry 1.0.89 → 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 (50) hide show
  1. package/README.md +208 -31
  2. package/dist/admins/adminsApi.d.ts +2 -1
  3. package/dist/admins/adminsInterfaces.d.ts +2 -2
  4. package/dist/attribute-sets/attributeSetsApi.d.ts +3 -2
  5. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +3 -2
  6. package/dist/auth-provider/authProviderApi.d.ts +11 -10
  7. package/dist/auth-provider/authProvidersInterfaces.d.ts +11 -11
  8. package/dist/base/asyncModules.js +1 -1
  9. package/dist/blocks/blocksApi.d.ts +4 -3
  10. package/dist/blocks/blocksInterfaces.d.ts +4 -4
  11. package/dist/events/eventsApi.d.ts +3 -2
  12. package/dist/events/eventsInterfaces.d.ts +3 -2
  13. package/dist/file-uploding/fileUploadingApi.d.ts +4 -3
  14. package/dist/file-uploding/fileUploadingInterfaces.d.ts +4 -3
  15. package/dist/forms/formsApi.d.ts +3 -2
  16. package/dist/forms/formsInterfaces.d.ts +3 -3
  17. package/dist/formsData/formsDataApi.d.ts +4 -3
  18. package/dist/formsData/formsDataInterfaces.d.ts +4 -3
  19. package/dist/general-types/generalTypesInterfaces.d.ts +2 -2
  20. package/dist/general-types/typesApi.d.ts +2 -1
  21. package/dist/index.d.ts +2 -0
  22. package/dist/index.js +4 -1
  23. package/dist/locales/localesApi.d.ts +2 -1
  24. package/dist/locales/localesInterfaces.d.ts +2 -1
  25. package/dist/menus/menusApi.d.ts +2 -1
  26. package/dist/menus/menusApi.js +1 -17
  27. package/dist/menus/menusInterfaces.d.ts +2 -1
  28. package/dist/orders/ordersApi.d.ts +7 -6
  29. package/dist/orders/ordersInterfaces.d.ts +7 -6
  30. package/dist/pages/pagesApi.d.ts +10 -9
  31. package/dist/pages/pagesInterfaces.d.ts +14 -12
  32. package/dist/payments/paymentsApi.d.ts +8 -7
  33. package/dist/payments/paymentsInterfaces.d.ts +8 -7
  34. package/dist/product-statuses/productStatusesApi.d.ts +5 -4
  35. package/dist/product-statuses/productStatusesInterfaces.d.ts +5 -4
  36. package/dist/products/productsApi.d.ts +10 -9
  37. package/dist/products/productsInterfaces.d.ts +10 -10
  38. package/dist/templates/templatesApi.d.ts +12 -4
  39. package/dist/templates/templatesApi.js +18 -7
  40. package/dist/templates/templatesInterfaces.d.ts +10 -4
  41. package/dist/templates-preview/templatesPreviewApi.d.ts +4 -3
  42. package/dist/templates-preview/templatesPreviewApi.js +3 -3
  43. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +9 -3
  44. package/dist/users/usersApi.d.ts +5 -4
  45. package/dist/users/usersInterfaces.d.ts +5 -4
  46. package/dist/web-socket/wsApi.d.ts +3 -2
  47. package/dist/web-socket/wsApi.js +2 -2
  48. package/dist/web-socket/wsInterfaces.d.ts +9 -0
  49. package/dist/web-socket/wsInterfaces.js +2 -0
  50. package/package.json +2 -1
package/README.md CHANGED
@@ -5043,7 +5043,7 @@ const value = await System.test500()
5043
5043
  const { Templates } = defineOneEntry('your-url');
5044
5044
  ```
5045
5045
 
5046
- ### Templates.getAllTemplates()
5046
+ ### Templates.getAllTemplates(langCode)
5047
5047
 
5048
5048
  ```js
5049
5049
  const value = await Templates.getAllTemplates()
@@ -5054,17 +5054,37 @@ const value = await Templates.getAllTemplates()
5054
5054
  Example return:
5055
5055
 
5056
5056
  ```json
5057
- [
5058
- {
5059
- "id": 1764,
5060
- "version": 10,
5061
- "identifier": "marker",
5062
- "generalTypeId": 4,
5063
- "title": "Page template",
5064
- "position": 0,
5065
- "generalTypeName": "forProductPreview"
5066
- }
5067
- ]
5057
+ {
5058
+ "forTextBlock": [
5059
+ {
5060
+ "id": 1,
5061
+ "version": 0,
5062
+ "identifier": "for-block",
5063
+ "title": "For blocks",
5064
+ "generalTypeName": "forTextBlock",
5065
+ "generalTypeId": 18,
5066
+ "position": 1,
5067
+ "attributeValues": {
5068
+ "en_US": {
5069
+ "marker": {
5070
+ "value": "",
5071
+ "type": "string",
5072
+ "position": 1,
5073
+ "isProductPreview": false,
5074
+ "isIcon": false,
5075
+ "attributeFields": {
5076
+ "marker": {
5077
+ "type": "string",
5078
+ "value": "test"
5079
+ }
5080
+ }
5081
+ }
5082
+ }
5083
+ },
5084
+ "attributeIdentifier": "my-set"
5085
+ }
5086
+ ]
5087
+ }
5068
5088
  ```
5069
5089
  <details>
5070
5090
  <summary>Schema</summary>
@@ -5100,7 +5120,7 @@ general type name <br>
5100
5120
 
5101
5121
  </details>
5102
5122
 
5103
- ### Templates.getTemplateByType(type)
5123
+ ### Templates.getTemplateByType(type, langCode)
5104
5124
 
5105
5125
  ```js
5106
5126
  const value = await Templates.getTemplateByType('forCatalogProducts')
@@ -5114,12 +5134,28 @@ Example return:
5114
5134
  [
5115
5135
  {
5116
5136
  "id": 1764,
5117
- "version": 10,
5118
- "identifier": "marker",
5119
5137
  "generalTypeId": 4,
5138
+ "generalTypeName": "forCatalogProducts",
5120
5139
  "title": "Page template",
5121
- "position": 0,
5122
- "generalTypeName": "forProductPreview"
5140
+ "identifier": "marker",
5141
+ "position": 1,
5142
+ "version": 10,
5143
+ "attributeValues": {
5144
+ "marker": {
5145
+ "value": "",
5146
+ "type": "string",
5147
+ "position": 1,
5148
+ "isProductPreview": false,
5149
+ "isIcon": false,
5150
+ "attributeFields": {
5151
+ "marker": {
5152
+ "type": "string",
5153
+ "value": "test"
5154
+ }
5155
+ }
5156
+ }
5157
+ },
5158
+ "attributeSetIdentifier": "my-set"
5123
5159
  }
5124
5160
  ]
5125
5161
  ```
@@ -5158,7 +5194,7 @@ general type name <br>
5158
5194
  </details>
5159
5195
 
5160
5196
 
5161
- ### Templates.getTemplateById(id)
5197
+ ### Templates.getTemplateById(id, langCode)
5162
5198
 
5163
5199
  ```js
5164
5200
  const value = await Templates.getTemplateById(1)
@@ -5169,16 +5205,102 @@ const value = await Templates.getTemplateById(1)
5169
5205
  Example return:
5170
5206
 
5171
5207
  ```json
5172
- [
5173
- {
5174
- "id": 1764,
5175
- "version": 10,
5176
- "identifier": "marker",
5177
- "generalTypeId": 4,
5178
- "title": "Page template",
5179
- "generalTypeName": "forProductPreview"
5180
- }
5181
- ]
5208
+ {
5209
+ "id": 1764,
5210
+ "generalTypeId": 4,
5211
+ "generalTypeName": "forProductPreview",
5212
+ "title": "Page template",
5213
+ "identifier": "marker",
5214
+ "position": 1,
5215
+ "version": 10,
5216
+ "attributeValues": {
5217
+ "marker": {
5218
+ "value": "",
5219
+ "type": "string",
5220
+ "position": 1,
5221
+ "isProductPreview": false,
5222
+ "isIcon": false,
5223
+ "attributeFields": {
5224
+ "marker": {
5225
+ "type": "string",
5226
+ "value": "test"
5227
+ }
5228
+ }
5229
+ }
5230
+ },
5231
+ "attributeSetIdentifier": "my-set"
5232
+ }
5233
+ ```
5234
+ <details>
5235
+ <summary>Schema</summary>
5236
+
5237
+ **id:** number <br>
5238
+ *object identifier* <br>
5239
+ example: 1764 <br>
5240
+
5241
+ **version** number <br>
5242
+ *object's version number of modification* <br>
5243
+ example: 10 <br>
5244
+
5245
+ **identifier:** string <br>
5246
+ *textual identifier for a field in the record* <br>
5247
+ example: catalog <br>
5248
+
5249
+ **generalTypeId:** number <br>
5250
+ *type identifier* <br>
5251
+ example: 4 <br>
5252
+
5253
+ **title:** string<br>
5254
+ *template name* <br>
5255
+ example: page template <br>
5256
+
5257
+ **position** object <br>
5258
+ *position number* <br>
5259
+ example: 0 <br>
5260
+
5261
+
5262
+ **generalTypeName** string <br>
5263
+ *example: forProductPreview* <br>
5264
+ general type name <br>
5265
+
5266
+ </details>
5267
+
5268
+ ### Templates.getTemplateByMarker(marker, langCode)
5269
+
5270
+ ```js
5271
+ const value = await Templates.getTemplateByMarker('my-marker')
5272
+ ```
5273
+
5274
+ > This method retrieves a single template object based on its identifier (marker) from the API. It returns a Promise that resolves to a template object.
5275
+
5276
+ Example return:
5277
+
5278
+ ```json
5279
+ {
5280
+ "id": 1764,
5281
+ "generalTypeId": 4,
5282
+ "generalTypeName": "forProductPreview",
5283
+ "title": "Page template",
5284
+ "identifier": "marker",
5285
+ "position": 1,
5286
+ "version": 10,
5287
+ "attributeValues": {
5288
+ "marker": {
5289
+ "value": "",
5290
+ "type": "string",
5291
+ "position": 1,
5292
+ "isProductPreview": false,
5293
+ "isIcon": false,
5294
+ "attributeFields": {
5295
+ "marker": {
5296
+ "type": "string",
5297
+ "value": "test"
5298
+ }
5299
+ }
5300
+ }
5301
+ },
5302
+ "attributeSetIdentifier": "my-set"
5303
+ }
5182
5304
  ```
5183
5305
  <details>
5184
5306
  <summary>Schema</summary>
@@ -5214,6 +5336,7 @@ general type name <br>
5214
5336
 
5215
5337
  </details>
5216
5338
 
5339
+
5217
5340
  ---
5218
5341
 
5219
5342
 
@@ -5224,7 +5347,7 @@ general type name <br>
5224
5347
  const { TemplatePreviews } = defineOneEntry('your-url');
5225
5348
  ```
5226
5349
 
5227
- ### TemplatePreviews.getTemplatePreviews()
5350
+ ### TemplatePreviews.getTemplatePreviews(langCode)
5228
5351
 
5229
5352
  ```js
5230
5353
  const value = await TemplatePreviews.getTemplatePreviews()
@@ -5240,6 +5363,24 @@ Example return:
5240
5363
  "id": 1,
5241
5364
  "version": 0,
5242
5365
  "identifier": "preview-templates",
5366
+ "attributeValues": {
5367
+ "en_US": {
5368
+ "marker": {
5369
+ "value": "",
5370
+ "type": "string",
5371
+ "position": 1,
5372
+ "isProductPreview": false,
5373
+ "isIcon": false,
5374
+ "attributeFields": {
5375
+ "marker": {
5376
+ "type": "string",
5377
+ "value": "test"
5378
+ }
5379
+ }
5380
+ }
5381
+ }
5382
+ },
5383
+ "attributeSetIdentifier": "my-set",
5243
5384
  "proportion": {
5244
5385
  "vertical": {
5245
5386
  "width": "2",
@@ -5299,7 +5440,7 @@ example: 12 <br>
5299
5440
  </details>
5300
5441
 
5301
5442
 
5302
- ### TemplatePreviews.getTemplatesPreviewById(id)
5443
+ ### TemplatePreviews.getTemplatesPreviewById(id, langCode)
5303
5444
 
5304
5445
  ```js
5305
5446
  const value = await TemplatePreviews.getTemplatePreviewById(1764)
@@ -5314,6 +5455,24 @@ Example return:
5314
5455
  "id": 1,
5315
5456
  "version": 0,
5316
5457
  "identifier": "preview-templates",
5458
+ "attributeValues": {
5459
+ "en_US": {
5460
+ "marker": {
5461
+ "value": "",
5462
+ "type": "string",
5463
+ "position": 1,
5464
+ "isProductPreview": false,
5465
+ "isIcon": false,
5466
+ "attributeFields": {
5467
+ "marker": {
5468
+ "type": "string",
5469
+ "value": "test"
5470
+ }
5471
+ }
5472
+ }
5473
+ }
5474
+ },
5475
+ "attributeSetIdentifier": "my-set",
5317
5476
  "proportion": {
5318
5477
  "vertical": {
5319
5478
  "width": "2",
@@ -5371,7 +5530,7 @@ example: 12 <br>
5371
5530
 
5372
5531
  </details>
5373
5532
 
5374
- ### TemplatePreviews.getTemplatesPreviewByMarker(marker)
5533
+ ### TemplatePreviews.getTemplatesPreviewByMarker(marker, langCode)
5375
5534
 
5376
5535
  ```js
5377
5536
  const value = await TemplatePreviews.getTemplatePreviewByMarker('my-marker')
@@ -5386,6 +5545,24 @@ Example return:
5386
5545
  "id": 1,
5387
5546
  "version": 0,
5388
5547
  "identifier": "preview-templates",
5548
+ "attributeValues": {
5549
+ "en_US": {
5550
+ "marker": {
5551
+ "value": "",
5552
+ "type": "string",
5553
+ "position": 1,
5554
+ "isProductPreview": false,
5555
+ "isIcon": false,
5556
+ "attributeFields": {
5557
+ "marker": {
5558
+ "type": "string",
5559
+ "value": "test"
5560
+ }
5561
+ }
5562
+ }
5563
+ }
5564
+ },
5565
+ "attributeSetIdentifier": "my-set",
5389
5566
  "proportion": {
5390
5567
  "vertical": {
5391
5568
  "width": "2",
@@ -1,6 +1,7 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
2
  import { IAdminEntity, IAdmins } from "./adminsInterfaces";
3
3
  import StateModule from "../base/stateModule";
4
+ import { IError } from "../base/utils";
4
5
  /**
5
6
  * Controllers for working with users - admins
6
7
  */
@@ -17,5 +18,5 @@ export default class AdminsApi extends AsyncModules implements IAdmins {
17
18
  *
18
19
  * @returns Returns all AdminEntity user objects
19
20
  */
20
- getAdminsInfo(langCode?: string, offset?: number, limit?: number): Promise<Array<IAdminEntity>>;
21
+ getAdminsInfo(langCode?: string, offset?: number, limit?: number): Promise<Array<IAdminEntity> | IError>;
21
22
  }
@@ -1,11 +1,11 @@
1
- import { AttributeType } from "../base/utils";
1
+ import { AttributeType, IError } from "../base/utils";
2
2
  /**
3
3
  * Represents a interface object of Admins Api.
4
4
  *
5
5
  * @property {function} getAdminsInfo - Get all user objects - admins.
6
6
  */
7
7
  interface IAdmins {
8
- getAdminsInfo(langCode: string, offset?: number, limit?: number): Promise<Array<IAdminEntity>>;
8
+ getAdminsInfo(langCode: string, offset?: number, limit?: number): Promise<Array<IAdminEntity> | IError>;
9
9
  }
10
10
  /**
11
11
  * Represents a position object.
@@ -1,5 +1,6 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
2
  import { IAttributesSets, IAttributesSetsEntity } from "./attributeSetsInterfaces";
3
+ import { IError } from "../base/utils";
3
4
  import StateModule from "../base/stateModule";
4
5
  /**
5
6
  * Controllers for working with attributes.
@@ -16,7 +17,7 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
16
17
  *
17
18
  * @returns Returns an array of AttributeInSet objects.
18
19
  */
19
- getAttributesByMarker(marker: string, langCode?: string): Promise<Array<IAttributesSetsEntity>>;
20
+ getAttributesByMarker(marker: string, langCode?: string): Promise<Array<IAttributesSetsEntity> | IError>;
20
21
  /**
21
22
  * Get a single attribute with data from the attribute sets.
22
23
  *
@@ -26,5 +27,5 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
26
27
  *
27
28
  * @returns Returns a AttributeInSet object.
28
29
  */
29
- getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode?: string): Promise<IAttributesSetsEntity>;
30
+ getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode?: string): Promise<IAttributesSetsEntity | IError>;
30
31
  }
@@ -1,3 +1,4 @@
1
+ import { IError } from "../base/utils";
1
2
  /**
2
3
  * Represents an interface object of AttributesSets Api.
3
4
  *
@@ -6,8 +7,8 @@
6
7
  * @property {function} getSingleAttributeByMarkerSet - Get a single attribute with data from the attribute sets.
7
8
  */
8
9
  interface IAttributesSets {
9
- getAttributesByMarker(marker: string, langCode: string): Promise<Array<IAttributesSetsEntity>>;
10
- getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode: string): Promise<IAttributesSetsEntity>;
10
+ getAttributesByMarker(marker: string, langCode: string): Promise<Array<IAttributesSetsEntity> | IError>;
11
+ getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode: string): Promise<IAttributesSetsEntity | IError>;
11
12
  }
12
13
  interface IListTitle {
13
14
  title: string;
@@ -1,6 +1,7 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
2
  import { IAuthProvider, ISignUpData, ISignUpEntity, IAuthEntity, IAuthProvidersEntity, IAuthPostBody } from "./authProvidersInterfaces";
3
3
  import StateModule from "../base/stateModule";
4
+ import { IError } from "../base/utils";
4
5
  /**
5
6
  * Controllers for working with auth services.
6
7
  */
@@ -41,28 +42,28 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
41
42
  * }
42
43
  * }
43
44
  */
44
- signUp(marker: string, data: ISignUpData, langCode?: string): Promise<ISignUpEntity>;
45
+ signUp(marker: string, data: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
45
46
  /**
46
47
  * Getting a user activation code. The code is returned via the appropriate user notification method
47
48
  * @param {string} marker - The text identifier of the authorization provider. Example - email
48
49
  * @param {string} userIdentifier - The text identifier of the user's object (user login)
49
50
  * @param {string} eventIdentifier - Text identifier of the event object for which the code is generated
50
51
  */
51
- generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void>;
52
+ generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void | IError>;
52
53
  /**
53
54
  * User activation code verification. Returns true (if the code is correct) or false (if it is incorrect).
54
55
  * @param {string} marker - The text identifier of the authorization provider. Example - email
55
56
  * @param {string} userIdentifier - The text identifier of the user's object (user login)
56
57
  * @param {string} code - Service code
57
58
  */
58
- checkCode(marker: string, userIdentifier: string, code: string): Promise<boolean>;
59
+ checkCode(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
59
60
  /**
60
61
  * User activate.
61
62
  * @param {string} marker - The text identifier of the authorization provider. Example - email
62
63
  * @param {string} userIdentifier - The text identifier of the user's object (user login)
63
64
  * @param {string} code - Service code
64
65
  */
65
- activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean>;
66
+ activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
66
67
  /**
67
68
  * User authorization
68
69
  * @param {string} marker - The text identifier of the authorization provider. Example - email
@@ -83,14 +84,14 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
83
84
  * }
84
85
  *
85
86
  */
86
- auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity>;
87
+ auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity | IError>;
87
88
  /**
88
89
  * Refresh token
89
90
  * @param {string} marker - The text identifier of the authorization provider. Example - email
90
91
  * @param {string} token - Refresh token
91
92
  *
92
93
  */
93
- refresh(marker: string, token: string): Promise<IAuthEntity>;
94
+ refresh(marker: string, token: string): Promise<IAuthEntity | IError>;
94
95
  /**
95
96
  *
96
97
  * User logout.
@@ -99,7 +100,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
99
100
  *
100
101
  * @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.
101
102
  */
102
- logout(marker: string, token: string): Promise<boolean>;
103
+ logout(marker: string, token: string): Promise<boolean | IError>;
103
104
  /**
104
105
  * Change password
105
106
  * @param {string} marker - The text identifier of the authorization provider. Example - email
@@ -109,18 +110,18 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
109
110
  * @param {string} newPassword - New password
110
111
  * @param {string} [repeatPassword] - Optional variable contains repeat new password for validation
111
112
  */
112
- changePassword(marker: string, userIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean>;
113
+ changePassword(marker: string, userIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
113
114
  /**
114
115
  * Get all auth providers objects
115
116
  * @param {string} [langCode] - Language code. Default "en_US"
116
117
  * @param {number} [offset] - Parameter for pagination. Default 0
117
118
  * @param {number} [limit] - Parameter for pagination. Default 30
118
119
  */
119
- getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<Array<IAuthProvidersEntity>>;
120
+ getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<Array<IAuthProvidersEntity> | IError>;
120
121
  /**
121
122
  * Get one auth provider object by marker
122
123
  * @param {string} marker - The text identifier of the authorization provider. Example - email
123
124
  * @param {string} [langCode] - Optional parameter language code. Default "en_US"
124
125
  */
125
- getMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity>;
126
+ getMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity | IError>;
126
127
  }
@@ -1,4 +1,4 @@
1
- import { ILocalizeInfo } from "../base/utils";
1
+ import { IError, ILocalizeInfo } from "../base/utils";
2
2
  /**
3
3
  * Represents a interface object of User Auth Provider Api.
4
4
  *
@@ -14,16 +14,16 @@ import { ILocalizeInfo } from "../base/utils";
14
14
  * @property {function} getMarker - Get one auth provider object by marker.
15
15
  */
16
16
  interface IAuthProvider {
17
- signUp(marker: string, data: ISignUpData, langCode?: string): Promise<ISignUpEntity>;
18
- generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void>;
19
- checkCode(marker: string, userIdentifier: string, code: string): Promise<boolean>;
20
- activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean>;
21
- auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity>;
22
- refresh(marker: string, token: string): Promise<IAuthEntity>;
23
- logout(marker: string, token: string): Promise<boolean>;
24
- changePassword(marker: string, userIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean>;
25
- getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<Array<IAuthProvidersEntity>>;
26
- getMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity>;
17
+ signUp(marker: string, data: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
18
+ generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void | IError>;
19
+ checkCode(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
20
+ activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
21
+ auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity | IError>;
22
+ refresh(marker: string, token: string): Promise<IAuthEntity | IError>;
23
+ logout(marker: string, token: string): Promise<boolean | IError>;
24
+ changePassword(marker: string, userIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
25
+ getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<Array<IAuthProvidersEntity> | IError>;
26
+ getMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity | IError>;
27
27
  }
28
28
  interface IAuthFormData {
29
29
  marker: string;
@@ -167,7 +167,7 @@ class AsyncModules extends syncModules_1.default {
167
167
  }
168
168
  }
169
169
  catch (e) {
170
- console.error(e);
170
+ return e;
171
171
  }
172
172
  }
173
173
  }
@@ -1,6 +1,7 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
2
  import { IBlocks, IBlocksResponse, IBlockEntity, ISearchBlock, BlockType } from "./blocksInterfaces";
3
3
  import StateModule from "../base/stateModule";
4
+ import { IError } from "../base/utils";
4
5
  /**
5
6
  * Controllers for working with blocks
6
7
  */
@@ -18,7 +19,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
18
19
  *
19
20
  * @returns Return array of BlocksEntity object.
20
21
  */
21
- getBlocks(type: BlockType, langCode?: string, offset?: number, limit?: number): Promise<IBlocksResponse>;
22
+ getBlocks(type: BlockType, langCode?: string, offset?: number, limit?: number): Promise<IBlocksResponse | IError>;
22
23
  /**
23
24
  * Get block by marker.
24
25
  *
@@ -29,7 +30,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
29
30
  *
30
31
  * @returns Return BlocksEntity object.
31
32
  */
32
- getBlockByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IBlockEntity>;
33
+ getBlockByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IBlockEntity | IError>;
33
34
  /**
34
35
  * Get similar products by block marker.
35
36
  *
@@ -57,5 +58,5 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
57
58
  * @param name - Search string
58
59
  * @param [langCode] - Language code. Default "en_US"
59
60
  */
60
- searchBlock(name: string, langCode?: string): Promise<Array<ISearchBlock>>;
61
+ searchBlock(name: string, langCode?: string): Promise<Array<ISearchBlock> | IError>;
61
62
  }
@@ -1,4 +1,4 @@
1
- import { AttributeType } from "../base/utils";
1
+ import { AttributeType, IError } from "../base/utils";
2
2
  import { IProductsEntity } from "../products/productsInterfaces";
3
3
  /**
4
4
  * Represents a interface object of Blocks Api.
@@ -10,9 +10,9 @@ import { IProductsEntity } from "../products/productsInterfaces";
10
10
  * @property {function} searchBlock - Quick search for block objects with limited output.
11
11
  */
12
12
  interface IBlocks {
13
- getBlocks(type: BlockType, langCode?: string, offset?: number, limit?: number): Promise<IBlocksResponse>;
14
- getBlockByMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IBlockEntity>;
15
- searchBlock(name: string, langCode?: string): Promise<Array<ISearchBlock>>;
13
+ getBlocks(type: BlockType, langCode?: string, offset?: number, limit?: number): Promise<IBlocksResponse | IError>;
14
+ getBlockByMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IBlockEntity | IError>;
15
+ searchBlock(name: string, langCode?: string): Promise<Array<ISearchBlock> | IError>;
16
16
  }
17
17
  interface IBlocksResponse {
18
18
  total: number;
@@ -1,6 +1,7 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
2
  import { IEvents } from "./eventsInterfaces";
3
3
  import StateModule from "../base/stateModule";
4
+ import { IError } from "../base/utils";
4
5
  /**
5
6
  * Controllers for working with events
6
7
  */
@@ -16,7 +17,7 @@ export default class EventsApi extends AsyncModules implements IEvents {
16
17
  * @param langCode - Language code.
17
18
  * @param productId - Product id.
18
19
  */
19
- subscribeByMarker(marker: string, productId: number, langCode?: string): Promise<any>;
20
+ subscribeByMarker(marker: string, productId: number, langCode?: string): Promise<any | IError>;
20
21
  /**
21
22
  * Unsubscribing to an event on a product.
22
23
  *
@@ -25,5 +26,5 @@ export default class EventsApi extends AsyncModules implements IEvents {
25
26
  * @param langCode - Language code.
26
27
  * @param productId - Product id.
27
28
  */
28
- unsubscribeByMarker(marker: string, productId: number, langCode?: string): Promise<any>;
29
+ unsubscribeByMarker(marker: string, productId: number, langCode?: string): Promise<any | IError>;
29
30
  }
@@ -1,3 +1,4 @@
1
+ import { IError } from "../base/utils";
1
2
  /**
2
3
  * Represents a interface object of Events Api.
3
4
  *
@@ -5,7 +6,7 @@
5
6
  * @property {function} unsubscribeByMarker - Unsubscribing to an event on a product.
6
7
  */
7
8
  interface IEvents {
8
- subscribeByMarker(marker: string, productId: number, langCode: string): Promise<any>;
9
- unsubscribeByMarker(marker: string, productId: number, langCode: string): Promise<any>;
9
+ subscribeByMarker(marker: string, productId: number, langCode: string): Promise<any | IError>;
10
+ unsubscribeByMarker(marker: string, productId: number, langCode: string): Promise<any | IError>;
10
11
  }
11
12
  export { IEvents };
@@ -1,5 +1,6 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
2
  import { IUploadingQuery, IUploadingReturns, IFileUploading } from "./fileUploadingInterfaces";
3
+ import { IError } from "../base/utils";
3
4
  import StateModule from "../base/stateModule";
4
5
  /**
5
6
  * Controllers for working with file uploading
@@ -24,7 +25,7 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
24
25
  *
25
26
  * @returns Uploads a file to an Amazon S3-compatible cloud file storage
26
27
  */
27
- upload(data: File | Blob, fileQuery?: IUploadingQuery): Promise<IUploadingReturns>;
28
+ upload(data: File | Blob, fileQuery?: IUploadingQuery): Promise<IUploadingReturns | IError>;
28
29
  /**
29
30
  * Deletes a file from the cloud file storage.
30
31
  *
@@ -37,7 +38,7 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
37
38
  *
38
39
  * @returns Deletes a file from the cloud file storage
39
40
  */
40
- delete(filename: string, fileQuery?: IUploadingQuery): Promise<any>;
41
+ delete(filename: string, fileQuery?: IUploadingQuery): Promise<any | IError>;
41
42
  /**
42
43
  * Get file by parameters.
43
44
  *
@@ -49,5 +50,5 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
49
50
  *
50
51
  * @returns Return file as File object
51
52
  */
52
- getFile(id: number, type: string, entity: string, filename?: string): Promise<Blob>;
53
+ getFile(id: number, type: string, entity: string, filename?: string): Promise<Blob | IError>;
53
54
  }
@@ -1,3 +1,4 @@
1
+ import { IError } from "../base/utils";
1
2
  /**
2
3
  * Represents a interface object of File Uploading Api.
3
4
  *
@@ -6,9 +7,9 @@
6
7
  * @property {function} getFile - Get file by parameters.
7
8
  */
8
9
  interface IFileUploading {
9
- upload(data: File, fileQuery?: IUploadingQuery): Promise<IUploadingReturns>;
10
- delete(filename: string, fileQuery?: IUploadingQuery): Promise<any>;
11
- getFile(id: number, type: string, entity: string, filename?: string): Promise<Blob>;
10
+ upload(data: File, fileQuery?: IUploadingQuery): Promise<IUploadingReturns | IError>;
11
+ delete(filename: string, fileQuery?: IUploadingQuery): Promise<any | IError>;
12
+ getFile(id: number, type: string, entity: string, filename?: string): Promise<Blob | IError>;
12
13
  }
13
14
  interface IFileEntity {
14
15
  file: File | string | null;