oneentry 1.0.124 → 1.0.126
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 +24 -22
- package/dist/admins/adminsApi.d.ts +17 -4
- package/dist/admins/adminsApi.js +16 -3
- package/dist/admins/adminsInterfaces.d.ts +47 -26
- package/dist/attribute-sets/attributeSetsApi.d.ts +10 -18
- package/dist/attribute-sets/attributeSetsApi.js +9 -17
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +92 -44
- package/dist/auth-provider/authProviderApi.d.ts +146 -36
- package/dist/auth-provider/authProviderApi.js +163 -37
- package/dist/auth-provider/authProvidersInterfaces.d.ts +189 -40
- package/dist/base/asyncModules.d.ts +7 -1
- package/dist/base/asyncModules.js +127 -21
- package/dist/base/result.js +23 -0
- package/dist/base/syncModules.d.ts +4 -0
- package/dist/base/syncModules.js +19 -1
- package/dist/base/utils.d.ts +1 -1
- package/dist/blocks/blocksApi.d.ts +7 -17
- package/dist/blocks/blocksApi.js +7 -17
- package/dist/blocks/blocksInterfaces.d.ts +77 -32
- package/dist/events/eventsApi.d.ts +7 -8
- package/dist/events/eventsApi.js +12 -7
- package/dist/events/eventsInterfaces.d.ts +16 -11
- package/dist/file-uploading/fileUploadingApi.d.ts +22 -14
- package/dist/file-uploading/fileUploadingApi.js +20 -12
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +42 -18
- package/dist/forms/formsApi.d.ts +3 -7
- package/dist/forms/formsApi.js +2 -6
- package/dist/forms/formsInterfaces.d.ts +44 -28
- package/dist/{formsData → forms-data}/formsDataApi.d.ts +31 -15
- package/dist/{formsData → forms-data}/formsDataApi.js +30 -14
- package/dist/forms-data/formsDataInterfaces.d.ts +462 -0
- package/dist/general-types/generalTypesApi.d.ts +1 -3
- package/dist/general-types/generalTypesApi.js +0 -2
- package/dist/general-types/generalTypesInterfaces.d.ts +2 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +74 -47
- package/dist/integration-collections/integrationCollectionsApi.js +64 -45
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +144 -63
- package/dist/locales/localesApi.d.ts +1 -2
- package/dist/locales/localesApi.js +1 -2
- package/dist/locales/localesInterfaces.d.ts +2 -4
- package/dist/menus/menusApi.d.ts +1 -3
- package/dist/menus/menusApi.js +1 -3
- package/dist/menus/menusInterfaces.d.ts +39 -13
- package/dist/orders/ordersApi.d.ts +36 -18
- package/dist/orders/ordersApi.js +40 -22
- package/dist/orders/ordersInterfaces.d.ts +163 -81
- package/dist/pages/pagesApi.d.ts +48 -48
- package/dist/pages/pagesApi.js +40 -45
- package/dist/pages/pagesInterfaces.d.ts +147 -98
- package/dist/payments/paymentsApi.d.ts +25 -45
- package/dist/payments/paymentsApi.js +27 -46
- package/dist/payments/paymentsInterfaces.d.ts +42 -60
- package/dist/product-statuses/productStatusesApi.d.ts +6 -12
- package/dist/product-statuses/productStatusesApi.js +5 -11
- package/dist/product-statuses/productStatusesInterfaces.d.ts +16 -15
- package/dist/products/productsApi.d.ts +256 -104
- package/dist/products/productsApi.js +263 -97
- package/dist/products/productsInterfaces.d.ts +343 -160
- package/dist/system/systemApi.d.ts +21 -10
- package/dist/system/systemApi.js +22 -8
- package/dist/system/systemInterfaces.d.ts +0 -1
- package/dist/templates/templatesApi.d.ts +6 -12
- package/dist/templates/templatesApi.js +4 -10
- package/dist/templates/templatesInterfaces.d.ts +20 -20
- package/dist/templates-preview/templatesPreviewApi.d.ts +2 -6
- package/dist/templates-preview/templatesPreviewApi.js +1 -5
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +50 -25
- package/dist/users/usersApi.d.ts +33 -13
- package/dist/users/usersApi.js +38 -15
- package/dist/users/usersInterfaces.d.ts +78 -27
- package/dist/web-socket/wsApi.d.ts +1 -5
- package/dist/web-socket/wsApi.js +1 -5
- package/dist/web-socket/wsInterfaces.d.ts +0 -1
- package/package.json +18 -16
- package/dist/formsData/formsDataInterfaces.d.ts +0 -267
- /package/dist/{formsData → forms-data}/formsDataInterfaces.js +0 -0
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
7
|
/**
|
|
8
8
|
* Controllers for working with payments
|
|
9
|
+
*
|
|
9
10
|
* @handle /api/content/payments
|
|
10
11
|
*/
|
|
11
12
|
class PaymentsApi extends asyncModules_1.default {
|
|
@@ -14,17 +15,15 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
14
15
|
this._url = state.url + '/api/content/payments';
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
* Get list of payment sessions.
|
|
18
|
+
* Get list of payment sessions. This method requires user authorization.
|
|
18
19
|
*
|
|
19
20
|
* @handleName getSessions
|
|
20
21
|
*
|
|
21
22
|
* @param {number} [offset] - Optional parameter for pagination. Default: 0.
|
|
22
23
|
* @param {number} [limit] - Optional parameter for pagination. Default: 30.
|
|
23
|
-
*
|
|
24
24
|
* @return {ISessionsEntity} Returns an array of SessionEntity objects.
|
|
25
25
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
26
|
-
*
|
|
27
|
-
* @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.
|
|
26
|
+
* @description Get list of payment sessions. This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
28
27
|
*/
|
|
29
28
|
async getSessions(offset = 0, limit = 30) {
|
|
30
29
|
const query = {
|
|
@@ -35,50 +34,44 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
35
34
|
return result;
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
|
-
* Get a single payment session object by its identifier.
|
|
37
|
+
* Get a single payment session object by its identifier. This method requires user authorization.
|
|
39
38
|
*
|
|
40
39
|
* @handleName getSessionById
|
|
41
40
|
*
|
|
42
41
|
* @param {number} id - Identifier of the retrieved payment session object. Example: 12345.
|
|
43
|
-
*
|
|
44
42
|
* @return {ISessionEntity} Returns a single payment session object.
|
|
45
43
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
46
|
-
*
|
|
47
|
-
* @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.
|
|
44
|
+
* @description Get a single payment session object by its identifier. This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
48
45
|
*/
|
|
49
46
|
async getSessionById(id) {
|
|
50
47
|
const result = await this._fetchGet(`/sessions/${id}`);
|
|
51
48
|
return result;
|
|
52
49
|
}
|
|
53
50
|
/**
|
|
54
|
-
* Get one payment session object by order identifier
|
|
51
|
+
* Get one payment session object by order identifier
|
|
55
52
|
*
|
|
56
53
|
* @handleName getSessionByOrderId
|
|
57
54
|
*
|
|
58
55
|
* @param {number} id - Order identifier. Example: 12345.
|
|
59
|
-
*
|
|
60
|
-
* @return {IAccountsEntity}
|
|
56
|
+
* @return {IAccountsEntity} Returns a single payment account object.
|
|
61
57
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
62
|
-
*
|
|
63
|
-
* @description
|
|
58
|
+
* @description Get one payment session object by order identifier. This method requires user authorization.
|
|
64
59
|
*/
|
|
65
60
|
async getSessionByOrderId(id) {
|
|
66
61
|
const result = await this._fetchGet(`/sessions/order/${id}`);
|
|
67
62
|
return result;
|
|
68
63
|
}
|
|
69
64
|
/**
|
|
70
|
-
* Creation of payment session.
|
|
65
|
+
* Creation of payment session. This method requires user authorization.
|
|
71
66
|
*
|
|
72
67
|
* @handleName createSession
|
|
73
68
|
*
|
|
74
69
|
* @param {number} orderId - Order identifier. Example: 12345.
|
|
75
|
-
* @param {'session' | 'intent'} type - Session type. Possible values:
|
|
70
|
+
* @param {'session' | 'intent'} type - Session type. Possible values: "session" or "intent". Example: 'session'.
|
|
76
71
|
* @param {boolean} [automaticTaxEnabled] - Automatic calculation of the tax rate. Default: false.
|
|
77
|
-
*
|
|
78
72
|
* @return {ICreateSessionEntity} Returns a single payment session object.
|
|
79
73
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
80
|
-
*
|
|
81
|
-
* @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.
|
|
74
|
+
* @description Creation of payment session. This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
82
75
|
*/
|
|
83
76
|
async createSession(orderId, type, automaticTaxEnabled = false) {
|
|
84
77
|
const result = await this._fetchPost('/sessions', {
|
|
@@ -89,61 +82,49 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
89
82
|
return result;
|
|
90
83
|
}
|
|
91
84
|
/**
|
|
92
|
-
* Get payment
|
|
93
|
-
*
|
|
94
|
-
* @handleName getConnected
|
|
95
|
-
*
|
|
96
|
-
* @return {IConnectedEntity} Returns object PaymentsConnected or null.
|
|
97
|
-
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
98
|
-
*
|
|
99
|
-
* @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.
|
|
100
|
-
*/
|
|
101
|
-
async getConnected() {
|
|
102
|
-
const result = await this._fetchGet('/connected');
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Get all payment accounts as an array.
|
|
85
|
+
* Get all payment accounts as an array. This method requires user authorization.
|
|
107
86
|
*
|
|
108
87
|
* @handleName getAccounts
|
|
109
88
|
*
|
|
110
89
|
* @return {IAccountsEntity} Returns all created payment accounts as an array of PaymentAccountEntity objects.
|
|
111
90
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
112
|
-
*
|
|
113
|
-
* @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
|
+
* @description Get all payment accounts as an array. This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
114
92
|
*/
|
|
115
93
|
async getAccounts() {
|
|
116
94
|
const result = await this._fetchGet('/accounts');
|
|
117
95
|
return this._normalizeData(result);
|
|
118
96
|
}
|
|
119
97
|
/**
|
|
120
|
-
* Get a single payment account object by its identifier.
|
|
98
|
+
* Get a single payment account object by its identifier. This method requires user authorization.
|
|
121
99
|
*
|
|
122
100
|
* @handleName getAccountById
|
|
123
101
|
*
|
|
124
|
-
* @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.
|
|
125
|
-
*
|
|
126
102
|
* @param {number} id - Identifier of the retrieved payment account object. Example: 12345.
|
|
127
|
-
*
|
|
103
|
+
* @param {any} settings - Settings object. Example: !!!
|
|
128
104
|
* @return {IAccountsEntity} Returns a single payment account object.
|
|
129
105
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
106
|
+
* @description Get a single payment account object by its identifier. This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
130
107
|
*/
|
|
131
|
-
async getAccountById(id
|
|
108
|
+
async getAccountById(id,
|
|
109
|
+
// !!! куда добавлять settins? query? body?
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
|
+
settings) {
|
|
132
112
|
const result = await this._fetchGet(`/accounts/${id}`);
|
|
133
113
|
return result;
|
|
134
114
|
}
|
|
135
115
|
/**
|
|
136
|
-
* Webhook for
|
|
116
|
+
* Webhook for payment account.
|
|
137
117
|
*
|
|
138
|
-
* @handleName
|
|
118
|
+
* @handleName webhookByMarker
|
|
139
119
|
*
|
|
140
|
-
* @
|
|
120
|
+
* @param {number} marker - marker. Example: "stripe".
|
|
121
|
+
* @return {boolean} Returns ...!!!
|
|
141
122
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
142
|
-
*
|
|
143
123
|
* @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.
|
|
144
124
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
|
+
async webhookByMarker(marker) {
|
|
127
|
+
const result = await this._fetchPost(`/webhook/${marker}`, {});
|
|
147
128
|
return result;
|
|
148
129
|
}
|
|
149
130
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import type { IError } from '../base/utils';
|
|
1
|
+
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IPaymentsApi
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getSessions - Get list of payment sessions.
|
|
6
6
|
* @property {function} getSessionById - Get a single payment session object by its identifier.
|
|
7
7
|
* @property {function} createSession - Creation of payment session.
|
|
8
|
-
* @property {function} getConnected - Get payment settings.
|
|
9
8
|
* @property {function} getAccounts - Get all payment accounts as an array.
|
|
10
9
|
* @property {function} getAccountById - Get a single payment account object by its identifier.
|
|
11
|
-
* @property {function} webhookStripe - Webhook for Stripe.
|
|
12
10
|
* @property {function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
|
|
13
|
-
*
|
|
14
11
|
* @description This interface defines methods for managing payment sessions, accounts, and connected payment settings in the system.
|
|
15
12
|
*/
|
|
16
13
|
interface IPaymentsApi {
|
|
@@ -19,7 +16,6 @@ interface IPaymentsApi {
|
|
|
19
16
|
*
|
|
20
17
|
* @param {number} [offset] - Optional parameter for pagination. Default: 0.
|
|
21
18
|
* @param {number} [limit] - Optional parameter for pagination. Default: 30.
|
|
22
|
-
*
|
|
23
19
|
* @return {ISessionsEntity} Returns an array of SessionEntity objects.
|
|
24
20
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
25
21
|
*/
|
|
@@ -28,7 +24,6 @@ interface IPaymentsApi {
|
|
|
28
24
|
* Get a single payment session object by its identifier.
|
|
29
25
|
*
|
|
30
26
|
* @param {number} id - Identifier of the retrieved payment session object. Example: 12345.
|
|
31
|
-
*
|
|
32
27
|
* @return {ISessionEntity} Returns a single payment session object.
|
|
33
28
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
34
29
|
*/
|
|
@@ -37,59 +32,54 @@ interface IPaymentsApi {
|
|
|
37
32
|
* Get one payment session object by order identifier 🔐
|
|
38
33
|
*
|
|
39
34
|
* @param {number} id - Order identifier. Example: 12345.
|
|
40
|
-
*
|
|
41
|
-
* @return {IAccountsEntity}
|
|
35
|
+
* @return {ISessionEntity}
|
|
42
36
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
43
37
|
*/
|
|
44
|
-
getSessionByOrderId(id: number): Promise<
|
|
38
|
+
getSessionByOrderId(id: number): Promise<ISessionEntity | IError>;
|
|
45
39
|
/**
|
|
46
40
|
* Creation of payment session.
|
|
47
41
|
*
|
|
48
42
|
* @param {number} orderId - Order identifier. Example: 12345.
|
|
49
|
-
* @param {'session' | 'intent'} type - Session type. Possible values:
|
|
43
|
+
* @param {'session' | 'intent'} type - Session type. Possible values: "session" or "intent". Example: "session".
|
|
50
44
|
* @param {boolean} [automaticTaxEnabled] - Automatic calculation of the tax rate. Default: false.
|
|
51
|
-
*
|
|
52
45
|
* @return {ICreateSessionEntity} Returns a single payment session object.
|
|
53
46
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
54
47
|
*/
|
|
55
48
|
createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<ICreateSessionEntity | IError>;
|
|
56
|
-
/**
|
|
57
|
-
* Get payment settings.
|
|
58
|
-
*
|
|
59
|
-
* @return {IConnectedEntity} Returns object PaymentsConnected or null.
|
|
60
|
-
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
61
|
-
*/
|
|
62
|
-
getConnected(): Promise<IConnectedEntity | null | IError>;
|
|
63
49
|
/**
|
|
64
50
|
* Get all payment accounts as an array.
|
|
65
51
|
*
|
|
66
52
|
* @return {IAccountsEntity} Returns all created payment accounts as an array of PaymentAccountEntity objects.
|
|
67
53
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
68
54
|
*/
|
|
69
|
-
getAccounts(): Promise<
|
|
55
|
+
getAccounts(): Promise<IAccountsEntity[] | IError>;
|
|
70
56
|
/**
|
|
71
57
|
* Get a single payment account object by its identifier.
|
|
72
58
|
*
|
|
73
59
|
* @param {number} id - Identifier of the retrieved payment account object. Example: 12345.
|
|
74
|
-
*
|
|
60
|
+
* @param {any} settings - Settings object. Example: ...!!!
|
|
75
61
|
* @return {IAccountsEntity} Returns a single payment account object.
|
|
76
62
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
77
63
|
*/
|
|
78
|
-
getAccountById(id: number): Promise<IAccountsEntity | IError>;
|
|
79
|
-
/**
|
|
80
|
-
* Webhook for Stripe.
|
|
81
|
-
*
|
|
82
|
-
* @return {boolean} Returns true (in case of successful execution) or false (in case of unsuccessful execution)
|
|
83
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
84
|
-
*/
|
|
85
|
-
webhookStripe(): Promise<boolean | IError>;
|
|
64
|
+
getAccountById(id: number, settings?: any): Promise<IAccountsEntity | IError>;
|
|
86
65
|
}
|
|
87
66
|
/**
|
|
88
67
|
* @interface ISessionsEntity
|
|
89
68
|
*
|
|
90
69
|
* @property {number} total - Total number of found records. Example: 100.
|
|
91
|
-
* @property {ISessionEntity} items - Array of session objects. Example:
|
|
92
|
-
|
|
70
|
+
* @property {ISessionEntity} items - Array of session objects. Example:
|
|
71
|
+
[
|
|
72
|
+
{
|
|
73
|
+
"id": 27,
|
|
74
|
+
"createdDate": "2025-06-04T04:38:32.849Z",
|
|
75
|
+
"updatedDate": "2025-06-04T04:38:32.849Z",
|
|
76
|
+
"type": "session",
|
|
77
|
+
"status": "waiting",
|
|
78
|
+
"paymentAccountId": 1,
|
|
79
|
+
"orderId": 55,
|
|
80
|
+
"paymentUrl": null
|
|
81
|
+
}
|
|
82
|
+
]
|
|
93
83
|
* @description Represents a response from the payments API containing a total count and an array of session entities.
|
|
94
84
|
*/
|
|
95
85
|
interface ISessionsEntity {
|
|
@@ -99,27 +89,31 @@ interface ISessionsEntity {
|
|
|
99
89
|
/**
|
|
100
90
|
* @interface ISessionEntity
|
|
101
91
|
*
|
|
102
|
-
* @property {number}
|
|
103
|
-
* @property {
|
|
104
|
-
* @property {string}
|
|
105
|
-
* @property {string}
|
|
106
|
-
* @property {string}
|
|
107
|
-
*
|
|
92
|
+
* @property {number} id - Object identifier. Example: 1764.
|
|
93
|
+
* @property {string} createdDate - Object creation date. Example: "2025-02-26T10:13:16.839Z".
|
|
94
|
+
* @property {string} updatedDate - Object modification date. Example: "2025-02-26T10:13:16.839Z".
|
|
95
|
+
* @property {string} type - Type may be 'session' or 'intent'. Example: "session".
|
|
96
|
+
* @property {string} status - Payment status. Example: "completed".
|
|
97
|
+
* @property {number} paymentAccountId - Payment ID from an external provider. Example: "9BE88048TU058770M".
|
|
98
|
+
* @property {number} orderId - Order identifier. Example: 1.
|
|
99
|
+
* @property {string | null} paymentUrl - payment link. Example: " https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M".
|
|
108
100
|
* @description This interface defines the structure of a session entity, including its quantity, amount, currency, name, and description.
|
|
109
101
|
*/
|
|
110
102
|
interface ISessionEntity {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
103
|
+
id: number;
|
|
104
|
+
createdDate: string;
|
|
105
|
+
updatedDate: string;
|
|
106
|
+
type: string;
|
|
107
|
+
status: string;
|
|
108
|
+
paymentAccountId: number;
|
|
109
|
+
orderId: number;
|
|
110
|
+
paymentUrl: string | null;
|
|
116
111
|
}
|
|
117
112
|
/**
|
|
118
113
|
* @interface IIntent
|
|
119
114
|
*
|
|
120
115
|
* @property {number} amount - Amount of the payment intent. Example: 100.00.
|
|
121
116
|
* @property {string} currency - Currency of the payment intent. Example: "USD".
|
|
122
|
-
*
|
|
123
117
|
* @description This interface defines the structure of a payment intent, including its amount and currency.
|
|
124
118
|
*/
|
|
125
119
|
interface IIntent {
|
|
@@ -137,7 +131,6 @@ interface IIntent {
|
|
|
137
131
|
* @property {string} paymentUrl - Payment link. Example: "https://example.com/payment/12345".
|
|
138
132
|
* @property {string} clientSecret - Client secret key. Example: "sk_test_4eC39HqLyjWDarjtT1zdp7dc".
|
|
139
133
|
* @property {string} status - payment status. Example: "pending".
|
|
140
|
-
*
|
|
141
134
|
* @description This interface defines the structure of a session item, which includes identifiers, payment details, and status information.
|
|
142
135
|
*/
|
|
143
136
|
interface ISessionItem {
|
|
@@ -158,7 +151,6 @@ interface ISessionItem {
|
|
|
158
151
|
* @property {number} version - Version of the object. Example: 1.
|
|
159
152
|
* @property {string} identifier - Text identifier for the recording field. Example: "payment_12345".
|
|
160
153
|
* @property {string} paymentUrl - Payment link. Example: "https://example.com/payment/12345".
|
|
161
|
-
*
|
|
162
154
|
* @description This interface defines the structure of a session entity created during the payment process, including its identifiers, version, and payment URL.
|
|
163
155
|
*/
|
|
164
156
|
interface ICreateSessionEntity {
|
|
@@ -168,36 +160,26 @@ interface ICreateSessionEntity {
|
|
|
168
160
|
identifier: string;
|
|
169
161
|
paymentUrl: string;
|
|
170
162
|
}
|
|
171
|
-
/**
|
|
172
|
-
* @interface IConnectedEntity
|
|
173
|
-
*
|
|
174
|
-
* @property {string} stripeAccountId - Identifier of connected Stripe account. Example: "acct_12345".
|
|
175
|
-
* @property {string} stripePublishableKey - Stripe Connect public key. Example: "pk_test_4eC39HqLyjWDarjtT1zdp7dc".
|
|
176
|
-
*
|
|
177
|
-
* @description This interface defines the structure of a connected entity, which includes identifiers for a Stripe account and its publishable key.
|
|
178
|
-
*/
|
|
179
|
-
interface IConnectedEntity {
|
|
180
|
-
stripeAccountId: string | null;
|
|
181
|
-
stripePublishableKey: string | null;
|
|
182
|
-
}
|
|
183
163
|
/**
|
|
184
164
|
* @interface IAccountsEntity
|
|
185
165
|
*
|
|
186
166
|
* @property {number} id - Object identifier. Example: 12345.
|
|
167
|
+
* @property {ILocalizeInfo} localizeInfos - Json description of the payment account object.
|
|
187
168
|
* @property {string} identifier - Text identifier for the recording field. Example: "payment_12345".
|
|
188
|
-
* @property {Record<string, any>} localizeInfos - Json description of the payment account object.
|
|
189
169
|
* @property {'stripe' | 'custom'} type - Type may be 'stripe' or 'custom'. Example: 'stripe'.
|
|
190
170
|
* @property {boolean} isVisible - Visibility indicator of the payment account. Example: true.
|
|
191
171
|
* @property {boolean} isUsed - Usage indicator of the payment account. Example: false.
|
|
192
|
-
*
|
|
193
172
|
* @description This interface defines the structure of a payment account entity, including its identifiers, localization information, type, visibility, and usage status.
|
|
194
173
|
*/
|
|
195
174
|
interface IAccountsEntity {
|
|
196
175
|
id: number;
|
|
176
|
+
localizeInfos: ILocalizeInfo;
|
|
197
177
|
identifier: string;
|
|
198
|
-
localizeInfos: Record<string, any>;
|
|
199
178
|
type: 'stripe' | 'custom';
|
|
200
179
|
isVisible: boolean;
|
|
201
180
|
isUsed: boolean;
|
|
181
|
+
settings: any;
|
|
182
|
+
testMode: boolean;
|
|
183
|
+
testSettings: any;
|
|
202
184
|
}
|
|
203
|
-
export type { IAccountsEntity,
|
|
185
|
+
export type { IAccountsEntity, ICreateSessionEntity, IIntent, IPaymentsApi, ISessionEntity, ISessionItem, ISessionsEntity, };
|
|
@@ -16,25 +16,21 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
|
|
|
16
16
|
* @handleName getProductStatuses
|
|
17
17
|
*
|
|
18
18
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
19
|
-
*
|
|
20
19
|
* @return {IProductStatusEntity[]} Returns an array of product status objects.
|
|
21
20
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
22
|
-
*
|
|
23
|
-
* @description
|
|
21
|
+
* @description Search for all product status objects.
|
|
24
22
|
*/
|
|
25
|
-
getProductStatuses(langCode?: string): Promise<
|
|
23
|
+
getProductStatuses(langCode?: string): Promise<IProductStatusEntity[] | IError>;
|
|
26
24
|
/**
|
|
27
25
|
* Search for a product status object by its textual identifier (marker).
|
|
28
26
|
*
|
|
29
27
|
* @handleName getProductsByStatusMarker
|
|
30
28
|
*
|
|
31
|
-
* @param {string} marker - Product marker. Example:
|
|
29
|
+
* @param {string} marker - Product marker. Example: "in_stock".
|
|
32
30
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
33
|
-
*
|
|
34
31
|
* @return {IProductStatusEntity} Returns a product status object.
|
|
35
32
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
36
|
-
*
|
|
37
|
-
* @description
|
|
33
|
+
* @description Search for a product status object by its textual identifier (marker).
|
|
38
34
|
*/
|
|
39
35
|
getProductsByStatusMarker(marker: string, langCode?: string): Promise<IProductStatusEntity | IError>;
|
|
40
36
|
/**
|
|
@@ -42,12 +38,10 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
|
|
|
42
38
|
*
|
|
43
39
|
* @handleName validateMarker
|
|
44
40
|
*
|
|
45
|
-
* @param {string} marker - Product marker. Example:
|
|
46
|
-
*
|
|
41
|
+
* @param {string} marker - Product marker. Example: "in_stock".
|
|
47
42
|
* @return {boolean} Returns true if the textual identifier (marker) exists or false if it doesn't.
|
|
48
43
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
49
|
-
*
|
|
50
|
-
* @description
|
|
44
|
+
* @description Check the existence of a textual identifier.
|
|
51
45
|
*/
|
|
52
46
|
validateMarker(marker: string): Promise<boolean | IError>;
|
|
53
47
|
}
|
|
@@ -19,11 +19,9 @@ class ProductStatusesApi extends asyncModules_1.default {
|
|
|
19
19
|
* @handleName getProductStatuses
|
|
20
20
|
*
|
|
21
21
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
22
|
-
*
|
|
23
22
|
* @return {IProductStatusEntity[]} Returns an array of product status objects.
|
|
24
23
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
25
|
-
*
|
|
26
|
-
* @description
|
|
24
|
+
* @description Search for all product status objects.
|
|
27
25
|
*/
|
|
28
26
|
async getProductStatuses(langCode = this.state.lang) {
|
|
29
27
|
const result = await this._fetchGet('');
|
|
@@ -34,13 +32,11 @@ class ProductStatusesApi extends asyncModules_1.default {
|
|
|
34
32
|
*
|
|
35
33
|
* @handleName getProductsByStatusMarker
|
|
36
34
|
*
|
|
37
|
-
* @param {string} marker - Product marker. Example:
|
|
35
|
+
* @param {string} marker - Product marker. Example: "in_stock".
|
|
38
36
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
39
|
-
*
|
|
40
37
|
* @return {IProductStatusEntity} Returns a product status object.
|
|
41
38
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
42
|
-
*
|
|
43
|
-
* @description
|
|
39
|
+
* @description Search for a product status object by its textual identifier (marker).
|
|
44
40
|
*/
|
|
45
41
|
async getProductsByStatusMarker(marker, langCode = this.state.lang) {
|
|
46
42
|
const result = await this._fetchGet(`/marker/${marker}`);
|
|
@@ -51,12 +47,10 @@ class ProductStatusesApi extends asyncModules_1.default {
|
|
|
51
47
|
*
|
|
52
48
|
* @handleName validateMarker
|
|
53
49
|
*
|
|
54
|
-
* @param {string} marker - Product marker. Example:
|
|
55
|
-
*
|
|
50
|
+
* @param {string} marker - Product marker. Example: "in_stock".
|
|
56
51
|
* @return {boolean} Returns true if the textual identifier (marker) exists or false if it doesn't.
|
|
57
52
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
58
|
-
*
|
|
59
|
-
* @description
|
|
53
|
+
* @description Check the existence of a textual identifier.
|
|
60
54
|
*/
|
|
61
55
|
async validateMarker(marker) {
|
|
62
56
|
const result = await this._fetchGet(`/marker-validation/${marker}`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IError } from '../base/utils';
|
|
1
|
+
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IProductStatuses
|
|
4
4
|
*
|
|
@@ -6,7 +6,6 @@ import type { IError } from '../base/utils';
|
|
|
6
6
|
* @property {function} getProductStatusesById - Search for a product status object by identifier.
|
|
7
7
|
* @property {function} getProductsByStatusMarker - Search for a product status object by its textual identifier (marker).
|
|
8
8
|
* @property {function} validateMarker - Check the existence of a textual identifier.
|
|
9
|
-
*
|
|
10
9
|
* @description This interface defines methods for retrieving and managing product statuses in the system.
|
|
11
10
|
*/
|
|
12
11
|
interface IProductStatuses {
|
|
@@ -14,17 +13,15 @@ interface IProductStatuses {
|
|
|
14
13
|
* Search for all product status objects.
|
|
15
14
|
*
|
|
16
15
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
17
|
-
*
|
|
18
16
|
* @return {IProductStatusEntity[]} Returns an array of product status objects.
|
|
19
17
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
20
18
|
*/
|
|
21
|
-
getProductStatuses(langCode: string): Promise<
|
|
19
|
+
getProductStatuses(langCode: string): Promise<IProductStatusEntity[] | IError>;
|
|
22
20
|
/**
|
|
23
21
|
* Search for a product status object by its textual identifier (marker).
|
|
24
22
|
*
|
|
25
|
-
* @param {string} marker - Product marker. Example:
|
|
23
|
+
* @param {string} marker - Product marker. Example: "in_stock".
|
|
26
24
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
27
|
-
*
|
|
28
25
|
* @return {IProductStatusEntity} Returns a product status object.
|
|
29
26
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
30
27
|
*/
|
|
@@ -32,8 +29,7 @@ interface IProductStatuses {
|
|
|
32
29
|
/**
|
|
33
30
|
* Check the existence of a textual identifier.
|
|
34
31
|
*
|
|
35
|
-
* @param {string} marker - Product marker. Example:
|
|
36
|
-
*
|
|
32
|
+
* @param {string} marker - Product marker. Example: "in_stock".
|
|
37
33
|
* @return {boolean} Returns true if the textual identifier (marker) exists or false if it doesn't.
|
|
38
34
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
39
35
|
*/
|
|
@@ -43,20 +39,25 @@ interface IProductStatuses {
|
|
|
43
39
|
* @interface IProductStatusEntity
|
|
44
40
|
*
|
|
45
41
|
* @property {number} id - The unique identifier of the position. Example: 12345.
|
|
42
|
+
* @property {string} identifier - The textual identifier for the record field. Example: "in_stock".
|
|
43
|
+
* @property {ILocalizeInfo} localizeInfos - The name of the products statuses, taking into account localization. Example:
|
|
44
|
+
* @property {boolean} isDefault - Default status flag. Example: true.
|
|
46
45
|
* @property {number} version - The version number of the object. Example: 1.
|
|
47
|
-
* @property {string} identifier - The textual identifier for the record field. Example: 'in_stock'.
|
|
48
46
|
* @property {number} position - Position number. Example: 1.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
{
|
|
48
|
+
"title": "Catalog",
|
|
49
|
+
"plainContent": "Content for catalog",
|
|
50
|
+
"htmlContent": "<b>Content for catalog</b>",
|
|
51
|
+
"menuTitle": "Catalog"
|
|
52
|
+
}
|
|
52
53
|
* @description This interface defines the structure of a product status entity, including its identifiers, localization information, position, and default status flag.
|
|
53
54
|
*/
|
|
54
55
|
interface IProductStatusEntity {
|
|
55
56
|
id: number;
|
|
56
|
-
position: number;
|
|
57
|
-
version: number;
|
|
58
57
|
identifier: string;
|
|
59
|
-
localizeInfos:
|
|
58
|
+
localizeInfos: ILocalizeInfo;
|
|
60
59
|
isDefault: boolean;
|
|
60
|
+
version: number;
|
|
61
|
+
position: number;
|
|
61
62
|
}
|
|
62
63
|
export type { IProductStatusEntity, IProductStatuses };
|