getAttributes
Getting all attribute set objects. This method return all attribute sets objects and total. It returns a Promise that resolves to an IAttributesSetsResponse object.
Descriptionβ
-
In addition to returning the list of attribute set objects, the method also provides the total count of these objects. This is particularly useful for pagination, reporting, and analytics purposes, allowing developers and administrators to understand the scope and scale of the attribute sets being managed.
-
This functionality is essential for applications where dynamic data modeling is required. For instance, e-commerce platforms might use attribute sets to define different product categories, each with its own unique set of attributes like size, color, material, etc. It can also be used in user management systems where different user roles have distinct attribute requirements.
-
The method is likely designed to integrate seamlessly with other components of the system, allowing for flexible data manipulation and presentation. This could involve filtering, sorting, or transforming the attribute sets based on specific criteria or business logic.
π‘Data returned in the attribute set does not include actual attribute values, as these values are contained within specific entities such as pages, products, etc. The only exception is timeInterval attribute type. This attribute can have values ββby checking the corresponding box in the admin panel.
AttributesSets.getAttributes(
langCode,
offset,
limit,
typeId,
sortBy
);
Parameters schemaβ
Schema
langCode: string
Language code. Default: "en_US"
example: "en_US"
offset: number
parameter offset of record selection. Default: 0
example: 0
limit: number
parameter limiting the selection of records. Default: 30
example: 30
typeId: number
identifier of the attribute set type. Default: null
example: NaN
sortBy: string
identifier of the attribute set type. Default: "id"
example: "id"
By default, you can retrieve 10 objects. This is due to the record limit in the module's permissions settings.
For pagination to work correctly, you need to configure Module permissions according to your needs in the corresponding section.
Examplesβ
Minimal exampleβ
const response = await AttributesSets.getAttributes();
Example with attributesβ
const response = await AttributesSets.getAttributes('en_US', 0, 30, null, 'id');
Example responseβ
{
"total": 18,
"items": [
{
"id": 15,
"createdDate": "2025-10-28T13:50:27.426Z",
"updatedDate": "2025-12-25T23:18:11.854Z",
"version": 0,
"identifier": "form",
"typeId": 7,
"title": "Form",
"schema": {
"name": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "name",
"validators": {
"requiredValidator": {
"strict": true
},
"stringInspectionValidator": {
"stringMax": 0,
"stringMin": 0,
"stringLength": 0
}
},
"initialValue": null,
"localizeInfos": {
"title": "Name"
},
"additionalFields": [
{
"marker": "additional_field"
}
]
},
"file": {
"id": 2,
"type": "file",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "file",
"initialValue": null,
"localizeInfos": {
"title": "File"
}
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 7,
"type": "forForms"
},
"position": 1
},
{
"id": 11,
"createdDate": "2025-10-28T13:50:27.426Z",
"updatedDate": "2025-05-05T10:41:05.287Z",
"version": 0,
"identifier": "user_form_set",
"typeId": 6,
"title": "user_form_set",
"schema": {
"name_attr": {
"id": 1,
"type": "string",
"isLogin": false,
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "name_attr",
"isPassword": false,
"initialValue": null,
"localizeInfos": {
"title": "name"
},
"isNotificationEmail": false,
"isNotificationPhoneSMS": false,
"isNotificationPhonePush": false
},
"username": {
"id": 2,
"type": "string",
"isLogin": true,
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "username",
"isPassword": false,
"initialValue": null,
"localizeInfos": {
"title": "username"
},
"isNotificationEmail": false,
"isNotificationPhoneSMS": false,
"isNotificationPhonePush": false
},
"password": {
"id": 3,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "password",
"isPassword": true,
"initialValue": null,
"localizeInfos": {
"title": "password"
},
"isNotificationEmail": false,
"isNotificationPhoneSMS": false,
"isNotificationPhonePush": false
},
"phone": {
"id": 4,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "phone",
"initialValue": null,
"localizeInfos": {
"title": "phone"
},
"isNotificationEmail": false,
"isNotificationPhoneSMS": true,
"isNotificationPhonePush": true
},
"email": {
"id": 5,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "email",
"initialValue": null,
"localizeInfos": {
"title": "email"
},
"additionalFields": [],
"isNotificationEmail": true
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 6,
"type": "forUsers"
},
"position": 2
},
{
"id": 14,
"createdDate": "2025-10-28T13:50:27.426Z",
"updatedDate": "2025-03-22T21:07:41.202Z",
"version": 0,
"identifier": "order_form",
"typeId": 7,
"title": "Order form",
"schema": {
"order_name": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "order_name",
"initialValue": null,
"localizeInfos": {
"title": "name"
}
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 7,
"type": "forForms"
},
"position": 3
},
"..."
]
}
Response schemaβ
Schema: IAttributesSetsResponse
total: number
Total items.
example: 100
items: IAttributeSetsEntity[]
IAttributeSetsEntity array containing attribute set entities.
example:
[
{
"id": 1,
"identifier": "set1"
},
{
"id": 2,
"identifier": "set2"
}
]
items.id: number
The unique identifier of the attribute set entity.
example: 123
items.updatedDate: string
The date when the attribute set was last updated, represented as a string.
example: "2023-10-01T12:00:00Z"
items.version: number
The version number of the attribute set, used for tracking changes or updates.
example: 1
items.identifier: string
A string that uniquely identifies the attribute set.
example: "attributeSet1"
items.typeId: number
The numerical identifier representing the type of the attribute set.
example: 1
items.title: string
The title or name of the attribute set.
example: "Product Attributes"
items.schema: object
The schema definition associated with the attribute set. This could represent the structure or rules for the data.
example:
{
"attribute1": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"identifier": "string",
"localizeInfos": {
"en_US": {
"title": "String"
}
}
}
}
items.isVisible: boolean
Indicates whether the attribute set is visible or not.
example: true
items.properties: object
Additional properties associated with the attribute set, which can be of any type.
example:
{
"color": "red",
"size": "M"
}
items.type: string
The type of the attribute set, which could be a specific classification or category.
example: "product", "user", "etc"
items.position: number
The position number for sorting the attribute set.
example: 1