# === DATA PIPELINE COMMANDS === # # Commands for running the Auth0/Neo4j export pipeline .PHONY: export_auth0_users export_auth0_orgs export_auth0_org_members export_auth0_org_members_test export_neo4j_identities export_vend_contacts combine_users # Variables for pipeline commands INPUT ?= BATCH_SIZE ?= 1000 MAX_BATCHES ?= OUTPUT ?= INCLUDE_PROFILES ?= AUTH0_USERS ?= ORG_MEMBERS ?= NEO4J_IDENTITIES ?= VEND_CONTACTS ?= export_auth0_users: ## Export Auth0 users via CLI (saves to data/input/job_.json) uv run python src/auth0/export_users.py export_auth0_orgs: ## Export Auth0 organizations to JSON (saves to data/input/orgs_.json) uv run python src/auth0/export_orgs.py export_auth0_org_members: ## Export organization members (interactive file picker) uv run python src/auth0/export_org_members.py export_auth0_org_members_test: ## Export org members in test mode (single org, limited users) uv run python src/auth0/export_org_members.py --test export_neo4j_identities: ## Enrich Auth0 users with Neo4j data (interactive file picker if INPUT omitted) @CMD="uv run python src/neo4j/export_identities.py --batch-size $(BATCH_SIZE)"; \ if [ -n "$(INPUT)" ]; then CMD="$$CMD --input $(INPUT)"; fi; \ if [ -n "$(MAX_BATCHES)" ]; then CMD="$$CMD --max-batches $(MAX_BATCHES)"; fi; \ if [ -n "$(OUTPUT)" ]; then CMD="$$CMD --output $(OUTPUT)"; fi; \ if [ -n "$(INCLUDE_PROFILES)" ]; then CMD="$$CMD --include-profiles"; fi; \ eval $$CMD export_vend_contacts: ## Generate vend_contact report (Auth0 + Neo4j LabelProfiles + MySQL) @CMD="uv run python src/mysql/export_vend_contacts.py --batch-size $(BATCH_SIZE)"; \ if [ -n "$(INPUT)" ]; then CMD="$$CMD --input $(INPUT)"; fi; \ if [ -n "$(MAX_BATCHES)" ]; then CMD="$$CMD --max-batches $(MAX_BATCHES)"; fi; \ if [ -n "$(OUTPUT)" ]; then CMD="$$CMD --output $(OUTPUT)"; fi; \ eval $$CMD combine_users: ## Combine Auth0 users, org members, Neo4j identities, and vend_contacts (interactive file picker) @CMD="uv run python src/combine_users.py"; \ if [ -n "$(AUTH0_USERS)" ]; then CMD="$$CMD --auth0-users $(AUTH0_USERS)"; fi; \ if [ -n "$(ORG_MEMBERS)" ]; then CMD="$$CMD --org-members $(ORG_MEMBERS)"; fi; \ if [ -n "$(NEO4J_IDENTITIES)" ]; then CMD="$$CMD --neo4j-identities $(NEO4J_IDENTITIES)"; fi; \ if [ -n "$(VEND_CONTACTS)" ]; then CMD="$$CMD --vend-contacts $(VEND_CONTACTS)"; fi; \ if [ -n "$(OUTPUT)" ]; then CMD="$$CMD --output $(OUTPUT)"; fi; \ eval $$CMD