OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,132 @@
# Bearer-auth JSON-RPC requests — for local exploration / debugging the
# Bearer auth path on /api/jsonrpc.
#
# Setup (one-time per environment):
# 1. Copy http-client.sample.env.json -> http-client.env.json
# 2. Edit http-client.env.json: set base-url and bearer-token
# 3. To mint a fresh bearer (no AdvancedAuth plugin required):
# php bin/leantime auth:create-bearer-token --email=you@example.com --quiet-output
# Copy the output into the bearer-token env var.
#
# These mirror the BearerApiCest.php contract suite, which is what runs
# in CI on every PR. Use this file when you need to poke at the auth
# behavior manually (different user, different project, different role)
# without running the full Codeception harness.
###
# whoami — server-authoritative session resolution from Bearer
POST {{ base-url }}/api/jsonrpc
Authorization: Bearer {{ bearer-token }}
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "leantime.rpc.Users.Users.getUser",
"params": {},
"id": 1
}
###
# Projects accessible to the bearer's user
POST {{ base-url }}/api/jsonrpc
Authorization: Bearer {{ bearer-token }}
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "leantime.rpc.Projects.Projects.getProjectsUserHasAccessTo",
"params": {},
"id": 1
}
###
# Open tickets across all accessible projects
POST {{ base-url }}/api/jsonrpc
Authorization: Bearer {{ bearer-token }}
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "leantime.rpc.Tickets.Tickets.getAllOpenUserTickets",
"params": {},
"id": 1
}
###
# Get a single ticket — projectIdParam-resolved permission check.
# This is the call that started returning -32001 in the 2026-06 deploy.
POST {{ base-url }}/api/jsonrpc
Authorization: Bearer {{ bearer-token }}
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "leantime.rpc.Tickets.Tickets.getTicket",
"params": {"id": 1},
"id": 1
}
###
# Quick-add a ticket — RPC mutation under bearer
POST {{ base-url }}/api/jsonrpc
Authorization: Bearer {{ bearer-token }}
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "leantime.rpc.Tickets.Tickets.quickAddTicket",
"params": {
"params": {
"headline": "Bearer-auth manual test",
"projectId": 1
}
},
"id": 1
}
###
# Get comments on a ticket — entityScoped permission check.
# Second of the 2026-06 regression pair.
POST {{ base-url }}/api/jsonrpc
Authorization: Bearer {{ bearer-token }}
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "leantime.rpc.Comments.Comments.getComments",
"params": {"module": "ticket", "moduleId": 1},
"id": 1
}
###
# Unread notifications count
POST {{ base-url }}/api/jsonrpc
Authorization: Bearer {{ bearer-token }}
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "leantime.rpc.Notifications.Notifications.getUnreadCount",
"params": {},
"id": 1
}
###
# Missing bearer — expect 401
POST {{ base-url }}/api/jsonrpc
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "leantime.rpc.Tickets.Tickets.getAllOpenUserTickets",
"params": {},
"id": 1
}

View File

@@ -0,0 +1,74 @@
# Poll Comments
# @no-redirect
POST {{ base-url }}/api/jsonrpc
x-api-key: {{ x-api-key }}
Content-Type: Content-Type: application/json
User-Agent: IntelliJ HTTP Client/PhpStorm 2024.2.4
Accept-Encoding: br, deflate, gzip, x-gzip
Accept: */*
x-http2-scheme: https
Content-Length: 234
[
{
"method": "leantime.rpc.Comments.pollComments",
"params": {"projectId": 3},
"id": 1,
"jsonrpc": "2.0"
},
{
"method": "leantime.rpc.Comments.pollComments",
"params": {"projectId": 3},
"id": 1,
"jsonrpc": "2.0"
}
]
<> 2025-09-30T081831.303.html
###
# api key auth
# @no-redirect
POST {{ base-url }}/api/jsonrpc
x-api-key: {{x-api-key}}
Content-Type: Content-Type: application/json
User-Agent: IntelliJ HTTP Client/PhpStorm 2024.3
Accept-Encoding: br, deflate, gzip, x-gzip
Accept: */*
Content-Length: 193
x-http2-scheme: https
<> 2025-06-09T190524.200.json
###
# create client
# @no-redirect
POST {{ base-url }}/api/jsonrpc
x-api-key: {{x-api-key}}
Content-Type: Content-Type: application/json
User-Agent: IntelliJ HTTP Client/PhpStorm 2024.3
Accept-Encoding: br, deflate, gzip, x-gzip
Accept: */*
Content-Length: 193
x-http2-scheme: https
{
"method": "leantime.rpc.Clients.Clients.create",
"jsonrpc": "2.0",
"id": "create-client-1",
"params": {
"values": {
"name": "Test Client"
}
}
}
<> 2025-06-09T190503.200.json

112
tests/Httprequests/MCP.http Normal file
View File

@@ -0,0 +1,112 @@
# List Prompts
# @no-redirect
POST {{ base-url }}/mcp
Authorization: Bearer {{ bearer-token }}
Content-Type: Content-Type: application/json
User-Agent: IntelliJ HTTP Client/PhpStorm 2024.3
Accept-Encoding: br, deflate, gzip, x-gzip
Accept: application/json
x-http2-scheme: https
Mcp-Session-Id: f703118b3b1e83a46fb02c22511da140
Content-Length: 106
{
"method": "prompts/list",
"jsonrpc": "2.0",
"id": "create-client-1",
"params": {
}
}
<> 2025-06-28T161808.200.json
###
# Initiatlize
# @no-redirect
POST {{ base-url }}/mcp
Authorization: Bearer {{ bearer-token }}
Content-Type: Content-Type: application/json
User-Agent: IntelliJ HTTP Client/PhpStorm 2024.3
Accept-Encoding: br, deflate, gzip, x-gzip
Accept: application/json
x-http2-scheme: https
Mcp-Session-Id: f703118b3b1e83a46fb02c22511da140
Content-Length: 200
{
"method": "initialize",
"jsonrpc": "2.0",
"id": "1",
"params": {"protocolVersion":"2025-03-26","capabilities":[],"clientInfo":{"name":"mcp-remote-fallback-test","version":"0.0.0"}}
}
<> 2025-06-28T161740.400.json
###
# Tool Call getCalendar
# @no-redirect
POST {{ base-url }}/mcp
Authorization: Bearer {{ bearer-token }}
Content-Type: Content-Type: application/json
User-Agent: IntelliJ HTTP Client/PhpStorm 2024.3
Accept-Encoding: br, deflate, gzip, x-gzip
Accept: */*
x-http2-scheme: https
Content-Length: 236
{
"method": "tools/call",
"jsonrpc": "2.0",
"id": "1",
"params": {
"name": "getCalendar",
"arguments": {
"from": "2025-06-15 00:00:00-0100",
"until": "2025-06-17 00:00:00-0100"
}
}
}
<> 2025-06-20T122107.200.json
###
# Tools List
# @no-redirect
POST {{ base-url }}/mcp
Authorization: Bearer {{ bearer-token }}
Content-Type: Content-Type: application/json
User-Agent: IntelliJ HTTP Client/PhpStorm 2024.3
Accept-Encoding: br, deflate, gzip, x-gzip
Accept: */*
x-http2-scheme: https
Content-Length: 104
{
"method": "tools/list",
"jsonrpc": "2.0",
"id": "create-client-1",
"params": {
}
}
<> 2025-06-16T081130.200.json
###
# Auth no body
# @no-redirect
POST {{ base-url }}/mcp
Authorization: Bearer {{ bearer-token }}
Content-Type: Content-Type: application/json
User-Agent: IntelliJ HTTP Client/PhpStorm 2024.3
Accept-Encoding: br, deflate, gzip, x-gzip
Accept: */*
x-http2-scheme: https
content-length: 0
<> 2025-06-16T081028.200.json
###

View File

@@ -0,0 +1,7 @@
{
"dev": {
"base-url": "https://localhost",
"x-api-key": "APIKEY",
"bearer-token": "TOKEN"
}
}