-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0.30.0.html
140 lines (137 loc) · 74.8 KB
/
0.30.0.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
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Upgrading to 0.30.0 | 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/upgrading_0.30.0.md.DIz8XJiq.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 has-sidebar 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 has-sidebar" 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 active" 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 active" 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 has-sidebar empty" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-a6f0e41e><span class="vpi-align-left menu-icon" data-v-a6f0e41e></span><span class="menu-text" data-v-a6f0e41e>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-17a5e62e><button data-v-17a5e62e>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-5d98c3a5 data-v-319d5ca6><div class="curtain" data-v-319d5ca6></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-319d5ca6><span class="visually-hidden" id="sidebar-aria-label" data-v-319d5ca6> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 has-active" data-v-c40bc020 data-v-b7550ba0><!----><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/upgrading/versioning-policy.html" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Versioning Policy</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/upgrading/v1.html" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Upgrading to v1</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/upgrading/0.30.0.html" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Upgrading to 0.30.0</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/upgrading/0.20.0.html" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Upgrading to 0.20.0</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar 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 _upgrading_0_30_0" data-v-39a288b8><div><h1 id="upgrading-to-0-30-0" tabindex="-1">Upgrading to 0.30.0 <a class="header-anchor" href="#upgrading-to-0-30-0" aria-label="Permalink to "Upgrading to 0.30.0""></a></h1><p>This version contains some major and breaking changes. You can easily upgrade your project by using this documentation.</p><h2 id="step-1-serialization-folder" tabindex="-1">Step 1. Serialization folder <a class="header-anchor" href="#step-1-serialization-folder" aria-label="Permalink to "Step 1. Serialization folder""></a></h2><p>Axe API will not support model <code>serialize</code> method anymore with this version.</p><p>You should create a <code>Serialization</code> folder under the <code>app</code> directory instead of that model function.</p><h4 id="before" tabindex="-1">Before <a class="header-anchor" href="#before" aria-label="Permalink to "Before""></a></h4><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;">class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> User</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;"> serialize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">item</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:#E36209;--shiki-dark:#FFAB70;">request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Request</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:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">item,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> fullname: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">item</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">name</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} ${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">item</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">surname</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}`</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 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><h4 id="after" tabindex="-1">After <a class="header-anchor" href="#after" aria-label="Permalink to "After""></a></h4><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;">class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> User</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:#6A737D;--shiki-dark:#6A737D;"> // no serialize method anymore</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><code>app/Serialization/UserSerialization.ts</code></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;"> { Request } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "express"</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;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">item</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:#E36209;--shiki-dark:#FFAB70;">request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Request</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:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">item,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> fullname: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">`${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">item</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ||</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ""} ${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">item</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">surname</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ||</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ""}`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">trim</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 style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><h2 id="step-2-setup-version-folder" tabindex="-1">Step 2. Setup version folder <a class="header-anchor" href="#step-2-setup-version-folder" aria-label="Permalink to "Step 2. Setup version folder""></a></h2><p>All of your application files should be in a version folder with the new version. Your files should be looking like the following example before <code>0.30.0</code>;</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> app</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Config</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Events</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Hooks</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Models</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> init.ts</span></span></code></pre></div><p>Your <code>app</code> folder structure should be changed like this;</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> app</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> v1</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Config</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Events</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Hooks</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Models</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ├──</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> init.ts</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>You can use any version name such as <code>v1</code>, <code>v2</code>, <code>beta</code>, etc.</p></div><h2 id="step-3-setup-application-config" tabindex="-1">Step 3. Setup application config <a class="header-anchor" href="#step-3-setup-application-config" aria-label="Permalink to "Step 3. Setup application config""></a></h2><p>Your API should have two different configurations;</p><ul><li>Application config (<code>/app/config.ts</code>)</li><li>Version config (<code>/app/v1/config.ts</code>)</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The main configuration file has been split into two different parts because both applications and versions should have different configuration files to configure the application and version separately.</p></div><p>You can see the application configuration file content in the following example;</p><p><code>app/config.ts</code></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;"> path </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { LogLevels, IApplicationConfig } </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:#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:#24292E;--shiki-dark:#E1E4E8;"> prefix: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"api"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> env: process.env.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">NODE_ENV</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ||</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "production"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> port: process.env.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APP_PORT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ?</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> parseInt</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(process.env.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">APP_PORT</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 3000</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> logLevel: LogLevels.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">INFO</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> database: {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> client: process.env.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">DB_CLIENT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ||</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "mysql"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> connection: {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> host: process.env.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">DB_HOST</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ||</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "localhost"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> user: process.env.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">DB_USER</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ||</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "user"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> password: process.env.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">DB_PASSWORD</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ||</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "password"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> database: process.env.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">DB_DATABASE</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ||</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "database"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> filename: path.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">join</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(__dirname, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">".."</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">".."</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"mydb.sqlite"</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 style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> pool: {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> min: </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;"> max: </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 style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> migrations: {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tableName: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"knex_migrations"</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 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;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config;</span></span></code></pre></div><h2 id="step-4-setup-version-config" tabindex="-1">Step 4. Setup version config <a class="header-anchor" href="#step-4-setup-version-config" aria-label="Permalink to "Step 4. Setup version config""></a></h2><p>Each of your API versions should have a configuration file like the following example;</p><p><code>app/v1/config.ts</code></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;"> { IVersionConfig, QueryFeature, allow } </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:#005CC5;--shiki-dark:#79B8FF;"> config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IVersionConfig</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;"> transaction: [],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> serializers: [],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> supportedLanguages: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"en-GB"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"en"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"tr"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"de"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> defaultLanguage: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"en-GB"</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>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> limits: [</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">allow</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(QueryFeature.All)],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> defaults: {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> perPage: </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;"> minPerPage: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">5</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> maxPerPage: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">25</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 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;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config;</span></span></code></pre></div><h2 id="step-4-remove-old-configuration-folder" tabindex="-1">Step 4. Remove old configuration folder <a class="header-anchor" href="#step-4-remove-old-configuration-folder" aria-label="Permalink to "Step 4. Remove old configuration folder""></a></h2><p>The <code>app/Config</code> folder should be removed. All configurations in that folder should be moved to the <code>app/config.ts</code> and <code>app/v1/config.ts</code> files.</p><h2 id="step-5-setting-new-hooks-and-event-folders" tabindex="-1">Step 5. Setting new <code>hooks</code> and <code>event</code> folders <a class="header-anchor" href="#step-5-setting-new-hooks-and-event-folders" aria-label="Permalink to "Step 5. Setting new `hooks` and `event` folders""></a></h2><p>Hook and Event folder structure is redesigned. Let's assume that you have the following hook file for the <code>User</code> model.</p><p><code>app/v1/Events/UserEvents.ts</code></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;"> { IContext } </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;"> onAfterInsert</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;">formData</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IContext</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:#6A737D;--shiki-dark:#6A737D;"> // You can send an email to the user in here...</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;"> onBeforePaginate</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;">formData</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IContext</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:#6A737D;--shiki-dark:#6A737D;"> // do something cool in here</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;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { onAfterInsert, onBeforePaginate };</span></span></code></pre></div><p>You should have two different files with the new file structure;</p><p><code>app/v1/Events/User/onAfterInsert.ts</code></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;"> { IContext } </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;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</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;">formData</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IContext</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:#6A737D;--shiki-dark:#6A737D;"> // You can send an email to the user in here...</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><p><code>app/v1/Events/User/onBeforePaginate.ts</code></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;"> { IContext } </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;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</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;">formData</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IContext</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:#6A737D;--shiki-dark:#6A737D;"> // do something cool in here</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The changes you must do;</p><ul><li>Create subfolders for each model that have hooks or events.</li><li>Create a hook or event file by the hook or event name.</li><li>Export the hook or event function as default.</li></ul></div><h2 id="you-ve-made-it" tabindex="-1">You've made it! 🎉 <a class="header-anchor" href="#you-ve-made-it" aria-label="Permalink to "You've made it! :tada:""></a></h2><p>It looks like you have made it. Congrats! 👏 👏 👏</p><p>If you have any question please contact us via <a href="https://github.com/axe-api/axe-api/issues" target="_blank" rel="noreferrer">GitHub Issues</a>.</p></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/upgrading/0.30.0.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><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/upgrading/v1.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Previous page</span><span class="title" data-v-e257564d>Upgrading to v1</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/upgrading/0.20.0.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Next page</span><span class="title" data-v-e257564d>Upgrading to 0.20.0</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" 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>