2017-08-24 00:23:48 -07:00
|
|
|
import { ApiStatus } from 'wherehows-web/utils/api/shared';
|
2017-08-16 13:28:13 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes the prediction property in a compliance suggestion
|
|
|
|
*/
|
|
|
|
interface IPrediction {
|
|
|
|
// Percentage confidence level for this prediction
|
|
|
|
confidence: number;
|
|
|
|
// The predicted value
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
|
2017-10-03 18:07:38 -07:00
|
|
|
/**
|
|
|
|
* Describes the interface for a field suggestion
|
|
|
|
* values for the keys are extracted from the JSON response
|
|
|
|
* from the compliance/suggestion endpoint and do not necessarily match up
|
|
|
|
* with the key [`identifierTypePrediction` | `logicalTypePrediction`] predicted values
|
|
|
|
* @link extractTypesSuggestion gives further detail
|
|
|
|
*/
|
|
|
|
interface IFieldSuggestion {
|
|
|
|
identifierType?: string;
|
|
|
|
logicalType?: string;
|
|
|
|
confidence: number;
|
|
|
|
}
|
|
|
|
|
2017-08-16 13:28:13 -07:00
|
|
|
/**
|
|
|
|
* Describes shape of a compliance auto suggestion
|
|
|
|
*/
|
|
|
|
export interface IComplianceSuggestion {
|
|
|
|
// The name of the field
|
|
|
|
fieldName: string;
|
|
|
|
// Prediction for the identifierType
|
|
|
|
identifierTypePrediction: IPrediction | null;
|
|
|
|
// Prediction for the logicalType
|
|
|
|
logicalTypePrediction: IPrediction | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes the expected properties for the autoClassification on a compliance suggestions api response
|
|
|
|
*/
|
|
|
|
interface IAutoClassification {
|
|
|
|
// The urn for the dataset
|
|
|
|
urn: string;
|
2017-08-18 03:42:40 -07:00
|
|
|
// a JSON string: array of suggestions available for fields on this dataset
|
2017-08-16 13:28:13 -07:00
|
|
|
classificationResult: string;
|
|
|
|
// the last modified date for the suggestion
|
|
|
|
lastModified: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes the expected affirmative API response for a the compliance suggestion
|
|
|
|
*/
|
|
|
|
export interface IComplianceSuggestionResponse {
|
|
|
|
status: ApiStatus;
|
|
|
|
autoClassification?: IAutoClassification;
|
|
|
|
}
|