oneentry 1.0.102 → 1.0.105
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 +1322 -506
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IError } from
|
|
1
|
+
import type { IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of Orders Api.
|
|
4
4
|
*
|
|
@@ -42,6 +42,9 @@ interface IPicture {
|
|
|
42
42
|
size: number;
|
|
43
43
|
previewLink: string;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* IOrderProducts
|
|
47
|
+
*/
|
|
45
48
|
interface IOrderProducts {
|
|
46
49
|
id: number;
|
|
47
50
|
title: string;
|
|
@@ -85,13 +88,17 @@ interface IOrderProductData {
|
|
|
85
88
|
interface IBaseOrdersEntity {
|
|
86
89
|
formIdentifier: string;
|
|
87
90
|
paymentAccountIdentifier: string;
|
|
88
|
-
statusIdentifier: string;
|
|
89
91
|
formData: Array<IOrdersFormData>;
|
|
90
92
|
products: Array<IOrderProductData>;
|
|
91
93
|
createdDate: string;
|
|
92
94
|
totalSum: string;
|
|
93
95
|
currency: string;
|
|
94
96
|
id: number;
|
|
97
|
+
statusIdentifier?: string;
|
|
98
|
+
}
|
|
99
|
+
interface IBaseOrdersEntityResponse {
|
|
100
|
+
items: Array<IBaseOrdersEntity>;
|
|
101
|
+
total: string | number;
|
|
95
102
|
}
|
|
96
103
|
/**
|
|
97
104
|
* @interface
|
|
@@ -112,6 +119,9 @@ interface IOrdersEntity {
|
|
|
112
119
|
paymentAccountIdentifiers: Array<IPaymentAccountIdentifiers>;
|
|
113
120
|
position: number | null;
|
|
114
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* IPaymentAccountIdentifiers
|
|
124
|
+
*/
|
|
115
125
|
interface IPaymentAccountIdentifiers {
|
|
116
126
|
identifier: string;
|
|
117
127
|
}
|
|
@@ -155,4 +165,4 @@ interface IOrderByMarkerEntity {
|
|
|
155
165
|
isHistory: boolean;
|
|
156
166
|
id: number;
|
|
157
167
|
}
|
|
158
|
-
export {
|
|
168
|
+
export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, IOrderByMarkerEntity, IOrderData, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IPaymentAccountIdentifiers, IPicture, };
|
package/dist/pages/pagesApi.d.ts
CHANGED
|
@@ -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 { IPageApi, IPageConfig, IPagesEntity, IPositionBlock, IPositionForm } from './pagesInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with page objects, including catalog pages
|
|
7
7
|
*/
|
|
@@ -29,7 +29,6 @@ export default class PageApi extends AsyncModules implements IPageApi {
|
|
|
29
29
|
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
30
30
|
*
|
|
31
31
|
* @param {string} [langCode] Required parameter lang code
|
|
32
|
-
*
|
|
33
32
|
* @param {number} [id] - Page object identifier
|
|
34
33
|
*
|
|
35
34
|
* @returns Returns PageEntity object
|
|
@@ -39,7 +38,6 @@ export default class PageApi extends AsyncModules implements IPageApi {
|
|
|
39
38
|
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
40
39
|
*
|
|
41
40
|
* @param {string} [langCode] Required parameter lang code
|
|
42
|
-
*
|
|
43
41
|
* @param {string} [url] - Page URL
|
|
44
42
|
*
|
|
45
43
|
* @returns Returns PageEntity object
|
|
@@ -49,7 +47,6 @@ export default class PageApi extends AsyncModules implements IPageApi {
|
|
|
49
47
|
* Get child pages object with information as an array.
|
|
50
48
|
*
|
|
51
49
|
* @param {string} [langCode] Required parameter lang code
|
|
52
|
-
*
|
|
53
50
|
* @param {string} [url] - Page URL
|
|
54
51
|
*
|
|
55
52
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
@@ -59,7 +56,6 @@ export default class PageApi extends AsyncModules implements IPageApi {
|
|
|
59
56
|
* Get all forms by page url.
|
|
60
57
|
*
|
|
61
58
|
* @param {string} [langCode] Required parameter lang code
|
|
62
|
-
*
|
|
63
59
|
* @param {string} [url] - Page URL
|
|
64
60
|
*
|
|
65
61
|
* @returns Returns all forms as an array of PositionForm objects or an empty array [] (if there is no data) for the selected parent
|
|
@@ -69,7 +65,6 @@ export default class PageApi extends AsyncModules implements IPageApi {
|
|
|
69
65
|
* Get all blocks by page url.
|
|
70
66
|
*
|
|
71
67
|
* @param {string} [langCode] Required parameter lang code
|
|
72
|
-
*
|
|
73
68
|
* @param {string} [url] - Page URL
|
|
74
69
|
*
|
|
75
70
|
* @returns Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
@@ -87,7 +82,6 @@ export default class PageApi extends AsyncModules implements IPageApi {
|
|
|
87
82
|
* Quick search for page objects with limited output.
|
|
88
83
|
*
|
|
89
84
|
* @param {string} [name] - Text for searching page objects (search is performed on the title field of the localizeInfos object with the language taken into account)
|
|
90
|
-
*
|
|
91
85
|
* @param {string} [langCode] Required parameter lang code
|
|
92
86
|
*
|
|
93
87
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
package/dist/pages/pagesApi.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 page objects, including catalog pages
|
|
6
10
|
*/
|
|
@@ -35,7 +39,6 @@ class PageApi extends asyncModules_1.default {
|
|
|
35
39
|
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
36
40
|
*
|
|
37
41
|
* @param {string} [langCode] Required parameter lang code
|
|
38
|
-
*
|
|
39
42
|
* @param {number} [id] - Page object identifier
|
|
40
43
|
*
|
|
41
44
|
* @returns Returns PageEntity object
|
|
@@ -48,7 +51,6 @@ class PageApi extends asyncModules_1.default {
|
|
|
48
51
|
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
49
52
|
*
|
|
50
53
|
* @param {string} [langCode] Required parameter lang code
|
|
51
|
-
*
|
|
52
54
|
* @param {string} [url] - Page URL
|
|
53
55
|
*
|
|
54
56
|
* @returns Returns PageEntity object
|
|
@@ -61,7 +63,6 @@ class PageApi extends asyncModules_1.default {
|
|
|
61
63
|
* Get child pages object with information as an array.
|
|
62
64
|
*
|
|
63
65
|
* @param {string} [langCode] Required parameter lang code
|
|
64
|
-
*
|
|
65
66
|
* @param {string} [url] - Page URL
|
|
66
67
|
*
|
|
67
68
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
@@ -74,7 +75,6 @@ class PageApi extends asyncModules_1.default {
|
|
|
74
75
|
* Get all forms by page url.
|
|
75
76
|
*
|
|
76
77
|
* @param {string} [langCode] Required parameter lang code
|
|
77
|
-
*
|
|
78
78
|
* @param {string} [url] - Page URL
|
|
79
79
|
*
|
|
80
80
|
* @returns Returns all forms as an array of PositionForm objects or an empty array [] (if there is no data) for the selected parent
|
|
@@ -87,7 +87,6 @@ class PageApi extends asyncModules_1.default {
|
|
|
87
87
|
* Get all blocks by page url.
|
|
88
88
|
*
|
|
89
89
|
* @param {string} [langCode] Required parameter lang code
|
|
90
|
-
*
|
|
91
90
|
* @param {string} [url] - Page URL
|
|
92
91
|
*
|
|
93
92
|
* @returns Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
@@ -97,9 +96,11 @@ class PageApi extends asyncModules_1.default {
|
|
|
97
96
|
const normalizeResponse = this._normalizeData(response);
|
|
98
97
|
normalizeResponse.map((item) => {
|
|
99
98
|
const customSettings = item.customSettings;
|
|
99
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
100
100
|
if (customSettings && customSettings.hasOwnProperty('productConfig')) {
|
|
101
101
|
if (customSettings.productConfig.countElementsPerRow)
|
|
102
|
-
item.countElementsPerRow =
|
|
102
|
+
item.countElementsPerRow =
|
|
103
|
+
+customSettings.productConfig.countElementsPerRow;
|
|
103
104
|
if (customSettings.productConfig.quantity)
|
|
104
105
|
item.quantity = +customSettings.productConfig.quantity;
|
|
105
106
|
}
|
|
@@ -125,7 +126,9 @@ class PageApi extends asyncModules_1.default {
|
|
|
125
126
|
const staffModule = new StaffModule(this.state);
|
|
126
127
|
if (normalizeResponse.type === 'forSimilarProductBlock') {
|
|
127
128
|
try {
|
|
128
|
-
await staffModule
|
|
129
|
+
await staffModule
|
|
130
|
+
.getSimilarProducts(normalizeResponse.identifier, langCode)
|
|
131
|
+
.then((result) => {
|
|
129
132
|
normalizeResponse.similarProducts = this._normalizeData(result);
|
|
130
133
|
});
|
|
131
134
|
}
|
|
@@ -135,7 +138,9 @@ class PageApi extends asyncModules_1.default {
|
|
|
135
138
|
}
|
|
136
139
|
else if (normalizeResponse.type === 'forProductBlock') {
|
|
137
140
|
try {
|
|
138
|
-
await staffModule
|
|
141
|
+
await staffModule
|
|
142
|
+
.getProductsByBlockMarker(normalizeResponse.identifier, langCode)
|
|
143
|
+
.then((result) => {
|
|
139
144
|
normalizeResponse.products = this._normalizeData(result);
|
|
140
145
|
});
|
|
141
146
|
}
|
|
@@ -161,7 +166,6 @@ class PageApi extends asyncModules_1.default {
|
|
|
161
166
|
* Quick search for page objects with limited output.
|
|
162
167
|
*
|
|
163
168
|
* @param {string} [name] - Text for searching page objects (search is performed on the title field of the localizeInfos object with the language taken into account)
|
|
164
|
-
*
|
|
165
169
|
* @param {string} [langCode] Required parameter lang code
|
|
166
170
|
*
|
|
167
171
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
@@ -1,47 +1,38 @@
|
|
|
1
|
-
import { AttributeType, IAttributes, IError, LangType, Types } from
|
|
1
|
+
import type { AttributeType, IAttributes, IError, LangType, Types } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of Pages Api.
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getRootPages - Get all top-level page objects.
|
|
6
|
-
*
|
|
7
6
|
* @property {function} getCatalogPages - Get all page objects with product information as an array.
|
|
8
|
-
*
|
|
9
7
|
* @property {function} getPages - Get all page objects with product information as an array.
|
|
10
|
-
*
|
|
11
8
|
* @property {function} getPageById - Get page object with information about forms, blocks, menus, linked to the page.
|
|
12
|
-
*
|
|
13
9
|
* @property {function} getPageByUrl - Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
14
|
-
*
|
|
15
10
|
* @property {function} getChildPagesByParentUrl - Get child pages object with information as an array.
|
|
16
|
-
*
|
|
17
11
|
* @property {function} getFormsByPageUrl - Get all forms by page url.
|
|
18
|
-
*
|
|
19
12
|
* @property {function} getConfigPageByUrl - Get settings for the page.
|
|
20
|
-
*
|
|
21
13
|
* @property {function} searchPage - Quick search for page objects with limited output.
|
|
22
14
|
*/
|
|
23
15
|
interface IPageApi {
|
|
24
16
|
getRootPages(langCode?: LangType): Promise<Array<IPagesEntity> | IError>;
|
|
25
|
-
getPages(langCode
|
|
26
|
-
getPageById(id: number, langCode
|
|
27
|
-
getPageByUrl(url: string, langCode
|
|
28
|
-
getChildPagesByParentUrl(url: string, langCode
|
|
29
|
-
getFormsByPageUrl(url: string, langCode
|
|
30
|
-
getBlocksByPageUrl(url: string, langCode
|
|
17
|
+
getPages(langCode?: LangType): Promise<Array<IPagesEntity> | IError>;
|
|
18
|
+
getPageById(id: number, langCode?: LangType): Promise<IPagesEntity | IError>;
|
|
19
|
+
getPageByUrl(url: string, langCode?: LangType): Promise<IPagesEntity | IError>;
|
|
20
|
+
getChildPagesByParentUrl(url: string, langCode?: LangType): Promise<Array<IPagesEntity> | IError>;
|
|
21
|
+
getFormsByPageUrl(url: string, langCode?: LangType): Promise<Array<IPositionForm> | IError>;
|
|
22
|
+
getBlocksByPageUrl(url: string, langCode?: LangType): Promise<Array<IPositionBlock> | IError>;
|
|
31
23
|
getConfigPageByUrl(url: string): Promise<IPageConfig | IError>;
|
|
32
|
-
searchPage(name: string, langCode
|
|
24
|
+
searchPage(name: string, langCode?: LangType): Promise<Array<IPagesEntity> | IError>;
|
|
33
25
|
}
|
|
34
26
|
/**
|
|
35
27
|
* Represents a config object.
|
|
36
28
|
*
|
|
37
29
|
* @interface
|
|
38
30
|
* @property {number} rowsPerPage - Number of lines per page.
|
|
39
|
-
*
|
|
40
31
|
* @property {number} rowsPerPage - Number of products per page.
|
|
41
32
|
*/
|
|
42
33
|
interface IPageConfig {
|
|
43
|
-
rowsPerPage: number;
|
|
44
|
-
productsPerRow: number;
|
|
34
|
+
rowsPerPage: number | null;
|
|
35
|
+
productsPerRow: number | null;
|
|
45
36
|
}
|
|
46
37
|
/**
|
|
47
38
|
* Represents an object with various properties.
|
|
@@ -96,7 +87,7 @@ interface IPositionBlock {
|
|
|
96
87
|
attributeSetIdentifier: string | null;
|
|
97
88
|
type: string;
|
|
98
89
|
templateIdentifier: string | null;
|
|
99
|
-
countElementsPerRow
|
|
90
|
+
countElementsPerRow?: number;
|
|
100
91
|
}
|
|
101
92
|
/**
|
|
102
93
|
* Represents an object with various properties.
|
|
@@ -119,7 +110,7 @@ interface IPositionBlock {
|
|
|
119
110
|
* @property {number} childrenCount - Children count.
|
|
120
111
|
*/
|
|
121
112
|
interface IPagesEntity {
|
|
122
|
-
attributeSetIdentifier: string;
|
|
113
|
+
attributeSetIdentifier: string | null;
|
|
123
114
|
attributeValues: AttributeType;
|
|
124
115
|
childrenCount?: number;
|
|
125
116
|
config?: Record<string, number>;
|
|
@@ -137,4 +128,4 @@ interface IPagesEntity {
|
|
|
137
128
|
templateIdentifier: string | null;
|
|
138
129
|
type: Types;
|
|
139
130
|
}
|
|
140
|
-
export { IPageApi, IPageConfig, IPagesEntity, IPositionForm,
|
|
131
|
+
export type { IPageApi, IPageConfig, IPagesEntity, IPositionBlock, IPositionForm, };
|
|
@@ -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 { IAccountsEntity, IConnectedEntity, ICreateSessionEntity, IPaymentsApi, ISessionEntity, ISessionsEntity } from './paymentsInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with payments
|
|
7
7
|
*/
|
|
@@ -13,12 +13,12 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
|
|
|
13
13
|
* Get list of payment sessions.
|
|
14
14
|
*
|
|
15
15
|
* @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.
|
|
16
|
-
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
17
16
|
* @param {number} [offset] - Optional parameter for pagination, default is 30
|
|
17
|
+
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
18
18
|
*
|
|
19
19
|
* @returns Returns an array of SessionEntity objects.
|
|
20
20
|
*/
|
|
21
|
-
getSessions(
|
|
21
|
+
getSessions(offset?: number, limit?: number): Promise<ISessionsEntity | IError>;
|
|
22
22
|
/**
|
|
23
23
|
* Get a single payment session object by its identifier.
|
|
24
24
|
* @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.
|
|
@@ -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 payments
|
|
6
9
|
*/
|
|
@@ -13,13 +16,17 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
13
16
|
* Get list of payment sessions.
|
|
14
17
|
*
|
|
15
18
|
* @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.
|
|
16
|
-
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
17
19
|
* @param {number} [offset] - Optional parameter for pagination, default is 30
|
|
20
|
+
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
18
21
|
*
|
|
19
22
|
* @returns Returns an array of SessionEntity objects.
|
|
20
23
|
*/
|
|
21
|
-
async getSessions(
|
|
22
|
-
const
|
|
24
|
+
async getSessions(offset = 0, limit = 30) {
|
|
25
|
+
const query = {
|
|
26
|
+
offset,
|
|
27
|
+
limit,
|
|
28
|
+
};
|
|
29
|
+
const result = await this._fetchGet('/sessions/?' + this._queryParamsToString(query));
|
|
23
30
|
return result;
|
|
24
31
|
}
|
|
25
32
|
/**
|
|
@@ -44,10 +51,11 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
44
51
|
*
|
|
45
52
|
* @returns Returns a single payment session object.
|
|
46
53
|
*/
|
|
47
|
-
async createSession(orderId, type, automaticTaxEnabled) {
|
|
54
|
+
async createSession(orderId, type, automaticTaxEnabled = false) {
|
|
48
55
|
const result = await this._fetchPost('/sessions', {
|
|
56
|
+
orderId,
|
|
49
57
|
type,
|
|
50
|
-
|
|
58
|
+
automaticTaxEnabled,
|
|
51
59
|
});
|
|
52
60
|
return result;
|
|
53
61
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IError } from
|
|
1
|
+
import type { IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of Orders Api.
|
|
4
4
|
*
|
|
@@ -12,7 +12,7 @@ import { IError } from "../base/utils";
|
|
|
12
12
|
* @property {function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
|
|
13
13
|
*/
|
|
14
14
|
interface IPaymentsApi {
|
|
15
|
-
getSessions(
|
|
15
|
+
getSessions(offset: number, limit: number): Promise<ISessionsEntity | IError>;
|
|
16
16
|
getSessionById(id: number): Promise<ISessionEntity | IError>;
|
|
17
17
|
createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<ICreateSessionEntity | IError>;
|
|
18
18
|
getConnected(): Promise<IConnectedEntity | null | IError>;
|
|
@@ -20,11 +20,15 @@ interface IPaymentsApi {
|
|
|
20
20
|
getAccountById(id: number): Promise<IAccountsEntity | IError>;
|
|
21
21
|
webhookStripe(): Promise<boolean | IError>;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* ISessionsEntity
|
|
25
|
+
*/
|
|
23
26
|
interface ISessionsEntity {
|
|
24
27
|
total: number;
|
|
25
28
|
items: ISessionEntity;
|
|
26
29
|
}
|
|
27
30
|
/**
|
|
31
|
+
* ISessionEntity
|
|
28
32
|
*
|
|
29
33
|
* @interface
|
|
30
34
|
* @property {number} quantity - Quantity information.
|
|
@@ -41,6 +45,8 @@ interface ISessionEntity {
|
|
|
41
45
|
description: string;
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
48
|
+
* IIntent
|
|
49
|
+
*
|
|
44
50
|
* @interface
|
|
45
51
|
* @property {number} amount
|
|
46
52
|
* @property {string} currency
|
|
@@ -50,6 +56,8 @@ interface IIntent {
|
|
|
50
56
|
currency: string;
|
|
51
57
|
}
|
|
52
58
|
/**
|
|
59
|
+
* ISessionItem
|
|
60
|
+
*
|
|
53
61
|
* @interface
|
|
54
62
|
* @property {number} id - Object identifier.
|
|
55
63
|
* @property {string} updatedDate - Object modification date.
|
|
@@ -70,6 +78,9 @@ interface ISessionItem {
|
|
|
70
78
|
clientSecret: string;
|
|
71
79
|
status: string;
|
|
72
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* ICreateSessionEntity
|
|
83
|
+
*/
|
|
73
84
|
interface ICreateSessionEntity {
|
|
74
85
|
id: number;
|
|
75
86
|
updatedDate: string;
|
|
@@ -78,15 +89,19 @@ interface ICreateSessionEntity {
|
|
|
78
89
|
paymentUrl: string;
|
|
79
90
|
}
|
|
80
91
|
/**
|
|
92
|
+
* IConnectedEntity
|
|
93
|
+
*
|
|
81
94
|
* @interface
|
|
82
95
|
* @property {string} [stripeAccountId] - Identifier of connected Stripe account.
|
|
83
96
|
* @property {string} [stripePublishableKey] - Stripe Connect public key.
|
|
84
97
|
*/
|
|
85
98
|
interface IConnectedEntity {
|
|
86
|
-
stripeAccountId: string;
|
|
87
|
-
stripePublishableKey: string;
|
|
99
|
+
stripeAccountId: string | null;
|
|
100
|
+
stripePublishableKey: string | null;
|
|
88
101
|
}
|
|
89
102
|
/**
|
|
103
|
+
* IAccountsEntity
|
|
104
|
+
*
|
|
90
105
|
* @interface
|
|
91
106
|
* @property {number} id - Object identifier.
|
|
92
107
|
* @property {string} identifier - Text identifier for the recording field.
|
|
@@ -101,4 +116,4 @@ interface IAccountsEntity {
|
|
|
101
116
|
type: 'stripe' | 'custom';
|
|
102
117
|
isVisible: boolean;
|
|
103
118
|
}
|
|
104
|
-
export { IAccountsEntity, IConnectedEntity,
|
|
119
|
+
export type { IAccountsEntity, IConnectedEntity, ICreateSessionEntity, IIntent, IPaymentsApi, ISessionEntity, ISessionItem, ISessionsEntity, };
|
|
@@ -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 { IProductStatusEntity, IProductStatuses } from './productStatusesInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with product statuses
|
|
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 product statuses
|
|
6
9
|
*/
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { IError } from
|
|
1
|
+
import type { IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of Product Statuses Api.
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getProductStatuses - Search for all product status objects.
|
|
6
|
-
*
|
|
7
6
|
* @property {function} getProductStatusesById - Search for a product status object by identifier.
|
|
8
|
-
*
|
|
9
7
|
* @property {function} getProductsByStatusMarker - Search for a product status object by its textual identifier (marker).
|
|
10
|
-
*
|
|
11
8
|
* @property {function} validateMarker - Check the existence of a textual identifier.
|
|
12
9
|
*/
|
|
13
10
|
interface IProductStatuses {
|
|
@@ -33,4 +30,4 @@ interface IProductStatusEntity {
|
|
|
33
30
|
identifier: string;
|
|
34
31
|
localizeInfos: Record<string, any>;
|
|
35
32
|
}
|
|
36
|
-
export {
|
|
33
|
+
export type { IProductStatusEntity, IProductStatuses };
|