@djvlc/openapi-admin-client 1.1.1 → 1.2.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.
- package/dist/index.d.mts +197 -25
- package/dist/index.d.ts +197 -25
- package/dist/index.js +75 -13
- package/dist/index.mjs +75 -13
- package/package.json +11 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import { ApiResponse, PaginatedApiResponse, PageSchema, PublishConfig, VersionInfo, ComponentMeta, ActionDefinition, DataQueryDefinition } from '@djvlc/contracts-types';
|
|
1
|
+
import { ApiResponse, PaginationParams, PageStatus, SortOrder, PaginatedApiResponse, PageSchema, PublishConfig, PublishChannel, VersionInfo, ComponentCategory, ComponentStatus, ComponentMeta, ActionDefinition, DataQueryDefinition, TimeRange, HealthCheckResponse } from '@djvlc/contracts-types';
|
|
2
|
+
export { ActionDefinition, ActionDefinitionStatus, ApiResponse, ComponentCategory, ComponentMeta, ComponentStatus, DataQueryDefinition, DataQueryDefinitionStatus, DataSourceType, HealthCheckResponse, PageSchema, PageStatus, PaginatedApiResponse, PaginationParams, PublishChannel, PublishConfig, SortOrder, TimeRange, VersionInfo } from '@djvlc/contracts-types';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @djvlc/openapi-admin-client - Admin API 客户端
|
|
5
6
|
*
|
|
6
7
|
* 自动从 OpenAPI 规范生成,提供类型安全的 Admin API 访问
|
|
8
|
+
* 用于 Editor 管理页面/组件/活动
|
|
7
9
|
*
|
|
8
10
|
* @packageDocumentation
|
|
9
11
|
*/
|
|
10
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Admin API 客户端配置
|
|
15
|
+
*/
|
|
11
16
|
interface AdminClientConfig {
|
|
12
17
|
/** API 基础 URL */
|
|
13
18
|
baseUrl: string;
|
|
14
19
|
/** 认证 Token */
|
|
15
20
|
token?: string;
|
|
21
|
+
/** 获取 Token 的函数(支持动态获取) */
|
|
22
|
+
getToken?: () => string | Promise<string>;
|
|
16
23
|
/** 请求超时(毫秒) */
|
|
17
24
|
timeout?: number;
|
|
18
25
|
/** 自定义请求头 */
|
|
19
26
|
headers?: Record<string, string>;
|
|
27
|
+
/** 获取 Trace Headers(用于链路追踪) */
|
|
28
|
+
getTraceHeaders?: () => Record<string, string>;
|
|
20
29
|
/** 请求拦截器 */
|
|
21
30
|
onRequest?: (config: RequestInit) => RequestInit;
|
|
22
31
|
/** 响应拦截器 */
|
|
@@ -24,62 +33,208 @@ interface AdminClientConfig {
|
|
|
24
33
|
/** 错误处理 */
|
|
25
34
|
onError?: (error: Error) => void;
|
|
26
35
|
}
|
|
27
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* 创建页面请求
|
|
38
|
+
* POST /api/admin/pages
|
|
39
|
+
*/
|
|
28
40
|
interface CreatePageRequest {
|
|
41
|
+
/** 页面标题 */
|
|
29
42
|
title: string;
|
|
43
|
+
/** 页面描述 */
|
|
30
44
|
description?: string;
|
|
45
|
+
/** 基于模板创建的模板ID */
|
|
31
46
|
templateId?: string;
|
|
47
|
+
/** 所属工作区ID */
|
|
32
48
|
workspaceId?: string;
|
|
33
49
|
}
|
|
34
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* 更新页面请求
|
|
52
|
+
* PUT /api/admin/pages/{pageId}
|
|
53
|
+
*/
|
|
35
54
|
interface UpdatePageRequest {
|
|
55
|
+
/** 页面标题 */
|
|
36
56
|
title?: string;
|
|
57
|
+
/** 页面描述 */
|
|
37
58
|
description?: string;
|
|
59
|
+
/** 页面 Schema */
|
|
38
60
|
schema?: PageSchema;
|
|
39
61
|
}
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
62
|
+
/**
|
|
63
|
+
* 页面列表查询参数
|
|
64
|
+
* GET /api/admin/pages
|
|
65
|
+
*/
|
|
66
|
+
interface ListPagesParams extends PaginationParams {
|
|
67
|
+
/** 页面状态 */
|
|
68
|
+
status?: PageStatus;
|
|
69
|
+
/** 搜索关键词 */
|
|
45
70
|
search?: string;
|
|
46
|
-
|
|
47
|
-
|
|
71
|
+
/** 排序字段 */
|
|
72
|
+
sortBy?: 'createdAt' | 'updatedAt' | 'title';
|
|
73
|
+
/** 排序方向 */
|
|
74
|
+
sortOrder?: SortOrder;
|
|
48
75
|
}
|
|
49
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* 页面详情响应(OpenAPI 返回格式)
|
|
78
|
+
* 复用 PageSchema,扩展 API 返回字段
|
|
79
|
+
*/
|
|
50
80
|
interface PageDetail {
|
|
81
|
+
/** 页面 ID */
|
|
51
82
|
id: string;
|
|
83
|
+
/** 页面 UID */
|
|
52
84
|
uid: string;
|
|
85
|
+
/** 页面标题 */
|
|
53
86
|
title: string;
|
|
87
|
+
/** 页面描述 */
|
|
54
88
|
description?: string;
|
|
55
|
-
|
|
89
|
+
/** 页面状态 */
|
|
90
|
+
status: PageStatus;
|
|
91
|
+
/** 页面 Schema */
|
|
56
92
|
schema: PageSchema;
|
|
93
|
+
/** 当前版本 ID */
|
|
57
94
|
currentVersionId?: string;
|
|
95
|
+
/** 创建时间 */
|
|
58
96
|
createdAt: string;
|
|
97
|
+
/** 更新时间 */
|
|
59
98
|
updatedAt: string;
|
|
99
|
+
/** 创建者 */
|
|
60
100
|
createdBy: string;
|
|
61
101
|
}
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
category?: string;
|
|
67
|
-
status?: string;
|
|
68
|
-
search?: string;
|
|
69
|
-
}
|
|
70
|
-
/** 发布结果 */
|
|
102
|
+
/**
|
|
103
|
+
* 发布结果
|
|
104
|
+
* POST /api/admin/pages/{pageId}/publish
|
|
105
|
+
*/
|
|
71
106
|
interface PublishResult {
|
|
107
|
+
/** 页面版本 ID */
|
|
72
108
|
pageVersionId: string;
|
|
109
|
+
/** Manifest ID */
|
|
73
110
|
manifestId: string;
|
|
111
|
+
/** 发布时间 */
|
|
74
112
|
publishedAt: string;
|
|
75
|
-
|
|
113
|
+
/** 发布渠道 */
|
|
114
|
+
channel: PublishChannel;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 组件列表查询参数
|
|
118
|
+
* GET /api/admin/components
|
|
119
|
+
*/
|
|
120
|
+
interface ListComponentsParams extends PaginationParams {
|
|
121
|
+
/** 组件分类 */
|
|
122
|
+
category?: ComponentCategory;
|
|
123
|
+
/** 组件状态 */
|
|
124
|
+
status?: ComponentStatus;
|
|
125
|
+
/** 搜索关键词 */
|
|
126
|
+
search?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* 阻断组件请求
|
|
130
|
+
* POST /api/admin/components/{name}/versions/{version}/block
|
|
131
|
+
*/
|
|
132
|
+
interface BlockComponentRequest {
|
|
133
|
+
/** 阻断原因 */
|
|
134
|
+
reason: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* 解除阻断请求
|
|
138
|
+
* POST /api/admin/components/{name}/versions/{version}/unblock
|
|
139
|
+
*/
|
|
140
|
+
interface UnblockComponentRequest {
|
|
141
|
+
/** 解除原因 */
|
|
142
|
+
reason: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* 活动规则
|
|
146
|
+
*/
|
|
147
|
+
interface ActivityRule {
|
|
148
|
+
/** 活动 ID */
|
|
149
|
+
id: string;
|
|
150
|
+
/** 活动名称 */
|
|
151
|
+
name: string;
|
|
152
|
+
/** 活动描述 */
|
|
153
|
+
description?: string;
|
|
154
|
+
/** 活动状态 */
|
|
155
|
+
status: 'draft' | 'active' | 'inactive' | 'archived';
|
|
156
|
+
/** 开始时间 */
|
|
157
|
+
startTime: string;
|
|
158
|
+
/** 结束时间 */
|
|
159
|
+
endTime: string;
|
|
160
|
+
/** 活动配置 */
|
|
161
|
+
config?: Record<string, unknown>;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 创建活动请求
|
|
165
|
+
*/
|
|
166
|
+
interface CreateActivityRequest {
|
|
167
|
+
/** 活动名称 */
|
|
168
|
+
name: string;
|
|
169
|
+
/** 活动描述 */
|
|
170
|
+
description?: string;
|
|
171
|
+
/** 开始时间 */
|
|
172
|
+
startTime: string;
|
|
173
|
+
/** 结束时间 */
|
|
174
|
+
endTime: string;
|
|
175
|
+
/** 活动配置 */
|
|
176
|
+
config?: Record<string, unknown>;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* 更新活动请求
|
|
180
|
+
*/
|
|
181
|
+
interface UpdateActivityRequest {
|
|
182
|
+
/** 活动名称 */
|
|
183
|
+
name?: string;
|
|
184
|
+
/** 活动描述 */
|
|
185
|
+
description?: string;
|
|
186
|
+
/** 活动状态 */
|
|
187
|
+
status?: 'draft' | 'active' | 'inactive' | 'archived';
|
|
188
|
+
/** 开始时间 */
|
|
189
|
+
startTime?: string;
|
|
190
|
+
/** 结束时间 */
|
|
191
|
+
endTime?: string;
|
|
192
|
+
/** 活动配置 */
|
|
193
|
+
config?: Record<string, unknown>;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* 审计日志
|
|
197
|
+
*/
|
|
198
|
+
interface AuditLog {
|
|
199
|
+
/** 日志 ID */
|
|
200
|
+
id: string;
|
|
201
|
+
/** 操作类型 */
|
|
202
|
+
action: string;
|
|
203
|
+
/** 实体类型 */
|
|
204
|
+
entityType: string;
|
|
205
|
+
/** 实体 ID */
|
|
206
|
+
entityId: string;
|
|
207
|
+
/** 操作人 UID */
|
|
208
|
+
operator: string;
|
|
209
|
+
/** 操作时间 */
|
|
210
|
+
timestamp: string;
|
|
211
|
+
/** 操作详情 */
|
|
212
|
+
details?: Record<string, unknown>;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* 审计日志查询参数
|
|
216
|
+
*/
|
|
217
|
+
interface ListAuditLogsParams extends PaginationParams, TimeRange {
|
|
218
|
+
/** 操作类型 */
|
|
219
|
+
action?: string;
|
|
220
|
+
/** 实体类型 */
|
|
221
|
+
entityType?: string;
|
|
222
|
+
/** 实体 ID */
|
|
223
|
+
entityId?: string;
|
|
224
|
+
/** 操作人 UID */
|
|
225
|
+
operator?: string;
|
|
76
226
|
}
|
|
77
227
|
/**
|
|
78
228
|
* Admin API 客户端类
|
|
229
|
+
* 用于 Editor 管理页面/组件/活动
|
|
79
230
|
*/
|
|
80
231
|
declare class AdminApiClient {
|
|
81
232
|
private config;
|
|
82
233
|
constructor(config: AdminClientConfig);
|
|
234
|
+
/**
|
|
235
|
+
* 获取认证 Token
|
|
236
|
+
*/
|
|
237
|
+
private getAuthToken;
|
|
83
238
|
/**
|
|
84
239
|
* 发送请求
|
|
85
240
|
*/
|
|
@@ -107,9 +262,9 @@ declare class AdminApiClient {
|
|
|
107
262
|
/** 获取组件详情 */
|
|
108
263
|
getComponent(name: string, version?: string): Promise<ApiResponse<ComponentMeta>>;
|
|
109
264
|
/** 阻断组件版本 */
|
|
110
|
-
blockComponent(name: string, version: string,
|
|
265
|
+
blockComponent(name: string, version: string, data: BlockComponentRequest): Promise<ApiResponse<void>>;
|
|
111
266
|
/** 解除组件阻断 */
|
|
112
|
-
unblockComponent(name: string, version: string): Promise<ApiResponse<void>>;
|
|
267
|
+
unblockComponent(name: string, version: string, data?: UnblockComponentRequest): Promise<ApiResponse<void>>;
|
|
113
268
|
/** 获取 ActionDefinition 列表 */
|
|
114
269
|
listActionDefinitions(): Promise<ApiResponse<ActionDefinition[]>>;
|
|
115
270
|
/** 创建 ActionDefinition */
|
|
@@ -118,10 +273,27 @@ declare class AdminApiClient {
|
|
|
118
273
|
listDataQueryDefinitions(): Promise<ApiResponse<DataQueryDefinition[]>>;
|
|
119
274
|
/** 创建 DataQueryDefinition */
|
|
120
275
|
createDataQueryDefinition(data: Omit<DataQueryDefinition, 'id'>): Promise<ApiResponse<DataQueryDefinition>>;
|
|
276
|
+
/** 获取活动列表 */
|
|
277
|
+
listActivities(params?: PaginationParams & {
|
|
278
|
+
status?: string;
|
|
279
|
+
search?: string;
|
|
280
|
+
}): Promise<PaginatedApiResponse<ActivityRule>>;
|
|
281
|
+
/** 获取活动详情 */
|
|
282
|
+
getActivity(activityId: string): Promise<ApiResponse<ActivityRule>>;
|
|
283
|
+
/** 创建活动 */
|
|
284
|
+
createActivity(data: CreateActivityRequest): Promise<ApiResponse<ActivityRule>>;
|
|
285
|
+
/** 更新活动 */
|
|
286
|
+
updateActivity(activityId: string, data: UpdateActivityRequest): Promise<ApiResponse<ActivityRule>>;
|
|
287
|
+
/** 删除活动 */
|
|
288
|
+
deleteActivity(activityId: string): Promise<ApiResponse<void>>;
|
|
289
|
+
/** 获取审计日志列表 */
|
|
290
|
+
listAuditLogs(params?: ListAuditLogsParams): Promise<PaginatedApiResponse<AuditLog>>;
|
|
291
|
+
/** 健康检查 */
|
|
292
|
+
health(): Promise<ApiResponse<HealthCheckResponse>>;
|
|
121
293
|
}
|
|
122
294
|
/**
|
|
123
295
|
* 创建 Admin API 客户端实例
|
|
124
296
|
*/
|
|
125
297
|
declare function createAdminClient(config: AdminClientConfig): AdminApiClient;
|
|
126
298
|
|
|
127
|
-
export { AdminApiClient, type AdminClientConfig, type CreatePageRequest, type ListComponentsParams, type ListPagesParams, type PageDetail, type PublishResult, type UpdatePageRequest, createAdminClient, AdminApiClient as default };
|
|
299
|
+
export { type ActivityRule, AdminApiClient, type AdminClientConfig, type AuditLog, type BlockComponentRequest, type CreateActivityRequest, type CreatePageRequest, type ListAuditLogsParams, type ListComponentsParams, type ListPagesParams, type PageDetail, type PublishResult, type UnblockComponentRequest, type UpdateActivityRequest, type UpdatePageRequest, createAdminClient, AdminApiClient as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import { ApiResponse, PaginatedApiResponse, PageSchema, PublishConfig, VersionInfo, ComponentMeta, ActionDefinition, DataQueryDefinition } from '@djvlc/contracts-types';
|
|
1
|
+
import { ApiResponse, PaginationParams, PageStatus, SortOrder, PaginatedApiResponse, PageSchema, PublishConfig, PublishChannel, VersionInfo, ComponentCategory, ComponentStatus, ComponentMeta, ActionDefinition, DataQueryDefinition, TimeRange, HealthCheckResponse } from '@djvlc/contracts-types';
|
|
2
|
+
export { ActionDefinition, ActionDefinitionStatus, ApiResponse, ComponentCategory, ComponentMeta, ComponentStatus, DataQueryDefinition, DataQueryDefinitionStatus, DataSourceType, HealthCheckResponse, PageSchema, PageStatus, PaginatedApiResponse, PaginationParams, PublishChannel, PublishConfig, SortOrder, TimeRange, VersionInfo } from '@djvlc/contracts-types';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @djvlc/openapi-admin-client - Admin API 客户端
|
|
5
6
|
*
|
|
6
7
|
* 自动从 OpenAPI 规范生成,提供类型安全的 Admin API 访问
|
|
8
|
+
* 用于 Editor 管理页面/组件/活动
|
|
7
9
|
*
|
|
8
10
|
* @packageDocumentation
|
|
9
11
|
*/
|
|
10
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Admin API 客户端配置
|
|
15
|
+
*/
|
|
11
16
|
interface AdminClientConfig {
|
|
12
17
|
/** API 基础 URL */
|
|
13
18
|
baseUrl: string;
|
|
14
19
|
/** 认证 Token */
|
|
15
20
|
token?: string;
|
|
21
|
+
/** 获取 Token 的函数(支持动态获取) */
|
|
22
|
+
getToken?: () => string | Promise<string>;
|
|
16
23
|
/** 请求超时(毫秒) */
|
|
17
24
|
timeout?: number;
|
|
18
25
|
/** 自定义请求头 */
|
|
19
26
|
headers?: Record<string, string>;
|
|
27
|
+
/** 获取 Trace Headers(用于链路追踪) */
|
|
28
|
+
getTraceHeaders?: () => Record<string, string>;
|
|
20
29
|
/** 请求拦截器 */
|
|
21
30
|
onRequest?: (config: RequestInit) => RequestInit;
|
|
22
31
|
/** 响应拦截器 */
|
|
@@ -24,62 +33,208 @@ interface AdminClientConfig {
|
|
|
24
33
|
/** 错误处理 */
|
|
25
34
|
onError?: (error: Error) => void;
|
|
26
35
|
}
|
|
27
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* 创建页面请求
|
|
38
|
+
* POST /api/admin/pages
|
|
39
|
+
*/
|
|
28
40
|
interface CreatePageRequest {
|
|
41
|
+
/** 页面标题 */
|
|
29
42
|
title: string;
|
|
43
|
+
/** 页面描述 */
|
|
30
44
|
description?: string;
|
|
45
|
+
/** 基于模板创建的模板ID */
|
|
31
46
|
templateId?: string;
|
|
47
|
+
/** 所属工作区ID */
|
|
32
48
|
workspaceId?: string;
|
|
33
49
|
}
|
|
34
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* 更新页面请求
|
|
52
|
+
* PUT /api/admin/pages/{pageId}
|
|
53
|
+
*/
|
|
35
54
|
interface UpdatePageRequest {
|
|
55
|
+
/** 页面标题 */
|
|
36
56
|
title?: string;
|
|
57
|
+
/** 页面描述 */
|
|
37
58
|
description?: string;
|
|
59
|
+
/** 页面 Schema */
|
|
38
60
|
schema?: PageSchema;
|
|
39
61
|
}
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
62
|
+
/**
|
|
63
|
+
* 页面列表查询参数
|
|
64
|
+
* GET /api/admin/pages
|
|
65
|
+
*/
|
|
66
|
+
interface ListPagesParams extends PaginationParams {
|
|
67
|
+
/** 页面状态 */
|
|
68
|
+
status?: PageStatus;
|
|
69
|
+
/** 搜索关键词 */
|
|
45
70
|
search?: string;
|
|
46
|
-
|
|
47
|
-
|
|
71
|
+
/** 排序字段 */
|
|
72
|
+
sortBy?: 'createdAt' | 'updatedAt' | 'title';
|
|
73
|
+
/** 排序方向 */
|
|
74
|
+
sortOrder?: SortOrder;
|
|
48
75
|
}
|
|
49
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* 页面详情响应(OpenAPI 返回格式)
|
|
78
|
+
* 复用 PageSchema,扩展 API 返回字段
|
|
79
|
+
*/
|
|
50
80
|
interface PageDetail {
|
|
81
|
+
/** 页面 ID */
|
|
51
82
|
id: string;
|
|
83
|
+
/** 页面 UID */
|
|
52
84
|
uid: string;
|
|
85
|
+
/** 页面标题 */
|
|
53
86
|
title: string;
|
|
87
|
+
/** 页面描述 */
|
|
54
88
|
description?: string;
|
|
55
|
-
|
|
89
|
+
/** 页面状态 */
|
|
90
|
+
status: PageStatus;
|
|
91
|
+
/** 页面 Schema */
|
|
56
92
|
schema: PageSchema;
|
|
93
|
+
/** 当前版本 ID */
|
|
57
94
|
currentVersionId?: string;
|
|
95
|
+
/** 创建时间 */
|
|
58
96
|
createdAt: string;
|
|
97
|
+
/** 更新时间 */
|
|
59
98
|
updatedAt: string;
|
|
99
|
+
/** 创建者 */
|
|
60
100
|
createdBy: string;
|
|
61
101
|
}
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
category?: string;
|
|
67
|
-
status?: string;
|
|
68
|
-
search?: string;
|
|
69
|
-
}
|
|
70
|
-
/** 发布结果 */
|
|
102
|
+
/**
|
|
103
|
+
* 发布结果
|
|
104
|
+
* POST /api/admin/pages/{pageId}/publish
|
|
105
|
+
*/
|
|
71
106
|
interface PublishResult {
|
|
107
|
+
/** 页面版本 ID */
|
|
72
108
|
pageVersionId: string;
|
|
109
|
+
/** Manifest ID */
|
|
73
110
|
manifestId: string;
|
|
111
|
+
/** 发布时间 */
|
|
74
112
|
publishedAt: string;
|
|
75
|
-
|
|
113
|
+
/** 发布渠道 */
|
|
114
|
+
channel: PublishChannel;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 组件列表查询参数
|
|
118
|
+
* GET /api/admin/components
|
|
119
|
+
*/
|
|
120
|
+
interface ListComponentsParams extends PaginationParams {
|
|
121
|
+
/** 组件分类 */
|
|
122
|
+
category?: ComponentCategory;
|
|
123
|
+
/** 组件状态 */
|
|
124
|
+
status?: ComponentStatus;
|
|
125
|
+
/** 搜索关键词 */
|
|
126
|
+
search?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* 阻断组件请求
|
|
130
|
+
* POST /api/admin/components/{name}/versions/{version}/block
|
|
131
|
+
*/
|
|
132
|
+
interface BlockComponentRequest {
|
|
133
|
+
/** 阻断原因 */
|
|
134
|
+
reason: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* 解除阻断请求
|
|
138
|
+
* POST /api/admin/components/{name}/versions/{version}/unblock
|
|
139
|
+
*/
|
|
140
|
+
interface UnblockComponentRequest {
|
|
141
|
+
/** 解除原因 */
|
|
142
|
+
reason: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* 活动规则
|
|
146
|
+
*/
|
|
147
|
+
interface ActivityRule {
|
|
148
|
+
/** 活动 ID */
|
|
149
|
+
id: string;
|
|
150
|
+
/** 活动名称 */
|
|
151
|
+
name: string;
|
|
152
|
+
/** 活动描述 */
|
|
153
|
+
description?: string;
|
|
154
|
+
/** 活动状态 */
|
|
155
|
+
status: 'draft' | 'active' | 'inactive' | 'archived';
|
|
156
|
+
/** 开始时间 */
|
|
157
|
+
startTime: string;
|
|
158
|
+
/** 结束时间 */
|
|
159
|
+
endTime: string;
|
|
160
|
+
/** 活动配置 */
|
|
161
|
+
config?: Record<string, unknown>;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 创建活动请求
|
|
165
|
+
*/
|
|
166
|
+
interface CreateActivityRequest {
|
|
167
|
+
/** 活动名称 */
|
|
168
|
+
name: string;
|
|
169
|
+
/** 活动描述 */
|
|
170
|
+
description?: string;
|
|
171
|
+
/** 开始时间 */
|
|
172
|
+
startTime: string;
|
|
173
|
+
/** 结束时间 */
|
|
174
|
+
endTime: string;
|
|
175
|
+
/** 活动配置 */
|
|
176
|
+
config?: Record<string, unknown>;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* 更新活动请求
|
|
180
|
+
*/
|
|
181
|
+
interface UpdateActivityRequest {
|
|
182
|
+
/** 活动名称 */
|
|
183
|
+
name?: string;
|
|
184
|
+
/** 活动描述 */
|
|
185
|
+
description?: string;
|
|
186
|
+
/** 活动状态 */
|
|
187
|
+
status?: 'draft' | 'active' | 'inactive' | 'archived';
|
|
188
|
+
/** 开始时间 */
|
|
189
|
+
startTime?: string;
|
|
190
|
+
/** 结束时间 */
|
|
191
|
+
endTime?: string;
|
|
192
|
+
/** 活动配置 */
|
|
193
|
+
config?: Record<string, unknown>;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* 审计日志
|
|
197
|
+
*/
|
|
198
|
+
interface AuditLog {
|
|
199
|
+
/** 日志 ID */
|
|
200
|
+
id: string;
|
|
201
|
+
/** 操作类型 */
|
|
202
|
+
action: string;
|
|
203
|
+
/** 实体类型 */
|
|
204
|
+
entityType: string;
|
|
205
|
+
/** 实体 ID */
|
|
206
|
+
entityId: string;
|
|
207
|
+
/** 操作人 UID */
|
|
208
|
+
operator: string;
|
|
209
|
+
/** 操作时间 */
|
|
210
|
+
timestamp: string;
|
|
211
|
+
/** 操作详情 */
|
|
212
|
+
details?: Record<string, unknown>;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* 审计日志查询参数
|
|
216
|
+
*/
|
|
217
|
+
interface ListAuditLogsParams extends PaginationParams, TimeRange {
|
|
218
|
+
/** 操作类型 */
|
|
219
|
+
action?: string;
|
|
220
|
+
/** 实体类型 */
|
|
221
|
+
entityType?: string;
|
|
222
|
+
/** 实体 ID */
|
|
223
|
+
entityId?: string;
|
|
224
|
+
/** 操作人 UID */
|
|
225
|
+
operator?: string;
|
|
76
226
|
}
|
|
77
227
|
/**
|
|
78
228
|
* Admin API 客户端类
|
|
229
|
+
* 用于 Editor 管理页面/组件/活动
|
|
79
230
|
*/
|
|
80
231
|
declare class AdminApiClient {
|
|
81
232
|
private config;
|
|
82
233
|
constructor(config: AdminClientConfig);
|
|
234
|
+
/**
|
|
235
|
+
* 获取认证 Token
|
|
236
|
+
*/
|
|
237
|
+
private getAuthToken;
|
|
83
238
|
/**
|
|
84
239
|
* 发送请求
|
|
85
240
|
*/
|
|
@@ -107,9 +262,9 @@ declare class AdminApiClient {
|
|
|
107
262
|
/** 获取组件详情 */
|
|
108
263
|
getComponent(name: string, version?: string): Promise<ApiResponse<ComponentMeta>>;
|
|
109
264
|
/** 阻断组件版本 */
|
|
110
|
-
blockComponent(name: string, version: string,
|
|
265
|
+
blockComponent(name: string, version: string, data: BlockComponentRequest): Promise<ApiResponse<void>>;
|
|
111
266
|
/** 解除组件阻断 */
|
|
112
|
-
unblockComponent(name: string, version: string): Promise<ApiResponse<void>>;
|
|
267
|
+
unblockComponent(name: string, version: string, data?: UnblockComponentRequest): Promise<ApiResponse<void>>;
|
|
113
268
|
/** 获取 ActionDefinition 列表 */
|
|
114
269
|
listActionDefinitions(): Promise<ApiResponse<ActionDefinition[]>>;
|
|
115
270
|
/** 创建 ActionDefinition */
|
|
@@ -118,10 +273,27 @@ declare class AdminApiClient {
|
|
|
118
273
|
listDataQueryDefinitions(): Promise<ApiResponse<DataQueryDefinition[]>>;
|
|
119
274
|
/** 创建 DataQueryDefinition */
|
|
120
275
|
createDataQueryDefinition(data: Omit<DataQueryDefinition, 'id'>): Promise<ApiResponse<DataQueryDefinition>>;
|
|
276
|
+
/** 获取活动列表 */
|
|
277
|
+
listActivities(params?: PaginationParams & {
|
|
278
|
+
status?: string;
|
|
279
|
+
search?: string;
|
|
280
|
+
}): Promise<PaginatedApiResponse<ActivityRule>>;
|
|
281
|
+
/** 获取活动详情 */
|
|
282
|
+
getActivity(activityId: string): Promise<ApiResponse<ActivityRule>>;
|
|
283
|
+
/** 创建活动 */
|
|
284
|
+
createActivity(data: CreateActivityRequest): Promise<ApiResponse<ActivityRule>>;
|
|
285
|
+
/** 更新活动 */
|
|
286
|
+
updateActivity(activityId: string, data: UpdateActivityRequest): Promise<ApiResponse<ActivityRule>>;
|
|
287
|
+
/** 删除活动 */
|
|
288
|
+
deleteActivity(activityId: string): Promise<ApiResponse<void>>;
|
|
289
|
+
/** 获取审计日志列表 */
|
|
290
|
+
listAuditLogs(params?: ListAuditLogsParams): Promise<PaginatedApiResponse<AuditLog>>;
|
|
291
|
+
/** 健康检查 */
|
|
292
|
+
health(): Promise<ApiResponse<HealthCheckResponse>>;
|
|
121
293
|
}
|
|
122
294
|
/**
|
|
123
295
|
* 创建 Admin API 客户端实例
|
|
124
296
|
*/
|
|
125
297
|
declare function createAdminClient(config: AdminClientConfig): AdminApiClient;
|
|
126
298
|
|
|
127
|
-
export { AdminApiClient, type AdminClientConfig, type CreatePageRequest, type ListComponentsParams, type ListPagesParams, type PageDetail, type PublishResult, type UpdatePageRequest, createAdminClient, AdminApiClient as default };
|
|
299
|
+
export { type ActivityRule, AdminApiClient, type AdminClientConfig, type AuditLog, type BlockComponentRequest, type CreateActivityRequest, type CreatePageRequest, type ListAuditLogsParams, type ListComponentsParams, type ListPagesParams, type PageDetail, type PublishResult, type UnblockComponentRequest, type UpdateActivityRequest, type UpdatePageRequest, createAdminClient, AdminApiClient as default };
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,15 @@ var AdminApiClient = class {
|
|
|
32
32
|
...config
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* 获取认证 Token
|
|
37
|
+
*/
|
|
38
|
+
async getAuthToken() {
|
|
39
|
+
if (this.config.getToken) {
|
|
40
|
+
return this.config.getToken();
|
|
41
|
+
}
|
|
42
|
+
return this.config.token;
|
|
43
|
+
}
|
|
35
44
|
/**
|
|
36
45
|
* 发送请求
|
|
37
46
|
*/
|
|
@@ -49,11 +58,13 @@ var AdminApiClient = class {
|
|
|
49
58
|
url += `?${queryString}`;
|
|
50
59
|
}
|
|
51
60
|
}
|
|
61
|
+
const token = await this.getAuthToken();
|
|
52
62
|
let requestConfig = {
|
|
53
63
|
method,
|
|
54
64
|
headers: {
|
|
55
65
|
"Content-Type": "application/json",
|
|
56
|
-
...
|
|
66
|
+
...token ? { Authorization: `Bearer ${token}` } : {},
|
|
67
|
+
...this.config.getTraceHeaders ? this.config.getTraceHeaders() : {},
|
|
57
68
|
...this.config.headers
|
|
58
69
|
},
|
|
59
70
|
body: options?.body ? JSON.stringify(options.body) : void 0
|
|
@@ -84,7 +95,9 @@ var AdminApiClient = class {
|
|
|
84
95
|
// ==================== 页面管理 ====================
|
|
85
96
|
/** 获取页面列表 */
|
|
86
97
|
async listPages(params) {
|
|
87
|
-
return this.request("GET", "/api/admin/pages", {
|
|
98
|
+
return this.request("GET", "/api/admin/pages", {
|
|
99
|
+
params
|
|
100
|
+
});
|
|
88
101
|
}
|
|
89
102
|
/** 获取页面详情 */
|
|
90
103
|
async getPage(pageId) {
|
|
@@ -108,11 +121,15 @@ var AdminApiClient = class {
|
|
|
108
121
|
}
|
|
109
122
|
/** 发布页面 */
|
|
110
123
|
async publishPage(pageId, config) {
|
|
111
|
-
return this.request("POST", `/api/admin/pages/${pageId}/publish`, {
|
|
124
|
+
return this.request("POST", `/api/admin/pages/${pageId}/publish`, {
|
|
125
|
+
body: config
|
|
126
|
+
});
|
|
112
127
|
}
|
|
113
128
|
/** 回滚页面 */
|
|
114
129
|
async rollbackPage(pageId, versionId) {
|
|
115
|
-
return this.request("POST", `/api/admin/pages/${pageId}/rollback`, {
|
|
130
|
+
return this.request("POST", `/api/admin/pages/${pageId}/rollback`, {
|
|
131
|
+
body: { versionId }
|
|
132
|
+
});
|
|
116
133
|
}
|
|
117
134
|
/** 获取版本历史 */
|
|
118
135
|
async getVersionHistory(pageId) {
|
|
@@ -121,22 +138,30 @@ var AdminApiClient = class {
|
|
|
121
138
|
// ==================== 组件管理 ====================
|
|
122
139
|
/** 获取组件列表 */
|
|
123
140
|
async listComponents(params) {
|
|
124
|
-
return this.request("GET", "/api/admin/components", {
|
|
141
|
+
return this.request("GET", "/api/admin/components", {
|
|
142
|
+
params
|
|
143
|
+
});
|
|
125
144
|
}
|
|
126
145
|
/** 获取组件详情 */
|
|
127
146
|
async getComponent(name, version) {
|
|
128
|
-
const path = version ? `/api/admin/components/${name}/versions/${version}` : `/api/admin/components/${name}`;
|
|
147
|
+
const path = version ? `/api/admin/components/${encodeURIComponent(name)}/versions/${encodeURIComponent(version)}` : `/api/admin/components/${encodeURIComponent(name)}`;
|
|
129
148
|
return this.request("GET", path);
|
|
130
149
|
}
|
|
131
150
|
/** 阻断组件版本 */
|
|
132
|
-
async blockComponent(name, version,
|
|
133
|
-
return this.request(
|
|
134
|
-
|
|
135
|
-
|
|
151
|
+
async blockComponent(name, version, data) {
|
|
152
|
+
return this.request(
|
|
153
|
+
"POST",
|
|
154
|
+
`/api/admin/components/${encodeURIComponent(name)}/versions/${encodeURIComponent(version)}/block`,
|
|
155
|
+
{ body: data }
|
|
156
|
+
);
|
|
136
157
|
}
|
|
137
158
|
/** 解除组件阻断 */
|
|
138
|
-
async unblockComponent(name, version) {
|
|
139
|
-
return this.request(
|
|
159
|
+
async unblockComponent(name, version, data) {
|
|
160
|
+
return this.request(
|
|
161
|
+
"POST",
|
|
162
|
+
`/api/admin/components/${encodeURIComponent(name)}/versions/${encodeURIComponent(version)}/unblock`,
|
|
163
|
+
{ body: data }
|
|
164
|
+
);
|
|
140
165
|
}
|
|
141
166
|
// ==================== Definition 管理 ====================
|
|
142
167
|
/** 获取 ActionDefinition 列表 */
|
|
@@ -153,7 +178,44 @@ var AdminApiClient = class {
|
|
|
153
178
|
}
|
|
154
179
|
/** 创建 DataQueryDefinition */
|
|
155
180
|
async createDataQueryDefinition(data) {
|
|
156
|
-
return this.request("POST", "/api/admin/definitions/queries", {
|
|
181
|
+
return this.request("POST", "/api/admin/definitions/queries", {
|
|
182
|
+
body: data
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
// ==================== 活动管理 ====================
|
|
186
|
+
/** 获取活动列表 */
|
|
187
|
+
async listActivities(params) {
|
|
188
|
+
return this.request("GET", "/api/admin/activities", {
|
|
189
|
+
params
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/** 获取活动详情 */
|
|
193
|
+
async getActivity(activityId) {
|
|
194
|
+
return this.request("GET", `/api/admin/activities/${activityId}`);
|
|
195
|
+
}
|
|
196
|
+
/** 创建活动 */
|
|
197
|
+
async createActivity(data) {
|
|
198
|
+
return this.request("POST", "/api/admin/activities", { body: data });
|
|
199
|
+
}
|
|
200
|
+
/** 更新活动 */
|
|
201
|
+
async updateActivity(activityId, data) {
|
|
202
|
+
return this.request("PUT", `/api/admin/activities/${activityId}`, { body: data });
|
|
203
|
+
}
|
|
204
|
+
/** 删除活动 */
|
|
205
|
+
async deleteActivity(activityId) {
|
|
206
|
+
return this.request("DELETE", `/api/admin/activities/${activityId}`);
|
|
207
|
+
}
|
|
208
|
+
// ==================== 审计日志 ====================
|
|
209
|
+
/** 获取审计日志列表 */
|
|
210
|
+
async listAuditLogs(params) {
|
|
211
|
+
return this.request("GET", "/api/admin/audit-logs", {
|
|
212
|
+
params
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
// ==================== 健康检查 ====================
|
|
216
|
+
/** 健康检查 */
|
|
217
|
+
async health() {
|
|
218
|
+
return this.request("GET", "/api/admin/health");
|
|
157
219
|
}
|
|
158
220
|
};
|
|
159
221
|
function createAdminClient(config) {
|
package/dist/index.mjs
CHANGED
|
@@ -6,6 +6,15 @@ var AdminApiClient = class {
|
|
|
6
6
|
...config
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* 获取认证 Token
|
|
11
|
+
*/
|
|
12
|
+
async getAuthToken() {
|
|
13
|
+
if (this.config.getToken) {
|
|
14
|
+
return this.config.getToken();
|
|
15
|
+
}
|
|
16
|
+
return this.config.token;
|
|
17
|
+
}
|
|
9
18
|
/**
|
|
10
19
|
* 发送请求
|
|
11
20
|
*/
|
|
@@ -23,11 +32,13 @@ var AdminApiClient = class {
|
|
|
23
32
|
url += `?${queryString}`;
|
|
24
33
|
}
|
|
25
34
|
}
|
|
35
|
+
const token = await this.getAuthToken();
|
|
26
36
|
let requestConfig = {
|
|
27
37
|
method,
|
|
28
38
|
headers: {
|
|
29
39
|
"Content-Type": "application/json",
|
|
30
|
-
...
|
|
40
|
+
...token ? { Authorization: `Bearer ${token}` } : {},
|
|
41
|
+
...this.config.getTraceHeaders ? this.config.getTraceHeaders() : {},
|
|
31
42
|
...this.config.headers
|
|
32
43
|
},
|
|
33
44
|
body: options?.body ? JSON.stringify(options.body) : void 0
|
|
@@ -58,7 +69,9 @@ var AdminApiClient = class {
|
|
|
58
69
|
// ==================== 页面管理 ====================
|
|
59
70
|
/** 获取页面列表 */
|
|
60
71
|
async listPages(params) {
|
|
61
|
-
return this.request("GET", "/api/admin/pages", {
|
|
72
|
+
return this.request("GET", "/api/admin/pages", {
|
|
73
|
+
params
|
|
74
|
+
});
|
|
62
75
|
}
|
|
63
76
|
/** 获取页面详情 */
|
|
64
77
|
async getPage(pageId) {
|
|
@@ -82,11 +95,15 @@ var AdminApiClient = class {
|
|
|
82
95
|
}
|
|
83
96
|
/** 发布页面 */
|
|
84
97
|
async publishPage(pageId, config) {
|
|
85
|
-
return this.request("POST", `/api/admin/pages/${pageId}/publish`, {
|
|
98
|
+
return this.request("POST", `/api/admin/pages/${pageId}/publish`, {
|
|
99
|
+
body: config
|
|
100
|
+
});
|
|
86
101
|
}
|
|
87
102
|
/** 回滚页面 */
|
|
88
103
|
async rollbackPage(pageId, versionId) {
|
|
89
|
-
return this.request("POST", `/api/admin/pages/${pageId}/rollback`, {
|
|
104
|
+
return this.request("POST", `/api/admin/pages/${pageId}/rollback`, {
|
|
105
|
+
body: { versionId }
|
|
106
|
+
});
|
|
90
107
|
}
|
|
91
108
|
/** 获取版本历史 */
|
|
92
109
|
async getVersionHistory(pageId) {
|
|
@@ -95,22 +112,30 @@ var AdminApiClient = class {
|
|
|
95
112
|
// ==================== 组件管理 ====================
|
|
96
113
|
/** 获取组件列表 */
|
|
97
114
|
async listComponents(params) {
|
|
98
|
-
return this.request("GET", "/api/admin/components", {
|
|
115
|
+
return this.request("GET", "/api/admin/components", {
|
|
116
|
+
params
|
|
117
|
+
});
|
|
99
118
|
}
|
|
100
119
|
/** 获取组件详情 */
|
|
101
120
|
async getComponent(name, version) {
|
|
102
|
-
const path = version ? `/api/admin/components/${name}/versions/${version}` : `/api/admin/components/${name}`;
|
|
121
|
+
const path = version ? `/api/admin/components/${encodeURIComponent(name)}/versions/${encodeURIComponent(version)}` : `/api/admin/components/${encodeURIComponent(name)}`;
|
|
103
122
|
return this.request("GET", path);
|
|
104
123
|
}
|
|
105
124
|
/** 阻断组件版本 */
|
|
106
|
-
async blockComponent(name, version,
|
|
107
|
-
return this.request(
|
|
108
|
-
|
|
109
|
-
|
|
125
|
+
async blockComponent(name, version, data) {
|
|
126
|
+
return this.request(
|
|
127
|
+
"POST",
|
|
128
|
+
`/api/admin/components/${encodeURIComponent(name)}/versions/${encodeURIComponent(version)}/block`,
|
|
129
|
+
{ body: data }
|
|
130
|
+
);
|
|
110
131
|
}
|
|
111
132
|
/** 解除组件阻断 */
|
|
112
|
-
async unblockComponent(name, version) {
|
|
113
|
-
return this.request(
|
|
133
|
+
async unblockComponent(name, version, data) {
|
|
134
|
+
return this.request(
|
|
135
|
+
"POST",
|
|
136
|
+
`/api/admin/components/${encodeURIComponent(name)}/versions/${encodeURIComponent(version)}/unblock`,
|
|
137
|
+
{ body: data }
|
|
138
|
+
);
|
|
114
139
|
}
|
|
115
140
|
// ==================== Definition 管理 ====================
|
|
116
141
|
/** 获取 ActionDefinition 列表 */
|
|
@@ -127,7 +152,44 @@ var AdminApiClient = class {
|
|
|
127
152
|
}
|
|
128
153
|
/** 创建 DataQueryDefinition */
|
|
129
154
|
async createDataQueryDefinition(data) {
|
|
130
|
-
return this.request("POST", "/api/admin/definitions/queries", {
|
|
155
|
+
return this.request("POST", "/api/admin/definitions/queries", {
|
|
156
|
+
body: data
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
// ==================== 活动管理 ====================
|
|
160
|
+
/** 获取活动列表 */
|
|
161
|
+
async listActivities(params) {
|
|
162
|
+
return this.request("GET", "/api/admin/activities", {
|
|
163
|
+
params
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/** 获取活动详情 */
|
|
167
|
+
async getActivity(activityId) {
|
|
168
|
+
return this.request("GET", `/api/admin/activities/${activityId}`);
|
|
169
|
+
}
|
|
170
|
+
/** 创建活动 */
|
|
171
|
+
async createActivity(data) {
|
|
172
|
+
return this.request("POST", "/api/admin/activities", { body: data });
|
|
173
|
+
}
|
|
174
|
+
/** 更新活动 */
|
|
175
|
+
async updateActivity(activityId, data) {
|
|
176
|
+
return this.request("PUT", `/api/admin/activities/${activityId}`, { body: data });
|
|
177
|
+
}
|
|
178
|
+
/** 删除活动 */
|
|
179
|
+
async deleteActivity(activityId) {
|
|
180
|
+
return this.request("DELETE", `/api/admin/activities/${activityId}`);
|
|
181
|
+
}
|
|
182
|
+
// ==================== 审计日志 ====================
|
|
183
|
+
/** 获取审计日志列表 */
|
|
184
|
+
async listAuditLogs(params) {
|
|
185
|
+
return this.request("GET", "/api/admin/audit-logs", {
|
|
186
|
+
params
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
// ==================== 健康检查 ====================
|
|
190
|
+
/** 健康检查 */
|
|
191
|
+
async health() {
|
|
192
|
+
return this.request("GET", "/api/admin/health");
|
|
131
193
|
}
|
|
132
194
|
};
|
|
133
195
|
function createAdminClient(config) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djvlc/openapi-admin-client",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "DJV Low-code Platform - Admin API
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "DJV Low-code Platform - Admin API 客户端",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -17,25 +17,31 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
20
|
-
"generate": "openapi-typescript ../specs/admin-api.yaml -o src/types.ts && npm run build",
|
|
21
20
|
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
22
21
|
"lint": "eslint src/ --ext .ts",
|
|
23
22
|
"typecheck": "tsc --noEmit",
|
|
24
23
|
"clean": "rimraf dist"
|
|
25
24
|
},
|
|
26
25
|
"dependencies": {
|
|
27
|
-
"@djvlc/contracts-types": "1.
|
|
26
|
+
"@djvlc/contracts-types": "1.3.0"
|
|
28
27
|
},
|
|
29
28
|
"devDependencies": {
|
|
30
29
|
"@types/node": "^20.0.0",
|
|
31
30
|
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
32
31
|
"@typescript-eslint/parser": "^7.0.0",
|
|
33
32
|
"eslint": "^8.56.0",
|
|
34
|
-
"openapi-typescript": "^6.0.0",
|
|
35
33
|
"rimraf": "^5.0.0",
|
|
36
34
|
"tsup": "^8.0.0",
|
|
37
35
|
"typescript": "^5.3.0"
|
|
38
36
|
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@djvlc/contracts-types": "1.3.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependenciesMeta": {
|
|
41
|
+
"@djvlc/contracts-types": {
|
|
42
|
+
"optional": false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
39
45
|
"keywords": [
|
|
40
46
|
"lowcode",
|
|
41
47
|
"openapi",
|