getAttributeSetByMarker
Obtenir un seul objet d'ensemble d'attributs par marqueur.
Description
Cette méthode renvoie un attribut avec des données de l'ensemble d'attributs. Elle renvoie une promesse qui se résout en un objet IAttributeSetsEntity.
AttributesSets.getAttributeSetByMarker(
marker*,
langCode
);
Schéma des paramètres
Schéma
marker(obligatoire) : string
marqueur de l'objet d'ensemble d'attributs
exemple : "productAttributes"
langCode : string
Code de langue. Par défaut : "en_US"
exemple : "en_US"
Exemples
Exemple minimal
const response = await AttributesSets.getAttributeSetByMarker('my-marker');
Exemple avec des attributs
const response = await AttributesSets.getAttributeSetByMarker('my-marker', 'en_US');
Exemple de réponse
{
"id": 27,
"createdDate": "2025-10-28T13:50:27.426Z",
"updatedDate": "2025-02-26T17:18:11.275Z",
"version": 0,
"identifier": "admins",
"typeId": 1,
"title": "Admins",
"schema": {
"admin-text": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "admin-text",
"initialValue": null,
"localizeInfos": {
"title": "Admins text"
}
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 1,
"type": "forAdmins"
},
"position": 1
}
Schéma de réponse
Schéma : IAttributeSetsEntity
id : number
L'identifiant unique de l'entité d'ensemble d'attributs.
exemple : 123
createdDate : string
La date à laquelle l'ensemble d'attributs a été créé.
exemple : "2023-10-01T12:00:00Z"
updatedDate : string
La date à laquelle l'ensemble d'attributs a été mis à jour pour la dernière fois.
exemple : "2023-10-01T12:00:00Z"
version : number
Le numéro de version de l'ensemble d'attributs, utilisé pour suivre les modifications ou mises à jour.
exemple : 1
identifier : string
Une chaîne qui identifie de manière unique l'ensemble d'attributs.
exemple : "attributeSet1"
typeId : number
L'identifiant numérique représentant le type de l'ensemble d'attributs.
exemple : 1
title : string
Le titre ou le nom de l'ensemble d'attributs.
exemple : "Attributs de produit"
schema : Record<string, IAttributeSchemaItem>
Champs de schéma indexés par marqueur.
exemple :
{
"attribute1": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"identifier": "string",
"localizeInfos": {
"en_US": {
"title": "String"
}
}
}
}
isVisible : boolean
Indique si l'ensemble d'attributs est visible ou non.
exemple : true
properties : Record<string, unknown>
Propriétés supplémentaires associées à l'ensemble d'attributs ; objet vide lorsqu'il n'y en a pas.
exemple :
{
"color": "red",
"size": "M"
}
type : string
Le type de l'ensemble d'attributs, qui pourrait être une classification ou une catégorie spécifique.
exemple : "produit", "utilisateur", "etc"
position : number
Le numéro de position pour trier l'ensemble d'attributs.
exemple : 1