import { PhotoFile, VideoFile } from "react-native-vision-camera"; import { Guide } from "../components/guides/GuideManager"; export type captureType = "Image" | "Video"; export type sourceType = "DeviceCamera" | "IPCamera" | "Ricoh"; /** * @interface AOP * @description * represents the base `SOP` interface consumed by the `capture-sdk` */ export interface AOP { title: string; steps: Step[]; gpt: GPTResponse[][][]; appMetaData?: { ricoh?: { ip: string; username: string; password: string; }; }; } /** * @interface Step * @description * represents the `Step` component */ export interface Step { /** * @param {string} title * represents title of step * @description * used to display the title as a item in the step list */ title: string; /** * @param {string} stepId * represents id of step * @description * used for internal state management of each step */ stepId: string; /** * @param {Slot[]} slots * represents slots present in each step * @description * used for working through each slot of a step */ slots: Slot[]; /** * @param {boolean} isComplete * used to check and set if a step is complete * @description * used for internal state management of each step */ isComplete: boolean; isUploaded: boolean; /** * @todo * work in progress for this list */ prerequisiteSteps?: string[]; stepType: "DEFAULT" | "NOT_DEFAULT"; } export interface Slot { /** * @param {string} title * represents title of slot * @description * used to display the title as a item in the slot list */ title: string; /** * @param {string} slotId * represents id of slot * @description * used for internal state management of each slot */ slotId: string; key?: string; /** * @param {boolean} isComplete * used to check and set if a slot is complete * @description * used for internal state management of each slot */ isComplete: boolean; /** * @param {boolean} isUploaded * used to check and set if a slot is uploaded * @description * used for internal state management of each slot */ isUploaded: boolean; /** * @todo */ hint?: Hint; /** * @param {Action} usedAction * used to set the action with data used in the current slot * @description * used for internal state management of each slot */ usedAction?: Action; /** * @param {string} uploadURL * set URL of s3 after a successful AWS upload of the action data */ uploadURL?: string; /** * @param {string} uploadURI * set URI of s3 after a successful AWS upload of the action data */ uploadURI?: string; /** * @todo */ prerequisiteSlots: string[]; /** * @todo */ preprocessingServices?: ServiceAction[]; /** * @param {ServiceAction[]} postprocessingServices * a list of post processing services to be run on the given data */ postprocessingServices?: ServiceAction[]; /** * action to be executed */ sequence?: { sequence: Guide[] }; action?: Action; lock?: boolean; slotItems: SlotItem[]; slotType: "DEFAULT" | "FEATURE" | "IMPERFECTION"; locked: boolean; refKey?: string; imperfectionData?: any; imperfectionMetaData?: { hotspotCategoryGroup?: string; hotspotCategory?: string; hotspotPart?: string; hotspotCondition?: string; }; } export interface SlotItem { title: string; slotItemId: string; availableActions: Action[]; usedAction?: Action; isComplete: boolean; isUploaded: boolean; /** * @param {string} uploadURL * set URL of s3 after a successful AWS upload of the action data */ uploadURL?: string; /** * @param {string} uploadURI * set URI of s3 after a successful AWS upload of the action data */ uploadURI?: string; } export interface Action { title: string; actionId: string; vision?: boolean; guide?: { url: string; }; actionData?: PhotoFile | VideoFile; captureType: captureType; sourceType: sourceType; settings?: Settings[]; // dynamic settings changed by the user inside app storagePath?: string; // defined for the outputs to be stored on the device } export interface ServiceAction { service_id: string; status: "idle" | "running" | "finished"; } export interface Settings { settingName: string; default: any; } export interface Hint { type: "string" | "image_array"; source: string[] | string; } export type GPTResponse = { role: "user" | "assistant" | "system"; content: string; }; // store the AOP state as a storage value after each action is completed