@djvlc/openapi-admin-client 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,135 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: DJVLC Admin API
4
+ version: 1.0.0
5
+ description: |
6
+ DJVLC 低代码平台管理端 API
7
+
8
+ 提供以下功能:
9
+ - 页面管理(创建、更新、删除)
10
+ - 草稿管理(保存、获取)
11
+ - 版本管理(发布、回滚)
12
+ - 组件管理(状态控制)
13
+ - 运维操作(Kill Switch)
14
+ contact:
15
+ name: DJVLC Team
16
+ email: dev@djvlc.com
17
+ license:
18
+ name: MIT
19
+ url: https://opensource.org/licenses/MIT
20
+
21
+ servers:
22
+ - url: /api/admin
23
+ description: 管理端 API
24
+
25
+ tags:
26
+ - name: Pages
27
+ description: 页面管理
28
+ - name: Drafts
29
+ description: 草稿管理
30
+ - name: Versions
31
+ description: 版本管理
32
+ - name: Rollout
33
+ description: 灰度发布
34
+ - name: Components
35
+ description: 组件管理
36
+ - name: Definitions
37
+ description: Definition 管理(Action/DataQuery)
38
+ - name: Activities
39
+ description: 活动管理
40
+ - name: Audit
41
+ description: 审计日志
42
+ - name: Operations
43
+ description: 运维操作
44
+
45
+ paths:
46
+ # 页面管理
47
+ /pages:
48
+ $ref: './paths/pages.yaml#/pages'
49
+ /pages/{pageId}:
50
+ $ref: './paths/pages.yaml#/pages~1{pageId}'
51
+
52
+ # 草稿管理
53
+ /pages/{pageId}/draft:
54
+ $ref: './paths/drafts.yaml#/draft'
55
+
56
+ # 版本管理
57
+ /pages/{pageId}/versions:
58
+ $ref: './paths/versions.yaml#/versions'
59
+ /pages/{pageId}/versions/{versionId}:
60
+ $ref: './paths/versions.yaml#/versions~1{versionId}'
61
+ /pages/{pageId}/publish:
62
+ $ref: './paths/versions.yaml#/publish'
63
+ /pages/{pageId}/rollback:
64
+ $ref: './paths/versions.yaml#/rollback'
65
+
66
+ # 组件管理
67
+ /components:
68
+ $ref: './paths/components.yaml#/components'
69
+ /components/{componentId}/versions:
70
+ $ref: './paths/components.yaml#/componentVersions'
71
+ /components/{componentId}/versions/{versionId}/status:
72
+ $ref: './paths/components.yaml#/componentVersionStatus'
73
+
74
+ # 灰度发布
75
+ /pages/{pageId}/rollout:
76
+ $ref: './paths/rollout.yaml#/rollout'
77
+ /pages/{pageId}/rollout/strategies:
78
+ $ref: './paths/rollout.yaml#/rolloutStrategies'
79
+ /pages/{pageId}/rollout/strategies/{strategyId}:
80
+ $ref: './paths/rollout.yaml#/rolloutStrategyById'
81
+
82
+ # Definition 管理
83
+ /definitions/actions:
84
+ $ref: './paths/definitions.yaml#/actionDefinitions'
85
+ /definitions/actions/{definitionId}:
86
+ $ref: './paths/definitions.yaml#/actionDefinitionById'
87
+ /definitions/actions/{definitionId}/versions:
88
+ $ref: './paths/definitions.yaml#/actionDefinitionVersions'
89
+ /definitions/queries:
90
+ $ref: './paths/definitions.yaml#/dataQueryDefinitions'
91
+ /definitions/queries/{definitionId}:
92
+ $ref: './paths/definitions.yaml#/dataQueryDefinitionById'
93
+ /definitions/queries/{definitionId}/versions:
94
+ $ref: './paths/definitions.yaml#/dataQueryDefinitionVersions'
95
+
96
+ # 活动管理
97
+ /activities:
98
+ $ref: './paths/activities.yaml#/activities'
99
+ /activities/{activityId}:
100
+ $ref: './paths/activities.yaml#/activityById'
101
+ /activities/{activityId}/status:
102
+ $ref: './paths/activities.yaml#/activityStatus'
103
+ /activities/{activityId}/stats:
104
+ $ref: './paths/activities.yaml#/activityStats'
105
+
106
+ # 审计日志
107
+ /audit:
108
+ $ref: './paths/audit.yaml#/audit'
109
+ /audit/{auditId}:
110
+ $ref: './paths/audit.yaml#/auditById'
111
+ /audit/stats:
112
+ $ref: './paths/audit.yaml#/auditStats'
113
+
114
+ # 运维操作
115
+ /operations/kill-switch:
116
+ $ref: './paths/operations.yaml#/killSwitch'
117
+ /operations/kill-switch/{pageId}:
118
+ $ref: './paths/operations.yaml#/killSwitchPage'
119
+
120
+ components:
121
+ schemas:
122
+ $ref: './components/schemas/_index.yaml'
123
+ responses:
124
+ $ref: './components/responses/_index.yaml'
125
+ parameters:
126
+ $ref: './components/parameters/_index.yaml'
127
+ securitySchemes:
128
+ BearerAuth:
129
+ type: http
130
+ scheme: bearer
131
+ bearerFormat: JWT
132
+ description: JWT 认证令牌
133
+
134
+ security:
135
+ - BearerAuth: []
@@ -0,0 +1,214 @@
1
+ # Activities 活动管理 API
2
+
3
+ activities:
4
+ get:
5
+ tags:
6
+ - Activities
7
+ summary: 获取活动列表
8
+ operationId: listActivities
9
+ parameters:
10
+ - name: pageSize
11
+ in: query
12
+ schema:
13
+ type: integer
14
+ default: 20
15
+ - name: pageToken
16
+ in: query
17
+ schema:
18
+ type: string
19
+ - name: type
20
+ in: query
21
+ schema:
22
+ type: string
23
+ enum: [claim, signin, lottery, reserve, task, vote, share, bind, custom]
24
+ - name: status
25
+ in: query
26
+ schema:
27
+ type: string
28
+ enum: [draft, scheduled, active, paused, ended, archived]
29
+ responses:
30
+ '200':
31
+ description: 成功
32
+ content:
33
+ application/json:
34
+ schema:
35
+ type: object
36
+ properties:
37
+ success:
38
+ type: boolean
39
+ data:
40
+ type: array
41
+ items:
42
+ $ref: '../components/schemas/_index.yaml#/ActivityInfo'
43
+ meta:
44
+ $ref: '../components/schemas/_index.yaml#/PaginationMeta'
45
+
46
+ post:
47
+ tags:
48
+ - Activities
49
+ summary: 创建活动
50
+ operationId: createActivity
51
+ requestBody:
52
+ required: true
53
+ content:
54
+ application/json:
55
+ schema:
56
+ $ref: '../components/schemas/_index.yaml#/CreateActivityRequest'
57
+ responses:
58
+ '201':
59
+ description: 创建成功
60
+ content:
61
+ application/json:
62
+ schema:
63
+ type: object
64
+ properties:
65
+ success:
66
+ type: boolean
67
+ data:
68
+ $ref: '../components/schemas/_index.yaml#/ActivityInfo'
69
+
70
+ activityById:
71
+ get:
72
+ tags:
73
+ - Activities
74
+ summary: 获取活动详情
75
+ operationId: getActivity
76
+ parameters:
77
+ - name: activityId
78
+ in: path
79
+ required: true
80
+ schema:
81
+ type: string
82
+ responses:
83
+ '200':
84
+ description: 成功
85
+ content:
86
+ application/json:
87
+ schema:
88
+ type: object
89
+ properties:
90
+ success:
91
+ type: boolean
92
+ data:
93
+ $ref: '../components/schemas/_index.yaml#/ActivityDetail'
94
+ '404':
95
+ $ref: '../components/responses/_index.yaml#/NotFound'
96
+
97
+ put:
98
+ tags:
99
+ - Activities
100
+ summary: 更新活动
101
+ operationId: updateActivity
102
+ parameters:
103
+ - name: activityId
104
+ in: path
105
+ required: true
106
+ schema:
107
+ type: string
108
+ requestBody:
109
+ required: true
110
+ content:
111
+ application/json:
112
+ schema:
113
+ $ref: '../components/schemas/_index.yaml#/UpdateActivityRequest'
114
+ responses:
115
+ '200':
116
+ description: 更新成功
117
+ content:
118
+ application/json:
119
+ schema:
120
+ type: object
121
+ properties:
122
+ success:
123
+ type: boolean
124
+ data:
125
+ $ref: '../components/schemas/_index.yaml#/ActivityInfo'
126
+
127
+ delete:
128
+ tags:
129
+ - Activities
130
+ summary: 删除活动
131
+ operationId: deleteActivity
132
+ parameters:
133
+ - name: activityId
134
+ in: path
135
+ required: true
136
+ schema:
137
+ type: string
138
+ responses:
139
+ '204':
140
+ description: 删除成功
141
+
142
+ activityStatus:
143
+ put:
144
+ tags:
145
+ - Activities
146
+ summary: 更新活动状态
147
+ operationId: updateActivityStatus
148
+ parameters:
149
+ - name: activityId
150
+ in: path
151
+ required: true
152
+ schema:
153
+ type: string
154
+ requestBody:
155
+ required: true
156
+ content:
157
+ application/json:
158
+ schema:
159
+ type: object
160
+ required:
161
+ - status
162
+ properties:
163
+ status:
164
+ type: string
165
+ enum: [scheduled, active, paused, ended, archived]
166
+ reason:
167
+ type: string
168
+ responses:
169
+ '200':
170
+ description: 更新成功
171
+ content:
172
+ application/json:
173
+ schema:
174
+ type: object
175
+ properties:
176
+ success:
177
+ type: boolean
178
+ data:
179
+ $ref: '../components/schemas/_index.yaml#/ActivityInfo'
180
+
181
+ activityStats:
182
+ get:
183
+ tags:
184
+ - Activities
185
+ summary: 获取活动统计
186
+ operationId: getActivityStats
187
+ parameters:
188
+ - name: activityId
189
+ in: path
190
+ required: true
191
+ schema:
192
+ type: string
193
+ - name: startDate
194
+ in: query
195
+ schema:
196
+ type: string
197
+ format: date
198
+ - name: endDate
199
+ in: query
200
+ schema:
201
+ type: string
202
+ format: date
203
+ responses:
204
+ '200':
205
+ description: 成功
206
+ content:
207
+ application/json:
208
+ schema:
209
+ type: object
210
+ properties:
211
+ success:
212
+ type: boolean
213
+ data:
214
+ $ref: '../components/schemas/_index.yaml#/ActivityStats'
@@ -0,0 +1,159 @@
1
+ # Audit 审计日志 API
2
+
3
+ audit:
4
+ get:
5
+ tags:
6
+ - Audit
7
+ summary: 查询审计日志
8
+ operationId: listAuditLogs
9
+ parameters:
10
+ - name: pageSize
11
+ in: query
12
+ schema:
13
+ type: integer
14
+ default: 50
15
+ - name: pageToken
16
+ in: query
17
+ schema:
18
+ type: string
19
+ - name: actor
20
+ in: query
21
+ description: 操作者 ID
22
+ schema:
23
+ type: string
24
+ - name: action
25
+ in: query
26
+ description: 操作类型
27
+ schema:
28
+ type: string
29
+ enum:
30
+ - page.publish
31
+ - page.rollback
32
+ - page.delete
33
+ - component.block
34
+ - component.deprecated
35
+ - definition.publish
36
+ - activity.create
37
+ - activity.update
38
+ - rollout.update
39
+ - kill_switch.enable
40
+ - kill_switch.disable
41
+ - name: targetType
42
+ in: query
43
+ description: 目标类型
44
+ schema:
45
+ type: string
46
+ enum: [page, component, activity, definition, rollout, kill_switch]
47
+ - name: targetId
48
+ in: query
49
+ description: 目标 ID
50
+ schema:
51
+ type: string
52
+ - name: traceId
53
+ in: query
54
+ description: 链路追踪 ID
55
+ schema:
56
+ type: string
57
+ - name: startTime
58
+ in: query
59
+ description: 开始时间
60
+ schema:
61
+ type: string
62
+ format: date-time
63
+ - name: endTime
64
+ in: query
65
+ description: 结束时间
66
+ schema:
67
+ type: string
68
+ format: date-time
69
+ - name: riskLevel
70
+ in: query
71
+ description: 风险级别
72
+ schema:
73
+ type: string
74
+ enum: [low, medium, high, critical]
75
+ responses:
76
+ '200':
77
+ description: 成功
78
+ content:
79
+ application/json:
80
+ schema:
81
+ type: object
82
+ properties:
83
+ success:
84
+ type: boolean
85
+ data:
86
+ type: array
87
+ items:
88
+ $ref: '../components/schemas/_index.yaml#/AuditLogEntry'
89
+ meta:
90
+ $ref: '../components/schemas/_index.yaml#/PaginationMeta'
91
+ '401':
92
+ $ref: '../components/responses/_index.yaml#/Unauthorized'
93
+ '403':
94
+ $ref: '../components/responses/_index.yaml#/Forbidden'
95
+
96
+ auditById:
97
+ get:
98
+ tags:
99
+ - Audit
100
+ summary: 获取审计日志详情
101
+ operationId: getAuditLog
102
+ parameters:
103
+ - name: auditId
104
+ in: path
105
+ required: true
106
+ schema:
107
+ type: string
108
+ responses:
109
+ '200':
110
+ description: 成功
111
+ content:
112
+ application/json:
113
+ schema:
114
+ type: object
115
+ properties:
116
+ success:
117
+ type: boolean
118
+ data:
119
+ $ref: '../components/schemas/_index.yaml#/AuditLogDetail'
120
+ '404':
121
+ $ref: '../components/responses/_index.yaml#/NotFound'
122
+
123
+ auditStats:
124
+ get:
125
+ tags:
126
+ - Audit
127
+ summary: 获取审计统计
128
+ operationId: getAuditStats
129
+ parameters:
130
+ - name: startDate
131
+ in: query
132
+ required: true
133
+ schema:
134
+ type: string
135
+ format: date
136
+ - name: endDate
137
+ in: query
138
+ required: true
139
+ schema:
140
+ type: string
141
+ format: date
142
+ - name: groupBy
143
+ in: query
144
+ schema:
145
+ type: string
146
+ enum: [action, actor, targetType, riskLevel]
147
+ default: action
148
+ responses:
149
+ '200':
150
+ description: 成功
151
+ content:
152
+ application/json:
153
+ schema:
154
+ type: object
155
+ properties:
156
+ success:
157
+ type: boolean
158
+ data:
159
+ $ref: '../components/schemas/_index.yaml#/AuditStats'
@@ -0,0 +1,88 @@
1
+ # 组件管理相关路径
2
+
3
+ components:
4
+ get:
5
+ tags: [Components]
6
+ operationId: listComponents
7
+ summary: 获取组件列表
8
+ description: 获取平台中所有可用的组件
9
+ parameters:
10
+ - $ref: '../components/parameters/_index.yaml#/PageParam'
11
+ - $ref: '../components/parameters/_index.yaml#/LimitParam'
12
+ - name: category
13
+ in: query
14
+ schema:
15
+ type: string
16
+ description: 按分类筛选
17
+ - name: status
18
+ in: query
19
+ schema:
20
+ type: string
21
+ enum: [active, deprecated, disabled]
22
+ description: 按状态筛选
23
+ responses:
24
+ '200':
25
+ description: 成功
26
+ content:
27
+ application/json:
28
+ schema:
29
+ $ref: '../components/schemas/_index.yaml#/ComponentListResponse'
30
+ '401':
31
+ $ref: '../components/responses/_index.yaml#/Unauthorized'
32
+ '500':
33
+ $ref: '../components/responses/_index.yaml#/InternalError'
34
+
35
+ componentVersions:
36
+ get:
37
+ tags: [Components]
38
+ operationId: listComponentVersions
39
+ summary: 获取组件版本列表
40
+ description: 获取指定组件的所有版本
41
+ parameters:
42
+ - $ref: '../components/parameters/_index.yaml#/ComponentIdPath'
43
+ - $ref: '../components/parameters/_index.yaml#/PageParam'
44
+ - $ref: '../components/parameters/_index.yaml#/LimitParam'
45
+ responses:
46
+ '200':
47
+ description: 成功
48
+ content:
49
+ application/json:
50
+ schema:
51
+ $ref: '../components/schemas/_index.yaml#/ComponentVersionListResponse'
52
+ '401':
53
+ $ref: '../components/responses/_index.yaml#/Unauthorized'
54
+ '404':
55
+ $ref: '../components/responses/_index.yaml#/NotFound'
56
+ '500':
57
+ $ref: '../components/responses/_index.yaml#/InternalError'
58
+
59
+ componentVersionStatus:
60
+ put:
61
+ tags: [Components]
62
+ operationId: updateComponentVersionStatus
63
+ summary: 更新组件版本状态
64
+ description: 更新指定组件版本的状态(启用/禁用/废弃)
65
+ parameters:
66
+ - $ref: '../components/parameters/_index.yaml#/ComponentIdPath'
67
+ - $ref: '../components/parameters/_index.yaml#/VersionIdPath'
68
+ requestBody:
69
+ required: true
70
+ content:
71
+ application/json:
72
+ schema:
73
+ $ref: '../components/schemas/_index.yaml#/UpdateComponentStatusRequest'
74
+ responses:
75
+ '200':
76
+ description: 更新成功
77
+ content:
78
+ application/json:
79
+ schema:
80
+ $ref: '../components/schemas/_index.yaml#/ComponentVersionResponse'
81
+ '400':
82
+ $ref: '../components/responses/_index.yaml#/BadRequest'
83
+ '401':
84
+ $ref: '../components/responses/_index.yaml#/Unauthorized'
85
+ '404':
86
+ $ref: '../components/responses/_index.yaml#/NotFound'
87
+ '500':
88
+ $ref: '../components/responses/_index.yaml#/InternalError'