oneentry 1.0.142 → 1.0.144

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 (150) hide show
  1. package/configure.js +2 -2
  2. package/dist/admins/adminsApi.d.ts +50 -0
  3. package/dist/admins/adminsApi.js +65 -0
  4. package/dist/admins/adminsInterfaces.d.ts +98 -0
  5. package/dist/admins/adminsInterfaces.js +2 -0
  6. package/dist/admins/adminsSchemas.d.ts +30 -0
  7. package/dist/admins/adminsSchemas.js +27 -0
  8. package/dist/attribute-sets/attributeSetsApi.d.ts +63 -0
  9. package/dist/attribute-sets/attributeSetsApi.js +98 -0
  10. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +185 -0
  11. package/dist/attribute-sets/attributeSetsInterfaces.js +2 -0
  12. package/dist/attribute-sets/attributeSetsSchemas.d.ts +90 -0
  13. package/dist/attribute-sets/attributeSetsSchemas.js +74 -0
  14. package/dist/auth-provider/authProviderApi.d.ts +249 -0
  15. package/dist/auth-provider/authProviderApi.js +354 -0
  16. package/dist/auth-provider/authProviderSchemas.d.ts +131 -0
  17. package/dist/auth-provider/authProviderSchemas.js +82 -0
  18. package/dist/auth-provider/authProvidersInterfaces.d.ts +412 -0
  19. package/dist/auth-provider/authProvidersInterfaces.js +2 -0
  20. package/dist/base/asyncModules.d.ts +80 -0
  21. package/dist/base/asyncModules.js +448 -0
  22. package/dist/base/result.d.ts +39 -0
  23. package/dist/base/result.js +154 -0
  24. package/dist/base/stateModule.d.ts +41 -0
  25. package/dist/base/stateModule.js +128 -0
  26. package/dist/base/syncModules.d.ts +286 -0
  27. package/dist/base/syncModules.js +716 -0
  28. package/dist/base/utils.d.ts +197 -0
  29. package/dist/base/utils.js +2 -0
  30. package/dist/base/validation.d.ts +118 -0
  31. package/dist/base/validation.js +132 -0
  32. package/dist/blocks/blocksApi.d.ts +88 -0
  33. package/dist/blocks/blocksApi.js +207 -0
  34. package/dist/blocks/blocksInterfaces.d.ts +179 -0
  35. package/dist/blocks/blocksInterfaces.js +2 -0
  36. package/dist/blocks/blocksSchemas.d.ts +195 -0
  37. package/dist/blocks/blocksSchemas.js +43 -0
  38. package/dist/discounts/discountsApi.d.ts +76 -0
  39. package/dist/discounts/discountsApi.js +116 -0
  40. package/dist/discounts/discountsInterfaces.d.ts +217 -0
  41. package/dist/discounts/discountsInterfaces.js +2 -0
  42. package/dist/events/eventsApi.d.ts +60 -0
  43. package/dist/events/eventsApi.js +97 -0
  44. package/dist/events/eventsInterfaces.d.ts +87 -0
  45. package/dist/events/eventsInterfaces.js +2 -0
  46. package/dist/file-uploading/fileUploadingApi.d.ts +88 -0
  47. package/dist/file-uploading/fileUploadingApi.js +129 -0
  48. package/dist/file-uploading/fileUploadingInterfaces.d.ts +114 -0
  49. package/dist/file-uploading/fileUploadingInterfaces.js +2 -0
  50. package/dist/file-uploading/fileUploadingSchemas.d.ts +22 -0
  51. package/dist/file-uploading/fileUploadingSchemas.js +21 -0
  52. package/dist/forms/formsApi.d.ts +42 -0
  53. package/dist/forms/formsApi.js +57 -0
  54. package/dist/forms/formsInterfaces.d.ts +144 -0
  55. package/dist/forms/formsInterfaces.js +2 -0
  56. package/dist/forms/formsSchemas.d.ts +53 -0
  57. package/dist/forms/formsSchemas.js +34 -0
  58. package/dist/forms-data/formsDataApi.d.ts +106 -0
  59. package/dist/forms-data/formsDataApi.js +189 -0
  60. package/dist/forms-data/formsDataInterfaces.d.ts +522 -0
  61. package/dist/forms-data/formsDataInterfaces.js +2 -0
  62. package/dist/forms-data/formsDataSchemas.d.ts +115 -0
  63. package/dist/forms-data/formsDataSchemas.js +86 -0
  64. package/dist/general-types/generalTypesApi.d.ts +28 -0
  65. package/dist/general-types/generalTypesApi.js +38 -0
  66. package/dist/general-types/generalTypesInterfaces.d.ts +29 -0
  67. package/dist/general-types/generalTypesInterfaces.js +2 -0
  68. package/dist/general-types/generalTypesSchemas.d.ts +52 -0
  69. package/dist/general-types/generalTypesSchemas.js +36 -0
  70. package/dist/index.d.ts +124 -0
  71. package/dist/index.js +103 -0
  72. package/dist/integration-collections/integrationCollectionsApi.d.ts +163 -0
  73. package/dist/integration-collections/integrationCollectionsApi.js +220 -0
  74. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +313 -0
  75. package/dist/integration-collections/integrationCollectionsInterfaces.js +2 -0
  76. package/dist/integration-collections/integrationCollectionsSchemas.d.ts +80 -0
  77. package/dist/integration-collections/integrationCollectionsSchemas.js +61 -0
  78. package/dist/locales/localesApi.d.ts +27 -0
  79. package/dist/locales/localesApi.js +37 -0
  80. package/dist/locales/localesInterfaces.d.ts +40 -0
  81. package/dist/locales/localesInterfaces.js +2 -0
  82. package/dist/locales/localesSchemas.d.ts +32 -0
  83. package/dist/locales/localesSchemas.js +26 -0
  84. package/dist/menus/menusApi.d.ts +29 -0
  85. package/dist/menus/menusApi.js +39 -0
  86. package/dist/menus/menusInterfaces.d.ts +87 -0
  87. package/dist/menus/menusInterfaces.js +3 -0
  88. package/dist/menus/menusSchemas.d.ts +16 -0
  89. package/dist/menus/menusSchemas.js +28 -0
  90. package/dist/orders/ordersApi.d.ts +175 -0
  91. package/dist/orders/ordersApi.js +247 -0
  92. package/dist/orders/ordersInterfaces.d.ts +593 -0
  93. package/dist/orders/ordersInterfaces.js +2 -0
  94. package/dist/orders/ordersSchemas.d.ts +120 -0
  95. package/dist/orders/ordersSchemas.js +101 -0
  96. package/dist/pages/pagesApi.d.ts +151 -0
  97. package/dist/pages/pagesApi.js +390 -0
  98. package/dist/pages/pagesInterfaces.d.ts +286 -0
  99. package/dist/pages/pagesInterfaces.js +2 -0
  100. package/dist/pages/pagesSchemas.d.ts +85 -0
  101. package/dist/pages/pagesSchemas.js +46 -0
  102. package/dist/payments/paymentsApi.d.ts +82 -0
  103. package/dist/payments/paymentsApi.js +121 -0
  104. package/dist/payments/paymentsInterfaces.d.ts +200 -0
  105. package/dist/payments/paymentsInterfaces.js +2 -0
  106. package/dist/payments/paymentsSchemas.d.ts +100 -0
  107. package/dist/payments/paymentsSchemas.js +65 -0
  108. package/dist/product-statuses/productStatusesApi.d.ts +47 -0
  109. package/dist/product-statuses/productStatusesApi.js +70 -0
  110. package/dist/product-statuses/productStatusesInterfaces.d.ts +62 -0
  111. package/dist/product-statuses/productStatusesInterfaces.js +2 -0
  112. package/dist/product-statuses/productStatusesSchemas.d.ts +34 -0
  113. package/dist/product-statuses/productStatusesSchemas.js +30 -0
  114. package/dist/products/productsApi.d.ts +366 -0
  115. package/dist/products/productsApi.js +458 -0
  116. package/dist/products/productsInterfaces.d.ts +593 -0
  117. package/dist/products/productsInterfaces.js +2 -0
  118. package/dist/products/productsSchemas.d.ts +200 -0
  119. package/dist/products/productsSchemas.js +98 -0
  120. package/dist/sitemap/sitemapApi.d.ts +35 -0
  121. package/dist/sitemap/sitemapApi.js +45 -0
  122. package/dist/sitemap/sitemapInterfaces.d.ts +40 -0
  123. package/dist/sitemap/sitemapInterfaces.js +2 -0
  124. package/dist/system/systemApi.d.ts +43 -0
  125. package/dist/system/systemApi.js +56 -0
  126. package/dist/system/systemInterfaces.d.ts +29 -0
  127. package/dist/system/systemInterfaces.js +2 -0
  128. package/dist/templates/templatesApi.d.ts +49 -0
  129. package/dist/templates/templatesApi.js +75 -0
  130. package/dist/templates/templatesInterfaces.d.ts +67 -0
  131. package/dist/templates/templatesInterfaces.js +2 -0
  132. package/dist/templates/templatesSchemas.d.ts +48 -0
  133. package/dist/templates/templatesSchemas.js +31 -0
  134. package/dist/templates-preview/templatesPreviewApi.d.ts +38 -0
  135. package/dist/templates-preview/templatesPreviewApi.js +53 -0
  136. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +119 -0
  137. package/dist/templates-preview/templatesPreviewInterfaces.js +2 -0
  138. package/dist/templates-preview/templatesPreviewSchemas.d.ts +83 -0
  139. package/dist/templates-preview/templatesPreviewSchemas.js +48 -0
  140. package/dist/users/usersApi.d.ts +143 -0
  141. package/dist/users/usersApi.js +171 -0
  142. package/dist/users/usersInterfaces.d.ts +231 -0
  143. package/dist/users/usersInterfaces.js +2 -0
  144. package/dist/users/usersSchemas.d.ts +38 -0
  145. package/dist/users/usersSchemas.js +28 -0
  146. package/dist/web-socket/wsApi.d.ts +25 -0
  147. package/dist/web-socket/wsApi.js +45 -0
  148. package/dist/web-socket/wsInterfaces.d.ts +16 -0
  149. package/dist/web-socket/wsInterfaces.js +2 -0
  150. package/package.json +2 -80
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ /* eslint-disable jsdoc/reject-any-type */
7
+ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
8
+ const integrationCollectionsSchemas_1 = require("./integrationCollectionsSchemas");
9
+ /**
10
+ * Controllers for working with attributes.
11
+ * @handle /api/content/integration-collections
12
+ * @class IntegrationCollectionsApi
13
+ * @augments AsyncModules
14
+ * @implements {ICollectionsApi}
15
+ * @description This class provides methods to interact with integration collections, including retrieving all collections, getting a single collection by ID, and managing collection rows.
16
+ */
17
+ class IntegrationCollectionsApi extends asyncModules_1.default {
18
+ /**
19
+ *
20
+ */
21
+ constructor(state) {
22
+ super(state);
23
+ this._defaultQuery = {
24
+ langCode: 'en_US',
25
+ offset: 0,
26
+ limit: 30,
27
+ };
28
+ this._url = state.url + '/api/content/integration-collections';
29
+ }
30
+ /**
31
+ * Get all collections.
32
+ * @handleName getICollections
33
+ * @param {string} [langCode] - Language code. Default: "en_US".
34
+ * @param {object} [userQuery] - Optional set query parameters.
35
+ * @example
36
+ {
37
+ "limit": 0,
38
+ "offset": 30,
39
+ "entityType": "orders",
40
+ "entityId": 1
41
+ }
42
+ * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
43
+ * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
44
+ * @param {string} [userQuery.entityType] - Entity type. Example: "orders".
45
+ * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
46
+ * @returns {Promise<ICollectionEntity[] | IError>} Returns an array of ICollection objects or an error object if there was an issue.
47
+ */
48
+ async getICollections(langCode = this.state.lang, userQuery) {
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ const query = { ...this._defaultQuery, ...userQuery, langCode };
51
+ const result = await this._fetchGet(`?` + this._queryParamsToString(query));
52
+ // Validate response if validation is enabled
53
+ const validated = this._validateResponse(result, integrationCollectionsSchemas_1.CollectionsResponseSchema);
54
+ return this._dataPostProcess(validated, langCode);
55
+ }
56
+ /**
57
+ * Get a single collection object by id.
58
+ * @handleName getICollectionById
59
+ * @param {number} id - Collection id. Example: 1.
60
+ * @param {string} [langCode] - Language code. Default: "en_US".
61
+ * @returns {Promise<ICollectionEntity | IError>} Returns an ICollection object or an error object if there was an issue.
62
+ * @throws {IError} When isShell=false and an error occurs during the fetch
63
+ */
64
+ async getICollectionById(id, langCode = this.state.lang) {
65
+ const result = await this._fetchGet(`/${id}?` + this._queryParamsToString({ langCode }));
66
+ // Validate response if validation is enabled
67
+ const validated = this._validateResponse(result, integrationCollectionsSchemas_1.CollectionEntitySchema);
68
+ return this._dataPostProcess(validated, langCode);
69
+ }
70
+ /**
71
+ * Get all records belonging to the collection by collection id.
72
+ * @handleName getICollectionRowsById
73
+ * @param {number} id - Collection id. Example: 1.
74
+ * @param {string} [langCode] - Language code. Default: "en_US".
75
+ * @param {any} [userQuery] - Optional set query parameters.
76
+ * @example
77
+ {
78
+ "limit": 0,
79
+ "offset": 30,
80
+ "entityType": "orders",
81
+ "entityId": 1
82
+ }
83
+ * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
84
+ * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
85
+ * @param {number} [userQuery.entityType] - Entity type. Example: "orders".
86
+ * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
87
+ * @returns {Promise<ICollectionRowsResponce | IError>} Returns object ItemsWithTotal, where items is an array of requested objects.
88
+ * @throws {IError} When isShell=false and an error occurs during the fetch
89
+ * @description Get all records belonging to the collection by collection id.
90
+ */
91
+ async getICollectionRowsById(id, langCode = this.state.lang, userQuery) {
92
+ const result = await this._fetchGet(`/${id}/rows?` +
93
+ this._queryParamsToString({
94
+ ...this._defaultQuery,
95
+ ...userQuery,
96
+ langCode,
97
+ }));
98
+ // Validate response if validation is enabled
99
+ const validated = this._validateResponse(result, integrationCollectionsSchemas_1.CollectionRowsResponseSchema);
100
+ return this._dataPostProcess(validated, langCode);
101
+ }
102
+ /**
103
+ * Check for the existence of a text identifier (marker).
104
+ * @handleName validateICollectionMarker
105
+ * @param {string} marker - Collection marker. Example: "collection1".
106
+ * @returns {Promise<ICollectionIsValid | IError>} Returns an object with a boolean property `valid` indicating whether the marker is valid or not.
107
+ * @example
108
+ {
109
+ "valid": true
110
+ }
111
+ * @throws {IError} When isShell=false and an error occurs during the fetch
112
+ * @description Check for the existence of a text identifier (marker).
113
+ */
114
+ async validateICollectionMarker(marker) {
115
+ const result = await this._fetchGet(`/marker-validation/${marker}`);
116
+ // Validate response if validation is enabled
117
+ const validated = this._validateResponse(result, integrationCollectionsSchemas_1.CollectionIsValidSchema);
118
+ return this._dataPostProcess(validated);
119
+ }
120
+ /**
121
+ * Getting all records from the collection.
122
+ * @handleName getICollectionRowsByMarker
123
+ * @param {string} marker - Collection text identifier. Example: "collection1".
124
+ * @param {string} [langCode] - Language code. Default: "en_US".
125
+ * @returns {Promise<ICollectionRowsResponce | IError>} Returns CollectionRowEntity object.
126
+ * @throws {IError} When isShell=false and an error occurs during the fetch
127
+ */
128
+ async getICollectionRowsByMarker(marker, langCode = this.state.lang) {
129
+ const result = await this._fetchGet(`/marker/${marker}/rows?langCode=${langCode}`);
130
+ // Validate response if validation is enabled
131
+ const validated = this._validateResponse(result, integrationCollectionsSchemas_1.CollectionRowsResponseSchema);
132
+ return this._dataPostProcess(validated, langCode);
133
+ }
134
+ /**
135
+ * Getting one record from the collection.
136
+ * @handleName getICollectionRowByMarkerAndId
137
+ * @param {string} marker - Collection text identifier. Example: "collection1".
138
+ * @param {number} id - Collection record identifier. Example: 1.
139
+ * @param {string} [langCode] - Language code. Default: "en_US".
140
+ * @returns {Promise<ICollectionRow | IError>} Returns CollectionRowEntity object.
141
+ * @throws {IError} When isShell=false and an error occurs during the fetch
142
+ */
143
+ async getICollectionRowByMarkerAndId(marker, id, langCode = this.state.lang) {
144
+ const result = await this._fetchGet(`/marker/${marker}/rows/${id}?langCode=${langCode}`);
145
+ // Validate response if validation is enabled
146
+ const validated = this._validateResponse(result, integrationCollectionsSchemas_1.CollectionRowSchema);
147
+ return this._dataPostProcess(validated, langCode);
148
+ }
149
+ /**
150
+ * Create a record in the collection.
151
+ * @handleName createICollectionRow
152
+ * @param {string} marker - Collection text identifier. Example: "collection1".
153
+ * @param {ICollectionFormObject} body - Object for creating a record.
154
+ * @example
155
+ {
156
+ "formIdentifier": "collection-form",
157
+ "formData": [
158
+ {
159
+ "marker": "collection_marker",
160
+ "type": "string",
161
+ "value": "Collection marker"
162
+ }
163
+ ]
164
+ }
165
+ * @param {string} [langCode] - Language code. Default: "en_US".
166
+ * @returns {Promise<ICollectionRow | IError>} Returns object of type ICollectionRow.
167
+ * @throws {IError} When isShell=false and an error occurs during the fetch
168
+ * @description Create a record in the collection.
169
+ */
170
+ async createICollectionRow(marker, body, langCode = this.state.lang) {
171
+ const response = await this._fetchPost(`/marker/${marker}/rows?langCode=${langCode}`, body);
172
+ // Validate response if validation is enabled
173
+ const validated = this._validateResponse(response, integrationCollectionsSchemas_1.CollectionRowSchema);
174
+ return this._normalizeData(validated, langCode);
175
+ }
176
+ /**
177
+ * Edit a record in the collection.
178
+ * @handleName updateICollectionRow
179
+ * @param {string} marker - Text identifier of the collection. Example: "collection1".
180
+ * @param {number} id - Row identifier in the collection. Example: 12.
181
+ * @param {object} body - Object for updating a record in the collection.
182
+ * @example
183
+ {
184
+ "formIdentifier": "collection-form",
185
+ "formData": [
186
+ {
187
+ "marker": "collection_marker",
188
+ "type": "string",
189
+ "value": "Collection marker"
190
+ }
191
+ ]
192
+ }
193
+ * @param {string} body.formIdentifier - Textual identifier of the form. Example: "collection-form".
194
+ * @param {any} body.formData - Object with the form data.
195
+ * @param {string} [langCode] - Language code. Default: "en_US".
196
+ * @returns {Promise<ICollectionRow | IError>} Returns object of type ICollectionRow.
197
+ * @throws {IError} When isShell=false and an error occurs during the fetch
198
+ * @description Edit a record in the collection.
199
+ */
200
+ async updateICollectionRow(marker, id, body, langCode = this.state.lang) {
201
+ const response = await this._fetchPut(`/marker/${marker}/rows/${id}?` + `langCode=${langCode}`, body);
202
+ // Validate response if validation is enabled
203
+ const validated = this._validateResponse(response, integrationCollectionsSchemas_1.CollectionRowSchema);
204
+ return this._normalizeData(validated, langCode);
205
+ }
206
+ /**
207
+ * Deletion of collection record object
208
+ * @handleName deleteICollectionRowByMarkerAndId
209
+ * @param {string} marker - text identifier of the collection Example: "collection1".
210
+ * @param {number} id - record identifier in the collection Example: 12.
211
+ * @returns {Promise<boolean | IError>} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
212
+ * @throws {IError} When isShell=false and an error occurs during the fetch
213
+ * @description Deletion of collection record object
214
+ */
215
+ async deleteICollectionRowByMarkerAndId(marker, id) {
216
+ const result = await this._fetchDelete(`/marker/${marker}/rows/${id}`);
217
+ return result;
218
+ }
219
+ }
220
+ exports.default = IntegrationCollectionsApi;
@@ -0,0 +1,313 @@
1
+ import type { IError, ILocalizeInfo } from '../base/utils';
2
+ /**
3
+ * @interface ICollectionsApi
4
+ * @description This interface defines methods for managing collections and their records in the system.
5
+ */
6
+ interface ICollectionsApi {
7
+ /**
8
+ * Get all collections.
9
+ * @handleName getICollections
10
+ * @param {string} [langCode] - Language code. Default: "en_US".
11
+ * @param {ICollectionQuery} [userQuery] - Query parameters.
12
+ * @example
13
+ {
14
+ "limit": 30,
15
+ "offset": 0,
16
+ "entityType": "orders",
17
+ "entityId": 1
18
+ }
19
+ * @param {number} [userQuery.limit] - Parameter for pagination. Default: 0.
20
+ * @param {number} [userQuery.offset] - Parameter for pagination. Default: 30.
21
+ * @param {string} [userQuery.entityType] - Entity type. Example: "orders".
22
+ * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
23
+ * @returns {ICollectionEntity[]} Returns an array of ICollection objects or an error object if there was an issue.
24
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
25
+ * @description This method gets all collections.
26
+ */
27
+ getICollections(langCode: string, userQuery?: ICollectionQuery): Promise<ICollectionEntity[] | IError>;
28
+ /**
29
+ * Get a single collection object by id.
30
+ * @handleName getICollectionById
31
+ * @param {number} id - Collection id. Example: 1.
32
+ * @param {string} [langCode] - Language code. Default: "en_US".
33
+ * @returns {ICollectionEntity} Returns an ICollection object or an error object if there was an issue.
34
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
35
+ * @description This method gets a single collection object by id.
36
+ */
37
+ getICollectionById(id: number, langCode: string): Promise<ICollectionEntity | IError>;
38
+ /**
39
+ * Get all records belonging to the collection by collection id.
40
+ * @handleName getICollectionRowsById
41
+ * @param {number} id - Collection id.
42
+ * @param {string} [langCode] - Language code. Default: "en_US".
43
+ * @param {ICollectionQuery} [userQuery] - Optional set query parameters.
44
+ * @example
45
+ {
46
+ "limit": 30,
47
+ "offset": 0,
48
+ "entityType": "orders",
49
+ "entityId": 1
50
+ }
51
+ * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
52
+ * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
53
+ * @param {number} [userQuery.entityType] - Entity type. Example: "orders".
54
+ * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
55
+ * @returns {ICollectionRowsResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
56
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
57
+ * @description This method gets all records belonging to the collection by collection id.
58
+ */
59
+ getICollectionRowsById(id: number, langCode: string, userQuery?: ICollectionQuery): Promise<ICollectionRowsResponce | IError>;
60
+ /**
61
+ * Check for the existence of a text identifier (marker).
62
+ * @handleName validateICollectionMarker
63
+ * @param {string} marker - Collection marker. Example: "collection1".
64
+ * @returns {ICollectionIsValid} Returns an object with a boolean property `valid` indicating whether the marker is valid or not.
65
+ * @example
66
+ {
67
+ "valid": true
68
+ }
69
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
70
+ * @description This method checks for the existence of a text identifier (marker).
71
+ */
72
+ validateICollectionMarker(marker: string): Promise<ICollectionIsValid | IError>;
73
+ /**
74
+ * Getting all records from the collection.
75
+ * @handleName getICollectionRowsByMarker
76
+ * @param {string} marker - Collection text identifier. Example: "collection1".
77
+ * @param {string} [langCode] - Language code. Default: "en_US".
78
+ * @returns {ICollectionRowsResponce} Returns collection row entity object.
79
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
80
+ * @description This method gets all records from the collection.
81
+ */
82
+ getICollectionRowsByMarker(marker: string, langCode?: string): Promise<ICollectionRowsResponce | IError>;
83
+ /**
84
+ * Getting one record from the collection.
85
+ * @handleName getICollectionRowByMarkerAndId
86
+ * @param {string} marker - Collection text identifier. Example: "collection1".
87
+ * @param {number} id - Collection record identifier. Example: 1.
88
+ * @param {string} [langCode] - Language code. Default: "en_US".
89
+ * @returns {ICollectionRow} Returns collection row entity object.
90
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
91
+ * @description This method gets one record from the collection.
92
+ */
93
+ getICollectionRowByMarkerAndId(marker: string, id: number, langCode: string): Promise<ICollectionRow | IError>;
94
+ /**
95
+ * Create a record in the collection.
96
+ * @handleName createICollectionRow
97
+ * @param {string} marker - Collection text identifier. Example: "collection1".
98
+ * @param {ICollectionFormObject} body - Object for creating a record.
99
+ * @example
100
+ {
101
+ "formIdentifier": "collection-form",
102
+ "formData": [
103
+ {
104
+ "marker": "collection_marker",
105
+ "type": "string",
106
+ "value": "Collection marker"
107
+ }
108
+ ]
109
+ }
110
+ * @param {string} [langCode] - Language code. Default: "en_US".
111
+ * @returns {ICollectionRow} Returns object of type ICollectionRow.
112
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
113
+ * @description This method creates a record in the collection.
114
+ */
115
+ createICollectionRow(marker: string, body: ICollectionFormObject, langCode: string): Promise<ICollectionRow | IError>;
116
+ /**
117
+ * Edit a record in the collection.
118
+ * @handleName updateICollectionRow
119
+ * @param {string} marker - Text identifier of the collection. Example: "collection1".
120
+ * @param {number} id - Row id. Example: 12.
121
+ * @param {ICollectionFormObject} body - Object for updating a record in the collection.
122
+ * @example
123
+ {
124
+ "formIdentifier": "collection-form",
125
+ "formData": [
126
+ {
127
+ "marker": "collection_marker",
128
+ "type": "string",
129
+ "value": "Collection marker"
130
+ }
131
+ ]
132
+ }
133
+ * @param {string} [langCode] - Language code. Default: "en_US".
134
+ * @returns {ICollectionRow} Returns object of type ICollectionRow.
135
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
136
+ * @description This method edits a record in the collection.
137
+ */
138
+ updateICollectionRow(marker: string, id: number, body: ICollectionFormObject, langCode: string): Promise<ICollectionRow | IError>;
139
+ /**
140
+ * Deletion of collection record object
141
+ * @handleName deleteICollectionRowByMarkerAndId
142
+ * @param {string} marker - text identifier of the collection Example: "collection1".
143
+ * @param {number} id - record identifier in the collection Example: 12.
144
+ * @returns {boolean} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
145
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
146
+ * @description This method deletes a collection record object.
147
+ */
148
+ deleteICollectionRowByMarkerAndId(marker: string, id: number): Promise<boolean | IError>;
149
+ }
150
+ /**
151
+ * Collection object
152
+ * @interface ICollectionEntity
153
+ * @property {number} id - Object identifier. Example: 1.
154
+ * @property {string | null} identifier - Text identifier for record field. Example: "collection1".
155
+ * @property {number | null} formId - Identifier for the form used by the order storage. Example: 1234.
156
+ * @property {ILocalizeInfo} localizeInfos - Localized information about the collection.
157
+ * @example
158
+ {
159
+ "title": "Admins text"
160
+ }
161
+ * @property {number | null} attributeSetId - Identifier of the set of attributes used by the form attached to the collection. Example: 1234 or null if not applicable.
162
+ * @property {string | null} selectedAttributeMarkers - Text identifiers of form object attributes for display in the data table. Example: "collection_marker".
163
+ * @description Represents a collection object with various properties, including identifiers, form information, and localized data.
164
+ */
165
+ interface ICollectionEntity {
166
+ id: number;
167
+ identifier: string | null;
168
+ formId: number | null;
169
+ localizeInfos: ILocalizeInfo;
170
+ attributeSetId: number | null;
171
+ selectedAttributeMarkers: string | null;
172
+ }
173
+ /**
174
+ * Collection response object
175
+ * @interface ICollectionResponce
176
+ * @property {ICollectionEntity[]} items - Array of collection objects.
177
+ * @example
178
+ [
179
+ {
180
+ "id": 1,
181
+ "identifier": "collection1"
182
+ }
183
+ ]
184
+ * @property {number} total - Total number of found records. Example: 10.
185
+ * @description Represents a response from the collections API containing a total count and an array of collection objects.
186
+ */
187
+ interface ICollectionResponce {
188
+ items: ICollectionEntity[];
189
+ total: number;
190
+ }
191
+ /**
192
+ * Collection form data object
193
+ * @interface ICollectionFormData
194
+ * @property {string} marker - Text identifier (marker) of the form field. Example: "collection_marker".
195
+ * @property {string} type - Type of the form field, such as "text", "number", "date", "etc". Example: "number".
196
+ * @property {string} value - Value of the form field, which can be a "string", "number", "date", "etc". Example: "Collection marker".
197
+ * @description Represents a form data object within a collection, containing a marker, type, and value.
198
+ */
199
+ interface ICollectionFormData {
200
+ marker: string;
201
+ type: string;
202
+ value: string;
203
+ }
204
+ /**
205
+ * Collection form object
206
+ * @interface ICollectionFormObject
207
+ * @property {string} formIdentifier - Text identifier (marker) of the form. Example: "collection-form".
208
+ * @property {Record<string, ICollectionFormData>} formData - An object where keys are form field markers and values are arrays of ICollectionFormData objects.
209
+ * @example
210
+ [
211
+ {
212
+ "marker": "name_1",
213
+ "type": "string",
214
+ "value": "Value"
215
+ }
216
+ ]
217
+ * @property {string} formData[].marker - Text identifier (marker) of the form field. Example: "name_1".
218
+ * @property {string} formData[].type - Type of the form field. Example: "string".
219
+ * @property {string} formData[].value - Value of the form field. Example: "Value".
220
+ * @description Represents a collection form object that contains a form identifier and associated form data. This interface defines the structure of a collection form object, which includes a form identifier and a set of form data organized by markers.
221
+ */
222
+ interface ICollectionFormObject {
223
+ formIdentifier: string;
224
+ formData: {
225
+ [key: string]: ICollectionFormData[];
226
+ };
227
+ }
228
+ /**
229
+ * Collection row object
230
+ * @interface ICollectionRow
231
+ * @property {number} id - Object identifier. Example: 1.
232
+ * @property {string} createdDate - Date of creation of the record. Example: "2023-01-01T00:00:00Z".
233
+ * @property {string} updatedDate - Date of last update of the record. Example: "2023-01-02T00:00:00Z".
234
+ * @property {number | null} [collectionId] - collectionId associated with the collection row. Example: "product", "order", "etc".
235
+ * @property {ICollectionFormData[]} formData - Array of form data objects associated with the collection row.
236
+ * @example
237
+ [
238
+ {
239
+ "marker": "name_1",
240
+ "type": "string",
241
+ "value": "Value"
242
+ }
243
+ ]
244
+ * @property {string | null} entityType - Type of the entity associated with the collection row. Example: "product", "order", "etc".
245
+ * @property {number | null} entityId - Identifier of the entity associated with the collection row. Example: 12345.
246
+ * @property {string | null} [attributeSetIdentifier] - Identifier of the attribute set used by the form attached to the collection row, or null if not applicable. Example: "attributeSet1" or null.
247
+ * @property {string} total - Total count. Example: "1".
248
+ * @description Represents a row in a collection, containing various properties such as identifiers, dates, form data, and an optional total value.
249
+ */
250
+ interface ICollectionRow {
251
+ id: number;
252
+ createdDate: string;
253
+ updatedDate: string;
254
+ collectionId?: number | null;
255
+ formData: ICollectionFormData[];
256
+ entityType: string | null;
257
+ entityId: number | null;
258
+ attributeSetIdentifier?: string | null;
259
+ total?: string;
260
+ }
261
+ /**
262
+ * Collection rows response object
263
+ * @interface ICollectionRowsResponce
264
+ * @property {ICollectionRow[]} items - Array of collection row objects.
265
+ * @example
266
+ [
267
+ {
268
+ "id": 1,
269
+ "createdDate": "2025-06-06T19:08:54.616Z",
270
+ "updatedDate": "2025-06-06T19:08:54.616Z",
271
+ "entityId": null,
272
+ "entityType": null,
273
+ "formData": [
274
+ {
275
+ "marker": "name_1",
276
+ "type": "string",
277
+ "value": "Value"
278
+ }
279
+ ],
280
+ "attributeSetIdentifier": null
281
+ }
282
+ ]
283
+ * @property {number} total - Total number of found records. Example: 10.
284
+ * @description Represents a response from the collections API containing a total count and an array of collection row objects.
285
+ */
286
+ interface ICollectionRowsResponce {
287
+ items: ICollectionRow[];
288
+ total: number;
289
+ }
290
+ /**
291
+ * Collection is valid object
292
+ * @interface ICollectionIsValid
293
+ * @property {boolean} valid - Valid marker object. Example: true.
294
+ * @description Represents a response from the validateICollectionMarker.
295
+ */
296
+ interface ICollectionIsValid {
297
+ valid: boolean;
298
+ }
299
+ /**
300
+ * Query parameters for collection requests.
301
+ * @interface ICollectionQuery
302
+ * @property {number} limit - Parameter for pagination. Default: 30.
303
+ * @property {number} offset - Parameter for pagination. Default: 0.
304
+ * @property {string} entityType - Entity type. Example: "orders".
305
+ * @property {number} entityId - Entity identifier. Example: 1.
306
+ */
307
+ interface ICollectionQuery {
308
+ limit: number;
309
+ offset: number;
310
+ entityType: string;
311
+ entityId: number;
312
+ }
313
+ export type { ICollectionEntity, ICollectionFormObject, ICollectionIsValid, ICollectionQuery, ICollectionResponce, ICollectionRow, ICollectionRowsResponce, ICollectionsApi, };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Validation schemas for IntegrationCollections module
3
+ * @description Zod schemas for validating integration collections-related API responses
4
+ */
5
+ import { z } from 'zod';
6
+ /**
7
+ * Collection entity schema
8
+ */
9
+ export declare const CollectionEntitySchema: z.ZodObject<{
10
+ id: z.ZodNumber;
11
+ identifier: z.ZodNullable<z.ZodString>;
12
+ formId: z.ZodNullable<z.ZodNumber>;
13
+ localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
14
+ attributeSetId: z.ZodNullable<z.ZodNumber>;
15
+ selectedAttributeMarkers: z.ZodNullable<z.ZodString>;
16
+ }, z.core.$strip>;
17
+ /**
18
+ * Collections response schema (array of collections)
19
+ */
20
+ export declare const CollectionsResponseSchema: z.ZodArray<z.ZodObject<{
21
+ id: z.ZodNumber;
22
+ identifier: z.ZodNullable<z.ZodString>;
23
+ formId: z.ZodNullable<z.ZodNumber>;
24
+ localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
25
+ attributeSetId: z.ZodNullable<z.ZodNumber>;
26
+ selectedAttributeMarkers: z.ZodNullable<z.ZodString>;
27
+ }, z.core.$strip>>;
28
+ /**
29
+ * Collection form data schema
30
+ */
31
+ export declare const CollectionFormDataSchema: z.ZodObject<{
32
+ marker: z.ZodString;
33
+ type: z.ZodString;
34
+ value: z.ZodString;
35
+ }, z.core.$strip>;
36
+ /**
37
+ * Collection row schema
38
+ */
39
+ export declare const CollectionRowSchema: z.ZodObject<{
40
+ id: z.ZodNumber;
41
+ createdDate: z.ZodString;
42
+ updatedDate: z.ZodString;
43
+ collectionId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
44
+ formData: z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
45
+ marker: z.ZodString;
46
+ type: z.ZodString;
47
+ value: z.ZodString;
48
+ }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
49
+ entityType: z.ZodNullable<z.ZodString>;
50
+ entityId: z.ZodNullable<z.ZodNumber>;
51
+ attributeSetIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
+ total: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strip>;
54
+ /**
55
+ * Collection rows response schema
56
+ */
57
+ export declare const CollectionRowsResponseSchema: z.ZodObject<{
58
+ items: z.ZodArray<z.ZodObject<{
59
+ id: z.ZodNumber;
60
+ createdDate: z.ZodString;
61
+ updatedDate: z.ZodString;
62
+ collectionId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
63
+ formData: z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
64
+ marker: z.ZodString;
65
+ type: z.ZodString;
66
+ value: z.ZodString;
67
+ }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
68
+ entityType: z.ZodNullable<z.ZodString>;
69
+ entityId: z.ZodNullable<z.ZodNumber>;
70
+ attributeSetIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ total: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strip>>;
73
+ total: z.ZodNumber;
74
+ }, z.core.$strip>;
75
+ /**
76
+ * Collection is valid schema
77
+ */
78
+ export declare const CollectionIsValidSchema: z.ZodObject<{
79
+ valid: z.ZodBoolean;
80
+ }, z.core.$strip>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectionIsValidSchema = exports.CollectionRowsResponseSchema = exports.CollectionRowSchema = exports.CollectionFormDataSchema = exports.CollectionsResponseSchema = exports.CollectionEntitySchema = void 0;
4
+ /**
5
+ * Validation schemas for IntegrationCollections module
6
+ * @description Zod schemas for validating integration collections-related API responses
7
+ */
8
+ const zod_1 = require("zod");
9
+ /**
10
+ * Collection entity schema
11
+ */
12
+ exports.CollectionEntitySchema = zod_1.z.object({
13
+ id: zod_1.z.number(),
14
+ identifier: zod_1.z.string().nullable(),
15
+ formId: zod_1.z.number().nullable(),
16
+ localizeInfos: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
17
+ attributeSetId: zod_1.z.number().nullable(),
18
+ selectedAttributeMarkers: zod_1.z.string().nullable(),
19
+ });
20
+ /**
21
+ * Collections response schema (array of collections)
22
+ */
23
+ exports.CollectionsResponseSchema = zod_1.z.array(exports.CollectionEntitySchema);
24
+ /**
25
+ * Collection form data schema
26
+ */
27
+ exports.CollectionFormDataSchema = zod_1.z.object({
28
+ marker: zod_1.z.string(),
29
+ type: zod_1.z.string(),
30
+ value: zod_1.z.string(),
31
+ });
32
+ /**
33
+ * Collection row schema
34
+ */
35
+ exports.CollectionRowSchema = zod_1.z.object({
36
+ id: zod_1.z.number(),
37
+ createdDate: zod_1.z.string(),
38
+ updatedDate: zod_1.z.string(),
39
+ collectionId: zod_1.z.number().nullable().optional(),
40
+ formData: zod_1.z.union([
41
+ zod_1.z.array(exports.CollectionFormDataSchema),
42
+ zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
43
+ ]),
44
+ entityType: zod_1.z.string().nullable(),
45
+ entityId: zod_1.z.number().nullable(),
46
+ attributeSetIdentifier: zod_1.z.string().nullable().optional(),
47
+ total: zod_1.z.string().optional(),
48
+ });
49
+ /**
50
+ * Collection rows response schema
51
+ */
52
+ exports.CollectionRowsResponseSchema = zod_1.z.object({
53
+ items: zod_1.z.array(exports.CollectionRowSchema),
54
+ total: zod_1.z.number(),
55
+ });
56
+ /**
57
+ * Collection is valid schema
58
+ */
59
+ exports.CollectionIsValidSchema = zod_1.z.object({
60
+ valid: zod_1.z.boolean(),
61
+ });