-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun-data-collection.sh
More file actions
142 lines (132 loc) · 6.16 KB
/
run-data-collection.sh
File metadata and controls
142 lines (132 loc) · 6.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/bin/bash
# ═══════════════════════════════════════════════════════════════════════
# QuickPay Data Collection Testing Script
# ═══════════════════════════════════════════════════════════════════════
#
# This script helps you test data collection functionality
#
# ═══════════════════════════════════════════════════════════════════════
show_menu() {
clear
echo ""
echo "╔═══════════════════════════════════════════════════════════════════╗"
echo "║ QuickPay Data Collection Testing ║"
echo "╚═══════════════════════════════════════════════════════════════════╝"
echo ""
echo "Please select an option:"
echo ""
echo " 1. View Data Collection Analysis"
echo " 2. Export Data Collection Analysis to JSON"
echo " 3. Export User Data (requires Clerk ID)"
echo " 4. View Help"
echo " 5. Exit"
echo ""
}
analyze() {
echo ""
echo "═══════════════════════════════════════════════════════════════════"
echo " Running Data Collection Analysis..."
echo "═══════════════════════════════════════════════════════════════════"
echo ""
node scripts/analyze-data-collection.js
echo ""
read -p "Press Enter to continue..."
}
analyze_export() {
echo ""
echo "═══════════════════════════════════════════════════════════════════"
echo " Exporting Data Collection Analysis to JSON..."
echo "═══════════════════════════════════════════════════════════════════"
echo ""
node scripts/analyze-data-collection.js --export
echo ""
echo "File saved to: data-exports/data-collection-analysis-*.json"
echo ""
read -p "Press Enter to continue..."
}
export_user() {
echo ""
echo "═══════════════════════════════════════════════════════════════════"
echo " Export User Data (GDPR Compliance)"
echo "═══════════════════════════════════════════════════════════════════"
echo ""
echo "You need a Clerk User ID to export data."
echo "Example: user_2a1b2c3d4e5f6g7h8i9j"
echo ""
read -p "Enter Clerk ID (or 'back' to return): " clerkid
if [ "$clerkid" = "back" ]; then
return
fi
if [ -z "$clerkid" ]; then
echo "Error: Clerk ID cannot be empty"
echo ""
read -p "Press Enter to continue..."
return
fi
echo ""
echo "Exporting data for user: $clerkid"
echo ""
node scripts/export-user-data.js "$clerkid"
echo ""
echo "File saved to: data-exports/user-data-*.json"
echo ""
read -p "Press Enter to continue..."
}
show_help() {
clear
echo ""
echo "═══════════════════════════════════════════════════════════════════"
echo " HELP - How to Use This Script"
echo "═══════════════════════════════════════════════════════════════════"
echo ""
echo "OPTION 1: View Data Collection Analysis"
echo " - Shows all 7 data collection points"
echo " - Lists 5 storage locations"
echo " - Documents 4 external services"
echo " - Shows 6 security measures"
echo " - Displays compliance information"
echo " - Output: Console only"
echo ""
echo "OPTION 2: Export Analysis to JSON"
echo " - Same as Option 1 but saves to JSON file"
echo " - Output: data-exports/data-collection-analysis-*.json"
echo ""
echo "OPTION 3: Export User Data"
echo " - Exports all data for a specific user (GDPR compliance)"
echo " - Required: Clerk User ID"
echo " - Output: data-exports/user-data-*.json"
echo " - Includes: profile, favorites, metadata"
echo ""
echo "HOW TO GET CLERK USER ID:"
echo " 1. Open the QuickPay app"
echo " 2. Check Profile screen OR"
echo " 3. Go to Clerk Dashboard (clerk.com) and find user"
echo " 4. Format: user_2a1b2c3d4e5f6g7h8i9j"
echo ""
echo "EXAMPLE USAGE:"
echo " Option 3 with ID: user_2a1b2c3d4e5f6g7h8i9j"
echo " Creates: data-exports/user-data-user_2a1b...-1699123456789.json"
echo ""
read -p "Press Enter to continue..."
}
# Main loop
while true; do
show_menu
read -p "Enter your choice (1-5): " choice
case $choice in
1) analyze ;;
2) analyze_export ;;
3) export_user ;;
4) show_help ;;
5)
echo ""
echo "Thank you for using QuickPay Data Collection Testing!"
echo ""
exit 0
;;
*)
echo "Invalid choice. Please try again."
sleep 2
;;
esac
done