-
Notifications
You must be signed in to change notification settings - Fork 0
/
amelinium.common.html
208 lines (208 loc) · 156 KB
/
amelinium.common.html
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>amelinium.common documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Amelinium</span> <span class="project-version">1.0.1</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li><li class="depth-1 "><a href="20_hypermedia.html"><div class="inner"><span>Hypermedia-driven</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><a href="amelinium.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>amelinium</span></div></a></li><li class="depth-2 branch"><a href="amelinium.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-2"><a href="amelinium.api.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>api</span></div></a></li><li class="depth-3"><a href="amelinium.api.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4"><a href="amelinium.api.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3"><a href="amelinium.api.url.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>url</span></div></a></li><li class="depth-2 branch"><a href="amelinium.app.html"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>app</span></div></a></li><li class="depth-2"><a href="amelinium.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>algo</span></div></div></li><li class="depth-4 branch"><a href="amelinium.auth.algo.append.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>append</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.fail.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fail</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.pbkdf2.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pbkdf2</span></div></a></li><li class="depth-4"><a href="amelinium.auth.algo.scrypt.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scrypt</span></div></a></li><li class="depth-3 branch"><a href="amelinium.auth.pwd.html"><div class="inner"><span class="tree" style="top: -145px;"><span class="top" style="height: 154px;"></span><span class="bottom"></span></span><span>pwd</span></div></a></li><li class="depth-3"><a href="amelinium.auth.specs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>specs</span></div></a></li><li class="depth-2 current"><a href="amelinium.common.html"><div class="inner"><span class="tree" style="top: -238px;"><span class="top" style="height: 247px;"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-3"><a href="amelinium.common.oplog.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>oplog</span></div></a></li><li class="depth-4"><a href="amelinium.common.oplog.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.populators.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-3"><a href="amelinium.common.swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>swagger</span></div></a></li><li class="depth-2 branch"><a href="amelinium.core.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2"><a href="amelinium.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3"><a href="amelinium.db.sql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sql</span></div></a></li><li class="depth-2 branch"><a href="amelinium.errors.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-2"><a href="amelinium.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>client</span></div></div></li><li class="depth-4"><a href="amelinium.http.client.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.handler.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-3"><a href="amelinium.http.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.coercion.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>coercion</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.content.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>content</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.debug.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>debug</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.format.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>format</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.headers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>headers</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.language.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>language</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.lazy-req.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>lazy-req</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.populators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.remote-ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>remote-ip</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.roles.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>roles</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-4"><a href="amelinium.http.middleware.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.router.html"><div class="inner"><span class="tree" style="top: -424px;"><span class="top" style="height: 433px;"></span><span class="bottom"></span></span><span>router</span></div></a></li><li class="depth-3"><a href="amelinium.http.server.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.server.jetty.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>jetty</span></div></a></li><li class="depth-4"><a href="amelinium.http.server.undertow.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>undertow</span></div></a></li><li class="depth-2"><a href="amelinium.i18n.html"><div class="inner"><span class="tree" style="top: -672px;"><span class="top" style="height: 681px;"></span><span class="bottom"></span></span><span>i18n</span></div></a></li><li class="depth-3"><a href="amelinium.i18n.pluralizers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pluralizers</span></div></a></li><li class="depth-2 branch"><a href="amelinium.identity.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-2 branch"><a href="amelinium.locale.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>locale</span></div></a></li><li class="depth-2 branch"><a href="amelinium.logging.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logging</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>model</span></div></div></li><li class="depth-3 branch"><a href="amelinium.model.confirmation.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>confirmation</span></div></a></li><li class="depth-3"><a href="amelinium.model.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>proto</span></div></div></li><li class="depth-3 branch"><a href="amelinium.proto.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.proto.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.schemas.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>schemas</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></div></li><li class="depth-3"><a href="amelinium.server.ssl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ssl</span></div></a></li><li class="depth-2 branch"><a href="amelinium.system.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>system</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></div></li><li class="depth-3 branch"><a href="amelinium.types.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.types.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.utils.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="amelinium.web.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>web</span></div></a></li><li class="depth-3"><a href="amelinium.web.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4 branch"><a href="amelinium.web.controller.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-4"><a href="amelinium.web.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.js.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>js</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.taggers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>taggers</span></div></a></li><li class="depth-3"><a href="amelinium.web.url.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>url</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="amelinium.common.html#var-acceptable-identity-type"><div class="inner"><span>acceptable-identity-type</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-add-header"><div class="inner"><span>add-header</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-add-headers"><div class="inner"><span>add-headers</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-add-json-event-header"><div class="inner"><span>add-json-event-header</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-add-missing-lang"><div class="inner"><span>add-missing-lang</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-add-missing-translation"><div class="inner"><span>add-missing-translation</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-add-session-hx-header"><div class="inner"><span>add-session-hx-header</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-add-session-id-header"><div class="inner"><span>add-session-id-header</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-add-slash"><div class="inner"><span>add-slash</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-add-status"><div class="inner"><span>add-status</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-auth-page"><div class="inner"><span>auth-page</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-auth-page.3F"><div class="inner"><span>auth-page?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-config.2Bsession"><div class="inner"><span>config+session</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-created"><div class="inner"><span>created</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-current-page"><div class="inner"><span>current-page</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-current-page-id"><div class="inner"><span>current-page-id</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-current-page-id-or-path"><div class="inner"><span>current-page-id-or-path</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-def-localized-redirect"><div class="inner"><span>def-localized-redirect</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-def-redirect"><div class="inner"><span>def-redirect</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-default-contexts-labeler"><div class="inner"><span>default-contexts-labeler</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-early-hints"><div class="inner"><span>early-hints</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-empty-session-id-header"><div class="inner"><span>empty-session-id-header</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-fast-url-matcher"><div class="inner"><span>fast-url-matcher</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-found"><div class="inner"><span>found</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-get-session-id-header"><div class="inner"><span>get-session-id-header</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-go-to"><div class="inner"><span>go-to</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-guess-identity-type"><div class="inner"><span>guess-identity-type</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-guess-lang-param"><div class="inner"><span>guess-lang-param</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-hard-lock-time"><div class="inner"><span>hard-lock-time</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-hard-locked.3F"><div class="inner"><span>hard-locked?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-has-any-role.3F"><div class="inner"><span>has-any-role?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-has-param.3F"><div class="inner"><span>has-param?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-has-role.3F"><div class="inner"><span>has-role?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-hx-request.3F"><div class="inner"><span>hx-request?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-hx-target"><div class="inner"><span>hx-target</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-id-type-.3Eurl-type"><div class="inner"><span>id-type->url-type</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-identity-and-type"><div class="inner"><span>identity-and-type</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-im-a-teapot"><div class="inner"><span>im-a-teapot</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-is-url.3F"><div class="inner"><span>is-url?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-kv-json-str"><div class="inner"><span>kv-json-str</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lang-config"><div class="inner"><span>lang-config</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lang-from-req"><div class="inner"><span>lang-from-req</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lang-id"><div class="inner"><span>lang-id</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lang-id-or-nil"><div class="inner"><span>lang-id-or-nil</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lang-param"><div class="inner"><span>lang-param</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lang-query-string"><div class="inner"><span>lang-query-string</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lang-redir"><div class="inner"><span>lang-redir</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lang-str"><div class="inner"><span>lang-str</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lang-str-or-nil"><div class="inner"><span>lang-str-or-nil</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lang-url"><div class="inner"><span>lang-url</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-created"><div class="inner"><span>localized-created</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-found"><div class="inner"><span>localized-found</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-moved-permanently"><div class="inner"><span>localized-moved-permanently</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-multiple-choices"><div class="inner"><span>localized-multiple-choices</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-not-modified"><div class="inner"><span>localized-not-modified</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-page"><div class="inner"><span>localized-page</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-path"><div class="inner"><span>localized-path</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-permanent-redirect"><div class="inner"><span>localized-permanent-redirect</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-redirect"><div class="inner"><span>localized-redirect</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-see-other"><div class="inner"><span>localized-see-other</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-temporary-redirect"><div class="inner"><span>localized-temporary-redirect</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-localized-use-proxy"><div class="inner"><span>localized-use-proxy</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lock-wait"><div class="inner"><span>lock-wait</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-lock-wait-default"><div class="inner"><span>lock-wait-default</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-login-auth-state"><div class="inner"><span>login-auth-state</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-login-page"><div class="inner"><span>login-page</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-login-page.3F"><div class="inner"><span>login-page?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-max-url-len"><div class="inner"><span>max-url-len</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-misdirected-request"><div class="inner"><span>misdirected-request</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-mobile-agent.3F"><div class="inner"><span>mobile-agent?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-move-to"><div class="inner"><span>move-to</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-moved-permanently"><div class="inner"><span>moved-permanently</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-multiple-choices"><div class="inner"><span>multiple-choices</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-not-modified"><div class="inner"><span>not-modified</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-on-page.3F"><div class="inner"><span>on-page?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-on-slash"><div class="inner"><span>on-slash</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-oplog"><div class="inner"><span>oplog</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-oplog-config"><div class="inner"><span>oplog-config</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-oplog-logger"><div class="inner"><span>oplog-logger</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-oplog-logger-from-route-data"><div class="inner"><span>oplog-logger-from-route-data</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-oplog-logger-populated"><div class="inner"><span>oplog-logger-populated</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-page"><div class="inner"><span>page</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-page-cache-len"><div class="inner"><span>page-cache-len</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-parameterized-page"><div class="inner"><span>parameterized-page</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-parse-query-params"><div class="inner"><span>parse-query-params</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-path"><div class="inner"><span>path</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-path-language"><div class="inner"><span>path-language</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-path-param"><div class="inner"><span>path-param</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-path-params"><div class="inner"><span>path-params</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-path-slash-variants"><div class="inner"><span>path-slash-variants</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-path-splitter"><div class="inner"><span>path-splitter</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-path-template-with-param"><div class="inner"><span>path-template-with-param</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-path-variants"><div class="inner"><span>path-variants</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-permanent-redirect"><div class="inner"><span>permanent-redirect</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-pick-language"><div class="inner"><span>pick-language</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-pick-language-str"><div class="inner"><span>pick-language-str</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-pick-language-str-without-fallback"><div class="inner"><span>pick-language-str-without-fallback</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-pick-language-without-fallback"><div class="inner"><span>pick-language-without-fallback</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-pick-params"><div class="inner"><span>pick-params</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-query-string-encode"><div class="inner"><span>query-string-encode</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-redirect"><div class="inner"><span>redirect</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-reflect-session-hx-header"><div class="inner"><span>reflect-session-hx-header</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-reflect-session-id-header"><div class="inner"><span>reflect-session-id-header</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-remove-body-params"><div class="inner"><span>remove-body-params</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-remove-form-params"><div class="inner"><span>remove-form-params</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-remove-params"><div class="inner"><span>remove-params</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-remove-path-params"><div class="inner"><span>remove-path-params</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-remove-query-params"><div class="inner"><span>remove-query-params</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-remove-status"><div class="inner"><span>remove-status</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-render"><div class="inner"><span>render</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-render-force"><div class="inner"><span>render-force</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-replace-session-hx-header"><div class="inner"><span>replace-session-hx-header</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-replace-session-id-header"><div class="inner"><span>replace-session-id-header</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-role-required.21"><div class="inner"><span>role-required!</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-roles-for-context"><div class="inner"><span>roles-for-context</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-roles-for-contexts"><div class="inner"><span>roles-for-contexts</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-roles-matrix"><div class="inner"><span>roles-matrix</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-roles-refresh"><div class="inner"><span>roles-refresh</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-roles-tabler"><div class="inner"><span>roles-tabler</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-router-match.3F"><div class="inner"><span>router-match?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-see-other"><div class="inner"><span>see-other</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-session"><div class="inner"><span>session</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-session-config"><div class="inner"><span>session-config</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-session-inject"><div class="inner"><span>session-inject</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-session-variable-get-failed.3F"><div class="inner"><span>session-variable-get-failed?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-slash-break"><div class="inner"><span>slash-break</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-slash-redir"><div class="inner"><span>slash-redir</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-soft-lock-passed"><div class="inner"><span>soft-lock-passed</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-soft-lock-remains"><div class="inner"><span>soft-lock-remains</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-soft-lock-time"><div class="inner"><span>soft-lock-time</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-soft-locked.3F"><div class="inner"><span>soft-locked?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-split-qparams"><div class="inner"><span>split-qparams</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-split-query-params"><div class="inner"><span>split-query-params</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-split-query-params-simple"><div class="inner"><span>split-query-params-simple</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-strictly-localized-page"><div class="inner"><span>strictly-localized-page</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-template-path"><div class="inner"><span>template-path</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-temporary-redirect"><div class="inner"><span>temporary-redirect</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-translator"><div class="inner"><span>translator</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-translator-sub"><div class="inner"><span>translator-sub</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-untranslatable.3F"><div class="inner"><span>untranslatable?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-url-.3Euri.2Bparams"><div class="inner"><span>url->uri+params</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-use-hx.3F"><div class="inner"><span>use-hx?</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-use-proxy"><div class="inner"><span>use-proxy</span></div></a></li><li class="depth-1"><a href="amelinium.common.html#var-with-role-only.21"><div class="inner"><span>with-role-only!</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">amelinium.common</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>Common helpers for amelinium.</p>
</div></div><div class="public anchor" id="var-acceptable-identity-type"><h3>acceptable-identity-type</h3><div class="usage"><code>(acceptable-identity-type identity-type)</code><code>(acceptable-identity-type identity-type acceptable-tag)</code></div><div class="doc"><div class="markdown"><p>For the given identity type <code>identity-type</code> and optional acceptable type tag <code>acceptable-type</code> (<code>amelinium.identity/standard</code> by default), returns that type as keyword, or <code>nil</code> if the type is not acceptable.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2467">view source</a></div></div><div class="public anchor" id="var-add-header"><h3>add-header</h3><h4 class="type">macro</h4><div class="usage"><code>(add-header req header-name & body)</code></div><div class="doc"><div class="markdown"><p>Adds a header <code>header</code> to <code>:response/headers</code> map of the <code>req</code> using built-in function <code>qassoc</code>. If a header name argument is a literal keyword, a character, a number, or a literal string, it will be converted to a string literal and placed as <code>qassoc</code> argument. Otherwise it will be left as is and wrapped into a call to <code>io.randomseed.utils/some-str</code> to ensure the result is a string run-time. All arguments of the body are used to calculate a value of the header. Assumes that <code>req</code> is always a map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2317">view source</a></div></div><div class="public anchor" id="var-add-headers"><h3>add-headers</h3><h4 class="type">macro</h4><div class="usage"><code>(add-headers req header-name header-value)</code><code>(add-headers req header-name header-value & more)</code></div><div class="doc"><div class="markdown"><p>Adds headers with associated values to <code>:response/headers</code> map of the <code>req</code> using built-in function <code>qassoc</code>. If any header name argument is a literal keyword, a character, a number, or a literal string, it will be converted to a string literal and placed as an argument passed to <code>qassoc</code>. Otherwise it will be left as is and wrapped in a call to <code>io.randomseed.utils/some-str</code> to ensure at run-time that the result will be a string. Missing header value, if any, will be padded with <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2339">view source</a></div></div><div class="public anchor" id="var-add-json-event-header"><h3>add-json-event-header</h3><div class="usage"><code>(add-json-event-header req header-name event-name)</code><code>(add-json-event-header req header-name event-name param-key param-value)</code><code>(add-json-event-header req header-name event-name param-key param-value replace?)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1588">view source</a></div></div><div class="public anchor" id="var-add-missing-lang"><h3>add-missing-lang</h3><div class="usage"><code>(add-missing-lang body req translation-keys)</code></div><div class="doc"><div class="markdown"><p>For the given <code>body</code> map it adds a language under the <code>:lang</code> key if it does not exists yet. The language is obtained from the request map <code>req</code> by reading a value associated with the <code>:language/id</code> key.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2244">view source</a></div></div><div class="public anchor" id="var-add-missing-translation"><h3>add-missing-translation</h3><div class="usage"><code>(add-missing-translation body new-k k sub-translation-fn)</code><code>(add-missing-translation body new-k k suffix sub-translation-fn)</code></div><div class="doc"><div class="markdown"><p>For the given <code>body</code> map, a new key <code>new-k</code>, a key <code>k</code> and a translation function <code>sub-translation-fn</code>, tries to add a translation of the key <code>k</code> as a value under the given key <code>new-k</code>, if it does not exist yet in <code>body</code>. Optional <code>suffix</code> argument is used to add suffix to a key name.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2287">view source</a></div></div><div class="public anchor" id="var-add-session-hx-header"><h3>add-session-hx-header</h3><div class="usage"><code>(add-session-hx-header req sess)</code></div><div class="doc"><div class="markdown"><p>Adds <code>HX-Trigger</code> server response header to <code>:response/headers</code> map of the given <code>req</code> map by putting a JSON in the following form:</p>
<p><code>{"setSession":{"session-id": "SID"}}</code></p>
<p>where the <code>session-id</code> string is obtained from session’s ID field (using <code>amelinium.http.middleware.session/id-field</code>) and <code>SID</code> is replaced with session ID (obtained with <code>amelinium.http.middleware.session/any-id</code>).</p>
<p>If the <code>HX-Trigger</code> header already exists but it does not contain <code>setSession</code> trigger name, it will be modified. If it already contains it, it will be left as is.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1606">view source</a></div></div><div class="public anchor" id="var-add-session-id-header"><h3>add-session-id-header</h3><div class="usage"><code>(add-session-id-header req sess)</code><code>(add-session-id-header req sess replace?)</code></div><div class="doc"><div class="markdown"><p>Adds session ID header to the <code>:response/headers</code> map of the given <code>req</code> map. Name of the header is obtained from session ID field (by calling <code>amelinium.http.middleware.session/id-field</code>) and its value is set to session ID (obtained by calling <code>amelinium.http.middleware.session/any-id</code>). If the header already exists it is not added.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1670">view source</a></div></div><div class="public anchor" id="var-add-slash"><h3>add-slash</h3><div class="usage"><code>(add-slash uri)</code></div><div class="doc"><div class="markdown"><p>Adds trailing slash to a path unless it already exists.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1441">view source</a></div></div><div class="public anchor" id="var-add-status"><h3>add-status</h3><h4 class="type">macro</h4><div class="usage"><code>(add-status req & body)</code></div><div class="doc"><div class="markdown"><p>Adds response status to a request map <code>req</code> under its key <code>:response/status</code> using <code>qassoc</code>. The status is a result of evaluating expressions passed as additional arguments. Returns updated <code>req</code>. Assumes that <code>req</code> is always a map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2524">view source</a></div></div><div class="public anchor" id="var-auth-page"><h3>auth-page</h3><div class="usage"><code>(auth-page req)</code><code>(auth-page req lang-id)</code></div><div class="doc"><div class="markdown"><p>Returns a path for the authentication page. The page must have ID of <code>:user/welcome</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1002">view source</a></div></div><div class="public anchor" id="var-auth-page.3F"><h3>auth-page?</h3><div class="usage"><code>(auth-page? req)</code><code>(auth-page? req ring-match)</code></div><div class="doc"><div class="markdown"><p>Returns true if the current (or given as a match) page is an authentication page (has :auth-page? route data set to a truthy value).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L160">view source</a></div></div><div class="public anchor" id="var-config.2Bsession"><h3>config+session</h3><div class="usage"><code>(config+session req)</code><code>(config+session req session-key)</code></div><div class="doc"><div class="markdown"><p>Gets a session map and a session config map from the given request map. Returns a two-element vector.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1546">view source</a></div></div><div class="public anchor" id="var-created"><h3>created</h3><div class="usage"><code>(created)</code><code>(created req)</code><code>(created url)</code><code>(created req url)</code><code>(created req name-or-path)</code><code>(created req name-or-path path-params)</code><code>(created req name-or-path path-params query-params)</code><code>(created req name-or-path lang)</code><code>(created req name-or-path lang path-params)</code><code>(created req name-or-path lang path-params query-params)</code><code>(created req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the page function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 201 to it using <code>resp/created</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1357">view source</a></div></div><div class="public anchor" id="var-current-page"><h3>current-page</h3><div class="usage"><code>(current-page req)</code></div><div class="doc"><div class="markdown"><p>Returns a path of the current page.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L981">view source</a></div></div><div class="public anchor" id="var-current-page-id"><h3>current-page-id</h3><div class="usage"><code>(current-page-id req-or-match)</code></div><div class="doc"><div class="markdown"><p>Returns an identifier of a current page if it is defined for a HTTP route.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L986">view source</a></div></div><div class="public anchor" id="var-current-page-id-or-path"><h3>current-page-id-or-path</h3><div class="usage"><code>(current-page-id-or-path req)</code></div><div class="doc"><div class="markdown"><p>Returns an identifier of a current page if it is defined for a HTTP route or a path if the page name is not defined.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L991">view source</a></div></div><div class="public anchor" id="var-def-localized-redirect"><h3>def-localized-redirect</h3><h4 class="type">macro</h4><div class="usage"><code>(def-localized-redirect name f)</code><code>(def-localized-redirect name f http-code)</code><code>(def-localized-redirect name doc f)</code></div><div class="doc"><div class="markdown"><p>Generates a language-parameterized redirect function which acts like <code>localized-redirect</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1296">view source</a></div></div><div class="public anchor" id="var-def-redirect"><h3>def-redirect</h3><h4 class="type">macro</h4><div class="usage"><code>(def-redirect name f)</code><code>(def-redirect name f http-code)</code><code>(def-redirect name doc f)</code></div><div class="doc"><div class="markdown"><p>Generates a language-parameterized redirect function which acts like <code>redirect</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1245">view source</a></div></div><div class="public anchor" id="var-default-contexts-labeler"><h3>default-contexts-labeler</h3><div class="usage"><code>(default-contexts-labeler _ ids)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1792">view source</a></div></div><div class="public anchor" id="var-early-hints"><h3>early-hints</h3><div class="usage"><code>(early-hints)</code><code>(early-hints body)</code></div><div class="doc"><div class="markdown"><p>103 Early Hints The server sends some response headers (e.g. HTML resource links) before final HTTP message.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1028">view source</a></div></div><div class="public anchor" id="var-empty-session-id-header"><h3>empty-session-id-header</h3><div class="usage"><code>(empty-session-id-header req sess)</code><code>(empty-session-id-header req sess headers-key)</code></div><div class="doc"><div class="markdown"><p>Adds session ID header with an empty string to the <code>:response/headers</code> map of the given <code>req</code> map. Name of the header is obtained from session ID field (by calling <code>amelinium.http.middleware.session/id-field</code>). If the header already exists it is replaced.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1722">view source</a></div></div><div class="public anchor" id="var-fast-url-matcher"><h3>fast-url-matcher</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L194">view source</a></div></div><div class="public anchor" id="var-found"><h3>found</h3><div class="usage"><code>(found)</code><code>(found req)</code><code>(found url)</code><code>(found req url)</code><code>(found req name-or-path)</code><code>(found req name-or-path path-params)</code><code>(found req name-or-path path-params query-params)</code><code>(found req name-or-path lang)</code><code>(found req name-or-path lang path-params)</code><code>(found req name-or-path lang path-params query-params)</code><code>(found req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the page function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 302 to it using <code>resp/found</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1360">view source</a></div></div><div class="public anchor" id="var-get-session-id-header"><h3>get-session-id-header</h3><div class="usage"><code>(get-session-id-header req id-field)</code></div><div class="doc"><div class="markdown"><p>For the given request map <code>req</code> it tries to get a request header identified by a name <code>id-field</code>, and then checks if it is valid session identifier. Returns a session identifier or <code>nil</code> if the obtained value is not valid session ID or the header is not found.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1641">view source</a></div></div><div class="public anchor" id="var-go-to"><h3>go-to</h3><div class="usage"><code>(go-to)</code><code>(go-to req)</code><code>(go-to url)</code><code>(go-to req url)</code><code>(go-to req name-or-path)</code><code>(go-to req name-or-path path-params)</code><code>(go-to req name-or-path path-params query-params)</code><code>(go-to req name-or-path lang)</code><code>(go-to req name-or-path lang path-params)</code><code>(go-to req name-or-path lang path-params query-params)</code><code>(go-to req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the <code>localized-page</code> function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 303 to it using <code>resp/see-other</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
<p>The difference between this function and its regular counterpart (if defined) is in binary variants of them (when a request map and a name or a path are given as arguments). The regular function will fail to generate a redirect if there is no language parameter and the given path does not point to an existing page. On the contrary, this function will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that a localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1371">view source</a></div></div><div class="public anchor" id="var-guess-identity-type"><h3>guess-identity-type</h3><div class="usage"><code>(guess-identity-type src)</code><code>(guess-identity-type src identity-type)</code><code>(guess-identity-type src id identity-type)</code><code>(guess-identity-type src id identity-type acceptable-tag)</code></div><div class="doc"><div class="markdown"><p>Detects an identity type and checks if it is assigned to a tag <code>:amelinium.identity/standard</code> or to a tag passed as <code>acceptable-tag</code> argument. To accept any valid identity type the <code>:amelinium.identity/valid</code> must be explicitly given.</p>
<p>The <code>src</code> may be a map or a single value. If it is a map, the keys <code>:identity</code>, <code>:user/identity</code> and <code>:id</code> are looked up to get the identity of a user, keys <code>:id-type</code> and <code>:identity/type</code> are used to look up to get already established identity type. If it is a single value then it should contain the identity source (a string, a phone number, a number, etc).</p>
<p>When the optional <code>id</code> argument is given, it is tried before any lookup in a source map and even before getting it from <code>src</code> directly (in case it is a single value).</p>
<p>If the identity type was obtained (from the optional <code>identity-type</code> argument or a map entry, if any), it is checked whether it is acceptable. If the identity type was not obtained, it is guessed by analyzing the identity value (and also checked against the acceptable types).</p>
<p>If the identity type cannot be established or it is not acceptable, <code>nil</code> is returned.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2420">view source</a></div></div><div class="public anchor" id="var-guess-lang-param"><h3>guess-lang-param</h3><div class="usage"><code>(guess-lang-param)</code><code>(guess-lang-param src)</code></div><div class="doc"><div class="markdown"><p>For the given src argument, tries to obtain a language ID. If it’s a map it looks for <code>:param</code> key and for <code>:language/settings</code> if that fails. If <code>:language/settings</code> is found, it will try to get :param, assuming it’s a map too. If the argument is not a map it will simply convert it into a keyword (without a namespace). If all of that fails (e.g. the src is nil) then the :lang keyword is returned.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L139">view source</a></div></div><div class="public anchor" id="var-hard-lock-time"><h3>hard-lock-time</h3><div class="usage"><code>(hard-lock-time user)</code></div><div class="doc"><div class="markdown"><p>Gets a hard-lock time for a given user specified by a map having the :locked key.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1469">view source</a></div></div><div class="public anchor" id="var-hard-locked.3F"><h3>hard-locked?</h3><div class="usage"><code>(hard-locked? user)</code></div><div class="doc"><div class="markdown"><p>Returns true if the given user map contains the :locked key and a value associated with it is not nil. Does not connect to a database.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1497">view source</a></div></div><div class="public anchor" id="var-has-any-role.3F"><h3>has-any-role?</h3><div class="usage"><code>(has-any-role? req role)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1743">view source</a></div></div><div class="public anchor" id="var-has-param.3F"><h3>has-param?</h3><div class="usage"><code>(has-param? match param)</code></div><div class="doc"><div class="markdown"><p>Checks if the given route match can be parameterized with a parameter of the given id.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L340">view source</a></div></div><div class="public anchor" id="var-has-role.3F"><h3>has-role?</h3><div class="usage"><code>(has-role? req role)</code><code>(has-role? req role context)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1749">view source</a></div></div><div class="public anchor" id="var-hx-request.3F"><h3>hx-request?</h3><div class="usage"><code>(hx-request? req)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the client request has <code>HX-Request</code> header set to any value but <code>false</code> or an empty string.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1126">view source</a></div></div><div class="public anchor" id="var-hx-target"><h3>hx-target</h3><div class="usage"><code>(hx-target req)</code></div><div class="doc"><div class="markdown"><p>Returns a string from <code>HX-Target</code> header set by a client. If the header does not exist, it returns <code>nil</code>. If the header exists but contains an empty string, it returns <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1161">view source</a></div></div><div class="public anchor" id="var-id-type-.3Eurl-type"><h3>id-type->url-type</h3><div class="usage"><code>(id-type->url-type id-type reason)</code></div><div class="doc"><div class="markdown"><p>Returns URL type identifier which matches the given identity type and confirmation reason. Used to generate confirmation link which is to be sent in verification message.</p>
<p>If <code>id-type</code> is <code>:user/email</code> or <code>:email</code> and <code>reason</code> is <code>:change</code> or “change”, the result is <code>:url/update-email.</code></p>
<p>If <code>id-type</code> is <code>:user/email</code> or <code>:email</code> and <code>reason</code> is <code>:recovery</code> or “recovery”, the result is <code>:url/update-password.</code></p>
<p>If <code>id-type</code> is <code>:user/email</code> or <code>:email</code> and <code>reason</code> is not of any above, the result is <code>:url/create.</code></p>
<p>If <code>id-type</code> is <code>:user/phone</code> or <code>:phone</code> and <code>reason</code> is <code>:recovery</code> or “recovery”, the result is <code>:url/update-password.</code></p>
<p>If <code>id-type</code> is <code>:user/phone</code> or <code>:phone</code>, and <code>reason</code> is not of any above, the result is <code>:url/update-phone.</code></p>
<p>In all other cases <code>:url/update-email</code> is returned.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2389">view source</a></div></div><div class="public anchor" id="var-identity-and-type"><h3>identity-and-type</h3><div class="usage"><code>(identity-and-type user-identity)</code><code>(identity-and-type user-identity identity-type)</code><code>(identity-and-type user-identity identity-type acceptable-tag)</code></div><div class="doc"><div class="markdown"><p>Detects an identity type and checks if it is assigned to a tag <code>:amelinium.identity/standard</code> or to a tag passed as <code>acceptable-tag</code> argument.</p>
<p>To accept any valid identity type the <code>:amelinium.identity/valid</code> must be explicitly given as <code>acceptable-tag</code> argument.</p>
<p>If <code>identity-type</code> is not given, is set to <code>nil</code> or to <code>:amelinium.identity/any</code>, it is guessed by analyzing <code>user-identity</code>.</p>
<p>Returns a 2-element vector containing original value of <code>user-identity</code> argument and detected identity type.</p>
<p>If <code>user-identity</code> is <code>nil</code> or <code>false</code> then only the given <code>identity-type</code> is checked whether it is acceptable. If it is not, <code>nil</code> is returned instead of vector.</p>
<p>If <code>user-identity</code> is given but it is not matching the given identity type or its identity type is not acceptable, <code>nil</code> is returned instead of vector.</p>
<p>If <code>user-identity</code> is given but <code>identity-type</code> is <code>nil</code> or <code>:amelinium.identity/any</code>, the type of user identity is extracted and checked whether it is acceptable.</p>
<p>User identity is only tested, never transformed, even if it is not an <code>Identity</code> object. Identity type is extracted from identity object (given or ad-hoc created).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2480">view source</a></div></div><div class="public anchor" id="var-im-a-teapot"><h3>im-a-teapot</h3><div class="usage"><code>(im-a-teapot)</code><code>(im-a-teapot body)</code></div><div class="doc"><div class="markdown"><p>418 I’m a teapot The server cannot brew coffee because it is, permanently, a teapot.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1009">view source</a></div></div><div class="public anchor" id="var-is-url.3F"><h3>is-url?</h3><div class="usage"><code>(is-url? s)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L200">view source</a></div></div><div class="public anchor" id="var-kv-json-str"><h3>kv-json-str</h3><h4 class="type">macro</h4><div class="usage"><code>(kv-json-str k v)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1568">view source</a></div></div><div class="public anchor" id="var-lang-config"><h3>lang-config</h3><div class="usage"><code>(lang-config req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2240">view source</a></div></div><div class="public anchor" id="var-lang-from-req"><h3>lang-from-req</h3><div class="usage"><code>(lang-from-req req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L781">view source</a></div></div><div class="public anchor" id="var-lang-id"><h3>lang-id</h3><div class="usage"><code>(lang-id req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2218">view source</a></div></div><div class="public anchor" id="var-lang-id-or-nil"><h3>lang-id-or-nil</h3><div class="usage"><code>(lang-id-or-nil req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2223">view source</a></div></div><div class="public anchor" id="var-lang-param"><h3>lang-param</h3><div class="usage"><code>(lang-param req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2214">view source</a></div></div><div class="public anchor" id="var-lang-query-string"><h3>lang-query-string</h3><div class="usage"><code>(lang-query-string req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2236">view source</a></div></div><div class="public anchor" id="var-lang-redir"><h3>lang-redir</h3><div class="usage"><code>(lang-redir req)</code></div><div class="doc"><div class="markdown"><p>Redirects to a best-suited language version of the URI. Uses <code>:browser</code> pickers chain to get the right language if the path is language-parameterized.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1457">view source</a></div></div><div class="public anchor" id="var-lang-str"><h3>lang-str</h3><div class="usage"><code>(lang-str req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2227">view source</a></div></div><div class="public anchor" id="var-lang-str-or-nil"><h3>lang-str-or-nil</h3><div class="usage"><code>(lang-str-or-nil req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2232">view source</a></div></div><div class="public anchor" id="var-lang-url"><h3>lang-url</h3><div class="usage"><code>(lang-url router req path-or-name lang localized? path-params)</code><code>(lang-url router req path-or-name lang localized?)</code><code>(lang-url router req path-or-name lang)</code><code>(lang-url router req path-or-name)</code><code>(lang-url router req)</code><code>(lang-url req)</code><code>(lang-url req path-or-name lang localized? path-params query-params lang-param)</code><code>(lang-url router req path-or-name lang localized? path-params query-params lang-param)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2189">view source</a></div></div><div class="public anchor" id="var-localized-created"><h3>localized-created</h3><div class="usage"><code>(localized-created)</code><code>(localized-created req)</code><code>(localized-created url)</code><code>(localized-created req url)</code><code>(localized-created req name-or-path)</code><code>(localized-created req name-or-path path-params)</code><code>(localized-created req name-or-path path-params query-params)</code><code>(localized-created req name-or-path lang)</code><code>(localized-created req name-or-path lang path-params)</code><code>(localized-created req name-or-path lang path-params query-params)</code><code>(localized-created req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the <code>localized-page</code> function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 201 to it using <code>resp/created</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
<p>The difference between this function and its regular counterpart (if defined) is in binary variants of them (when a request map and a name or a path are given as arguments). The regular function will fail to generate a redirect if there is no language parameter and the given path does not point to an existing page. On the contrary, this function will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that a localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1366">view source</a></div></div><div class="public anchor" id="var-localized-found"><h3>localized-found</h3><div class="usage"><code>(localized-found)</code><code>(localized-found req)</code><code>(localized-found url)</code><code>(localized-found req url)</code><code>(localized-found req name-or-path)</code><code>(localized-found req name-or-path path-params)</code><code>(localized-found req name-or-path path-params query-params)</code><code>(localized-found req name-or-path lang)</code><code>(localized-found req name-or-path lang path-params)</code><code>(localized-found req name-or-path lang path-params query-params)</code><code>(localized-found req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the <code>localized-page</code> function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 302 to it using <code>resp/found</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
<p>The difference between this function and its regular counterpart (if defined) is in binary variants of them (when a request map and a name or a path are given as arguments). The regular function will fail to generate a redirect if there is no language parameter and the given path does not point to an existing page. On the contrary, this function will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that a localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1369">view source</a></div></div><div class="public anchor" id="var-localized-moved-permanently"><h3>localized-moved-permanently</h3><div class="usage"><code>(localized-moved-permanently)</code><code>(localized-moved-permanently req)</code><code>(localized-moved-permanently url)</code><code>(localized-moved-permanently req url)</code><code>(localized-moved-permanently req name-or-path)</code><code>(localized-moved-permanently req name-or-path path-params)</code><code>(localized-moved-permanently req name-or-path path-params query-params)</code><code>(localized-moved-permanently req name-or-path lang)</code><code>(localized-moved-permanently req name-or-path lang path-params)</code><code>(localized-moved-permanently req name-or-path lang path-params query-params)</code><code>(localized-moved-permanently req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the <code>localized-page</code> function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 301 to it using <code>resp/moved-permanently</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
<p>The difference between this function and its regular counterpart (if defined) is in binary variants of them (when a request map and a name or a path are given as arguments). The regular function will fail to generate a redirect if there is no language parameter and the given path does not point to an existing page. On the contrary, this function will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that a localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1368">view source</a></div></div><div class="public anchor" id="var-localized-multiple-choices"><h3>localized-multiple-choices</h3><div class="usage"><code>(localized-multiple-choices)</code><code>(localized-multiple-choices req)</code><code>(localized-multiple-choices url)</code><code>(localized-multiple-choices req url)</code><code>(localized-multiple-choices req name-or-path)</code><code>(localized-multiple-choices req name-or-path path-params)</code><code>(localized-multiple-choices req name-or-path path-params query-params)</code><code>(localized-multiple-choices req name-or-path lang)</code><code>(localized-multiple-choices req name-or-path lang path-params)</code><code>(localized-multiple-choices req name-or-path lang path-params query-params)</code><code>(localized-multiple-choices req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the <code>localized-page</code> function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 300 to it using <code>resp/multiple-choices</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
<p>The difference between this function and its regular counterpart (if defined) is in binary variants of them (when a request map and a name or a path are given as arguments). The regular function will fail to generate a redirect if there is no language parameter and the given path does not point to an existing page. On the contrary, this function will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that a localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1367">view source</a></div></div><div class="public anchor" id="var-localized-not-modified"><h3>localized-not-modified</h3><div class="usage"><code>(localized-not-modified)</code><code>(localized-not-modified req)</code><code>(localized-not-modified req & more)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1382">view source</a></div></div><div class="public anchor" id="var-localized-page"><h3>localized-page</h3><div class="usage"><code>(localized-page req)</code><code>(localized-page req name-or-path)</code><code>(localized-page req name-or-path path-params)</code><code>(localized-page req name-or-path path-params query-params)</code><code>(localized-page req name-or-path lang)</code><code>(localized-page req name-or-path lang path-params)</code><code>(localized-page req name-or-path lang path-params query-params)</code><code>(localized-page req name-or-path lang lang-required?)</code><code>(localized-page req name-or-path lang path-params lang-required?)</code><code>(localized-page req name-or-path lang path-params query-params lang-required?)</code><code>(localized-page req name-or-path lang path-params query-params lang-required? name-path-fallback?)</code><code>(localized-page req name-or-path lang path-params query-params lang-required? name-path-fallback? router)</code><code>(localized-page _ name-or-path lang path-params query-params lang-required? name-path-fallback? router language-settings-or-param)</code></div><div class="doc"><div class="markdown"><p>Generates a page path for the given page identifier and language identifier. When called with just a request map, returns a path of the current page but re-generated to support current language in use (taken from <code>:language/str</code> key of the request map).</p>
<p>The optional <code>name-path-fallback?</code> argument, when set to a truthy value (<code>true</code> by default), causes non-matching route identifier to be retried by extracting its path and calling this function for that path given as a string.</p>
<p>The optional <code>lang-required?</code> argument (set to <code>false</code> when not given) enables extra check eliminating pages which do not support the given language parameter. Example:</p>
<p><code>(localized-page req :login-page :pl true)</code></p>
<p>will fail if there is no parameter <code>:lang</code> handled by the route named <code>:login-page</code>.</p>
<p>When the given path is already parameterized with language then re-parameterized path is generated and checked if it exists, unless the value of the parameter is the same as the existing one. In such case the path is returned after a quick existence check.</p>
<p>Additional path parameters (<code>path-params</code>) can be given to be used when matching by name. Giving extra (unknown to route) parameters does not affect lookup. Giving <code>path-params</code> when matching by path causes them to be silently ignored.</p>
<p>Additional query parameters (<code>query-params</code>) can be given. They will be used when generating path. If the path was given and it already contains query parameters, they will be replaced.</p>
<p>If the path is given instead of a route identifier, it must exist (after being equipped with any extra parameters, if needed, using <code>path-params</code>).</p>
<p>When the <code>lang-required?</code> is set to <code>false</code> (default) and a path is given but it does not require language parameter, a path will be generated by testing whether it exists for regular and for slash-stripped or slash-added variant (the original variant goes first).</p>
<p>When the <code>lang-required?</code> is set to <code>false</code> (default) and a path is given but it does not require language parameter plus the <code>name-path-fallback?</code> argument is set to <code>:brute-force</code>, all possible path variants (with language parameter injected within its succesive segments) will be tried in hope that one will exist, regardless of parameter name that matches. Use it with caution as it may give weird matches; if for example, there is a route path <code>/users/:id</code> defined, and the given path is <code>/users/</code> with language set to <code>:pl</code>, then it will match <code>/users/pl</code> even though the parameter is not related to a language.</p>
<p>When the <code>lang-required?</code> is set to <code>true</code> and a path is given but it does not require a language parameter, all possible path variants (with parameter injected within its succesive segments) will be tried in hope that one will match, being a path that requires language parameter.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L573">view source</a></div></div><div class="public anchor" id="var-localized-path"><h3>localized-path</h3><div class="usage"><code>(localized-path)</code><code>(localized-path req)</code><code>(localized-path req name-or-path)</code><code>(localized-path req name-or-path lang)</code><code>(localized-path req name-or-path lang params)</code><code>(localized-path req name-or-path lang params query-params)</code><code>(localized-path name-or-path lang params query-params router language-settings-or-param)</code></div><div class="doc"><div class="markdown"><p>Creates a URL on a basis of route name or a path.</p>
<p>Uses very optimistic matching algorithm. Tries to obtain language from user settings and client settings if the path does not contain language information. Uses the <code>:default</code> language picker.</p>
<p>Non-matching route identifier is retried by extracting its path and calling the <code>localized-page</code> function for that path given as a string.</p>
<p>If a page found does not have a language parameter it is accepted too.</p>
<p>When the given path is already parameterized with language then re-parameterized path is generated and checked if it exists, unless the value of the parameter is the same as the existing one. In such case the path is returned after a quick existence check.</p>
<p>Additional path parameters (<code>params</code>) can be given to be used when matching by name. Giving extra (unknown to route) parameters does not affect lookup. Giving <code>params</code> when matching by path causes them to be silently ignored.</p>
<p>Additional query parameters (<code>query-params</code>) can be given. They will be used when generating path. If the path was given and it already contains query parameters, they will be replaced.</p>
<p>If the path is given instead of a route identifier, it must exist (after being equipped with any extra parameters, if needed, using <code>params</code>).</p>
<p>When a path is given but it does not require language parameter, a path will be generated by testing whether it exists for regular and for slash-stripped or slash-added variant (the original variant goes first).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1933">view source</a></div></div><div class="public anchor" id="var-localized-permanent-redirect"><h3>localized-permanent-redirect</h3><div class="usage"><code>(localized-permanent-redirect)</code><code>(localized-permanent-redirect req)</code><code>(localized-permanent-redirect url)</code><code>(localized-permanent-redirect req url)</code><code>(localized-permanent-redirect req name-or-path)</code><code>(localized-permanent-redirect req name-or-path path-params)</code><code>(localized-permanent-redirect req name-or-path path-params query-params)</code><code>(localized-permanent-redirect req name-or-path lang)</code><code>(localized-permanent-redirect req name-or-path lang path-params)</code><code>(localized-permanent-redirect req name-or-path lang path-params query-params)</code><code>(localized-permanent-redirect req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the <code>localized-page</code> function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 308 to it using <code>resp/permanent-redirect</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
<p>The difference between this function and its regular counterpart (if defined) is in binary variants of them (when a request map and a name or a path are given as arguments). The regular function will fail to generate a redirect if there is no language parameter and the given path does not point to an existing page. On the contrary, this function will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that a localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1375">view source</a></div></div><div class="public anchor" id="var-localized-redirect"><h3>localized-redirect</h3><div class="usage"><code>(localized-redirect f)</code><code>(localized-redirect f req)</code><code>(localized-redirect f url)</code><code>(localized-redirect f req url)</code><code>(localized-redirect f req name-or-path)</code><code>(localized-redirect f req name-or-path path-params)</code><code>(localized-redirect f req name-or-path path-params query-params)</code><code>(localized-redirect f req name-or-path lang)</code><code>(localized-redirect f req name-or-path lang path-params)</code><code>(localized-redirect f req name-or-path lang path-params query-params)</code><code>(localized-redirect f req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Generic redirect wrapper. The <code>f</code> should be a function which takes a request map and returns a response; should take at least one single argument which should be a URL. The URL will be parameterized with a language. Works almost the same way as the <code>redirect</code> but it will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1207">view source</a></div></div><div class="public anchor" id="var-localized-see-other"><h3>localized-see-other</h3><div class="usage"><code>(localized-see-other)</code><code>(localized-see-other req)</code><code>(localized-see-other url)</code><code>(localized-see-other req url)</code><code>(localized-see-other req name-or-path)</code><code>(localized-see-other req name-or-path path-params)</code><code>(localized-see-other req name-or-path path-params query-params)</code><code>(localized-see-other req name-or-path lang)</code><code>(localized-see-other req name-or-path lang path-params)</code><code>(localized-see-other req name-or-path lang path-params query-params)</code><code>(localized-see-other req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the <code>localized-page</code> function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 303 to it using <code>resp/see-other</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
<p>The difference between this function and its regular counterpart (if defined) is in binary variants of them (when a request map and a name or a path are given as arguments). The regular function will fail to generate a redirect if there is no language parameter and the given path does not point to an existing page. On the contrary, this function will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that a localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1370">view source</a></div></div><div class="public anchor" id="var-localized-temporary-redirect"><h3>localized-temporary-redirect</h3><div class="usage"><code>(localized-temporary-redirect)</code><code>(localized-temporary-redirect req)</code><code>(localized-temporary-redirect url)</code><code>(localized-temporary-redirect req url)</code><code>(localized-temporary-redirect req name-or-path)</code><code>(localized-temporary-redirect req name-or-path path-params)</code><code>(localized-temporary-redirect req name-or-path path-params query-params)</code><code>(localized-temporary-redirect req name-or-path lang)</code><code>(localized-temporary-redirect req name-or-path lang path-params)</code><code>(localized-temporary-redirect req name-or-path lang path-params query-params)</code><code>(localized-temporary-redirect req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the <code>localized-page</code> function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 307 to it using <code>resp/temporary-redirect</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
<p>The difference between this function and its regular counterpart (if defined) is in binary variants of them (when a request map and a name or a path are given as arguments). The regular function will fail to generate a redirect if there is no language parameter and the given path does not point to an existing page. On the contrary, this function will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that a localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1373">view source</a></div></div><div class="public anchor" id="var-localized-use-proxy"><h3>localized-use-proxy</h3><div class="usage"><code>(localized-use-proxy)</code><code>(localized-use-proxy req)</code><code>(localized-use-proxy url)</code><code>(localized-use-proxy req url)</code><code>(localized-use-proxy req name-or-path)</code><code>(localized-use-proxy req name-or-path path-params)</code><code>(localized-use-proxy req name-or-path path-params query-params)</code><code>(localized-use-proxy req name-or-path lang)</code><code>(localized-use-proxy req name-or-path lang path-params)</code><code>(localized-use-proxy req name-or-path lang path-params query-params)</code><code>(localized-use-proxy req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the <code>localized-page</code> function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 305 to it using <code>resp/use-proxy</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
<p>The difference between this function and its regular counterpart (if defined) is in binary variants of them (when a request map and a name or a path are given as arguments). The regular function will fail to generate a redirect if there is no language parameter and the given path does not point to an existing page. On the contrary, this function will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that a localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1372">view source</a></div></div><div class="public anchor" id="var-lock-wait"><h3>lock-wait</h3><div class="usage"><code>(lock-wait auth-config-or-lock-wait)</code></div><div class="doc"><div class="markdown"><p>Returns lock-wait configuration option taken from the authentication configuration map or given as a time duration. Does not connect to a database.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1488">view source</a></div></div><div class="public anchor" id="var-lock-wait-default"><h3>lock-wait-default</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1467">view source</a></div></div><div class="public anchor" id="var-login-auth-state"><h3>login-auth-state</h3><div class="usage"><code>(login-auth-state req)</code><code>(login-auth-state req ring-match)</code><code>(login-auth-state req login-page-data auth-page-data)</code><code>(login-auth-state req ring-match login-page-data auth-page-data)</code></div><div class="doc"><div class="markdown"><p>Helper which returns 2-element vector telling if the current (or given as a match) page is a login page (1st element) and/or an auth page (2nd element).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L166">view source</a></div></div><div class="public anchor" id="var-login-page"><h3>login-page</h3><div class="usage"><code>(login-page req)</code><code>(login-page req lang-id)</code></div><div class="doc"><div class="markdown"><p>Returns a path for the login page. The page must have ID of <code>:user/login</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L997">view source</a></div></div><div class="public anchor" id="var-login-page.3F"><h3>login-page?</h3><div class="usage"><code>(login-page? req)</code><code>(login-page? req ring-match)</code></div><div class="doc"><div class="markdown"><p>Returns true if the current (or given as a match) page is a login page (has <code>:login-page?</code> route data set to a truthy value).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L154">view source</a></div></div><div class="public anchor" id="var-max-url-len"><h3>max-url-len</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L192">view source</a></div></div><div class="public anchor" id="var-misdirected-request"><h3>misdirected-request</h3><div class="usage"><code>(misdirected-request)</code><code>(misdirected-request body)</code></div><div class="doc"><div class="markdown"><p>421 Misdirected Request The request was directed at a server that is not able to produce a response (e.g. network balancer forwarded traffic to a wrong server).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1018">view source</a></div></div><div class="public anchor" id="var-mobile-agent.3F"><h3>mobile-agent?</h3><div class="usage"><code>(mobile-agent? req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2312">view source</a></div></div><div class="public anchor" id="var-move-to"><h3>move-to</h3><div class="usage"><code>(move-to)</code><code>(move-to req)</code><code>(move-to url)</code><code>(move-to req url)</code><code>(move-to req name-or-path)</code><code>(move-to req name-or-path path-params)</code><code>(move-to req name-or-path path-params query-params)</code><code>(move-to req name-or-path lang)</code><code>(move-to req name-or-path lang path-params)</code><code>(move-to req name-or-path lang path-params query-params)</code><code>(move-to req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the <code>localized-page</code> function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 307 to it using <code>resp/temporary-redirect</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
<p>The difference between this function and its regular counterpart (if defined) is in binary variants of them (when a request map and a name or a path are given as arguments). The regular function will fail to generate a redirect if there is no language parameter and the given path does not point to an existing page. On the contrary, this function will generate a localized path using a language obtained from a request (under <code>:language/str</code> key) and if there will be no language-parameterized variant of the path, it will fail. Use this function to make sure that a localized path will be produced, or <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1374">view source</a></div></div><div class="public anchor" id="var-moved-permanently"><h3>moved-permanently</h3><div class="usage"><code>(moved-permanently)</code><code>(moved-permanently req)</code><code>(moved-permanently url)</code><code>(moved-permanently req url)</code><code>(moved-permanently req name-or-path)</code><code>(moved-permanently req name-or-path path-params)</code><code>(moved-permanently req name-or-path path-params query-params)</code><code>(moved-permanently req name-or-path lang)</code><code>(moved-permanently req name-or-path lang path-params)</code><code>(moved-permanently req name-or-path lang path-params query-params)</code><code>(moved-permanently req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the page function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 301 to it using <code>resp/moved-permanently</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1359">view source</a></div></div><div class="public anchor" id="var-multiple-choices"><h3>multiple-choices</h3><div class="usage"><code>(multiple-choices)</code><code>(multiple-choices req)</code><code>(multiple-choices url)</code><code>(multiple-choices req url)</code><code>(multiple-choices req name-or-path)</code><code>(multiple-choices req name-or-path path-params)</code><code>(multiple-choices req name-or-path path-params query-params)</code><code>(multiple-choices req name-or-path lang)</code><code>(multiple-choices req name-or-path lang path-params)</code><code>(multiple-choices req name-or-path lang path-params query-params)</code><code>(multiple-choices req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the page function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 300 to it using <code>resp/multiple-choices</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1358">view source</a></div></div><div class="public anchor" id="var-not-modified"><h3>not-modified</h3><div class="usage"><code>(not-modified)</code><code>(not-modified req)</code><code>(not-modified req & more)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1377">view source</a></div></div><div class="public anchor" id="var-on-page.3F"><h3>on-page?</h3><div class="usage"><code>(on-page?)</code><code>(on-page? req)</code><code>(on-page? req page-id-or-path)</code><code>(on-page? req page-id-or-path & more)</code></div><div class="doc"><div class="markdown"><p>Checks if a current page matches the given route name (if an identifier is given) or the exact path. For multiple page names or paths, it returns true when any of them matches.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L106">view source</a></div></div><div class="public anchor" id="var-on-slash"><h3>on-slash</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L197">view source</a></div></div><div class="public anchor" id="var-oplog"><h3>oplog</h3><div class="usage"><code>(oplog req-or-match & message)</code></div><div class="doc"><div class="markdown"><p>Logs operation using operations logger. First argument should be a request map or a <code>Match</code> object containing configuration associated with the current route data under the <code>:oplog/config</code> key.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L92">view source</a></div></div><div class="public anchor" id="var-oplog-config"><h3>oplog-config</h3><div class="usage"><code>(oplog-config req-or-match)</code></div><div class="doc"><div class="markdown"><p>Returns operations logger configuration obtained from a request or a <code>Match</code> object.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L51">view source</a></div></div><div class="public anchor" id="var-oplog-logger"><h3>oplog-logger</h3><div class="usage"><code>(oplog-logger req-or-match)</code></div><div class="doc"><div class="markdown"><p>Retrieves operations logger function from a current route data (via <code>:oplog/config</code> key and then the <code>:fn/reporter</code> key), and if that fails, tries to retrieve it using <code>:oplog/config</code> key of the request map (and <code>:fn/reporter</code> sub-key). When everything fails it will fall back to a global variable <code>amelinium.common.oplog.auth/log</code>. The given argument can be either a request map or a <code>Match</code> object.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L66">view source</a></div></div><div class="public anchor" id="var-oplog-logger-from-route-data"><h3>oplog-logger-from-route-data</h3><div class="usage"><code>(oplog-logger-from-route-data route-data)</code></div><div class="doc"><div class="markdown"><p>Retrieves operations logger function from a given route data map (via <code>:oplog/config</code> key and then the <code>:fn/reporter</code> key) and creates a wrapper for handling keyword arguments.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L57">view source</a></div></div><div class="public anchor" id="var-oplog-logger-populated"><h3>oplog-logger-populated</h3><div class="usage"><code>(oplog-logger-populated req)</code><code>(oplog-logger-populated req route-data)</code></div><div class="doc"><div class="markdown"><p>Creates operations logging function on a basis of operations logger retrieved by getting <code>:oplog/logger</code> key of the request (<code>req</code>), and if that fails by calling <code>oplog-logger-from-route-data</code> (when <code>route-data</code> is given), and if that fails by calling <code>oplog-logger</code> function on a <code>req</code> (which falls back to <code>amelinium.common.oplog.auth/log</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L78">view source</a></div></div><div class="public anchor" id="var-page"><h3>page</h3><div class="usage"><code>(page req)</code><code>(page req name-or-path)</code><code>(page req name-or-path path-params)</code><code>(page req name-or-path path-params query-params)</code><code>(page req name-or-path lang)</code><code>(page req name-or-path lang path-params)</code><code>(page req name-or-path lang path-params query-params)</code><code>(page req name-or-path lang lang-required?)</code><code>(page req name-or-path lang path-params lang-required?)</code><code>(page req name-or-path lang path-params query-params lang-required?)</code><code>(page req name-or-path lang path-params query-params lang-required? name-path-fallback?)</code><code>(page _ _ name-or-path path-params query-params router hint-lang lang-settings-or-param)</code><code>(page _ name-or-path lang path-params query-params lang-required? name-path-fallback? router lang-settings-or-param)</code></div><div class="doc"><div class="markdown"><p>Generates a page path for the given page identifier (a route name) or a path, and optional language identifier. When called with just a request map, returns a path of the current page.</p>
<p>It tries to be optimistic. When called for a page identified by its name (expressed as an identifier, usually a keyword) and with a language parameter to be found (so it cannot be looked up using just a name alone), it will use currently detected language obtained from the given request map (key <code>:language/str</code>), and will use it.</p>
<p>Additional query parameters (<code>query-params</code>) can be given. They will be used when generating path with <code>localized-page</code>. If the path was given and it already contains query parameters, they will be replaced.</p>
<p>Additional path parameters (<code>path-params</code>) may be given. Giving extra (unknown to route) parameters does not affect lookup. Giving <code>path-params</code> when matching by path causes them to be silently ignored.</p>
<p>When invoked with a language parameter, calls <code>localized-page</code> internally.</p>
<p>When invoked with a language parameter, the <code>lang-required?</code> argument may be used (by default set to <code>false</code>) to check if a matching route is parameterized with a language parameter. This is to ensure that only a localized route is used.</p>
<p>When invoked with a language parameter, the optional <code>name-path-fallback?</code> argument may be used (set to <code>true</code> by default) to cause non-matching route identifier to be retried by extracting its path and calling <code>localized-page</code> function for that path expressed as a string.</p>
<p>If the path is given instead of a route identifier, it must exist (after being equipped with any extra parameters, if needed, using <code>path-params</code>).</p>
<p>When invoked with a language parameter, the <code>lang-required?</code> is set to <code>false</code> (default), and a path is given but it does not require language parameter, a path will be generated by testing whether it exists for regular and for slash-stripped or slash-added variant (the original variant goes first).</p>
<p>When invoked with a language parameter, the <code>lang-required?</code> is set to <code>false</code> (default), and a path is given but it does not require language parameter plus the <code>name-path-fallback?</code> argument is set to <code>:brute-force</code>, all possible path variants (with language parameter injected within its succesive segments) will be tried in hope that one will exist, regardless of parameter name that matches. Use it with caution as it may give weird matches; if for example, there is a route path <code>/users/:id</code> defined, and the given path is <code>/users/</code> with language set to <code>:pl</code>, then it will match <code>/users/pl</code> even though the parameter is not related to a language.</p>
<p>When invoked with a language parameter, the <code>lang-required?</code> is set to <code>true</code>, and a path is given but it does not require a language parameter, all possible path variants (with language parameter injected within its succesive segments) will be tried in hope that one will match, being a path that requires language parameter.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L787">view source</a></div></div><div class="public anchor" id="var-page-cache-len"><h3>page-cache-len</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L193">view source</a></div></div><div class="public anchor" id="var-parameterized-page"><h3>parameterized-page</h3><div class="usage"><code>(parameterized-page)</code><code>(parameterized-page req)</code><code>(parameterized-page req name-or-path)</code><code>(parameterized-page req name-or-path param param-value)</code><code>(parameterized-page req name-or-path param param-value path-params)</code><code>(parameterized-page req name-or-path param param-value path-params query-params)</code><code>(parameterized-page req name-or-path param param-value require-param?)</code><code>(parameterized-page req name-or-path param param-value path-params require-param?)</code><code>(parameterized-page req name-or-path param param-value path-params query-params require-param?)</code><code>(parameterized-page req name-or-path param param-value path-params query-params require-param? name-path-fallback?)</code><code>(parameterized-page _ name-or-path param param-value path-params query-params require-param? name-path-fallback? router)</code></div><div class="doc"><div class="markdown"><p>Generates a path for the given page identifier (which may be a name expressed with an identifier, preferably a keyword, or a path expressed as a string) and a parameter with the given value.</p>
<p>Optional path parameters may be given. They will be used to match a page by name if it requires additional parameters to be present.</p>
<p>Examples:</p>
<p><code>(parameterized-page req)</code> <code>(parameterized-page req :login-page)</code> <code>(parameterized-page req :login-page :lang :pl)</code> <code>(parameterized-page req :login-page :lang :pl {:client "wow-corp"})</code> <code>(parameterized-page req "/login/page/")</code> <code>(parameterized-page req "/login/page/" :lang :pl)</code> <code>(parameterized-page req "/en/login/page/" :lang :pl)</code></p>
<p>When called with just a request map, returns a path of the current page if the page exists. When called with a page name or path, it returns a path if the page exists.</p>
<p>The optional <code>name-path-fallback?</code> argument, when set to a truthy value (default is <code>false</code>), causes non-matching route identifier to be retried by extracting its path and calling this function for that path given as a string.</p>
<p>The optional <code>require-param?</code> argument (set to <code>false</code> when not given) enables extra check eliminating pages which do not support the given parameter, yet would be matched. Example:</p>
<p><code>(parameterized-page req :login-page :lang :pl true)</code></p>
<p>will fail if there is no parameter <code>:lang</code> handled by the route named <code>:login-page</code>.</p>
<p>When the given path is already parameterized then re-parameterized path is generated and checked if it exists, unless the value of the parameter is the same as the existing one. In such case the path is returned after a quick existence check.</p>
<p>Additional path parameters (<code>path-params</code>) can be given to be used when matching by name. Giving extra (unknown to route) parameters does not affect lookup. Giving <code>path-params</code> when matching by path causes them to be silently ignored.</p>
<p>Additional query parameters (<code>query-params</code>) can be given. They will be used when generating path. If the path was given and it already contains query parameters, they will be replaced.</p>
<p>If the path is given instead of a route identifier, it must exist (after being equipped with any extra parameters, if needed, using <code>path-params</code>).</p>
<p>When the <code>require-param?</code> is set to <code>false</code> (default) and a path is given but it does not require this parameter, a path will be generated by testing whether it exists for regular and for slash-stripped or slash-added variant (the original variant goes first).</p>
<p>When the <code>require-param?</code> is set to <code>false</code> (default) and a path is given but it does not require this parameter plus the <code>name-path-fallback?</code> argument is set to <code>:brute-force</code>, all possible path variants (with parameter injected within its succesive segments) will be tried in hope that one will exist, regardless of parameter name that matches. Use it with caution as it may give weird matches; if for example, there is a route path <code>/users/:id</code> defined, and the given path is <code>/users/</code> with <code>:lang</code> parameter set to <code>:pl</code>, then it will match <code>/users/pl</code> even though the parameter name is different.</p>
<p>When the <code>require-param?</code> is set to <code>true</code> and a path is given but it does not require this parameter, all possible path variants (with parameter injected within its succesive segments) will be tried in hope that one will match, being a path that requires this parameter.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L459">view source</a></div></div><div class="public anchor" id="var-parse-query-params"><h3>parse-query-params</h3><div class="usage"><code>(parse-query-params req qstr)</code></div><div class="doc"><div class="markdown"><p>Parses query params string <code>qstr</code> using Ring’s <code>ring.util.codec/form-decode</code>. The given request map <code>req</code> is used internally to get the current character encoding (with fallback to UTF-8).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1995">view source</a></div></div><div class="public anchor" id="var-path"><h3>path</h3><div class="usage"><code>(path)</code><code>(path req)</code><code>(path req name-or-path)</code><code>(path req name-or-path lang)</code><code>(path req name-or-path lang params)</code><code>(path req name-or-path lang params query-params)</code><code>(path name-or-path lang params query-params router language-settings-or-param)</code></div><div class="doc"><div class="markdown"><p>Creates a URL on a basis of route name or a path.</p>
<p>If a page found does not have a language parameter it is accepted too.</p>
<p>When the given path is already parameterized with language then re-parameterized path is generated and checked if it exists, unless the value of the parameter is the same as the existing one. In such case the path is returned after a quick existence check.</p>
<p>Additional path parameters (<code>params</code>) can be given to be used when matching by name. Giving extra (unknown to route) parameters does not affect lookup. Giving <code>params</code> when matching by path causes them to be silently ignored.</p>
<p>Additional query parameters (<code>query-params</code>) can be given. They will be used when generating path. If the path was given and it already contains query parameters, they will be replaced.</p>
<p>If the path is given instead of a route identifier, it must exist (after being equipped with any extra parameters, if needed, using <code>params</code>).</p>
<p>When a path is given but it does not require language parameter, a path will be generated by testing whether it exists for regular and for slash-stripped or slash-added variant (the original variant goes first).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1882">view source</a></div></div><div class="public anchor" id="var-path-language"><h3>path-language</h3><div class="usage"><code>(path-language req)</code><code>(path-language req-or-match path-or-lang-settings)</code><code>(path-language req path router)</code><code>(path-language _ path router language-settings-or-param)</code></div><div class="doc"><div class="markdown"><p>Returns a language string if the given path contains a language parameter. Otherwise it returns nil.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L269">view source</a></div></div><div class="public anchor" id="var-path-param"><h3>path-param</h3><div class="usage"><code>(path-param req-or-match param)</code><code>(path-param req path param)</code><code>(path-param _ path param router)</code></div><div class="doc"><div class="markdown"><p>Returns a parameter if the given path contains it and it is set. Otherwise it returns nil.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L247">view source</a></div></div><div class="public anchor" id="var-path-params"><h3>path-params</h3><div class="usage"><code>(path-params req-or-match)</code><code>(path-params req path)</code><code>(path-params _ path router)</code></div><div class="doc"><div class="markdown"><p>Returns a map of parameters if the given path contains it. Otherwise it returns nil.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L259">view source</a></div></div><div class="public anchor" id="var-path-slash-variants"><h3>path-slash-variants</h3><div class="usage"><code>(path-slash-variants uri)</code></div><div class="doc"><div class="markdown"><p>Returns a 2-element vector of a path containing its two variants: with and without a trailing slash. The original path is always placed first.</p>
<p>If the path is empty, vector of an empty string and a slash is returned. If the path is a slash, vector of a slash and an empty string is returned.</p>
<p>If the path is <code>nil</code>, it returns <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L323">view source</a></div></div><div class="public anchor" id="var-path-splitter"><h3>path-splitter</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L195">view source</a></div></div><div class="public anchor" id="var-path-template-with-param"><h3>path-template-with-param</h3><div class="usage"><code>(path-template-with-param match required-param)</code><code>(path-template-with-param match required-param short-circuit)</code></div><div class="doc"><div class="markdown"><p>Returns a path template for the given match if the route supports the given parameter.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L364">view source</a></div></div><div class="public anchor" id="var-path-variants"><h3>path-variants</h3><div class="usage"><code>(path-variants path lang-id)</code><code>(path-variants path lang suffix)</code></div><div class="doc"><div class="markdown"><p>Generates a list of all possible language variants of a path.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L241">view source</a></div></div><div class="public anchor" id="var-permanent-redirect"><h3>permanent-redirect</h3><div class="usage"><code>(permanent-redirect)</code><code>(permanent-redirect req)</code><code>(permanent-redirect url)</code><code>(permanent-redirect req url)</code><code>(permanent-redirect req name-or-path)</code><code>(permanent-redirect req name-or-path path-params)</code><code>(permanent-redirect req name-or-path path-params query-params)</code><code>(permanent-redirect req name-or-path lang)</code><code>(permanent-redirect req name-or-path lang path-params)</code><code>(permanent-redirect req name-or-path lang path-params query-params)</code><code>(permanent-redirect req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the page function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 308 to it using <code>resp/permanent-redirect</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1364">view source</a></div></div><div class="public anchor" id="var-pick-language"><h3>pick-language</h3><div class="usage"><code>(pick-language req)</code><code>(pick-language req pickers)</code><code>(pick-language req picker-id)</code><code>(pick-language req pickers picker-id)</code></div><div class="doc"><div class="markdown"><p>Tries to pick the best language for a known user or a visitor. To be used (among other scenarios) after a successful log-in to show the right language version of a welcome page. Does not use pre-calculated values from a request map, instead triggers configured pickers from a default or given chain. Returns a keyword.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1389">view source</a></div></div><div class="public anchor" id="var-pick-language-str"><h3>pick-language-str</h3><div class="usage"><code>(pick-language-str req)</code><code>(pick-language-str req pickers)</code><code>(pick-language-str req picker-id)</code><code>(pick-language-str req pickers picker-id)</code></div><div class="doc"><div class="markdown"><p>Tries to pick the best language for a known user or a visitor. To be used (among other scenarios) after a successful log-in to show the right language version of a welcome page. Does not use pre-calculated values from a request map, instead triggers configured pickers from a default or given chain. Returns a string.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1401">view source</a></div></div><div class="public anchor" id="var-pick-language-str-without-fallback"><h3>pick-language-str-without-fallback</h3><div class="usage"><code>(pick-language-str-without-fallback req)</code><code>(pick-language-str-without-fallback req pickers)</code><code>(pick-language-str-without-fallback req picker-id)</code><code>(pick-language-str-without-fallback req pickers picker-id)</code></div><div class="doc"><div class="markdown"><p>Tries to pick the best language for a known user or a visitor. To be used (among other scenarios) after a successful log-in to show the right language version of a welcome page. Does not use pre-calculated values from a request map, instead triggers configured pickers from a default or given chain. When a language cannot be found it simply returns <code>nil</code> instead of a default language. Returns a string.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1426">view source</a></div></div><div class="public anchor" id="var-pick-language-without-fallback"><h3>pick-language-without-fallback</h3><div class="usage"><code>(pick-language-without-fallback req)</code><code>(pick-language-without-fallback req pickers)</code><code>(pick-language-without-fallback req picker-id)</code><code>(pick-language-without-fallback req pickers picker-id)</code></div><div class="doc"><div class="markdown"><p>Tries to pick the best language for a known user or a visitor. To be used (among other scenarios) after a successful log-in to show the right language version of a welcome page. Does not use pre-calculated values from a request map, instead triggers configured pickers from a default or given chain. When a language cannot be found it simply returns <code>nil</code> instead of a default language. Returns a keyword.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1413">view source</a></div></div><div class="public anchor" id="var-pick-params"><h3>pick-params</h3><div class="usage"><code>(pick-params params)</code><code>(pick-params params ns)</code><code>(pick-params params keys)</code><code>(pick-params params key-map)</code><code>(pick-params params new-ns ns)</code><code>(pick-params params new-ns keys)</code></div><div class="doc"><div class="markdown"><p>Removes namespaces from keys in <code>params</code> or renames keys according to the given <code>key-map</code>.</p>
<p>The <code>keys</code> argument should be a sequence of keys to be found in <code>params</code>. Only the entries identified by these keys will be preserved, with keys stripped from their namespaces. When <code>new-ns</code> is present then the keys in generated map will have their namespace set to this value (which should be a string or any object convertible to a string).</p>
<p>The <code>key-map</code> argument should be a map of keys to be found in <code>params</code> mapped to their new names. Only the entries from <code>params</code> identified by the keys from <code>key-map</code> will be preserved and renamed to corresponding values.</p>
<p>The <code>ns</code> argument should be a string or an object which can be converted to a string. It will be used to select the entries from <code>params</code> by the given namespace and to remove this namespace when producing the result. When <code>new-ns</code> is present then the keys in generated map will have their namespace set to this value (which should be a string or any object convertible to a string).</p>
<p>When only <code>params</code> argument is given, it will simply rename all keys from namespaced to simple keywords.</p>
<p>When <code>params</code> argument is given, then <code>ns</code> is set to <code>nil</code>, and <code>new-ns</code> is set, it will strip all keys from their namespaces replacing it with the given namespace in a resulting map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2113">view source</a></div></div><div class="public anchor" id="var-query-string-encode"><h3>query-string-encode</h3><div class="usage"><code>(query-string-encode params)</code><code>(query-string-encode req params)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2017">view source</a></div></div><div class="public anchor" id="var-redirect"><h3>redirect</h3><div class="usage"><code>(redirect f)</code><code>(redirect f req)</code><code>(redirect f url)</code><code>(redirect f req url)</code><code>(redirect f req name-or-path)</code><code>(redirect f req name-or-path path-params)</code><code>(redirect f req name-or-path path-params query-params)</code><code>(redirect f req name-or-path lang)</code><code>(redirect f req name-or-path lang path-params)</code><code>(redirect f req name-or-path lang path-params query-params)</code><code>(redirect f req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Generic redirect wrapper. The <code>f</code> should be a function which takes a request map and returns a response; should take at least one single argument which should be a URL. The URL will be parameterized with a language if required. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1170">view source</a></div></div><div class="public anchor" id="var-reflect-session-hx-header"><h3>reflect-session-hx-header</h3><div class="usage"><code>(reflect-session-hx-header req sess)</code></div><div class="doc"><div class="markdown"><p>Tries to obtain session ID from the given <code>sess</code> object, and if that fails from the request header with name same as session ID field (obtained by calling <code>amelinium.http.middleware.session/id-field</code> on <code>sess</code>) from the <code>req</code> map. Then it uses <code>add-json-event-handler</code> to set <code>HX-Trigger</code> response header in a similar way the <code>add-session-hx-header</code> does.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1650">view source</a></div></div><div class="public anchor" id="var-reflect-session-id-header"><h3>reflect-session-id-header</h3><div class="usage"><code>(reflect-session-id-header req sess)</code></div><div class="doc"><div class="markdown"><p>Adds session ID header to the <code>:response/headers</code> map of the given <code>req</code> map. Name of the header is obtained from session ID field (by calling <code>amelinium.http.middleware.session/id-field</code>) and its value is set to session ID (obtained by calling <code>amelinium.http.middleware.session/any-id</code>, and if that fails by getting the value of client request header with the same name using <code>get-session-id-header</code>). If the header already exists it is not added.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1701">view source</a></div></div><div class="public anchor" id="var-remove-body-params"><h3>remove-body-params</h3><div class="usage"><code>(remove-body-params m param)</code><code>(remove-body-params m param & more)</code></div><div class="doc"><div class="markdown"><p>Removes the given parameter or parameters from a request map locations: <code>[:parameters :body]</code>, <code>:body-params</code> and <code>:params</code>. All parameters must be either keywords or strings, they cannot be mixed.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2104">view source</a></div></div><div class="public anchor" id="var-remove-form-params"><h3>remove-form-params</h3><div class="usage"><code>(remove-form-params m param)</code><code>(remove-form-params m param & more)</code></div><div class="doc"><div class="markdown"><p>Removes the given parameter or parameters from a request map locations: <code>[:parameters :form]</code>, <code>:form-params</code> and <code>:params</code>. All parameters must be either keywords or strings, they cannot be mixed.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2095">view source</a></div></div><div class="public anchor" id="var-remove-params"><h3>remove-params</h3><div class="usage"><code>(remove-params m params-key parameters-sub-key combined? param)</code><code>(remove-params m params-key parameters-sub-key combined? param & more)</code></div><div class="doc"><div class="markdown"><p>Removes the given parameter or parameters from a request map locations: - from a map associated with <code>parameters-sub-key</code> key within a map associated with <code>:parameters</code> key in <code>m</code>, - from a map associated with <code>params-key</code> key in <code>m</code>, - from a map associated with <code>:params</code> key in <code>m</code> (if <code>combined?</code> is truthy). All parameters must be either keywords or strings, they cannot be mixed. Parameter type <code>params-key</code> and <code>parameters-sub-key</code> should be keywords. If <code>params-key</code> or <code>parameters-sub-key</code> is <code>nil</code> then the removal within a specific location(s) will be skipped.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2025">view source</a></div></div><div class="public anchor" id="var-remove-path-params"><h3>remove-path-params</h3><div class="usage"><code>(remove-path-params m param)</code><code>(remove-path-params m param & more)</code></div><div class="doc"><div class="markdown"><p>Removes the given parameter or parameters from a request map locations: <code>[:parameters :path]</code>, <code>:path-params</code> and <code>:params</code>. All parameters must be either keywords or strings, they cannot be mixed.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2077">view source</a></div></div><div class="public anchor" id="var-remove-query-params"><h3>remove-query-params</h3><div class="usage"><code>(remove-query-params m param)</code><code>(remove-query-params m param & more)</code></div><div class="doc"><div class="markdown"><p>Removes the given parameter or parameters from a request map locations: <code>[:parameters :query]</code>, <code>:query-params</code> and <code>:params</code>. All parameters must be either keywords or strings, they cannot be mixed.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2086">view source</a></div></div><div class="public anchor" id="var-remove-status"><h3>remove-status</h3><h4 class="type">macro</h4><div class="usage"><code>(remove-status req)</code></div><div class="doc"><div class="markdown"><p>Removes <code>:response/status</code> from <code>req</code> using <code>clojure.core/dissoc</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2533">view source</a></div></div><div class="public anchor" id="var-render"><h3>render</h3><div class="usage"><code>(render resp-fn)</code><code>(render resp-fn req)</code><code>(render resp-fn req a)</code><code>(render resp-fn req a b)</code><code>(render resp-fn req a b c)</code><code>(render resp-fn req a b c & more)</code></div><div class="doc"><div class="markdown"><p>Universal response renderer. Returns the result of calling the <code>resp-fn</code> with headers attached (from <code>:response/headers</code> key of the <code>req</code>) unless the req is already a valid response. Arguments from the third are passed to <code>resp-fn</code> function.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1039">view source</a></div></div><div class="public anchor" id="var-render-force"><h3>render-force</h3><div class="usage"><code>(render-force resp-fn)</code><code>(render-force resp-fn req)</code><code>(render-force resp-fn req a)</code><code>(render-force resp-fn req a b)</code><code>(render-force resp-fn req a b c)</code><code>(render-force resp-fn req a b c & more)</code></div><div class="doc"><div class="markdown"><p>Universal body-less response renderer. Returns the result of calling the <code>resp-fn</code> with headers attached (from <code>:response/headers</code> key of the <code>req</code>). Arguments from the third are passed to <code>resp-fn</code> function.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1087">view source</a></div></div><div class="public anchor" id="var-replace-session-hx-header"><h3>replace-session-hx-header</h3><div class="usage"><code>(replace-session-hx-header req sess)</code></div><div class="doc"><div class="markdown"><p>Adds <code>HX-Trigger</code> server response header to <code>:response/headers</code> map of the given <code>req</code> map by putting a JSON in the following form:</p>
<p><code>{"setSession":{"session-id": "SID"}}</code></p>
<p>where the <code>session-id</code> string is obtained from session’s ID field (using <code>amelinium.http.middleware.session/id-field</code>) and <code>SID</code> is replaced with session ID (obtained with <code>amelinium.http.middleware.session/any-id</code>).</p>
<p>If the <code>HX-Trigger</code> header already exists, it will be modified and any value associated with <code>setSession</code> key will be modified.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1624">view source</a></div></div><div class="public anchor" id="var-replace-session-id-header"><h3>replace-session-id-header</h3><div class="usage"><code>(replace-session-id-header req sess)</code></div><div class="doc"><div class="markdown"><p>Adds session ID header to the <code>:response/headers</code> map of the given <code>req</code> map. Name of the header is obtained from session ID field (by calling <code>amelinium.http.middleware.session/id-field</code>) and its value is set to session ID (obtained by calling <code>amelinium.http.middleware.session/any-id</code>). If the header already exists it is replaced.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1692">view source</a></div></div><div class="public anchor" id="var-role-required.21"><h3>role-required!</h3><div class="usage"><code>(role-required! req role)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1757">view source</a></div></div><div class="public anchor" id="var-roles-for-context"><h3>roles-for-context</h3><div class="usage"><code>(roles-for-context req user-id context)</code><code>(roles-for-context req context)</code><code>(roles-for-context req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1768">view source</a></div></div><div class="public anchor" id="var-roles-for-contexts"><h3>roles-for-contexts</h3><div class="usage"><code>(roles-for-contexts req user-id)</code><code>(roles-for-contexts req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1778">view source</a></div></div><div class="public anchor" id="var-roles-matrix"><h3>roles-matrix</h3><div class="usage"><code>(roles-matrix req)</code><code>(roles-matrix req opts)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1796">view source</a></div></div><div class="public anchor" id="var-roles-refresh"><h3>roles-refresh</h3><div class="usage"><code>(roles-refresh req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1739">view source</a></div></div><div class="public anchor" id="var-roles-tabler"><h3>roles-tabler</h3><div class="usage"><code>(roles-tabler req)</code><code>(roles-tabler {{:keys [global-context], :or {global-context :!}} :roles/config, :as req} {:keys [user-id effective? include-global? include-self? present-label missing-label global-label global-marker global-present-label context-label contexts-labeler], :or {present-label "YES", missing-label "—", global-label "global", context-label "Context", contexts-labeler default-contexts-labeler, include-global? (not effective?), include-self? false}, :as opts})</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1840">view source</a></div></div><div class="public anchor" id="var-router-match.3F"><h3>router-match?</h3><div class="usage"><code>(router-match? v)</code></div><div class="doc"><div class="markdown"><p>Returns true if the given argument is Reitit’s Match object.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L101">view source</a></div></div><div class="public anchor" id="var-see-other"><h3>see-other</h3><div class="usage"><code>(see-other)</code><code>(see-other req)</code><code>(see-other url)</code><code>(see-other req url)</code><code>(see-other req name-or-path)</code><code>(see-other req name-or-path path-params)</code><code>(see-other req name-or-path path-params query-params)</code><code>(see-other req name-or-path lang)</code><code>(see-other req name-or-path lang path-params)</code><code>(see-other req name-or-path lang path-params query-params)</code><code>(see-other req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the page function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 303 to it using <code>resp/see-other</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1361">view source</a></div></div><div class="public anchor" id="var-session"><h3>session</h3><div class="usage"><code>(session req)</code><code>(session req session-key)</code></div><div class="doc"><div class="markdown"><p>Gets a session map from the given request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1532">view source</a></div></div><div class="public anchor" id="var-session-config"><h3>session-config</h3><div class="usage"><code>(session-config req)</code><code>(session-config req session-key)</code></div><div class="doc"><div class="markdown"><p>Gets a session config map from the given request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1539">view source</a></div></div><div class="public anchor" id="var-session-inject"><h3>session-inject</h3><div class="usage"><code>(session-inject req smap)</code><code>(session-inject req smap session-key)</code></div><div class="doc"><div class="markdown"><p>Adds session data to a request map. Session key is obtained from the <code>config</code> field of <code>smap</code> or (if given) from a <code>session-key</code> argument.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1556">view source</a></div></div><div class="public anchor" id="var-session-variable-get-failed.3F"><h3>session-variable-get-failed?</h3><div class="usage"><code>(session-variable-get-failed? v)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1564">view source</a></div></div><div class="public anchor" id="var-slash-break"><h3>slash-break</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L198">view source</a></div></div><div class="public anchor" id="var-slash-redir"><h3>slash-redir</h3><div class="usage"><code>(slash-redir req)</code></div><div class="doc"><div class="markdown"><p>Redirects to a slash-trailed version of the same URI. If the URI already has a slash, it returns a req.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1451">view source</a></div></div><div class="public anchor" id="var-soft-lock-passed"><h3>soft-lock-passed</h3><div class="usage"><code>(soft-lock-passed user time)</code></div><div class="doc"><div class="markdown"><p>Returns the time duration between soft lock and the given moment. If the duration is zero or negative, it returns nil.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1480">view source</a></div></div><div class="public anchor" id="var-soft-lock-remains"><h3>soft-lock-remains</h3><div class="usage"><code>(soft-lock-remains lock-passed auth-config-or-lw)</code><code>(soft-lock-remains user auth-config-or-lw time)</code></div><div class="doc"><div class="markdown"><p>Returns the amount of time left before reaching lock-wait. If the amount is negative or zero, it returns nil. Does not connect to a database.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1517">view source</a></div></div><div class="public anchor" id="var-soft-lock-time"><h3>soft-lock-time</h3><div class="usage"><code>(soft-lock-time user)</code></div><div class="doc"><div class="markdown"><p>Gets a soft lock time for the given user specified by a map having :soft-locked key.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1474">view source</a></div></div><div class="public anchor" id="var-soft-locked.3F"><h3>soft-locked?</h3><div class="usage"><code>(soft-locked? lock-passed auth-config-or-lw)</code><code>(soft-locked? user auth-config-or-lw time)</code></div><div class="doc"><div class="markdown"><p>Returns true if the given user account is soft-locked (the time amount which passed from the lock till the given time is lesser than the soft lock wait configuration option). Does not connect to a database.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1503">view source</a></div></div><div class="public anchor" id="var-split-qparams"><h3>split-qparams</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L196">view source</a></div></div><div class="public anchor" id="var-split-query-params"><h3>split-query-params</h3><div class="usage"><code>(split-query-params path)</code></div><div class="doc"><div class="markdown"><p>Splits path into 3 string components: path, location and query params. Returns a vector.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L289">view source</a></div></div><div class="public anchor" id="var-split-query-params-simple"><h3>split-query-params-simple</h3><div class="usage"><code>(split-query-params-simple path)</code></div><div class="doc"><div class="markdown"><p>Splits path into 2 components: path string and location / query params string. Returns a sequence.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L283">view source</a></div></div><div class="public anchor" id="var-strictly-localized-page"><h3>strictly-localized-page</h3><div class="usage"><code>(strictly-localized-page req)</code><code>(strictly-localized-page req name-or-path)</code><code>(strictly-localized-page req name-or-path lang)</code><code>(strictly-localized-page req name-or-path lang params)</code><code>(strictly-localized-page req name-or-path lang params query-params)</code><code>(strictly-localized-page name-or-path lang params query-params router lang-param)</code></div><div class="doc"><div class="markdown"><p>Same as <code>localized-page</code> with <code>lang-required?</code> always set to <code>true</code>, <code>name-path-fallback?</code> set to <code>false</code>, and with less arities supported. When the language version of a page identified by its name is not present it will return <code>nil</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L716">view source</a></div></div><div class="public anchor" id="var-template-path"><h3>template-path</h3><div class="usage"><code>(template-path match params)</code><code>(template-path match params query-params)</code><code>(template-path path template params _)</code></div><div class="doc"><div class="markdown"><p>Replaces parameters in the given path using a template.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L348">view source</a></div></div><div class="public anchor" id="var-temporary-redirect"><h3>temporary-redirect</h3><div class="usage"><code>(temporary-redirect)</code><code>(temporary-redirect req)</code><code>(temporary-redirect url)</code><code>(temporary-redirect req url)</code><code>(temporary-redirect req name-or-path)</code><code>(temporary-redirect req name-or-path path-params)</code><code>(temporary-redirect req name-or-path path-params query-params)</code><code>(temporary-redirect req name-or-path lang)</code><code>(temporary-redirect req name-or-path lang path-params)</code><code>(temporary-redirect req name-or-path lang path-params query-params)</code><code>(temporary-redirect req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the page function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 307 to it using <code>resp/temporary-redirect</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1363">view source</a></div></div><div class="public anchor" id="var-translator"><h3>translator</h3><div class="usage"><code>(translator req)</code><code>(translator req lang-id)</code></div><div class="doc"><div class="markdown"><p>Generates a translation function using populated values from <code>:i18n/translator</code> or <code>:i18n/translator-nd</code> (variant which returns <code>nil</code> for missing keys, used when <code>i18n/*handle-missing-keys*</code> is set to a falsy value).</p>
<p>Falls back to <code>i18n/translator</code> if predefined functions are not populated in the request map or if a language was specified as an optional <code>lang</code> argument and it differs from the language stored in <code>req</code> under <code>:language/id</code> (or <code>:language/default</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2259">view source</a></div></div><div class="public anchor" id="var-translator-sub"><h3>translator-sub</h3><div class="usage"><code>(translator-sub req)</code><code>(translator-sub req lang-id)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2277">view source</a></div></div><div class="public anchor" id="var-untranslatable.3F"><h3>untranslatable?</h3><div class="usage"><code>(untranslatable? v)</code></div><div class="doc"><div class="markdown"><p>Returns true if the given argument cannot be used as a translation key.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2305">view source</a></div></div><div class="public anchor" id="var-url-.3Euri.2Bparams"><h3>url->uri+params</h3><div class="usage"><code>(url->uri+params req u)</code></div><div class="doc"><div class="markdown"><p>Takes a request map <code>req</code> and URI (<code>u</code>) and tries to decompose it into 2-element vector with first element being a URI and second a query params map. If there is a processing exception during the operation, string-converted <code>u</code> is returned unmodified and query params slot is set to be <code>nil</code>. The request map is used internally to get the current character encoding (with fallback to UTF-8).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L2006">view source</a></div></div><div class="public anchor" id="var-use-hx.3F"><h3>use-hx?</h3><div class="usage"><code>(use-hx? req)</code><code>(use-hx? req route-data)</code><code>(use-hx? req route-data extra-key)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if response should be HTMX-compatible, <code>false</code> if it should not. Uses optional <code>route-data</code> or gets it from the <code>req</code> to look for (optional) <code>extra-key</code> first, and if it is not given or has falsy value then gets a value associated with the <code>:use-htmx?</code> key.</p>
<ul>
<li>If the obtained value is <code>false</code>, it will return <code>false</code>.</li>
<li>If the obtained value is <code>true</code> or any non-<code>nil</code> value, it will return <code>true</code>.</li>
<li>If the obtained value is <code>nil</code>, or there is no route data nor any of the mentioned keys can be found in route data, it will try to auto-detect HTMX using <code>hx-request?</code> function which analyzes the <code>HX-Request</code> request header.</li>
</ul>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1136">view source</a></div></div><div class="public anchor" id="var-use-proxy"><h3>use-proxy</h3><div class="usage"><code>(use-proxy)</code><code>(use-proxy req)</code><code>(use-proxy url)</code><code>(use-proxy req url)</code><code>(use-proxy req name-or-path)</code><code>(use-proxy req name-or-path path-params)</code><code>(use-proxy req name-or-path path-params query-params)</code><code>(use-proxy req name-or-path lang)</code><code>(use-proxy req name-or-path lang path-params)</code><code>(use-proxy req name-or-path lang path-params query-params)</code><code>(use-proxy req name-or-path lang path-params query-params & more)</code></div><div class="doc"><div class="markdown"><p>Uses the page function to calculate the destination path on a basis of page name (identifier) or a path (a string) and performs a redirect with code 305 to it using <code>resp/use-proxy</code>. If the language is given it uses the <code>localized-page</code> function. If there is no language given but the page identified by its name requires a language parameter to be set, it will be obtained from the given request map (under the key <code>:language/str</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1362">view source</a></div></div><div class="public anchor" id="var-with-role-only.21"><h3>with-role-only!</h3><h4 class="type">macro</h4><div class="usage"><code>(with-role-only! req role & body)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/common.clj#L1763">view source</a></div></div></div></body></html>