Files
meet-hub/deploy-edge-functions.sh
dwindown 631dc9a083 Add Google Calendar integration via Supabase Edge Functions
- Create new create-google-meet-event edge function
- Use service account authentication (no OAuth needed)
- Add google_service_account_json field to platform_settings
- Add admin UI for service account JSON configuration
- Include test connection button in Integrasi tab
- Add comprehensive setup documentation
- Keep n8n workflows as alternative option

Features:
- Direct Google Calendar API integration
- JWT authentication with service account
- Auto-create Google Meet links
- No external dependencies needed
- Simple configuration via admin panel

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 01:32:23 +07:00

42 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Configuration
SUPABASE_URL="https://lovable.backoffice.biz.id"
SERVICE_ROLE_KEY="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTc2NjAzNzEyMCwiZXhwIjo0OTIxNzEwNzIwLCJyb2xlIjoic2VydmljZV9yb2xlIn0.t6D9VwaukYGq4c_VbW1bkd3ZkKgldpCKRR13nN14XXc"
# Function to deploy edge function
deploy_function() {
local func_name=$1
echo "Deploying $func_name..."
# Read the function content
if [ -f "supabase/functions/$func_name/index.ts" ]; then
FUNCTION_CONTENT=$(cat "supabase/functions/$func_name/index.ts")
# Create the function via API
curl -X POST "$SUPABASE_URL/rest/v1/functions" \
-H "Authorization: Bearer $SERVICE_ROLE_KEY" \
-H "apikey: $SERVICE_ROLE_KEY" \
-H "Content-Type: application/json" \
-d "{
\"name\": \"$func_name\",
\"verify_jwt\": $(cat supabase/config.toml | grep -A 1 "\\[functions.$func_name\\]" | grep verify_jwt | awk '{print $3}')
}"
echo "Function $func_name created/updated"
else
echo "Function $func_name not found"
fi
}
# Deploy all functions
deploy_function "pakasir-webhook"
deploy_function "send-test-email"
deploy_function "create-meet-link" # Includes n8n test mode toggle
deploy_function "send-consultation-reminder"
deploy_function "send-notification"
deploy_function "send-email-v2"
deploy_function "daily-reminders"
echo "Deployment complete!"