-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
ls filter.md | entr ./bin/buildhtml /_ ./app/filter.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
declare product="${1:-1}" | ||
|
||
curl \ | ||
--header 'Content-Type: application/json' \ | ||
--silent \ | ||
--fail \ | ||
--request POST \ | ||
--url "http://localhost:4004/northwind-model/Products/$product/NorthwindModel.discontinue" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
declare supplier="${1:-1}" | ||
curl \ | ||
--silent \ | ||
--fail \ | ||
--request GET \ | ||
--url "http://localhost:4004/northwind-model/Suppliers/$supplier/NorthwindModel.addressLine()" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
pandoc \ | ||
-f markdown-smart \ | ||
-t html \ | ||
--ascii \ | ||
"${1:?Specify source file}" > "${2:?Specify target file}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Downloads a complete Northwind entityset into a file | ||
# <entityset>.json. | ||
|
||
# Combines the northwindentitysets and slurp scripts which | ||
# are assumed to be in the same directory as this script. | ||
|
||
declare here="${0%/*}" | ||
declare entityset | ||
entityset="$("$here/northwindentitysets" | fzf)" | ||
"$here/slurp" "$entityset" > "$entityset.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Returns a list of entity sets in the Northwind V4 OData service | ||
|
||
set -euo pipefail | ||
|
||
declare serviceroot='https://services.odata.org/v4/northwind/northwind.svc/' | ||
|
||
main() { | ||
|
||
curl \ | ||
--silent \ | ||
--fail \ | ||
--url "${serviceroot}?\$format=json" \ | ||
| jq -r '.value[]|select(.kind == "EntitySet").url' | ||
|
||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
declare servicefile="${1:-$(find srv/ -name '*.cds' | head -1)}" | ||
cds compile --to edmx "$servicefile" | bat --plain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Slurps an entire Northwind entity set (collection) by | ||
# following @odata.nextLink references. Produces JSON output | ||
# in the same shape as the core JSON data in the entityset, | ||
# i.e. { "value": [ <entity object>, <entity object>, ... ] } | ||
|
||
# Requires an entity set name to be specified (e.g. Products). | ||
|
||
set -euo pipefail | ||
|
||
declare serviceroot='https://services.odata.org/v4/northwind/northwind.svc/' | ||
declare entityset="${1:?Specify Northwind entity set name e.g. Products}" | ||
declare pause=0.5 | ||
|
||
main() { | ||
|
||
local tempfile | ||
tempfile="$(mktemp)" | ||
local nextlink="$entityset" | ||
{ | ||
while [[ -n $nextlink ]]; do | ||
curl \ | ||
--silent \ | ||
--location \ | ||
--fail \ | ||
--url "${serviceroot}${nextlink}" \ | ||
> "$tempfile" | ||
jq --raw-output '.value' "$tempfile" | ||
nextlink="$(jq --raw-output '.["@odata.nextLink"]' "$tempfile")" | ||
if [[ -n $nextlink ]]; then sleep "$pause"; fi | ||
done | ||
} | jq --slurp '{value:flatten}' | ||
|
||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
declare product="${1:-1}" | ||
declare quantity="${2:-1}" | ||
curl \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{"product":'"$product"',"quantity":'"$quantity"'}' \ | ||
--url 'http://localhost:4004/northwind-model/submitOrder' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
curl \ | ||
--silent \ | ||
--fail \ | ||
--url 'http://localhost:4004/northwind-model/randomProduct()' \ | ||
| jq . |