export const flowMongoSchema = { bsonType: "object", required: [ "flowName", "systemInstructions", "initialSentence", "interactions", ], properties: { _id: { bsonType: "objectId" }, flowName: { bsonType: "string" }, clientId: { bsonType: "string" }, systemInstructions: { bsonType: "string" }, initialSentence: { bsonType: "string" }, disableGenericPrompt: { bsonType: "bool" }, voice: { bsonType: ["string", "null"] }, conversationSettings: { bsonType: ["object", "null"], properties: { interruptions: { bsonType: ["object", "null"], properties: { enableInterruptionDetection: { bsonType: "bool" }, interruptionWindowSeconds: { bsonType: "number" }, interruptionThresholdSeconds: { bsonType: "number" }, interruptionInstruction: { bsonType: "string" }, }, additionalProperties: false, }, silence: { bsonType: ["object", "null"], properties: { enableSilenceDetection: { bsonType: "bool" }, firstWarningSilenceSeconds: { bsonType: "number" }, firstWarningInstruction: { bsonType: "string" }, secondWarningSilenceSeconds: { bsonType: "number" }, secondWarningInstruction: { bsonType: "string" }, disconnectSilenceSeconds: { bsonType: "number" }, }, additionalProperties: false, }, liveTimeUpdates: { bsonType: "bool" }, }, additionalProperties: false, }, interactions: { bsonType: "array", items: { bsonType: "object", required: ["id", "type", "text", "position"], properties: { id: { bsonType: "string" }, type: { bsonType: "string" }, text: { bsonType: "string" }, successStatus: { bsonType: ["string", "null"] }, conditions: { bsonType: ["array", "null"], items: { bsonType: "object", required: ["conditionString"], properties: { conditionString: { bsonType: "string" }, nodeType: { bsonType: ["string", "null"] }, id: { bsonType: ["string", "null"] }, }, }, }, defaultNodeType: { bsonType: ["string", "null"] }, defaultChild: { bsonType: ["object", "null"], properties: { id: { bsonType: "string" } }, }, position: { bsonType: "object", required: ["x", "y"], properties: { x: { bsonType: "number" }, y: { bsonType: "number" }, }, }, name: { bsonType: ["string", "null"] }, children: { bsonType: ["array", "null"], items: { bsonType: "string" }, }, resultsLabel: { bsonType: ["string", "null"] }, resultsColor: { bsonType: ["string", "null"] }, }, }, }, edges: { bsonType: ["array", "null"], items: { bsonType: "object", required: ["id", "source", "target"], properties: { id: { bsonType: "string" }, source: { bsonType: "string" }, target: { bsonType: "string" }, label: { bsonType: ["string", "null"] }, }, }, }, metaKeys: { bsonType: ["array", "null"], items: { bsonType: "object", required: ["key"], properties: { key: { bsonType: "string" }, required: { bsonType: "bool" }, }, }, }, userProperties: { bsonType: ["array", "null"], items: { bsonType: "object", required: ["name", "description"], properties: { name: { bsonType: "string" }, description: { bsonType: "string" }, }, }, }, tools: { bsonType: ["array", "null"], items: { bsonType: "object", required: ["id", "name", "url", "method", "parameters"], properties: { id: { bsonType: "string" }, name: { bsonType: "string" }, description: { bsonType: "string" }, url: { bsonType: "string" }, method: { bsonType: "string" }, headers: { bsonType: "object" }, parameters: { bsonType: "object" }, bodyFormat: { bsonType: "string", enum: ["json", "form-data"] }, preventAudioDuringTool: { bsonType: "bool" }, useRedisTranscription: { bsonType: "bool" }, sendUserAuthToken: { bsonType: "bool" }, runInBackground: { bsonType: "bool" }, backgroundToolType: { bsonType: "string", enum: ["backgroundToolAlways", "backgroundToolOnce"], }, backgroundContinuationInstructions: { bsonType: "string" }, }, additionalProperties: false, }, }, internalTools: { bsonType: ["object", "null"], additionalProperties: { bsonType: "object", required: ["enabled"], properties: { enabled: { bsonType: "bool" }, maxCalls: { bsonType: ["number", "null"] }, params: { bsonType: ["object", "null"], additionalProperties: { bsonType: "object", properties: { description: { bsonType: ["string", "null"] }, value: { bsonType: ["string", "number", "bool", "array", "null"], }, }, additionalProperties: false, }, }, }, additionalProperties: false, }, }, }, additionalProperties: false, } as const;