oneentry 1.0.106 → 1.0.109

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 (42) hide show
  1. package/README.md +6479 -3951
  2. package/dist/attribute-sets/attributeSetsApi.d.ts +11 -14
  3. package/dist/attribute-sets/attributeSetsApi.js +14 -17
  4. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +2 -2
  5. package/dist/auth-provider/authProviderApi.d.ts +21 -23
  6. package/dist/auth-provider/authProviderApi.js +28 -30
  7. package/dist/auth-provider/authProvidersInterfaces.d.ts +1 -1
  8. package/dist/blocks/blocksApi.d.ts +6 -6
  9. package/dist/blocks/blocksApi.js +9 -8
  10. package/dist/events/eventsApi.d.ts +7 -7
  11. package/dist/events/eventsApi.js +11 -7
  12. package/dist/file-uploading/fileUploadingApi.d.ts +4 -4
  13. package/dist/file-uploading/fileUploadingApi.js +4 -4
  14. package/dist/forms/formsApi.d.ts +1 -1
  15. package/dist/forms/formsApi.js +1 -1
  16. package/dist/formsData/formsDataApi.d.ts +16 -12
  17. package/dist/formsData/formsDataApi.js +21 -17
  18. package/dist/integration-collections/integrationCollectionsApi.d.ts +18 -20
  19. package/dist/integration-collections/integrationCollectionsApi.js +15 -19
  20. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +45 -8
  21. package/dist/menus/menusApi.d.ts +1 -1
  22. package/dist/menus/menusApi.js +1 -1
  23. package/dist/orders/ordersApi.d.ts +43 -43
  24. package/dist/orders/ordersApi.js +60 -60
  25. package/dist/orders/ordersInterfaces.d.ts +2 -2
  26. package/dist/pages/pagesApi.d.ts +15 -15
  27. package/dist/pages/pagesApi.js +20 -20
  28. package/dist/payments/paymentsApi.d.ts +5 -5
  29. package/dist/payments/paymentsApi.js +5 -5
  30. package/dist/product-statuses/productStatusesApi.d.ts +7 -6
  31. package/dist/product-statuses/productStatusesApi.js +7 -6
  32. package/dist/products/productsApi.d.ts +19 -19
  33. package/dist/products/productsApi.js +18 -18
  34. package/dist/products/productsInterfaces.d.ts +1 -1
  35. package/dist/templates/templatesApi.d.ts +3 -3
  36. package/dist/templates/templatesApi.js +3 -3
  37. package/dist/templates-preview/templatesPreviewApi.d.ts +2 -2
  38. package/dist/templates-preview/templatesPreviewApi.js +2 -2
  39. package/dist/users/usersApi.d.ts +9 -9
  40. package/dist/users/usersApi.js +19 -19
  41. package/package.json +8 -9
  42. package/readme.js +103 -0
@@ -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 { IAttributeSetsEntity, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponce } from './attributeSetsInterfaces';
4
+ import type { IAttributeSetsEntity, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponse } from './attributeSetsInterfaces';
5
5
  /**
6
6
  * Controllers for working with attributes - AttributesSetsApi.
7
7
  * @class
@@ -9,9 +9,6 @@ import type { IAttributeSetsEntity, IAttributesSets, IAttributesSetsEntity, IAtt
9
9
  export default class AttributesSetsApi extends AsyncModules implements IAttributesSets {
10
10
  protected state: StateModule;
11
11
  protected _url: string;
12
- /**
13
- * '/api/content/attributes-sets'
14
- */
15
12
  constructor(state: StateModule);
16
13
  /**
17
14
  * Getting all attribute sets objects
@@ -24,7 +21,7 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
24
21
  *
25
22
  * @returns Returns an array of AttributeInSet objects.
26
23
  */
27
- getAttributes(langCode?: string, limit?: number, offset?: number, typeId?: any, sortBy?: string): Promise<IAttributesSetsResponce | IError>;
24
+ getAttributes(langCode?: string, offset?: number, limit?: number, typeId?: any, sortBy?: string): Promise<IAttributesSetsResponse | IError>;
28
25
  /**
29
26
  * Getting all attributes with data from the attribute set
30
27
  *
@@ -34,15 +31,6 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
34
31
  * @returns Returns an array of AttributeInSet objects.
35
32
  */
36
33
  getAttributesByMarker(marker: string, langCode?: string): Promise<Array<IAttributesSetsEntity> | IError>;
37
- /**
38
- * Getting a single object from a set of attributes by marker
39
- *
40
- * @param {string} [marker] - marker of the attribute set object
41
- * @param {string} [langCode] - Language code.
42
- *
43
- * @returns Returns one object ContentPositionAttributesSetDto of the attribute set
44
- */
45
- getAttributeSetByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity | IError>;
46
34
  /**
47
35
  * Get a single attribute with data from the attribute sets.
48
36
  *
@@ -53,4 +41,13 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
53
41
  * @returns Returns a AttributeInSet object.
54
42
  */
55
43
  getSingleAttributeByMarkerSet(setMarker: string, attributeMarker: string, langCode?: string): Promise<IAttributesSetsEntity | IError>;
44
+ /**
45
+ * Getting a single object from a set of attributes by marker
46
+ *
47
+ * @param {string} [marker] - marker of the attribute set object
48
+ * @param {string} [langCode] - Language code.
49
+ *
50
+ * @returns Returns one object ContentPositionAttributesSetDto of the attribute set
51
+ */
52
+ getAttributeSetByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity | IError>;
56
53
  }
@@ -10,9 +10,6 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
10
10
  * @class
11
11
  */
12
12
  class AttributesSetsApi extends asyncModules_1.default {
13
- /**
14
- * '/api/content/attributes-sets'
15
- */
16
13
  constructor(state) {
17
14
  super(state);
18
15
  this._url = state.url + '/api/content/attributes-sets';
@@ -28,11 +25,11 @@ class AttributesSetsApi extends asyncModules_1.default {
28
25
  *
29
26
  * @returns Returns an array of AttributeInSet objects.
30
27
  */
31
- async getAttributes(langCode = this.state.lang, limit = 30, offset = 0, typeId = null, sortBy = 'id') {
28
+ async getAttributes(langCode = this.state.lang, offset = 0, limit = 30, typeId = null, sortBy = 'id') {
32
29
  const query = {
33
30
  langCode,
34
- limit,
35
31
  offset,
32
+ limit,
36
33
  typeId,
37
34
  sortBy,
38
35
  };
@@ -51,18 +48,6 @@ class AttributesSetsApi extends asyncModules_1.default {
51
48
  const result = await this._fetchGet(`/${marker}/attributes?langCode=${langCode}`);
52
49
  return this._dataPostProcess(result, langCode);
53
50
  }
54
- /**
55
- * Getting a single object from a set of attributes by marker
56
- *
57
- * @param {string} [marker] - marker of the attribute set object
58
- * @param {string} [langCode] - Language code.
59
- *
60
- * @returns Returns one object ContentPositionAttributesSetDto of the attribute set
61
- */
62
- async getAttributeSetByMarker(marker, langCode = this.state.lang) {
63
- const result = await this._fetchGet(`/marker/${marker}/?langCode=${langCode}`);
64
- return this._dataPostProcess(result, langCode);
65
- }
66
51
  /**
67
52
  * Get a single attribute with data from the attribute sets.
68
53
  *
@@ -76,5 +61,17 @@ class AttributesSetsApi extends asyncModules_1.default {
76
61
  const result = await this._fetchGet(`/${setMarker}/attributes/${attributeMarker}?langCode=${langCode}`);
77
62
  return result;
78
63
  }
64
+ /**
65
+ * Getting a single object from a set of attributes by marker
66
+ *
67
+ * @param {string} [marker] - marker of the attribute set object
68
+ * @param {string} [langCode] - Language code.
69
+ *
70
+ * @returns Returns one object ContentPositionAttributesSetDto of the attribute set
71
+ */
72
+ async getAttributeSetByMarker(marker, langCode = this.state.lang) {
73
+ const result = await this._fetchGet(`/marker/${marker}/?langCode=${langCode}`);
74
+ return this._dataPostProcess(result, langCode);
75
+ }
79
76
  }
80
77
  exports.default = AttributesSetsApi;
@@ -76,8 +76,8 @@ interface IAttributeSetsEntity {
76
76
  * @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity
77
77
  * @property {number} total - total items
78
78
  */
79
- interface IAttributesSetsResponce {
79
+ interface IAttributesSetsResponse {
80
80
  items: IAttributeSetsEntity[];
81
81
  total: number;
82
82
  }
83
- export type { AttributeType, IAttributeSetsEntity, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponce, IListTitle, };
83
+ export type { AttributeType, IAttributeSetsEntity, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponse, IListTitle, };
@@ -8,19 +8,16 @@ import type { IAuthEntity, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, I
8
8
  export default class AuthProviderApi extends AsyncModules implements IAuthProvider {
9
9
  protected state: StateModule;
10
10
  protected _url: string;
11
- /**
12
- * '/api/content/users-auth-providers'
13
- */
14
11
  constructor(state: StateModule);
15
12
  /**
16
13
  * User registration
17
14
  *
18
- * @param {string} marker - The text identifier of the authorization provider. Example - email
19
- * @param data - Request body
20
- * @param {string} langCode - Optional language field
15
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
16
+ * @param {ISignUpData} [body] - Request body
17
+ * @param {string} [langCode] - Optional language field
21
18
  *
22
19
  * @example
23
- * const data = {
20
+ * const body = {
24
21
  * "formIdentifier": "reg",
25
22
  * "authData": [
26
23
  * {
@@ -46,23 +43,24 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
46
43
  * }
47
44
  * }
48
45
  */
49
- signUp(marker: string, data: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
46
+ signUp(marker: string, body: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
50
47
  /**
51
48
  * Getting a user activation code. The code is returned via the appropriate user notification method
52
49
  *
53
- * @param {string} marker - The text identifier of the authorization provider. Example - email
54
- * @param {string} userIdentifier - The text identifier of the user's object (user login)
55
- * @param {string} eventIdentifier - Text identifier of the event object for which the code is generated
50
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
51
+ * @param {string} [userIdentifier] - The text identifier of the user's object (user login)
52
+ * @param {string} [eventIdentifier] - Text identifier of the event object for which the code is generated
56
53
  */
57
54
  generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void | IError>;
58
55
  /**
59
56
  * User activation code verification. Returns true (if the code is correct) or false (if it is incorrect).
60
57
  *
61
- * @param {string} marker - The text identifier of the authorization provider. Example - email
62
- * @param {string} userIdentifier - The text identifier of the user's object (user login)
63
- * @param {string} code - Service code
58
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
59
+ * @param {string} [userIdentifier] - The text identifier of the user's object (user login)
60
+ * @param {string} [eventIdentifier] - Text identifier of the event object for which the code is generated
61
+ * @param {string} [code] - Service code
64
62
  */
65
- checkCode(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
63
+ checkCode(marker: string, userIdentifier: string, eventIdentifier: string, code: string): Promise<boolean | IError>;
66
64
  /**
67
65
  * User activate.
68
66
  *
@@ -96,8 +94,8 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
96
94
  /**
97
95
  * Refresh token
98
96
  *
99
- * @param {string} marker - The text identifier of the authorization provider. Example - email
100
- * @param {string} token - Refresh token
97
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
98
+ * @param {string} [token] - Refresh token
101
99
  *
102
100
  */
103
101
  refresh(marker: string, token: string): Promise<IAuthEntity | IError>;
@@ -113,11 +111,11 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
113
111
  /**
114
112
  * Change password
115
113
  *
116
- * @param {string} marker - The text identifier of the authorization provider. Example - email
117
- * @param {string} userIdentifier - The text identifier of the user's object (user login)
118
- * @param {string} code - Service code
119
- * @param {number} type - Operation type (1 - for changing password, 2 - for recovery)
120
- * @param {string} newPassword - New password
114
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
115
+ * @param {string} [userIdentifier] - The text identifier of the user's object (user login)
116
+ * @param {string} [code] - Service code
117
+ * @param {number} [type] - Operation type (1 - for changing password, 2 - for recovery)
118
+ * @param {string} [newPassword] - New password
121
119
  * @param {string} [repeatPassword] - Optional variable contains repeat new password for validation
122
120
  */
123
121
  changePassword(marker: string, userIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
@@ -132,7 +130,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
132
130
  /**
133
131
  * Get one auth provider object by marker
134
132
  *
135
- * @param {string} marker - The text identifier of the authorization provider. Example - email
133
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
136
134
  * @param {string} [langCode] - Optional parameter language code. Default "en_US"
137
135
  */
138
136
  getMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity | IError>;
@@ -8,9 +8,6 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
8
8
  * Controllers for working with auth services.
9
9
  */
10
10
  class AuthProviderApi extends asyncModules_1.default {
11
- /**
12
- * '/api/content/users-auth-providers'
13
- */
14
11
  constructor(state) {
15
12
  super(state);
16
13
  this._url = state.url + '/api/content/users-auth-providers';
@@ -18,12 +15,12 @@ class AuthProviderApi extends asyncModules_1.default {
18
15
  /**
19
16
  * User registration
20
17
  *
21
- * @param {string} marker - The text identifier of the authorization provider. Example - email
22
- * @param data - Request body
23
- * @param {string} langCode - Optional language field
18
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
19
+ * @param {ISignUpData} [body] - Request body
20
+ * @param {string} [langCode] - Optional language field
24
21
  *
25
22
  * @example
26
- * const data = {
23
+ * const body = {
27
24
  * "formIdentifier": "reg",
28
25
  * "authData": [
29
26
  * {
@@ -49,23 +46,22 @@ class AuthProviderApi extends asyncModules_1.default {
49
46
  * }
50
47
  * }
51
48
  */
52
- async signUp(marker, data, langCode = this.state.lang) {
53
- data['langCode'] = langCode;
54
- const body = this._normalizePostBody(data, langCode);
55
- const result = await this._fetchPost(`/marker/${marker}/users/sign-up`, body);
49
+ async signUp(marker, body, langCode = this.state.lang) {
50
+ body['langCode'] = langCode;
51
+ const result = await this._fetchPost(`/marker/${marker}/users/sign-up`, this._normalizePostBody(body, langCode));
56
52
  return this._normalizeData(result);
57
53
  }
58
54
  /**
59
55
  * Getting a user activation code. The code is returned via the appropriate user notification method
60
56
  *
61
- * @param {string} marker - The text identifier of the authorization provider. Example - email
62
- * @param {string} userIdentifier - The text identifier of the user's object (user login)
63
- * @param {string} eventIdentifier - Text identifier of the event object for which the code is generated
57
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
58
+ * @param {string} [userIdentifier] - The text identifier of the user's object (user login)
59
+ * @param {string} [eventIdentifier] - Text identifier of the event object for which the code is generated
64
60
  */
65
61
  async generateCode(marker, userIdentifier, eventIdentifier) {
66
62
  const data = {
67
- userIdentifier: userIdentifier,
68
- eventIdentifier: eventIdentifier,
63
+ userIdentifier,
64
+ eventIdentifier,
69
65
  };
70
66
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
71
67
  const result = await this._fetchPost(`/marker/${marker}/users/generate-code`, data);
@@ -74,14 +70,16 @@ class AuthProviderApi extends asyncModules_1.default {
74
70
  /**
75
71
  * User activation code verification. Returns true (if the code is correct) or false (if it is incorrect).
76
72
  *
77
- * @param {string} marker - The text identifier of the authorization provider. Example - email
78
- * @param {string} userIdentifier - The text identifier of the user's object (user login)
79
- * @param {string} code - Service code
73
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
74
+ * @param {string} [userIdentifier] - The text identifier of the user's object (user login)
75
+ * @param {string} [eventIdentifier] - Text identifier of the event object for which the code is generated
76
+ * @param {string} [code] - Service code
80
77
  */
81
- async checkCode(marker, userIdentifier, code) {
78
+ async checkCode(marker, userIdentifier, eventIdentifier, code) {
82
79
  const data = {
83
- userIdentifier: userIdentifier,
84
- code: code,
80
+ userIdentifier,
81
+ code,
82
+ eventIdentifier,
85
83
  };
86
84
  const result = await this._fetchPost(`/marker/${marker}/users/check-code`, data);
87
85
  return result;
@@ -134,8 +132,8 @@ class AuthProviderApi extends asyncModules_1.default {
134
132
  /**
135
133
  * Refresh token
136
134
  *
137
- * @param {string} marker - The text identifier of the authorization provider. Example - email
138
- * @param {string} token - Refresh token
135
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
136
+ * @param {string} [token] - Refresh token
139
137
  *
140
138
  */
141
139
  async refresh(marker, token) {
@@ -173,11 +171,11 @@ class AuthProviderApi extends asyncModules_1.default {
173
171
  /**
174
172
  * Change password
175
173
  *
176
- * @param {string} marker - The text identifier of the authorization provider. Example - email
177
- * @param {string} userIdentifier - The text identifier of the user's object (user login)
178
- * @param {string} code - Service code
179
- * @param {number} type - Operation type (1 - for changing password, 2 - for recovery)
180
- * @param {string} newPassword - New password
174
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
175
+ * @param {string} [userIdentifier] - The text identifier of the user's object (user login)
176
+ * @param {string} [code] - Service code
177
+ * @param {number} [type] - Operation type (1 - for changing password, 2 - for recovery)
178
+ * @param {string} [newPassword] - New password
181
179
  * @param {string} [repeatPassword] - Optional variable contains repeat new password for validation
182
180
  */
183
181
  async changePassword(marker, userIdentifier, type, code, newPassword, repeatPassword) {
@@ -205,7 +203,7 @@ class AuthProviderApi extends asyncModules_1.default {
205
203
  /**
206
204
  * Get one auth provider object by marker
207
205
  *
208
- * @param {string} marker - The text identifier of the authorization provider. Example - email
206
+ * @param {string} [marker] - The text identifier of the authorization provider. Example - email
209
207
  * @param {string} [langCode] - Optional parameter language code. Default "en_US"
210
208
  */
211
209
  async getMarker(marker, langCode = this.state.lang) {
@@ -16,7 +16,7 @@ import type { IError, ILocalizeInfo } from '../base/utils';
16
16
  interface IAuthProvider {
17
17
  signUp(marker: string, data: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
18
18
  generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void | IError>;
19
- checkCode(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
19
+ checkCode(marker: string, userIdentifier: string, code: string, eventIdentifier: string): Promise<boolean | IError>;
20
20
  activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
21
21
  auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity | IError>;
22
22
  refresh(marker: string, token: string): Promise<IAuthEntity | IError>;
@@ -12,7 +12,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
12
12
  /**
13
13
  * Get blocks by parameters.
14
14
  *
15
- * @param {BlockType} type - Available values : forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service
15
+ * @param {BlockType} [type] - Available values : forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service
16
16
  * @param {string} [langCode] - Language code. Default "en_US"
17
17
  * @param {number} [offset] - Parameter for pagination. Default 0
18
18
  * @param {number} [limit] - Parameter for pagination. Default 30
@@ -23,7 +23,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
23
23
  /**
24
24
  * Get block by marker.
25
25
  *
26
- * @param {string} marker - Marker of Block.
26
+ * @param {string} [marker] - Marker of Block.
27
27
  * @param {string} [langCode] - Language code. Default "en_US"
28
28
  * @param {number} [offset] - Parameter for pagination. Default 0
29
29
  * @param {number} [limit] - Parameter for pagination. Default 30
@@ -34,7 +34,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
34
34
  /**
35
35
  * Get similar products by block marker.
36
36
  *
37
- * @param {string} marker - Block identifier
37
+ * @param {string} [marker] - Block identifier
38
38
  * @param {string} [langCode] - Language code. Default "en_US"
39
39
  * @param {number} [offset] - Parameter for pagination. Default 0
40
40
  * @param {number} [limit] - Parameter for pagination. Default 30
@@ -45,7 +45,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
45
45
  /**
46
46
  * Get products by block marker.
47
47
  *
48
- * @param {string} marker - Block identifier
48
+ * @param {string} [marker] - Block identifier
49
49
  * @param {string} [langCode] - Language code. Default "en_US"
50
50
  * @param {number} [offset] - Parameter for pagination. Default 0
51
51
  * @param {number} [limit] - Parameter for pagination. Default 30
@@ -56,8 +56,8 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
56
56
  /**
57
57
  * Quick search for block objects with limited output
58
58
  *
59
- * @param name - Search string
60
- * @param [langCode] - Language code. Default "en_US"
59
+ * @param {string} [name] - Search string
60
+ * @param {string} [langCode] - Language code. Default "en_US"
61
61
  *
62
62
  * @returns Return array of BlocksEntity object.
63
63
  */
@@ -3,7 +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 @typescript-eslint/no-explicit-any */
7
6
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
8
7
  /**
9
8
  * Controllers for working with blocks
@@ -16,7 +15,7 @@ class BlocksApi extends asyncModules_1.default {
16
15
  /**
17
16
  * Get blocks by parameters.
18
17
  *
19
- * @param {BlockType} type - Available values : forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service
18
+ * @param {BlockType} [type] - Available values : forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service
20
19
  * @param {string} [langCode] - Language code. Default "en_US"
21
20
  * @param {number} [offset] - Parameter for pagination. Default 0
22
21
  * @param {number} [limit] - Parameter for pagination. Default 30
@@ -27,7 +26,9 @@ class BlocksApi extends asyncModules_1.default {
27
26
  const response = await this._fetchGet(`?langCode=${langCode}&type=${type}&offset=${offset}&limit=${limit}`);
28
27
  if (this.state.multipleResponse) {
29
28
  const normalizeResponse = this._normalizeData(response);
30
- await Promise.all(normalizeResponse.items.map(async (block) => {
29
+ await Promise.all(
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ normalizeResponse.items.map(async (block) => {
31
32
  const customSettings = block.customSettings;
32
33
  if (customSettings &&
33
34
  // eslint-disable-next-line no-prototype-builtins
@@ -69,7 +70,7 @@ class BlocksApi extends asyncModules_1.default {
69
70
  /**
70
71
  * Get block by marker.
71
72
  *
72
- * @param {string} marker - Marker of Block.
73
+ * @param {string} [marker] - Marker of Block.
73
74
  * @param {string} [langCode] - Language code. Default "en_US"
74
75
  * @param {number} [offset] - Parameter for pagination. Default 0
75
76
  * @param {number} [limit] - Parameter for pagination. Default 30
@@ -118,7 +119,7 @@ class BlocksApi extends asyncModules_1.default {
118
119
  /**
119
120
  * Get similar products by block marker.
120
121
  *
121
- * @param {string} marker - Block identifier
122
+ * @param {string} [marker] - Block identifier
122
123
  * @param {string} [langCode] - Language code. Default "en_US"
123
124
  * @param {number} [offset] - Parameter for pagination. Default 0
124
125
  * @param {number} [limit] - Parameter for pagination. Default 30
@@ -137,7 +138,7 @@ class BlocksApi extends asyncModules_1.default {
137
138
  /**
138
139
  * Get products by block marker.
139
140
  *
140
- * @param {string} marker - Block identifier
141
+ * @param {string} [marker] - Block identifier
141
142
  * @param {string} [langCode] - Language code. Default "en_US"
142
143
  * @param {number} [offset] - Parameter for pagination. Default 0
143
144
  * @param {number} [limit] - Parameter for pagination. Default 30
@@ -156,8 +157,8 @@ class BlocksApi extends asyncModules_1.default {
156
157
  /**
157
158
  * Quick search for block objects with limited output
158
159
  *
159
- * @param name - Search string
160
- * @param [langCode] - Language code. Default "en_US"
160
+ * @param {string} [name] - Search string
161
+ * @param {string} [langCode] - Language code. Default "en_US"
161
162
  *
162
163
  * @returns Return array of BlocksEntity object.
163
164
  */
@@ -13,17 +13,17 @@ export default class EventsApi extends AsyncModules implements IEvents {
13
13
  /**
14
14
  * Return all subscriptions to product.
15
15
  *
16
- * @param {number} offset -
17
- * @param {number} limit - Event marker.
16
+ * @param {number} [offset] - Pagination parameter, default is 0
17
+ * @param {number} [limit] - Pagination parameter, default is 30
18
18
  */
19
19
  getAllSubscriptions(offset?: number, limit?: number): Promise<ISubscriptions | IError>;
20
20
  /**
21
21
  * Subscribing to an event on a product.
22
22
  *
23
23
  * @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.
24
- * @param {string} marker - Event marker.
25
- * @param {number} [langCode] - Language code.
26
- * @param {string} productId - Product id.
24
+ * @param {string} [marker] - Event marker.
25
+ * @param {string} [productId] - Product id.
26
+ * @param {string} [langCode] - Language code.
27
27
  * @param {number} [threshold] - Threshold value for comparing numerical value.
28
28
  */
29
29
  subscribeByMarker(marker: string, productId: number, langCode?: string, threshold?: number): Promise<any | IError>;
@@ -31,9 +31,9 @@ export default class EventsApi extends AsyncModules implements IEvents {
31
31
  * Unsubscribing to an event on a product.
32
32
  *
33
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.
34
- * @param {string} marker - Event marker.
34
+ * @param {string} [marker] - Event marker.
35
+ * @param {string} [productId] - Product id.
35
36
  * @param {number} [langCode] - Language code.
36
- * @param {string} productId - Product id.
37
37
  * @param {number} [threshold] - Threshold value for comparing numerical value.
38
38
  */
39
39
  unsubscribeByMarker(marker: string, productId: number, langCode?: string, threshold?: number): Promise<any | IError>;
@@ -17,10 +17,14 @@ class EventsApi extends asyncModules_1.default {
17
17
  /**
18
18
  * Return all subscriptions to product.
19
19
  *
20
- * @param {number} offset -
21
- * @param {number} limit - Event marker.
20
+ * @param {number} [offset] - Pagination parameter, default is 0
21
+ * @param {number} [limit] - Pagination parameter, default is 30
22
22
  */
23
23
  async getAllSubscriptions(offset = 0, limit = 30) {
24
+ const query = {
25
+ offset,
26
+ limit,
27
+ };
24
28
  const result = await this._fetchGet(`/subscriptions`);
25
29
  return result;
26
30
  }
@@ -28,9 +32,9 @@ class EventsApi extends asyncModules_1.default {
28
32
  * Subscribing to an event on a product.
29
33
  *
30
34
  * @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.
31
- * @param {string} marker - Event marker.
32
- * @param {number} [langCode] - Language code.
33
- * @param {string} productId - Product id.
35
+ * @param {string} [marker] - Event marker.
36
+ * @param {string} [productId] - Product id.
37
+ * @param {string} [langCode] - Language code.
34
38
  * @param {number} [threshold] - Threshold value for comparing numerical value.
35
39
  */
36
40
  async subscribeByMarker(marker, productId, langCode = this.state.lang, threshold = 0) {
@@ -48,9 +52,9 @@ class EventsApi extends asyncModules_1.default {
48
52
  * Unsubscribing to an event on a product.
49
53
  *
50
54
  * @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
- * @param {string} marker - Event marker.
55
+ * @param {string} [marker] - Event marker.
56
+ * @param {string} [productId] - Product id.
52
57
  * @param {number} [langCode] - Language code.
53
- * @param {string} productId - Product id.
54
58
  * @param {number} [threshold] - Threshold value for comparing numerical value.
55
59
  */
56
60
  async unsubscribeByMarker(marker, productId, langCode = this.state.lang, threshold = 0) {
@@ -16,9 +16,9 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
16
16
  * @param {File} [data] File objects. Get data as File from your unput as e.target.files[0]
17
17
  *
18
18
  * @param {IUploadingQuery} [fileQuery] - Optional set query parameters.
19
- * @param {string} fileQuery.type - Type, determines the folder name in the storage. Example : "page"
20
- * @param {string} fileQuery.entity - Entity name from which the file is uploaded, determines the folder name in the storage. Example : "editor"
21
- * @param {number} fileQuery.id - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example : 3787
19
+ * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example : "page"
20
+ * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example : "editor"
21
+ * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example : 3787
22
22
  * @param {number} [fileQuery.width] - Optional width parameter. Example : 0
23
23
  * @param {number} [fileQuery.height] - Optional height parameter. Example : 0
24
24
  * @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example : true
@@ -42,7 +42,7 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
42
42
  /**
43
43
  * Get file by parameters.
44
44
  *
45
- * @param {number} [id] Object identifier, from which the file is uploaded, determines the folder name in the storage
45
+ * @param {number} [id] - Object identifier, from which the file is uploaded, determines the folder name in the storage
46
46
  *
47
47
  * @param {string} [type] - Type, determines the folder name in the storage
48
48
  * @param {string} [entity] - entity name, from which the file is uploaded, determines the folder name in the storage
@@ -28,9 +28,9 @@ class FileUploadingApi extends asyncModules_1.default {
28
28
  * @param {File} [data] File objects. Get data as File from your unput as e.target.files[0]
29
29
  *
30
30
  * @param {IUploadingQuery} [fileQuery] - Optional set query parameters.
31
- * @param {string} fileQuery.type - Type, determines the folder name in the storage. Example : "page"
32
- * @param {string} fileQuery.entity - Entity name from which the file is uploaded, determines the folder name in the storage. Example : "editor"
33
- * @param {number} fileQuery.id - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example : 3787
31
+ * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example : "page"
32
+ * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example : "editor"
33
+ * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example : 3787
34
34
  * @param {number} [fileQuery.width] - Optional width parameter. Example : 0
35
35
  * @param {number} [fileQuery.height] - Optional height parameter. Example : 0
36
36
  * @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example : true
@@ -64,7 +64,7 @@ class FileUploadingApi extends asyncModules_1.default {
64
64
  /**
65
65
  * Get file by parameters.
66
66
  *
67
- * @param {number} [id] Object identifier, from which the file is uploaded, determines the folder name in the storage
67
+ * @param {number} [id] - Object identifier, from which the file is uploaded, determines the folder name in the storage
68
68
  *
69
69
  * @param {string} [type] - Type, determines the folder name in the storage
70
70
  * @param {string} [entity] - entity name, from which the file is uploaded, determines the folder name in the storage
@@ -22,7 +22,7 @@ export default class FormsApi extends AsyncModules implements IForms {
22
22
  /**
23
23
  * Get one form by form marker.
24
24
  *
25
- * @param {string} marker - Marker of form.
25
+ * @param {string} [marker] - Marker of form.
26
26
  * @param {string} [langCode] - Language code. Default "en_US"
27
27
  *
28
28
  * @returns Returns object of type FormEntity
@@ -28,7 +28,7 @@ class FormsApi extends asyncModules_1.default {
28
28
  /**
29
29
  * Get one form by form marker.
30
30
  *
31
- * @param {string} marker - Marker of form.
31
+ * @param {string} [marker] - Marker of form.
32
32
  * @param {string} [langCode] - Language code. Default "en_US"
33
33
  *
34
34
  * @returns Returns object of type FormEntity