added more support for supabase-js
This commit is contained in:
35
functions/src/models.rs
Normal file
35
functions/src/models.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, sqlx::FromRow)]
|
||||
pub struct Function {
|
||||
pub id: Uuid,
|
||||
pub name: String,
|
||||
pub code: Vec<u8>,
|
||||
pub runtime: String, // "wasm" or "deno"
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct InvokeRequest {
|
||||
pub payload: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct InvokeResponse {
|
||||
pub result: Option<String>,
|
||||
pub error: Option<String>,
|
||||
pub logs: Vec<String>,
|
||||
pub status: u16,
|
||||
pub headers: Option<std::collections::HashMap<String, String>>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct DeployRequest {
|
||||
pub name: String,
|
||||
pub code_base64: String,
|
||||
pub runtime: Option<String>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user