oneentry 1.0.101 → 1.0.104

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 (82) hide show
  1. package/README.md +798 -426
  2. package/configure.js +24 -33
  3. package/dist/admins/adminsApi.d.ts +11 -7
  4. package/dist/admins/adminsApi.js +17 -5
  5. package/dist/admins/adminsInterfaces.d.ts +33 -19
  6. package/dist/attribute-sets/attributeSetsApi.d.ts +35 -10
  7. package/dist/attribute-sets/attributeSetsApi.js +49 -7
  8. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +42 -11
  9. package/dist/auth-provider/authProviderApi.d.ts +17 -5
  10. package/dist/auth-provider/authProviderApi.js +31 -14
  11. package/dist/auth-provider/authProvidersInterfaces.d.ts +23 -2
  12. package/dist/base/asyncModules.d.ts +2 -2
  13. package/dist/base/asyncModules.js +26 -17
  14. package/dist/base/result.js +26 -12
  15. package/dist/base/stateModule.d.ts +1 -1
  16. package/dist/base/stateModule.js +20 -11
  17. package/dist/base/syncModules.d.ts +4 -4
  18. package/dist/base/syncModules.js +16 -12
  19. package/dist/base/utils.d.ts +2 -2
  20. package/dist/blocks/blocksApi.d.ts +8 -5
  21. package/dist/blocks/blocksApi.js +30 -8
  22. package/dist/blocks/blocksInterfaces.d.ts +38 -5
  23. package/dist/events/eventsApi.d.ts +7 -7
  24. package/dist/events/eventsApi.js +14 -9
  25. package/dist/events/eventsInterfaces.d.ts +5 -2
  26. package/dist/{file-uploding → file-uploading}/fileUploadingApi.d.ts +3 -3
  27. package/dist/{file-uploding → file-uploading}/fileUploadingApi.js +9 -5
  28. package/dist/{file-uploding → file-uploading}/fileUploadingInterfaces.d.ts +8 -5
  29. package/dist/forms/formsApi.d.ts +4 -4
  30. package/dist/forms/formsApi.js +4 -1
  31. package/dist/forms/formsInterfaces.d.ts +2 -3
  32. package/dist/formsData/formsDataApi.d.ts +5 -5
  33. package/dist/formsData/formsDataApi.js +10 -4
  34. package/dist/formsData/formsDataInterfaces.d.ts +2 -2
  35. package/dist/general-types/{typesApi.d.ts → generalTypesApi.d.ts} +4 -4
  36. package/dist/general-types/{typesApi.js → generalTypesApi.js} +4 -1
  37. package/dist/general-types/generalTypesInterfaces.d.ts +2 -2
  38. package/dist/index.d.ts +33 -21
  39. package/dist/index.js +37 -26
  40. package/dist/integration-collections/integrationCollectionsApi.d.ts +128 -0
  41. package/dist/integration-collections/integrationCollectionsApi.js +161 -0
  42. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +57 -0
  43. package/dist/integration-collections/integrationCollectionsInterfaces.js +2 -0
  44. package/dist/locales/localesApi.d.ts +4 -4
  45. package/dist/locales/localesApi.js +4 -1
  46. package/dist/locales/localesInterfaces.d.ts +2 -2
  47. package/dist/menus/menusApi.d.ts +4 -4
  48. package/dist/menus/menusApi.js +4 -1
  49. package/dist/menus/menusInterfaces.d.ts +6 -4
  50. package/dist/menus/menusInterfaces.js +1 -0
  51. package/dist/orders/ordersApi.d.ts +8 -8
  52. package/dist/orders/ordersApi.js +15 -7
  53. package/dist/orders/ordersInterfaces.d.ts +13 -3
  54. package/dist/pages/pagesApi.d.ts +4 -10
  55. package/dist/pages/pagesApi.js +14 -10
  56. package/dist/pages/pagesInterfaces.d.ts +13 -22
  57. package/dist/payments/paymentsApi.d.ts +6 -6
  58. package/dist/payments/paymentsApi.js +14 -6
  59. package/dist/payments/paymentsInterfaces.d.ts +20 -5
  60. package/dist/product-statuses/productStatusesApi.d.ts +3 -3
  61. package/dist/product-statuses/productStatusesApi.js +4 -1
  62. package/dist/product-statuses/productStatusesInterfaces.d.ts +2 -5
  63. package/dist/products/productsApi.d.ts +38 -54
  64. package/dist/products/productsApi.js +63 -61
  65. package/dist/products/productsInterfaces.d.ts +52 -40
  66. package/dist/system/systemApi.d.ts +3 -3
  67. package/dist/system/systemApi.js +5 -1
  68. package/dist/system/systemInterfaces.d.ts +1 -1
  69. package/dist/templates/templatesApi.d.ts +6 -3
  70. package/dist/templates/templatesApi.js +10 -2
  71. package/dist/templates/templatesInterfaces.d.ts +2 -2
  72. package/dist/templates-preview/templatesPreviewApi.d.ts +5 -4
  73. package/dist/templates-preview/templatesPreviewApi.js +5 -1
  74. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +21 -10
  75. package/dist/users/usersApi.d.ts +15 -4
  76. package/dist/users/usersApi.js +29 -2
  77. package/dist/users/usersInterfaces.d.ts +10 -4
  78. package/dist/web-socket/wsApi.d.ts +4 -4
  79. package/dist/web-socket/wsApi.js +15 -14
  80. package/dist/web-socket/wsInterfaces.d.ts +2 -2
  81. package/package.json +46 -10
  82. /package/dist/{file-uploding → file-uploading}/fileUploadingInterfaces.js +0 -0
package/dist/index.js CHANGED
@@ -1,30 +1,39 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineOneEntry = void 0;
4
- const productsApi_1 = require("./products/productsApi");
5
- const pagesApi_1 = require("./pages/pagesApi");
6
- const productStatusesApi_1 = require("./product-statuses/productStatusesApi");
7
- const templatesApi_1 = require("./templates/templatesApi");
8
- const templatesPreviewApi_1 = require("./templates-preview/templatesPreviewApi");
9
- const adminsApi_1 = require("./admins/adminsApi");
10
- const typesApi_1 = require("./general-types/typesApi");
11
- const localesApi_1 = require("./locales/localesApi");
12
- const menusApi_1 = require("./menus/menusApi");
13
- const formsApi_1 = require("./forms/formsApi");
14
- const formsDataApi_1 = require("./formsData/formsDataApi");
15
- const fileUploadingApi_1 = require("./file-uploding/fileUploadingApi");
16
- const systemApi_1 = require("./system/systemApi");
17
- const blocksApi_1 = require("./blocks/blocksApi");
18
- const attributeSetsApi_1 = require("./attribute-sets/attributeSetsApi");
19
- const ordersApi_1 = require("./orders/ordersApi");
20
- const paymentsApi_1 = require("./payments/paymentsApi");
21
- const authProviderApi_1 = require("./auth-provider/authProviderApi");
22
- const eventsApi_1 = require("./events/eventsApi");
23
- const usersApi_1 = require("./users/usersApi");
24
- const stateModule_1 = require("./base/stateModule");
25
- const wsApi_1 = require("./web-socket/wsApi");
6
+ exports.defineOneEntry = defineOneEntry;
7
+ /**
8
+ * OneEntry SDK
9
+ */
10
+ const adminsApi_1 = __importDefault(require("./admins/adminsApi"));
11
+ const attributeSetsApi_1 = __importDefault(require("./attribute-sets/attributeSetsApi"));
12
+ const authProviderApi_1 = __importDefault(require("./auth-provider/authProviderApi"));
13
+ const stateModule_1 = __importDefault(require("./base/stateModule"));
14
+ const blocksApi_1 = __importDefault(require("./blocks/blocksApi"));
15
+ const eventsApi_1 = __importDefault(require("./events/eventsApi"));
16
+ const fileUploadingApi_1 = __importDefault(require("./file-uploading/fileUploadingApi"));
17
+ const formsApi_1 = __importDefault(require("./forms/formsApi"));
18
+ const formsDataApi_1 = __importDefault(require("./formsData/formsDataApi"));
19
+ const generalTypesApi_1 = __importDefault(require("./general-types/generalTypesApi"));
20
+ const integrationCollectionsApi_1 = __importDefault(require("./integration-collections/integrationCollectionsApi"));
21
+ const localesApi_1 = __importDefault(require("./locales/localesApi"));
22
+ const menusApi_1 = __importDefault(require("./menus/menusApi"));
23
+ const ordersApi_1 = __importDefault(require("./orders/ordersApi"));
24
+ const pagesApi_1 = __importDefault(require("./pages/pagesApi"));
25
+ const paymentsApi_1 = __importDefault(require("./payments/paymentsApi"));
26
+ const productStatusesApi_1 = __importDefault(require("./product-statuses/productStatusesApi"));
27
+ const productsApi_1 = __importDefault(require("./products/productsApi"));
28
+ const systemApi_1 = __importDefault(require("./system/systemApi"));
29
+ const templatesApi_1 = __importDefault(require("./templates/templatesApi"));
30
+ const templatesPreviewApi_1 = __importDefault(require("./templates-preview/templatesPreviewApi"));
31
+ const usersApi_1 = __importDefault(require("./users/usersApi"));
32
+ const wsApi_1 = __importDefault(require("./web-socket/wsApi"));
26
33
  /**
27
34
  * Define API.
35
+ *
36
+ * @function
28
37
  * @param {string} url - URl of your project.
29
38
  * @param {IConfig} config - Custom configuration settings
30
39
  * @param {string} [config.token] - Optional token parameter
@@ -34,6 +43,7 @@ const wsApi_1 = require("./web-socket/wsApi");
34
43
  * @param {boolean} [config.auth.customAuth] - Set this flag to true if you want to configure the authorization process yourself. Set the flag to false, or do not pass it at all to have automatic authorization and token renewal.
35
44
  * @param {string} [config.auth.refreshToken] - Transfer the refresh token here, for example from the local storage, to resume the user's session. Otherwise, the user will need to log in every time a new session is created.
36
45
  * @param {string} [config.auth.saveFunction] - If you want to store the token between sessions, for example in local storage, create a custom function that takes refreshToken as a parameter and executes the necessary instructions. This function will be called every time the tokens are updated.
46
+ *
37
47
  * @returns {IDefineApi} - List of methods set.
38
48
  */
39
49
  function defineOneEntry(url, config) {
@@ -46,7 +56,8 @@ function defineOneEntry(url, config) {
46
56
  const FileUploading = new fileUploadingApi_1.default(stateModule);
47
57
  const Forms = new formsApi_1.default(stateModule);
48
58
  const FormData = new formsDataApi_1.default(stateModule);
49
- const GeneralTypes = new typesApi_1.default(stateModule);
59
+ const GeneralTypes = new generalTypesApi_1.default(stateModule);
60
+ const IntegrationCollections = new integrationCollectionsApi_1.default(stateModule);
50
61
  const Locales = new localesApi_1.default(stateModule);
51
62
  const Menus = new menusApi_1.default(stateModule);
52
63
  const Orders = new ordersApi_1.default(stateModule);
@@ -69,6 +80,7 @@ function defineOneEntry(url, config) {
69
80
  Forms,
70
81
  FormData,
71
82
  GeneralTypes,
83
+ IntegrationCollections,
72
84
  Locales,
73
85
  Menus,
74
86
  Orders,
@@ -80,7 +92,6 @@ function defineOneEntry(url, config) {
80
92
  Templates,
81
93
  TemplatePreviews,
82
94
  Users,
83
- WS
95
+ WS,
84
96
  };
85
97
  }
86
- exports.defineOneEntry = defineOneEntry;
@@ -0,0 +1,128 @@
1
+ import AsyncModules from '../base/asyncModules';
2
+ import type StateModule from '../base/stateModule';
3
+ import type { IError } from '../base/utils';
4
+ import type { ICollection, ICollectionFormObject, ICollectionResponce, ICollectionsApi } from './integrationCollectionsInterfaces';
5
+ /**
6
+ * Controllers for working with attributes.
7
+ */
8
+ export default class IntegrationCollectionsApi extends AsyncModules implements ICollectionsApi {
9
+ protected state: StateModule;
10
+ protected _url: string;
11
+ constructor(state: StateModule);
12
+ private _defaultQuery;
13
+ /**
14
+ * Get all collections
15
+ *
16
+ * @param {string} [langCode] - Language code.
17
+ * @param {any} [userQuery] - Optional set query parameters.
18
+ *
19
+ * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
20
+ * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
21
+ *
22
+ * @returns Returns an array of ICollections objects.
23
+ */
24
+ getICollections(langCode?: string, userQuery?: any): Promise<Array<ICollection> | IError>;
25
+ /**
26
+ * Get a single collection object by id.
27
+ * GET/api/content/integration-collections/{id}
28
+ *
29
+ * @param {number} [id] - Collection id.
30
+ * @param {string} [langCode] - Language code.
31
+ *
32
+ * @returns Returns single ICollection object.
33
+ */
34
+ getICollectionById(id: number, langCode?: string): Promise<ICollection | IError>;
35
+ /**
36
+ * Get all records belonging to the collection by collection id.
37
+ * GET/api/content/integration-collections/{id}/rows
38
+ *
39
+ * @param {number} [id] - Collection id.
40
+ * @param {string} [langCode] - Language code.
41
+ * @param {any} [userQuery] - Optional set query parameters.
42
+ *
43
+ * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
44
+ * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
45
+ *
46
+ * @returns Returns object ItemsWithTotal, where items is an array of requested objects
47
+ */
48
+ getICollectionRowsById(id: number, langCode?: string, userQuery?: any): Promise<ICollectionResponce | IError>;
49
+ /**
50
+ * Check for the existence of a text identifier (marker)
51
+ * GET/api/content/integration-collections/marker-validation/{marker}
52
+ *
53
+ * @param {string} [marker] - Collection id.
54
+ *
55
+ * @returns Returns object MarkerValidDto with value true if text identifier (marker) exists or false if not
56
+ */
57
+ validateICollectionMarker(marker: string): Promise<any | IError>;
58
+ /**
59
+ * Getting one record from the collection.
60
+ * GET/api/content/integration-collections/marker/{marker}/rows/{id}
61
+ *
62
+ * @param {string} [marker] - Collection text identifier
63
+ * @param {number} [id] - Collection record identifier
64
+ * @param {string} [langCode] - Language code.
65
+ *
66
+ * @returns Returns CollectionRowEntity object.
67
+ */
68
+ getICollectionRowByMarkerAndId(marker: string, id: number, langCode?: string): Promise<any | IError>;
69
+ /**
70
+ * Create a record in the collection
71
+ * POST/api/content/integration-collections/marker/{marker}/rows
72
+ *
73
+ * @param {string} [marker] - Collection text identifier. Example : collection1
74
+ * @param {ICollectionFormObject} [data] - Object for creating a record
75
+ * const data: ICollectionFormObject = {
76
+ "formIdentifier": "collection-form",
77
+ "formData": {
78
+ "en_US": [
79
+ {
80
+ "marker": "naimenovanie_1",
81
+ "type": "string",
82
+ "value": "Наименование"
83
+ }
84
+ ]
85
+ }
86
+ }
87
+ * @param {string} [langCode] - Language code.
88
+ *
89
+ * @description Create a record in the collection
90
+ */
91
+ createICollectionRow(marker: string, data: ICollectionFormObject, langCode?: string): Promise<Array<any> | IError>;
92
+ /**
93
+ * Edit a record in the collection
94
+ * PUT/api/content/integration-collections/marker/{marker}/rows/{id}
95
+ *
96
+ * @param {string} marker - text identifier of the collection
97
+ * @param {any} body - Object UpdateCollectionRowDto for updating a record in the collection
98
+ * const body = {
99
+ "formIdentifier": "collection-form",
100
+ "formData": {
101
+ "en_US": [
102
+ {
103
+ "marker": "naimenovanie_1",
104
+ "type": "string",
105
+ "value": "Наименование"
106
+ }
107
+ ]
108
+ }
109
+ }
110
+ * @param {string} langCode - language code
111
+ *
112
+ * @returns Returns object UpdateCollectionRowDto
113
+ */
114
+ updateICollectionRow(marker: string, id: number, body: {
115
+ formIdentifier: string;
116
+ formData: any;
117
+ }, langCode?: string): Promise<any | IError>;
118
+ /**
119
+ * Deletion of collection record object
120
+ * DELETE/api/content/integration-collections/marker/{marker}/rows/{id} Удаление объекта записи коллекции
121
+ *
122
+ * @param id - record identifier in the collection Example : 12
123
+ * @param marker - text identifier of the collection Example : collection1
124
+ *
125
+ * @returns Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
126
+ */
127
+ deleteCollectionRowByMarker(marker: number, id: number): Promise<any | IError>;
128
+ }
@@ -0,0 +1,161 @@
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 @typescript-eslint/no-explicit-any */
7
+ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
8
+ /**
9
+ * Controllers for working with attributes.
10
+ */
11
+ class IntegrationCollectionsApi extends asyncModules_1.default {
12
+ constructor(state) {
13
+ super(state);
14
+ this._defaultQuery = {
15
+ langCode: 'en_US',
16
+ offset: 0,
17
+ limit: 30,
18
+ };
19
+ this._url = state.url + '/api/content/integration-collections';
20
+ }
21
+ /**
22
+ * Get all collections
23
+ *
24
+ * @param {string} [langCode] - Language code.
25
+ * @param {any} [userQuery] - Optional set query parameters.
26
+ *
27
+ * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
28
+ * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
29
+ *
30
+ * @returns Returns an array of ICollections objects.
31
+ */
32
+ async getICollections(langCode = this.state.lang, userQuery) {
33
+ const query = { ...this._defaultQuery, ...userQuery, langCode };
34
+ const result = await this._fetchGet(`/?` + this._queryParamsToString(query));
35
+ return this._dataPostProcess(result, langCode);
36
+ }
37
+ /**
38
+ * Get a single collection object by id.
39
+ * GET/api/content/integration-collections/{id}
40
+ *
41
+ * @param {number} [id] - Collection id.
42
+ * @param {string} [langCode] - Language code.
43
+ *
44
+ * @returns Returns single ICollection object.
45
+ */
46
+ async getICollectionById(id, langCode = this.state.lang) {
47
+ const query = { langCode };
48
+ const result = await this._fetchGet(`/${id}/?` + this._queryParamsToString(query));
49
+ return this._dataPostProcess(result, langCode);
50
+ }
51
+ /**
52
+ * Get all records belonging to the collection by collection id.
53
+ * GET/api/content/integration-collections/{id}/rows
54
+ *
55
+ * @param {number} [id] - Collection id.
56
+ * @param {string} [langCode] - Language code.
57
+ * @param {any} [userQuery] - Optional set query parameters.
58
+ *
59
+ * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
60
+ * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
61
+ *
62
+ * @returns Returns object ItemsWithTotal, where items is an array of requested objects
63
+ */
64
+ async getICollectionRowsById(id, langCode = this.state.lang, userQuery) {
65
+ const query = { ...this._defaultQuery, ...userQuery, langCode };
66
+ const result = await this._fetchGet(`/${id}/rows/?` + this._queryParamsToString(query));
67
+ return this._dataPostProcess(result, langCode);
68
+ }
69
+ /**
70
+ * Check for the existence of a text identifier (marker)
71
+ * GET/api/content/integration-collections/marker-validation/{marker}
72
+ *
73
+ * @param {string} [marker] - Collection id.
74
+ *
75
+ * @returns Returns object MarkerValidDto with value true if text identifier (marker) exists or false if not
76
+ */
77
+ async validateICollectionMarker(marker) {
78
+ const result = await this._fetchGet(`/marker-validation/${marker}/`);
79
+ return this._dataPostProcess(result);
80
+ }
81
+ /**
82
+ * Getting one record from the collection.
83
+ * GET/api/content/integration-collections/marker/{marker}/rows/{id}
84
+ *
85
+ * @param {string} [marker] - Collection text identifier
86
+ * @param {number} [id] - Collection record identifier
87
+ * @param {string} [langCode] - Language code.
88
+ *
89
+ * @returns Returns CollectionRowEntity object.
90
+ */
91
+ async getICollectionRowByMarkerAndId(marker, id, langCode = this.state.lang) {
92
+ const result = await this._fetchGet(`/marker/${marker}/rows/${id}/?langCode=${langCode}`);
93
+ return this._dataPostProcess(result, langCode);
94
+ }
95
+ /**
96
+ * Create a record in the collection
97
+ * POST/api/content/integration-collections/marker/{marker}/rows
98
+ *
99
+ * @param {string} [marker] - Collection text identifier. Example : collection1
100
+ * @param {ICollectionFormObject} [data] - Object for creating a record
101
+ * const data: ICollectionFormObject = {
102
+ "formIdentifier": "collection-form",
103
+ "formData": {
104
+ "en_US": [
105
+ {
106
+ "marker": "naimenovanie_1",
107
+ "type": "string",
108
+ "value": "Наименование"
109
+ }
110
+ ]
111
+ }
112
+ }
113
+ * @param {string} [langCode] - Language code.
114
+ *
115
+ * @description Create a record in the collection
116
+ */
117
+ async createICollectionRow(marker, data, langCode = this.state.lang) {
118
+ const response = await this._fetchPost(`/marker/${marker}/rows/?` + `langCode=${langCode}`, data);
119
+ return this._normalizeData(response, langCode);
120
+ }
121
+ /**
122
+ * Edit a record in the collection
123
+ * PUT/api/content/integration-collections/marker/{marker}/rows/{id}
124
+ *
125
+ * @param {string} marker - text identifier of the collection
126
+ * @param {any} body - Object UpdateCollectionRowDto for updating a record in the collection
127
+ * const body = {
128
+ "formIdentifier": "collection-form",
129
+ "formData": {
130
+ "en_US": [
131
+ {
132
+ "marker": "naimenovanie_1",
133
+ "type": "string",
134
+ "value": "Наименование"
135
+ }
136
+ ]
137
+ }
138
+ }
139
+ * @param {string} langCode - language code
140
+ *
141
+ * @returns Returns object UpdateCollectionRowDto
142
+ */
143
+ async updateICollectionRow(marker, id, body, langCode = this.state.lang) {
144
+ const response = await this._fetchPut(`/marker/${marker}/rows/${id}/?` + `langCode=${langCode}`, body);
145
+ return this._normalizeData(response, langCode);
146
+ }
147
+ /**
148
+ * Deletion of collection record object
149
+ * DELETE/api/content/integration-collections/marker/{marker}/rows/{id} Удаление объекта записи коллекции
150
+ *
151
+ * @param id - record identifier in the collection Example : 12
152
+ * @param marker - text identifier of the collection Example : collection1
153
+ *
154
+ * @returns Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
155
+ */
156
+ async deleteCollectionRowByMarker(marker, id) {
157
+ const result = await this._fetchDelete(`/marker/${marker}/rows/${id}`);
158
+ return result.json();
159
+ }
160
+ }
161
+ exports.default = IntegrationCollectionsApi;
@@ -0,0 +1,57 @@
1
+ import type { IError } from '../base/utils';
2
+ /**
3
+ * Represents an interface object of ICollections Api.
4
+ *
5
+ * @property {function} getICollections - Get all collections
6
+ * @property {function} getICollectionById - Get a single collection object
7
+ * @property {function} getICollectionRowsById -
8
+ * @property {function} validateICollectionMarker -
9
+ * @property {function} getICollectionRowByMarkerAndId -
10
+ * @property {function} createICollectionRow -
11
+ * @property {function} updateICollectionRow -
12
+ */
13
+ interface ICollectionsApi {
14
+ getICollections(marker: string, langCode: string, userQuery?: any): Promise<Array<any> | IError>;
15
+ getICollectionById(id: number, langCode: string): Promise<any | IError>;
16
+ getICollectionRowsById(id: number, langCode: string, userQuery?: any): Promise<any | IError>;
17
+ validateICollectionMarker(marker: string): Promise<any | IError>;
18
+ getICollectionRowByMarkerAndId(marker: string, id: number, langCode: string): Promise<any | IError>;
19
+ createICollectionRow(marker: string, body: any, langCode: string): Promise<Array<any> | IError>;
20
+ updateICollectionRow(marker: string, id: number, body: any, langCode: string): Promise<any | IError>;
21
+ }
22
+ /**
23
+ * ICollection
24
+ */
25
+ interface ICollection {
26
+ id: number;
27
+ identifier: string | null;
28
+ formId: number | null;
29
+ localizeInfos: object;
30
+ attributeSetId: string | null;
31
+ selectedAttributeMarkers: string | null;
32
+ }
33
+ /**
34
+ * ICollectionResponce
35
+ */
36
+ interface ICollectionResponce {
37
+ items: ICollection[];
38
+ total: number;
39
+ }
40
+ /**
41
+ * ICollectionFormData
42
+ */
43
+ interface ICollectionFormData {
44
+ marker: string;
45
+ type: string;
46
+ value: string;
47
+ }
48
+ /**
49
+ * ICollectionFormObject
50
+ */
51
+ interface ICollectionFormObject {
52
+ formIdentifier: string;
53
+ formData: {
54
+ [key: string]: ICollectionFormData[];
55
+ };
56
+ }
57
+ export type { ICollection, ICollectionFormObject, ICollectionResponce, ICollectionsApi, };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
- import AsyncModules from "../base/asyncModules";
2
- import { ILocales, ILocalEntity } from "./localesInterfaces";
3
- import { IError } from "../base/utils";
4
- import StateModule from "../base/stateModule";
1
+ import AsyncModules from '../base/asyncModules';
2
+ import type StateModule from '../base/stateModule';
3
+ import type { IError } from '../base/utils';
4
+ import type { ILocalEntity, ILocales } from './localesInterfaces';
5
5
  /**
6
6
  * Controllers for working with localizations (content language)
7
7
  */
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const asyncModules_1 = require("../base/asyncModules");
6
+ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
4
7
  /**
5
8
  * Controllers for working with localizations (content language)
6
9
  */
@@ -1,4 +1,4 @@
1
- import { IError } from "../base/utils";
1
+ import type { IError } from '../base/utils';
2
2
  /**
3
3
  * Represents an interface object of Locales Api.
4
4
  *
@@ -30,4 +30,4 @@ interface ILocalEntity {
30
30
  image: string | null;
31
31
  position: number;
32
32
  }
33
- export { ILocales, ILocalEntity };
33
+ export type { ILocalEntity, ILocales };
@@ -1,7 +1,7 @@
1
- import AsyncModules from "../base/asyncModules";
2
- import { IMenus, IMenusEntity } from "./menusInterfaces";
3
- import { IError } from "../base/utils";
4
- import StateModule from "../base/stateModule";
1
+ import AsyncModules from '../base/asyncModules';
2
+ import type StateModule from '../base/stateModule';
3
+ import type { IError } from '../base/utils';
4
+ import type { IMenus, IMenusEntity } from './menusInterfaces';
5
5
  /**
6
6
  * Controllers for working with menu objects
7
7
  */
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const asyncModules_1 = require("../base/asyncModules");
6
+ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
4
7
  /**
5
8
  * Controllers for working with menu objects
6
9
  */
@@ -1,4 +1,4 @@
1
- import { IError } from "../base/utils";
1
+ import type { IError, ILocalizeInfo } from '../base/utils';
2
2
  /**
3
3
  * Represents an interface object of Menus Api.
4
4
  *
@@ -15,6 +15,7 @@ interface IMenus {
15
15
  * @property {number} id - The unique identifier of the menu.
16
16
  * @property {string} pageUrl - The page url string.
17
17
  * @property {ILocalizeInfo} localizeInfos - The menu data, taking into account localization.
18
+ * @property {IAttributesSets} attributeValues - Attributes sets
18
19
  * @property {number} position - The menu position.
19
20
  * @property {number | null} parentId - The menu parent id.
20
21
  */
@@ -22,7 +23,8 @@ interface IMenusPages {
22
23
  children?: Array<IMenusPages> | IMenusPages;
23
24
  id: number;
24
25
  pageUrl: string;
25
- localizeInfos: Record<string, any>;
26
+ localizeInfos: ILocalizeInfo;
27
+ attributeValues: any;
26
28
  position: number;
27
29
  parentId: number | null;
28
30
  }
@@ -38,7 +40,7 @@ interface IMenusPages {
38
40
  interface IMenusEntity {
39
41
  id: number;
40
42
  identifier: string;
41
- localizeInfos: Record<string, any>;
43
+ localizeInfos: ILocalizeInfo;
42
44
  pages: Array<IMenusPages> | IMenusPages;
43
45
  }
44
- export { IMenus, IMenusEntity, IMenusPages };
46
+ export type { IMenus, IMenusEntity, IMenusPages };
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
+ // import type { IAttributesSets } from 'attribute-sets/attributeSetsInterfaces';
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
- import AsyncModules from "../base/asyncModules";
2
- import { IOrdersApi, IOrdersEntity, IBaseOrdersEntity, IOrderData, IOrdersByMarkerEntity, IOrderByMarkerEntity } from "./ordersInterfaces";
3
- import StateModule from "../base/stateModule";
4
- import { IError } from "../base/utils";
1
+ import AsyncModules from '../base/asyncModules';
2
+ import type StateModule from '../base/stateModule';
3
+ import type { IError } from '../base/utils';
4
+ import type { IBaseOrdersEntity, IOrderByMarkerEntity, IOrderData, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity } from './ordersInterfaces';
5
5
  /**
6
6
  * Controllers for working with orders
7
7
  */
@@ -44,10 +44,10 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
44
44
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
45
45
  * @param {number} marker - Textual identifier of the order storage object
46
46
  * @param {string} [langCode] Optional language field
47
- * @param {number} [limit] Limit parameter. Default 30
48
47
  * @param {number} [offset] Offset parameter. Default 0
48
+ * @param {number} [limit] Limit parameter. Default 30
49
49
  */
50
- getAllOrdersByMarker(marker: string, langCode?: string, limit?: number, offset?: number): Promise<IOrdersByMarkerEntity | IError>;
50
+ getAllOrdersByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
51
51
  /**
52
52
  * Changing an order in the orders storage
53
53
  *
@@ -90,10 +90,10 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
90
90
  * @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.
91
91
  *
92
92
  * @param {number} [langCode] Optional language field
93
- * @param {number} [limit] - Optional parameter for pagination, default is 0
94
93
  * @param {number} [offset] - Optional parameter for pagination, default is 30
94
+ * @param {number} [limit] - Optional parameter for pagination, default is 0
95
95
  */
96
- getAllOrdersStorage(langCode?: string, limit?: number, offset?: number): Promise<Array<IOrdersEntity> | IError>;
96
+ getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<Array<IOrdersEntity> | IError>;
97
97
  /**
98
98
  * Retrieve one order storage object by marker.
99
99
  *
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const asyncModules_1 = require("../base/asyncModules");
6
+ /* eslint-disable @typescript-eslint/no-explicit-any */
7
+ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
4
8
  /**
5
9
  * Controllers for working with orders
6
10
  */
@@ -39,7 +43,9 @@ class OrdersApi extends asyncModules_1.default {
39
43
  */
40
44
  async createOrder(marker, data, langCode = this.state.lang) {
41
45
  const formData = {};
42
- formData[langCode] = Array.isArray(data.formData) ? data.formData : [data.formData];
46
+ formData[langCode] = Array.isArray(data.formData)
47
+ ? data.formData
48
+ : [data.formData];
43
49
  data.formData = formData;
44
50
  const result = await this._fetchPost(`/marker/${marker}/orders`, data);
45
51
  return this._normalizeData(result);
@@ -50,10 +56,10 @@ class OrdersApi extends asyncModules_1.default {
50
56
  * @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
57
  * @param {number} marker - Textual identifier of the order storage object
52
58
  * @param {string} [langCode] Optional language field
53
- * @param {number} [limit] Limit parameter. Default 30
54
59
  * @param {number} [offset] Offset parameter. Default 0
60
+ * @param {number} [limit] Limit parameter. Default 30
55
61
  */
56
- async getAllOrdersByMarker(marker, langCode = this.state.lang, limit = 30, offset = 0) {
62
+ async getAllOrdersByMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
57
63
  const result = await this._fetchGet(`/marker/${marker}/orders?langCode=${langCode}&limit=${limit}&offset=${offset}`);
58
64
  return this._normalizeData(result);
59
65
  }
@@ -86,7 +92,9 @@ class OrdersApi extends asyncModules_1.default {
86
92
  */
87
93
  async updateOrderByMarkerAndId(marker, id, data, langCode = this.state.lang) {
88
94
  const formData = {};
89
- formData[langCode] = Array.isArray(data.formData) ? data.formData : [data.formData];
95
+ formData[langCode] = Array.isArray(data.formData)
96
+ ? data.formData
97
+ : [data.formData];
90
98
  data.formData = formData;
91
99
  const result = await this._fetchPut(`/marker/${marker}/orders/${id}?langCode=${langCode}`, data);
92
100
  return this._normalizeData(result);
@@ -108,10 +116,10 @@ class OrdersApi extends asyncModules_1.default {
108
116
  * @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.
109
117
  *
110
118
  * @param {number} [langCode] Optional language field
111
- * @param {number} [limit] - Optional parameter for pagination, default is 0
112
119
  * @param {number} [offset] - Optional parameter for pagination, default is 30
120
+ * @param {number} [limit] - Optional parameter for pagination, default is 0
113
121
  */
114
- async getAllOrdersStorage(langCode = this.state.lang, limit = 30, offset = 0) {
122
+ async getAllOrdersStorage(langCode = this.state.lang, offset = 0, limit = 30) {
115
123
  const result = await this._fetchGet(`?langCode=${langCode}&limit=${limit}&offset=${offset}`);
116
124
  return this._normalizeData(result);
117
125
  }