-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2024-11-19-axe-api-v1-5-is-out.html
79 lines (76 loc) · 53.4 KB
/
2024-11-19-axe-api-v1-5-is-out.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
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Axe API v1.5 is out! | Axe API</title>
<meta name="generator" content="VitePress v1.3.4">
<link rel="preload stylesheet" href="/assets/style.D2wWT-OU.css" as="style">
<script type="module" src="/assets/app.BuAYJVRv.js"></script>
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/assets/chunks/theme.BxoX7LQB.js">
<link rel="modulepreload" href="/assets/chunks/framework.DgZLXPSQ.js">
<link rel="modulepreload" href="/assets/blog_2024-11-19-axe-api-v1-5-is-out.md.lgXQpL7t.lean.js">
<link rel="icon" href="/logo.png">
<meta name="theme-color" content="#3eaf7c">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="/styles.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.9.1/dist/cookieconsent.css">
<meta name="description" content="Axe API is the next generation rest API framework. You can quickly create a Rest API by simply defining models and relationships.">
<meta name="og:title" content="Axe API">
<meta name="og:description" content="Axe API is the next generation rest API framework. You can quickly create a Rest API by simply defining models and relationships.">
<meta name="og:image" content="https://axe-api.com/social.png">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Axe API">
<meta name="twitter:description" content="Axe API is the next generation rest API framework. You can quickly create a Rest API by simply defining models and relationships.">
<meta name="twitter:image" content="https://axe-api.com/social.png">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" href="/icons/apple-touch-icon-152x152.png">
<link rel="mask-icon" href="/icons/safari-pinned-tab.svg" color="#3eaf7c">
<meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
<meta name="msapplication-TileColor" content="#000000">
<script defer src="https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.9.1/dist/cookieconsent.js"></script>
<script defer src="/init.js"></script>
<script async type="text/plain" data-cookiecategory="analytics" src="https://www.googletagmanager.com/gtag/js?id=G-1HBM031QWE"></script>
<script type="text/plain" data-cookiecategory="analytics">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-1HBM031QWE');
</script>
<script id="check-dark-mode">document.documentElement.classList.add("dark");</script>
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
</head>
<body>
<div id="app"><div class="Layout" data-v-a4de5d60 data-v-5d98c3a5><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0f60ec36></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0f60ec36> Skip to content </a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar top" data-v-ae24b3ad data-v-6aa21345><div class="wrapper" data-v-6aa21345><div class="container" data-v-6aa21345><div class="title" data-v-6aa21345><div class="VPNavBarTitle" data-v-6aa21345 data-v-ab179fa1><a class="title" href="/" data-v-ab179fa1><!--[--><!--]--><!--[--><img class="VPImage logo" src="/axe.png" alt data-v-8426fc1a><!--]--><span data-v-ab179fa1>Axe API</span><!--[--><!--]--></a></div></div><div class="content" data-v-6aa21345><div class="content-body" data-v-6aa21345><!--[--><!--]--><div class="VPNavBarSearch search" data-v-6aa21345><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-6aa21345 data-v-dc692963><span id="main-nav-aria-label" class="visually-hidden" data-v-dc692963> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/learn/quick-start.html" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>Learn</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/reference/api-configs.html" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>API Reference</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/blog/index.html" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>Blog</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-dc692963 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-b6c34ac9><span class="text" data-v-b6c34ac9><!----><span data-v-b6c34ac9>Upgrading</span><span class="vpi-chevron-down text-icon" data-v-b6c34ac9></span></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><div class="items" data-v-b98bc113><!--[--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/upgrading/versioning-policy.html" data-v-43f1e123><!--[-->Versioning Policy<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/upgrading/v1.html" data-v-43f1e123><!--[-->v1 (stable)<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/upgrading/0.30.0.html" data-v-43f1e123><!--[-->v0.30<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/upgrading/0.20.0.html" data-v-43f1e123><!--[-->v0.20<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://github.com/axe-api/axe-api/releases" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Releases<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://github.com/axe-api/axe-api/blob/master/CHANGELOG.md" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Changelog<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-dc692963 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-b6c34ac9><span class="text" data-v-b6c34ac9><!----><span data-v-b6c34ac9>Ecosystem</span><span class="vpi-chevron-down text-icon" data-v-b6c34ac9></span></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><div class="items" data-v-b98bc113><!--[--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/ecosystem/support.html" data-v-43f1e123><!--[-->Support<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/ecosystem/faq.html" data-v-43f1e123><!--[-->FAQ<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/ecosystem/team.html" data-v-43f1e123><!--[-->Team<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://github.com/axe-api/axe-magic" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->CLI<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://sonarcloud.io/dashboard?id=axe-api_axe-api" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->SonarCloud<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-dc692963 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-b6c34ac9><span class="text" data-v-b6c34ac9><!----><span data-v-b6c34ac9>v1</span><span class="vpi-chevron-down text-icon" data-v-b6c34ac9></span></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><div class="items" data-v-b98bc113><!--[--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://axe-api.com" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->v1 (stable)<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://legacy.axe-api.com" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->v0.30<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://github.com/axe-api/axe-api" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>GitHub</span><!--]--></a><!--]--><!--]--></nav><!----><!----><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-6aa21345 data-v-0394ad82 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/axe-api/axe-api" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><a class="VPSocialLink no-icon" href="https://twitter.com/axeapi" aria-label="twitter" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-twitter" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-6aa21345 data-v-bb2aa2f0 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-b6c34ac9><span class="vpi-more-horizontal icon" data-v-b6c34ac9></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><!----><!--[--><!--[--><!----><!----><div class="group" data-v-bb2aa2f0><div class="item social-links" data-v-bb2aa2f0><div class="VPSocialLinks social-links-list" data-v-bb2aa2f0 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/axe-api/axe-api" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><a class="VPSocialLink no-icon" href="https://twitter.com/axeapi" aria-label="twitter" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-twitter" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-6aa21345 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-6aa21345><div class="divider-line" data-v-6aa21345></div></div></div><!----></header><div class="VPLocalNav empty fixed" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><!----><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-17a5e62e><button data-v-17a5e62e>Return to top</button><!----></div></div></div><!----><div class="VPContent" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>On this page</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _blog_2024-11-19-axe-api-v1-5-is-out" data-v-39a288b8><div><h1 id="axe-api-v1-5-is-out" tabindex="-1">Axe API v1.5 is out! <a class="header-anchor" href="#axe-api-v1-5-is-out" aria-label="Permalink to "Axe API v1.5 is out!""></a></h1><p><code>v1.5</code> comes with one feature and a security upgrades.</p><p>Let's discover it more!</p><h2 id="createratelimitmiddleware" tabindex="-1"><code>createRateLimitMiddleware()</code> <a class="header-anchor" href="#createratelimitmiddleware" aria-label="Permalink to "`createRateLimitMiddleware()`""></a></h2><p>A new function has been added to the Axe API; <code>createRateLimitMiddleware</code>.</p><p>You can define a custom rate-limit middleware as the following definition:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { createRateLimitMiddleware } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "axe-api"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> myRateLimitter</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">req</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IncomingMessage</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">res</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ServerResponse</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">next</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> any</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> createRateLimitMiddleware</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(req, res, next, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"user-identifier"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> maxRequests: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> windowInSeconds: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">10</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onBeforeInit</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> async</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">app</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> App</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> app.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">use</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(myRateLimitter);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><h2 id="disabling-x-powered-by-response-header" tabindex="-1">Disabling <code>x-powered-by</code> response header <a class="header-anchor" href="#disabling-x-powered-by-response-header" aria-label="Permalink to "Disabling `x-powered-by` response header""></a></h2><p>A new configuration parameter has been added. Now, you can disable <code>x-powered-by</code> header by using <code>disableXPoweredByHeader</code> value.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IApplicationConfig</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ...</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> disableXPoweredByHeader: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ...</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><h2 id="custom-relationship-query-hooks" tabindex="-1">Custom relationship query hooks <a class="header-anchor" href="#custom-relationship-query-hooks" aria-label="Permalink to "Custom relationship query hooks""></a></h2><p>You can define a <code>onBeforeQuery</code> hook for <code>hasMany</code> relationship definitions. By using that function, you can limit, or add more conditions as we wish.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onBeforeViewQuery</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> async</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">req</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> AxeRequest</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">query</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Knex</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">QueryBuilder</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> query.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">orderBy</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"desc"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Model</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> views</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> this</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">hasMany</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"PostView"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"post_id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> onBeforeQuery: onBeforeViewQuery,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="missing-hooks-events-on-patching" tabindex="-1">Missing hooks/events on patching <a class="header-anchor" href="#missing-hooks-events-on-patching" aria-label="Permalink to "Missing hooks/events on patching""></a></h2><p><code>PATCH</code> hooks and events weren't working as expected. They were using the wrong hooks/events functions.</p><p>The following hooks/events definitions are added:</p><ul><li><code>onBeforePatchQuery</code></li><li><code>onBeforePatch</code></li><li><code>onAfterPatchQuery</code></li><li><code>onAfterPatch</code></li></ul><h2 id="hostname-configuration" tabindex="-1"><code>hostname</code> configuration <a class="header-anchor" href="#hostname-configuration" aria-label="Permalink to "`hostname` configuration""></a></h2><p>A new configuration parameter has been added. Now, you can set the hostname value of the server:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IApplicationConfig</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ...</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> hostname: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"127.0.0.1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ...</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><h2 id="bug-fixes" tabindex="-1">Bug fixes <a class="header-anchor" href="#bug-fixes" aria-label="Permalink to "Bug fixes""></a></h2><p>The follwing bugs have been fixed:</p><ul><li>Fixed performance issues on related-data queries. <a href="https://github.com/axe-api/axe-api/issues/585" target="_blank" rel="noreferrer">#585</a></li><li>Fixed query limit issue <a href="https://github.com/axe-api/axe-api/issues/587" target="_blank" rel="noreferrer">#587</a></li><li>Fixed model serialization function doesn't work on ALL handlers issue. <a href="https://github.com/axe-api/axe-api/issues/588" target="_blank" rel="noreferrer">#588</a></li></ul></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><div class="edit-link" data-v-e257564d><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/axe-api/docs/edit/master/docs/blog/2024-11-19-axe-api-v1-5-is-out.md" target="_blank" rel="noreferrer" data-v-e257564d><!--[--><span class="vpi-square-pen edit-link-icon" data-v-e257564d></span> Edit this page on GitHub<!--]--></a></div><!----></div><!----></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2020-present</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"404.md\":\"DBrGGMqk\",\"blog_2021-07-27-a-new-approach-to-create-apis.md\":\"DHGX6jRU\",\"blog_2021-09-21-how-to-create-an-axe-api-from-scratch.md\":\"f87ALr3w\",\"blog_2023-12-24-axe-api-v1-is-out.md\":\"B460WYJa\",\"blog_2024-02-18-axe-api-v1-is-out.md\":\"Cmwf-oK-\",\"blog_2024-03-16-axe-api-v1-2-is-out.md\":\"sszNXTmV\",\"blog_2024-04-08-axe-api-v1-3-is-out.md\":\"CEKwEj-l\",\"blog_2024-04-21-axe-api-v1-4-is-out.md\":\"DNeUkEAg\",\"blog_2024-11-19-axe-api-v1-5-is-out.md\":\"lgXQpL7t\",\"blog_2025-01-02-axe-api-v1-6-is-out.md\":\"qF98Z6Fu\",\"blog_index.md\":\"B5BNfFG8\",\"ecosystem_faq.md\":\"COwcsvf0\",\"ecosystem_support.md\":\"Dl700XA0\",\"ecosystem_team.md\":\"BoUdgyXD\",\"errors.md\":\"BMFOxdHK\",\"index.md\":\"Bulr5Qr2\",\"learn_application-logic.md\":\"c05FdG3O\",\"learn_authentication.md\":\"tWCuz3di\",\"learn_bookstore-api.md\":\"CnHpY6n5\",\"learn_caching.md\":\"B2JFVRw0\",\"learn_configurations.md\":\"d9ia1dnU\",\"learn_contribution-tests.md\":\"BomXrVSf\",\"learn_contribution.md\":\"D8r__2zG\",\"learn_database-migrations.md\":\"C2fPzORZ\",\"learn_database-transactions.md\":\"Box8bLLF\",\"learn_db-analyzer.md\":\"Cw3-H0Lq\",\"learn_deployment.md\":\"B1iANop2\",\"learn_dev-kit-databases.md\":\"BIUyeF__\",\"learn_development-kit.md\":\"DtyImxs-\",\"learn_documentation.md\":\"uBl7QFvh\",\"learn_error-handling.md\":\"DjBw5-ol\",\"learn_file-uploading.md\":\"D5c2yV6Y\",\"learn_full-text-search.md\":\"DUdRn8p1\",\"learn_hooks-and-events.md\":\"DnXj0uRJ\",\"learn_i18n.md\":\"Y6ThEGM-\",\"learn_javascript-client-axe-api-client.md\":\"DIkUKxCX\",\"learn_middlewares.md\":\"xZKSCgPe\",\"learn_models.md\":\"CcyHn3IU\",\"learn_querying-data.md\":\"DKWtqhct\",\"learn_quick-start.md\":\"33PkmWIv\",\"learn_rate-limiting.md\":\"DJ4dkoNZ\",\"learn_related-data-queries.md\":\"BVncZ4ok\",\"learn_request-response-cycle.md\":\"YUDG_cdJ\",\"learn_routing.md\":\"B5_A7PCm\",\"learn_serializers.md\":\"CKFnqA9N\",\"learn_serving-static-files.md\":\"DzzQ2GqP\",\"learn_testing.md\":\"D4JNTbP8\",\"learn_validations.md\":\"BboK8d9e\",\"learn_version-management.md\":\"8LhAokZa\",\"privacy-policy.md\":\"D35U8GW9\",\"reference_api-configs.md\":\"B0WlTg4j\",\"reference_api-error.md\":\"Cy0_oaRR\",\"reference_app.md\":\"CBJRoLgI\",\"reference_axe-request.md\":\"EslJLAZ2\",\"reference_axe-response.md\":\"vVrJqda4\",\"reference_cache-configs.md\":\"KCPzVBW8\",\"reference_client-add-request.md\":\"D4iSx8J-\",\"reference_client-add-response.md\":\"CeNnk5gB\",\"reference_client-and-where.md\":\"ctKBm2xj\",\"reference_client-delete.md\":\"DU3menQe\",\"reference_client-first.md\":\"BgPt_Zl7\",\"reference_client-insert.md\":\"CoVbCsFs\",\"reference_client-or-where.md\":\"DPYCdyMG\",\"reference_client-paginate.md\":\"B7EadYVR\",\"reference_client-patch.md\":\"D4ROkvkR\",\"reference_client-resource.md\":\"guZ_kDze\",\"reference_client-set-config.md\":\"qjfnpmva\",\"reference_client-update.md\":\"D7Ue-_aY\",\"reference_client-where-between.md\":\"D2enRHzZ\",\"reference_client-where-in.md\":\"pob8s2Eg\",\"reference_client-where-like.md\":\"BvGWhO_N\",\"reference_client-where-null.md\":\"B_AD4swH\",\"reference_client-where.md\":\"CYsPWVLt\",\"reference_client-with.md\":\"B1Prn_7z\",\"reference_database-configs.md\":\"BAusUCdf\",\"reference_default-handlers.md\":\"cEKyX6Tc\",\"reference_elastic-search-configs.md\":\"DDpas-0v\",\"reference_error-codes.md\":\"D4NGNe71\",\"reference_handlers-all-handler.md\":\"BGD-tX2S\",\"reference_handlers-delete-handler.md\":\"OH8C8uTx\",\"reference_handlers-force-delete-handler.md\":\"DYycZ7-C\",\"reference_handlers-insert-handler.md\":\"C9BfCDX9\",\"reference_handlers-paginate-handler.md\":\"DtvSX-1n\",\"reference_handlers-patch-handler.md\":\"BuIqpP2H\",\"reference_handlers-search-handler.md\":\"BZKFDEfs\",\"reference_handlers-show-handler.md\":\"C3AR1ylO\",\"reference_handlers-update-handler.md\":\"BLQ_5tVJ\",\"reference_hooks-events-on-after-all.md\":\"CzaNgeTf\",\"reference_hooks-events-on-after-delete-query.md\":\"Cc55V1UM\",\"reference_hooks-events-on-after-delete.md\":\"CgEHIPlP\",\"reference_hooks-events-on-after-force-delete-query.md\":\"BzI6_GQQ\",\"reference_hooks-events-on-after-force-delete.md\":\"D51Ejfh1\",\"reference_hooks-events-on-after-insert.md\":\"j7FDwev5\",\"reference_hooks-events-on-after-paginate.md\":\"BxOSJD6M\",\"reference_hooks-events-on-after-patch-query.md\":\"CfqB6yJn\",\"reference_hooks-events-on-after-patch.md\":\"vnmKKVW6\",\"reference_hooks-events-on-after-search.md\":\"BS7qUNF9\",\"reference_hooks-events-on-after-show.md\":\"DO5sq-n7\",\"reference_hooks-events-on-after-update-query.md\":\"twQ5cUg4\",\"reference_hooks-events-on-after-update.md\":\"cNmIV1mo\",\"reference_hooks-events-on-before-all.md\":\"DWpL9YwP\",\"reference_hooks-events-on-before-delete-query.md\":\"1ugu4HMC\",\"reference_hooks-events-on-before-delete.md\":\"DpiKI3kd\",\"reference_hooks-events-on-before-force-delete-query.md\":\"CICDnuNS\",\"reference_hooks-events-on-before-force-delete.md\":\"Cu5k60Nh\",\"reference_hooks-events-on-before-insert.md\":\"DRPRQg1Z\",\"reference_hooks-events-on-before-paginate.md\":\"0F9Z1UYt\",\"reference_hooks-events-on-before-patch-query.md\":\"DVdcXbsb\",\"reference_hooks-events-on-before-patch.md\":\"DtS74Rn9\",\"reference_hooks-events-on-before-search.md\":\"zqbgRn3C\",\"reference_hooks-events-on-before-show.md\":\"DWcc409t\",\"reference_hooks-events-on-before-update-query.md\":\"C0wu0xIs\",\"reference_hooks-events-on-before-update.md\":\"D5ya7IGu\",\"reference_icontext.md\":\"C5LQOFZH\",\"reference_ioc.md\":\"B-boVLXn\",\"reference_model-cache.md\":\"CUC1Tgra\",\"reference_model-created-at-column.md\":\"D4fCTqkL\",\"reference_model-deleted-at-column.md\":\"DkRiQYs3\",\"reference_model-fillable.md\":\"kqrAJ_Rd\",\"reference_model-get-search-query.md\":\"QBJHEhMI\",\"reference_model-handlers.md\":\"BFSKQoFE\",\"reference_model-hiddens.md\":\"DVa6rV3h\",\"reference_model-ignore.md\":\"BGWSUTA9\",\"reference_model-limits.md\":\"DFfwwDuT\",\"reference_model-middlewares.md\":\"CLkDqhNA\",\"reference_model-primary-key.md\":\"CfEHO3ZO\",\"reference_model-search.md\":\"CjCtSrWR\",\"reference_model-table.md\":\"q-LAoqc0\",\"reference_model-transactions.md\":\"B3JxuTUi\",\"reference_model-updated-at-column.md\":\"DQTbejMm\",\"reference_model-validations.md\":\"U5eBUtQr\",\"reference_on-after-init.md\":\"BrWVKyny\",\"reference_on-before-init.md\":\"9p0nX5iv\",\"reference_pino-logger-configs.md\":\"DZg9Hcze\",\"reference_queries-fields.md\":\"BsrqI7OP\",\"reference_queries-page.md\":\"B8scHBrO\",\"reference_queries-per-page.md\":\"Bv6-VcZ2\",\"reference_queries-q.md\":\"Bw4tPu4f\",\"reference_queries-sort.md\":\"DdCLcVa_\",\"reference_queries-trashed.md\":\"DoYREmF6\",\"reference_queries-with.md\":\"0o6B0qh9\",\"reference_rate-limit-configs.md\":\"DdaVtdvW\",\"reference_redis-configs.md\":\"CUa65_nq\",\"reference_search-configs.md\":\"DJG8tIJH\",\"reference_version-configs.md\":\"CaFCFBNW\",\"rest-api.md\":\"DJWe4JfP\",\"upgrading_0.20.0.md\":\"CiwYK56w\",\"upgrading_0.30.0.md\":\"DIz8XJiq\",\"upgrading_v1.md\":\"BtHOX7TT\",\"upgrading_versioning-policy.md\":\"BjG5V7hV\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Axe API\",\"description\":\"The fastest way to create Rest API, by defining database models and relations.\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":\"force-dark\",\"themeConfig\":{\"logo\":\"/axe.png\",\"editLink\":{\"pattern\":\"https://github.com/axe-api/docs/edit/master/docs/:path\",\"text\":\"Edit this page on GitHub\"},\"nav\":[{\"text\":\"Learn\",\"link\":\"/learn/quick-start\"},{\"text\":\"API Reference\",\"link\":\"/reference/api-configs\"},{\"text\":\"Blog\",\"link\":\"/blog/index\"},{\"text\":\"Upgrading\",\"items\":[{\"text\":\"Versioning Policy\",\"link\":\"/upgrading/versioning-policy\"},{\"text\":\"v1 (stable)\",\"link\":\"/upgrading/v1\"},{\"text\":\"v0.30\",\"link\":\"/upgrading/0.30.0.html\"},{\"text\":\"v0.20\",\"link\":\"/upgrading/0.20.0.html\"},{\"text\":\"Releases\",\"link\":\"https://github.com/axe-api/axe-api/releases\"},{\"text\":\"Changelog\",\"link\":\"https://github.com/axe-api/axe-api/blob/master/CHANGELOG.md\"}]},{\"text\":\"Ecosystem\",\"items\":[{\"text\":\"Support\",\"link\":\"/ecosystem/support\"},{\"text\":\"FAQ\",\"link\":\"/ecosystem/faq\"},{\"text\":\"Team\",\"link\":\"/ecosystem/team\"},{\"text\":\"CLI\",\"link\":\"https://github.com/axe-api/axe-magic\"},{\"text\":\"SonarCloud\",\"link\":\"https://sonarcloud.io/dashboard?id=axe-api_axe-api\"}]},{\"text\":\"v1\",\"items\":[{\"text\":\"v1 (stable)\",\"link\":\"https://axe-api.com\"},{\"text\":\"v0.30\",\"link\":\"https://legacy.axe-api.com\"}]},{\"text\":\"GitHub\",\"link\":\"https://github.com/axe-api/axe-api\"}],\"sidebar\":{\"/learn/\":[{\"text\":\"Getting Started\",\"collapsed\":false,\"items\":[{\"text\":\"Quick start\",\"link\":\"/learn/quick-start\"},{\"text\":\"Tutorial: Bookstore API\",\"link\":\"/learn/bookstore-api\"}]},{\"text\":\"Fundamentals\",\"collapsed\":true,\"items\":[{\"text\":\"What does a Model mean?\",\"link\":\"/learn/models\"},{\"text\":\"Understanding the routing\",\"link\":\"/learn/routing\"},{\"text\":\"Version management\",\"link\":\"/learn/version-management\"},{\"text\":\"Validate your data\",\"link\":\"/learn/validations\"}]},{\"text\":\"Gains\",\"collapsed\":true,\"items\":[{\"text\":\"Auto-created documentation\",\"link\":\"/learn/documentation\"},{\"text\":\"Querying data\",\"link\":\"/learn/querying-data\"},{\"text\":\"Related data queries\",\"link\":\"/learn/related-data-queries\"},{\"text\":\"Auto-caching\",\"link\":\"/learn/caching\"},{\"text\":\"Full-text search\",\"link\":\"/learn/full-text-search\"},{\"text\":\"JavaScript Client\",\"link\":\"/learn/javascript-client-axe-api-client\"},{\"text\":\"How DB Analyzer works?\",\"link\":\"/learn/db-analyzer\"}]},{\"text\":\"Application Logic\",\"collapsed\":true,\"items\":[{\"text\":\"Getting started\",\"link\":\"/learn/application-logic\"},{\"text\":\"Request-Response cycle\",\"link\":\"/learn/request-response-cycle\"},{\"text\":\"Middlewares\",\"link\":\"/learn/middlewares\"},{\"text\":\"Hooks & Events\",\"link\":\"/learn/hooks-and-events\"},{\"text\":\"Serializers\",\"link\":\"/learn/serializers\"}]},{\"text\":\"Advanced\",\"collapsed\":true,\"items\":[{\"text\":\"Configurations\",\"link\":\"/learn/configurations\"},{\"text\":\"Internationalization\",\"link\":\"/learn/i18n\"},{\"text\":\"Error handling\",\"link\":\"/learn/error-handling\"},{\"text\":\"Database transactions\",\"link\":\"/learn/database-transactions\"}]},{\"text\":\"How to?\",\"collapsed\":true,\"items\":[{\"text\":\"Migrate database\",\"link\":\"/learn/database-migrations\"},{\"text\":\"File uploading\",\"link\":\"/learn/file-uploading\"},{\"text\":\"Serving static files\",\"link\":\"/learn/serving-static-files\"},{\"text\":\"Authentication\",\"link\":\"/learn/authentication\"},{\"text\":\"Rate limiting\",\"link\":\"/learn/rate-limiting\"},{\"text\":\"Testing\",\"link\":\"/learn/testing\"},{\"text\":\"Deployment\",\"link\":\"/learn/deployment\"}]},{\"text\":\"Contribution\",\"collapsed\":true,\"items\":[{\"text\":\"Preparation\",\"link\":\"/learn/contribution\"},{\"text\":\"Development Kit\",\"link\":\"/learn/development-kit\"},{\"text\":\"Databases\",\"link\":\"/learn/dev-kit-databases\"},{\"text\":\"Tests\",\"link\":\"/learn/contribution-tests\"}]}],\"/reference/\":[{\"text\":\"Configs\",\"collapsed\":false,\"items\":[{\"text\":\"API configs\",\"link\":\"/reference/api-configs\"},{\"text\":\"Pino (logger) configs\",\"link\":\"/reference/pino-logger-configs\"},{\"text\":\"Rate limit configs\",\"link\":\"/reference/rate-limit-configs\"},{\"text\":\"Database configs\",\"link\":\"/reference/database-configs\"},{\"text\":\"Cache configs\",\"link\":\"/reference/cache-configs\"},{\"text\":\"Redis configs\",\"link\":\"/reference/redis-configs\"},{\"text\":\"Elasticsearch configs\",\"link\":\"/reference/elastic-search-configs\"},{\"text\":\"Search configs\",\"link\":\"/reference/search-configs\"},{\"text\":\"Version configs\",\"link\":\"/reference/version-configs\"}]},{\"text\":\"Initialization\",\"collapsed\":true,\"items\":[{\"text\":\"onBeforeInit()\",\"link\":\"/reference/on-before-init\"},{\"text\":\"onAfterInit()\",\"link\":\"/reference/on-after-init\"}]},{\"text\":\"Axe API\",\"collapsed\":true,\"items\":[{\"text\":\"App\",\"link\":\"/reference/app\"},{\"text\":\"IContext\",\"link\":\"/reference/icontext\"},{\"text\":\"AxeRequest\",\"link\":\"/reference/axe-request\"},{\"text\":\"AxeResponse\",\"link\":\"/reference/axe-response\"},{\"text\":\"IoC\",\"link\":\"/reference/ioc\"},{\"text\":\"ApiError\",\"link\":\"/reference/api-error\"},{\"text\":\"Error Codes\",\"link\":\"/errors\"}]},{\"text\":\"Models\",\"collapsed\":true,\"items\":[{\"text\":\"table()\",\"link\":\"/reference/model-table\"},{\"text\":\"primaryKey()\",\"link\":\"/reference/model-primary-key\"},{\"text\":\"fillable()\",\"link\":\"/reference/model-fillable\"},{\"text\":\"validations()\",\"link\":\"/reference/model-validations\"},{\"text\":\"hiddens()\",\"link\":\"/reference/model-hiddens\"},{\"text\":\"createdAtColumn()\",\"link\":\"/reference/model-created-at-column\"},{\"text\":\"updatedAtColumn()\",\"link\":\"/reference/model-updated-at-column\"},{\"text\":\"deletedAtColumn()\",\"link\":\"/reference/model-deleted-at-column\"},{\"text\":\"handlers()\",\"link\":\"/reference/model-handlers\"},{\"text\":\"middlewares()\",\"link\":\"/reference/model-middlewares\"},{\"text\":\"transactions()\",\"link\":\"/reference/model-transactions\"},{\"text\":\"limits()\",\"link\":\"/reference/model-limits\"},{\"text\":\"cache()\",\"link\":\"/reference/model-cache\"},{\"text\":\"search()\",\"link\":\"/reference/model-search\"},{\"text\":\"getSearchQuery()\",\"link\":\"/reference/model-get-search-query\"},{\"text\":\"ignore()\",\"link\":\"/reference/model-ignore\"}]},{\"text\":\"Handlers\",\"collapsed\":true,\"items\":[{\"text\":\"Defaults\",\"link\":\"/reference/default-handlers\"},{\"text\":\"INSERT\",\"link\":\"/reference/handlers-insert-handler\"},{\"text\":\"PAGINATE\",\"link\":\"/reference/handlers-paginate-handler\"},{\"text\":\"SHOW\",\"link\":\"/reference/handlers-show-handler\"},{\"text\":\"UPDATE\",\"link\":\"/reference/handlers-update-handler\"},{\"text\":\"DELETE\",\"link\":\"/reference/handlers-delete-handler\"},{\"text\":\"FORCE_DELETE\",\"link\":\"/reference/handlers-force-delete-handler\"},{\"text\":\"PATCH\",\"link\":\"/reference/handlers-patch-handler\"},{\"text\":\"ALL\",\"link\":\"/reference/handlers-all-handler\"},{\"text\":\"SEARCH\",\"link\":\"/reference/handlers-search-handler\"}]},{\"text\":\"Queries\",\"collapsed\":true,\"items\":[{\"text\":\"fields\",\"link\":\"/reference/queries-fields\"},{\"text\":\"sort\",\"link\":\"/reference/queries-sort\"},{\"text\":\"page\",\"link\":\"/reference/queries-page\"},{\"text\":\"per_page\",\"link\":\"/reference/queries-per-page\"},{\"text\":\"trashed\",\"link\":\"/reference/queries-trashed\"},{\"text\":\"q\",\"link\":\"/reference/queries-q\"},{\"text\":\"with\",\"link\":\"/reference/queries-with\"}]},{\"text\":\"Hooks & Events\",\"collapsed\":true,\"items\":[{\"text\":\"onBeforeInsert()\",\"link\":\"/reference/hooks-events-on-before-insert\"},{\"text\":\"onBeforeUpdateQuery()\",\"link\":\"/reference/hooks-events-on-before-update-query\"},{\"text\":\"onBeforeUpdate()\",\"link\":\"/reference/hooks-events-on-before-update\"},{\"text\":\"onBeforePatchQuery()\",\"link\":\"/reference/hooks-events-on-before-patch-query\"},{\"text\":\"onBeforePatch()\",\"link\":\"/reference/hooks-events-on-before-patch\"},{\"text\":\"onBeforeDeleteQuery()\",\"link\":\"/reference/hooks-events-on-before-delete-query\"},{\"text\":\"onBeforeDelete()\",\"link\":\"/reference/hooks-events-on-before-delete\"},{\"text\":\"onBeforeForceDeleteQuery()\",\"link\":\"/reference/hooks-events-on-before-force-delete-query\"},{\"text\":\"onBeforeForceDelete()\",\"link\":\"/reference/hooks-events-on-before-force-delete\"},{\"text\":\"onBeforePaginate()\",\"link\":\"/reference/hooks-events-on-before-paginate\"},{\"text\":\"onBeforeAll()\",\"link\":\"/reference/hooks-events-on-before-all\"},{\"text\":\"onBeforeSearch()\",\"link\":\"/reference/hooks-events-on-before-search\"},{\"text\":\"onBeforeShow()\",\"link\":\"/reference/hooks-events-on-before-show\"},{\"text\":\"onAfterInsert()\",\"link\":\"/reference/hooks-events-on-after-insert\"},{\"text\":\"onAfterUpdateQuery()\",\"link\":\"/reference/hooks-events-on-after-update-query\"},{\"text\":\"onAfterUpdate()\",\"link\":\"/reference/hooks-events-on-after-update\"},{\"text\":\"onAfterPatchQuery()\",\"link\":\"/reference/hooks-events-on-after-patch-query\"},{\"text\":\"onAfterPatch()\",\"link\":\"/reference/hooks-events-on-after-patch\"},{\"text\":\"onAfterDeleteQuery()\",\"link\":\"/reference/hooks-events-on-after-delete-query\"},{\"text\":\"onAfterDelete()\",\"link\":\"/reference/hooks-events-on-after-delete\"},{\"text\":\"onAfterForceDeleteQuery()\",\"link\":\"/reference/hooks-events-on-after-force-delete-query\"},{\"text\":\"onAfterForceDelete()\",\"link\":\"/reference/hooks-events-on-after-force-delete\"},{\"text\":\"onAfterPaginate()\",\"link\":\"/reference/hooks-events-on-after-paginate\"},{\"text\":\"onAfterAll()\",\"link\":\"/reference/hooks-events-on-after-all\"},{\"text\":\"onAfterSearch()\",\"link\":\"/reference/hooks-events-on-after-search\"},{\"text\":\"onAfterShow()\",\"link\":\"/reference/hooks-events-on-after-show\"}]},{\"text\":\"Axe API Client\",\"collapsed\":true,\"items\":[{\"text\":\"setConfig()\",\"link\":\"/reference/client-set-config\"},{\"text\":\"addRequest()\",\"link\":\"/reference/client-add-request\"},{\"text\":\"addResponse()\",\"link\":\"/reference/client-add-response\"},{\"text\":\"first()\",\"link\":\"/reference/client-first\"},{\"text\":\"resource()\",\"link\":\"/reference/client-resource\"},{\"text\":\"insert()\",\"link\":\"/reference/client-insert\"},{\"text\":\"update()\",\"link\":\"/reference/client-update\"},{\"text\":\"patch()\",\"link\":\"/reference/client-patch\"},{\"text\":\"delete()\",\"link\":\"/reference/client-delete\"},{\"text\":\"paginate()\",\"link\":\"/reference/client-paginate\"},{\"text\":\"with()\",\"link\":\"/reference/client-with\"},{\"text\":\"where()\",\"link\":\"/reference/client-where\"},{\"text\":\"orWhere()\",\"link\":\"/reference/client-or-where\"},{\"text\":\"andWhere()\",\"link\":\"/reference/client-and-where\"},{\"text\":\"whereLike()\",\"link\":\"/reference/client-where-like\"},{\"text\":\"whereIn()\",\"link\":\"/reference/client-where-in\"},{\"text\":\"whereBetween()\",\"link\":\"/reference/client-where-between\"},{\"text\":\"whereNull()\",\"link\":\"/reference/client-where-null\"}]}],\"/errors\":[{\"text\":\"Configs\",\"collapsed\":false,\"items\":[{\"text\":\"API configs\",\"link\":\"/reference/api-configs\"},{\"text\":\"Pino (logger) configs\",\"link\":\"/reference/pino-logger-configs\"},{\"text\":\"Rate limit configs\",\"link\":\"/reference/rate-limit-configs\"},{\"text\":\"Database configs\",\"link\":\"/reference/database-configs\"},{\"text\":\"Cache configs\",\"link\":\"/reference/cache-configs\"},{\"text\":\"Redis configs\",\"link\":\"/reference/redis-configs\"},{\"text\":\"Elasticsearch configs\",\"link\":\"/reference/elastic-search-configs\"},{\"text\":\"Search configs\",\"link\":\"/reference/search-configs\"},{\"text\":\"Version configs\",\"link\":\"/reference/version-configs\"}]},{\"text\":\"Initialization\",\"collapsed\":true,\"items\":[{\"text\":\"onBeforeInit()\",\"link\":\"/reference/on-before-init\"},{\"text\":\"onAfterInit()\",\"link\":\"/reference/on-after-init\"}]},{\"text\":\"Axe API\",\"collapsed\":true,\"items\":[{\"text\":\"App\",\"link\":\"/reference/app\"},{\"text\":\"IContext\",\"link\":\"/reference/icontext\"},{\"text\":\"AxeRequest\",\"link\":\"/reference/axe-request\"},{\"text\":\"AxeResponse\",\"link\":\"/reference/axe-response\"},{\"text\":\"IoC\",\"link\":\"/reference/ioc\"},{\"text\":\"ApiError\",\"link\":\"/reference/api-error\"},{\"text\":\"Error Codes\",\"link\":\"/errors\"}]},{\"text\":\"Models\",\"collapsed\":true,\"items\":[{\"text\":\"table()\",\"link\":\"/reference/model-table\"},{\"text\":\"primaryKey()\",\"link\":\"/reference/model-primary-key\"},{\"text\":\"fillable()\",\"link\":\"/reference/model-fillable\"},{\"text\":\"validations()\",\"link\":\"/reference/model-validations\"},{\"text\":\"hiddens()\",\"link\":\"/reference/model-hiddens\"},{\"text\":\"createdAtColumn()\",\"link\":\"/reference/model-created-at-column\"},{\"text\":\"updatedAtColumn()\",\"link\":\"/reference/model-updated-at-column\"},{\"text\":\"deletedAtColumn()\",\"link\":\"/reference/model-deleted-at-column\"},{\"text\":\"handlers()\",\"link\":\"/reference/model-handlers\"},{\"text\":\"middlewares()\",\"link\":\"/reference/model-middlewares\"},{\"text\":\"transactions()\",\"link\":\"/reference/model-transactions\"},{\"text\":\"limits()\",\"link\":\"/reference/model-limits\"},{\"text\":\"cache()\",\"link\":\"/reference/model-cache\"},{\"text\":\"search()\",\"link\":\"/reference/model-search\"},{\"text\":\"getSearchQuery()\",\"link\":\"/reference/model-get-search-query\"},{\"text\":\"ignore()\",\"link\":\"/reference/model-ignore\"}]},{\"text\":\"Handlers\",\"collapsed\":true,\"items\":[{\"text\":\"Defaults\",\"link\":\"/reference/default-handlers\"},{\"text\":\"INSERT\",\"link\":\"/reference/handlers-insert-handler\"},{\"text\":\"PAGINATE\",\"link\":\"/reference/handlers-paginate-handler\"},{\"text\":\"SHOW\",\"link\":\"/reference/handlers-show-handler\"},{\"text\":\"UPDATE\",\"link\":\"/reference/handlers-update-handler\"},{\"text\":\"DELETE\",\"link\":\"/reference/handlers-delete-handler\"},{\"text\":\"FORCE_DELETE\",\"link\":\"/reference/handlers-force-delete-handler\"},{\"text\":\"PATCH\",\"link\":\"/reference/handlers-patch-handler\"},{\"text\":\"ALL\",\"link\":\"/reference/handlers-all-handler\"},{\"text\":\"SEARCH\",\"link\":\"/reference/handlers-search-handler\"}]},{\"text\":\"Queries\",\"collapsed\":true,\"items\":[{\"text\":\"fields\",\"link\":\"/reference/queries-fields\"},{\"text\":\"sort\",\"link\":\"/reference/queries-sort\"},{\"text\":\"page\",\"link\":\"/reference/queries-page\"},{\"text\":\"per_page\",\"link\":\"/reference/queries-per-page\"},{\"text\":\"trashed\",\"link\":\"/reference/queries-trashed\"},{\"text\":\"q\",\"link\":\"/reference/queries-q\"},{\"text\":\"with\",\"link\":\"/reference/queries-with\"}]},{\"text\":\"Hooks & Events\",\"collapsed\":true,\"items\":[{\"text\":\"onBeforeInsert()\",\"link\":\"/reference/hooks-events-on-before-insert\"},{\"text\":\"onBeforeUpdateQuery()\",\"link\":\"/reference/hooks-events-on-before-update-query\"},{\"text\":\"onBeforeUpdate()\",\"link\":\"/reference/hooks-events-on-before-update\"},{\"text\":\"onBeforePatchQuery()\",\"link\":\"/reference/hooks-events-on-before-patch-query\"},{\"text\":\"onBeforePatch()\",\"link\":\"/reference/hooks-events-on-before-patch\"},{\"text\":\"onBeforeDeleteQuery()\",\"link\":\"/reference/hooks-events-on-before-delete-query\"},{\"text\":\"onBeforeDelete()\",\"link\":\"/reference/hooks-events-on-before-delete\"},{\"text\":\"onBeforeForceDeleteQuery()\",\"link\":\"/reference/hooks-events-on-before-force-delete-query\"},{\"text\":\"onBeforeForceDelete()\",\"link\":\"/reference/hooks-events-on-before-force-delete\"},{\"text\":\"onBeforePaginate()\",\"link\":\"/reference/hooks-events-on-before-paginate\"},{\"text\":\"onBeforeAll()\",\"link\":\"/reference/hooks-events-on-before-all\"},{\"text\":\"onBeforeSearch()\",\"link\":\"/reference/hooks-events-on-before-search\"},{\"text\":\"onBeforeShow()\",\"link\":\"/reference/hooks-events-on-before-show\"},{\"text\":\"onAfterInsert()\",\"link\":\"/reference/hooks-events-on-after-insert\"},{\"text\":\"onAfterUpdateQuery()\",\"link\":\"/reference/hooks-events-on-after-update-query\"},{\"text\":\"onAfterUpdate()\",\"link\":\"/reference/hooks-events-on-after-update\"},{\"text\":\"onAfterPatchQuery()\",\"link\":\"/reference/hooks-events-on-after-patch-query\"},{\"text\":\"onAfterPatch()\",\"link\":\"/reference/hooks-events-on-after-patch\"},{\"text\":\"onAfterDeleteQuery()\",\"link\":\"/reference/hooks-events-on-after-delete-query\"},{\"text\":\"onAfterDelete()\",\"link\":\"/reference/hooks-events-on-after-delete\"},{\"text\":\"onAfterForceDeleteQuery()\",\"link\":\"/reference/hooks-events-on-after-force-delete-query\"},{\"text\":\"onAfterForceDelete()\",\"link\":\"/reference/hooks-events-on-after-force-delete\"},{\"text\":\"onAfterPaginate()\",\"link\":\"/reference/hooks-events-on-after-paginate\"},{\"text\":\"onAfterAll()\",\"link\":\"/reference/hooks-events-on-after-all\"},{\"text\":\"onAfterSearch()\",\"link\":\"/reference/hooks-events-on-after-search\"},{\"text\":\"onAfterShow()\",\"link\":\"/reference/hooks-events-on-after-show\"}]},{\"text\":\"Axe API Client\",\"collapsed\":true,\"items\":[{\"text\":\"setConfig()\",\"link\":\"/reference/client-set-config\"},{\"text\":\"addRequest()\",\"link\":\"/reference/client-add-request\"},{\"text\":\"addResponse()\",\"link\":\"/reference/client-add-response\"},{\"text\":\"first()\",\"link\":\"/reference/client-first\"},{\"text\":\"resource()\",\"link\":\"/reference/client-resource\"},{\"text\":\"insert()\",\"link\":\"/reference/client-insert\"},{\"text\":\"update()\",\"link\":\"/reference/client-update\"},{\"text\":\"patch()\",\"link\":\"/reference/client-patch\"},{\"text\":\"delete()\",\"link\":\"/reference/client-delete\"},{\"text\":\"paginate()\",\"link\":\"/reference/client-paginate\"},{\"text\":\"with()\",\"link\":\"/reference/client-with\"},{\"text\":\"where()\",\"link\":\"/reference/client-where\"},{\"text\":\"orWhere()\",\"link\":\"/reference/client-or-where\"},{\"text\":\"andWhere()\",\"link\":\"/reference/client-and-where\"},{\"text\":\"whereLike()\",\"link\":\"/reference/client-where-like\"},{\"text\":\"whereIn()\",\"link\":\"/reference/client-where-in\"},{\"text\":\"whereBetween()\",\"link\":\"/reference/client-where-between\"},{\"text\":\"whereNull()\",\"link\":\"/reference/client-where-null\"}]}],\"/upgrading/\":[{\"text\":\"Versioning Policy\",\"link\":\"/upgrading/versioning-policy\"},{\"text\":\"Upgrading to v1\",\"link\":\"/upgrading/v1\"},{\"text\":\"Upgrading to 0.30.0\",\"link\":\"/upgrading/0.30.0.html\"},{\"text\":\"Upgrading to 0.20.0\",\"link\":\"/upgrading/0.20.0.html\"}],\"/ecosystem/\":[{\"text\":\"Support\",\"link\":\"/ecosystem/support\"},{\"text\":\"FAQ\",\"link\":\"/ecosystem/faq\"},{\"text\":\"Team\",\"link\":\"/ecosystem/team\"},{\"text\":\"CLI\",\"link\":\"https://github.com/axe-api/axe-magic\"},{\"text\":\"SonarCloud\",\"link\":\"https://sonarcloud.io/dashboard?id=axe-api_axe-api\"}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/axe-api/axe-api\"},{\"icon\":\"twitter\",\"link\":\"https://twitter.com/axeapi\"}],\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2020-present\"},\"search\":{\"provider\":\"local\"}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>