diff --git a/src/core/Thing.ts b/src/core/Thing.ts index af5f9bfe..9680a16f 100644 --- a/src/core/Thing.ts +++ b/src/core/Thing.ts @@ -85,7 +85,7 @@ export interface SCThing { /** * Type of the thing */ - type: string; + type: SCThingType; /** * Universally unique identifier of the thing */ diff --git a/src/core/protocol/routes/bulk/BulkRequest.ts b/src/core/protocol/routes/bulk/BulkRequest.ts index 6e7f1a94..b7aabc60 100644 --- a/src/core/protocol/routes/bulk/BulkRequest.ts +++ b/src/core/protocol/routes/bulk/BulkRequest.ts @@ -13,6 +13,7 @@ * this program. If not, see . */ import {SCAbstractRoute} from '../../../Route'; +import {SCThingType} from '../../../Thing'; import {SCISO8601Date} from '../../../types/Time'; /** @@ -46,9 +47,8 @@ export interface SCBulkParameters { /** * Type of things that are indexed in this bulk. * - * String is an element of the SCThingType enumeration. */ - type: string; + type: SCThingType; } /** diff --git a/src/core/types/config/Backend.ts b/src/core/types/config/Backend.ts index 67d47f8c..0373e2fd 100644 --- a/src/core/types/config/Backend.ts +++ b/src/core/types/config/Backend.ts @@ -12,6 +12,7 @@ * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ +import {SCThingType} from '../../Thing'; import {SCSearchSortType} from '../sorts/Abstract'; import {SCUuid} from '../UUID'; import {SCMonitoringConfiguration} from './Monitoring'; @@ -25,9 +26,8 @@ export interface SCBackendConfiguration { * * If a type is hidden it won't show in any result unless the type is filtered for * - * Strings must be elements of the SCThingType enumeration. */ - hiddenTypes: string[]; + hiddenTypes: SCThingType[]; /** * Name of university @@ -64,7 +64,7 @@ export interface SCBackendConfigurationSortableField { * * If no type is given it is assumed it exists on every type */ - onlyOnTypes?: string[]; + onlyOnTypes?: SCThingType[]; /** * A list of supported sorts on this field @@ -111,7 +111,7 @@ export interface SCBackendConfigurationSearchBoosting { /** * Type of things the factor should be applied to */ - type: string; + type: SCThingType; } /** @@ -128,7 +128,7 @@ export interface SCBackendAggregationConfiguration { * * If the type is not given is is assumed the field exists on every type */ - onlyOnTypes?: string[]; + onlyOnTypes?: SCThingType[]; } /**