oneentry 1.0.102 → 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.
- package/README.md +798 -426
- package/configure.js +24 -33
- package/dist/admins/adminsApi.d.ts +11 -7
- package/dist/admins/adminsApi.js +17 -5
- package/dist/admins/adminsInterfaces.d.ts +33 -19
- package/dist/attribute-sets/attributeSetsApi.d.ts +35 -10
- package/dist/attribute-sets/attributeSetsApi.js +49 -7
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +42 -11
- package/dist/auth-provider/authProviderApi.d.ts +17 -5
- package/dist/auth-provider/authProviderApi.js +31 -14
- package/dist/auth-provider/authProvidersInterfaces.d.ts +23 -2
- package/dist/base/asyncModules.d.ts +2 -2
- package/dist/base/asyncModules.js +26 -17
- package/dist/base/result.js +26 -12
- package/dist/base/stateModule.d.ts +1 -1
- package/dist/base/stateModule.js +20 -11
- package/dist/base/syncModules.d.ts +4 -4
- package/dist/base/syncModules.js +16 -12
- package/dist/base/utils.d.ts +2 -2
- package/dist/blocks/blocksApi.d.ts +8 -5
- package/dist/blocks/blocksApi.js +30 -8
- package/dist/blocks/blocksInterfaces.d.ts +38 -5
- package/dist/events/eventsApi.d.ts +7 -7
- package/dist/events/eventsApi.js +14 -9
- package/dist/events/eventsInterfaces.d.ts +5 -2
- package/dist/{file-uploding → file-uploading}/fileUploadingApi.d.ts +3 -3
- package/dist/{file-uploding → file-uploading}/fileUploadingApi.js +9 -5
- package/dist/{file-uploding → file-uploading}/fileUploadingInterfaces.d.ts +8 -5
- package/dist/forms/formsApi.d.ts +4 -4
- package/dist/forms/formsApi.js +4 -1
- package/dist/forms/formsInterfaces.d.ts +2 -3
- package/dist/formsData/formsDataApi.d.ts +5 -5
- package/dist/formsData/formsDataApi.js +10 -4
- package/dist/formsData/formsDataInterfaces.d.ts +2 -2
- package/dist/general-types/{typesApi.d.ts → generalTypesApi.d.ts} +4 -4
- package/dist/general-types/{typesApi.js → generalTypesApi.js} +4 -1
- package/dist/general-types/generalTypesInterfaces.d.ts +2 -2
- package/dist/index.d.ts +33 -21
- package/dist/index.js +37 -26
- package/dist/integration-collections/integrationCollectionsApi.d.ts +128 -0
- package/dist/integration-collections/integrationCollectionsApi.js +161 -0
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +57 -0
- package/dist/integration-collections/integrationCollectionsInterfaces.js +2 -0
- package/dist/locales/localesApi.d.ts +4 -4
- package/dist/locales/localesApi.js +4 -1
- package/dist/locales/localesInterfaces.d.ts +2 -2
- package/dist/menus/menusApi.d.ts +4 -4
- package/dist/menus/menusApi.js +4 -1
- package/dist/menus/menusInterfaces.d.ts +6 -4
- package/dist/menus/menusInterfaces.js +1 -0
- package/dist/orders/ordersApi.d.ts +8 -8
- package/dist/orders/ordersApi.js +15 -7
- package/dist/orders/ordersInterfaces.d.ts +13 -3
- package/dist/pages/pagesApi.d.ts +4 -10
- package/dist/pages/pagesApi.js +14 -10
- package/dist/pages/pagesInterfaces.d.ts +13 -22
- package/dist/payments/paymentsApi.d.ts +6 -6
- package/dist/payments/paymentsApi.js +14 -6
- package/dist/payments/paymentsInterfaces.d.ts +20 -5
- package/dist/product-statuses/productStatusesApi.d.ts +3 -3
- package/dist/product-statuses/productStatusesApi.js +4 -1
- package/dist/product-statuses/productStatusesInterfaces.d.ts +2 -5
- package/dist/products/productsApi.d.ts +38 -54
- package/dist/products/productsApi.js +63 -61
- package/dist/products/productsInterfaces.d.ts +50 -38
- package/dist/system/systemApi.d.ts +3 -3
- package/dist/system/systemApi.js +5 -1
- package/dist/system/systemInterfaces.d.ts +1 -1
- package/dist/templates/templatesApi.d.ts +6 -3
- package/dist/templates/templatesApi.js +10 -2
- package/dist/templates/templatesInterfaces.d.ts +2 -2
- package/dist/templates-preview/templatesPreviewApi.d.ts +5 -4
- package/dist/templates-preview/templatesPreviewApi.js +5 -1
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +21 -10
- package/dist/users/usersApi.d.ts +15 -4
- package/dist/users/usersApi.js +29 -2
- package/dist/users/usersInterfaces.d.ts +10 -4
- package/dist/web-socket/wsApi.d.ts +4 -4
- package/dist/web-socket/wsApi.js +15 -14
- package/dist/web-socket/wsInterfaces.d.ts +2 -2
- package/package.json +45 -9
- /package/dist/{file-uploding → file-uploading}/fileUploadingInterfaces.js +0 -0
package/dist/blocks/blocksApi.js
CHANGED
|
@@ -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
|
-
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
+
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
4
8
|
/**
|
|
5
9
|
* Controllers for working with blocks
|
|
6
10
|
*/
|
|
@@ -25,9 +29,12 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
25
29
|
const normalizeResponse = this._normalizeData(response);
|
|
26
30
|
await Promise.all(normalizeResponse.items.map(async (block) => {
|
|
27
31
|
const customSettings = block.customSettings;
|
|
28
|
-
if (customSettings &&
|
|
32
|
+
if (customSettings &&
|
|
33
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
34
|
+
customSettings.hasOwnProperty('productConfig')) {
|
|
29
35
|
if (customSettings.productConfig.countElementsPerRow)
|
|
30
|
-
block.countElementsPerRow =
|
|
36
|
+
block.countElementsPerRow =
|
|
37
|
+
+customSettings.productConfig.countElementsPerRow;
|
|
31
38
|
if (customSettings.productConfig.quantity)
|
|
32
39
|
block.quantity = +customSettings.productConfig.quantity;
|
|
33
40
|
}
|
|
@@ -73,9 +80,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
73
80
|
const response = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
74
81
|
const normalizeResponse = this._normalizeData(response);
|
|
75
82
|
const customSettings = normalizeResponse.customSettings;
|
|
83
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
76
84
|
if (customSettings && customSettings.hasOwnProperty('productConfig')) {
|
|
77
85
|
if (customSettings.productConfig.countElementsPerRow)
|
|
78
|
-
normalizeResponse.countElementsPerRow =
|
|
86
|
+
normalizeResponse.countElementsPerRow =
|
|
87
|
+
+customSettings.productConfig.countElementsPerRow;
|
|
79
88
|
if (customSettings.productConfig.quantity)
|
|
80
89
|
normalizeResponse.quantity = +customSettings.productConfig.quantity;
|
|
81
90
|
}
|
|
@@ -114,11 +123,16 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
114
123
|
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
115
124
|
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
116
125
|
*
|
|
117
|
-
* @returns Return array of BlocksEntity object.
|
|
126
|
+
* @returns Return IProductsResponse with total and items array of BlocksEntity object.
|
|
118
127
|
*/
|
|
119
128
|
async getSimilarProducts(marker, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
120
|
-
const
|
|
121
|
-
|
|
129
|
+
const query = {
|
|
130
|
+
langCode,
|
|
131
|
+
offset,
|
|
132
|
+
limit,
|
|
133
|
+
};
|
|
134
|
+
const result = await this._fetchGet(`/${marker}/similar-products?` + this._queryParamsToString(query));
|
|
135
|
+
return this._normalizeData(result);
|
|
122
136
|
}
|
|
123
137
|
/**
|
|
124
138
|
* Get products by block marker.
|
|
@@ -131,13 +145,21 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
131
145
|
* @returns Return array of BlocksEntity object.
|
|
132
146
|
*/
|
|
133
147
|
async getProductsByBlockMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
134
|
-
const
|
|
148
|
+
const query = {
|
|
149
|
+
langCode,
|
|
150
|
+
offset,
|
|
151
|
+
limit,
|
|
152
|
+
};
|
|
153
|
+
const result = await this._fetchGet(`/${marker}/products?` + this._queryParamsToString(query));
|
|
135
154
|
return this._normalizeData(result.items);
|
|
136
155
|
}
|
|
137
156
|
/**
|
|
138
157
|
* Quick search for block objects with limited output
|
|
158
|
+
*
|
|
139
159
|
* @param name - Search string
|
|
140
160
|
* @param [langCode] - Language code. Default "en_US"
|
|
161
|
+
*
|
|
162
|
+
* @returns Return array of BlocksEntity object.
|
|
141
163
|
*/
|
|
142
164
|
async searchBlock(name, langCode = this.state.lang) {
|
|
143
165
|
const result = await this._fetchGet(`/quick/search?langCode=${langCode}&name=${name}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AttributeType, IError } from
|
|
2
|
-
import { IProductsEntity } from
|
|
1
|
+
import type { AttributeType, IError, ILocalizeInfo } from '../base/utils';
|
|
2
|
+
import type { IProductsEntity, IProductsResponse } from '../products/productsInterfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a interface object of Blocks Api.
|
|
5
5
|
*
|
|
@@ -14,29 +14,62 @@ interface IBlocks {
|
|
|
14
14
|
getBlockByMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IBlockEntity | IError>;
|
|
15
15
|
searchBlock(name: string, langCode?: string): Promise<Array<ISearchBlock> | IError>;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* IBlocksResponse
|
|
19
|
+
*
|
|
20
|
+
* @property {number} total -
|
|
21
|
+
* @property {Array<IBlockEntity>} items -
|
|
22
|
+
*/
|
|
17
23
|
interface IBlocksResponse {
|
|
18
24
|
total: number;
|
|
19
25
|
items: Array<IBlockEntity>;
|
|
20
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* IBlockEntity
|
|
29
|
+
*
|
|
30
|
+
* @property {AttributeType} attributeValues -
|
|
31
|
+
* @property {number} id -
|
|
32
|
+
* @property {string} identifier -
|
|
33
|
+
* @property {boolean} isVisible -
|
|
34
|
+
* @property {ILocalizeInfo} localizeInfos -
|
|
35
|
+
* @property {number} position -
|
|
36
|
+
* @property {string | null} templateIdentifier -
|
|
37
|
+
* @property {string} type -
|
|
38
|
+
* @property {number} version -
|
|
39
|
+
* @property {number} countElementsPerRow -
|
|
40
|
+
* @property {number} quantity -
|
|
41
|
+
* @property {IProductsResponse} similarProducts -
|
|
42
|
+
* @property {Array<IProductsEntity>} products -
|
|
43
|
+
*/
|
|
21
44
|
interface IBlockEntity {
|
|
22
45
|
attributeValues: AttributeType;
|
|
23
46
|
id: number;
|
|
24
47
|
identifier: string;
|
|
25
48
|
isVisible: boolean;
|
|
26
|
-
localizeInfos:
|
|
49
|
+
localizeInfos: ILocalizeInfo;
|
|
27
50
|
position: number;
|
|
28
51
|
templateIdentifier: string | null;
|
|
29
52
|
type: string;
|
|
30
53
|
version: number;
|
|
31
54
|
countElementsPerRow?: number;
|
|
32
55
|
quantity?: number;
|
|
33
|
-
similarProducts?:
|
|
56
|
+
similarProducts?: IProductsResponse;
|
|
34
57
|
products?: Array<IProductsEntity>;
|
|
35
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* ISearchBlock
|
|
61
|
+
*
|
|
62
|
+
* @property {number} id -
|
|
63
|
+
* @property {string} name -
|
|
64
|
+
* @property {string} identifier -
|
|
65
|
+
*/
|
|
36
66
|
interface ISearchBlock {
|
|
37
67
|
id: number;
|
|
38
68
|
name: string;
|
|
39
69
|
identifier: string;
|
|
40
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* BlockType
|
|
73
|
+
*/
|
|
41
74
|
type BlockType = 'forCatalogProducts' | 'forBasketPage' | 'forErrorPage' | 'forCatalogPages' | 'forProductPreview' | 'forProductPage' | 'forSimilarProductBlock' | 'forStatisticProductBlock' | 'forProductBlock' | 'forForm' | 'forFormField' | 'forNewsPage' | 'forNewsBlock' | 'forNewsPreview' | 'forOneNewsPage' | 'forUsualPage' | 'forTextBlock' | 'forSlider' | 'forOrder' | 'service' | 'none';
|
|
42
|
-
export {
|
|
75
|
+
export type { BlockType, IBlockEntity, IBlocks, IBlocksResponse, ISearchBlock };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import AsyncModules from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { ISubscriptions } from
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { IEvents } from './eventsInterfaces';
|
|
5
|
+
import type { ISubscriptions } from './eventsInterfaces';
|
|
6
6
|
/**
|
|
7
7
|
* Controllers for working with events
|
|
8
8
|
*/
|
|
@@ -13,10 +13,10 @@ export default class EventsApi extends AsyncModules implements IEvents {
|
|
|
13
13
|
/**
|
|
14
14
|
* Return all subscriptions to product.
|
|
15
15
|
*
|
|
16
|
+
* @param {number} offset -
|
|
16
17
|
* @param {number} limit - Event marker.
|
|
17
|
-
* @param {number} offset - Language code.
|
|
18
18
|
*/
|
|
19
|
-
getAllSubscriptions(
|
|
19
|
+
getAllSubscriptions(offset?: number, limit?: number): Promise<ISubscriptions | IError>;
|
|
20
20
|
/**
|
|
21
21
|
* Subscribing to an event on a product.
|
|
22
22
|
*
|
package/dist/events/eventsApi.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
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
|
-
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
4
9
|
/**
|
|
5
10
|
* Controllers for working with events
|
|
6
11
|
*/
|
|
@@ -12,10 +17,10 @@ class EventsApi extends asyncModules_1.default {
|
|
|
12
17
|
/**
|
|
13
18
|
* Return all subscriptions to product.
|
|
14
19
|
*
|
|
20
|
+
* @param {number} offset -
|
|
15
21
|
* @param {number} limit - Event marker.
|
|
16
|
-
* @param {number} offset - Language code.
|
|
17
22
|
*/
|
|
18
|
-
async getAllSubscriptions(
|
|
23
|
+
async getAllSubscriptions(offset = 0, limit = 30) {
|
|
19
24
|
const result = await this._fetchGet(`/subscriptions`);
|
|
20
25
|
return result;
|
|
21
26
|
}
|
|
@@ -28,10 +33,10 @@ class EventsApi extends asyncModules_1.default {
|
|
|
28
33
|
* @param {string} productId - Product id.
|
|
29
34
|
* @param {number} [threshold] - Threshold value for comparing numerical value.
|
|
30
35
|
*/
|
|
31
|
-
async subscribeByMarker(marker, productId, langCode = this.state.lang, threshold =
|
|
36
|
+
async subscribeByMarker(marker, productId, langCode = this.state.lang, threshold = 0) {
|
|
32
37
|
const data = {
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
locale: langCode,
|
|
39
|
+
productId: productId,
|
|
35
40
|
};
|
|
36
41
|
if (threshold) {
|
|
37
42
|
data.threshold = threshold;
|
|
@@ -48,10 +53,10 @@ class EventsApi extends asyncModules_1.default {
|
|
|
48
53
|
* @param {string} productId - Product id.
|
|
49
54
|
* @param {number} [threshold] - Threshold value for comparing numerical value.
|
|
50
55
|
*/
|
|
51
|
-
async unsubscribeByMarker(marker, productId, langCode = this.state.lang, threshold =
|
|
56
|
+
async unsubscribeByMarker(marker, productId, langCode = this.state.lang, threshold = 0) {
|
|
52
57
|
const data = {
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
locale: langCode,
|
|
59
|
+
productId: productId,
|
|
55
60
|
};
|
|
56
61
|
if (threshold) {
|
|
57
62
|
data.threshold = threshold;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IError } from
|
|
1
|
+
import type { IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents a interface object of Events Api.
|
|
4
4
|
*
|
|
@@ -11,6 +11,9 @@ interface IEvents {
|
|
|
11
11
|
subscribeByMarker(marker: string, productId: number, langCode?: string, threshold?: number): Promise<any | IError>;
|
|
12
12
|
unsubscribeByMarker(marker: string, productId: number, langCode?: string, threshold?: number): Promise<any | IError>;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* ISubscriptions
|
|
16
|
+
*/
|
|
14
17
|
interface ISubscriptions {
|
|
15
18
|
total: number;
|
|
16
19
|
items: Array<{
|
|
@@ -18,4 +21,4 @@ interface ISubscriptions {
|
|
|
18
21
|
productId: number;
|
|
19
22
|
}>;
|
|
20
23
|
}
|
|
21
|
-
export { IEvents, ISubscriptions };
|
|
24
|
+
export type { IEvents, ISubscriptions };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import AsyncModules from '../base/asyncModules';
|
|
2
|
-
import
|
|
3
|
-
import { IError } from
|
|
4
|
-
import
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { IFileUploading, IUploadingQuery, IUploadingReturns } from './fileUploadingInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with file uploading
|
|
7
7
|
*/
|
|
@@ -1,6 +1,11 @@
|
|
|
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
|
-
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
+
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
8
|
+
// import { IFileEntity } from './fileUploadingInterfaces';
|
|
4
9
|
/**
|
|
5
10
|
* Controllers for working with file uploading
|
|
6
11
|
*/
|
|
@@ -68,14 +73,13 @@ class FileUploadingApi extends asyncModules_1.default {
|
|
|
68
73
|
* @returns Return file as File object
|
|
69
74
|
*/
|
|
70
75
|
async getFile(id, type, entity, filename) {
|
|
71
|
-
const
|
|
76
|
+
const response = await fetch(this._getFullPath(`?id=${id}&type=${type}&entity=${entity}${filename ? `&filename=${filename}` : ''}`), {
|
|
72
77
|
method: 'GET',
|
|
73
78
|
headers: {
|
|
74
79
|
'Content-Type': 'application/json',
|
|
75
80
|
'x-app-token': this.state.token,
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const response = await fetch(this._getFullPath(`?id=${id}&type=${type}&entity=${entity}${filename ? `&filename=${filename}` : ''}`), options);
|
|
81
|
+
},
|
|
82
|
+
});
|
|
79
83
|
return response.blob();
|
|
80
84
|
}
|
|
81
85
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IError } from
|
|
1
|
+
import type { IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents a interface object of File Uploading Api.
|
|
4
4
|
*
|
|
@@ -11,6 +11,9 @@ interface IFileUploading {
|
|
|
11
11
|
delete(filename: string, fileQuery?: IUploadingQuery): Promise<any | IError>;
|
|
12
12
|
getFile(id: number, type: string, entity: string, filename?: string): Promise<Blob | IError>;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* IFileEntity
|
|
16
|
+
*/
|
|
14
17
|
interface IFileEntity {
|
|
15
18
|
file: File | string | null;
|
|
16
19
|
}
|
|
@@ -27,9 +30,9 @@ interface IUploadingQuery {
|
|
|
27
30
|
type: string | null;
|
|
28
31
|
entity: string | null;
|
|
29
32
|
id: number | null;
|
|
30
|
-
width
|
|
31
|
-
height
|
|
32
|
-
compress
|
|
33
|
+
width: number | null;
|
|
34
|
+
height: string | null;
|
|
35
|
+
compress: boolean | null;
|
|
33
36
|
[key: string]: string | number | boolean | null;
|
|
34
37
|
}
|
|
35
38
|
/**
|
|
@@ -43,4 +46,4 @@ interface IUploadingReturns {
|
|
|
43
46
|
downloadLink: string;
|
|
44
47
|
size: number;
|
|
45
48
|
}
|
|
46
|
-
export {
|
|
49
|
+
export type { IFileEntity, IFileUploading, IUploadingQuery, IUploadingReturns };
|
package/dist/forms/formsApi.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import AsyncModules from
|
|
2
|
-
import
|
|
3
|
-
import { IError } from
|
|
4
|
-
import
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { IForms, IFormsEntity } from './formsInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for forms objects
|
|
7
7
|
*/
|
package/dist/forms/formsApi.js
CHANGED
|
@@ -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 forms objects
|
|
6
9
|
*/
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { IAttributes, IError } from
|
|
1
|
+
import type { IAttributes, IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of Forms Api.
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getAllForms - Get all forms in array.
|
|
6
|
-
*
|
|
7
6
|
* @property {function} getFormByMarker - Get one form by form marker.
|
|
8
7
|
*/
|
|
9
8
|
interface IForms {
|
|
@@ -37,4 +36,4 @@ interface IFormsEntity {
|
|
|
37
36
|
processingType: string;
|
|
38
37
|
version: number;
|
|
39
38
|
}
|
|
40
|
-
export { IForms, IFormsEntity };
|
|
39
|
+
export type { IForms, IFormsEntity };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import AsyncModules from '../base/asyncModules';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { IFormDataEntity, IFormsData, IFormsDataEntity, IFormsPost } from './formsDataInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with form data
|
|
7
7
|
*/
|
|
@@ -22,7 +22,7 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
|
|
|
22
22
|
/**
|
|
23
23
|
* Find all product page objects with pagination and multiple filtering.
|
|
24
24
|
*
|
|
25
|
-
* @param {object} data - Request body.
|
|
25
|
+
* @param {object} [data] - Request body.
|
|
26
26
|
* @param {string} [langCode] - Optional language field
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
@@ -41,7 +41,7 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
|
|
|
41
41
|
/**
|
|
42
42
|
* Get one object of form data by marker.
|
|
43
43
|
*
|
|
44
|
-
* @param {string} marker - Marker of the form data
|
|
44
|
+
* @param {string} [marker] - Marker of the form data
|
|
45
45
|
* @param {string} [langCode] - Language code. Default "en_US"
|
|
46
46
|
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
47
47
|
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
@@ -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
|
-
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
+
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
4
8
|
/**
|
|
5
9
|
* Controllers for working with form data
|
|
6
10
|
*/
|
|
@@ -25,7 +29,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
25
29
|
/**
|
|
26
30
|
* Find all product page objects with pagination and multiple filtering.
|
|
27
31
|
*
|
|
28
|
-
* @param {object} data - Request body.
|
|
32
|
+
* @param {object} [data] - Request body.
|
|
29
33
|
* @param {string} [langCode] - Optional language field
|
|
30
34
|
*
|
|
31
35
|
* @example
|
|
@@ -42,7 +46,9 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
42
46
|
*/
|
|
43
47
|
async postFormsData(data, langCode = this.state.lang) {
|
|
44
48
|
const formData = {};
|
|
45
|
-
formData[langCode] = Array.isArray(data.formData)
|
|
49
|
+
formData[langCode] = Array.isArray(data.formData)
|
|
50
|
+
? data.formData
|
|
51
|
+
: [data.formData];
|
|
46
52
|
data.formData = formData;
|
|
47
53
|
const result = await this._fetchPost(``, data);
|
|
48
54
|
return this._dataPostProcess(result);
|
|
@@ -50,7 +56,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
50
56
|
/**
|
|
51
57
|
* Get one object of form data by marker.
|
|
52
58
|
*
|
|
53
|
-
* @param {string} marker - Marker of the form data
|
|
59
|
+
* @param {string} [marker] - Marker of the form data
|
|
54
60
|
* @param {string} [langCode] - Language code. Default "en_US"
|
|
55
61
|
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
56
62
|
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IError } from
|
|
1
|
+
import type { IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents a interface object of Forms Api.
|
|
4
4
|
*
|
|
@@ -173,4 +173,4 @@ interface IBodyTypeRadioButtonList {
|
|
|
173
173
|
};
|
|
174
174
|
}>;
|
|
175
175
|
}
|
|
176
|
-
export {
|
|
176
|
+
export type { FormDataType, IBodyTypeFile, IBodyTypeImageGroupOfImages, IBodyTypeRadioButtonList, IBodyTypeStringNumberFloat, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeTimeDate, IFormDataEntity, IFormsData, IFormsDataEntity, IFormsPost, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import AsyncModules from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { IGeneralTypes, IGeneralTypesEntity } from './generalTypesInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with types
|
|
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 types
|
|
6
9
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IError, Types } from
|
|
1
|
+
import type { IError, Types } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of General Type Api.
|
|
4
4
|
*
|
|
@@ -18,4 +18,4 @@ interface IGeneralTypesEntity {
|
|
|
18
18
|
id: number;
|
|
19
19
|
type: Types;
|
|
20
20
|
}
|
|
21
|
-
export { IGeneralTypes, IGeneralTypesEntity };
|
|
21
|
+
export type { IGeneralTypes, IGeneralTypesEntity };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OneEntry SDK
|
|
3
|
+
*/
|
|
4
|
+
import AdminsApi from './admins/adminsApi';
|
|
5
|
+
import AttributesSetsApi from './attribute-sets/attributeSetsApi';
|
|
6
|
+
import AuthProviderApi from './auth-provider/authProviderApi';
|
|
7
|
+
import type { IConfig } from './base/utils';
|
|
8
|
+
import BlocksApi from './blocks/blocksApi';
|
|
9
|
+
import EventsApi from './events/eventsApi';
|
|
10
|
+
import FileUploadingApi from './file-uploading/fileUploadingApi';
|
|
11
|
+
import FormsApi from './forms/formsApi';
|
|
12
|
+
import FormsDataApi from './formsData/formsDataApi';
|
|
13
|
+
import GeneralTypesApi from './general-types/generalTypesApi';
|
|
14
|
+
import IntegrationCollectionsApi from './integration-collections/integrationCollectionsApi';
|
|
15
|
+
import LocalesApi from './locales/localesApi';
|
|
16
|
+
import MenusApi from './menus/menusApi';
|
|
17
|
+
import OrdersApi from './orders/ordersApi';
|
|
18
|
+
import PageApi from './pages/pagesApi';
|
|
19
|
+
import PaymentsApi from './payments/paymentsApi';
|
|
20
|
+
import ProductStatusesApi from './product-statuses/productStatusesApi';
|
|
1
21
|
import ProductApi from './products/productsApi';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import FormsDataApi from "./formsData/formsDataApi";
|
|
12
|
-
import FileUploadingApi from "./file-uploding/fileUploadingApi";
|
|
13
|
-
import SystemApi from "./system/systemApi";
|
|
14
|
-
import BlocksApi from "./blocks/blocksApi";
|
|
15
|
-
import AttributesSetsApi from "./attribute-sets/attributeSetsApi";
|
|
16
|
-
import { IConfig } from "./base/utils";
|
|
17
|
-
import OrdersApi from "./orders/ordersApi";
|
|
18
|
-
import PaymentsApi from "./payments/paymentsApi";
|
|
19
|
-
import AuthProviderApi from "./auth-provider/authProviderApi";
|
|
20
|
-
import EventsApi from "./events/eventsApi";
|
|
21
|
-
import UsersApi from "./users/usersApi";
|
|
22
|
-
import WsApi from "./web-socket/wsApi";
|
|
22
|
+
import SystemApi from './system/systemApi';
|
|
23
|
+
import TemplatesApi from './templates/templatesApi';
|
|
24
|
+
import TemplatePreviewsApi from './templates-preview/templatesPreviewApi';
|
|
25
|
+
import UsersApi from './users/usersApi';
|
|
26
|
+
import WsApi from './web-socket/wsApi';
|
|
27
|
+
/**
|
|
28
|
+
* IDefineApi interface
|
|
29
|
+
* @interface
|
|
30
|
+
*/
|
|
23
31
|
interface IDefineApi {
|
|
24
32
|
Admins: AdminsApi;
|
|
25
33
|
AttributesSets: AttributesSetsApi;
|
|
@@ -30,6 +38,7 @@ interface IDefineApi {
|
|
|
30
38
|
Forms: FormsApi;
|
|
31
39
|
FormData: FormsDataApi;
|
|
32
40
|
GeneralTypes: GeneralTypesApi;
|
|
41
|
+
IntegrationCollections: IntegrationCollectionsApi;
|
|
33
42
|
Locales: LocalesApi;
|
|
34
43
|
Menus: MenusApi;
|
|
35
44
|
Orders: OrdersApi;
|
|
@@ -45,6 +54,8 @@ interface IDefineApi {
|
|
|
45
54
|
}
|
|
46
55
|
/**
|
|
47
56
|
* Define API.
|
|
57
|
+
*
|
|
58
|
+
* @function
|
|
48
59
|
* @param {string} url - URl of your project.
|
|
49
60
|
* @param {IConfig} config - Custom configuration settings
|
|
50
61
|
* @param {string} [config.token] - Optional token parameter
|
|
@@ -54,6 +65,7 @@ interface IDefineApi {
|
|
|
54
65
|
* @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.
|
|
55
66
|
* @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.
|
|
56
67
|
* @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.
|
|
68
|
+
*
|
|
57
69
|
* @returns {IDefineApi} - List of methods set.
|
|
58
70
|
*/
|
|
59
71
|
export declare function defineOneEntry(url: string, config: IConfig): IDefineApi;
|