-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
156 lines (134 loc) · 5.55 KB
/
Taskfile.yml
File metadata and controls
156 lines (134 loc) · 5.55 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
version: "3"
tasks:
build:
desc: Build the school module
cmds:
- npm i
- npx tsc
watch:
desc: Watch the school module and build on changes
cmds:
- npm i
- npx tsc -w
up:
deps: [build]
desc: Start the Connector
cmds:
- docker compose --env-file .env --env-file .env.connector up -d --build
down:
desc: Remove Connector
cmds:
- docker compose --env-file .env --env-file .env.connector down -v
restart:
desc: Restart the Connector
cmds:
- docker compose --env-file .env --env-file .env.connector restart connector
logs:
desc: Show Connector logs
cmds:
- docker compose --env-file .env --env-file .env.connector logs -f connector
create-student:
desc: Call the create-student endpoint
cmds:
- 'echo -n ''{"id": "{{.STUDENT_ID}}", "pin": "1234", "givenname": "Max", "surname": "Mustermann", "additionalConsents": [{"consent": "A Consent Bla", "link": "https://example.com"}]}'' | http -b POST localhost:8099/students ''X-API-KEY: This_is_a_test_APIKEY_with_30_chars+'' | jq'
requires:
vars: [STUDENT_ID]
get-onboarding-pdf:
desc: Gets the onboarding document as PDF
cmds:
- "http --download localhost:8099/students/{{ .STUDENT_ID }}/onboarding Accept:application/pdf 'X-API-KEY: This_is_a_test_APIKEY_with_30_chars+'"
requires:
vars: [STUDENT_ID]
create-onboarding-pdf-with-custom-png-logo:
desc: Gets the onboarding document as PDF
cmds:
- 'echo -n ''{"schoolLogo": "{{.LOGO_BASE64}}"}'' | http -b POST localhost:8099/students/{{ .STUDENT_ID }}/onboarding Accept:application/pdf ''X-API-KEY: This_is_a_test_APIKEY_with_30_chars+'' > {{ .STUDENT_ID }}_onboarding.pdf'
requires:
vars: [STUDENT_ID]
vars:
LOGO_BASE64:
sh: 'cat assets/Logo_GM.png | {{if eq OS "darwin"}}base64{{else}}base64 -w 0{{end}}'
create-onboarding-pdf-with-custom-jpg-logo:
desc: Gets the onboarding document as PDF
cmds:
- 'echo -n ''{"schoolLogo": "{{.LOGO_BASE64}}"}'' | http -b POST localhost:8099/students/{{ .STUDENT_ID }}/onboarding Accept:application/pdf ''X-API-KEY: This_is_a_test_APIKEY_with_30_chars+'' > {{ .STUDENT_ID }}_onboarding.pdf'
requires:
vars: [STUDENT_ID]
vars:
LOGO_BASE64:
sh: 'cat assets/Logo_GM.jpg | {{if eq OS "darwin"}}base64{{else}}base64 -w 0{{end}}'
get-onboarding-png:
desc: Gets the onboarding document as PNG
cmds:
- "http --download localhost:8099/students/{{ .STUDENT_ID }}/onboarding Accept:image/png 'X-API-KEY: This_is_a_test_APIKEY_with_30_chars+'"
requires:
vars: [STUDENT_ID]
get-onboarding-link:
desc: Gets the onboarding document as link
cmds:
- "http -b GET localhost:8099/students/{{ .STUDENT_ID }}/onboarding 'X-API-KEY: This_is_a_test_APIKEY_with_30_chars+' | jq -r .result.link"
requires:
vars: [STUDENT_ID]
get-onboarding-terminal:
desc: Gets the onboarding document as a QR-Code in the terminal
cmds:
- "http -b GET localhost:8099/students/{{ .STUDENT_ID }}/onboarding 'X-API-KEY: This_is_a_test_APIKEY_with_30_chars+' | jq -r .result.link | qrencode -t ansiutf8"
requires:
vars: [STUDENT_ID]
get-fileBase64:
desc: Get the Base64 of file
cmds:
- 'echo "{{.FILE_BASE64}}"'
vars:
FILE_BASE64:
sh: 'cat assets/Zeugnis.pdf | {{if eq OS "darwin"}}base64{{else}}base64 -w 0{{end}}'
get-student:
desc: Call the get-student endpoint
cmds:
- "http -b GET localhost:8099/students/{{.STUDENT_ID}} 'X-API-KEY: This_is_a_test_APIKEY_with_30_chars+' | jq"
requires:
vars: [STUDENT_ID]
get-students:
desc: Call the get-students endpoint
cmds:
- "http -b GET localhost:8099/students 'X-API-KEY: This_is_a_test_APIKEY_with_30_chars+' | jq"
delete-student:
desc: Call the delete-student endpoint
cmds:
- "http -b DELETE localhost:8099/students/{{.STUDENT_ID}} 'X-API-KEY: This_is_a_test_APIKEY_with_30_chars+' | jq"
get-files:
desc: Call the get-files endpoint
cmds:
- "http -b GET localhost:8099/students/{{.STUDENT_ID}}/files 'X-API-KEY: This_is_a_test_APIKEY_with_30_chars+' | jq"
requires:
vars: [STUDENT_ID]
send-file:
desc: Call the send-file endpoint
cmds:
- 'echo -n ''{"file": "{{.FILE_BASE64}}", "filename": "Abiturzeugnis.pdf", "title": "Abiturzeugnis", "mimetype": "application/pdf"}'' | http -b POST localhost:8099/students/{{.STUDENT_ID}}/files ''X-API-KEY: This_is_a_test_APIKEY_with_30_chars+'' | jq'
vars:
FILE_BASE64:
sh: 'cat assets/Zeugnis.pdf | {{if eq OS "darwin"}}base64{{else}}base64 -w 0{{end}}'
requires:
vars: [STUDENT_ID]
send-degree:
desc: Call the send-file endpoint
cmds:
- 'echo -n ''{"file": "{{.FILE_BASE64}}"}'' | http -b POST localhost:8099/students/{{.STUDENT_ID}}/files/abiturzeugnis ''X-API-KEY: This_is_a_test_APIKEY_with_30_chars+'' | jq'
vars:
FILE_BASE64:
sh: 'cat assets/Zeugnis.pdf | {{if eq OS "darwin"}}base64{{else}}base64 -w 0{{end}}'
requires:
vars: [STUDENT_ID]
audit-log:
desc: Get the audit log for a student
cmds:
- "http -b GET localhost:8099/students/{{.STUDENT_ID}}/log 'X-API-KEY: This_is_a_test_APIKEY_with_30_chars+' 'Accept: test/plain'"
requires:
vars: [STUDENT_ID]
audit-log-json:
desc: Get the audit log for a student
cmds:
- "http -b GET localhost:8099/students/{{.STUDENT_ID}}/log?verbose=true 'X-API-KEY: This_is_a_test_APIKEY_with_30_chars+' 'Accept: application/json' | jq"
requires:
vars: [STUDENT_ID]