no submod

This commit is contained in:
Bel LaPointe
2023-04-17 11:20:05 -06:00
parent 026e7718ed
commit 8970da11e5
60 changed files with 4326 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
#! /bin/bash
curl -i -sS localhost:3000/api/notes/$ID
curl -sS localhost:3000/api/notes/$ID \
| jq '{id:.id, content:.content, title:.title}'

View File

@@ -0,0 +1,3 @@
#! /bin/bash
curl -sS localhost:3000/api/tree | jq -r '.items | to_entries[].value.id' | grep -v ^root$

View File

@@ -0,0 +1,8 @@
#! /bin/bash
api_response="$(curl -i -sS localhost:3000/api)"
csrf_key="xsrf-token"
csrf_token="$(echo "$api_response" | grep -o '"csrfToken":[^,]*' | tr ':' '\n' | jq -r . | tail -n 1)"
notea_auth_cookie="$(echo "$api_response" | grep ^set.cookie: | sed 's/^set.cookie: //' | tr ';' '\n' | head -n 1)"
curl --fail -sS -X POST localhost:3000/api/notes/$ID -H "$csrf_key: $csrf_token" -b "$notea_auth_cookie" -H 'Content-Type: application/json' -d '{"content": "g"}'
echo $?