oneentry 1.0.123 → 1.0.125

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 (76) hide show
  1. package/README.md +24 -22
  2. package/dist/admins/adminsApi.d.ts +30 -9
  3. package/dist/admins/adminsApi.js +30 -9
  4. package/dist/admins/adminsInterfaces.d.ts +77 -32
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +36 -22
  6. package/dist/attribute-sets/attributeSetsApi.js +41 -25
  7. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +133 -39
  8. package/dist/auth-provider/authProviderApi.d.ts +209 -88
  9. package/dist/auth-provider/authProviderApi.js +226 -87
  10. package/dist/auth-provider/authProvidersInterfaces.d.ts +345 -18
  11. package/dist/base/asyncModules.d.ts +38 -28
  12. package/dist/base/asyncModules.js +178 -47
  13. package/dist/base/result.js +23 -0
  14. package/dist/base/syncModules.d.ts +48 -44
  15. package/dist/base/syncModules.js +84 -64
  16. package/dist/base/utils.d.ts +1 -1
  17. package/dist/blocks/blocksApi.d.ts +48 -27
  18. package/dist/blocks/blocksApi.js +48 -27
  19. package/dist/blocks/blocksInterfaces.d.ts +126 -32
  20. package/dist/events/eventsApi.d.ts +45 -12
  21. package/dist/events/eventsApi.js +47 -12
  22. package/dist/events/eventsInterfaces.d.ts +50 -3
  23. package/dist/file-uploading/fileUploadingApi.d.ts +57 -29
  24. package/dist/file-uploading/fileUploadingApi.js +57 -30
  25. package/dist/file-uploading/fileUploadingInterfaces.d.ts +90 -17
  26. package/dist/forms/formsApi.d.ts +20 -9
  27. package/dist/forms/formsApi.js +19 -8
  28. package/dist/forms/formsInterfaces.d.ts +86 -23
  29. package/dist/formsData/formsDataApi.d.ts +33 -21
  30. package/dist/formsData/formsDataApi.js +33 -21
  31. package/dist/formsData/formsDataInterfaces.d.ts +212 -41
  32. package/dist/general-types/generalTypesApi.d.ts +11 -2
  33. package/dist/general-types/generalTypesApi.js +10 -1
  34. package/dist/general-types/generalTypesInterfaces.d.ts +17 -6
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.js +2 -2
  37. package/dist/integration-collections/integrationCollectionsApi.d.ts +134 -81
  38. package/dist/integration-collections/integrationCollectionsApi.js +135 -83
  39. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +246 -43
  40. package/dist/locales/localesApi.d.ts +5 -1
  41. package/dist/locales/localesApi.js +5 -1
  42. package/dist/locales/localesInterfaces.d.ts +19 -12
  43. package/dist/menus/menusApi.d.ts +6 -3
  44. package/dist/menus/menusApi.js +6 -3
  45. package/dist/menus/menusInterfaces.d.ts +60 -21
  46. package/dist/orders/ordersApi.d.ts +84 -66
  47. package/dist/orders/ordersApi.js +91 -71
  48. package/dist/orders/ordersInterfaces.d.ts +282 -86
  49. package/dist/pages/pagesApi.d.ts +101 -42
  50. package/dist/pages/pagesApi.js +93 -39
  51. package/dist/pages/pagesInterfaces.d.ts +218 -75
  52. package/dist/payments/paymentsApi.d.ts +53 -39
  53. package/dist/payments/paymentsApi.js +55 -40
  54. package/dist/payments/paymentsInterfaces.d.ts +121 -56
  55. package/dist/product-statuses/productStatusesApi.d.ts +17 -17
  56. package/dist/product-statuses/productStatusesApi.js +16 -19
  57. package/dist/product-statuses/productStatusesInterfaces.d.ts +43 -14
  58. package/dist/products/productsApi.d.ts +309 -177
  59. package/dist/products/productsApi.js +313 -167
  60. package/dist/products/productsInterfaces.d.ts +447 -81
  61. package/dist/system/systemApi.d.ts +42 -12
  62. package/dist/system/systemApi.js +43 -10
  63. package/dist/system/systemInterfaces.d.ts +7 -0
  64. package/dist/templates/templatesApi.d.ts +24 -20
  65. package/dist/templates/templatesApi.js +22 -21
  66. package/dist/templates/templatesInterfaces.d.ts +48 -22
  67. package/dist/templates-preview/templatesPreviewApi.d.ts +17 -17
  68. package/dist/templates-preview/templatesPreviewApi.js +16 -19
  69. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +85 -32
  70. package/dist/users/usersApi.d.ts +59 -35
  71. package/dist/users/usersApi.js +62 -35
  72. package/dist/users/usersInterfaces.d.ts +136 -14
  73. package/dist/web-socket/wsApi.d.ts +4 -5
  74. package/dist/web-socket/wsApi.js +4 -5
  75. package/dist/web-socket/wsInterfaces.d.ts +2 -1
  76. package/package.json +20 -18
@@ -1,10 +1,15 @@
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 { ICollection, ICollectionFormObject, ICollectionResponce, ICollectionRow, ICollectionsApi } from './integrationCollectionsInterfaces';
4
+ import type { ICollectionEntity, ICollectionFormObject, ICollectionIsValid, ICollectionRow, ICollectionRowsResponce, ICollectionsApi } from './integrationCollectionsInterfaces';
5
5
  /**
6
6
  * Controllers for working with attributes.
7
+ *
7
8
  * @handle /api/content/integration-collections
9
+ * @class IntegrationCollectionsApi
10
+ * @extends AsyncModules
11
+ * @implements {ICollectionsApi}
12
+ * @description This class provides methods to interact with integration collections, including retrieving all collections, getting a single collection by ID, and managing collection rows.
8
13
  */
9
14
  export default class IntegrationCollectionsApi extends AsyncModules implements ICollectionsApi {
10
15
  protected state: StateModule;
@@ -12,115 +17,160 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
12
17
  constructor(state: StateModule);
13
18
  private _defaultQuery;
14
19
  /**
15
- * Get all collections
20
+ * Get all collections.
16
21
  *
17
- * @param {string} [langCode] - Language code.
18
- * @param {any} [userQuery] - Optional set query parameters.
22
+ * @handleName getICollections
19
23
  *
20
- * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
21
- * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
22
- *
23
- * @returns Returns an array of ICollections objects.
24
+ * @param {string} [langCode] - Language code. Default: "en_US".
25
+ * @param {object} [userQuery] - Optional set query parameters. Example:
26
+ {
27
+ "limit": 0,
28
+ "offset": 30,
29
+ "entityType": "orders",
30
+ "entityId": 1
31
+ }
32
+ * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
33
+ * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
34
+ * @param {string} [userQuery.entityType] - Entity type. Example: "orders".
35
+ * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
36
+ * @return {ICollectionEntity[]} Returns an array of ICollection objects or an error object if there was an issue.
37
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
38
+ * @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
39
  */
25
- getICollections(langCode?: string, userQuery?: any): Promise<Array<ICollection> | IError>;
40
+ getICollections(langCode?: string, userQuery?: {
41
+ limit: number;
42
+ offset: number;
43
+ entityType: string;
44
+ entityId: number;
45
+ }): Promise<ICollectionEntity[] | IError>;
26
46
  /**
27
47
  * Get a single collection object by id.
28
48
  *
29
- * @param {number} [id] - Collection id.
30
- * @param {string} [langCode] - Language code.
49
+ * @handleName getICollectionById
31
50
  *
32
- * @returns Returns single ICollection object.
51
+ * @param {number} id - Collection id. Example: 1.
52
+ * @param {string} [langCode] - Language code. Default: "en_US".
53
+ * @return {ICollectionEntity} Returns an ICollection object or an error object if there was an issue.
54
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
55
+ * @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.
33
56
  */
34
- getICollectionById(id: number, langCode?: string): Promise<ICollection | IError>;
57
+ getICollectionById(id: number, langCode?: string): Promise<ICollectionEntity | IError>;
35
58
  /**
36
59
  * Get all records belonging to the collection by collection id.
37
60
  *
38
- * @param {number} [id] - Collection id.
39
- * @param {string} [langCode] - Language code.
40
- * @param {any} [userQuery] - Optional set query parameters.
61
+ * @handleName getICollectionRowsById
41
62
  *
42
- * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
43
- * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
44
- * @param {number} [userQuery.entityType] - Entity type. Example: 1
45
- * @param {number} [userQuery.entityId] - Entity identifier. Example: orders
46
- *
47
- * @returns Returns object ItemsWithTotal, where items is an array of requested objects
63
+ * @param {number} id - Collection id. Example: 1.
64
+ * @param {string} [langCode] - Language code. Default: "en_US".
65
+ * @param {any} [userQuery] - Optional set query parameters. Example:
66
+ {
67
+ "limit": 0,
68
+ "offset": 30,
69
+ "entityType": "orders",
70
+ "entityId": 1
71
+ }
72
+ * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
73
+ * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
74
+ * @param {number} [userQuery.entityType] - Entity type. Example: "orders".
75
+ * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
76
+ * @return {ICollectionRowsResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
77
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
78
+ * @description Get all records belonging to the collection by collection id.
48
79
  */
49
- getICollectionRowsById(id: number, langCode?: string, userQuery?: any): Promise<ICollectionResponce | IError>;
80
+ getICollectionRowsById(id: number, langCode?: string, userQuery?: {
81
+ limit: number;
82
+ offset: number;
83
+ entityType: string;
84
+ entityId: number;
85
+ }): Promise<ICollectionRowsResponce | IError>;
50
86
  /**
51
- * Check for the existence of a text identifier (marker)
87
+ * Check for the existence of a text identifier (marker).
52
88
  *
53
- * @param {string} [marker] - Collection marker.
89
+ * @handleName validateICollectionMarker
54
90
  *
55
- * @returns Returns object with value true if text identifier (marker) exists or false if not
91
+ * @param {string} marker - Collection marker. Example: "collection1".
92
+ * @return {ICollectionIsValid} Returns an object with a boolean property `valid` indicating whether the marker is valid or not. Example:
93
+ {
94
+ "valid": true
95
+ }
96
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
97
+ * @description Check for the existence of a text identifier (marker).
56
98
  */
57
- validateICollectionMarker(marker: string): Promise<{
58
- valid: boolean;
59
- } | IError>;
99
+ validateICollectionMarker(marker: string): Promise<ICollectionIsValid | IError>;
60
100
  /**
61
101
  * Getting all records from the collection.
62
102
  *
63
- * @param {string} [marker] - Collection text identifier
64
- * @param {string} [langCode] - Language code.
103
+ * @handleName getICollectionRowsByMarker
65
104
  *
66
- * @returns Returns CollectionRowEntity object.
105
+ * @param {string} marker - Collection text identifier. Example: "collection1".
106
+ * @param {string} [langCode] - Language code. Default: "en_US".
107
+ * @return {ICollectionRowsResponce} Returns CollectionRowEntity object.
108
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
109
+ * @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
110
  */
68
- getICollectionRowsByMarker(marker: string, langCode?: string): Promise<any | IError>;
111
+ getICollectionRowsByMarker(marker: string, langCode?: string): Promise<ICollectionRowsResponce | IError>;
69
112
  /**
70
113
  * Getting one record from the collection.
71
114
  *
72
- * @param {string} [marker] - Collection text identifier
73
- * @param {number} [id] - Collection record identifier
74
- * @param {string} [langCode] - Language code.
115
+ * @handleName getICollectionRowByMarkerAndId
75
116
  *
76
- * @returns Returns CollectionRowEntity object.
117
+ * @param {string} marker - Collection text identifier. Example: "collection1".
118
+ * @param {number} id - Collection record identifier. Example: 1.
119
+ * @param {string} [langCode] - Language code. Default: "en_US".
120
+ * @return {ICollectionRow} Returns CollectionRowEntity object.
121
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
122
+ * @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.
77
123
  */
78
- getICollectionRowByMarkerAndId(marker: string, id: number, langCode?: string): Promise<any | IError>;
124
+ getICollectionRowByMarkerAndId(marker: string, id: number, langCode?: string): Promise<ICollectionRow | IError>;
79
125
  /**
80
- * Create a record in the collection
81
- *
82
- * @param {string} [marker] - Collection text identifier. Example : collection1
83
- * @param {ICollectionFormObject} [body] - Object for creating a record
84
- * const body: ICollectionFormObject = {
85
- "formIdentifier": "collection-form",
86
- "formData": {
87
- "en_US": [
88
- {
89
- "marker": "collection_marker",
90
- "type": "string",
91
- "value": "Collection marker"
92
- }
93
- ]
126
+ * Create a record in the collection.
127
+ *
128
+ * @handleName createICollectionRow
129
+ *
130
+ * @param {string} marker - Collection text identifier. Example: "collection1".
131
+ * @param {ICollectionFormObject} body - Object for creating a record. Example:
132
+ {
133
+ "formIdentifier": "collection-form",
134
+ "formData": {
135
+ "en_US": [
136
+ {
137
+ "marker": "collection_marker",
138
+ "type": "string",
139
+ "value": "Collection marker"
140
+ }
141
+ ]
142
+ }
94
143
  }
95
- }
96
- * @param {string} [langCode] - Language code.
97
- *
98
- * @description Create a record in the collection
144
+ * @param {string} [langCode] - Language code. Default: "en_US".
145
+ * @return {ICollectionRow} Returns object of type ICollectionRow.
146
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
147
+ * @description Create a record in the collection.
99
148
  */
100
- createICollectionRow(marker: string, body: ICollectionFormObject, langCode?: string): Promise<any | IError>;
149
+ createICollectionRow(marker: string, body: ICollectionFormObject, langCode?: string): Promise<ICollectionRow | IError>;
101
150
  /**
102
- * Edit a record in the collection
103
- *
104
- * @param {string} [marker] - text identifier of the collection
105
- * @param {number} [id] - row id
106
- * @param {any} [body] - Object for updating a record in the collection
107
- *
108
- * const body = {
109
- "formIdentifier": "collection-form",
110
- "formData": {
111
- "en_US": [
112
- {
113
- "marker": "collection_marker",
114
- "type": "string",
115
- "value": "Collection marker"
116
- }
117
- ]
151
+ * Edit a record in the collection.
152
+ *
153
+ * @handleName updateICollectionRow
154
+ *
155
+ * @param {string} marker - Text identifier of the collection. Example: "collection1".
156
+ * @param {number} id - Row identifier in the collection. Example: 12.
157
+ * @param {object} body - Object for updating a record in the collection. Example:
158
+ {
159
+ "formIdentifier": "collection-form",
160
+ "formData": {
161
+ "en_US": [
162
+ {
163
+ "marker": "collection_marker",
164
+ "type": "string",
165
+ "value": "Collection marker"
166
+ }
167
+ ]
168
+ }
118
169
  }
119
- }
120
- *
121
- * @param {string} [langCode] - language code
122
- *
123
- * @returns Returns object
170
+ * @param {string} [langCode] - Language code. Default: "en_US".
171
+ * @return {ICollectionRow} Returns object of type ICollectionRow.
172
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
173
+ * @description Edit a record in the collection.
124
174
  */
125
175
  updateICollectionRow(marker: string, id: number, body: {
126
176
  formIdentifier: string;
@@ -129,10 +179,13 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
129
179
  /**
130
180
  * Deletion of collection record object
131
181
  *
132
- * @param {string} [marker] - text identifier of the collection Example : collection1
133
- * @param {number} [id] - record identifier in the collection Example : 12
182
+ * @handleName deleteICollectionRowByMarkerAndId
134
183
  *
135
- * @returns Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
184
+ * @param {string} marker - text identifier of the collection Example: "collection1".
185
+ * @param {number} id - record identifier in the collection Example: 12.
186
+ * @return {boolean} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
187
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
188
+ * @description Deletion of collection record object
136
189
  */
137
190
  deleteICollectionRowByMarkerAndId(marker: string, id: number): Promise<boolean | IError>;
138
191
  }
@@ -3,15 +3,20 @@ 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 attributes.
9
+ *
10
10
  * @handle /api/content/integration-collections
11
+ * @class IntegrationCollectionsApi
12
+ * @extends AsyncModules
13
+ * @implements {ICollectionsApi}
14
+ * @description This class provides methods to interact with integration collections, including retrieving all collections, getting a single collection by ID, and managing collection rows.
11
15
  */
12
16
  class IntegrationCollectionsApi extends asyncModules_1.default {
13
17
  constructor(state) {
14
18
  super(state);
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
20
  this._defaultQuery = {
16
21
  langCode: 'en_US',
17
22
  offset: 0,
@@ -20,149 +25,196 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
20
25
  this._url = state.url + '/api/content/integration-collections';
21
26
  }
22
27
  /**
23
- * Get all collections
28
+ * Get all collections.
24
29
  *
25
- * @param {string} [langCode] - Language code.
26
- * @param {any} [userQuery] - Optional set query parameters.
30
+ * @handleName getICollections
27
31
  *
28
- * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
29
- * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
30
- *
31
- * @returns Returns an array of ICollections objects.
32
+ * @param {string} [langCode] - Language code. Default: "en_US".
33
+ * @param {object} [userQuery] - Optional set query parameters. Example:
34
+ {
35
+ "limit": 0,
36
+ "offset": 30,
37
+ "entityType": "orders",
38
+ "entityId": 1
39
+ }
40
+ * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
41
+ * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
42
+ * @param {string} [userQuery.entityType] - Entity type. Example: "orders".
43
+ * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
44
+ * @return {ICollectionEntity[]} Returns an array of ICollection objects or an error object if there was an issue.
45
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
46
+ * @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.
32
47
  */
33
- async getICollections(langCode = this.state.lang, userQuery) {
48
+ async getICollections(langCode = this.state.lang,
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ userQuery) {
51
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
52
  const query = { ...this._defaultQuery, ...userQuery, langCode };
35
- const result = await this._fetchGet(`/?` + this._queryParamsToString(query));
53
+ const result = await this._fetchGet(`?` + this._queryParamsToString(query));
36
54
  return this._dataPostProcess(result, langCode);
37
55
  }
38
56
  /**
39
57
  * Get a single collection object by id.
40
58
  *
41
- * @param {number} [id] - Collection id.
42
- * @param {string} [langCode] - Language code.
59
+ * @handleName getICollectionById
43
60
  *
44
- * @returns Returns single ICollection object.
61
+ * @param {number} id - Collection id. Example: 1.
62
+ * @param {string} [langCode] - Language code. Default: "en_US".
63
+ * @return {ICollectionEntity} Returns an ICollection object or an error object if there was an issue.
64
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
65
+ * @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
66
  */
46
67
  async getICollectionById(id, langCode = this.state.lang) {
47
- const query = { langCode };
48
- const result = await this._fetchGet(`/${id}/?` + this._queryParamsToString(query));
68
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
+ const result = await this._fetchGet(`/${id}?` + this._queryParamsToString({ langCode }));
49
70
  return this._dataPostProcess(result, langCode);
50
71
  }
51
72
  /**
52
73
  * Get all records belonging to the collection by collection id.
53
74
  *
54
- * @param {number} [id] - Collection id.
55
- * @param {string} [langCode] - Language code.
56
- * @param {any} [userQuery] - Optional set query parameters.
57
- *
58
- * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
59
- * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
60
- * @param {number} [userQuery.entityType] - Entity type. Example: 1
61
- * @param {number} [userQuery.entityId] - Entity identifier. Example: orders
75
+ * @handleName getICollectionRowsById
62
76
  *
63
- * @returns Returns object ItemsWithTotal, where items is an array of requested objects
77
+ * @param {number} id - Collection id. Example: 1.
78
+ * @param {string} [langCode] - Language code. Default: "en_US".
79
+ * @param {any} [userQuery] - Optional set query parameters. Example:
80
+ {
81
+ "limit": 0,
82
+ "offset": 30,
83
+ "entityType": "orders",
84
+ "entityId": 1
85
+ }
86
+ * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
87
+ * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
88
+ * @param {number} [userQuery.entityType] - Entity type. Example: "orders".
89
+ * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
90
+ * @return {ICollectionRowsResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
91
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
92
+ * @description Get all records belonging to the collection by collection id.
64
93
  */
65
94
  async getICollectionRowsById(id, langCode = this.state.lang, userQuery) {
66
- const query = { ...this._defaultQuery, ...userQuery, langCode };
67
- const result = await this._fetchGet(`/${id}/rows/?` + this._queryParamsToString(query));
95
+ const result = await this._fetchGet(`/${id}/rows?` +
96
+ this._queryParamsToString({
97
+ ...this._defaultQuery,
98
+ ...userQuery,
99
+ langCode,
100
+ }));
68
101
  return this._dataPostProcess(result, langCode);
69
102
  }
70
103
  /**
71
- * Check for the existence of a text identifier (marker)
104
+ * Check for the existence of a text identifier (marker).
72
105
  *
73
- * @param {string} [marker] - Collection marker.
106
+ * @handleName validateICollectionMarker
74
107
  *
75
- * @returns Returns object with value true if text identifier (marker) exists or false if not
108
+ * @param {string} marker - Collection marker. Example: "collection1".
109
+ * @return {ICollectionIsValid} Returns an object with a boolean property `valid` indicating whether the marker is valid or not. Example:
110
+ {
111
+ "valid": true
112
+ }
113
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
114
+ * @description Check for the existence of a text identifier (marker).
76
115
  */
77
116
  async validateICollectionMarker(marker) {
78
- const result = await this._fetchGet(`/marker-validation/${marker}/`);
117
+ const result = await this._fetchGet(`/marker-validation/${marker}`);
79
118
  return this._dataPostProcess(result);
80
119
  }
81
120
  /**
82
121
  * Getting all records from the collection.
83
122
  *
84
- * @param {string} [marker] - Collection text identifier
85
- * @param {string} [langCode] - Language code.
123
+ * @handleName getICollectionRowsByMarker
86
124
  *
87
- * @returns Returns CollectionRowEntity object.
125
+ * @param {string} marker - Collection text identifier. Example: "collection1".
126
+ * @param {string} [langCode] - Language code. Default: "en_US".
127
+ * @return {ICollectionRowsResponce} Returns CollectionRowEntity object.
128
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
129
+ * @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.
88
130
  */
89
131
  async getICollectionRowsByMarker(marker, langCode = this.state.lang) {
90
- const result = await this._fetchGet(`/marker/${marker}/rows/?langCode=${langCode}`);
132
+ const result = await this._fetchGet(`/marker/${marker}/rows?langCode=${langCode}`);
91
133
  return this._dataPostProcess(result, langCode);
92
134
  }
93
135
  /**
94
136
  * Getting one record from the collection.
95
137
  *
96
- * @param {string} [marker] - Collection text identifier
97
- * @param {number} [id] - Collection record identifier
98
- * @param {string} [langCode] - Language code.
138
+ * @handleName getICollectionRowByMarkerAndId
99
139
  *
100
- * @returns Returns CollectionRowEntity object.
140
+ * @param {string} marker - Collection text identifier. Example: "collection1".
141
+ * @param {number} id - Collection record identifier. Example: 1.
142
+ * @param {string} [langCode] - Language code. Default: "en_US".
143
+ * @return {ICollectionRow} Returns CollectionRowEntity object.
144
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
145
+ * @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
146
  */
102
147
  async getICollectionRowByMarkerAndId(marker, id, langCode = this.state.lang) {
103
- const result = await this._fetchGet(`/marker/${marker}/rows/${id}/?langCode=${langCode}`);
148
+ const result = await this._fetchGet(`/marker/${marker}/rows/${id}?langCode=${langCode}`);
104
149
  return this._dataPostProcess(result, langCode);
105
150
  }
106
151
  /**
107
- * Create a record in the collection
108
- *
109
- * @param {string} [marker] - Collection text identifier. Example : collection1
110
- * @param {ICollectionFormObject} [body] - Object for creating a record
111
- * const body: ICollectionFormObject = {
112
- "formIdentifier": "collection-form",
113
- "formData": {
114
- "en_US": [
115
- {
116
- "marker": "collection_marker",
117
- "type": "string",
118
- "value": "Collection marker"
119
- }
120
- ]
152
+ * Create a record in the collection.
153
+ *
154
+ * @handleName createICollectionRow
155
+ *
156
+ * @param {string} marker - Collection text identifier. Example: "collection1".
157
+ * @param {ICollectionFormObject} body - Object for creating a record. Example:
158
+ {
159
+ "formIdentifier": "collection-form",
160
+ "formData": {
161
+ "en_US": [
162
+ {
163
+ "marker": "collection_marker",
164
+ "type": "string",
165
+ "value": "Collection marker"
166
+ }
167
+ ]
168
+ }
121
169
  }
122
- }
123
- * @param {string} [langCode] - Language code.
124
- *
125
- * @description Create a record in the collection
170
+ * @param {string} [langCode] - Language code. Default: "en_US".
171
+ * @return {ICollectionRow} Returns object of type ICollectionRow.
172
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
173
+ * @description Create a record in the collection.
126
174
  */
127
175
  async createICollectionRow(marker, body, langCode = this.state.lang) {
128
- const response = await this._fetchPost(`/marker/${marker}/rows/?` + `langCode=${langCode}`, body);
176
+ const response = await this._fetchPost(`/marker/${marker}/rows?langCode=${langCode}`, body);
129
177
  return this._normalizeData(response, langCode);
130
178
  }
131
179
  /**
132
- * Edit a record in the collection
133
- *
134
- * @param {string} [marker] - text identifier of the collection
135
- * @param {number} [id] - row id
136
- * @param {any} [body] - Object for updating a record in the collection
137
- *
138
- * const body = {
139
- "formIdentifier": "collection-form",
140
- "formData": {
141
- "en_US": [
142
- {
143
- "marker": "collection_marker",
144
- "type": "string",
145
- "value": "Collection marker"
146
- }
147
- ]
180
+ * Edit a record in the collection.
181
+ *
182
+ * @handleName updateICollectionRow
183
+ *
184
+ * @param {string} marker - Text identifier of the collection. Example: "collection1".
185
+ * @param {number} id - Row identifier in the collection. Example: 12.
186
+ * @param {object} body - Object for updating a record in the collection. Example:
187
+ {
188
+ "formIdentifier": "collection-form",
189
+ "formData": {
190
+ "en_US": [
191
+ {
192
+ "marker": "collection_marker",
193
+ "type": "string",
194
+ "value": "Collection marker"
195
+ }
196
+ ]
197
+ }
148
198
  }
149
- }
150
- *
151
- * @param {string} [langCode] - language code
152
- *
153
- * @returns Returns object
199
+ * @param {string} [langCode] - Language code. Default: "en_US".
200
+ * @return {ICollectionRow} Returns object of type ICollectionRow.
201
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
202
+ * @description Edit a record in the collection.
154
203
  */
155
204
  async updateICollectionRow(marker, id, body, langCode = this.state.lang) {
156
- const response = await this._fetchPut(`/marker/${marker}/rows/${id}/?` + `langCode=${langCode}`, body);
205
+ const response = await this._fetchPut(`/marker/${marker}/rows/${id}?` + `langCode=${langCode}`, body);
157
206
  return this._normalizeData(response, langCode);
158
207
  }
159
208
  /**
160
209
  * Deletion of collection record object
161
210
  *
162
- * @param {string} [marker] - text identifier of the collection Example : collection1
163
- * @param {number} [id] - record identifier in the collection Example : 12
211
+ * @handleName deleteICollectionRowByMarkerAndId
164
212
  *
165
- * @returns Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
213
+ * @param {string} marker - text identifier of the collection Example: "collection1".
214
+ * @param {number} id - record identifier in the collection Example: 12.
215
+ * @return {boolean} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
216
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
217
+ * @description Deletion of collection record object
166
218
  */
167
219
  async deleteICollectionRowByMarkerAndId(marker, id) {
168
220
  const result = await this._fetchDelete(`/marker/${marker}/rows/${id}`);