Refactor Truncgil Finance documentation and endpoints
- Updated the introduction in `intro.md` to provide a clearer overview of the application and its features. - Added new API endpoints in `00.yaml` for retrieving today's currency rates and specific currency rates by name, enhancing the API's functionality. - Removed outdated documentation files including `collection.json`, `index.html`, `openapi.yaml`, and associated CSS and JS files to streamline the project structure. - Updated the `.filehashes` to reflect changes in the documentation files. This commit improves the clarity and usability of the Truncgil Finance API documentation and expands its capabilities.
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# GENERATED. YOU SHOULDN'T MODIFY OR DELETE THIS FILE.
|
# GENERATED. YOU SHOULDN'T MODIFY OR DELETE THIS FILE.
|
||||||
# Scribe uses this file to know when you change something manually in your docs.
|
# Scribe uses this file to know when you change something manually in your docs.
|
||||||
.scribe/intro.md=36e08690cc623bbddd8746db5fae918f
|
.scribe/intro.md=5ba4520f0a0f744a7aceda778b683bb0
|
||||||
.scribe/auth.md=9bee2b1ef8a238b2e58613fa636d5f39
|
.scribe/auth.md=9bee2b1ef8a238b2e58613fa636d5f39
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
-2
@@ -1,6 +1,6 @@
|
|||||||
# Truncgil Finance
|
# Introduction
|
||||||
|
|
||||||
|
|
||||||
|
Daily Financial Data: Provides access to real-time financial data updated through the Truncgil API, allowing users to track the daily performance of currency exchange rates and cryptocurrencies.
|
||||||
|
|
||||||
<aside>
|
<aside>
|
||||||
<strong>Base URL</strong>: <code>http://localhost:8000</code>
|
<strong>Base URL</strong>: <code>http://localhost:8000</code>
|
||||||
@@ -11,3 +11,9 @@ This documentation aims to provide all the information you need to work with our
|
|||||||
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
|
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
|
||||||
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
|
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
|
||||||
|
|
||||||
|
Easy to Use: With a clean and organized user interface, users can quickly access financial data and easily select their desired asset class.
|
||||||
|
|
||||||
|
Developability: The application has a modular and extensible structure, providing developers with a flexible ground to add new features.
|
||||||
|
|
||||||
|
"Truncgil Finance" is an ideal solution for developers and finance professionals who want to quickly adapt to dynamic changes in the financial world.
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,393 +0,0 @@
|
|||||||
/* Copied from https://github.com/slatedocs/slate/blob/c4b4c0b8f83e891ca9fab6bbe9a1a88d5fe41292/stylesheets/print.css and unminified */
|
|
||||||
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
|
|
||||||
|
|
||||||
html {
|
|
||||||
font-family: sans-serif;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
margin: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
article,
|
|
||||||
aside,
|
|
||||||
details,
|
|
||||||
figcaption,
|
|
||||||
figure,
|
|
||||||
footer,
|
|
||||||
header,
|
|
||||||
hgroup,
|
|
||||||
main,
|
|
||||||
menu,
|
|
||||||
nav,
|
|
||||||
section,
|
|
||||||
summary {
|
|
||||||
display: block
|
|
||||||
}
|
|
||||||
|
|
||||||
audio,
|
|
||||||
canvas,
|
|
||||||
progress,
|
|
||||||
video {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: baseline
|
|
||||||
}
|
|
||||||
|
|
||||||
audio:not([controls]) {
|
|
||||||
display: none;
|
|
||||||
height: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
[hidden],
|
|
||||||
template {
|
|
||||||
display: none
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
background-color: transparent
|
|
||||||
}
|
|
||||||
|
|
||||||
a:active,
|
|
||||||
a:hover {
|
|
||||||
outline: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
abbr[title] {
|
|
||||||
border-bottom: 1px dotted
|
|
||||||
}
|
|
||||||
|
|
||||||
b,
|
|
||||||
strong {
|
|
||||||
font-weight: bold
|
|
||||||
}
|
|
||||||
|
|
||||||
dfn {
|
|
||||||
font-style: italic
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 2em;
|
|
||||||
margin: 0.67em 0
|
|
||||||
}
|
|
||||||
|
|
||||||
mark {
|
|
||||||
background: #ff0;
|
|
||||||
color: #000
|
|
||||||
}
|
|
||||||
|
|
||||||
small {
|
|
||||||
font-size: 80%
|
|
||||||
}
|
|
||||||
|
|
||||||
sub,
|
|
||||||
sup {
|
|
||||||
font-size: 75%;
|
|
||||||
line-height: 0;
|
|
||||||
position: relative;
|
|
||||||
vertical-align: baseline
|
|
||||||
}
|
|
||||||
|
|
||||||
sup {
|
|
||||||
top: -0.5em
|
|
||||||
}
|
|
||||||
|
|
||||||
sub {
|
|
||||||
bottom: -0.25em
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
border: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
svg:not(:root) {
|
|
||||||
overflow: hidden
|
|
||||||
}
|
|
||||||
|
|
||||||
figure {
|
|
||||||
margin: 1em 40px
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
box-sizing: content-box;
|
|
||||||
height: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
overflow: auto
|
|
||||||
}
|
|
||||||
|
|
||||||
code,
|
|
||||||
kbd,
|
|
||||||
pre,
|
|
||||||
samp {
|
|
||||||
font-family: monospace, monospace;
|
|
||||||
font-size: 1em
|
|
||||||
}
|
|
||||||
|
|
||||||
button,
|
|
||||||
input,
|
|
||||||
optgroup,
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
color: inherit;
|
|
||||||
font: inherit;
|
|
||||||
margin: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
overflow: visible
|
|
||||||
}
|
|
||||||
|
|
||||||
button,
|
|
||||||
select {
|
|
||||||
text-transform: none
|
|
||||||
}
|
|
||||||
|
|
||||||
button,
|
|
||||||
html input[type="button"],
|
|
||||||
input[type="reset"],
|
|
||||||
input[type="submit"] {
|
|
||||||
-webkit-appearance: button;
|
|
||||||
cursor: pointer
|
|
||||||
}
|
|
||||||
|
|
||||||
button[disabled],
|
|
||||||
html input[disabled] {
|
|
||||||
cursor: default
|
|
||||||
}
|
|
||||||
|
|
||||||
button::-moz-focus-inner,
|
|
||||||
input::-moz-focus-inner {
|
|
||||||
border: 0;
|
|
||||||
padding: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
line-height: normal
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="checkbox"],
|
|
||||||
input[type="radio"] {
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="number"]::-webkit-inner-spin-button,
|
|
||||||
input[type="number"]::-webkit-outer-spin-button {
|
|
||||||
height: auto
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="search"] {
|
|
||||||
-webkit-appearance: textfield;
|
|
||||||
box-sizing: content-box
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="search"]::-webkit-search-cancel-button,
|
|
||||||
input[type="search"]::-webkit-search-decoration {
|
|
||||||
-webkit-appearance: none
|
|
||||||
}
|
|
||||||
|
|
||||||
fieldset {
|
|
||||||
border: 1px solid #c0c0c0;
|
|
||||||
margin: 0 2px;
|
|
||||||
padding: 0.35em 0.625em 0.75em
|
|
||||||
}
|
|
||||||
|
|
||||||
legend {
|
|
||||||
border: 0;
|
|
||||||
padding: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea {
|
|
||||||
overflow: auto
|
|
||||||
}
|
|
||||||
|
|
||||||
optgroup {
|
|
||||||
font-weight: bold
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
border-spacing: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
td,
|
|
||||||
th {
|
|
||||||
padding: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
.content h1,
|
|
||||||
.content h2,
|
|
||||||
.content h3,
|
|
||||||
.content h4,
|
|
||||||
body {
|
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
||||||
font-size: 14px
|
|
||||||
}
|
|
||||||
|
|
||||||
.content h1,
|
|
||||||
.content h2,
|
|
||||||
.content h3,
|
|
||||||
.content h4 {
|
|
||||||
font-weight: bold
|
|
||||||
}
|
|
||||||
|
|
||||||
.content pre,
|
|
||||||
.content code {
|
|
||||||
font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.5
|
|
||||||
}
|
|
||||||
|
|
||||||
.content pre,
|
|
||||||
.content code {
|
|
||||||
word-break: break-all;
|
|
||||||
-webkit-hyphens: auto;
|
|
||||||
-ms-hyphens: auto;
|
|
||||||
hyphens: auto
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'slate';
|
|
||||||
src: url(../fonts/slate.eot?-syv14m);
|
|
||||||
src: url(../fonts/slate.eot?#iefix-syv14m) format("embedded-opentype"), url(../fonts/slate.woff2?-syv14m) format("woff2"), url(../fonts/slate.woff?-syv14m) format("woff"), url(../fonts/slate.ttf?-syv14m) format("truetype"), url(../fonts/slate.svg?-syv14m#slate) format("svg");
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal
|
|
||||||
}
|
|
||||||
|
|
||||||
.content aside.warning:before,
|
|
||||||
.content aside.notice:before,
|
|
||||||
.content aside.success:before {
|
|
||||||
font-family: 'slate';
|
|
||||||
speak: none;
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: normal;
|
|
||||||
font-variant: normal;
|
|
||||||
text-transform: none;
|
|
||||||
line-height: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
.content aside.warning:before {
|
|
||||||
content: "\e600"
|
|
||||||
}
|
|
||||||
|
|
||||||
.content aside.notice:before {
|
|
||||||
content: "\e602"
|
|
||||||
}
|
|
||||||
|
|
||||||
.content aside.success:before {
|
|
||||||
content: "\e606"
|
|
||||||
}
|
|
||||||
|
|
||||||
.tocify,
|
|
||||||
.toc-footer,
|
|
||||||
.lang-selector,
|
|
||||||
.search,
|
|
||||||
#nav-button {
|
|
||||||
display: none
|
|
||||||
}
|
|
||||||
|
|
||||||
.tocify-wrapper>img {
|
|
||||||
margin: 0 auto;
|
|
||||||
display: block
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
font-size: 12px
|
|
||||||
}
|
|
||||||
|
|
||||||
.content pre,
|
|
||||||
.content code {
|
|
||||||
border: 1px solid #999;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 0.8em
|
|
||||||
}
|
|
||||||
|
|
||||||
.content pre code {
|
|
||||||
border: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
.content pre {
|
|
||||||
padding: 1.3em
|
|
||||||
}
|
|
||||||
|
|
||||||
.content code {
|
|
||||||
padding: 0.2em
|
|
||||||
}
|
|
||||||
|
|
||||||
.content table {
|
|
||||||
border: 1px solid #999
|
|
||||||
}
|
|
||||||
|
|
||||||
.content table tr {
|
|
||||||
border-bottom: 1px solid #999
|
|
||||||
}
|
|
||||||
|
|
||||||
.content table td,
|
|
||||||
.content table th {
|
|
||||||
padding: 0.7em
|
|
||||||
}
|
|
||||||
|
|
||||||
.content p {
|
|
||||||
line-height: 1.5
|
|
||||||
}
|
|
||||||
|
|
||||||
.content a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: #000
|
|
||||||
}
|
|
||||||
|
|
||||||
.content h1 {
|
|
||||||
font-size: 2.5em;
|
|
||||||
padding-top: 0.5em;
|
|
||||||
padding-bottom: 0.5em;
|
|
||||||
margin-top: 1em;
|
|
||||||
margin-bottom: 21px;
|
|
||||||
border: 2px solid #ccc;
|
|
||||||
border-width: 2px 0;
|
|
||||||
text-align: center
|
|
||||||
}
|
|
||||||
|
|
||||||
.content h2 {
|
|
||||||
font-size: 1.8em;
|
|
||||||
margin-top: 2em;
|
|
||||||
border-top: 2px solid #ccc;
|
|
||||||
padding-top: 0.8em
|
|
||||||
}
|
|
||||||
|
|
||||||
.content h1+h2,
|
|
||||||
.content h1+div+h2 {
|
|
||||||
border-top: none;
|
|
||||||
padding-top: 0;
|
|
||||||
margin-top: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
.content h3,
|
|
||||||
.content h4 {
|
|
||||||
font-size: 0.8em;
|
|
||||||
margin-top: 1.5em;
|
|
||||||
margin-bottom: 0.8em;
|
|
||||||
text-transform: uppercase
|
|
||||||
}
|
|
||||||
|
|
||||||
.content h5,
|
|
||||||
.content h6 {
|
|
||||||
text-transform: uppercase
|
|
||||||
}
|
|
||||||
|
|
||||||
.content aside {
|
|
||||||
padding: 1em;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 5px;
|
|
||||||
margin-top: 1.5em;
|
|
||||||
margin-bottom: 1.5em;
|
|
||||||
line-height: 1.6
|
|
||||||
}
|
|
||||||
|
|
||||||
.content aside:before {
|
|
||||||
vertical-align: middle;
|
|
||||||
padding-right: 0.5em;
|
|
||||||
font-size: 14px
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 96 B |
@@ -1,656 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
||||||
<title>Truncgil Finance Documentation</title>
|
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../docs/css/theme-default.style.css" media="screen">
|
|
||||||
<link rel="stylesheet" href="../docs/css/theme-default.print.css" media="print">
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js"></script>
|
|
||||||
|
|
||||||
<link rel="stylesheet"
|
|
||||||
href="https://unpkg.com/@highlightjs/cdn-assets@11.6.0/styles/obsidian.min.css">
|
|
||||||
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.6.0/highlight.min.js"></script>
|
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jets/0.14.1/jets.min.js"></script>
|
|
||||||
|
|
||||||
<style id="language-style">
|
|
||||||
/* starts out as display none and is replaced with js later */
|
|
||||||
body .content .bash-example code { display: none; }
|
|
||||||
body .content .javascript-example code { display: none; }
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var tryItOutBaseUrl = "http://localhost:8000";
|
|
||||||
var useCsrf = Boolean();
|
|
||||||
var csrfUrl = "/sanctum/csrf-cookie";
|
|
||||||
</script>
|
|
||||||
<script src="../docs/js/tryitout-4.39.0.js"></script>
|
|
||||||
|
|
||||||
<script src="../docs/js/theme-default-4.39.0.js"></script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body data-languages="["bash","javascript"]">
|
|
||||||
|
|
||||||
<a href="#" id="nav-button">
|
|
||||||
<span>
|
|
||||||
MENU
|
|
||||||
<img src="../docs/images/navbar.png" alt="navbar-image"/>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
<div class="tocify-wrapper">
|
|
||||||
|
|
||||||
<div class="lang-selector">
|
|
||||||
<button type="button" class="lang-button" data-language-name="bash">bash</button>
|
|
||||||
<button type="button" class="lang-button" data-language-name="javascript">javascript</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="search">
|
|
||||||
<input type="text" class="search" id="input-search" placeholder="Search">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="toc">
|
|
||||||
<ul id="tocify-header-truncgil-finance" class="tocify-header">
|
|
||||||
<li class="tocify-item level-1" data-unique="truncgil-finance">
|
|
||||||
<a href="#truncgil-finance">Truncgil Finance</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<ul id="tocify-header-authenticating-requests" class="tocify-header">
|
|
||||||
<li class="tocify-item level-1" data-unique="authenticating-requests">
|
|
||||||
<a href="#authenticating-requests">Authenticating requests</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<ul id="tocify-header-endpoints" class="tocify-header">
|
|
||||||
<li class="tocify-item level-1" data-unique="endpoints">
|
|
||||||
<a href="#endpoints">Endpoints</a>
|
|
||||||
</li>
|
|
||||||
<ul id="tocify-subheader-endpoints" class="tocify-subheader">
|
|
||||||
<li class="tocify-item level-2" data-unique="endpoints-GETapi-currency-rates">
|
|
||||||
<a href="#endpoints-GETapi-currency-rates">GET api/currency-rates</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="toc-footer" id="toc-footer">
|
|
||||||
<li style="padding-bottom: 5px;"><a href="../docs/collection.json">View Postman collection</a></li>
|
|
||||||
<li style="padding-bottom: 5px;"><a href="../docs/openapi.yaml">View OpenAPI spec</a></li>
|
|
||||||
<li><a href="http://github.com/knuckleswtf/scribe">Documentation powered by Scribe ✍</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<ul class="toc-footer" id="last-updated">
|
|
||||||
<li>Last updated: January 17, 2025</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="page-wrapper">
|
|
||||||
<div class="dark-box"></div>
|
|
||||||
<div class="content">
|
|
||||||
<h1 id="truncgil-finance">Truncgil Finance</h1>
|
|
||||||
<aside>
|
|
||||||
<strong>Base URL</strong>: <code>http://localhost:8000</code>
|
|
||||||
</aside>
|
|
||||||
<p>This documentation aims to provide all the information you need to work with our API.</p>
|
|
||||||
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
|
|
||||||
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
|
|
||||||
|
|
||||||
<h1 id="authenticating-requests">Authenticating requests</h1>
|
|
||||||
<p>This API is not authenticated.</p>
|
|
||||||
|
|
||||||
<h1 id="endpoints">Endpoints</h1>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 id="endpoints-GETapi-currency-rates">GET api/currency-rates</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<span id="example-requests-GETapi-currency-rates">
|
|
||||||
<blockquote>Example request:</blockquote>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="bash-example">
|
|
||||||
<pre><code class="language-bash">curl --request GET \
|
|
||||||
--get "http://localhost:8000/api/currency-rates" \
|
|
||||||
--header "Content-Type: application/json" \
|
|
||||||
--header "Accept: application/json"</code></pre></div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="javascript-example">
|
|
||||||
<pre><code class="language-javascript">const url = new URL(
|
|
||||||
"http://localhost:8000/api/currency-rates"
|
|
||||||
);
|
|
||||||
|
|
||||||
const headers = {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"Accept": "application/json",
|
|
||||||
};
|
|
||||||
|
|
||||||
fetch(url, {
|
|
||||||
method: "GET",
|
|
||||||
headers,
|
|
||||||
}).then(response => response.json());</code></pre></div>
|
|
||||||
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span id="example-responses-GETapi-currency-rates">
|
|
||||||
<blockquote>
|
|
||||||
<p>Example response (200):</p>
|
|
||||||
</blockquote>
|
|
||||||
<details class="annotation">
|
|
||||||
<summary style="cursor: pointer;">
|
|
||||||
<small onclick="textContent = parentElement.parentElement.open ? 'Show headers' : 'Hide headers'">Show headers</small>
|
|
||||||
</summary>
|
|
||||||
<pre><code class="language-http">cache-control: no-cache, private
|
|
||||||
content-type: application/json
|
|
||||||
access-control-allow-origin: *
|
|
||||||
</code></pre></details> <pre>
|
|
||||||
|
|
||||||
<code class="language-json" style="max-height: 300px;">{
|
|
||||||
"Update_Date": "2025-01-17 18:33:23",
|
|
||||||
"gram-altin": {
|
|
||||||
"Type": "Currency",
|
|
||||||
"Change": "0.24"
|
|
||||||
},
|
|
||||||
"USD": {
|
|
||||||
"Type": "Currency",
|
|
||||||
"Change": "0.39",
|
|
||||||
"Buying": "35.5568",
|
|
||||||
"Selling": "35.5729"
|
|
||||||
},
|
|
||||||
"EUR": {
|
|
||||||
"Type": "Currency",
|
|
||||||
"Change": "-0.10",
|
|
||||||
"Buying": "36.5659",
|
|
||||||
"Selling": "36.5827"
|
|
||||||
},
|
|
||||||
"GBP": {
|
|
||||||
"Type": "Currency",
|
|
||||||
"Change": "-0.26",
|
|
||||||
"Buying": "43.2899",
|
|
||||||
"Selling": "43.3139"
|
|
||||||
},
|
|
||||||
"XU100": {
|
|
||||||
"Type": "Currency",
|
|
||||||
"Change": "1.13"
|
|
||||||
},
|
|
||||||
"bitcoin": {
|
|
||||||
"Type": "Currency",
|
|
||||||
"Change": "5.18"
|
|
||||||
},
|
|
||||||
"gumus": {
|
|
||||||
"Type": "Currency",
|
|
||||||
"Change": "-1.15"
|
|
||||||
},
|
|
||||||
"BRENT": {
|
|
||||||
"Type": "Currency",
|
|
||||||
"Change": "-0.40"
|
|
||||||
},
|
|
||||||
"CHF": {
|
|
||||||
"Buying": "38.8684",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "38.8987",
|
|
||||||
"Change": "0.00"
|
|
||||||
},
|
|
||||||
"CAD": {
|
|
||||||
"Buying": "24.6017",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "24.6179",
|
|
||||||
"Change": "0.01"
|
|
||||||
},
|
|
||||||
"RUB": {
|
|
||||||
"Buying": "0.3469",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.3471",
|
|
||||||
"Change": "1.49"
|
|
||||||
},
|
|
||||||
"AED": {
|
|
||||||
"Buying": "9.6803",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "9.6855",
|
|
||||||
"Change": "0.39"
|
|
||||||
},
|
|
||||||
"AUD": {
|
|
||||||
"Buying": "22.0523",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "22.0694",
|
|
||||||
"Change": "0.29"
|
|
||||||
},
|
|
||||||
"DKK": {
|
|
||||||
"Buying": "4.9006",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "4.9039",
|
|
||||||
"Change": "0.23"
|
|
||||||
},
|
|
||||||
"SEK": {
|
|
||||||
"Buying": "3.1793",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "3.1830",
|
|
||||||
"Change": "0.13"
|
|
||||||
},
|
|
||||||
"NOK": {
|
|
||||||
"Buying": "3.1085",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "3.1113",
|
|
||||||
"Change": "-0.25"
|
|
||||||
},
|
|
||||||
"JPY": {
|
|
||||||
"Buying": 0.2275,
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": 0.2279,
|
|
||||||
"Change": -0.005699999999999999
|
|
||||||
},
|
|
||||||
"KWD": {
|
|
||||||
"Buying": "115.0539",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "115.4686",
|
|
||||||
"Change": "0.30"
|
|
||||||
},
|
|
||||||
"ZAR": {
|
|
||||||
"Buying": "1.8980",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "1.8998",
|
|
||||||
"Change": "0.94"
|
|
||||||
},
|
|
||||||
"BHD": {
|
|
||||||
"Buying": "94.3401",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "94.3829",
|
|
||||||
"Change": "0.40"
|
|
||||||
},
|
|
||||||
"LYD": {
|
|
||||||
"Buying": "7.1896",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "7.1928",
|
|
||||||
"Change": "-1.15"
|
|
||||||
},
|
|
||||||
"SAR": {
|
|
||||||
"Buying": "9.4641",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "9.4934",
|
|
||||||
"Change": "0.39"
|
|
||||||
},
|
|
||||||
"IQD": {
|
|
||||||
"Buying": "0.0271",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0272",
|
|
||||||
"Change": "0.39"
|
|
||||||
},
|
|
||||||
"ILS": {
|
|
||||||
"Buying": "9.9769",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "9.9815",
|
|
||||||
"Change": "1.93"
|
|
||||||
},
|
|
||||||
"IRR": {
|
|
||||||
"Buying": "0.0008",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0008",
|
|
||||||
"Change": "0.00"
|
|
||||||
},
|
|
||||||
"INR": {
|
|
||||||
"Buying": "0.4106",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.4108",
|
|
||||||
"Change": "0.41"
|
|
||||||
},
|
|
||||||
"MXN": {
|
|
||||||
"Buying": "1.7147",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "1.7154",
|
|
||||||
"Change": "0.90"
|
|
||||||
},
|
|
||||||
"HUF": {
|
|
||||||
"Buying": "0.0886",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0886",
|
|
||||||
"Change": "0.21"
|
|
||||||
},
|
|
||||||
"NZD": {
|
|
||||||
"Buying": "19.8808",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "19.8898",
|
|
||||||
"Change": "0.13"
|
|
||||||
},
|
|
||||||
"BRL": {
|
|
||||||
"Buying": "5.8608",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "5.8634",
|
|
||||||
"Change": "0.19"
|
|
||||||
},
|
|
||||||
"IDR": {
|
|
||||||
"Buying": "0.0022",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0022",
|
|
||||||
"Change": "0.42"
|
|
||||||
},
|
|
||||||
"CZK": {
|
|
||||||
"Buying": "1.4472",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "1.4479",
|
|
||||||
"Change": "0.33"
|
|
||||||
},
|
|
||||||
"PLN": {
|
|
||||||
"Buying": "8.5816",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "8.5854",
|
|
||||||
"Change": "0.35"
|
|
||||||
},
|
|
||||||
"RON": {
|
|
||||||
"Buying": "7.3452",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "7.3548",
|
|
||||||
"Change": "0.22"
|
|
||||||
},
|
|
||||||
"CNY": {
|
|
||||||
"Buying": "4.8533",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "4.8568",
|
|
||||||
"Change": "0.49"
|
|
||||||
},
|
|
||||||
"ARS": {
|
|
||||||
"Buying": "0.0341",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0341",
|
|
||||||
"Change": "0.34"
|
|
||||||
},
|
|
||||||
"ALL": {
|
|
||||||
"Buying": "0.3728",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.3730",
|
|
||||||
"Change": "0.47"
|
|
||||||
},
|
|
||||||
"AZN": {
|
|
||||||
"Buying": "20.9158",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "20.9252",
|
|
||||||
"Change": "0.39"
|
|
||||||
},
|
|
||||||
"BAM": {
|
|
||||||
"Buying": "18.7299",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "18.7384",
|
|
||||||
"Change": "-6.31"
|
|
||||||
},
|
|
||||||
"CLP": {
|
|
||||||
"Buying": "0.0353",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0353",
|
|
||||||
"Change": "0.95"
|
|
||||||
},
|
|
||||||
"COP": {
|
|
||||||
"Buying": "0.0082",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0082",
|
|
||||||
"Change": "0.47"
|
|
||||||
},
|
|
||||||
"CRC": {
|
|
||||||
"Buying": "0.0709",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0709",
|
|
||||||
"Change": "0.55"
|
|
||||||
},
|
|
||||||
"DZD": {
|
|
||||||
"Buying": "0.2616",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.2617",
|
|
||||||
"Change": "0.60"
|
|
||||||
},
|
|
||||||
"EGP": {
|
|
||||||
"Buying": "0.7054",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.7058",
|
|
||||||
"Change": "0.38"
|
|
||||||
},
|
|
||||||
"HKD": {
|
|
||||||
"Buying": "4.5675",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "4.5695",
|
|
||||||
"Change": "0.42"
|
|
||||||
},
|
|
||||||
"ISK": {
|
|
||||||
"Buying": "0.2513",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.2515",
|
|
||||||
"Change": "-0.04"
|
|
||||||
},
|
|
||||||
"JOD": {
|
|
||||||
"Buying": "50.1436",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "50.1663",
|
|
||||||
"Change": "0.42"
|
|
||||||
},
|
|
||||||
"KRW": {
|
|
||||||
"Buying": "0.0244",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0244",
|
|
||||||
"Change": "0.39"
|
|
||||||
},
|
|
||||||
"KZT": {
|
|
||||||
"Buying": "0.0670",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0670",
|
|
||||||
"Change": "0.35"
|
|
||||||
},
|
|
||||||
"LBP": {
|
|
||||||
"Buying": "0.0004",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0004",
|
|
||||||
"Change": "0.44"
|
|
||||||
},
|
|
||||||
"LKR": {
|
|
||||||
"Buying": "0.1199",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.1200",
|
|
||||||
"Change": "0.38"
|
|
||||||
},
|
|
||||||
"MAD": {
|
|
||||||
"Buying": "3.5377",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "3.5393",
|
|
||||||
"Change": "0.37"
|
|
||||||
},
|
|
||||||
"MDL": {
|
|
||||||
"Buying": "1.8828",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "1.8837",
|
|
||||||
"Change": "-0.21"
|
|
||||||
},
|
|
||||||
"MKD": {
|
|
||||||
"Buying": "0.5944",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.5947",
|
|
||||||
"Change": "0.27"
|
|
||||||
},
|
|
||||||
"MYR": {
|
|
||||||
"Buying": "7.8910",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "7.8946",
|
|
||||||
"Change": "0.31"
|
|
||||||
},
|
|
||||||
"OMR": {
|
|
||||||
"Buying": "92.3577",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "92.3995",
|
|
||||||
"Change": "0.39"
|
|
||||||
},
|
|
||||||
"PEN": {
|
|
||||||
"Buying": "9.4641",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "9.4684",
|
|
||||||
"Change": "0.41"
|
|
||||||
},
|
|
||||||
"PHP": {
|
|
||||||
"Buying": "0.6083",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.6086",
|
|
||||||
"Change": "0.63"
|
|
||||||
},
|
|
||||||
"PKR": {
|
|
||||||
"Buying": "0.1274",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.1277",
|
|
||||||
"Change": "0.39"
|
|
||||||
},
|
|
||||||
"QAR": {
|
|
||||||
"Buying": "9.7614",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "9.7771",
|
|
||||||
"Change": "0.39"
|
|
||||||
},
|
|
||||||
"RSD": {
|
|
||||||
"Buying": "0.3119",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.3128",
|
|
||||||
"Change": "-0.06"
|
|
||||||
},
|
|
||||||
"SGD": {
|
|
||||||
"Buying": "25.9937",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "26.0055",
|
|
||||||
"Change": "0.31"
|
|
||||||
},
|
|
||||||
"SYP": {
|
|
||||||
"Buying": "0.0027",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.0027",
|
|
||||||
"Change": "0.39"
|
|
||||||
},
|
|
||||||
"THB": {
|
|
||||||
"Buying": "1.0319",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "1.0323",
|
|
||||||
"Change": "0.72"
|
|
||||||
},
|
|
||||||
"TWD": {
|
|
||||||
"Buying": "1.0808",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "1.0812",
|
|
||||||
"Change": "0.51"
|
|
||||||
},
|
|
||||||
"UAH": {
|
|
||||||
"Buying": "0.8428",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.8432",
|
|
||||||
"Change": "0.23"
|
|
||||||
},
|
|
||||||
"UYU": {
|
|
||||||
"Buying": "0.8068",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "0.8072",
|
|
||||||
"Change": "0.23"
|
|
||||||
},
|
|
||||||
"GEL": {
|
|
||||||
"Buying": "12.5200",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "12.5257",
|
|
||||||
"Change": "-3.50"
|
|
||||||
},
|
|
||||||
"TND": {
|
|
||||||
"Buying": "11.0700",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "11.0750",
|
|
||||||
"Change": "0.39"
|
|
||||||
},
|
|
||||||
"BGN": {
|
|
||||||
"Buying": "18.6226",
|
|
||||||
"Type": "Currency",
|
|
||||||
"Selling": "18.7779",
|
|
||||||
"Change": "-0.10"
|
|
||||||
}
|
|
||||||
}</code>
|
|
||||||
</pre>
|
|
||||||
</span>
|
|
||||||
<span id="execution-results-GETapi-currency-rates" hidden>
|
|
||||||
<blockquote>Received response<span
|
|
||||||
id="execution-response-status-GETapi-currency-rates"></span>:
|
|
||||||
</blockquote>
|
|
||||||
<pre class="json"><code id="execution-response-content-GETapi-currency-rates"
|
|
||||||
data-empty-response-text="<Empty response>" style="max-height: 400px;"></code></pre>
|
|
||||||
</span>
|
|
||||||
<span id="execution-error-GETapi-currency-rates" hidden>
|
|
||||||
<blockquote>Request failed with error:</blockquote>
|
|
||||||
<pre><code id="execution-error-message-GETapi-currency-rates">
|
|
||||||
|
|
||||||
Tip: Check that you're properly connected to the network.
|
|
||||||
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
|
|
||||||
You can check the Dev Tools console for debugging information.</code></pre>
|
|
||||||
</span>
|
|
||||||
<form id="form-GETapi-currency-rates" data-method="GET"
|
|
||||||
data-path="api/currency-rates"
|
|
||||||
data-authed="0"
|
|
||||||
data-hasfiles="0"
|
|
||||||
data-isarraybody="0"
|
|
||||||
autocomplete="off"
|
|
||||||
onsubmit="event.preventDefault(); executeTryOut('GETapi-currency-rates', this);">
|
|
||||||
<h3>
|
|
||||||
Request
|
|
||||||
<button type="button"
|
|
||||||
style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
||||||
id="btn-tryout-GETapi-currency-rates"
|
|
||||||
onclick="tryItOut('GETapi-currency-rates');">Try it out ⚡
|
|
||||||
</button>
|
|
||||||
<button type="button"
|
|
||||||
style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
||||||
id="btn-canceltryout-GETapi-currency-rates"
|
|
||||||
onclick="cancelTryOut('GETapi-currency-rates');" hidden>Cancel 🛑
|
|
||||||
</button>
|
|
||||||
<button type="submit"
|
|
||||||
style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;"
|
|
||||||
id="btn-executetryout-GETapi-currency-rates"
|
|
||||||
data-initial-text="Send Request 💥"
|
|
||||||
data-loading-text="⏱ Sending..."
|
|
||||||
hidden>Send Request 💥
|
|
||||||
</button>
|
|
||||||
</h3>
|
|
||||||
<p>
|
|
||||||
<small class="badge badge-green">GET</small>
|
|
||||||
<b><code>api/currency-rates</code></b>
|
|
||||||
</p>
|
|
||||||
<h4 class="fancy-heading-panel"><b>Headers</b></h4>
|
|
||||||
<div style="padding-left: 28px; clear: unset;">
|
|
||||||
<b style="line-height: 2;"><code>Content-Type</code></b>
|
|
||||||
|
|
||||||
|
|
||||||
<input type="text" style="display: none"
|
|
||||||
name="Content-Type" data-endpoint="GETapi-currency-rates"
|
|
||||||
value="application/json"
|
|
||||||
data-component="header">
|
|
||||||
<br>
|
|
||||||
<p>Example: <code>application/json</code></p>
|
|
||||||
</div>
|
|
||||||
<div style="padding-left: 28px; clear: unset;">
|
|
||||||
<b style="line-height: 2;"><code>Accept</code></b>
|
|
||||||
|
|
||||||
|
|
||||||
<input type="text" style="display: none"
|
|
||||||
name="Accept" data-endpoint="GETapi-currency-rates"
|
|
||||||
value="application/json"
|
|
||||||
data-component="header">
|
|
||||||
<br>
|
|
||||||
<p>Example: <code>application/json</code></p>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="dark-box">
|
|
||||||
<div class="lang-selector">
|
|
||||||
<button type="button" class="lang-button" data-language-name="bash">bash</button>
|
|
||||||
<button type="button" class="lang-button" data-language-name="javascript">javascript</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
document.addEventListener('DOMContentLoaded', function() {
|
|
||||||
const updateHash = function (id) {
|
|
||||||
window.location.hash = `#${id}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
const navButton = document.getElementById('nav-button');
|
|
||||||
const menuWrapper = document.querySelector('.tocify-wrapper');
|
|
||||||
function toggleSidebar(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
if (menuWrapper) {
|
|
||||||
menuWrapper.classList.toggle('open');
|
|
||||||
navButton.classList.toggle('open');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function closeSidebar() {
|
|
||||||
if (menuWrapper) {
|
|
||||||
menuWrapper.classList.remove('open');
|
|
||||||
navButton.classList.remove('open');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
navButton.addEventListener('click', toggleSidebar);
|
|
||||||
|
|
||||||
window.hljs.highlightAll();
|
|
||||||
|
|
||||||
const wrapper = document.getElementById('toc');
|
|
||||||
// https://jets.js.org/
|
|
||||||
window.jets = new window.Jets({
|
|
||||||
// *OR - Selects elements whose values contains at least one part of search substring
|
|
||||||
searchSelector: '*OR',
|
|
||||||
searchTag: '#input-search',
|
|
||||||
contentTag: '#toc li',
|
|
||||||
didSearch: function(term) {
|
|
||||||
wrapper.classList.toggle('jets-searching', String(term).length > 0)
|
|
||||||
},
|
|
||||||
// map these accent keys to plain values
|
|
||||||
diacriticsMap: {
|
|
||||||
a: 'ÀÁÂÃÄÅàáâãäåĀāąĄ',
|
|
||||||
c: 'ÇçćĆčČ',
|
|
||||||
d: 'đĐďĎ',
|
|
||||||
e: 'ÈÉÊËèéêëěĚĒēęĘ',
|
|
||||||
i: 'ÌÍÎÏìíîïĪī',
|
|
||||||
l: 'łŁ',
|
|
||||||
n: 'ÑñňŇńŃ',
|
|
||||||
o: 'ÒÓÔÕÕÖØòóôõöøŌō',
|
|
||||||
r: 'řŘ',
|
|
||||||
s: 'ŠšśŚ',
|
|
||||||
t: 'ťŤ',
|
|
||||||
u: 'ÙÚÛÜùúûüůŮŪū',
|
|
||||||
y: 'ŸÿýÝ',
|
|
||||||
z: 'ŽžżŻźŹ'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function hashChange() {
|
|
||||||
const currentItems = document.querySelectorAll('.tocify-subheader.visible, .tocify-item.tocify-focus');
|
|
||||||
Array.from(currentItems).forEach((elem) => {
|
|
||||||
elem.classList.remove('visible', 'tocify-focus');
|
|
||||||
});
|
|
||||||
|
|
||||||
const currentTag = document.querySelector(`a[href="${window.location.hash}"]`);
|
|
||||||
if (currentTag) {
|
|
||||||
const parent = currentTag.closest('.tocify-subheader');
|
|
||||||
if (parent) {
|
|
||||||
parent.classList.add('visible');
|
|
||||||
}
|
|
||||||
|
|
||||||
const siblings = currentTag.closest('.tocify-header');
|
|
||||||
if (siblings) {
|
|
||||||
Array.from(siblings.querySelectorAll('.tocify-subheader')).forEach((elem) => {
|
|
||||||
elem.classList.add('visible');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
currentTag.parentElement.classList.add('tocify-focus');
|
|
||||||
|
|
||||||
// wait for dom changes to be done
|
|
||||||
setTimeout(() => {
|
|
||||||
currentTag.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
|
|
||||||
// only close the sidebar on level-2 events
|
|
||||||
if (currentTag.parentElement.classList.contains('level-2')) {
|
|
||||||
closeSidebar();
|
|
||||||
}
|
|
||||||
}, 1500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let languages = JSON.parse(document.body.getAttribute('data-languages'));
|
|
||||||
// Support a key => value object where the key is the name, or an array of strings where the value is the name
|
|
||||||
if (!Array.isArray(languages)) {
|
|
||||||
languages = Object.values(languages);
|
|
||||||
}
|
|
||||||
// if there is no language use the first one
|
|
||||||
const currentLanguage = window.localStorage.getItem('language') || languages[0];
|
|
||||||
const languageStyle = document.getElementById('language-style');
|
|
||||||
const langSelector = document.querySelectorAll('.lang-selector button.lang-button');
|
|
||||||
|
|
||||||
function setActiveLanguage(newLanguage) {
|
|
||||||
window.localStorage.setItem('language', newLanguage);
|
|
||||||
if (!languageStyle) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const newStyle = languages.map((language) => {
|
|
||||||
return language === newLanguage
|
|
||||||
// the current one should be visible
|
|
||||||
? `body .content .${language}-example pre { display: block; }`
|
|
||||||
// the inactive one should be hidden
|
|
||||||
: `body .content .${language}-example pre { display: none; }`;
|
|
||||||
}).join(`\n`);
|
|
||||||
|
|
||||||
Array.from(langSelector).forEach((elem) => {
|
|
||||||
elem.classList.toggle('active', elem.getAttribute('data-language-name') === newLanguage);
|
|
||||||
});
|
|
||||||
|
|
||||||
const activeHash = window.location.hash.slice(1);
|
|
||||||
|
|
||||||
languageStyle.innerHTML = newStyle;
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
updateHash(activeHash);
|
|
||||||
}, 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
setActiveLanguage(currentLanguage);
|
|
||||||
|
|
||||||
Array.from(langSelector).forEach((elem) => {
|
|
||||||
elem.addEventListener('click', () => {
|
|
||||||
const newLanguage = elem.getAttribute('data-language-name');
|
|
||||||
setActiveLanguage(newLanguage);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
window.addEventListener('hashchange', hashChange, false);
|
|
||||||
|
|
||||||
const divs = document.querySelectorAll('.content h1[id], .content h2[id]');
|
|
||||||
|
|
||||||
document.addEventListener('scroll', () => {
|
|
||||||
divs.forEach(item => {
|
|
||||||
const rect = item.getBoundingClientRect();
|
|
||||||
if (rect.top > 0 && rect.top < 150) {
|
|
||||||
const location = window.location.toString().split('#')[0];
|
|
||||||
history.replaceState(null, null, location + '#' + item.id);
|
|
||||||
hashChange();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
hashChange();
|
|
||||||
});
|
|
||||||
@@ -1,289 +0,0 @@
|
|||||||
window.abortControllers = {};
|
|
||||||
|
|
||||||
function cacheAuthValue() {
|
|
||||||
// Whenever the auth header is set for one endpoint, cache it for the others
|
|
||||||
window.lastAuthValue = '';
|
|
||||||
let authInputs = document.querySelectorAll(`.auth-value`)
|
|
||||||
authInputs.forEach(el => {
|
|
||||||
el.addEventListener('input', (event) => {
|
|
||||||
window.lastAuthValue = event.target.value;
|
|
||||||
authInputs.forEach(otherInput => {
|
|
||||||
if (otherInput === el) return;
|
|
||||||
// Don't block the main thread
|
|
||||||
setTimeout(() => {
|
|
||||||
otherInput.value = window.lastAuthValue;
|
|
||||||
}, 0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', cacheAuthValue);
|
|
||||||
|
|
||||||
function getCookie(name) {
|
|
||||||
if (!document.cookie) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const cookies = document.cookie.split(';')
|
|
||||||
.map(c => c.trim())
|
|
||||||
.filter(c => c.startsWith(name + '='));
|
|
||||||
|
|
||||||
if (cookies.length === 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return decodeURIComponent(cookies[0].split('=')[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
function tryItOut(endpointId) {
|
|
||||||
document.querySelector(`#btn-tryout-${endpointId}`).hidden = true;
|
|
||||||
document.querySelector(`#btn-canceltryout-${endpointId}`).hidden = false;
|
|
||||||
const executeBtn = document.querySelector(`#btn-executetryout-${endpointId}`).hidden = false;
|
|
||||||
executeBtn.disabled = false;
|
|
||||||
|
|
||||||
// Show all input fields
|
|
||||||
document.querySelectorAll(`input[data-endpoint=${endpointId}],label[data-endpoint=${endpointId}]`)
|
|
||||||
.forEach(el => el.style.display = 'block');
|
|
||||||
|
|
||||||
if (document.querySelector(`#form-${endpointId}`).dataset.authed === "1") {
|
|
||||||
const authElement = document.querySelector(`#auth-${endpointId}`);
|
|
||||||
authElement && (authElement.hidden = false);
|
|
||||||
}
|
|
||||||
// Expand all nested fields
|
|
||||||
document.querySelectorAll(`#form-${endpointId} details`)
|
|
||||||
.forEach(el => el.open = true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function cancelTryOut(endpointId) {
|
|
||||||
if (window.abortControllers[endpointId]) {
|
|
||||||
window.abortControllers[endpointId].abort();
|
|
||||||
delete window.abortControllers[endpointId];
|
|
||||||
}
|
|
||||||
|
|
||||||
document.querySelector(`#btn-tryout-${endpointId}`).hidden = false;
|
|
||||||
const executeBtn = document.querySelector(`#btn-executetryout-${endpointId}`);
|
|
||||||
executeBtn.hidden = true;
|
|
||||||
executeBtn.textContent = executeBtn.dataset.initialText;
|
|
||||||
document.querySelector(`#btn-canceltryout-${endpointId}`).hidden = true;
|
|
||||||
// Hide inputs
|
|
||||||
document.querySelectorAll(`input[data-endpoint=${endpointId}],label[data-endpoint=${endpointId}]`)
|
|
||||||
.forEach(el => el.style.display = 'none');
|
|
||||||
document.querySelectorAll(`#form-${endpointId} details`)
|
|
||||||
.forEach(el => el.open = false);
|
|
||||||
const authElement = document.querySelector(`#auth-${endpointId}`);
|
|
||||||
authElement && (authElement.hidden = true);
|
|
||||||
|
|
||||||
document.querySelector('#execution-results-' + endpointId).hidden = true;
|
|
||||||
document.querySelector('#execution-error-' + endpointId).hidden = true;
|
|
||||||
|
|
||||||
// Revert to sample code blocks
|
|
||||||
document.querySelector('#example-requests-' + endpointId).hidden = false;
|
|
||||||
document.querySelector('#example-responses-' + endpointId).hidden = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function makeAPICall(method, path, body = {}, query = {}, headers = {}, endpointId = null) {
|
|
||||||
console.log({endpointId, path, body, query, headers});
|
|
||||||
|
|
||||||
if (!(body instanceof FormData) && typeof body !== "string") {
|
|
||||||
body = JSON.stringify(body)
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = new URL(window.tryItOutBaseUrl + '/' + path.replace(/^\//, ''));
|
|
||||||
|
|
||||||
// We need this function because if you try to set an array or object directly to a URLSearchParams object,
|
|
||||||
// you'll get [object Object] or the array.toString()
|
|
||||||
function addItemToSearchParamsObject(key, value, searchParams) {
|
|
||||||
if (Array.isArray(value)) {
|
|
||||||
value.forEach((v, i) => {
|
|
||||||
// Append {filters: [first, second]} as filters[0]=first&filters[1]second
|
|
||||||
addItemToSearchParamsObject(key + '[' + i + ']', v, searchParams);
|
|
||||||
})
|
|
||||||
} else if (typeof value === 'object' && value !== null) {
|
|
||||||
Object.keys(value).forEach((i) => {
|
|
||||||
// Append {filters: {name: first}} as filters[name]=first
|
|
||||||
addItemToSearchParamsObject(key + '[' + i + ']', value[i], searchParams);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
searchParams.append(key, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.keys(query)
|
|
||||||
.forEach(key => addItemToSearchParamsObject(key, query[key], url.searchParams));
|
|
||||||
|
|
||||||
window.abortControllers[endpointId] = new AbortController();
|
|
||||||
|
|
||||||
return fetch(url, {
|
|
||||||
method,
|
|
||||||
headers,
|
|
||||||
body: method === 'GET' ? undefined : body,
|
|
||||||
signal: window.abortControllers[endpointId].signal,
|
|
||||||
referrer: window.tryItOutBaseUrl,
|
|
||||||
mode: 'cors',
|
|
||||||
credentials: 'same-origin',
|
|
||||||
})
|
|
||||||
.then(response => Promise.all([response.status, response.statusText, response.text(), response.headers]));
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideCodeSamples(endpointId) {
|
|
||||||
document.querySelector('#example-requests-' + endpointId).hidden = true;
|
|
||||||
document.querySelector('#example-responses-' + endpointId).hidden = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleResponse(endpointId, response, status, headers) {
|
|
||||||
hideCodeSamples(endpointId);
|
|
||||||
|
|
||||||
// Hide error views
|
|
||||||
document.querySelector('#execution-error-' + endpointId).hidden = true;
|
|
||||||
|
|
||||||
const responseContentEl = document.querySelector('#execution-response-content-' + endpointId);
|
|
||||||
|
|
||||||
// Check if the response contains Laravel's dd() default dump output
|
|
||||||
const isLaravelDump = response.includes('Sfdump');
|
|
||||||
|
|
||||||
// If it's a Laravel dd() dump, use innerHTML to render it safely
|
|
||||||
if (isLaravelDump) {
|
|
||||||
responseContentEl.innerHTML = response === '' ? responseContentEl.dataset.emptyResponseText : response;
|
|
||||||
} else {
|
|
||||||
// Otherwise, stick to textContent for regular responses
|
|
||||||
responseContentEl.textContent = response === '' ? responseContentEl.dataset.emptyResponseText : response;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prettify it if it's JSON
|
|
||||||
let isJson = false;
|
|
||||||
try {
|
|
||||||
const jsonParsed = JSON.parse(response);
|
|
||||||
if (jsonParsed !== null) {
|
|
||||||
isJson = true;
|
|
||||||
response = JSON.stringify(jsonParsed, null, 4);
|
|
||||||
responseContentEl.textContent = response;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
isJson && window.hljs.highlightElement(responseContentEl);
|
|
||||||
const statusEl = document.querySelector('#execution-response-status-' + endpointId);
|
|
||||||
statusEl.textContent = ` (${status})`;
|
|
||||||
document.querySelector('#execution-results-' + endpointId).hidden = false;
|
|
||||||
statusEl.scrollIntoView({behavior: "smooth", block: "center"});
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleError(endpointId, err) {
|
|
||||||
hideCodeSamples(endpointId);
|
|
||||||
// Hide response views
|
|
||||||
document.querySelector('#execution-results-' + endpointId).hidden = true;
|
|
||||||
|
|
||||||
// Show error views
|
|
||||||
let errorMessage = err.message || err;
|
|
||||||
const $errorMessageEl = document.querySelector('#execution-error-message-' + endpointId);
|
|
||||||
$errorMessageEl.textContent = errorMessage + $errorMessageEl.textContent;
|
|
||||||
const errorEl = document.querySelector('#execution-error-' + endpointId);
|
|
||||||
errorEl.hidden = false;
|
|
||||||
errorEl.scrollIntoView({behavior: "smooth", block: "center"});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
async function executeTryOut(endpointId, form) {
|
|
||||||
const executeBtn = document.querySelector(`#btn-executetryout-${endpointId}`);
|
|
||||||
executeBtn.textContent = executeBtn.dataset.loadingText;
|
|
||||||
executeBtn.disabled = true;
|
|
||||||
executeBtn.scrollIntoView({behavior: "smooth", block: "center"});
|
|
||||||
|
|
||||||
let body;
|
|
||||||
let setter;
|
|
||||||
if (form.dataset.hasfiles === "1") {
|
|
||||||
body = new FormData();
|
|
||||||
setter = (name, value) => body.append(name, value);
|
|
||||||
} else if (form.dataset.isarraybody === "1") {
|
|
||||||
body = [];
|
|
||||||
setter = (name, value) => _.set(body, name, value);
|
|
||||||
} else {
|
|
||||||
body = {};
|
|
||||||
setter = (name, value) => _.set(body, name, value);
|
|
||||||
}
|
|
||||||
const bodyParameters = form.querySelectorAll('input[data-component=body]');
|
|
||||||
bodyParameters.forEach(el => {
|
|
||||||
let value = el.value;
|
|
||||||
|
|
||||||
if (el.type === 'number' && typeof value === 'string') {
|
|
||||||
value = parseFloat(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (el.type === 'file' && el.files[0]) {
|
|
||||||
setter(el.name, el.files[0]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (el.type !== 'radio') {
|
|
||||||
if (value === "" && el.required === false) {
|
|
||||||
// Don't include empty optional values in the request
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setter(el.name, value);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (el.checked) {
|
|
||||||
value = (value === 'false') ? false : true;
|
|
||||||
setter(el.name, value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const query = {};
|
|
||||||
const queryParameters = form.querySelectorAll('input[data-component=query]');
|
|
||||||
queryParameters.forEach(el => {
|
|
||||||
if (el.type !== 'radio' || (el.type === 'radio' && el.checked)) {
|
|
||||||
if (el.value === '') {
|
|
||||||
// Don't include empty values in the request
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_.set(query, el.name, el.value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
let path = form.dataset.path;
|
|
||||||
const urlParameters = form.querySelectorAll('input[data-component=url]');
|
|
||||||
urlParameters.forEach(el => (path = path.replace(new RegExp(`\\{${el.name}\\??}`), el.value)));
|
|
||||||
|
|
||||||
const headers = Object.fromEntries(Array.from(form.querySelectorAll('input[data-component=header]'))
|
|
||||||
.map(el => [el.name, el.value]));
|
|
||||||
|
|
||||||
// When using FormData, the browser sets the correct content-type + boundary
|
|
||||||
let method = form.dataset.method;
|
|
||||||
if (body instanceof FormData) {
|
|
||||||
delete headers['Content-Type'];
|
|
||||||
|
|
||||||
// When using FormData with PUT or PATCH, use method spoofing so PHP can access the post body
|
|
||||||
if (['PUT', 'PATCH'].includes(form.dataset.method)) {
|
|
||||||
method = 'POST';
|
|
||||||
setter('_method', form.dataset.method);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let preflightPromise = Promise.resolve();
|
|
||||||
if (window.useCsrf && window.csrfUrl) {
|
|
||||||
preflightPromise = makeAPICall('GET', window.csrfUrl).then(() => {
|
|
||||||
headers['X-XSRF-TOKEN'] = getCookie('XSRF-TOKEN');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return preflightPromise.then(() => makeAPICall(method, path, body, query, headers, endpointId))
|
|
||||||
.then(([responseStatus, statusText, responseContent, responseHeaders]) => {
|
|
||||||
handleResponse(endpointId, responseContent, responseStatus, responseHeaders)
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if (err.name === "AbortError") {
|
|
||||||
console.log("Request cancelled");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log("Error while making request: ", err);
|
|
||||||
handleError(endpointId, err);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
executeBtn.disabled = false;
|
|
||||||
executeBtn.textContent = executeBtn.dataset.initialText;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user