-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsync.sh
More file actions
executable file
·43 lines (35 loc) · 1.3 KB
/
sync.sh
File metadata and controls
executable file
·43 lines (35 loc) · 1.3 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
#!/bin/bash
set -euo pipefail
defaultBaseUrl="https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi"
schemaUrl="${1:-$defaultBaseUrl/schemas/fingerprint-server-api-v4.yaml}"
examplesBaseUrl="${2:-$defaultBaseUrl/examples}"
mkdir -p ./res
curl -fSL --retry 3 -o ./res/fingerprint-server-api.yaml "$schemaUrl"
examples=(
'events/search/get_event_search_200.json'
'events/get_event_200.json'
'events/get_event_ruleset_200.json'
'events/update_event_multiple_fields_request.json'
'events/update_event_one_field_request.json'
'errors/400_event_id_invalid.json'
'errors/400_request_body_invalid.json'
'errors/400_visitor_id_required.json'
'errors/400_visitor_id_invalid.json'
'errors/403_feature_not_enabled.json'
'errors/403_secret_api_key_required.json'
'errors/404_event_not_found.json'
'errors/404_visitor_not_found.json'
'errors/409_state_not_ready.json'
'errors/429_too_many_requests.json'
)
baseDestination="./test/mocks"
mkdir -p "$baseDestination"
for example in "${examples[@]}"; do
destinationPath="$baseDestination/$example"
destinationDir="$(dirname "$destinationPath")"
mkdir -p "$destinationDir"
exampleUrl="$examplesBaseUrl/$example"
echo "Downloading $exampleUrl to $destinationPath"
curl -fSL --retry 3 -o "$destinationPath" "$exampleUrl"
done
./generate.sh