oneentry 1.0.123 → 1.0.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +24 -22
  2. package/dist/admins/adminsApi.d.ts +30 -9
  3. package/dist/admins/adminsApi.js +30 -9
  4. package/dist/admins/adminsInterfaces.d.ts +77 -32
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +36 -22
  6. package/dist/attribute-sets/attributeSetsApi.js +41 -25
  7. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +133 -39
  8. package/dist/auth-provider/authProviderApi.d.ts +209 -88
  9. package/dist/auth-provider/authProviderApi.js +226 -87
  10. package/dist/auth-provider/authProvidersInterfaces.d.ts +345 -18
  11. package/dist/base/asyncModules.d.ts +38 -28
  12. package/dist/base/asyncModules.js +178 -47
  13. package/dist/base/result.js +23 -0
  14. package/dist/base/syncModules.d.ts +48 -44
  15. package/dist/base/syncModules.js +84 -64
  16. package/dist/base/utils.d.ts +1 -1
  17. package/dist/blocks/blocksApi.d.ts +48 -27
  18. package/dist/blocks/blocksApi.js +48 -27
  19. package/dist/blocks/blocksInterfaces.d.ts +126 -32
  20. package/dist/events/eventsApi.d.ts +45 -12
  21. package/dist/events/eventsApi.js +47 -12
  22. package/dist/events/eventsInterfaces.d.ts +50 -3
  23. package/dist/file-uploading/fileUploadingApi.d.ts +57 -29
  24. package/dist/file-uploading/fileUploadingApi.js +57 -30
  25. package/dist/file-uploading/fileUploadingInterfaces.d.ts +90 -17
  26. package/dist/forms/formsApi.d.ts +20 -9
  27. package/dist/forms/formsApi.js +19 -8
  28. package/dist/forms/formsInterfaces.d.ts +86 -23
  29. package/dist/formsData/formsDataApi.d.ts +33 -21
  30. package/dist/formsData/formsDataApi.js +33 -21
  31. package/dist/formsData/formsDataInterfaces.d.ts +212 -41
  32. package/dist/general-types/generalTypesApi.d.ts +11 -2
  33. package/dist/general-types/generalTypesApi.js +10 -1
  34. package/dist/general-types/generalTypesInterfaces.d.ts +17 -6
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.js +2 -2
  37. package/dist/integration-collections/integrationCollectionsApi.d.ts +134 -81
  38. package/dist/integration-collections/integrationCollectionsApi.js +135 -83
  39. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +246 -43
  40. package/dist/locales/localesApi.d.ts +5 -1
  41. package/dist/locales/localesApi.js +5 -1
  42. package/dist/locales/localesInterfaces.d.ts +19 -12
  43. package/dist/menus/menusApi.d.ts +6 -3
  44. package/dist/menus/menusApi.js +6 -3
  45. package/dist/menus/menusInterfaces.d.ts +60 -21
  46. package/dist/orders/ordersApi.d.ts +84 -66
  47. package/dist/orders/ordersApi.js +91 -71
  48. package/dist/orders/ordersInterfaces.d.ts +282 -86
  49. package/dist/pages/pagesApi.d.ts +101 -42
  50. package/dist/pages/pagesApi.js +93 -39
  51. package/dist/pages/pagesInterfaces.d.ts +218 -75
  52. package/dist/payments/paymentsApi.d.ts +53 -39
  53. package/dist/payments/paymentsApi.js +55 -40
  54. package/dist/payments/paymentsInterfaces.d.ts +121 -56
  55. package/dist/product-statuses/productStatusesApi.d.ts +17 -17
  56. package/dist/product-statuses/productStatusesApi.js +16 -19
  57. package/dist/product-statuses/productStatusesInterfaces.d.ts +43 -14
  58. package/dist/products/productsApi.d.ts +309 -177
  59. package/dist/products/productsApi.js +313 -167
  60. package/dist/products/productsInterfaces.d.ts +447 -81
  61. package/dist/system/systemApi.d.ts +42 -12
  62. package/dist/system/systemApi.js +43 -10
  63. package/dist/system/systemInterfaces.d.ts +7 -0
  64. package/dist/templates/templatesApi.d.ts +24 -20
  65. package/dist/templates/templatesApi.js +22 -21
  66. package/dist/templates/templatesInterfaces.d.ts +48 -22
  67. package/dist/templates-preview/templatesPreviewApi.d.ts +17 -17
  68. package/dist/templates-preview/templatesPreviewApi.js +16 -19
  69. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +85 -32
  70. package/dist/users/usersApi.d.ts +59 -35
  71. package/dist/users/usersApi.js +62 -35
  72. package/dist/users/usersInterfaces.d.ts +136 -14
  73. package/dist/web-socket/wsApi.d.ts +4 -5
  74. package/dist/web-socket/wsApi.js +4 -5
  75. package/dist/web-socket/wsInterfaces.d.ts +2 -1
  76. package/package.json +20 -18
@@ -1,9 +1,10 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
2
  import type StateModule from '../base/stateModule';
3
3
  import type { IError } from '../base/utils';
4
- import type { IAccountsEntity, IConnectedEntity, ICreateSessionEntity, IPaymentsApi, ISessionEntity, ISessionsEntity } from './paymentsInterfaces';
4
+ import type { IAccountsEntity, ICreateSessionEntity, IPaymentsApi, ISessionEntity, ISessionsEntity } from './paymentsInterfaces';
5
5
  /**
6
6
  * Controllers for working with payments
7
+ *
7
8
  * @handle /api/content/payments
8
9
  */
9
10
  export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
@@ -11,70 +12,83 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
11
12
  protected _url: string;
12
13
  constructor(state: StateModule);
13
14
  /**
14
- * Get list of payment sessions.
15
+ * Get list of payment sessions. This method requires user authorization.
15
16
  *
16
- * @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.
17
- * @param {number} [offset] - Optional parameter for pagination, default is 0
18
- * @param {number} [limit] - Optional parameter for pagination, default is 30
17
+ * @handleName getSessions
19
18
  *
20
- * @returns Returns an array of SessionEntity objects.
19
+ * @param {number} [offset] - Optional parameter for pagination. Default: 0.
20
+ * @param {number} [limit] - Optional parameter for pagination. Default: 30.
21
+ * @return {ISessionsEntity} Returns an array of SessionEntity objects.
22
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
23
+ * @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.
21
24
  */
22
25
  getSessions(offset?: number, limit?: number): Promise<ISessionsEntity | IError>;
23
26
  /**
24
- * Get a single payment session object by its identifier.
25
- * @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.
27
+ * Get a single payment session object by its identifier. This method requires user authorization.
26
28
  *
27
- * @param {number} id - Identifier of the retrieved payment session object
29
+ * @handleName getSessionById
28
30
  *
29
- * @returns Returns a single payment session object.
31
+ * @param {number} id - Identifier of the retrieved payment session object. Example: 12345.
32
+ * @return {ISessionEntity} Returns a single payment session object.
33
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
34
+ * @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.
30
35
  */
31
36
  getSessionById(id: number): Promise<ISessionEntity | IError>;
32
37
  /**
33
- * Get one payment session object by order identifier 🔐
38
+ * Get one payment session object by order identifier
39
+ *
40
+ * @handleName getSessionByOrderId
34
41
  *
35
- * @param id - order identifier
36
- * @returns
42
+ * @param {number} id - Order identifier. Example: 12345.
43
+ * @return {IAccountsEntity} Returns a single payment account object.
44
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
45
+ * @description Get one payment session object by order identifier. This method requires user authorization.
37
46
  */
38
- getSessionByOrderId(id: number): Promise<IAccountsEntity | IError>;
47
+ getSessionByOrderId(id: number): Promise<ISessionEntity | IError>;
39
48
  /**
40
- * Creation of payment session.
41
- * @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.
49
+ * Creation of payment session. This method requires user authorization.
42
50
  *
43
- * @param {number} [orderId] - Order identifier
44
- * @param {'session' | 'intent'} [type] - Session type
45
- * @param {boolean} [automaticTaxEnabled] - Automatic calculation of the tax rate
51
+ * @handleName createSession
46
52
  *
47
- * @returns Returns a single payment session object.
53
+ * @param {number} orderId - Order identifier. Example: 12345.
54
+ * @param {'session' | 'intent'} type - Session type. Possible values: "session" or "intent". Example: 'session'.
55
+ * @param {boolean} [automaticTaxEnabled] - Automatic calculation of the tax rate. Default: false.
56
+ * @return {ICreateSessionEntity} Returns a single payment session object.
57
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
58
+ * @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.
48
59
  */
49
60
  createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<ICreateSessionEntity | IError>;
50
61
  /**
51
- * Get payment settings.
52
- * @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.
62
+ * Get all payment accounts as an array. This method requires user authorization.
53
63
  *
54
- * @returns Returns object PaymentsConnected or null.
55
- */
56
- getConnected(): Promise<IConnectedEntity | null | IError>;
57
- /**
58
- * Get all payment accounts as an array.
59
- * @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.
64
+ * @handleName getAccounts
60
65
  *
61
- * @returns Returns all created payment accounts as an array of PaymentAccountEntity objects.
66
+ * @return {IAccountsEntity} Returns all created payment accounts as an array of PaymentAccountEntity objects.
67
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
68
+ * @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.
62
69
  */
63
- getAccounts(): Promise<Array<IAccountsEntity> | IError>;
70
+ getAccounts(): Promise<IAccountsEntity[] | IError>;
64
71
  /**
65
- * Get a single payment account object by its identifier.
66
- * @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.
72
+ * Get a single payment account object by its identifier. This method requires user authorization.
67
73
  *
68
- * @param {number} id - Identifier of the retrieved payment account object
74
+ * @handleName getAccountById
69
75
  *
70
- * @returns Returns a single payment account object.
76
+ * @param {number} id - Identifier of the retrieved payment account object. Example: 12345.
77
+ * @param {any} settings - Settings object. Example: !!!
78
+ * @return {IAccountsEntity} Returns a single payment account object.
79
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
80
+ * @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.
71
81
  */
72
- getAccountById(id: number): Promise<IAccountsEntity | IError>;
82
+ getAccountById(id: number, settings?: any): Promise<IAccountsEntity | IError>;
73
83
  /**
74
- * Webhook for Stripe.
75
- * @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.
84
+ * Webhook for payment account.
85
+ *
86
+ * @handleName webhookByMarker
76
87
  *
77
- * @returns Returns true (in case of successful execution) or false (in case of unsuccessful execution)
88
+ * @param {number} marker - marker. Example: "stripe".
89
+ * @return {boolean} Returns ...!!!
90
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
91
+ * @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.
78
92
  */
79
- webhookStripe(): Promise<boolean | IError>;
93
+ webhookByMarker(marker: string): Promise<any | IError>;
80
94
  }
@@ -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,13 +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
- * @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.
20
- * @param {number} [offset] - Optional parameter for pagination, default is 0
21
- * @param {number} [limit] - Optional parameter for pagination, default is 30
20
+ * @handleName getSessions
22
21
  *
23
- * @returns Returns an array of SessionEntity objects.
22
+ * @param {number} [offset] - Optional parameter for pagination. Default: 0.
23
+ * @param {number} [limit] - Optional parameter for pagination. Default: 30.
24
+ * @return {ISessionsEntity} Returns an array of SessionEntity objects.
25
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
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.
24
27
  */
25
28
  async getSessions(offset = 0, limit = 30) {
26
29
  const query = {
@@ -31,36 +34,44 @@ class PaymentsApi extends asyncModules_1.default {
31
34
  return result;
32
35
  }
33
36
  /**
34
- * Get a single payment session object by its identifier.
35
- * @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.
37
+ * Get a single payment session object by its identifier. This method requires user authorization.
36
38
  *
37
- * @param {number} id - Identifier of the retrieved payment session object
39
+ * @handleName getSessionById
38
40
  *
39
- * @returns Returns a single payment session object.
41
+ * @param {number} id - Identifier of the retrieved payment session object. Example: 12345.
42
+ * @return {ISessionEntity} Returns a single payment session object.
43
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
40
45
  */
41
46
  async getSessionById(id) {
42
47
  const result = await this._fetchGet(`/sessions/${id}`);
43
48
  return result;
44
49
  }
45
50
  /**
46
- * Get one payment session object by order identifier 🔐
51
+ * Get one payment session object by order identifier
47
52
  *
48
- * @param id - order identifier
49
- * @returns
53
+ * @handleName getSessionByOrderId
54
+ *
55
+ * @param {number} id - Order identifier. Example: 12345.
56
+ * @return {IAccountsEntity} Returns a single payment account object.
57
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
58
+ * @description Get one payment session object by order identifier. This method requires user authorization.
50
59
  */
51
60
  async getSessionByOrderId(id) {
52
61
  const result = await this._fetchGet(`/sessions/order/${id}`);
53
62
  return result;
54
63
  }
55
64
  /**
56
- * Creation of payment session.
57
- * @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.
65
+ * Creation of payment session. This method requires user authorization.
58
66
  *
59
- * @param {number} [orderId] - Order identifier
60
- * @param {'session' | 'intent'} [type] - Session type
61
- * @param {boolean} [automaticTaxEnabled] - Automatic calculation of the tax rate
67
+ * @handleName createSession
62
68
  *
63
- * @returns Returns a single payment session object.
69
+ * @param {number} orderId - Order identifier. Example: 12345.
70
+ * @param {'session' | 'intent'} type - Session type. Possible values: "session" or "intent". Example: 'session'.
71
+ * @param {boolean} [automaticTaxEnabled] - Automatic calculation of the tax rate. Default: false.
72
+ * @return {ICreateSessionEntity} Returns a single payment session object.
73
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
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.
64
75
  */
65
76
  async createSession(orderId, type, automaticTaxEnabled = false) {
66
77
  const result = await this._fetchPost('/sessions', {
@@ -71,45 +82,49 @@ class PaymentsApi extends asyncModules_1.default {
71
82
  return result;
72
83
  }
73
84
  /**
74
- * Get payment settings.
75
- * @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.
85
+ * Get all payment accounts as an array. This method requires user authorization.
76
86
  *
77
- * @returns Returns object PaymentsConnected or null.
78
- */
79
- async getConnected() {
80
- const result = await this._fetchGet('/connected');
81
- return result;
82
- }
83
- /**
84
- * Get all payment accounts as an array.
85
- * @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.
87
+ * @handleName getAccounts
86
88
  *
87
- * @returns Returns all created payment accounts as an array of PaymentAccountEntity objects.
89
+ * @return {IAccountsEntity} Returns all created payment accounts as an array of PaymentAccountEntity objects.
90
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
88
92
  */
89
93
  async getAccounts() {
90
94
  const result = await this._fetchGet('/accounts');
91
95
  return this._normalizeData(result);
92
96
  }
93
97
  /**
94
- * Get a single payment account object by its identifier.
95
- * @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.
98
+ * Get a single payment account object by its identifier. This method requires user authorization.
96
99
  *
97
- * @param {number} id - Identifier of the retrieved payment account object
100
+ * @handleName getAccountById
98
101
  *
99
- * @returns Returns a single payment account object.
102
+ * @param {number} id - Identifier of the retrieved payment account object. Example: 12345.
103
+ * @param {any} settings - Settings object. Example: !!!
104
+ * @return {IAccountsEntity} Returns a single payment account object.
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.
100
107
  */
101
- async getAccountById(id) {
108
+ async getAccountById(id,
109
+ // !!! куда добавлять settins? query? body?
110
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
111
+ settings) {
102
112
  const result = await this._fetchGet(`/accounts/${id}`);
103
113
  return result;
104
114
  }
105
115
  /**
106
- * Webhook for Stripe.
107
- * @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.
116
+ * Webhook for payment account.
117
+ *
118
+ * @handleName webhookByMarker
108
119
  *
109
- * @returns Returns true (in case of successful execution) or false (in case of unsuccessful execution)
120
+ * @param {number} marker - marker. Example: "stripe".
121
+ * @return {boolean} Returns ...!!!
122
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
110
124
  */
111
- async webhookStripe() {
112
- const result = await this._fetchPost('/webhook/stripe', {});
125
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
126
+ async webhookByMarker(marker) {
127
+ const result = await this._fetchPost(`/webhook/${marker}`, {});
113
128
  return result;
114
129
  }
115
130
  }
@@ -1,72 +1,137 @@
1
- import type { IError } from '../base/utils';
1
+ import type { IError, ILocalizeInfo } from '../base/utils';
2
2
  /**
3
- * Represents an interface object of Orders Api.
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.
11
+ * @description This interface defines methods for managing payment sessions, accounts, and connected payment settings in the system.
13
12
  */
14
13
  interface IPaymentsApi {
14
+ /**
15
+ * Get list of payment sessions.
16
+ *
17
+ * @param {number} [offset] - Optional parameter for pagination. Default: 0.
18
+ * @param {number} [limit] - Optional parameter for pagination. Default: 30.
19
+ * @return {ISessionsEntity} Returns an array of SessionEntity objects.
20
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
21
+ */
15
22
  getSessions(offset: number, limit: number): Promise<ISessionsEntity | IError>;
23
+ /**
24
+ * Get a single payment session object by its identifier.
25
+ *
26
+ * @param {number} id - Identifier of the retrieved payment session object. Example: 12345.
27
+ * @return {ISessionEntity} Returns a single payment session object.
28
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
29
+ */
16
30
  getSessionById(id: number): Promise<ISessionEntity | IError>;
31
+ /**
32
+ * Get one payment session object by order identifier 🔐
33
+ *
34
+ * @param {number} id - Order identifier. Example: 12345.
35
+ * @return {ISessionEntity}
36
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
37
+ */
38
+ getSessionByOrderId(id: number): Promise<ISessionEntity | IError>;
39
+ /**
40
+ * Creation of payment session.
41
+ *
42
+ * @param {number} orderId - Order identifier. Example: 12345.
43
+ * @param {'session' | 'intent'} type - Session type. Possible values: "session" or "intent". Example: "session".
44
+ * @param {boolean} [automaticTaxEnabled] - Automatic calculation of the tax rate. Default: false.
45
+ * @return {ICreateSessionEntity} Returns a single payment session object.
46
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
47
+ */
17
48
  createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<ICreateSessionEntity | IError>;
18
- getConnected(): Promise<IConnectedEntity | null | IError>;
19
- getAccounts(): Promise<Array<IAccountsEntity> | IError>;
20
- getAccountById(id: number): Promise<IAccountsEntity | IError>;
21
- webhookStripe(): Promise<boolean | IError>;
49
+ /**
50
+ * Get all payment accounts as an array.
51
+ *
52
+ * @return {IAccountsEntity} Returns all created payment accounts as an array of PaymentAccountEntity objects.
53
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
54
+ */
55
+ getAccounts(): Promise<IAccountsEntity[] | IError>;
56
+ /**
57
+ * Get a single payment account object by its identifier.
58
+ *
59
+ * @param {number} id - Identifier of the retrieved payment account object. Example: 12345.
60
+ * @param {any} settings - Settings object. Example: ...!!!
61
+ * @return {IAccountsEntity} Returns a single payment account object.
62
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
63
+ */
64
+ getAccountById(id: number, settings?: any): Promise<IAccountsEntity | IError>;
22
65
  }
23
66
  /**
24
- * ISessionsEntity
67
+ * @interface ISessionsEntity
68
+ *
69
+ * @property {number} total - Total number of found records. Example: 100.
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
+ ]
83
+ * @description Represents a response from the payments API containing a total count and an array of session entities.
25
84
  */
26
85
  interface ISessionsEntity {
27
86
  total: number;
28
87
  items: ISessionEntity;
29
88
  }
30
89
  /**
31
- * ISessionEntity
90
+ * @interface ISessionEntity
32
91
  *
33
- * @interface
34
- * @property {number} quantity - Quantity information.
35
- * @property {number} amount - Amount information.
36
- * @property {string} currency - Currency information.
37
- * @property {string} name - Name.
38
- * @property {string} description - Description.
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".
100
+ * @description This interface defines the structure of a session entity, including its quantity, amount, currency, name, and description.
39
101
  */
40
102
  interface ISessionEntity {
41
- quantity: number;
42
- amount: number;
43
- currency: string;
44
- name: string;
45
- description: string;
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;
46
111
  }
47
112
  /**
48
- * IIntent
113
+ * @interface IIntent
49
114
  *
50
- * @interface
51
- * @property {number} amount
52
- * @property {string} currency
115
+ * @property {number} amount - Amount of the payment intent. Example: 100.00.
116
+ * @property {string} currency - Currency of the payment intent. Example: "USD".
117
+ * @description This interface defines the structure of a payment intent, including its amount and currency.
53
118
  */
54
119
  interface IIntent {
55
120
  amount: number;
56
121
  currency: string;
57
122
  }
58
123
  /**
59
- * ISessionItem
124
+ * @interface ISessionItem
60
125
  *
61
- * @interface
62
- * @property {number} id - Object identifier.
63
- * @property {string} updatedDate - Object modification date.
64
- * @property {string} type - Type may be 'session' or 'intent'.
65
- * @property {string} status - payment status.
66
- * @property {number} orderId - Order identifier.
67
- * @property {number} paymentAccountId - Payment account object identifier.
68
- * @property {string} paymentUrl - Payment link.
69
- * @property {string} clientSecret - Client secret key.
126
+ * @property {number} id - Object identifier. Example: 12345.
127
+ * @property {string} updatedDate - Object modification date. Example: "2023-10-01T12:00:00Z".
128
+ * @property {string} type - Type may be 'session' or 'intent'. Example: 'session'.
129
+ * @property {number} orderId - Order identifier. Example: 12345.
130
+ * @property {number} paymentAccountId - Payment account object identifier. Example: 12345.
131
+ * @property {string} paymentUrl - Payment link. Example: "https://example.com/payment/12345".
132
+ * @property {string} clientSecret - Client secret key. Example: "sk_test_4eC39HqLyjWDarjtT1zdp7dc".
133
+ * @property {string} status - payment status. Example: "pending".
134
+ * @description This interface defines the structure of a session item, which includes identifiers, payment details, and status information.
70
135
  */
71
136
  interface ISessionItem {
72
137
  id: number;
@@ -79,7 +144,14 @@ interface ISessionItem {
79
144
  status: string;
80
145
  }
81
146
  /**
82
- * ICreateSessionEntity
147
+ * @interface ICreateSessionEntity
148
+ *
149
+ * @property {number} id - Object identifier. Example: 12345.
150
+ * @property {string} updatedDate - Object modification date. Example: "2023-10-01T12:00:00Z".
151
+ * @property {number} version - Version of the object. Example: 1.
152
+ * @property {string} identifier - Text identifier for the recording field. Example: "payment_12345".
153
+ * @property {string} paymentUrl - Payment link. Example: "https://example.com/payment/12345".
154
+ * @description This interface defines the structure of a session entity created during the payment process, including its identifiers, version, and payment URL.
83
155
  */
84
156
  interface ICreateSessionEntity {
85
157
  id: number;
@@ -89,32 +161,25 @@ interface ICreateSessionEntity {
89
161
  paymentUrl: string;
90
162
  }
91
163
  /**
92
- * IConnectedEntity
93
- *
94
- * @interface
95
- * @property {string} [stripeAccountId] - Identifier of connected Stripe account.
96
- * @property {string} [stripePublishableKey] - Stripe Connect public key.
97
- */
98
- interface IConnectedEntity {
99
- stripeAccountId: string | null;
100
- stripePublishableKey: string | null;
101
- }
102
- /**
103
- * IAccountsEntity
164
+ * @interface IAccountsEntity
104
165
  *
105
- * @interface
106
- * @property {number} id - Object identifier.
107
- * @property {string} identifier - Text identifier for the recording field.
108
- * @property {Record<string, any>} localizeInfos - Json description of the payment account object.
109
- * @property {'stripe' | 'custom'} type - Type may be 'stripe' or 'custom'.
110
- * @property {boolean} isVisible - Visibility indicator of the payment account.
166
+ * @property {number} id - Object identifier. Example: 12345.
167
+ * @property {ILocalizeInfo} localizeInfos - Json description of the payment account object.
168
+ * @property {string} identifier - Text identifier for the recording field. Example: "payment_12345".
169
+ * @property {'stripe' | 'custom'} type - Type may be 'stripe' or 'custom'. Example: 'stripe'.
170
+ * @property {boolean} isVisible - Visibility indicator of the payment account. Example: true.
171
+ * @property {boolean} isUsed - Usage indicator of the payment account. Example: false.
172
+ * @description This interface defines the structure of a payment account entity, including its identifiers, localization information, type, visibility, and usage status.
111
173
  */
112
174
  interface IAccountsEntity {
113
175
  id: number;
176
+ localizeInfos: ILocalizeInfo;
114
177
  identifier: string;
115
- localizeInfos: Record<string, any>;
116
178
  type: 'stripe' | 'custom';
117
179
  isVisible: boolean;
118
180
  isUsed: boolean;
181
+ settings: any;
182
+ testMode: boolean;
183
+ testSettings: any;
119
184
  }
120
- export type { IAccountsEntity, IConnectedEntity, ICreateSessionEntity, IIntent, IPaymentsApi, ISessionEntity, ISessionItem, ISessionsEntity, };
185
+ export type { IAccountsEntity, ICreateSessionEntity, IIntent, IPaymentsApi, ISessionEntity, ISessionItem, ISessionsEntity, };
@@ -13,35 +13,35 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
13
13
  /**
14
14
  * Search for all product status objects.
15
15
  *
16
- * @param {string} [langCode] - language code
16
+ * @handleName getProductStatuses
17
17
  *
18
- * @returns Returns an array of product status objects
18
+ * @param {string} [langCode] - Language code. Default: "en_US".
19
+ * @return {IProductStatusEntity[]} Returns an array of product status objects.
20
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
21
+ * @description Search for all product status objects.
19
22
  */
20
- getProductStatuses(langCode?: string): Promise<Array<IProductStatusEntity> | IError>;
21
- /**
22
- * Search for a product status object by identifier.
23
- *
24
- * @param {number} [id] - Status id
25
- * @param {string} [langCode] - language code
26
- *
27
- * @returns Returns a product status object
28
- */
29
- getProductStatusesById(id: number, langCode?: string): Promise<IProductStatusEntity | IError>;
23
+ getProductStatuses(langCode?: string): Promise<IProductStatusEntity[] | IError>;
30
24
  /**
31
25
  * Search for a product status object by its textual identifier (marker).
32
26
  *
33
- * @param {string} [marker] - Product marker
34
- * @param {string} [langCode] - language code
27
+ * @handleName getProductsByStatusMarker
35
28
  *
36
- * @returns Returns a product status object
29
+ * @param {string} marker - Product marker. Example: "in_stock".
30
+ * @param {string} [langCode] - Language code. Default: "en_US".
31
+ * @return {IProductStatusEntity} Returns a product status object.
32
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
33
+ * @description Search for a product status object by its textual identifier (marker).
37
34
  */
38
35
  getProductsByStatusMarker(marker: string, langCode?: string): Promise<IProductStatusEntity | IError>;
39
36
  /**
40
37
  * Check the existence of a textual identifier.
41
38
  *
42
- * @param {string} [marker] - Product marker
39
+ * @handleName validateMarker
43
40
  *
44
- * @returns Returns true if the textual identifier (marker) exists or false if it doesn't
41
+ * @param {string} marker - Product marker. Example: "in_stock".
42
+ * @return {boolean} Returns true if the textual identifier (marker) exists or false if it doesn't.
43
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
44
+ * @description Check the existence of a textual identifier.
45
45
  */
46
46
  validateMarker(marker: string): Promise<boolean | IError>;
47
47
  }
@@ -16,33 +16,27 @@ class ProductStatusesApi extends asyncModules_1.default {
16
16
  /**
17
17
  * Search for all product status objects.
18
18
  *
19
- * @param {string} [langCode] - language code
19
+ * @handleName getProductStatuses
20
20
  *
21
- * @returns Returns an array of product status objects
21
+ * @param {string} [langCode] - Language code. Default: "en_US".
22
+ * @return {IProductStatusEntity[]} Returns an array of product status objects.
23
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
24
+ * @description Search for all product status objects.
22
25
  */
23
26
  async getProductStatuses(langCode = this.state.lang) {
24
27
  const result = await this._fetchGet('');
25
28
  return this._normalizeData(result, langCode);
26
29
  }
27
- /**
28
- * Search for a product status object by identifier.
29
- *
30
- * @param {number} [id] - Status id
31
- * @param {string} [langCode] - language code
32
- *
33
- * @returns Returns a product status object
34
- */
35
- async getProductStatusesById(id, langCode = this.state.lang) {
36
- const result = await this._fetchGet(`/${id}`);
37
- return this._normalizeData(result, langCode);
38
- }
39
30
  /**
40
31
  * Search for a product status object by its textual identifier (marker).
41
32
  *
42
- * @param {string} [marker] - Product marker
43
- * @param {string} [langCode] - language code
33
+ * @handleName getProductsByStatusMarker
44
34
  *
45
- * @returns Returns a product status object
35
+ * @param {string} marker - Product marker. Example: "in_stock".
36
+ * @param {string} [langCode] - Language code. Default: "en_US".
37
+ * @return {IProductStatusEntity} Returns a product status object.
38
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
39
+ * @description Search for a product status object by its textual identifier (marker).
46
40
  */
47
41
  async getProductsByStatusMarker(marker, langCode = this.state.lang) {
48
42
  const result = await this._fetchGet(`/marker/${marker}`);
@@ -51,9 +45,12 @@ class ProductStatusesApi extends asyncModules_1.default {
51
45
  /**
52
46
  * Check the existence of a textual identifier.
53
47
  *
54
- * @param {string} [marker] - Product marker
48
+ * @handleName validateMarker
55
49
  *
56
- * @returns Returns true if the textual identifier (marker) exists or false if it doesn't
50
+ * @param {string} marker - Product marker. Example: "in_stock".
51
+ * @return {boolean} Returns true if the textual identifier (marker) exists or false if it doesn't.
52
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
53
+ * @description Check the existence of a textual identifier.
57
54
  */
58
55
  async validateMarker(marker) {
59
56
  const result = await this._fetchGet(`/marker-validation/${marker}`);