oneentry 1.0.145 → 1.0.147

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 (43) hide show
  1. package/dist/admins/adminsApi.d.ts +4 -3
  2. package/dist/admins/adminsApi.js +1 -1
  3. package/dist/admins/adminsInterfaces.d.ts +4 -4
  4. package/dist/admins/adminsSchemas.d.ts +24 -8
  5. package/dist/admins/adminsSchemas.js +11 -5
  6. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +121 -24
  7. package/dist/auth-provider/authProvidersInterfaces.d.ts +43 -36
  8. package/dist/base/utils.d.ts +159 -53
  9. package/dist/blocks/blocksApi.d.ts +3 -3
  10. package/dist/blocks/blocksApi.js +1 -1
  11. package/dist/blocks/blocksInterfaces.d.ts +7 -7
  12. package/dist/blocks/blocksSchemas.d.ts +52 -8
  13. package/dist/discounts/discountsApi.d.ts +7 -7
  14. package/dist/discounts/discountsApi.js +3 -3
  15. package/dist/discounts/discountsInterfaces.d.ts +79 -33
  16. package/dist/forms/formsInterfaces.d.ts +85 -15
  17. package/dist/forms-data/formsDataInterfaces.d.ts +142 -67
  18. package/dist/menus/menusInterfaces.d.ts +1 -1
  19. package/dist/orders/ordersApi.d.ts +4 -4
  20. package/dist/orders/ordersApi.js +2 -2
  21. package/dist/orders/ordersInterfaces.d.ts +97 -24
  22. package/dist/orders/ordersSchemas.d.ts +73 -2
  23. package/dist/orders/ordersSchemas.js +32 -3
  24. package/dist/pages/pagesApi.js +1 -1
  25. package/dist/pages/pagesInterfaces.d.ts +8 -8
  26. package/dist/payments/paymentsApi.d.ts +3 -3
  27. package/dist/payments/paymentsApi.js +2 -2
  28. package/dist/payments/paymentsInterfaces.d.ts +45 -56
  29. package/dist/payments/paymentsSchemas.d.ts +4 -10
  30. package/dist/payments/paymentsSchemas.js +2 -11
  31. package/dist/products/productsApi.d.ts +26 -19
  32. package/dist/products/productsApi.js +27 -20
  33. package/dist/products/productsInterfaces.d.ts +109 -33
  34. package/dist/products/productsSchemas.d.ts +52 -8
  35. package/dist/products/productsSchemas.js +15 -2
  36. package/dist/sitemap/sitemapApi.d.ts +5 -5
  37. package/dist/sitemap/sitemapApi.js +2 -2
  38. package/dist/sitemap/sitemapInterfaces.d.ts +32 -21
  39. package/dist/templates/templatesApi.js +8 -3
  40. package/dist/templates/templatesInterfaces.d.ts +3 -3
  41. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +22 -8
  42. package/dist/users/usersInterfaces.d.ts +7 -11
  43. package/package.json +1 -1
@@ -1,4 +1,8 @@
1
- import type { IError } from '../base/utils';
1
+ import type { IAttributeValues, IError, ILocalizeInfo } from '../base/utils';
2
+ /**
3
+ * Discount type.
4
+ */
5
+ type IDiscountType = 'DISCOUNT' | 'BONUS' | 'PERSONAL_DISCOUNT';
2
6
  /**
3
7
  * Interface for the Discounts API module.
4
8
  * @interface IDiscountsApi
@@ -10,12 +14,12 @@ interface IDiscountsApi {
10
14
  * @param {string} [langCode] - Language code. Default: "en_US".
11
15
  * @param {number} [offset] - Optional parameter for pagination. Default: 0.
12
16
  * @param {number} [limit] - Optional parameter for pagination. Default: 30.
13
- * @param {string} [type] - Optional parameter to filter discounts by type.
17
+ * @param {IDiscountType} [type] - Optional parameter to filter discounts by type.
14
18
  * @returns {Promise<IDiscountsResponse | IError>} Returns an object containing all discounts or an error object if there was an issue.
15
19
  * @throws {IError} When isShell=false and an error occurs during the fetch
16
20
  * @description Fetches all discounts from the server.
17
21
  */
18
- getAllDiscounts(langCode?: string, offset?: number, limit?: number, type?: 'DISCOUNT' | 'BONUS' | 'PERSONAL_DISCOUNT'): Promise<IDiscountsResponse | IError>;
22
+ getAllDiscounts(langCode?: string, offset?: number, limit?: number, type?: IDiscountType): Promise<IDiscountsResponse | IError>;
19
23
  /**
20
24
  * Get discount by marker
21
25
  * @handleName getDiscountByMarker
@@ -38,10 +42,10 @@ interface IDiscountsApi {
38
42
  /**
39
43
  * Get bonus balance of the current user.
40
44
  * @handleName getBonusBalance
41
- * @returns {Promise<IDiscountsEntity | IError>} Returns bonus balance or an error object.
45
+ * @returns {Promise<IBonusBalanceEntity | IError>} Returns bonus balance or an error object.
42
46
  * @throws {IError} When isShell=false and an error occurs during the fetch
43
47
  */
44
- getBonusBalance(): Promise<IDiscountsEntity | IError>;
48
+ getBonusBalance(): Promise<IBonusBalanceEntity | IError>;
45
49
  /**
46
50
  * Get bonus transaction history of the current user.
47
51
  * @handleName getBonusHistory
@@ -54,18 +58,18 @@ interface IDiscountsApi {
54
58
  * @returns {Promise<IBonusTransactionEntity[] | IError>} Returns array of bonus transactions or an error object.
55
59
  * @throws {IError} When isShell=false and an error occurs during the fetch
56
60
  */
57
- getBonusHistory(type?: BonusTransactionType, dateFrom?: string, dateTo?: string, discountId?: number, moduleId?: number, isAdmin?: boolean): Promise<IBonusTransactionEntity[] | IError>;
61
+ getBonusHistory(type?: IBonusTransactionType, dateFrom?: string, dateTo?: string, discountId?: number, moduleId?: number, isAdmin?: boolean): Promise<IBonusTransactionEntity[] | IError>;
58
62
  }
59
63
  /**
60
64
  * Query parameters for fetching discounts.
61
65
  * @interface IDiscountsQuery
62
- * @property {'DISCOUNT' | 'BONUS' | 'PERSONAL_DISCOUNT'} [type] - Filter discounts by type.
66
+ * @property {IDiscountType} [type] - Filter discounts by type.
63
67
  * @property {string} langCode - The language code for localization. Example: "en_US".
64
68
  * @property {number} [offset] - Offset for pagination. Default: 0.
65
69
  * @property {number} [limit] - Limit for pagination. Default: 30.
66
70
  */
67
71
  interface IDiscountsQuery {
68
- type?: 'DISCOUNT' | 'BONUS' | 'PERSONAL_DISCOUNT';
72
+ type?: IDiscountType;
69
73
  langCode: string;
70
74
  offset?: number;
71
75
  limit?: number;
@@ -85,21 +89,21 @@ interface IDiscountCondition {
85
89
  * @interface IDiscountsEntity
86
90
  * @property {number} id - The unique identifier of the discount.
87
91
  * @property {number} [attributeSetId] - The identifier of the discount.
88
- * @property {object} [localizeInfos] - The name of the discount.
92
+ * @property {ILocalizeInfo} [localizeInfos] - The name of the discount.
89
93
  * @property {number} [version] - The version of the discount.
90
94
  * @property {string} [identifier] - The identifier of the discount.
91
- * @property {string} [type] - The type of the discount.
95
+ * @property {IDiscountType} type - The type of the discount.
92
96
  * @property {string} [startDate] - The start date of the discount.
93
97
  * @property {string} [endDate] - The end date of the discount.
94
- * @property {Record<string, unknown>} [discountValue] - The value of the discount.
98
+ * @property {IDiscountValue} [discountValue] - The value of the discount, including its type and amount limits.
95
99
  * @property {string} [conditionLogic] - The logic of the discount. Possible values are "AND" | "OR".
96
100
  * @property {IDiscountCondition[]} [conditions] - The conditions of the discount.
97
- * @property {object} [exclusions] - The exclusions of the discount.
98
- * @property {object} [gifts] - The gifts of the discount.
101
+ * @property {Record<string, unknown> | null} [exclusions] - The exclusions of the discount.
102
+ * @property {Record<string, unknown> | null} [gifts] - The gifts of the discount.
99
103
  * @property {boolean} [giftsReplaceCartItems] - Whether the gifts replace cart items.
100
- * @property {object} [userGroups] - The user groups of the discount.
101
- * @property {object} [userExclusions] - The user exclusions of the discount.
102
- * @property {object} [attributeValues] - The attribute values of the discount.
104
+ * @property {Record<string, unknown> | null} [userGroups] - The user groups of the discount.
105
+ * @property {Record<string, unknown> | null} [userExclusions] - The user exclusions of the discount.
106
+ * @property {IAttributeValues} [attributeValues] - The attribute values of the discount.
103
107
  * @property {string} [attributeSetIdentifier] - The identifier of the attribute set.
104
108
  * @property {Record<string, unknown>} [bonusEvent] - Bonus event configuration.
105
109
  * @property {number} [position] - Position number for sorting. Example: 1.
@@ -108,26 +112,60 @@ interface IDiscountCondition {
108
112
  interface IDiscountsEntity {
109
113
  id: number;
110
114
  attributeSetId?: number;
111
- localizeInfos?: object;
115
+ localizeInfos?: ILocalizeInfo;
112
116
  version?: number;
113
117
  identifier?: string;
114
- type: 'DISCOUNT' | 'BONUS' | 'PERSONAL_DISCOUNT';
118
+ type: IDiscountType;
115
119
  startDate?: string;
116
120
  endDate?: string;
117
- discountValue?: Record<string, unknown>;
121
+ discountValue?: IDiscountValue;
118
122
  conditionLogic?: 'AND' | 'OR';
119
123
  conditions?: IDiscountCondition[];
120
- exclusions?: object;
121
- gifts?: object;
124
+ exclusions?: Record<string, unknown> | null;
125
+ gifts?: Record<string, unknown> | null;
122
126
  giftsReplaceCartItems?: boolean;
123
- userGroups?: object;
124
- userExclusions?: object;
125
- attributeValues?: object;
127
+ userGroups?: Record<string, unknown> | null;
128
+ userExclusions?: Record<string, unknown> | null;
129
+ attributeValues?: IAttributeValues;
126
130
  attributeSetIdentifier?: string;
127
- bonusEvent?: Record<string, unknown>;
131
+ bonusEvent?: Record<string, unknown> | null;
128
132
  position?: number;
129
133
  total?: number | string;
130
134
  }
135
+ /**
136
+ * @interface IDiscountValue
137
+ * @property {'TO_PRODUCT' | 'TO_ORDER'} applicability - What the discount applies to. Example: "TO_PRODUCT".
138
+ * @property {'FIXED_AMOUNT' | 'PERCENT'} discountType - How the discount value is interpreted. Example: "FIXED_AMOUNT".
139
+ * @property {number} value - Discount amount (currency units for FIXED_AMOUNT, percentage points for PERCENT). Example: 10.
140
+ * @property {number} [maxAmount] - Optional cap on the absolute discount applied. Example: 5.
141
+ * @description Configuration of the discount calculation.
142
+ */
143
+ interface IDiscountValue {
144
+ applicability: 'TO_PRODUCT' | 'TO_ORDER';
145
+ discountType: 'FIXED_AMOUNT' | 'PERCENT';
146
+ value: number;
147
+ maxAmount?: number;
148
+ }
149
+ /**
150
+ * @interface ICouponEntity
151
+ * @property {number} id - Coupon record id. Example: 1.
152
+ * @property {number} discountId - Discount the coupon belongs to. Example: 1.
153
+ * @property {string} code - Coupon code. Example: "SUMMER-KBWZ-2428".
154
+ * @property {boolean} isReusable - Whether the coupon can be used more than once. Example: false.
155
+ * @property {boolean} isUsed - Whether the coupon has already been used. Example: false.
156
+ * @property {number | null} orderId - Order id where the coupon was applied, or null. Example: null.
157
+ * @property {string | null} usedAt - When the coupon was used, or null. Example: null.
158
+ * @description Coupon entity returned by the discounts API.
159
+ */
160
+ interface ICouponEntity {
161
+ id: number;
162
+ discountId: number;
163
+ code: string;
164
+ isReusable: boolean;
165
+ isUsed: boolean;
166
+ orderId: number | null;
167
+ usedAt: string | null;
168
+ }
131
169
  /**
132
170
  * Paginated response for discounts list.
133
171
  * @interface IDiscountsResponse
@@ -150,12 +188,12 @@ interface IDiscountsValidateCoupon {
150
188
  * Result of coupon validation.
151
189
  * @interface ICouponValidationResult
152
190
  * @property {boolean} valid - Whether the coupon is valid.
153
- * @property {unknown} [coupon] - Coupon data if the coupon is valid.
191
+ * @property {ICouponEntity} [coupon] - Coupon data if the coupon is valid.
154
192
  * @property {string} [error] - Error message if the coupon is invalid.
155
193
  */
156
194
  interface ICouponValidationResult {
157
195
  valid: boolean;
158
- coupon?: unknown;
196
+ coupon?: ICouponEntity;
159
197
  error?: string;
160
198
  }
161
199
  /**
@@ -171,10 +209,10 @@ interface IDiscountByMarkerQuery {
171
209
  /**
172
210
  *
173
211
  */
174
- type BonusTransactionType = 'ACCRUAL' | 'USAGE' | 'REDUCE' | 'REVERSAL_ACCRUAL' | 'REVERSAL_USAGE' | 'EXPIRATION';
212
+ type IBonusTransactionType = 'ACCRUAL' | 'USAGE' | 'REDUCE' | 'REVERSAL_ACCRUAL' | 'REVERSAL_USAGE' | 'EXPIRATION';
175
213
  /**
176
214
  * @interface IBonusHistoryQuery
177
- * @property {BonusTransactionType} [type] - Transaction type filter.
215
+ * @property {IBonusTransactionType} [type] - Transaction type filter.
178
216
  * @property {string} [dateFrom] - Start date filter.
179
217
  * @property {string} [dateTo] - End date filter.
180
218
  * @property {number} [discountId] - Discount id filter.
@@ -182,7 +220,7 @@ type BonusTransactionType = 'ACCRUAL' | 'USAGE' | 'REDUCE' | 'REVERSAL_ACCRUAL'
182
220
  * @property {boolean} [isAdmin] - Admin filter.
183
221
  */
184
222
  interface IBonusHistoryQuery {
185
- type?: BonusTransactionType;
223
+ type?: IBonusTransactionType;
186
224
  dateFrom?: string;
187
225
  dateTo?: string;
188
226
  discountId?: number;
@@ -193,7 +231,7 @@ interface IBonusHistoryQuery {
193
231
  * @interface IBonusTransactionEntity
194
232
  * @property {number} balanceId - Balance id.
195
233
  * @property {number} amount - Transaction amount.
196
- * @property {BonusTransactionType} type - Transaction type.
234
+ * @property {IBonusTransactionType} type - Transaction type.
197
235
  * @property {number} [discountId] - Discount id.
198
236
  * @property {number} [moduleId] - Module id.
199
237
  * @property {string} [entityIdentifier] - Entity identifier.
@@ -207,7 +245,7 @@ interface IBonusHistoryQuery {
207
245
  interface IBonusTransactionEntity {
208
246
  balanceId: number;
209
247
  amount: number;
210
- type: BonusTransactionType;
248
+ type: IBonusTransactionType;
211
249
  discountId?: number;
212
250
  moduleId?: number;
213
251
  entityIdentifier?: string;
@@ -218,4 +256,12 @@ interface IBonusTransactionEntity {
218
256
  expiresAt?: string;
219
257
  createdAt?: string;
220
258
  }
221
- export type { BonusTransactionType, IBonusHistoryQuery, IBonusTransactionEntity, ICouponValidationResult, IDiscountByMarkerQuery, IDiscountCondition, IDiscountsApi, IDiscountsEntity, IDiscountsQuery, IDiscountsResponse, IDiscountsValidateCoupon, };
259
+ /**
260
+ * @interface IBonusBalanceEntity
261
+ * @description Represents the balance of bonus points.
262
+ * @property {number} balance - The balance of bonus points. Example: 100
263
+ */
264
+ interface IBonusBalanceEntity {
265
+ balance: number;
266
+ }
267
+ export type { IBonusBalanceEntity, IBonusHistoryQuery, IBonusTransactionEntity, IBonusTransactionType, ICouponEntity, ICouponValidationResult, IDiscountByMarkerQuery, IDiscountCondition, IDiscountsApi, IDiscountsEntity, IDiscountsQuery, IDiscountsResponse, IDiscountsValidateCoupon, IDiscountType, IDiscountValue, };
@@ -1,5 +1,6 @@
1
1
  import type { IPosition } from '../admins/adminsInterfaces';
2
- import type { IAttributes, IError, ILocalizeInfo } from '../base/utils';
2
+ import type { AttributeType, IAttributeValidators, IListTitle } from '../attribute-sets/attributeSetsInterfaces';
3
+ import type { IAttributeLocalizeInfo, IError, ILocalizeInfo } from '../base/utils';
3
4
  /**
4
5
  * Interface for retrieving forms in the system.
5
6
  * @interface IForms
@@ -60,7 +61,7 @@ interface IFromPages {
60
61
  * @property {number} id - The identifier of the object. Example: 12345.
61
62
  * @property {number | null} attributeSetId - The identifier of the attribute set being used, or null if not applicable. Example: 1234.
62
63
  * @property {string | null} type - Form type. Example: "contact".
63
- * @property {ILocalizeInfo} localizeInfos - The name of the form, taking into account localization.
64
+ * @property {IFormLocalizeInfo} localizeInfos - The name of the form and form-side localization fields (success/error messages, processing config, etc.).
64
65
  * @example
65
66
  {
66
67
  "key": "value"
@@ -70,11 +71,7 @@ interface IFromPages {
70
71
  * @property {string} identifier - The textual identifier for the record field. Example: "form_contact_us".
71
72
  * @property {string} processingType - Type of form processing. Example: "async".
72
73
  * @property {number | null} templateId - The identifier of the template used by the form, or null if no template is used. Example: 6789.
73
- * @property {IAttributes[] | Record<string, any>} [attributes] - The attributes of the form, which can be an array of attribute objects or a record of key-value pairs.
74
- * @example
75
- {
76
- "key": "value"
77
- }
74
+ * @property {IFormAttribute[]} attributes - Form fields with their localization, validators and form-specific flags.
78
75
  * @property {number | string} [total] - Total count of related entries. Example: "1".
79
76
  * @property {IFormConfig[]} [moduleFormConfigs] - Array of module form configurations associated with the form.
80
77
  * @description This interface defines the structure of a form entity, including its identifiers, attributes, and processing data.
@@ -83,16 +80,82 @@ interface IFormsEntity {
83
80
  id: number;
84
81
  attributeSetId: number | null;
85
82
  type: 'order' | 'sing_in_up' | 'collection' | 'data' | 'rating' | null;
86
- localizeInfos: ILocalizeInfo;
83
+ localizeInfos: IFormLocalizeInfo;
87
84
  version: number;
88
85
  position: number;
89
86
  identifier: string;
90
87
  processingType: string;
91
88
  templateId: number | null;
92
- attributes?: IAttributes[] | Record<string, unknown>;
89
+ attributes: IFormAttribute[];
93
90
  total?: number | string;
94
91
  moduleFormConfigs?: IFormConfig[];
95
92
  }
93
+ /**
94
+ * @interface IFormLocalizeInfo
95
+ * @property {string} [titleForSite] - Public-facing title shown on the website. Example: "Form title (for application)".
96
+ * @property {string} [successMessage] - Message shown to the user after successful submission.
97
+ * @property {string} [unsuccessMessage] - Message shown to the user after a failed submission.
98
+ * @property {string} [urlAddress] - URL where the form data is sent for processing (used by `processingType: "url"`).
99
+ * @property {string} [database] - Database flag/id used by the form processor (stringly-typed in the API: "0" / "1" / id).
100
+ * @property {string} [script] - Script flag/id used by the form processor (stringly-typed in the API: "0" / "1" / id).
101
+ * @description Localization payload of a form — extends {@link ILocalizeInfo} with form-side fields (messages, processing config).
102
+ */
103
+ interface IFormLocalizeInfo extends ILocalizeInfo {
104
+ titleForSite?: string;
105
+ successMessage?: string;
106
+ unsuccessMessage?: string;
107
+ urlAddress?: string;
108
+ database?: string;
109
+ script?: string;
110
+ }
111
+ /**
112
+ * @interface IFormAttribute
113
+ * @property {string} marker - Field marker (machine name). Example: "email".
114
+ * @property {AttributeType} type - Attribute data type (e.g. "string", "file").
115
+ * @property {number} position - Sort position of the field. Example: 1.
116
+ * @property {boolean} isVisible - Whether the field is exposed to the user. Example: true.
117
+ * @property {IAttributeLocalizeInfo} localizeInfos - Localized labels for the field. For `timeInterval` attributes, also carries the `intervals` schedule payload.
118
+ * @property {unknown} initialValue - Default value applied when the field is not filled.
119
+ * @property {IListTitle[]} listTitles - Predefined options for `list`/`radioButton` fields; empty array for other types.
120
+ * @property {IAttributeValidators} validators - Validation rules; empty object when no validators are configured.
121
+ * @property {Record<string, unknown>} settings - Field-specific configuration; empty object by default.
122
+ * @property {Record<string, IFormAttributeAdditionalField>} additionalFields - Nested sub-fields keyed by marker; empty object when none.
123
+ * @property {boolean} isLogin - Whether this field carries the login value used for authentication. Example: false.
124
+ * @property {boolean} isSignUp - Whether this field is required during sign-up. Example: false.
125
+ * @property {boolean} isNotificationEmail - Whether this field stores the email used for notifications. Example: false.
126
+ * @property {boolean} isNotificationPhonePush - Whether this field stores the phone number used for push notifications. Example: false.
127
+ * @property {boolean} isNotificationPhoneSMS - Whether this field stores the phone number used for SMS notifications. Example: false.
128
+ * @description Definition of a single field inside a form — extends a generic attribute with form-specific authentication / notification flags.
129
+ */
130
+ interface IFormAttribute {
131
+ marker: string;
132
+ type: AttributeType;
133
+ position: number;
134
+ isVisible: boolean;
135
+ localizeInfos: IAttributeLocalizeInfo;
136
+ initialValue: unknown;
137
+ listTitles: IListTitle[];
138
+ validators: IAttributeValidators;
139
+ settings: Record<string, unknown>;
140
+ additionalFields: Record<string, IFormAttributeAdditionalField>;
141
+ isLogin: boolean;
142
+ isSignUp: boolean;
143
+ isNotificationEmail: boolean;
144
+ isNotificationPhonePush: boolean;
145
+ isNotificationPhoneSMS: boolean;
146
+ }
147
+ /**
148
+ * @interface IFormAttributeAdditionalField
149
+ * @property {string} marker - Marker of the additional field. Example: "additional_field".
150
+ * @property {string} type - Type of the additional field. Example: "string".
151
+ * @property {unknown} value - Value of the additional field. Example: "Additional field data".
152
+ * @description A single nested entry inside {@link IFormAttribute}'s `additionalFields` map.
153
+ */
154
+ interface IFormAttributeAdditionalField {
155
+ marker: string;
156
+ type: string;
157
+ value: unknown;
158
+ }
96
159
  /**
97
160
  * Represents the structure of a form configuration.
98
161
  * @interface IFormConfig
@@ -112,7 +175,7 @@ interface IFormsEntity {
112
175
  * @property {string[]} [nestedEntityIdentifiers] - An array of nested entity identifier strings (only in products/pages API). Example: ["catalog"].
113
176
  * @property {string[]} [exceptionIds] - An array of exception identifiers.
114
177
  * @property {number} [formDataCount] - Total count of form data entries (only in products/pages API). Example: 306.
115
- * @property {Record<string, number>} [entityFormDataCount] - Form data count per entity identifier (only in products/pages API). Example: {"catalog": 306}.
178
+ * @property {Record<string, number>} [entityFormDataCount] - Form data count per entity identifier (only in products/pages API). Example: `{"catalog": 306}`.
116
179
  * @property {boolean | null} [isRating] - Indicates whether this form config is for ratings. Example: null.
117
180
  * @property {boolean | null} [isAnonymous] - Indicates whether anonymous submissions are allowed. Example: null.
118
181
  * @property {boolean | null} [allowHalfRatings] - Indicates whether half ratings are allowed. Example: null.
@@ -132,10 +195,7 @@ interface IFormConfig {
132
195
  commentOnlyUserData?: boolean;
133
196
  viewOnlyMyData?: boolean;
134
197
  commentOnlyMyData?: boolean;
135
- entityIdentifiers: {
136
- id: string;
137
- isNested: boolean;
138
- }[];
198
+ entityIdentifiers: IEntityIdentifier[];
139
199
  nestedEntityIdentifiers?: string[];
140
200
  exceptionIds?: string[];
141
201
  formDataCount?: number;
@@ -147,6 +207,16 @@ interface IFormConfig {
147
207
  maxRatingScale?: number | null;
148
208
  ratingCalculation?: string;
149
209
  }
210
+ /**
211
+ * @interface IEntityIdentifier
212
+ * @property {string} id - Entity identifier (e.g. page or product marker). Example: "blog".
213
+ * @property {boolean} isNested - Whether the entit, is treated as ,ested unde, its parent. Exa,ple: false.
214
+ * @description Refe,ence to an entity attached to a form configuration.
215
+ */
216
+ interface IEntityIdentifier {
217
+ id: string;
218
+ isNested: boolean;
219
+ }
150
220
  /**
151
221
  * Represents the paginated response structure for forms.
152
222
  * @interface IFormsResponse
@@ -157,4 +227,4 @@ interface IFormsResponse {
157
227
  total: number;
158
228
  items: IFormsEntity[];
159
229
  }
160
- export type { IFormConfig, IForms, IFormsEntity, IFormsResponse, IFromPages };
230
+ export type { IEntityIdentifier, IFormAttribute, IFormAttributeAdditionalField, IFormConfig, IFormLocalizeInfo, IForms, IFormsEntity, IFormsResponse, IFromPages, };
@@ -241,22 +241,37 @@ interface IFormsByMarkerDataEntity {
241
241
  "value": "Jack"
242
242
  }
243
243
  ]
244
- * @property {string | Record<string, string>} actionMessage - Action message for the form data (can be localized). Example: "Form submitted successfully" or { "en_US": "Success" }.
244
+ * @property {string} actionMessage - Action message for the form data (can be localized). Example: "Form submitted successfully".
245
245
  */
246
246
  interface IPostFormResponse {
247
- actionMessage: string | Record<string, any>;
248
- formData: {
249
- id: number;
250
- formIdentifier: string;
251
- time: string;
252
- entityIdentifier: string;
253
- fingerprint: string;
254
- isUserAdmin: boolean;
255
- formModuleId: number;
256
- userIdentifier: string | null;
257
- parentId: number | null;
258
- formData: FormDataType[] | Record<string, any>;
259
- };
247
+ formData: IPostFormResponseData;
248
+ actionMessage: string;
249
+ }
250
+ /**
251
+ * @interface IPostFormResponseData
252
+ * @property {number} id - Identifier of the created form data record. Example: 42.
253
+ * @property {string} formIdentifier - Identifier of the form. Example: "contact_form".
254
+ * @property {string} time - Time of submission. Example: "2023-10-01T12:00:00Z".
255
+ * @property {string} entityIdentifier - Identifier of the entity the form is attached to. Example: "blog".
256
+ * @property {string} fingerprint - Submission fingerprint.
257
+ * @property {boolean} isUserAdmin - Whether the submitting user is an administrator. Example: false.
258
+ * @property {number} formModuleId - Form module configuration identifier. Example: 2.
259
+ * @property {string | null} userIdentifier - Identifier of the submitting user, or null when anonymous.
260
+ * @property {number | null} parentId - Identifier of the parent record, or null when top-level.
261
+ * @property {FormDataType[]} formData - Submitted form fields.
262
+ * @description Inner `formData` payload of {@link IPostFormResponse} — describes the created form data record.
263
+ */
264
+ interface IPostFormResponseData {
265
+ id: number;
266
+ formIdentifier: string;
267
+ time: string;
268
+ entityIdentifier: string;
269
+ fingerprint: string;
270
+ isUserAdmin: boolean;
271
+ formModuleId: number;
272
+ userIdentifier: string | null;
273
+ parentId: number | null;
274
+ formData: FormDataType[];
260
275
  }
261
276
  /**
262
277
  * Represents the structure of the response after updating form data.
@@ -356,11 +371,19 @@ interface IBodyTypeStringNumberFloat {
356
371
  interface IBodyTypeTimeDate {
357
372
  marker: string;
358
373
  type: 'date' | 'dateTime' | 'time';
359
- value: {
360
- fullDate: string;
361
- formattedValue: string;
362
- formatString: string;
363
- };
374
+ value: ITimeDateValue;
375
+ }
376
+ /**
377
+ * @interface ITimeDateValue
378
+ * @property {string} fullDate - ISO date string. Example: "2024-05-07T21:02:00.000Z".
379
+ * @property {string} formattedValue - Human-readable formatted date. Example: "08-05-2024 00:02".
380
+ * @property {string} formatString - Format mask used to render `formattedValue`. Example: "DD-MM-YYYY HH:mm".
381
+ * @description Value payload for `date`/`dateTime`/`time` form fields.
382
+ */
383
+ interface ITimeDateValue {
384
+ fullDate: string;
385
+ formattedValue: string;
386
+ formatString: string;
364
387
  }
365
388
  /**
366
389
  * Represents a text form data entity.
@@ -382,14 +405,29 @@ interface IBodyTypeTimeDate {
382
405
  interface IBodyTypeText {
383
406
  marker: string;
384
407
  type: 'text';
385
- value: {
386
- htmlValue: string;
387
- plainValue: string;
388
- params: {
389
- isEditorDisabled: boolean;
390
- isImageCompressed: boolean;
391
- };
392
- };
408
+ value: ITextValue;
409
+ }
410
+ /**
411
+ * @interface ITextEditorParams
412
+ * @property {boolean} isEditorDisabled - Whether the rich-text editor is disabled. Example: false.
413
+ * @property {boolean} isImageCompressed - Whether embedded images are compressed. Example: true.
414
+ * @description Editor parameters attached to text-type form values.
415
+ */
416
+ interface ITextEditorParams {
417
+ isEditorDisabled: boolean;
418
+ isImageCompressed: boolean;
419
+ }
420
+ /**
421
+ * @interface ITextValue
422
+ * @property {string} htmlValue - HTML representation of the text. Example: "<p>Hello world</p>".
423
+ * @property {string} plainValue - Plain-text representation.
424
+ * @property {ITextEditorParams} params - Editor configuration applied to this value.
425
+ * @description Value payload for `text` form fields.
426
+ */
427
+ interface ITextValue {
428
+ htmlValue: string;
429
+ plainValue: string;
430
+ params: ITextEditorParams;
393
431
  }
394
432
  /**
395
433
  * Represents a text with header form data entity.
@@ -412,15 +450,21 @@ interface IBodyTypeText {
412
450
  interface IBodyTypeTextWithHeader {
413
451
  marker: string;
414
452
  type: 'textWithHeader';
415
- value: {
416
- header: string;
417
- htmlValue: string;
418
- plainValue: string;
419
- params: {
420
- isEditorDisabled: boolean;
421
- isImageCompressed: boolean;
422
- };
423
- };
453
+ value: ITextWithHeaderValue;
454
+ }
455
+ /**
456
+ * @interface ITextWithHeaderValue
457
+ * @property {string} header - Headline text. Example: "Headline".
458
+ * @property {string} htmlValue - HTML body. Example: "<p>Hello world</p>".
459
+ * @property {string} plainValue - Plain-text body.
460
+ * @property {ITextEditorParams} params - Editor configuration applied to this value.
461
+ * @description Value payload for `textWithHeader` form fields.
462
+ */
463
+ interface ITextWithHeaderValue {
464
+ header: string;
465
+ htmlValue: string;
466
+ plainValue: string;
467
+ params: ITextEditorParams;
424
468
  }
425
469
  /**
426
470
  * Represents an image or group of images form data entity.
@@ -445,23 +489,31 @@ interface IBodyTypeTextWithHeader {
445
489
  interface IBodyTypeImageGroupOfImages {
446
490
  marker: string;
447
491
  type: 'image' | 'groupOfImage';
448
- value: {
449
- filename: string;
450
- downloadLink: string;
451
- size: number;
452
- previewLink: string;
453
- params: {
454
- isImageCompressed: boolean;
455
- };
456
- } | Array<{
457
- filename: string;
458
- downloadLink: string;
459
- size: number;
460
- previewLink: string;
461
- params: {
462
- isImageCompressed: boolean;
463
- };
464
- }>;
492
+ value: IImageValue | IImageValue[];
493
+ }
494
+ /**
495
+ * @interface IImageValueParams
496
+ * @property {boolean} isImageCompressed - Whether the stored image has been compressed by the server. Example: true.
497
+ * @description Per-image parameters attached to an image form value.
498
+ */
499
+ interface IImageValueParams {
500
+ isImageCompressed: boolean;
501
+ }
502
+ /**
503
+ * @interface IImageValue
504
+ * @property {string} filename - Server-side path to the image. Example: "files/project/page/10/image/foo.png".
505
+ * @property {string} downloadLink - Public URL to download the image.
506
+ * @property {number} size - File size in bytes. Example: 392585.
507
+ * @property {string} previewLink - URL to a preview-sized version (may be empty).
508
+ * @property {IImageValueParams} params - Image-specific parameters.
509
+ * @description Value payload for `image`/`groupOfImage` form fields.
510
+ */
511
+ interface IImageValue {
512
+ filename: string;
513
+ downloadLink: string;
514
+ size: number;
515
+ previewLink: string;
516
+ params: IImageValueParams;
465
517
  }
466
518
  /**
467
519
  * Represents a file form data entity.
@@ -482,11 +534,19 @@ interface IBodyTypeImageGroupOfImages {
482
534
  interface IBodyTypeFile {
483
535
  marker: string;
484
536
  type: 'file';
485
- value: {
486
- filename: string;
487
- downloadLink: string;
488
- size: number;
489
- };
537
+ value: IFileValue;
538
+ }
539
+ /**
540
+ * @interface IFileValue
541
+ * @property {string} filename - Server-side path to the file.
542
+ * @property {string} downloadLink - Public URL to download the file.
543
+ * @property {number} size - File size in bytes.
544
+ * @description Value payload for `file` form fields.
545
+ */
546
+ interface IFileValue {
547
+ filename: string;
548
+ downloadLink: string;
549
+ size: number;
490
550
  }
491
551
  /**
492
552
  * Represents a radio button or list selection form data entity.
@@ -510,13 +570,28 @@ interface IBodyTypeFile {
510
570
  interface IBodyTypeRadioButtonList {
511
571
  marker: string;
512
572
  type: 'list' | 'radioButton';
513
- value: Array<{
514
- title: string;
515
- value: string;
516
- extended: {
517
- value: string;
518
- type: string;
519
- };
520
- }>;
573
+ value: IListOptionValue[];
574
+ }
575
+ /**
576
+ * @interface IListOptionExtended
577
+ * @property {string} value - Extended option value (e.g. color code "#ff0000"). Example: "red".
578
+ * @property {string} type - Type of the extended value (e.g. "string", "color"). Example: "string".
579
+ * @description Extended payload attached to a list/radio option.
580
+ */
581
+ interface IListOptionExtended {
582
+ value: string;
583
+ type: string;
584
+ }
585
+ /**
586
+ * @interface IListOptionValue
587
+ * @property {string} title - Option title shown to the user.
588
+ * @property {string} value - Underlying option value.
589
+ * @property {IListOptionExtended} extended - Extended payload (e.g. color/code) attached to the option.
590
+ * @description Value payload for `list`/`radioButton` form fields.
591
+ */
592
+ interface IListOptionValue {
593
+ title: string;
594
+ value: string;
595
+ extended: IListOptionExtended;
521
596
  }
522
- export type { FormDataType, IBodyPostFormData, IBodyTypeFile, IBodyTypeImageGroupOfImages, IBodyTypeRadioButtonList, IBodyTypeStringNumberFloat, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeTimeDate, IFormByMarkerDataEntity, IFormDataEntity, IFormsByMarkerDataEntity, IFormsData, IFormsDataEntity, IPostFormResponse, IUpdateFormsData, };
597
+ export type { FormDataType, IBodyPostFormData, IBodyTypeFile, IBodyTypeImageGroupOfImages, IBodyTypeRadioButtonList, IBodyTypeStringNumberFloat, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeTimeDate, IFileValue, IFormByMarkerDataEntity, IFormDataEntity, IFormsByMarkerDataEntity, IFormsData, IFormsDataEntity, IImageValue, IImageValueParams, IListOptionExtended, IListOptionValue, IPostFormResponse, IPostFormResponseData, ITextEditorParams, ITextValue, ITextWithHeaderValue, ITimeDateValue, IUpdateFormsData, };
@@ -82,6 +82,6 @@ interface IMenusEntity {
82
82
  id: number;
83
83
  identifier: string;
84
84
  localizeInfos: ILocalizeInfo;
85
- pages: IMenusPages[] | IMenusPages;
85
+ pages: IMenusPages[];
86
86
  }
87
87
  export type { IMenus, IMenusEntity, IMenusPages };