getComponentDescriptorsByType method

Future<List<ComponentDescriptor>> getComponentDescriptorsByType(
  1. ComponentType componentType, {
  2. RuleChainType ruleChainType = RuleChainType.CORE,
  3. RequestConfig? requestConfig,
})

Implementation

Future<List<ComponentDescriptor>> getComponentDescriptorsByType(
    ComponentType componentType,
    {RuleChainType ruleChainType = RuleChainType.CORE,
    RequestConfig? requestConfig}) async {
  var response = await _tbClient.get<List<dynamic>>(
      '/api/components/${componentType.toShortString()}',
      queryParameters: {'ruleChainType': ruleChainType.toShortString()},
      options: defaultHttpOptionsFromConfig(requestConfig));
  return response.data!.map((e) => ComponentDescriptor.fromJson(e)).toList();
}