Skip to content

Commit 94c824f

Browse files
committed
docs: update api document and resolve render issue for website api page
1 parent d6a9d86 commit 94c824f

File tree

5 files changed

+210
-121
lines changed

5 files changed

+210
-121
lines changed

packages/client-sdk/src/open/client/core/OpenAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const OpenAPI: OpenAPIConfig = {
4747
PASSWORD: undefined,
4848
TOKEN: undefined,
4949
USERNAME: undefined,
50-
VERSION: '1.30.5',
50+
VERSION: '1.30.10',
5151
WITH_CREDENTIALS: false,
5252
interceptors: {
5353
request: new Interceptors(),

src/server/trpc/index.ts

Lines changed: 55 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -27,79 +27,61 @@ export const trpcOpenapiHttpHandler = createOpenApiExpressMiddleware({
2727
const title = 'Tianji OpenAPI';
2828

2929
const description = `
30-
<div style="font-family: system-ui, -apple-system, sans-serif; line-height: 1.6;">
31-
<h2>Tianji - All-in-One Insight Hub</h2>
32-
33-
<p>
34-
<strong>Tianji</strong> is a comprehensive, <strong>open-source</strong> monitoring and analytics platform
35-
designed for independent developers and small teams. It combines multiple essential tools into one lightweight solution.
36-
</p>
37-
38-
<div style="background: #f6f8fa; padding: 12px; border-radius: 6px; margin: 16px 0;">
39-
<strong>Getting Started:</strong> Visit our official website at
40-
<a href="https://tianji.dev/" target="_blank" style="color: #0969da; font-weight: 600;">tianji.dev</a>
41-
for complete documentation, tutorials, and deployment guides.
42-
</div>
43-
44-
<h3>Core Features</h3>
45-
<ul>
46-
<li><strong>Website Analytics</strong> - Track website visitors without cookies (GDPR/CCPA compliant)</li>
47-
<li><strong>Uptime Monitor</strong> - Monitor your services 24/7 with alerts</li>
48-
<li><strong>Server Status</strong> - Real-time server metrics and performance monitoring</li>
49-
<li><strong>Docker Status</strong> - Monitor Docker containers and services</li>
50-
<li><strong>Status Page</strong> - Public status pages for your services</li>
51-
<li><strong>Telemetry</strong> - Collect telemetry data from distributed systems</li>
52-
<li><strong>Survey</strong> - User feedback and satisfaction surveys</li>
53-
<li><strong>Feeds</strong> - Event streams and notification management</li>
54-
<li><strong>Short Link</strong> - URL shortener with analytics</li>
55-
<li><strong>AI Gateway</strong> - AI model proxy with cost tracking</li>
56-
</ul>
57-
58-
<h3>Why Tianji?</h3>
59-
<ul>
60-
<li><strong>Open Source</strong> - Apache 2.0 License, free forever</li>
61-
<li><strong>Privacy First</strong> - GDPR & CCPA compliant, no cookie tracking</li>
62-
<li><strong>All-in-One</strong> - Multiple tools in one lightweight platform</li>
63-
<li><strong>Self-Hosted</strong> - Full control over your data</li>
64-
<li><strong>Community Driven</strong> - Active community and continuous improvements</li>
65-
</ul>
66-
67-
<h3>Authentication</h3>
68-
<p>
69-
The Tianji API uses <strong>Bearer Token</strong> authentication. Include your API key in the Authorization header:
70-
</p>
71-
<pre style="background: #f6f8fa; padding: 12px; border-radius: 6px; overflow-x: auto;">Authorization: Bearer &lt;YOUR_API_KEY&gt;</pre>
72-
73-
<p><strong>How to obtain an API key:</strong></p>
74-
<ol>
75-
<li>Log in to your Tianji instance</li>
76-
<li>Click on your avatar in the top right corner</li>
77-
<li>Navigate to <strong>Settings → API Keys</strong></li>
78-
<li>Click the + button to create a new API key</li>
79-
<li>Name your key and save it securely</li>
80-
</ol>
81-
82-
<p style="margin-top: 12px;">
83-
For detailed authentication instructions and code examples, see the
84-
<a href="https://tianji.dev/docs/api/authentication" target="_blank" style="color: #0969da;">Authentication Documentation</a>.
85-
</p>
86-
87-
<h3>Resources</h3>
88-
<ul>
89-
<li><strong>Website:</strong> <a href="https://tianji.dev/" target="_blank">tianji.dev</a></li>
90-
<li><strong>GitHub:</strong> <a href="https://github.com/msgbyte/tianji" target="_blank">github.com/msgbyte/tianji</a></li>
91-
<li><strong>Community:</strong> <a href="https://discord.gg/8Vv47wAEej" target="_blank">Join our Discord</a></li>
92-
<li><strong>Cloud:</strong> <a href="https://tianji.msgbyte.com/" target="_blank">Try Tianji Cloud</a></li>
93-
</ul>
94-
95-
<hr style="margin: 24px 0; border: none; border-top: 1px solid #d0d7de;">
96-
97-
<p style="color: #57606a; font-size: 0.9em;">
98-
<strong>Note:</strong> This OpenAPI documentation provides programmatic access to all Tianji features.
99-
For detailed usage instructions, examples, and best practices, please visit our
100-
<a href="https://tianji.dev/" target="_blank" style="color: #0969da;">official website</a>.
101-
</p>
102-
</div>
30+
## Tianji - All-in-One Insight Hub
31+
32+
**Tianji** is a comprehensive, **open-source** monitoring and analytics platform designed for independent developers and small teams. It combines multiple essential tools into one lightweight solution.
33+
34+
> **Getting Started:** Visit our official website at [tianji.dev](https://tianji.dev/) for complete documentation, tutorials, and deployment guides.
35+
36+
### Core Features
37+
38+
- **Website Analytics** - Track website visitors without cookies (GDPR/CCPA compliant)
39+
- **Uptime Monitor** - Monitor your services 24/7 with alerts
40+
- **Server Status** - Real-time server metrics and performance monitoring
41+
- **Docker Status** - Monitor Docker containers and services
42+
- **Status Page** - Public status pages for your services
43+
- **Telemetry** - Collect telemetry data from distributed systems
44+
- **Survey** - User feedback and satisfaction surveys
45+
- **Feeds** - Event streams and notification management
46+
- **Short Link** - URL shortener with analytics
47+
- **AI Gateway** - AI model proxy with cost tracking
48+
49+
### Why Tianji?
50+
51+
- **Open Source** - Apache 2.0 License, free forever
52+
- **Privacy First** - GDPR & CCPA compliant, no cookie tracking
53+
- **All-in-One** - Multiple tools in one lightweight platform
54+
- **Self-Hosted** - Full control over your data
55+
- **Community Driven** - Active community and continuous improvements
56+
57+
### Authentication
58+
59+
The Tianji API uses **Bearer Token** authentication. Include your API key in the Authorization header:
60+
61+
\`\`\`
62+
Authorization: Bearer <YOUR_API_KEY>
63+
\`\`\`
64+
65+
**How to obtain an API key:**
66+
67+
1. Log in to your Tianji instance
68+
2. Click on your avatar in the top right corner
69+
3. Navigate to **Settings → API Keys**
70+
4. Click the + button to create a new API key
71+
5. Name your key and save it securely
72+
73+
For detailed authentication instructions and code examples, see the [Authentication Documentation](https://tianji.dev/docs/api/authentication).
74+
75+
### Resources
76+
77+
- **Website:** [tianji.dev](https://tianji.dev/)
78+
- **GitHub:** [github.com/msgbyte/tianji](https://github.com/msgbyte/tianji)
79+
- **Community:** [Join our Discord](https://discord.gg/8Vv47wAEej)
80+
- **Cloud:** [Try Tianji Cloud](https://tianji.msgbyte.com/)
81+
82+
---
83+
84+
**Note:** This OpenAPI documentation provides programmatic access to all Tianji features. For detailed usage instructions, examples, and best practices, please visit our [official website](https://tianji.dev/).
10385
`.trim();
10486

10587
export const trpcOpenapiDocument = generateOpenApiDocument(appRouter, {

website/openapi.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)