oneentry 1.0.159 → 1.0.161
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 +2 -0
- package/changelog.md +56 -1
- package/dist/admins/adminsApi.d.ts +15 -1
- package/dist/admins/adminsApi.js +29 -0
- package/dist/admins/adminsInterfaces.d.ts +37 -1
- package/dist/base/lazySchema.d.ts +15 -0
- package/dist/base/lazySchema.js +20 -0
- package/dist/discounts/discountsApi.d.ts +14 -1
- package/dist/discounts/discountsApi.js +21 -0
- package/dist/discounts/discountsInterfaces.d.ts +27 -1
- package/dist/filters/filtersInterfaces.d.ts +2 -2
- package/dist/filters/filtersSchemas.d.ts +1 -1
- package/dist/filters/filtersSchemas.js +4 -1
- package/dist/forms-data/formsDataApi.d.ts +14 -1
- package/dist/forms-data/formsDataApi.js +21 -0
- package/dist/forms-data/formsDataInterfaces.d.ts +74 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/orders/ordersApi.d.ts +15 -1
- package/dist/orders/ordersApi.js +22 -0
- package/dist/orders/ordersInterfaces.d.ts +27 -1
- package/dist/pages/pagesApi.d.ts +14 -1
- package/dist/pages/pagesApi.js +21 -0
- package/dist/pages/pagesInterfaces.d.ts +38 -1
- package/dist/payments/paymentsInterfaces.d.ts +2 -2
- package/dist/products/productsInterfaces.d.ts +1 -1
- package/dist/search/searchApi.d.ts +35 -0
- package/dist/search/searchApi.js +86 -0
- package/dist/search/searchInterfaces.d.ts +94 -0
- package/dist/search/searchInterfaces.js +2 -0
- package/dist/search/searchSchemas.d.ts +73 -0
- package/dist/search/searchSchemas.js +44 -0
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +0 -2
- package/dist/templates-preview/templatesPreviewSchemas.d.ts +0 -2
- package/dist/templates-preview/templatesPreviewSchemas.js +0 -1
- package/dist/types.d.ts +35 -0
- package/dist/types.js +2 -0
- package/dist/users/usersApi.d.ts +15 -1
- package/dist/users/usersApi.js +22 -0
- package/dist/users/usersInterfaces.d.ts +39 -1
- package/dist/web-socket/lazySocket.d.ts +18 -0
- package/dist/web-socket/lazySocket.js +70 -0
- package/esm/admins/adminsApi.d.ts +66 -0
- package/esm/admins/adminsApi.js +90 -0
- package/esm/admins/adminsInterfaces.d.ts +137 -0
- package/esm/admins/adminsInterfaces.js +1 -0
- package/esm/admins/adminsSchemas.d.ts +48 -0
- package/esm/admins/adminsSchemas.js +31 -0
- package/esm/attribute-sets/attributeSetsApi.d.ts +67 -0
- package/esm/attribute-sets/attributeSetsApi.js +97 -0
- package/esm/attribute-sets/attributeSetsInterfaces.d.ts +285 -0
- package/esm/attribute-sets/attributeSetsInterfaces.js +1 -0
- package/esm/attribute-sets/attributeSetsSchemas.d.ts +84 -0
- package/esm/attribute-sets/attributeSetsSchemas.js +66 -0
- package/esm/auth-provider/authProviderApi.d.ts +262 -0
- package/esm/auth-provider/authProviderApi.js +362 -0
- package/esm/auth-provider/authProviderSchemas.d.ts +124 -0
- package/esm/auth-provider/authProviderSchemas.js +92 -0
- package/esm/auth-provider/authProvidersInterfaces.d.ts +430 -0
- package/esm/auth-provider/authProvidersInterfaces.js +1 -0
- package/esm/base/asyncModules.d.ts +123 -0
- package/esm/base/asyncModules.js +382 -0
- package/esm/base/lazySchema.d.ts +15 -0
- package/esm/base/lazySchema.js +17 -0
- package/esm/base/stateModule.d.ts +35 -0
- package/esm/base/stateModule.js +51 -0
- package/esm/base/syncModules.d.ts +245 -0
- package/esm/base/syncModules.js +555 -0
- package/esm/base/timeIntervals.d.ts +95 -0
- package/esm/base/timeIntervals.js +317 -0
- package/esm/base/utils.d.ts +354 -0
- package/esm/base/utils.js +1 -0
- package/esm/base/validation.d.ts +98 -0
- package/esm/base/validation.js +118 -0
- package/esm/blocks/blocksApi.d.ts +252 -0
- package/esm/blocks/blocksApi.js +394 -0
- package/esm/blocks/blocksInterfaces.d.ts +361 -0
- package/esm/blocks/blocksInterfaces.js +1 -0
- package/esm/blocks/blocksSchemas.d.ts +213 -0
- package/esm/blocks/blocksSchemas.js +40 -0
- package/esm/discounts/discountsApi.d.ts +94 -0
- package/esm/discounts/discountsApi.js +136 -0
- package/esm/discounts/discountsInterfaces.d.ts +293 -0
- package/esm/discounts/discountsInterfaces.js +1 -0
- package/esm/events/eventsApi.d.ts +108 -0
- package/esm/events/eventsApi.js +141 -0
- package/esm/events/eventsInterfaces.d.ts +176 -0
- package/esm/events/eventsInterfaces.js +1 -0
- package/esm/file-uploading/fileUploadingApi.d.ts +91 -0
- package/esm/file-uploading/fileUploadingApi.js +127 -0
- package/esm/file-uploading/fileUploadingInterfaces.d.ts +116 -0
- package/esm/file-uploading/fileUploadingInterfaces.js +1 -0
- package/esm/file-uploading/fileUploadingSchemas.d.ts +24 -0
- package/esm/file-uploading/fileUploadingSchemas.js +19 -0
- package/esm/filters/filtersApi.d.ts +32 -0
- package/esm/filters/filtersApi.js +36 -0
- package/esm/filters/filtersInterfaces.d.ts +56 -0
- package/esm/filters/filtersInterfaces.js +1 -0
- package/esm/filters/filtersSchemas.d.ts +32 -0
- package/esm/filters/filtersSchemas.js +29 -0
- package/esm/forms/formsApi.d.ts +44 -0
- package/esm/forms/formsApi.js +54 -0
- package/esm/forms/formsInterfaces.d.ts +237 -0
- package/esm/forms/formsInterfaces.js +1 -0
- package/esm/forms/formsSchemas.d.ts +56 -0
- package/esm/forms/formsSchemas.js +32 -0
- package/esm/forms-data/formsDataApi.d.ts +124 -0
- package/esm/forms-data/formsDataApi.js +210 -0
- package/esm/forms-data/formsDataInterfaces.d.ts +670 -0
- package/esm/forms-data/formsDataInterfaces.js +1 -0
- package/esm/forms-data/formsDataSchemas.d.ts +107 -0
- package/esm/forms-data/formsDataSchemas.js +83 -0
- package/esm/general-types/generalTypesApi.d.ts +29 -0
- package/esm/general-types/generalTypesApi.js +34 -0
- package/esm/general-types/generalTypesInterfaces.d.ts +29 -0
- package/esm/general-types/generalTypesInterfaces.js +1 -0
- package/esm/general-types/generalTypesSchemas.d.ts +68 -0
- package/esm/general-types/generalTypesSchemas.js +42 -0
- package/esm/index.d.ts +143 -0
- package/esm/index.js +124 -0
- package/esm/integration-collections/integrationCollectionsApi.d.ts +172 -0
- package/esm/integration-collections/integrationCollectionsApi.js +224 -0
- package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +317 -0
- package/esm/integration-collections/integrationCollectionsInterfaces.js +1 -0
- package/esm/integration-collections/integrationCollectionsSchemas.d.ts +84 -0
- package/esm/integration-collections/integrationCollectionsSchemas.js +60 -0
- package/esm/locales/localesApi.d.ts +28 -0
- package/esm/locales/localesApi.js +33 -0
- package/esm/locales/localesInterfaces.d.ts +40 -0
- package/esm/locales/localesInterfaces.js +1 -0
- package/esm/locales/localesSchemas.d.ts +32 -0
- package/esm/locales/localesSchemas.js +23 -0
- package/esm/menus/menusApi.d.ts +30 -0
- package/esm/menus/menusApi.js +35 -0
- package/esm/menus/menusInterfaces.d.ts +87 -0
- package/esm/menus/menusInterfaces.js +2 -0
- package/esm/menus/menusSchemas.d.ts +16 -0
- package/esm/menus/menusSchemas.js +25 -0
- package/esm/orders/ordersApi.d.ts +213 -0
- package/esm/orders/ordersApi.js +288 -0
- package/esm/orders/ordersInterfaces.d.ts +763 -0
- package/esm/orders/ordersInterfaces.js +1 -0
- package/esm/orders/ordersSchemas.d.ts +312 -0
- package/esm/orders/ordersSchemas.js +171 -0
- package/esm/package.json +4 -0
- package/esm/pages/pagesApi.d.ts +173 -0
- package/esm/pages/pagesApi.js +414 -0
- package/esm/pages/pagesInterfaces.d.ts +344 -0
- package/esm/pages/pagesInterfaces.js +1 -0
- package/esm/pages/pagesSchemas.d.ts +121 -0
- package/esm/pages/pagesSchemas.js +60 -0
- package/esm/payments/paymentsApi.d.ts +88 -0
- package/esm/payments/paymentsApi.js +122 -0
- package/esm/payments/paymentsInterfaces.d.ts +189 -0
- package/esm/payments/paymentsInterfaces.js +1 -0
- package/esm/payments/paymentsSchemas.d.ts +94 -0
- package/esm/payments/paymentsSchemas.js +53 -0
- package/esm/product-statuses/productStatusesApi.d.ts +50 -0
- package/esm/product-statuses/productStatusesApi.js +68 -0
- package/esm/product-statuses/productStatusesInterfaces.d.ts +62 -0
- package/esm/product-statuses/productStatusesInterfaces.js +1 -0
- package/esm/product-statuses/productStatusesSchemas.d.ts +34 -0
- package/esm/product-statuses/productStatusesSchemas.js +27 -0
- package/esm/products/productsApi.d.ts +366 -0
- package/esm/products/productsApi.js +468 -0
- package/esm/products/productsInterfaces.d.ts +723 -0
- package/esm/products/productsInterfaces.js +1 -0
- package/esm/products/productsSchemas.d.ts +234 -0
- package/esm/products/productsSchemas.js +121 -0
- package/esm/search/searchApi.d.ts +35 -0
- package/esm/search/searchApi.js +47 -0
- package/esm/search/searchInterfaces.d.ts +94 -0
- package/esm/search/searchInterfaces.js +1 -0
- package/esm/search/searchSchemas.d.ts +73 -0
- package/esm/search/searchSchemas.js +41 -0
- package/esm/sitemap/sitemapApi.d.ts +37 -0
- package/esm/sitemap/sitemapApi.js +41 -0
- package/esm/sitemap/sitemapInterfaces.d.ts +51 -0
- package/esm/sitemap/sitemapInterfaces.js +1 -0
- package/esm/subscriptions/subscriptionsApi.d.ts +74 -0
- package/esm/subscriptions/subscriptionsApi.js +90 -0
- package/esm/subscriptions/subscriptionsInterfaces.d.ts +111 -0
- package/esm/subscriptions/subscriptionsInterfaces.js +1 -0
- package/esm/subscriptions/subscriptionsSchemas.d.ts +46 -0
- package/esm/subscriptions/subscriptionsSchemas.js +38 -0
- package/esm/system/systemApi.d.ts +46 -0
- package/esm/system/systemApi.js +53 -0
- package/esm/system/systemInterfaces.d.ts +29 -0
- package/esm/system/systemInterfaces.js +1 -0
- package/esm/templates/templatesApi.d.ts +53 -0
- package/esm/templates/templatesApi.js +78 -0
- package/esm/templates/templatesInterfaces.d.ts +68 -0
- package/esm/templates/templatesInterfaces.js +1 -0
- package/esm/templates/templatesSchemas.d.ts +48 -0
- package/esm/templates/templatesSchemas.js +28 -0
- package/esm/templates-preview/templatesPreviewApi.d.ts +40 -0
- package/esm/templates-preview/templatesPreviewApi.js +50 -0
- package/esm/templates-preview/templatesPreviewInterfaces.d.ts +129 -0
- package/esm/templates-preview/templatesPreviewInterfaces.js +1 -0
- package/esm/templates-preview/templatesPreviewSchemas.d.ts +79 -0
- package/esm/templates-preview/templatesPreviewSchemas.js +43 -0
- package/esm/types.d.ts +35 -0
- package/esm/types.js +1 -0
- package/esm/user-activity/userActivityApi.d.ts +31 -0
- package/esm/user-activity/userActivityApi.js +37 -0
- package/esm/user-activity/userActivityInterfaces.d.ts +42 -0
- package/esm/user-activity/userActivityInterfaces.js +1 -0
- package/esm/users/usersApi.d.ts +249 -0
- package/esm/users/usersApi.js +312 -0
- package/esm/users/usersInterfaces.d.ts +419 -0
- package/esm/users/usersInterfaces.js +1 -0
- package/esm/users/usersSchemas.d.ts +72 -0
- package/esm/users/usersSchemas.js +55 -0
- package/esm/web-socket/lazySocket.d.ts +18 -0
- package/esm/web-socket/lazySocket.js +67 -0
- package/esm/web-socket/wsApi.d.ts +27 -0
- package/esm/web-socket/wsApi.js +43 -0
- package/esm/web-socket/wsInterfaces.d.ts +16 -0
- package/esm/web-socket/wsInterfaces.js +1 -0
- package/package.json +47 -2
- package/types.d.ts +1 -0
- package/types.js +1 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import AsyncModules from '../base/asyncModules.js';
|
|
2
|
+
import createSchemaLoader from '../base/lazySchema.js';
|
|
3
|
+
const schema = createSchemaLoader(() => import('./attributeSetsSchemas.js'));
|
|
4
|
+
/**
|
|
5
|
+
* Controllers for working with attributes - AttributesSetsApi.
|
|
6
|
+
* @class AttributesSetsApi
|
|
7
|
+
* @augments AsyncModules
|
|
8
|
+
* @implements {IAttributesSets}
|
|
9
|
+
* @description This class provides methods to interact with attribute sets, including fetching attributes, getting attributes by marker, and retrieving single attributes by marker and set.
|
|
10
|
+
*/
|
|
11
|
+
export default class AttributesSetsApi extends AsyncModules {
|
|
12
|
+
/**
|
|
13
|
+
* Initializes the AttributesSetsApi with the provided state module.
|
|
14
|
+
* @class
|
|
15
|
+
* @class AttributesSetsApi
|
|
16
|
+
* @param {StateModule} state - The state module containing configuration data.
|
|
17
|
+
* @description Constructor initializes the AttributesSetsApi with a given state.
|
|
18
|
+
*/
|
|
19
|
+
constructor(state) {
|
|
20
|
+
super(state);
|
|
21
|
+
this._url = state.url + '/api/content/attributes-sets';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Getting all attribute sets objects.
|
|
25
|
+
* @handleName getAttributes
|
|
26
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
27
|
+
* @param {number} [offset] - parameter offset of record selection. Default: 0.
|
|
28
|
+
* @param {number} [limit] - parameter limiting the selection of records. Default: 30.
|
|
29
|
+
* @param {number} [typeId] - identifier of the attribute set type. Default: null.
|
|
30
|
+
* @param {string} [sortBy] - identifier of the attribute set type. Default: "id".
|
|
31
|
+
* @returns {Promise<IAttributesSetsResponse | IError>} Returns object with array of IAttributeSetsEntity and total items count.
|
|
32
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
33
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/attribute-sets/getAttributes getAttributes} documentation.
|
|
34
|
+
*/
|
|
35
|
+
async getAttributes(langCode = this.state.lang, offset = 0, limit = 30,
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
typeId = null, sortBy = 'id') {
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
+
const query = {
|
|
40
|
+
langCode,
|
|
41
|
+
offset,
|
|
42
|
+
limit,
|
|
43
|
+
typeId,
|
|
44
|
+
sortBy,
|
|
45
|
+
};
|
|
46
|
+
const result = await this._fetchGet(`?` + this._queryParamsToString(query));
|
|
47
|
+
// Validate response if validation is enabled
|
|
48
|
+
const validated = await this._validateResponse(result, schema('AttributeSetsResponseSchema'));
|
|
49
|
+
return this._normalizeData(validated, langCode);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Getting all attributes with data from the attribute set.
|
|
53
|
+
* @handleName getAttributesByMarker
|
|
54
|
+
* @param {string} marker - Attribute marker. Example: "productAttributes".
|
|
55
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
56
|
+
* @returns {Promise<IAttributesSetsEntity[] | IError>} Returns an array of Attributes objects.
|
|
57
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
58
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/attribute-sets/getAttributesByMarker getAttributesByMarker} documentation.
|
|
59
|
+
*/
|
|
60
|
+
async getAttributesByMarker(marker, langCode = this.state.lang) {
|
|
61
|
+
const result = await this._fetchGet(`/${marker}/attributes?langCode=${langCode}`);
|
|
62
|
+
// Validate response if validation is enabled
|
|
63
|
+
const validated = await this._validateResponse(result, schema('AttributesArrayResponseSchema'));
|
|
64
|
+
return this._normalizeData(validated, langCode);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get a single attribute with data from the attribute sets.
|
|
68
|
+
* @handleName getSingleAttributeByMarkerSet
|
|
69
|
+
* @param {string} setMarker - Text identifier (marker) of the attribute set. Example: "productAttributes".
|
|
70
|
+
* @param {string} attributeMarker - Text identifier (marker) of the attribute in the set. Example: "color".
|
|
71
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
72
|
+
* @returns {Promise<IAttributesSetsEntity | IError>} Returns a single attribute object from the attribute set.
|
|
73
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
74
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/attribute-sets/getSingleAttributeByMarkerSet getSingleAttributeByMarkerSet} documentation.
|
|
75
|
+
*/
|
|
76
|
+
async getSingleAttributeByMarkerSet(setMarker, attributeMarker, langCode = this.state.lang) {
|
|
77
|
+
const result = await this._fetchGet(`/${setMarker}/attributes/${attributeMarker}?langCode=${langCode}`);
|
|
78
|
+
// Validate response if validation is enabled
|
|
79
|
+
const validated = await this._validateResponse(result, schema('AttributeEntitySchema'));
|
|
80
|
+
return this._normalizeData(validated, langCode);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Getting a single object from a set of attributes by marker.
|
|
84
|
+
* @handleName getAttributeSetByMarker
|
|
85
|
+
* @param {string} marker - marker of the attribute set object. Example: "productAttributes".
|
|
86
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
87
|
+
* @returns {Promise<IAttributeSetsEntity | IError>} Returns one object of the attribute set.
|
|
88
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
89
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/attribute-sets/getAttributeSetByMarker getAttributeSetByMarker} documentation.
|
|
90
|
+
*/
|
|
91
|
+
async getAttributeSetByMarker(marker, langCode = this.state.lang) {
|
|
92
|
+
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
93
|
+
// Validate response if validation is enabled
|
|
94
|
+
const validated = await this._validateResponse(result, schema('AttributeSetEntitySchema'));
|
|
95
|
+
return this._normalizeData(validated, langCode);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import type { IAttributeLocalizeInfo, IError, ITimeIntervalSchedule } from '../base/utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for retrieving attributes based on markers and language codes.
|
|
4
|
+
* @interface IAttributesSets
|
|
5
|
+
* @description This interface defines methods for retrieving attributes based on markers and language codes.
|
|
6
|
+
*/
|
|
7
|
+
interface IAttributesSets {
|
|
8
|
+
/**
|
|
9
|
+
* Fetches attributes by a specific marker.
|
|
10
|
+
* @handleName getAttributesByMarker
|
|
11
|
+
* @param {string} marker - The marker used to identify the attribute set. Example: "productAttributes".
|
|
12
|
+
* @param {string} [langCode] - The language code for localization purposes. Default: 'en_US'.
|
|
13
|
+
* @returns {IAttributesSetsEntity[]} A promise that resolves to an array of attribute entities or an error.
|
|
14
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
15
|
+
* @description This method fetches attributes by a specific marker.
|
|
16
|
+
*/
|
|
17
|
+
getAttributesByMarker(marker: string, langCode: string): Promise<IAttributesSetsEntity[] | IError>;
|
|
18
|
+
/**
|
|
19
|
+
* Fetches a single attribute by its marker and the set marker.
|
|
20
|
+
* @handleName getSingleAttributeByMarkerSet
|
|
21
|
+
* @param {string} attributeMarker - The marker identifying the attribute. Example: "color".
|
|
22
|
+
* @param {string} setMarker - The marker identifying the attribute set. Example: "productAttributes".
|
|
23
|
+
* @param {string} [langCode] - The language code for localization purposes. Default: "en_US".
|
|
24
|
+
* @returns {IAttributesSetsEntity} A promise that resolves to an attribute set entity or an error.
|
|
25
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
26
|
+
* @description This method fetches a single attribute by its marker and the set marker.
|
|
27
|
+
*/
|
|
28
|
+
getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode: string): Promise<IAttributesSetsEntity | IError>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Represents the structure of a list item.
|
|
32
|
+
* @interface IListTitle
|
|
33
|
+
* @property {string} title - The title or name associated with the list item. Example: "Item Name".
|
|
34
|
+
* @property {number | string} value - The value of the list item, which can be either a number or a string depending on the context. Example: 42.
|
|
35
|
+
* @property {string | number | null} position - The position of the list item, which can be represented as a string, number, or null if not applicable. Example: 1.
|
|
36
|
+
* @property {object} extended - An object containing additional properties or metadata related to the list item. This could include any extra details that extend the basic information.
|
|
37
|
+
* @property {string | null} extended.value - The extended value, which can be a string or null. Example: "extra_value".
|
|
38
|
+
* @property {string | null} extended.type - The type of the extended value, which can be a string or null. Example: "color".
|
|
39
|
+
* @description This interface defines the structure of a list item, which includes properties for the title, value, position, and extended information.
|
|
40
|
+
*/
|
|
41
|
+
interface IListTitle {
|
|
42
|
+
title: string;
|
|
43
|
+
value: number | string | IListTitleEntityValue;
|
|
44
|
+
position?: string | number | null;
|
|
45
|
+
extended?: IListTitleExtended;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @interface IListTitleEntityValue
|
|
49
|
+
* @property {number | string} id - Identifier of the linked entity. Example: 10 or "p-10-2954".
|
|
50
|
+
* @property {number} depth - Nesting depth of the entity. Example: 1.
|
|
51
|
+
* @property {boolean} isPinned - Whether the entry is pinned in the list. Example: false.
|
|
52
|
+
* @property {number | null} parentId - Parent entity id, or null for top-level. Example: 10.
|
|
53
|
+
* @property {number | string} position - Sort position; numeric for products, lex-sortable string for categories.
|
|
54
|
+
* @property {boolean} [selected] - Whether the entry is currently selected. Optional.
|
|
55
|
+
* @description Object value used by `entity`-type {@link IListTitle} entries.
|
|
56
|
+
*/
|
|
57
|
+
interface IListTitleEntityValue {
|
|
58
|
+
id: number | string;
|
|
59
|
+
depth: number;
|
|
60
|
+
isPinned: boolean;
|
|
61
|
+
parentId: number | null;
|
|
62
|
+
position: number | string;
|
|
63
|
+
selected?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @interface IListTitleExtended
|
|
67
|
+
* @property {string | null} value - Extended value associated with the list option (e.g. a hex color, code or extra label). Example: "#ff0000".
|
|
68
|
+
* @property {string | null} type - Type of the extended value. Example: "color".
|
|
69
|
+
* @description Optional extended payload attached to a {@link IListTitle} option.
|
|
70
|
+
*/
|
|
71
|
+
interface IListTitleExtended {
|
|
72
|
+
value: string | null;
|
|
73
|
+
type: string | null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Defines the possible values for attribute types used in the system.
|
|
77
|
+
* @type {AttributeType}
|
|
78
|
+
* @description This type defines the possible values for attribute types used in the system.
|
|
79
|
+
*/
|
|
80
|
+
type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' | 'float' | 'dateTime' | 'date' | 'time' | 'file' | 'image' | 'groupOfImages' | 'radioButton' | 'list' | 'button' | 'spam' | 'entity' | 'timeInterval';
|
|
81
|
+
/**
|
|
82
|
+
* Represents an attribute set entity.
|
|
83
|
+
* @interface IAttributesSetsEntity
|
|
84
|
+
* @property {AttributeType} type - Attribute type. Example: "string", "text", "integer", "etc".
|
|
85
|
+
* @property {unknown} [value] - Value of the attribute, normalized the same way as an entity attribute value: `number | null` for numeric types, the file object itself for a single-file `image`/`file`, `null` when the attribute carries no value.
|
|
86
|
+
* @property {unknown} initialValue - Initial value of the attribute.
|
|
87
|
+
* @property {string} marker - Textual identifier of the attribute (marker). Example: "color", "size", "etc".
|
|
88
|
+
* @property {number} position - Position number for sorting. Example: 1.
|
|
89
|
+
* @property {IListTitle[]} listTitles - Array of values (with extended data) for list and radioButton attributes; empty array for non-list types.
|
|
90
|
+
* @example
|
|
91
|
+
[
|
|
92
|
+
{
|
|
93
|
+
"title": "red",
|
|
94
|
+
"value": 1,
|
|
95
|
+
"position": 1,
|
|
96
|
+
"extendedValue": null,
|
|
97
|
+
"extendedValueType": null
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"title": "yellow",
|
|
101
|
+
"value": 2,
|
|
102
|
+
"position": 2,
|
|
103
|
+
"extendedValue": null,
|
|
104
|
+
"extendedValueType": null
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
* @property {IAttributeValidators} validators - Set of validators for validation; empty object when no validators are configured.
|
|
108
|
+
* @example
|
|
109
|
+
{
|
|
110
|
+
"requiredValidator": {
|
|
111
|
+
"strict": true
|
|
112
|
+
},
|
|
113
|
+
"defaultValueValidator": {
|
|
114
|
+
"fieldDefaultValue": 11
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
* @property {IAttributeLocalizeInfo} localizeInfos - The name of the template, taking into account localization.
|
|
118
|
+
* @example
|
|
119
|
+
{
|
|
120
|
+
"title": "My attribute"
|
|
121
|
+
}
|
|
122
|
+
* @property {Record<string, IAttributesSetsEntity>} additionalFields - Nested sub-attributes keyed by marker; empty object when none.
|
|
123
|
+
* @description This interface defines the structure of an attribute set entity, including its type, marker, position, validators, localization information, list titles, additional fields, and settings.
|
|
124
|
+
*/
|
|
125
|
+
interface IAttributesSetsEntity {
|
|
126
|
+
type: AttributeType;
|
|
127
|
+
value?: unknown;
|
|
128
|
+
initialValue: unknown;
|
|
129
|
+
marker: string;
|
|
130
|
+
position: number;
|
|
131
|
+
listTitles: IListTitle[];
|
|
132
|
+
validators: IAttributeValidators;
|
|
133
|
+
localizeInfos: IAttributeLocalizeInfo;
|
|
134
|
+
additionalFields: Record<string, IAttributesSetsEntity>;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* @interface IAttributeSchemaItem
|
|
138
|
+
* @property {number} id - Unique identifier of the schema item. Example: 1.
|
|
139
|
+
* @property {string} identifier - Field marker (machine name) within the schema. Example: "name".
|
|
140
|
+
* @property {unknown} [initialValue] - Default value applied when the field is not filled. Optional — absent on some fields.
|
|
141
|
+
* @property {boolean} [isPrice] - Whether the field's numeric value is treated as the price for product entities. Optional — present on product (`forProducts`) attribute sets. Example: false.
|
|
142
|
+
* @property {boolean} isVisible - Whether the field is exposed in the public API/UI. Example: true.
|
|
143
|
+
* @property {IAttributeLocalizeInfo} localizeInfos - Localized labels for the field.
|
|
144
|
+
* @property {boolean} original - Whether the field is part of the original (system) schema, not a user extension. Example: true.
|
|
145
|
+
* @property {AttributeType} type - Attribute data type (e.g. "string", "file").
|
|
146
|
+
* @property {number} [position] - Sort position of the field inside the set. Optional. Example: 1.
|
|
147
|
+
* @property {IListTitle[]} [listTitles] - Options for `list`/`radioButton`/`entity` fields (with extended data or linked-entity values). Optional.
|
|
148
|
+
* @property {string} [listType] - For `entity` fields — how the option list is organized. Optional. Example: "nested".
|
|
149
|
+
* @property {string} [moduleIdentifier] - For `entity` fields — identifier of the module the linked entities are taken from. Optional. Example: "catalog".
|
|
150
|
+
* @property {number | null} [parentId] - Identifier of the parent field, `null` for top-level. Optional, seen on `groupOfImages` fields.
|
|
151
|
+
* @property {Record<string, IAttributeSchemaItem>} [additionalFields] - Nested sub-fields keyed by marker. Optional.
|
|
152
|
+
* @property {IAttributeValidators} [validators] - Validation rules for the field. Optional.
|
|
153
|
+
* @property {boolean | string} [splitUnit] - Splitting unit configuration; `false` when disabled, otherwise the unit name (e.g. "percent"). Optional, used by numeric fields.
|
|
154
|
+
* @property {number[] | boolean} [splitParts] - For split-price fields — ids of the schema fields the price is split into (e.g. [2, 3]); `false` when the field does not split. Optional.
|
|
155
|
+
* @property {boolean} [isCurrency] - Whether the field stores currency values. Optional.
|
|
156
|
+
* @property {boolean} [splitPrice] - Whether the price is split between several fields. Optional.
|
|
157
|
+
* @property {boolean} [isCompress] - Whether uploaded images are compressed. Optional, used by `image`/`groupOfImages` fields.
|
|
158
|
+
* @property {boolean} [receiveValues] - For `timeInterval` fields — whether the field receives precomputed values. Optional.
|
|
159
|
+
* @property {ITimeIntervalSchedule[]} [intervals] - For `timeInterval` fields — top-level schedule definition (separate from `localizeInfos.intervals`). Optional.
|
|
160
|
+
* @property {unknown} [value] - Current value of the field: `null` on numeric fields without a value, an array of schedule groups on `timeInterval` fields. Optional.
|
|
161
|
+
* @description Definition of a single field inside an attribute set's schema.
|
|
162
|
+
*/
|
|
163
|
+
interface IAttributeSchemaItem {
|
|
164
|
+
id: number;
|
|
165
|
+
identifier: string;
|
|
166
|
+
initialValue?: unknown;
|
|
167
|
+
isPrice?: boolean;
|
|
168
|
+
isVisible: boolean;
|
|
169
|
+
localizeInfos: IAttributeLocalizeInfo;
|
|
170
|
+
original: boolean;
|
|
171
|
+
type: AttributeType;
|
|
172
|
+
position?: number;
|
|
173
|
+
listTitles?: IListTitle[];
|
|
174
|
+
listType?: string;
|
|
175
|
+
moduleIdentifier?: string;
|
|
176
|
+
parentId?: number | null;
|
|
177
|
+
additionalFields?: Record<string, IAttributeSchemaItem>;
|
|
178
|
+
validators?: IAttributeValidators;
|
|
179
|
+
splitUnit?: boolean | string;
|
|
180
|
+
splitParts?: number[] | boolean;
|
|
181
|
+
isCurrency?: boolean;
|
|
182
|
+
splitPrice?: boolean;
|
|
183
|
+
isCompress?: boolean;
|
|
184
|
+
receiveValues?: boolean;
|
|
185
|
+
intervals?: ITimeIntervalSchedule[];
|
|
186
|
+
value?: unknown;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* @interface IAttributeValidators
|
|
190
|
+
* @property {object} [requiredValidator] - Marks the field as required. Shape: `{ strict: boolean }`. Example: `{ strict: true }`.
|
|
191
|
+
* @property {object} [stringInspectionValidator] - Length constraints for string fields. Shape: `{ stringMin: number; stringMax: number; stringLength: number }`.
|
|
192
|
+
* @property {boolean} [emailInspectionValidator] - Toggle for email-format validation.
|
|
193
|
+
* @property {object} [defaultValueValidator] - Default value configuration with optional custom error text. Shape: `{ customErrorText?: string; fieldDefaultValue?: unknown; fieldDefaultValue2?: unknown }`.
|
|
194
|
+
* @description Map of validators applied to an attribute or form field. Set is extensible — additional validator types may be added by the API.
|
|
195
|
+
*/
|
|
196
|
+
interface IAttributeValidators {
|
|
197
|
+
requiredValidator?: {
|
|
198
|
+
strict: boolean;
|
|
199
|
+
};
|
|
200
|
+
stringInspectionValidator?: {
|
|
201
|
+
stringMin: number;
|
|
202
|
+
stringMax: number;
|
|
203
|
+
stringLength: number;
|
|
204
|
+
};
|
|
205
|
+
emailInspectionValidator?: boolean;
|
|
206
|
+
defaultValueValidator?: {
|
|
207
|
+
customErrorText?: string;
|
|
208
|
+
fieldDefaultValue?: unknown;
|
|
209
|
+
fieldDefaultValue2?: unknown;
|
|
210
|
+
};
|
|
211
|
+
[key: string]: unknown;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Represents an attribute set entity.
|
|
215
|
+
* @interface IAttributeSetsEntity
|
|
216
|
+
* @property {number} id - The unique identifier of the attribute set entity. Example: 123.
|
|
217
|
+
* @property {string} createdDate - The date when the attribute set was created. Example: "2023-10-01T12:00:00Z".
|
|
218
|
+
* @property {string} updatedDate - The date when the attribute set was last updated. Example: "2023-10-01T12:00:00Z".
|
|
219
|
+
* @property {number} version - The version number of the attribute set, used for tracking changes or updates. Example: 1.
|
|
220
|
+
* @property {string} identifier - A string that uniquely identifies the attribute set. Example: "attributeSet1".
|
|
221
|
+
* @property {string} title - The title or name of the attribute set. Example: "Product Attributes".
|
|
222
|
+
* @property {Record<string, IAttributeSchemaItem>} schema - Schema fields keyed by marker.
|
|
223
|
+
* @example
|
|
224
|
+
{
|
|
225
|
+
"attribute1": {
|
|
226
|
+
"id": 1,
|
|
227
|
+
"type": "string",
|
|
228
|
+
"isPrice": false,
|
|
229
|
+
"original": true,
|
|
230
|
+
"identifier": "string",
|
|
231
|
+
"localizeInfos": {
|
|
232
|
+
"en_US": { "title": "String" }
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
* @property {boolean} isVisible - Indicates whether the attribute set is visible or not. Example: true.
|
|
237
|
+
* @property {string} type - The type of the attribute set, which could be a specific classification or category. Example: "product", "user", "etc".
|
|
238
|
+
* @property {number} position - The position number for sorting the attribute set. Example: 1.
|
|
239
|
+
* @description This interface defines the structure of an attribute set entity.
|
|
240
|
+
*/
|
|
241
|
+
interface IAttributeSetsEntity {
|
|
242
|
+
id: number;
|
|
243
|
+
createdDate: string;
|
|
244
|
+
updatedDate: string;
|
|
245
|
+
version: number;
|
|
246
|
+
identifier: string;
|
|
247
|
+
title: string;
|
|
248
|
+
schema: Record<string, IAttributeSchemaItem>;
|
|
249
|
+
isVisible: boolean;
|
|
250
|
+
type: IAttributeSetTypeRef;
|
|
251
|
+
position: number;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* @interface IAttributeSetTypeRef
|
|
255
|
+
* @property {number} id - Internal type identifier. Example: 1.
|
|
256
|
+
* @property {string} type - Type identifier (e.g. "forAdmins", "forForms", "forProducts"). Example: "forAdmins".
|
|
257
|
+
* @description Reference to the attribute set type — defines what entity the set is bound to.
|
|
258
|
+
*/
|
|
259
|
+
interface IAttributeSetTypeRef {
|
|
260
|
+
id: number;
|
|
261
|
+
type: string;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Represents the response structure for attribute sets.
|
|
265
|
+
* @interface IAttributesSetsResponse
|
|
266
|
+
* @property {number} total - Total items. Example: 100.
|
|
267
|
+
* @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity array containing attribute set entities.
|
|
268
|
+
* @example
|
|
269
|
+
[
|
|
270
|
+
{
|
|
271
|
+
"id": 1,
|
|
272
|
+
"identifier": "set1"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"id": 2,
|
|
276
|
+
"identifier": "set2"
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
* @description This interface defines the structure of a response object for attribute sets.
|
|
280
|
+
*/
|
|
281
|
+
interface IAttributesSetsResponse {
|
|
282
|
+
total: number;
|
|
283
|
+
items: IAttributeSetsEntity[];
|
|
284
|
+
}
|
|
285
|
+
export type { AttributeType, IAttributeSchemaItem, IAttributeSetsEntity, IAttributeSetTypeRef, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponse, IAttributeValidators, IListTitle, IListTitleEntityValue, IListTitleExtended, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation schemas for AttributeSets module
|
|
3
|
+
* @description Zod schemas for validating attribute sets-related API responses
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* List title schema for list and radioButton attributes
|
|
8
|
+
*/
|
|
9
|
+
export declare const ListTitleSchema: z.ZodObject<{
|
|
10
|
+
title: z.ZodString;
|
|
11
|
+
value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
12
|
+
position: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
|
|
13
|
+
extended: z.ZodObject<{
|
|
14
|
+
value: z.ZodNullable<z.ZodString>;
|
|
15
|
+
type: z.ZodNullable<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
/**
|
|
19
|
+
* Attribute entity schema (single attribute from a set)
|
|
20
|
+
*/
|
|
21
|
+
export declare const AttributeEntitySchema: z.ZodObject<{
|
|
22
|
+
type: z.ZodString;
|
|
23
|
+
value: z.ZodOptional<z.ZodAny>;
|
|
24
|
+
initialValue: z.ZodAny;
|
|
25
|
+
marker: z.ZodString;
|
|
26
|
+
position: z.ZodNumber;
|
|
27
|
+
listTitles: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
|
|
28
|
+
validators: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>>;
|
|
29
|
+
localizeInfos: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
30
|
+
additionalFields: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
/**
|
|
33
|
+
* Attribute set entity schema (attribute set object)
|
|
34
|
+
*/
|
|
35
|
+
export declare const AttributeSetEntitySchema: z.ZodObject<{
|
|
36
|
+
id: z.ZodNumber;
|
|
37
|
+
createdDate: z.ZodString;
|
|
38
|
+
updatedDate: z.ZodString;
|
|
39
|
+
version: z.ZodNumber;
|
|
40
|
+
identifier: z.ZodString;
|
|
41
|
+
title: z.ZodString;
|
|
42
|
+
schema: z.ZodObject<{}, z.core.$loose>;
|
|
43
|
+
isVisible: z.ZodBoolean;
|
|
44
|
+
type: z.ZodObject<{
|
|
45
|
+
id: z.ZodNumber;
|
|
46
|
+
type: z.ZodString;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
position: z.ZodNumber;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
/**
|
|
51
|
+
* Attributes response schema (for getAttributes method)
|
|
52
|
+
*/
|
|
53
|
+
export declare const AttributeSetsResponseSchema: z.ZodObject<{
|
|
54
|
+
total: z.ZodNumber;
|
|
55
|
+
items: z.ZodArray<z.ZodObject<{
|
|
56
|
+
id: z.ZodNumber;
|
|
57
|
+
createdDate: z.ZodString;
|
|
58
|
+
updatedDate: z.ZodString;
|
|
59
|
+
version: z.ZodNumber;
|
|
60
|
+
identifier: z.ZodString;
|
|
61
|
+
title: z.ZodString;
|
|
62
|
+
schema: z.ZodObject<{}, z.core.$loose>;
|
|
63
|
+
isVisible: z.ZodBoolean;
|
|
64
|
+
type: z.ZodObject<{
|
|
65
|
+
id: z.ZodNumber;
|
|
66
|
+
type: z.ZodString;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
position: z.ZodNumber;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
/**
|
|
72
|
+
* Attributes array response schema (for getAttributesByMarker method)
|
|
73
|
+
*/
|
|
74
|
+
export declare const AttributesArrayResponseSchema: z.ZodArray<z.ZodObject<{
|
|
75
|
+
type: z.ZodString;
|
|
76
|
+
value: z.ZodOptional<z.ZodAny>;
|
|
77
|
+
initialValue: z.ZodAny;
|
|
78
|
+
marker: z.ZodString;
|
|
79
|
+
position: z.ZodNumber;
|
|
80
|
+
listTitles: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
|
|
81
|
+
validators: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>>;
|
|
82
|
+
localizeInfos: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
83
|
+
additionalFields: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>>;
|
|
84
|
+
}, z.core.$strip>>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation schemas for AttributeSets module
|
|
3
|
+
* @description Zod schemas for validating attribute sets-related API responses
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* List title schema for list and radioButton attributes
|
|
8
|
+
*/
|
|
9
|
+
export const ListTitleSchema = z.object({
|
|
10
|
+
title: z.string(),
|
|
11
|
+
value: z.union([z.number(), z.string()]),
|
|
12
|
+
position: z.union([z.string(), z.number(), z.null()]),
|
|
13
|
+
extended: z.object({
|
|
14
|
+
value: z.string().nullable(),
|
|
15
|
+
type: z.string().nullable(),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Attribute entity schema (single attribute from a set)
|
|
20
|
+
*/
|
|
21
|
+
export const AttributeEntitySchema = z.object({
|
|
22
|
+
type: z.string(),
|
|
23
|
+
value: z.any().optional(),
|
|
24
|
+
initialValue: z.any(),
|
|
25
|
+
marker: z.string(),
|
|
26
|
+
position: z.number(),
|
|
27
|
+
listTitles: z
|
|
28
|
+
.union([z.array(z.any()), z.record(z.string(), z.any())])
|
|
29
|
+
.optional(),
|
|
30
|
+
validators: z
|
|
31
|
+
.union([z.record(z.string(), z.any()), z.array(z.any())])
|
|
32
|
+
.optional(),
|
|
33
|
+
localizeInfos: z.union([z.record(z.string(), z.any()), z.array(z.any())]),
|
|
34
|
+
additionalFields: z
|
|
35
|
+
.union([z.record(z.string(), z.any()), z.array(z.any())])
|
|
36
|
+
.optional(),
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Attribute set entity schema (attribute set object)
|
|
40
|
+
*/
|
|
41
|
+
export const AttributeSetEntitySchema = z.object({
|
|
42
|
+
id: z.number(),
|
|
43
|
+
createdDate: z.string(),
|
|
44
|
+
updatedDate: z.string(),
|
|
45
|
+
version: z.number(),
|
|
46
|
+
identifier: z.string(),
|
|
47
|
+
title: z.string(),
|
|
48
|
+
schema: z.object({}).passthrough(),
|
|
49
|
+
isVisible: z.boolean(),
|
|
50
|
+
type: z.object({
|
|
51
|
+
id: z.number(),
|
|
52
|
+
type: z.string(),
|
|
53
|
+
}),
|
|
54
|
+
position: z.number(),
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Attributes response schema (for getAttributes method)
|
|
58
|
+
*/
|
|
59
|
+
export const AttributeSetsResponseSchema = z.object({
|
|
60
|
+
total: z.number(),
|
|
61
|
+
items: z.array(AttributeSetEntitySchema),
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Attributes array response schema (for getAttributesByMarker method)
|
|
65
|
+
*/
|
|
66
|
+
export const AttributesArrayResponseSchema = z.array(AttributeEntitySchema);
|