diff --git a/packages/rest-client/src/types/AddonName.ts b/packages/rest-client/src/types/AddonName.ts index 59bbf6ae..52330770 100644 --- a/packages/rest-client/src/types/AddonName.ts +++ b/packages/rest-client/src/types/AddonName.ts @@ -1,5 +1,6 @@ export enum AddonName { UC_CLAMAV_VIRUS_SCAN = 'uc_clamav_virus_scan', AWS_REKOGNITION_DETECT_LABELS = 'aws_rekognition_detect_labels', + AWS_REKOGNITION_DETECT_MODERATION_LABELS = 'aws_rekognition_detect_moderation_labels', REMOVE_BG = 'remove_bg' } diff --git a/packages/rest-client/src/types/AddonParams.ts b/packages/rest-client/src/types/AddonParams.ts index 6604a6e3..4c08740c 100644 --- a/packages/rest-client/src/types/AddonParams.ts +++ b/packages/rest-client/src/types/AddonParams.ts @@ -6,6 +6,8 @@ export type AddonUcClamavVirusScanParams = { export type AddonAwsRekognitionDetectLabelsParams = undefined +export type AddonAwsRekognitionModerationLabelsParams = undefined + export type AddonRemoveBgParams = { crop?: boolean crop_margin?: string @@ -22,5 +24,6 @@ export type AddonRemoveBgParams = { export type AddonParams = { [AddonName.UC_CLAMAV_VIRUS_SCAN]: AddonUcClamavVirusScanParams [AddonName.AWS_REKOGNITION_DETECT_LABELS]: AddonAwsRekognitionDetectLabelsParams + [AddonName.AWS_REKOGNITION_DETECT_MODERATION_LABELS]: AddonAwsRekognitionModerationLabelsParams [AddonName.REMOVE_BG]: AddonRemoveBgParams } diff --git a/packages/rest-client/src/types/AppData.ts b/packages/rest-client/src/types/AppData.ts index 657fef4b..24048e20 100644 --- a/packages/rest-client/src/types/AppData.ts +++ b/packages/rest-client/src/types/AppData.ts @@ -1,14 +1,17 @@ import { AddonName } from './AddonName' +export type TechFieldsAppData = { + version: string + datetime_created: string + datetime_updated: string +} + export type ClamavVirusScan = { data: { infected: boolean infected_with: string } - version: string - datetime_created: string - datetime_updated: string -} +} & TechFieldsAppData export type AwsRekognitionDetectLabelParent = { Name: string @@ -36,22 +39,29 @@ export type AwsRekognitionDetectLabels = { LabelModelVersion: string Labels: AwsRekognitionDetectLabel[] } - version: string - datetime_created: string - datetime_updated: string -} +} & TechFieldsAppData + +export type AwsRekognitionDetectModerationLabel = Pick< + AwsRekognitionDetectLabel, + 'Confidence' | 'Name' +> & { ParentName: string } + +export type AwsRekognitionDetectModerationLabels = { + data: { + ModerationModelVersion: string + ModerationLabels: AwsRekognitionDetectModerationLabel[] + } +} & TechFieldsAppData export type RemoveBg = { data: { foreground_type: string } - version: string - datetime_created: string - datetime_updated: string -} +} & TechFieldsAppData export type AppData = { [AddonName.UC_CLAMAV_VIRUS_SCAN]?: ClamavVirusScan [AddonName.AWS_REKOGNITION_DETECT_LABELS]?: AwsRekognitionDetectLabels + [AddonName.AWS_REKOGNITION_DETECT_MODERATION_LABELS]: AwsRekognitionDetectModerationLabels [AddonName.REMOVE_BG]?: RemoveBg }