Перейти к основному содержимому

getAttributes

Получение всех объектов наборов атрибутов

AttributesSets.getAttributes(langCode, offset, limit, typeId, sortBy)

const value = await AttributesSets.getAttributes()
Схема

langCode: строка
Код языка. По умолчанию: "en_US"
пример: "en_US"

limit: число
параметр, ограничивающий выбор записей. По умолчанию: 30
пример: 30

offset: число
параметр смещения выборки записей. По умолчанию: 0
пример: 0

typeId: число
идентификатор типа набора атрибутов. По умолчанию: null
пример: NaN

sortBy: строка
идентификатор типа набора атрибутов. По умолчанию: "id"
пример: "id"

Этот метод возвращает все объекты наборов атрибутов и общее количество.

Пример возвращаемого значения:

{
"total": 16,
"items": [
{
"id": 27,
"updatedDate": "2025-02-26T17:18:11.275Z",
"version": 0,
"identifier": "admins",
"typeId": 1,
"title": "Администраторы",
"schema": {
"admin-text": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "admin-text",
"localizeInfos": {
"title": "Текст администраторов"
}
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 1,
"type": "дляАдминистраторов"
},
"position": 1
},
{
"id": 22,
"updatedDate": "2025-03-23T12:23:56.420Z",
"version": 0,
"identifier": "block",
"typeId": 2,
"title": "Блок",
"schema": {
"block-text": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "block-text",
"localizeInfos": {
"title": "Текст блока"
}
},
"interval": {
"id": 2,
"type": "timeInterval",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "interval",
"localizeInfos": {
"title": "Интервал",
"intervals": [
{
"id": "c6466cd8-c55d-4583-97c5-42b684210f12",
"range": [],
"external": [],
"fullMonth": 2,
"intervals": [
{
"id": "ab0e3e90-8153-4679-aea4-198c5022f8d4",
"end": {
"hours": 19,
"minutes": 0
},
"start": {
"hours": 9,
"minutes": 0
},
"period": 60
}
],
"inEveryMonth": true,
"selectedYear": 2025
}
]
}
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 2,
"type": "дляБлоков"
},
"position": 2
},
{
"id": 17,
"updatedDate": "2025-02-26T16:25:01.688Z",
"version": 0,
"identifier": "page",
"typeId": 4,
"title": "Страница",
"schema": {
"text": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "text",
"localizeInfos": {
"title": "текст"
}
},
"number": {
"id": 2,
"type": "integer",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "number",
"localizeInfos": {
"title": "Номер"
}
},
"real": {
"id": 3,
"type": "real",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "real",
"localizeInfos": {
"title": "Реальный"
}
},
"float": {
"id": 4,
"type": "float",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "float",
"localizeInfos": {
"title": "Число с плавающей запятой"
}
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 4,
"type": "дляСтраниц"
},
"position": 3
},
"..."
]
}
Схема

items: IAttributeSetsEntity[]
Массив IAttributeSetsEntity, содержащий сущности наборов атрибутов.
пример:

[
{
"id": 1,
"identifier": "set1"
},
{
"id": 2,
"identifier": "set2"
}
]

total: число
Общее количество элементов.
пример: 100