getSvcComponentsConfig(criteriaToMatch, options)
Calls the Constellation Service to fetch the corresponding component
config.json
file that satisfies the specified properties. This call is
authenticated by the Constellation Service, using the issued B2S JWT token.
Returns
A Promise that resolves to an object with key data and value of the array of config objects matching the criteria.
Parameters
Name | Type | Description | Required |
criteriaToMatch | array | The list of name-value pairs specifying the search criteria. | ✅ |
options | object | The object that contains information to obtain additional
config-ext.json values. | ❌ |
The following table contains the properties of the options object:
Name | Type | Description | Required |
alternateDesignSystemURL | string | The URL for an alternative design system, used for fetching additional
config-ext.json values. | ❌ |
Usage example
In this example, the API retrieves an operator image and creates a DOMString containing a URL representing the image Blob object.
const templateDefinitionConfigJson = await AssetLoader
.getSvcComponentsConfig([{ field: 'name', value: ‘OneColumn’ }])
.then((response) => {
if (response?.data?.components?.[0]) {
return response.data.components[0];
}
throw new Error('templateDefinition for OneColumn not found!');
})
.catch(() => {
throw new Error('templateDefinition for OneColumn not found!');
});
Previous topic getSvcComponent(name) Next topic getSvcImage(key)