-
-
Save vqc1909a/1a03300ea072abdbce8956a303378751 to your computer and use it in GitHub Desktop.
SCRIPT_DOWNLOAD_ALL_EDGE_FUNCTIONS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Download ALL edge functions from Supabase cloud | |
| echo "π Starting comprehensive edge functions download..." | |
| # Extract function names from the list (all of them!) | |
| functions=( | |
| "meta-auth" | |
| "snapchat-refresh" | |
| "snapchat-accounts" | |
| "meta-accounts" | |
| "tiktok-auth" | |
| "tiktok-accounts" | |
| "upload-facebook-creative" | |
| "upload-tiktok-video" | |
| "upload-snapchat-video" | |
| "meta-insights" | |
| "snapchat-insights" | |
| "tiktok-insights" | |
| "campaign-insights" | |
| "audience-insights" | |
| "ad-insights" | |
| "snapchat-ad-details" | |
| "create-campaign" | |
| "summarize-video" | |
| "get-campaign-platforms" | |
| "get-pixels" | |
| "known-audiences" | |
| "maps-locations-search" | |
| "zip-search" | |
| "get-schema" | |
| "get-temporary-exclusions" | |
| "generate-video-ideas" | |
| "generate-voice" | |
| "accept-faniq-audiences" | |
| "get-active-audiences" | |
| "tiktok-identities" | |
| "tiktok-create-identity" | |
| "facebook-generate-preview" | |
| "test-payload" | |
| "snapchat-generate-preview" | |
| "facebook-create-creative" | |
| "snapchat-create-creative" | |
| "tiktok-create-creative" | |
| "tixr-proxy" | |
| "meta-create-ad" | |
| "upload-tiktok-media" | |
| "deploy-ads" | |
| "deploy-meta-ads" | |
| "deploy-snapchat-ads" | |
| "deploy-tiktok-ads" | |
| "process-audience-payload" | |
| "snapchat-create-ad" | |
| "tiktok-create-ad" | |
| "audience-ad-insights" | |
| "search-meta-interests" | |
| "snapchat-interest-search" | |
| "clever-responder" | |
| "tiktok-interest-search" | |
| "facebook-campaign-details" | |
| "update-facebook-campaign" | |
| "meta-identities" | |
| "accept-faniq_audience" | |
| "facebook-insights-report" | |
| "super-task" | |
| "create_dataset_bigquery" | |
| "facebook_bigquery_backfill" | |
| "instagram_bigquery_backfill" | |
| "snapchat_bigquery_backfill" | |
| "get-external-campaigns" | |
| "tiktok-audience-size" | |
| "snapchat-campaign-details" | |
| "update-snapchat-campaign" | |
| "tiktok-campaign-details" | |
| "tiktok-update-campaign" | |
| "get-ad-details" | |
| "get-snapchat-ad-details" | |
| "get-tiktok-ad-details" | |
| "update-ad-status" | |
| "facebook-adset-details" | |
| "ai-campaign-assistant" | |
| "ai-campaign-assistant-mcp" | |
| "account-mappings-insights" | |
| "snapchat-refresh-all" | |
| "campaign-tree-insights" | |
| "cron-sync-trigger" | |
| "scheduled-data-sync" | |
| "tixr-public-feed" | |
| "transform-video-webhook" | |
| "sync-audience-to-platforms" | |
| "fetch-audience-sizes" | |
| "snapchat-adset-details" | |
| "tiktok-adset-details" | |
| "get-all-platform-campaigns" | |
| "creatomate-render" | |
| "spotify-search" | |
| "spotify-track-details" | |
| "create-meta-audience" | |
| "pexels-proxy" | |
| "perplexity-sports-search" | |
| "etix-proxy" | |
| "facebook-data-deletion" | |
| "campaign-tree-data" | |
| "instagram-media-proxy" | |
| "duplicate-meta-campaign" | |
| "create-unified-campaign" | |
| "spotify-artist-audience" | |
| "perplexity-artist-audience" | |
| "fetch-youtube-artist-content" | |
| "fetch-stock-media" | |
| "parse-fevo-event" | |
| "event-form-management" | |
| "get-upcoming-campaigns" | |
| "get-meta-campaigns" | |
| "get-snapchat-campaigns" | |
| "get-tiktok-campaigns" | |
| "perplexity-event-audience" | |
| "team-invite" | |
| "firecrawl-scrape" | |
| "ai-campaign-extractor" | |
| "perplexity-url-audience" | |
| "upload-image-from-url" | |
| "download-image" | |
| "google-ads-auth" | |
| "google-ads-callback" | |
| "google-ads-refresh" | |
| "google-ads-client-accounts" | |
| "instagram-scraper-cron" | |
| "fetch-all-events" | |
| "send-team-invitation" | |
| "accept-team-invitation-complete" | |
| "generate-team-invite-code" | |
| "join-team-with-code" | |
| "create-team" | |
| "get-user-teams" | |
| "get-accessible-account-mappings" | |
| "update-adset-status" | |
| "get-ad-permalink" | |
| "get-meta-campaign-hierarchy" | |
| "get-user-teams-safe" | |
| "get-team-access-context" | |
| "tiktok_bigquery_backfill" | |
| "instagram-scrape" | |
| "get-optimize-share-links" | |
| "create-optimize-share-link" | |
| "validate-optimize-share-link" | |
| "delete-optimize-share-link" | |
| "validate-share-link-v2" | |
| "backfill-orchestrator" | |
| "hourly-backfill-trigger" | |
| "create-admin-views" | |
| "create-master-all-platforms-view" | |
| "create-master-view" | |
| "create-master-view-simple" | |
| "create-master-view-validated" | |
| "scan-datasets" | |
| "scan-all-datasets" | |
| "create-master-view-final" | |
| "reset-all-datasets" | |
| "six-month-backfill" | |
| "create-master-view-unified" | |
| "refresh-master-view" | |
| "scheduled-refresh" | |
| "get-campaign-tree-data" | |
| "test-bigquery-simple" | |
| "quick-refresh-all-clients" | |
| "create-all-clients-table" | |
| "sync-bigquery-to-supabase" | |
| "sync-bigquery-365" | |
| "replace-campaign-data" | |
| "cleanup-all-tiktok" | |
| "create-sub-account" | |
| "get-sub-accounts" | |
| "update-sub-account-permissions" | |
| "create-sub-account-invite" | |
| "accept-sub-account-invitation" | |
| "team-sub-account-login" | |
| "create-team-sub-account" | |
| "create-team-user" | |
| "team-login" | |
| "axs-proxy" | |
| "axs" | |
| "sync-all-events" | |
| "event-sync-cron" | |
| "setup-database" | |
| "sync-events-to-database" | |
| "scheduled-events-sync" | |
| "force-sync-now" | |
| "canadian-postal-codes" | |
| "get-campaign-insights" | |
| "unified-ads-backfill" | |
| "scheduled-backfill-rotator" | |
| "campaign-insights-ai" | |
| "duplicate-enhanced-campaign" | |
| "update-facebook-ad" | |
| "create-shared-optimize-link" | |
| "validate-shared-optimize-link" | |
| "manage-shared-optimize-links" | |
| "slack-login-notify" | |
| "admin-user-search" | |
| "admin-impersonate-query" | |
| "get-pixels-by-mapping" | |
| "list-edge-functions" | |
| "get-edge-function-body" | |
| "get-function-source-code" | |
| "internal-meta-create-ad" | |
| "faniq-campaign-insights-detailed" | |
| "faniq-campaign-insights" | |
| "get-meta-insights" | |
| "save-campaign-draft" | |
| "load-campaign-draft" | |
| "list-campaign-drafts" | |
| "delete-campaign-draft" | |
| "save-campaign-payload" | |
| "load-campaign-payload" | |
| "list-campaign-payloads" | |
| "delete-campaign-payload" | |
| "meta-refresh" | |
| "get-meta-account-info" | |
| "scheduled-bigquery-view-refresh" | |
| "google-ads-accounts" | |
| ) | |
| # Counter for tracking progress | |
| total=${#functions[@]} | |
| current=0 | |
| success=0 | |
| failed=0 | |
| echo "π Total functions to download: $total" | |
| echo "π Starting download process..." | |
| echo | |
| # Download functions one by one with error handling and progress tracking | |
| for func in "${functions[@]}"; do | |
| current=$((current + 1)) | |
| echo "[$current/$total] π₯ Downloading: $func" | |
| if npx supabase functions download "$func" 2>/dev/null; then | |
| success=$((success + 1)) | |
| echo " β Success: $func" | |
| else | |
| failed=$((failed + 1)) | |
| echo " β Failed: $func" | |
| # Retry once after a short delay | |
| echo " π Retrying: $func" | |
| sleep 2 | |
| if npx supabase functions download "$func" 2>/dev/null; then | |
| success=$((success + 1)) | |
| failed=$((failed - 1)) | |
| echo " β Retry Success: $func" | |
| else | |
| echo " β Retry Failed: $func" | |
| fi | |
| fi | |
| # Small delay to avoid rate limiting | |
| sleep 0.3 | |
| done | |
| echo | |
| echo "π Download Summary:" | |
| echo " π Total functions: $total" | |
| echo " β Successfully downloaded: $success" | |
| echo " β Failed downloads: $failed" | |
| echo " π Success rate: $((success * 100 / total))%" | |
| echo | |
| if [ $success -gt 0 ]; then | |
| echo "π Functions are now available in supabase/functions/" | |
| echo "π‘ To deploy them locally, run:" | |
| echo " npx supabase functions deploy --no-verify-jwt" | |
| fi | |
| echo | |
| echo "β¨ Edge functions download completed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment