Skip to content

Commit 498cb57

Browse files
authored
Merge pull request #145 from flashcatcloud/codex/upload-openapi-json-oss
ci: 上传 OpenAPI JSON 到 OSS
2 parents 079f294 + de978eb commit 498cb57

138 files changed

Lines changed: 64964 additions & 37357 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/api-review/mapping.yaml

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,17 @@ modules:
385385
- name: fc-rum
386386
paths: [controller/application, logic/application, types]
387387

388+
rum/data:
389+
priority: 305
390+
tag_en: "Data query"
391+
tag_zh: "RUM 数据查询"
392+
icon: "chart-line"
393+
path_prefixes: [/rum/data]
394+
providers: [rum]
395+
repos:
396+
- name: fc-rum
397+
paths: [controller/data, logic/data, types]
398+
388399
rum/issue:
389400
priority: 310
390401
tag_en: "Issues"
@@ -423,11 +434,11 @@ modules:
423434
tag_en: "Facets"
424435
tag_zh: "RUM 自定义字段"
425436
icon: "filter"
426-
path_prefixes: [/rum/facet]
437+
path_prefixes: [/rum/facet, /rum/field]
427438
providers: [rum]
428439
repos:
429440
- name: fc-rum
430-
paths: [controller/facet, logic/facet, types]
441+
paths: [controller/facet, controller/field, logic/facet, logic/field, types]
431442

432443
rum/sourcemap:
433444
priority: 350
@@ -543,10 +554,68 @@ modules:
543554
path_prefixes: [/push, /kv, /onboarding]
544555
providers: [pgy]
545556

557+
safari/session:
558+
priority: 580
559+
tag_en: "Sessions"
560+
tag_zh: "会话"
561+
icon: "comments"
562+
path_prefixes: [/safari/session]
563+
providers: [safari]
564+
repos:
565+
- name: fc-safari
566+
paths: [cmd/api/sessions, logic/session, types]
567+
568+
safari/automation:
569+
priority: 590
570+
tag_en: "Automations"
571+
tag_zh: "自动化"
572+
icon: "clock"
573+
path_prefixes:
574+
- /safari/automation/rule
575+
- /safari/automation/template
576+
- /safari/automation/run
577+
providers: [safari]
578+
repos:
579+
- name: fc-safari
580+
paths: [cmd/api/automation, logic/automation, model/automation, types]
581+
582+
safari/skill:
583+
priority: 600
584+
tag_en: "Skills"
585+
tag_zh: "技能"
586+
icon: "wand-magic-sparkles"
587+
path_prefixes: [/safari/skill]
588+
providers: [safari]
589+
repos:
590+
- name: fc-safari
591+
paths: [cmd/api/skills, logic/skill, types]
592+
593+
safari/mcp:
594+
priority: 610
595+
tag_en: "MCP servers"
596+
tag_zh: "MCP 服务器"
597+
icon: "plug"
598+
path_prefixes: [/safari/mcp]
599+
providers: [safari]
600+
repos:
601+
- name: fc-safari
602+
paths: [cmd/api/mcp, logic/mcp, types]
603+
604+
safari/a2a-agent:
605+
priority: 620
606+
tag_en: "A2A agents"
607+
tag_zh: "A2A 智能体"
608+
icon: "robot"
609+
path_prefixes: [/safari/a2a-agent]
610+
providers: [safari]
611+
repos:
612+
- name: fc-safari
613+
paths: [cmd/api/a2a, logic/a2a, types]
614+
546615
_internal/safari:
547616
hidden: true
548-
reason: "AI agent (fc-safari) — separate product surface, not part of the public Flashduty API."
549-
path_prefixes: [/safari, /copilot, /ai]
617+
reason: "Internal AI agent routes that remain non-public or are not yet published."
618+
path_prefixes: [/copilot, /ai]
550619
providers: [safari, event]
551620

552621
_internal/echo:
@@ -571,4 +640,3 @@ modules:
571640
reason: "Small unfinished surfaces; revisit when stable."
572641
path_prefixes: [/collab, /change, /onboarding]
573642
providers: [event, pgy]
574-
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Upload OpenAPI JSON to OSS
2+
3+
on:
4+
push:
5+
branches: [main, test]
6+
paths:
7+
- 'api-reference/*.json'
8+
- 'integration-docs/scripts/upload-openapi.mjs'
9+
- 'integration-docs/scripts/upload-openapi.test.mjs'
10+
- 'integration-docs/package.json'
11+
- '.github/workflows/openapi-json-upload.yml'
12+
workflow_dispatch:
13+
inputs:
14+
environment:
15+
description: 'Target environment'
16+
required: true
17+
default: 'development'
18+
type: choice
19+
options:
20+
- development
21+
- production
22+
- both
23+
24+
jobs:
25+
test-openapi-upload:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 18
35+
36+
- name: Install dependencies
37+
working-directory: integration-docs
38+
run: npm install
39+
40+
- name: Test OpenAPI upload script
41+
working-directory: integration-docs
42+
run: npm run test:openapi-upload
43+
44+
upload-development:
45+
needs: test-openapi-upload
46+
if: github.ref == 'refs/heads/test' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.environment == 'development' || github.event.inputs.environment == 'both'))
47+
runs-on: ubuntu-latest
48+
environment: development
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
53+
- name: Setup Node.js
54+
uses: actions/setup-node@v4
55+
with:
56+
node-version: 18
57+
58+
- name: Install dependencies
59+
working-directory: integration-docs
60+
run: npm install
61+
62+
- name: Upload development OpenAPI JSON
63+
working-directory: integration-docs
64+
env:
65+
CDN_ACCESS_KEY: ${{ secrets.CDN_ACCESS_KEY }}
66+
CDN_SECRET_KEY: ${{ secrets.CDN_SECRET_KEY }}
67+
CDN_BUCKET: ${{ secrets.CDN_BUCKET }}
68+
CDN_REGION: ${{ secrets.CDN_REGION }}
69+
CDN_ENDPOINT: ${{ secrets.CDN_ENDPOINT }}
70+
CDN_URL: ${{ secrets.CDN_URL }}
71+
CDN_DIR: '/test/docs'
72+
run: npm run upload:openapi
73+
74+
upload-production:
75+
needs: test-openapi-upload
76+
if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.environment == 'production' || github.event.inputs.environment == 'both'))
77+
runs-on: ubuntu-latest
78+
environment: production
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v4
82+
83+
- name: Setup Node.js
84+
uses: actions/setup-node@v4
85+
with:
86+
node-version: 18
87+
88+
- name: Install dependencies
89+
working-directory: integration-docs
90+
run: npm install
91+
92+
- name: Upload production OpenAPI JSON
93+
working-directory: integration-docs
94+
env:
95+
CDN_ACCESS_KEY: ${{ secrets.CDN_ACCESS_KEY }}
96+
CDN_SECRET_KEY: ${{ secrets.CDN_SECRET_KEY }}
97+
CDN_BUCKET: ${{ secrets.CDN_BUCKET }}
98+
CDN_REGION: ${{ secrets.CDN_REGION }}
99+
CDN_ENDPOINT: ${{ secrets.CDN_ENDPOINT }}
100+
CDN_URL: ${{ secrets.CDN_URL }}
101+
CDN_DIR: '/docs'
102+
run: npm run upload:openapi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ docs/
1313

1414
# claude code worktrees
1515
.claude/worktrees/
16+
.worktrees/

api-reference/monitors.openapi.en.json

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
{
3333
"name": "Monitors/Diagnostics",
3434
"description": "Diagnostic and query endpoints used by Flashduty AI SRE — ad-hoc data source queries, log/metric diagnostics, and target-side tool invocation."
35+
},
36+
{
37+
"name": "Monitors/Monitor utilities",
38+
"description": "Monitors service activation and data preview utilities."
3539
}
3640
],
3741
"paths": {
@@ -2981,6 +2985,85 @@
29812985
}
29822986
}
29832987
}
2988+
},
2989+
"/monit/preview/sync": {
2990+
"post": {
2991+
"operationId": "monit-preview-sync",
2992+
"summary": "Preview datasource query",
2993+
"description": "Execute a synchronous datasource query and return the raw result. Used to preview alert rule expressions before saving.",
2994+
"tags": [
2995+
"Monitors/Monitor utilities"
2996+
],
2997+
"x-mint": {
2998+
"content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **60 requests/minute**; **10 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `ds_type` must match the datasource type (e.g. `prometheus`, `loki`).\n- `ds_name` is the display name of the datasource as configured in the account.\n- `delay_seconds` shifts the query window backward by the specified number of seconds, useful for accommodating data ingestion latency.\n- The response body is the raw JSON returned by the datasource — its schema varies by datasource type.",
2999+
"href": "/en/api-reference/monitors/monitor-utilities/monit-preview-sync",
3000+
"metadata": {
3001+
"sidebarTitle": "Preview datasource query"
3002+
}
3003+
},
3004+
"responses": {
3005+
"200": {
3006+
"description": "Success",
3007+
"content": {
3008+
"application/json": {
3009+
"schema": {
3010+
"allOf": [
3011+
{
3012+
"$ref": "#/components/schemas/SuccessEnvelope"
3013+
},
3014+
{
3015+
"type": "object",
3016+
"properties": {
3017+
"data": {
3018+
"$ref": "#/components/schemas/PreviewSyncResponse"
3019+
}
3020+
}
3021+
}
3022+
]
3023+
},
3024+
"example": {
3025+
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
3026+
"data": {
3027+
"status": "success",
3028+
"data": {
3029+
"resultType": "vector",
3030+
"result": []
3031+
}
3032+
}
3033+
}
3034+
}
3035+
}
3036+
},
3037+
"400": {
3038+
"$ref": "#/components/responses/BadRequest"
3039+
},
3040+
"401": {
3041+
"$ref": "#/components/responses/Unauthorized"
3042+
},
3043+
"429": {
3044+
"$ref": "#/components/responses/TooManyRequests"
3045+
},
3046+
"500": {
3047+
"$ref": "#/components/responses/ServerError"
3048+
}
3049+
},
3050+
"requestBody": {
3051+
"required": true,
3052+
"content": {
3053+
"application/json": {
3054+
"schema": {
3055+
"$ref": "#/components/schemas/PreviewSyncRequest"
3056+
},
3057+
"example": {
3058+
"ds_type": "prometheus",
3059+
"ds_name": "Prometheus Prod",
3060+
"expr": "rate(http_requests_total[5m])",
3061+
"delay_seconds": 0
3062+
}
3063+
}
3064+
}
3065+
}
3066+
}
29843067
}
29853068
},
29863069
"components": {
@@ -5614,6 +5697,44 @@
56145697
"description": "Opaque cursor for the next page. Absent / empty means this is the last page."
56155698
}
56165699
}
5700+
},
5701+
"PreviewSyncRequest": {
5702+
"type": "object",
5703+
"required": [
5704+
"ds_type",
5705+
"ds_name",
5706+
"expr"
5707+
],
5708+
"description": "Parameters for a synchronous datasource query preview.",
5709+
"properties": {
5710+
"ds_type": {
5711+
"type": "string",
5712+
"description": "Datasource type, e.g. `prometheus`, `loki`, `elasticsearch`."
5713+
},
5714+
"ds_name": {
5715+
"type": "string",
5716+
"description": "Datasource display name as configured in the account."
5717+
},
5718+
"expr": {
5719+
"type": "string",
5720+
"description": "Query expression. Format depends on `ds_type` (PromQL for Prometheus, LogQL for Loki, etc.)."
5721+
},
5722+
"delay_seconds": {
5723+
"type": "integer",
5724+
"description": "Shift the query window backward by this many seconds to compensate for data ingestion latency."
5725+
},
5726+
"args": {
5727+
"type": "object",
5728+
"additionalProperties": {
5729+
"type": "string"
5730+
},
5731+
"description": "Additional type-specific query arguments."
5732+
}
5733+
}
5734+
},
5735+
"PreviewSyncResponse": {
5736+
"type": "object",
5737+
"description": "Raw JSON response from the datasource. Schema varies by datasource type."
56175738
}
56185739
}
56195740
}

0 commit comments

Comments
 (0)