@djvlc/openapi-user-client 1.7.15 → 1.8.1
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.
- package/dist/index.d.mts +1725 -3725
- package/dist/index.d.ts +1725 -3725
- package/dist/index.js +1436 -2991
- package/dist/index.mjs +1286 -2673
- package/openapi/dist/user-api.yaml +1252 -1521
- package/openapi/src/components/schemas/_index.yaml +850 -1025
- package/openapi/src/openapi.yaml +30 -20
- package/openapi/src/paths/actions.yaml +15 -50
- package/openapi/src/paths/activities.yaml +132 -94
- package/openapi/src/paths/health.yaml +19 -61
- package/openapi/src/paths/pages.yaml +98 -30
- package/openapi/src/paths/queries.yaml +32 -52
- package/openapi/src/paths/tenant.yaml +15 -49
- package/openapi/src/paths/track.yaml +9 -53
- package/package.json +2 -2
|
@@ -4,69 +4,76 @@ resolve:
|
|
|
4
4
|
get:
|
|
5
5
|
tags: [Pages]
|
|
6
6
|
operationId: resolvePage
|
|
7
|
-
summary:
|
|
7
|
+
summary: 解析页面
|
|
8
8
|
description: |
|
|
9
|
-
Runtime
|
|
9
|
+
Runtime 核心接口,返回渲染所需的完整数据。
|
|
10
10
|
|
|
11
11
|
支持两种模式:
|
|
12
12
|
1. 稳定入口(推荐):支持灰度/回滚/ops,返回 resolvedVersionId 和 CDN 地址
|
|
13
|
-
2. 保底模式:当 includeSnapshot=
|
|
14
|
-
|
|
15
|
-
响应包含:
|
|
16
|
-
- resolvedVersionId: 解析后的页面版本 ID(考虑灰度/回滚)
|
|
17
|
-
- cdnBase: CDN 基础地址
|
|
18
|
-
- snapshotUrl: snapshot.json 的完整 URL
|
|
19
|
-
- manifestUrl: manifest.json 的完整 URL
|
|
20
|
-
- ops: 运维配置(killSwitch、blockedComponents、flags)
|
|
21
|
-
- etag: 内容哈希(用于缓存)
|
|
22
|
-
- cacheTtlSeconds: 缓存 TTL(建议 10~30 秒)
|
|
23
|
-
- snapshot: 完整快照(仅当 includeSnapshot=1 时返回)
|
|
13
|
+
2. 保底模式:当 includeSnapshot=true 时,返回完整 snapshot(CDN 失败时使用)
|
|
24
14
|
parameters:
|
|
25
|
-
- name: X-Trace-Id
|
|
26
|
-
in: header
|
|
27
|
-
required: false
|
|
28
|
-
schema:
|
|
29
|
-
type: string
|
|
30
|
-
description: 链路追踪 ID(OTel,全链路透传)
|
|
31
15
|
- name: pageId
|
|
32
16
|
in: query
|
|
33
17
|
required: true
|
|
18
|
+
description: 页面 ID
|
|
34
19
|
schema:
|
|
35
20
|
type: string
|
|
36
|
-
|
|
21
|
+
example: page_123456
|
|
37
22
|
- name: env
|
|
38
23
|
in: query
|
|
39
24
|
required: false
|
|
25
|
+
description: 环境
|
|
40
26
|
schema:
|
|
41
27
|
type: string
|
|
42
28
|
enum: [prod, preview, staging]
|
|
43
29
|
default: prod
|
|
44
|
-
|
|
30
|
+
example: prod
|
|
31
|
+
- name: includeSnapshot
|
|
32
|
+
in: query
|
|
33
|
+
required: false
|
|
34
|
+
description: 是否包含完整快照(CDN 失败保底)
|
|
35
|
+
schema:
|
|
36
|
+
type: boolean
|
|
37
|
+
default: false
|
|
45
38
|
- name: uid
|
|
46
39
|
in: query
|
|
47
40
|
required: false
|
|
41
|
+
description: 用户 ID(契约 query;也可用 Header x-user-id)
|
|
48
42
|
schema:
|
|
49
43
|
type: string
|
|
50
|
-
|
|
44
|
+
maxLength: 64
|
|
45
|
+
example: user_123456
|
|
51
46
|
- name: deviceId
|
|
52
47
|
in: query
|
|
53
48
|
required: false
|
|
49
|
+
description: 设备 ID(契约 query;也可用 Header x-device-id)
|
|
54
50
|
schema:
|
|
55
51
|
type: string
|
|
56
|
-
|
|
52
|
+
maxLength: 64
|
|
53
|
+
example: device_123456
|
|
57
54
|
- name: channel
|
|
58
55
|
in: query
|
|
59
56
|
required: false
|
|
57
|
+
description: 渠道(契约 query;也可用 Header x-channel)
|
|
60
58
|
schema:
|
|
61
59
|
type: string
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
maxLength: 64
|
|
61
|
+
example: wechat
|
|
62
|
+
- name: x-user-id
|
|
63
|
+
in: header
|
|
64
|
+
required: true
|
|
66
65
|
schema:
|
|
67
|
-
type:
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
type: string
|
|
67
|
+
- name: x-device-id
|
|
68
|
+
in: header
|
|
69
|
+
required: true
|
|
70
|
+
schema:
|
|
71
|
+
type: string
|
|
72
|
+
- name: x-channel
|
|
73
|
+
in: header
|
|
74
|
+
required: true
|
|
75
|
+
schema:
|
|
76
|
+
type: string
|
|
70
77
|
responses:
|
|
71
78
|
'200':
|
|
72
79
|
description: 解析成功
|
|
@@ -80,3 +87,64 @@ resolve:
|
|
|
80
87
|
$ref: '../components/responses/_index.yaml#/NotFound'
|
|
81
88
|
'503':
|
|
82
89
|
$ref: '../components/responses/_index.yaml#/ServiceUnavailable'
|
|
90
|
+
|
|
91
|
+
manifest:
|
|
92
|
+
get:
|
|
93
|
+
tags: [Pages]
|
|
94
|
+
operationId: getPageManifest
|
|
95
|
+
summary: 获取组件清单
|
|
96
|
+
description: 返回页面的组件锁定清单
|
|
97
|
+
parameters:
|
|
98
|
+
- name: pageId
|
|
99
|
+
in: query
|
|
100
|
+
required: true
|
|
101
|
+
description: 页面 ID
|
|
102
|
+
schema:
|
|
103
|
+
type: string
|
|
104
|
+
example: page_123456
|
|
105
|
+
- name: env
|
|
106
|
+
in: query
|
|
107
|
+
required: false
|
|
108
|
+
description: 环境
|
|
109
|
+
schema:
|
|
110
|
+
type: string
|
|
111
|
+
enum: [prod, preview, staging]
|
|
112
|
+
default: prod
|
|
113
|
+
example: prod
|
|
114
|
+
responses:
|
|
115
|
+
'200':
|
|
116
|
+
description: 获取成功
|
|
117
|
+
content:
|
|
118
|
+
application/json:
|
|
119
|
+
schema:
|
|
120
|
+
$ref: '../components/schemas/_index.yaml#/ManifestResponse'
|
|
121
|
+
'400':
|
|
122
|
+
$ref: '../components/responses/_index.yaml#/BadRequest'
|
|
123
|
+
'404':
|
|
124
|
+
$ref: '../components/responses/_index.yaml#/NotFound'
|
|
125
|
+
|
|
126
|
+
config:
|
|
127
|
+
get:
|
|
128
|
+
tags: [Pages]
|
|
129
|
+
operationId: getPageConfig
|
|
130
|
+
summary: 获取运维配置
|
|
131
|
+
description: 返回当前运维配置(killSwitch、blockedComponents 等)
|
|
132
|
+
parameters:
|
|
133
|
+
- name: env
|
|
134
|
+
in: query
|
|
135
|
+
required: false
|
|
136
|
+
description: 环境
|
|
137
|
+
schema:
|
|
138
|
+
type: string
|
|
139
|
+
enum: [prod, preview, staging]
|
|
140
|
+
default: prod
|
|
141
|
+
example: prod
|
|
142
|
+
responses:
|
|
143
|
+
'200':
|
|
144
|
+
description: 获取成功
|
|
145
|
+
content:
|
|
146
|
+
application/json:
|
|
147
|
+
schema:
|
|
148
|
+
$ref: '../components/schemas/_index.yaml#/OpsConfig'
|
|
149
|
+
'503':
|
|
150
|
+
$ref: '../components/responses/_index.yaml#/ServiceUnavailable'
|
|
@@ -4,23 +4,8 @@ query:
|
|
|
4
4
|
post:
|
|
5
5
|
tags: [Queries]
|
|
6
6
|
operationId: queryData
|
|
7
|
-
summary:
|
|
8
|
-
description:
|
|
9
|
-
Data Proxy 统一入口,所有数据查询都通过此接口执行。
|
|
10
|
-
|
|
11
|
-
功能:
|
|
12
|
-
- 白名单校验(queryVersionId 属于该 app/workspace)
|
|
13
|
-
- 字段裁剪、脱敏
|
|
14
|
-
- 缓存(短 TTL)
|
|
15
|
-
- 失败降级(兜底结构)
|
|
16
|
-
- 审计(可选,或采样)
|
|
17
|
-
|
|
18
|
-
支持的数据源类型:
|
|
19
|
-
- http: HTTP 接口
|
|
20
|
-
- graphql: GraphQL 查询
|
|
21
|
-
- database: 数据库查询(受限)
|
|
22
|
-
- internal: 内部服务
|
|
23
|
-
- aggregation: 聚合查询
|
|
7
|
+
summary: 执行数据查询
|
|
8
|
+
description: 通过 queryVersionId 查询数据
|
|
24
9
|
requestBody:
|
|
25
10
|
required: true
|
|
26
11
|
content:
|
|
@@ -29,7 +14,7 @@ query:
|
|
|
29
14
|
$ref: '../components/schemas/_index.yaml#/QueryDataRequest'
|
|
30
15
|
responses:
|
|
31
16
|
'200':
|
|
32
|
-
description:
|
|
17
|
+
description: 成功
|
|
33
18
|
content:
|
|
34
19
|
application/json:
|
|
35
20
|
schema:
|
|
@@ -38,48 +23,17 @@ query:
|
|
|
38
23
|
$ref: '../components/responses/_index.yaml#/BadRequest'
|
|
39
24
|
'401':
|
|
40
25
|
$ref: '../components/responses/_index.yaml#/Unauthorized'
|
|
41
|
-
'403':
|
|
42
|
-
$ref: '../components/responses/_index.yaml#/Forbidden'
|
|
43
|
-
'404':
|
|
44
|
-
$ref: '../components/responses/_index.yaml#/NotFound'
|
|
45
|
-
'422':
|
|
46
|
-
$ref: '../components/responses/_index.yaml#/UnprocessableEntity'
|
|
47
26
|
'500':
|
|
48
27
|
$ref: '../components/responses/_index.yaml#/InternalError'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
definitions:
|
|
53
|
-
get:
|
|
54
|
-
tags: [Queries]
|
|
55
|
-
operationId: getQueryDefinition
|
|
56
|
-
summary: 获取查询定义
|
|
57
|
-
description: 获取指定数据查询定义版本的详细信息
|
|
58
|
-
parameters:
|
|
59
|
-
- name: queryVersionId
|
|
60
|
-
in: query
|
|
61
|
-
required: true
|
|
62
|
-
schema:
|
|
63
|
-
type: string
|
|
64
|
-
description: 查询定义版本 ID
|
|
65
|
-
responses:
|
|
66
|
-
'200':
|
|
67
|
-
description: 成功
|
|
68
|
-
content:
|
|
69
|
-
application/json:
|
|
70
|
-
schema:
|
|
71
|
-
$ref: '../components/schemas/_index.yaml#/QueryDefinitionResponse'
|
|
72
|
-
'404':
|
|
73
|
-
$ref: '../components/responses/_index.yaml#/NotFound'
|
|
28
|
+
security:
|
|
29
|
+
- BearerAuth: []
|
|
74
30
|
|
|
75
31
|
batch:
|
|
76
32
|
post:
|
|
77
33
|
tags: [Queries]
|
|
78
34
|
operationId: batchQueryData
|
|
79
35
|
summary: 批量执行数据查询
|
|
80
|
-
description:
|
|
81
|
-
批量执行多个数据查询,用于页面初始化时预取多个数据源。
|
|
82
|
-
所有查询并行执行,部分失败不影响其他查询返回。
|
|
36
|
+
description: 批量执行多个数据查询,所有查询并行执行
|
|
83
37
|
requestBody:
|
|
84
38
|
required: true
|
|
85
39
|
content:
|
|
@@ -95,3 +49,29 @@ batch:
|
|
|
95
49
|
$ref: '../components/schemas/_index.yaml#/BatchQueryResponse'
|
|
96
50
|
'400':
|
|
97
51
|
$ref: '../components/responses/_index.yaml#/BadRequest'
|
|
52
|
+
security:
|
|
53
|
+
- BearerAuth: []
|
|
54
|
+
|
|
55
|
+
definitions:
|
|
56
|
+
get:
|
|
57
|
+
tags: [Queries]
|
|
58
|
+
operationId: getQueryDefinition
|
|
59
|
+
summary: 获取查询定义
|
|
60
|
+
description: 按版本 ID 获取数据查询定义
|
|
61
|
+
parameters:
|
|
62
|
+
- name: queryVersionId
|
|
63
|
+
in: query
|
|
64
|
+
required: true
|
|
65
|
+
schema:
|
|
66
|
+
type: string
|
|
67
|
+
responses:
|
|
68
|
+
'200':
|
|
69
|
+
description: 查询定义
|
|
70
|
+
content:
|
|
71
|
+
application/json:
|
|
72
|
+
schema:
|
|
73
|
+
$ref: '../components/schemas/_index.yaml#/QueryDefinitionResponse'
|
|
74
|
+
'404':
|
|
75
|
+
$ref: '../components/responses/_index.yaml#/NotFound'
|
|
76
|
+
security:
|
|
77
|
+
- BearerAuth: []
|
|
@@ -2,47 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
resolve:
|
|
4
4
|
post:
|
|
5
|
-
tags:
|
|
6
|
-
- Tenant
|
|
7
|
-
summary: 解析租户信息
|
|
5
|
+
tags: [Tenant]
|
|
8
6
|
operationId: resolveTenant
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
用于:
|
|
13
|
-
- Runtime 初始化时获取应用配置
|
|
14
|
-
- 多租户场景下的应用隔离
|
|
7
|
+
summary: 解析租户信息
|
|
8
|
+
description: 根据 appKey 或 host 解析租户/应用信息
|
|
15
9
|
requestBody:
|
|
16
10
|
required: true
|
|
17
11
|
content:
|
|
18
12
|
application/json:
|
|
19
13
|
schema:
|
|
20
|
-
|
|
21
|
-
properties:
|
|
22
|
-
appKey:
|
|
23
|
-
type: string
|
|
24
|
-
description: 应用密钥
|
|
25
|
-
host:
|
|
26
|
-
type: string
|
|
27
|
-
description: 请求来源域名
|
|
28
|
-
channel:
|
|
29
|
-
type: string
|
|
30
|
-
description: 渠道标识
|
|
31
|
-
anyOf:
|
|
32
|
-
- required: [appKey]
|
|
33
|
-
- required: [host]
|
|
14
|
+
$ref: '../components/schemas/_index.yaml#/ResolveTenantRequest'
|
|
34
15
|
responses:
|
|
35
16
|
'200':
|
|
36
17
|
description: 解析成功
|
|
37
18
|
content:
|
|
38
19
|
application/json:
|
|
39
20
|
schema:
|
|
40
|
-
|
|
41
|
-
properties:
|
|
42
|
-
success:
|
|
43
|
-
type: boolean
|
|
44
|
-
data:
|
|
45
|
-
$ref: '../components/schemas/_index.yaml#/TenantInfo'
|
|
21
|
+
$ref: '../components/schemas/_index.yaml#/ResolveTenantResponse'
|
|
46
22
|
'400':
|
|
47
23
|
$ref: '../components/responses/_index.yaml#/BadRequest'
|
|
48
24
|
'404':
|
|
@@ -55,38 +31,28 @@ resolve:
|
|
|
55
31
|
|
|
56
32
|
config:
|
|
57
33
|
get:
|
|
58
|
-
tags:
|
|
59
|
-
- Tenant
|
|
60
|
-
summary: 获取租户配置
|
|
34
|
+
tags: [Tenant]
|
|
61
35
|
operationId: getTenantConfig
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
包括:
|
|
66
|
-
- 功能开关
|
|
67
|
-
- 主题配置
|
|
68
|
-
- CDN 域名
|
|
69
|
-
- 阻断组件列表
|
|
70
|
-
- Kill Switch 状态
|
|
36
|
+
summary: 获取租户配置
|
|
37
|
+
description: 获取当前租户的运行时配置
|
|
71
38
|
parameters:
|
|
39
|
+
- name: x-app-id
|
|
40
|
+
in: header
|
|
41
|
+
required: true
|
|
42
|
+
schema:
|
|
43
|
+
type: string
|
|
72
44
|
- name: X-App-Id
|
|
73
45
|
in: header
|
|
74
46
|
required: true
|
|
75
47
|
schema:
|
|
76
48
|
type: string
|
|
77
|
-
description: 应用 ID
|
|
78
49
|
responses:
|
|
79
50
|
'200':
|
|
80
|
-
description:
|
|
51
|
+
description: 获取成功
|
|
81
52
|
content:
|
|
82
53
|
application/json:
|
|
83
54
|
schema:
|
|
84
|
-
|
|
85
|
-
properties:
|
|
86
|
-
success:
|
|
87
|
-
type: boolean
|
|
88
|
-
data:
|
|
89
|
-
$ref: '../components/schemas/_index.yaml#/TenantConfig'
|
|
55
|
+
$ref: '../components/schemas/_index.yaml#/TenantConfigResponse'
|
|
90
56
|
'401':
|
|
91
57
|
$ref: '../components/responses/_index.yaml#/Unauthorized'
|
|
92
58
|
'404':
|
|
@@ -2,55 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
track:
|
|
4
4
|
post:
|
|
5
|
-
tags:
|
|
6
|
-
- Track
|
|
7
|
-
summary: 埋点上报
|
|
5
|
+
tags: [Track]
|
|
8
6
|
operationId: track
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
特点:
|
|
13
|
-
- 高性能:不阻塞主链路
|
|
14
|
-
- 可靠:通过 Outbox 异步持久化
|
|
15
|
-
- 可追溯:自动关联 pageVersionId/componentVersionId/traceId
|
|
7
|
+
summary: 单个埋点上报
|
|
8
|
+
description: 接收客户端埋点数据,异步处理
|
|
16
9
|
requestBody:
|
|
17
10
|
required: true
|
|
18
11
|
content:
|
|
19
12
|
application/json:
|
|
20
13
|
schema:
|
|
21
|
-
$ref: '../components/schemas/_index.yaml#/
|
|
14
|
+
$ref: '../components/schemas/_index.yaml#/TrackSingleRequest'
|
|
22
15
|
responses:
|
|
23
16
|
'202':
|
|
24
17
|
description: 接收成功(异步处理)
|
|
25
18
|
content:
|
|
26
19
|
application/json:
|
|
27
20
|
schema:
|
|
28
|
-
|
|
29
|
-
properties:
|
|
30
|
-
success:
|
|
31
|
-
type: boolean
|
|
32
|
-
example: true
|
|
33
|
-
data:
|
|
34
|
-
type: object
|
|
35
|
-
properties:
|
|
36
|
-
eventId:
|
|
37
|
-
type: string
|
|
38
|
-
description: 事件 ID
|
|
21
|
+
$ref: '../components/schemas/_index.yaml#/TrackSingleResponse'
|
|
39
22
|
'400':
|
|
40
23
|
$ref: '../components/responses/_index.yaml#/BadRequest'
|
|
41
24
|
|
|
42
25
|
trackBatch:
|
|
43
26
|
post:
|
|
44
|
-
tags:
|
|
45
|
-
- Track
|
|
46
|
-
summary: 批量埋点上报
|
|
27
|
+
tags: [Track]
|
|
47
28
|
operationId: trackBatch
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
限制:
|
|
52
|
-
- 单次最多 100 条
|
|
53
|
-
- 单条事件不超过 10KB
|
|
29
|
+
summary: 批量埋点上报
|
|
30
|
+
description: 批量接收客户端埋点数据,提高上报效率
|
|
54
31
|
requestBody:
|
|
55
32
|
required: true
|
|
56
33
|
content:
|
|
@@ -63,27 +40,6 @@ trackBatch:
|
|
|
63
40
|
content:
|
|
64
41
|
application/json:
|
|
65
42
|
schema:
|
|
66
|
-
|
|
67
|
-
properties:
|
|
68
|
-
success:
|
|
69
|
-
type: boolean
|
|
70
|
-
data:
|
|
71
|
-
type: object
|
|
72
|
-
properties:
|
|
73
|
-
accepted:
|
|
74
|
-
type: integer
|
|
75
|
-
description: 接收的事件数量
|
|
76
|
-
rejected:
|
|
77
|
-
type: integer
|
|
78
|
-
description: 拒绝的事件数量
|
|
79
|
-
errors:
|
|
80
|
-
type: array
|
|
81
|
-
items:
|
|
82
|
-
type: object
|
|
83
|
-
properties:
|
|
84
|
-
index:
|
|
85
|
-
type: integer
|
|
86
|
-
reason:
|
|
87
|
-
type: string
|
|
43
|
+
$ref: '../components/schemas/_index.yaml#/TrackBatchResponse'
|
|
88
44
|
'400':
|
|
89
45
|
$ref: '../components/responses/_index.yaml#/BadRequest'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djvlc/openapi-user-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "DJV Low-code Platform - User API 客户端(自动生成)",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@djvlc/openapi-client-core": "1.2.
|
|
28
|
+
"@djvlc/openapi-client-core": "1.2.13"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^20.0.0",
|