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>
This commit is contained in:
60
test-n8n-webhook.sh
Executable file
60
test-n8n-webhook.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Test script to verify n8n webhook is being called correctly
|
||||
# This simulates what create-meet-link function does
|
||||
|
||||
SUPABASE_URL="https://lovable.backoffice.biz.id"
|
||||
SERVICE_ROLE_KEY="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTc2NjAzNzEyMCwiZXhwIjo0OTIxNzEwNzIwLCJyb2xlIjoic2VydmljZV9yb2xlIn0.t6D9VwaukYGq4c_VbW1bkd3ZkKgldpCKRR13nN14XXc"
|
||||
|
||||
echo "🔍 Checking platform settings..."
|
||||
echo ""
|
||||
|
||||
# Fetch current platform settings
|
||||
SETTINGS=$(curl -s "$SUPABASE_URL/rest/v1/platform_settings?select=integration_n8n_base_url,integration_n8n_test_mode" \
|
||||
-H "Authorization: Bearer $SERVICE_ROLE_KEY" \
|
||||
-H "apikey: $SERVICE_ROLE_KEY")
|
||||
|
||||
echo "Current Settings:"
|
||||
echo "$SETTINGS" | jq '.'
|
||||
|
||||
# Extract values
|
||||
BASE_URL=$(echo "$SETTINGS" | jq -r '.[0].integration_n8n_base_url')
|
||||
TEST_MODE=$(echo "$SETTINGS" | jq -r '.[0].integration_n8n_test_mode')
|
||||
|
||||
echo ""
|
||||
echo "Base URL: $BASE_URL"
|
||||
echo "Test Mode: $TEST_MODE"
|
||||
|
||||
# Construct webhook URL
|
||||
if [ "$TEST_MODE" = "true" ] || [ "$TEST_MODE" = "True" ]; then
|
||||
WEBHOOK_PATH="/webhook-test/"
|
||||
else
|
||||
WEBHOOK_PATH="/webhook/"
|
||||
fi
|
||||
|
||||
WEBHOOK_URL="${BASE_URL}${WEBHOOK_PATH}create-meet"
|
||||
|
||||
echo ""
|
||||
echo "📡 Webhook URL that will be called:"
|
||||
echo "$WEBHOOK_URL"
|
||||
echo ""
|
||||
|
||||
# Test if webhook is reachable (without actually triggering)
|
||||
echo "🧪 Testing webhook reachability..."
|
||||
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" -X POST "$WEBHOOK_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"slot_id": "test-slot-123",
|
||||
"date": "2025-12-23",
|
||||
"start_time": "14:00:00",
|
||||
"end_time": "15:00:00",
|
||||
"client_name": "Test Client",
|
||||
"client_email": "test@example.com",
|
||||
"topic": "Test Topic",
|
||||
"calendar_id": "test@example.com",
|
||||
"brand_name": "Test Hub",
|
||||
"test_mode": true
|
||||
}' || echo "Webhook not reachable"
|
||||
|
||||
echo ""
|
||||
echo "✅ Test complete!"
|
||||
Reference in New Issue
Block a user