forked from jsnbuchanan/crowd-funder-for-time-pwa
docs: improve endorserServer.ts documentation and types
Changes: - Add comprehensive JSDoc headers with examples - Improve function documentation with param/return types - Add module-level documentation explaining purpose - Clean up testRecursivelyOnStrings implementation - Add type annotations to cache functions - Simplify serverMessageForUser implementation This improves code maintainability by adding clear documentation and improving type safety throughout the endorser server module.
This commit is contained in:
89
test-deeplinks.sh
Normal file
89
test-deeplinks.sh
Normal file
@@ -0,0 +1,89 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Configurable pause duration (in seconds)
|
||||
PAUSE_DURATION=2
|
||||
MANUAL_CONTINUE=true
|
||||
|
||||
# Function to test deep link
|
||||
test_link() {
|
||||
echo "----------------------------------------"
|
||||
echo "Testing: $1"
|
||||
echo "----------------------------------------"
|
||||
adb shell am start -W -a android.intent.action.VIEW -d "$1" app.timesafari.app
|
||||
|
||||
if [ "$MANUAL_CONTINUE" = true ]; then
|
||||
read -p "Press Enter to continue to next test..."
|
||||
else
|
||||
sleep $PAUSE_DURATION
|
||||
fi
|
||||
}
|
||||
|
||||
# Allow command line override of pause settings
|
||||
while getopts "t:a" opt; do
|
||||
case $opt in
|
||||
t) PAUSE_DURATION=$OPTARG ;;
|
||||
a) MANUAL_CONTINUE=false ;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "Starting TimeSafari Deep Link Tests"
|
||||
echo "======================================"
|
||||
echo "Pause duration: $PAUSE_DURATION seconds"
|
||||
echo "Manual continue: $MANUAL_CONTINUE"
|
||||
|
||||
# Test claim routes
|
||||
echo "\nTesting Claim Routes:"
|
||||
test_link "timesafari://claim/01JMAAFZRNSRTQ0EBSD70A8E1H"
|
||||
test_link "timesafari://claim/01JMAAFZRNSRTQ0EBSD70A8E1H?view=details"
|
||||
test_link "timesafari://claim-cert/01JMAAFZRNSRTQ0EBSD70A8E1H"
|
||||
|
||||
# Test contact routes
|
||||
echo "\nTesting Contact Routes:"
|
||||
test_link "timesafari://contact-import/eyJhbGciOiJFUzI1NksifQ"
|
||||
test_link "timesafari://contact-edit/did:example:123"
|
||||
|
||||
# Test project routes
|
||||
echo "\nTesting Project Routes:"
|
||||
test_link "timesafari://project/456?view=details"
|
||||
|
||||
# Test invite routes
|
||||
echo "\nTesting Invite Routes:"
|
||||
test_link "timesafari://invite-one-accept/eyJhbGciOiJFUzI1NksifQ"
|
||||
|
||||
# Test gift routes
|
||||
echo "\nTesting Gift Routes:"
|
||||
test_link "timesafari://confirm-gift/789"
|
||||
|
||||
# Test offer routes
|
||||
echo "\nTesting Offer Routes:"
|
||||
test_link "timesafari://offer-details/101"
|
||||
|
||||
# Test complex query parameters
|
||||
echo "\nTesting Complex Query Parameters:"
|
||||
test_link "timesafari://contact-import/jwt?contacts=%5B%7B%22name%22%3A%22Test%22%7D%5D"
|
||||
|
||||
# New test cases
|
||||
echo "\nTesting DID Routes:"
|
||||
test_link "timesafari://did/did:example:123"
|
||||
test_link "timesafari://did/did:example:456?view=details"
|
||||
|
||||
echo "\nTesting Additional Claim Routes:"
|
||||
test_link "timesafari://claim/123?view=certificate"
|
||||
test_link "timesafari://claim/123?view=raw"
|
||||
test_link "timesafari://claim-add-raw/123?claimJwtId=jwt123"
|
||||
|
||||
echo "\nTesting Additional Contact Routes:"
|
||||
test_link "timesafari://contact-import/jwt?contacts=%5B%7B%22did%22%3A%22did%3Aexample%3A123%22%7D%5D"
|
||||
test_link "timesafari://contact-edit/did:example:123?action=edit"
|
||||
|
||||
echo "\nTesting Error Cases:"
|
||||
test_link "timesafari://invalid-route/123"
|
||||
test_link "timesafari://claim/123?view=invalid"
|
||||
test_link "timesafari://did/invalid-did"
|
||||
|
||||
# Test contact import one route
|
||||
echo "\nTesting Contact Import One Route:"
|
||||
test_link "timesafari://contacts?contactJwt=eyJhbGciOiJFUzI1NksifQ"
|
||||
|
||||
echo "\nDeep link testing complete"
|
||||
echo "======================================"
|
||||
Reference in New Issue
Block a user