added api docs
This commit is contained in:
parent
66aa62e624
commit
53302ff29b
18
content/docs/api.md
Normal file
18
content/docs/api.md
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
weight: 100
|
||||
title: "MoonVeil REST API"
|
||||
description: "Perform obfuscations programmatically"
|
||||
icon: "article"
|
||||
date: "2025-05-01T18:47:58-05:00"
|
||||
lastmod: "2025-05-01T18:47:58-05:00"
|
||||
---
|
||||
|
||||
MoonVeil is available to be used programmatically via it's web API if you'd like. Start by [creating an API token](/account).
|
||||
|
||||
## Authorization
|
||||
|
||||
Each API request expects an `Authorization` header in the format of `Authorization: Bearer mv-secret-...` where `mv-secret-...` is the API token you just created.
|
||||
{{% alert context="warning" text="**DO NOT** share this token with anyone else!" /%}}
|
||||
|
||||
{{< swagger >}}
|
||||
|
@ -9,4 +9,4 @@ lastmod: "2025-05-01T18:47:58-05:00"
|
||||
|
||||
[Macros](./macros/) are a collection of reserved global functions available for use in your scripts. These are only available at obfuscation-time and are not available at runtime, meaning trying to access these functions dynamically will fail.
|
||||
|
||||
They can be used in any script in [your dashboard](./dashboard/) and provide many useful tools for obfuscation.
|
||||
They can be used in any script in [your dashboard](./dashboard/) or through the [API](./api/) and provide many useful tools for obfuscation.
|
132
layouts/shortcodes/swagger.html
Normal file
132
layouts/shortcodes/swagger.html
Normal file
@ -0,0 +1,132 @@
|
||||
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui.css" />
|
||||
<script src="https://unpkg.com/swagger-ui-dist@5.11.0/swagger-ui-bundle.js" crossorigin></script>
|
||||
|
||||
<style>
|
||||
/* TODO: i just threw shit in here until it semi fit the theme, im so sorry */
|
||||
.information-container,
|
||||
.servers,
|
||||
.models {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.swagger-ui {
|
||||
fill: var(--body-color);
|
||||
color: var(--body-color);
|
||||
}
|
||||
|
||||
.swagger-ui .btn {
|
||||
background: var(--primary);
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.1);
|
||||
color: var(--body-color);
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
padding: 5px 23px;
|
||||
transition: all .3s;
|
||||
}
|
||||
|
||||
.swagger-ui .body-param-options {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.swagger-ui .btn.cancel {
|
||||
background: var(--danger);
|
||||
color: var(--body-color);
|
||||
}
|
||||
|
||||
.swagger-ui .prop-type {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.swagger-ui .opblock-description-wrapper p, .swagger-ui .opblock .opblock-section-header h4, .swagger-ui table thead tr td, .swagger-ui table thead tr th, .swagger-ui .parameter__name {
|
||||
fill: var(--body-color);
|
||||
color: var(--body-color);
|
||||
}
|
||||
|
||||
.swagger-ui .model, .swagger-ui .model-title, .swagger-ui .parameter__type, .swagger-ui .tab li, .swagger-ui label, .swagger-ui .opblock .opblock-section-header > label {
|
||||
fill: var(--body-color);
|
||||
color: var(--body-color);
|
||||
}
|
||||
|
||||
.swagger-ui, .swagger-ui .response-col_status, .swagger-ui .responses-inner h4, .swagger-ui .model-toggle {
|
||||
fill: var(--body-color);
|
||||
color: var(--body-color);
|
||||
}
|
||||
|
||||
.swagger-ui textarea {
|
||||
background: var(--code-block-bg);
|
||||
color: var(--body-color);
|
||||
}
|
||||
|
||||
.swagger-ui .parameters-col_description, .swagger-ui .response-col_description, .swagger-ui table th, .swagger-ui table td {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.docs-content .main-content ul > li::before, .swagger-ui .opblock .opblock-section-header > label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.docs-content .main-content ul > li {
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.swagger-ui .opblock-summary {
|
||||
background-color: var(--primary-color);
|
||||
color: var(--body-color);
|
||||
fill: var(--body-color);
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.swagger-ui .opblock-summary .opblock-summary-path {
|
||||
color: var(--body-color);
|
||||
}
|
||||
|
||||
.swagger-ui .opblock .opblock-summary-description {
|
||||
color: var(--body-color);
|
||||
}
|
||||
|
||||
.swagger-ui .opblock .opblock-section-header {
|
||||
align-items: center;
|
||||
background: var(--primary-color);
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.1);
|
||||
display: flex;
|
||||
min-height: 50px;
|
||||
padding: 8px 20px;
|
||||
}
|
||||
|
||||
.swagger-ui .wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.swagger-ui .scheme-container, .title {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="swagger-ui"></div>
|
||||
<script>
|
||||
|
||||
window.onload = () => {
|
||||
// Build a system
|
||||
const ui = SwaggerUIBundle({
|
||||
url: "https://moonveil.cc/api/doc.json",
|
||||
deepLinking: false,
|
||||
dom_id: "#swagger-ui",
|
||||
persistAuthorization: true,
|
||||
validatorUrl: null,
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
],
|
||||
plugins: [
|
||||
],
|
||||
layout: "BaseLayout",
|
||||
})
|
||||
window.ui = ui
|
||||
};
|
||||
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user