RTSDA-Website/src/lib.rs
Benjamin Slingo 91a1bb7a54 Restructure project and update gitignore
- Flatten directory structure by moving files from astro-church-website/ to root
- Remove church-core subdirectory in favor of inline Rust library
- Update .gitignore to properly exclude build artifacts, generated files, and dependencies
- Add environment variables, IDE files, and coverage reports to gitignore
- Include generated CSS files and native bindings in ignore patterns
2025-08-30 08:59:27 -04:00

169 lines
3.2 KiB
Rust

use napi_derive::napi;
use church_core;
use church_core::api;
#[napi]
pub fn get_church_name() -> String {
api::get_church_name()
}
#[napi]
pub fn fetch_events_json() -> String {
api::fetch_events_json()
}
#[napi]
pub fn fetch_featured_events_json() -> String {
api::fetch_featured_events_json()
}
#[napi]
pub fn fetch_sermons_json() -> String {
api::fetch_sermons_json()
}
#[napi]
pub fn fetch_config_json() -> String {
api::fetch_config_json()
}
#[napi]
pub fn get_mission_statement() -> String {
api::get_mission_statement()
}
#[napi]
pub fn fetch_random_bible_verse_json() -> String {
api::fetch_random_bible_verse_json()
}
#[napi]
pub fn get_stream_live_status() -> bool {
api::get_stream_live_status()
}
#[napi]
pub fn get_livestream_url() -> String {
api::get_livestream_url()
}
#[napi]
pub fn get_church_address() -> String {
api::get_church_address()
}
#[napi]
pub fn get_church_physical_address() -> String {
api::get_church_physical_address()
}
#[napi]
pub fn get_church_po_box() -> String {
api::get_church_po_box()
}
#[napi]
pub fn get_contact_phone() -> String {
api::get_contact_phone()
}
#[napi]
pub fn get_contact_email() -> String {
api::get_contact_email()
}
#[napi]
pub fn get_facebook_url() -> String {
api::get_facebook_url()
}
#[napi]
pub fn get_youtube_url() -> String {
api::get_youtube_url()
}
#[napi]
pub fn get_instagram_url() -> String {
api::get_instagram_url()
}
#[napi]
pub fn submit_contact_v2_json(name: String, email: String, subject: String, message: String, phone: String) -> String {
api::submit_contact_v2_json(name, email, subject, message, phone)
}
#[napi]
pub fn validate_contact_form_json(form_json: String) -> String {
api::validate_contact_form_json(form_json)
}
#[napi]
pub fn fetch_livestream_archive_json() -> String {
api::fetch_livestream_archive_json()
}
#[napi]
pub fn fetch_bulletins_json() -> String {
api::fetch_bulletins_json()
}
#[napi]
pub fn fetch_current_bulletin_json() -> String {
api::fetch_current_bulletin_json()
}
#[napi]
pub fn fetch_bible_verse_json(query: String) -> String {
api::fetch_bible_verse_json(query)
}
#[napi]
pub fn submit_event_json(
title: String,
description: String,
start_time: String,
end_time: String,
location: String,
location_url: Option<String>,
category: String,
recurring_type: Option<String>,
submitter_email: Option<String>
) -> String {
api::submit_event_json(
title,
description,
start_time,
end_time,
location,
location_url,
category,
recurring_type,
submitter_email
)
}
// Admin functions
#[napi]
pub fn test_admin_function() -> String {
"test".to_string()
}
#[napi]
pub fn fetch_all_schedules_json() -> String {
api::fetch_all_schedules_json()
}
#[napi]
pub fn create_schedule_json(schedule_json: String) -> String {
api::create_schedule_json(schedule_json)
}
#[napi]
pub fn update_schedule_json(date: String, update_json: String) -> String {
api::update_schedule_json(date, update_json)
}
#[napi]
pub fn delete_schedule_json(date: String) -> String {
api::delete_schedule_json(date)
}