@lobehub/market-sdk 0.0.27 → 0.0.29
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/README.md +210 -112
- package/dist/index.d.mts +689 -385
- package/dist/index.mjs +468 -383
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,675 +1,888 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginManifest, PluginCompatibility, ConnectionType, AdminPluginItem, AdminPluginItemDetail, PluginVersion, AdminDeploymentOption, InstallationDetails, SystemDependency } from '@lobehub/market-types';
|
|
2
2
|
export * from '@lobehub/market-types';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Visibility levels for plugins in the marketplace
|
|
7
|
+
* - public: Visible to all users
|
|
8
|
+
* - private: Visible only to the owner and authorized users
|
|
9
|
+
* - internal: Visible only within the organization
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
issuer: string;
|
|
10
|
-
market_index_schema_version: number;
|
|
11
|
-
resource_types_supported: string[];
|
|
12
|
-
resource_endpoints: Record<string, string>;
|
|
13
|
-
manifest_endpoint_template: string | Record<string, string>;
|
|
14
|
-
support_locales: string[];
|
|
15
|
-
response_types_supported: string[];
|
|
16
|
-
authentication?: {
|
|
17
|
-
schemes_supported: Array<'none' | 'apiKey' | 'oauth2'>;
|
|
18
|
-
};
|
|
19
|
-
api_documentation_url?: string;
|
|
20
|
-
policy_url?: string;
|
|
21
|
-
terms_of_service_url?: string;
|
|
22
|
-
}
|
|
11
|
+
declare const VisibilityEnumSchema: z.ZodEnum<["public", "private", "internal"]>;
|
|
23
12
|
/**
|
|
24
|
-
*
|
|
13
|
+
* Publication status options for plugins
|
|
14
|
+
* - published: Publicly available in the marketplace
|
|
15
|
+
* - unpublished: Not publicly visible
|
|
16
|
+
* - archived: Marked as no longer maintained
|
|
17
|
+
* - deprecated: Marked as deprecated, but still available
|
|
25
18
|
*/
|
|
26
|
-
interface MarketSDKOptions {
|
|
27
|
-
baseURL?: string;
|
|
28
|
-
defaultLocale?: string;
|
|
29
|
-
apiKey?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface PluginItem {
|
|
33
|
-
identifier: string;
|
|
34
|
-
version: string;
|
|
35
|
-
isLatest: boolean;
|
|
36
|
-
name: string;
|
|
37
|
-
createdAt: string;
|
|
38
|
-
manifestUrl?: string;
|
|
39
|
-
manifestVersion: string;
|
|
40
|
-
icon?: string;
|
|
41
|
-
author?: string;
|
|
42
|
-
homepage?: string;
|
|
43
|
-
category?: string;
|
|
44
|
-
connectionType?: ConnectionType;
|
|
45
|
-
compatibility?: PluginCompatibility;
|
|
46
|
-
capabilities: {
|
|
47
|
-
tools: boolean;
|
|
48
|
-
prompts: boolean;
|
|
49
|
-
resources: boolean;
|
|
50
|
-
};
|
|
51
|
-
description: string;
|
|
52
|
-
tags?: string[];
|
|
53
|
-
authRequirement?: string;
|
|
54
|
-
isInstallable?: boolean;
|
|
55
|
-
toolsCount?: number;
|
|
56
|
-
promptsCount?: number;
|
|
57
|
-
resourcesCount?: number;
|
|
58
|
-
isValidated?: boolean;
|
|
59
|
-
installCount?: number;
|
|
60
|
-
ratingAverage?: number;
|
|
61
|
-
ratingCount?: number;
|
|
62
|
-
commentCount?: number;
|
|
63
|
-
}
|
|
64
|
-
interface PluginListResponse {
|
|
65
|
-
items: PluginItem[];
|
|
66
|
-
totalCount: number;
|
|
67
|
-
currentPage: number;
|
|
68
|
-
pageSize: number;
|
|
69
|
-
totalPages: number;
|
|
70
|
-
categories: string[];
|
|
71
|
-
tags: string[];
|
|
72
|
-
}
|
|
73
|
-
interface PluginQueryParams {
|
|
74
|
-
page?: number;
|
|
75
|
-
pageSize?: number;
|
|
76
|
-
category?: string;
|
|
77
|
-
tags?: string;
|
|
78
|
-
q?: string;
|
|
79
|
-
sort?: 'installCount' | 'createdAt' | 'updatedAt' | 'ratingAverage';
|
|
80
|
-
order?: 'asc' | 'desc';
|
|
81
|
-
locale?: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
declare const VisibilityEnumSchema: z.ZodEnum<["public", "private", "internal"]>;
|
|
85
19
|
declare const StatusEnumSchema: z.ZodEnum<["published", "unpublished", "archived", "deprecated"]>;
|
|
86
20
|
/**
|
|
87
|
-
*
|
|
21
|
+
* Common query parameters for admin list endpoints
|
|
22
|
+
* These parameters are used for pagination, filtering, and sorting.
|
|
88
23
|
*/
|
|
89
24
|
interface AdminListQueryParams {
|
|
25
|
+
/** Current page number (1-based) */
|
|
90
26
|
current?: number;
|
|
27
|
+
/** Search keyword for filtering results */
|
|
28
|
+
keyword?: string;
|
|
29
|
+
/** Number of items per page */
|
|
91
30
|
pageSize?: number;
|
|
31
|
+
/** Field to sort results by */
|
|
92
32
|
sortField?: string;
|
|
33
|
+
/** Sort direction */
|
|
93
34
|
sortOrder?: 'ascend' | 'descend';
|
|
94
|
-
keyword?: string;
|
|
95
35
|
}
|
|
96
36
|
/**
|
|
97
|
-
*
|
|
37
|
+
* Common response format for paginated admin list endpoints
|
|
38
|
+
* This structure provides both the data and pagination information.
|
|
98
39
|
*/
|
|
99
40
|
interface AdminListResponse<T> {
|
|
41
|
+
/** Current page number (1-based) */
|
|
42
|
+
current: number;
|
|
43
|
+
/** Array of items for the current page */
|
|
100
44
|
data: T[];
|
|
45
|
+
/** Number of items per page */
|
|
46
|
+
pageSize: number;
|
|
47
|
+
/** Total number of items across all pages */
|
|
101
48
|
total: number;
|
|
49
|
+
/** Total number of pages */
|
|
102
50
|
totalPages: number;
|
|
103
|
-
current: number;
|
|
104
|
-
pageSize: number;
|
|
105
51
|
}
|
|
106
52
|
/**
|
|
107
|
-
*
|
|
53
|
+
* Review status options
|
|
54
|
+
* - pending: Awaiting review
|
|
55
|
+
* - approved: Review approved
|
|
56
|
+
* - rejected: Review rejected
|
|
108
57
|
*/
|
|
109
|
-
interface PluginVersion {
|
|
110
|
-
id: number;
|
|
111
|
-
pluginId: number;
|
|
112
|
-
version: string;
|
|
113
|
-
isLatest: boolean;
|
|
114
|
-
manifestUrl: string | null;
|
|
115
|
-
toolsCount: number;
|
|
116
|
-
promptsCount: number;
|
|
117
|
-
resourcesCount: number;
|
|
118
|
-
isValidated: boolean;
|
|
119
|
-
createdAt: string;
|
|
120
|
-
updatedAt: string;
|
|
121
|
-
manifest: PluginManifest;
|
|
122
|
-
meta: Record<string, any> | null;
|
|
123
|
-
}
|
|
124
58
|
type ReviewStatus = 'pending' | 'approved' | 'rejected';
|
|
59
|
+
/**
|
|
60
|
+
* Review status schema for validation
|
|
61
|
+
*/
|
|
125
62
|
declare const ReviewStatusEnumSchema: z.ZodEnum<["published", "draft", "review", "rejected"]>;
|
|
126
63
|
/**
|
|
127
|
-
*
|
|
64
|
+
* Parameters for admin plugin listing
|
|
65
|
+
* Extends the common query parameters with plugin-specific filters.
|
|
128
66
|
*/
|
|
129
67
|
interface AdminPluginParams {
|
|
130
|
-
|
|
131
|
-
visibility?: 'public' | 'private' | 'unlisted';
|
|
68
|
+
/** Filter for featured plugins */
|
|
132
69
|
featured?: boolean;
|
|
133
|
-
|
|
70
|
+
/** Maximum number of items to return */
|
|
134
71
|
limit?: number;
|
|
72
|
+
/** Number of items to skip */
|
|
135
73
|
offset?: number;
|
|
136
|
-
|
|
137
|
-
orderBy?: 'createdAt' | 'updatedAt' | 'installCount' | 'ratingAverage';
|
|
74
|
+
/** Sort direction */
|
|
138
75
|
order?: 'asc' | 'desc';
|
|
76
|
+
/** Field to sort by */
|
|
77
|
+
orderBy?: 'createdAt' | 'updatedAt' | 'installCount' | 'ratingAverage';
|
|
78
|
+
/** Filter by owner ID */
|
|
79
|
+
ownerId?: number;
|
|
80
|
+
/** Search query string */
|
|
81
|
+
query?: string;
|
|
82
|
+
/** Filter by plugin status */
|
|
83
|
+
status?: 'published' | 'draft' | 'review' | 'rejected';
|
|
84
|
+
/** Filter by visibility level */
|
|
85
|
+
visibility?: 'public' | 'private' | 'unlisted';
|
|
139
86
|
}
|
|
140
87
|
/**
|
|
141
|
-
*
|
|
88
|
+
* Parameters for creating a new plugin version
|
|
142
89
|
*/
|
|
143
90
|
interface PluginVersionCreateParams {
|
|
144
|
-
version
|
|
145
|
-
manifest: PluginManifest;
|
|
146
|
-
manifestUrl?: string;
|
|
91
|
+
/** Whether this is the latest version */
|
|
147
92
|
isLatest?: boolean;
|
|
93
|
+
/** Whether this version has been validated */
|
|
148
94
|
isValidated?: boolean;
|
|
95
|
+
/** The complete plugin manifest */
|
|
96
|
+
manifest: PluginManifest;
|
|
97
|
+
/** Optional URL to the manifest file */
|
|
98
|
+
manifestUrl?: string;
|
|
99
|
+
/** Additional metadata for the version */
|
|
149
100
|
meta?: Record<string, any>;
|
|
101
|
+
/** Semantic version string (e.g., "1.0.0") */
|
|
102
|
+
version: string;
|
|
150
103
|
}
|
|
151
104
|
/**
|
|
152
|
-
*
|
|
105
|
+
* Parameters for updating an existing plugin version
|
|
153
106
|
*/
|
|
154
107
|
interface PluginVersionUpdateParams {
|
|
155
|
-
|
|
108
|
+
/** Whether this version has been validated */
|
|
156
109
|
isValidated?: boolean;
|
|
110
|
+
/** URL to the manifest file */
|
|
111
|
+
manifestUrl?: string;
|
|
112
|
+
/** Additional metadata for the version */
|
|
157
113
|
meta?: Record<string, any>;
|
|
158
114
|
}
|
|
159
115
|
/**
|
|
160
|
-
*
|
|
116
|
+
* Parameters for updating a plugin
|
|
161
117
|
*/
|
|
162
118
|
interface PluginUpdateParams {
|
|
119
|
+
/** Unique identifier for the plugin */
|
|
163
120
|
identifier?: string;
|
|
164
|
-
|
|
165
|
-
status?: 'published' | 'draft' | 'review' | 'rejected';
|
|
121
|
+
/** Whether this plugin is featured */
|
|
166
122
|
isFeatured?: boolean;
|
|
167
|
-
|
|
123
|
+
/** Additional metadata for the plugin */
|
|
168
124
|
meta?: Record<string, any>;
|
|
125
|
+
/** Publication status */
|
|
126
|
+
status?: 'published' | 'draft' | 'review' | 'rejected';
|
|
127
|
+
/** Tags for categorization */
|
|
128
|
+
tags?: string[];
|
|
129
|
+
/** Visibility level */
|
|
130
|
+
visibility?: 'public' | 'private' | 'unlisted';
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Market Service Discovery Document
|
|
135
|
+
*
|
|
136
|
+
* Defines the structure of the discovery document returned by the API.
|
|
137
|
+
* This document provides information about available endpoints, authentication
|
|
138
|
+
* methods, and other capabilities of the Market API.
|
|
139
|
+
*/
|
|
140
|
+
interface DiscoveryDocument {
|
|
141
|
+
/** URL to the API documentation */
|
|
142
|
+
api_documentation_url?: string;
|
|
143
|
+
/** Authentication schemes supported by the API */
|
|
144
|
+
authentication?: {
|
|
145
|
+
/** List of supported authentication methods */
|
|
146
|
+
schemes_supported: Array<'none' | 'apiKey' | 'oauth2'>;
|
|
147
|
+
};
|
|
148
|
+
/** API issuer identifier (typically the base domain) */
|
|
149
|
+
issuer: string;
|
|
150
|
+
/** Template for constructing manifest endpoint URLs */
|
|
151
|
+
manifest_endpoint_template: string | Record<string, string>;
|
|
152
|
+
/** Version of the market index schema */
|
|
153
|
+
market_index_schema_version: number;
|
|
154
|
+
/** URL to the privacy policy */
|
|
155
|
+
policy_url?: string;
|
|
156
|
+
/** Mapping of resource types to their endpoint paths */
|
|
157
|
+
resource_endpoints: Record<string, string>;
|
|
158
|
+
/** List of resource types available in the marketplace */
|
|
159
|
+
resource_types_supported: string[];
|
|
160
|
+
/** List of response types supported by the API */
|
|
161
|
+
response_types_supported: string[];
|
|
162
|
+
/** List of locales supported for content localization */
|
|
163
|
+
support_locales: string[];
|
|
164
|
+
/** URL to the terms of service */
|
|
165
|
+
terms_of_service_url?: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* SDK Configuration Options
|
|
169
|
+
*
|
|
170
|
+
* Options for configuring the behavior of the Market SDK.
|
|
171
|
+
*/
|
|
172
|
+
interface MarketSDKOptions {
|
|
173
|
+
/** API key for authentication */
|
|
174
|
+
apiKey?: string;
|
|
175
|
+
/** Base URL for the Market API */
|
|
176
|
+
baseURL?: string;
|
|
177
|
+
/** Default locale to use for localized content */
|
|
178
|
+
defaultLocale?: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Category with count information
|
|
183
|
+
* Represents a plugin category and the number of plugins in that category.
|
|
184
|
+
*/
|
|
185
|
+
interface CategoryItem {
|
|
186
|
+
/** Category name */
|
|
187
|
+
category: string;
|
|
188
|
+
/** Number of plugins in this category */
|
|
189
|
+
count: number;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Plugin item in the marketplace
|
|
193
|
+
* Represents a plugin as displayed in the marketplace listing.
|
|
194
|
+
*/
|
|
195
|
+
interface PluginItem {
|
|
196
|
+
/** Authentication requirements for using the plugin */
|
|
197
|
+
authRequirement?: string;
|
|
198
|
+
/** Author or organization name */
|
|
199
|
+
author?: string;
|
|
200
|
+
/** Plugin capabilities */
|
|
201
|
+
capabilities: {
|
|
202
|
+
/** Whether the plugin provides custom prompts */
|
|
203
|
+
prompts: boolean;
|
|
204
|
+
/** Whether the plugin provides resources (assets) */
|
|
205
|
+
resources: boolean;
|
|
206
|
+
/** Whether the plugin provides tools (functions) */
|
|
207
|
+
tools: boolean;
|
|
208
|
+
};
|
|
209
|
+
/** Category for classification */
|
|
210
|
+
category?: string;
|
|
211
|
+
/** Number of comments on this plugin */
|
|
212
|
+
commentCount?: number;
|
|
213
|
+
/** Compatibility information for different platforms/versions */
|
|
214
|
+
compatibility?: PluginCompatibility;
|
|
215
|
+
/** Connection type for communicating with the plugin */
|
|
216
|
+
connectionType?: ConnectionType;
|
|
217
|
+
/** Creation timestamp (ISO 8601 format) */
|
|
218
|
+
createdAt: string;
|
|
219
|
+
/** Short description of the plugin */
|
|
220
|
+
description: string;
|
|
221
|
+
/** URL to the plugin's homepage or documentation */
|
|
222
|
+
homepage?: string;
|
|
223
|
+
/** Icon URL or emoji */
|
|
224
|
+
icon?: string;
|
|
225
|
+
/** Unique identifier for the plugin */
|
|
226
|
+
identifier: string;
|
|
227
|
+
/** Number of installations */
|
|
228
|
+
installCount?: number;
|
|
229
|
+
/** Whether the plugin can be installed */
|
|
230
|
+
isInstallable?: boolean;
|
|
231
|
+
/** Whether this is the latest version */
|
|
232
|
+
isLatest: boolean;
|
|
233
|
+
/** Whether this plugin has been validated */
|
|
234
|
+
isValidated?: boolean;
|
|
235
|
+
/** URL to the manifest file */
|
|
236
|
+
manifestUrl?: string;
|
|
237
|
+
/** Manifest schema version */
|
|
238
|
+
manifestVersion: string;
|
|
239
|
+
/** Display name of the plugin */
|
|
240
|
+
name: string;
|
|
241
|
+
/** Number of prompts provided by this plugin */
|
|
242
|
+
promptsCount?: number;
|
|
243
|
+
/** Average rating (typically 1-5 scale) */
|
|
244
|
+
ratingAverage?: number;
|
|
245
|
+
/** Number of ratings received */
|
|
246
|
+
ratingCount?: number;
|
|
247
|
+
/** Number of resources provided by this plugin */
|
|
248
|
+
resourcesCount?: number;
|
|
249
|
+
/** Tags for filtering and discovery */
|
|
250
|
+
tags?: string[];
|
|
251
|
+
/** Number of tools provided by this plugin */
|
|
252
|
+
toolsCount?: number;
|
|
253
|
+
/** Version string (e.g., "1.0.0") */
|
|
254
|
+
version: string;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Response structure for plugin listing endpoints
|
|
258
|
+
* Contains both the plugin items and pagination/filtering metadata.
|
|
259
|
+
*/
|
|
260
|
+
interface PluginListResponse {
|
|
261
|
+
/** Available categories for filtering */
|
|
262
|
+
categories: string[];
|
|
263
|
+
/** Current page number (1-based) */
|
|
264
|
+
currentPage: number;
|
|
265
|
+
/** Array of plugin items for the current page */
|
|
266
|
+
items: PluginItem[];
|
|
267
|
+
/** Number of items per page */
|
|
268
|
+
pageSize: number;
|
|
269
|
+
/** Available tags for filtering */
|
|
270
|
+
tags: string[];
|
|
271
|
+
/** Total number of items across all pages */
|
|
272
|
+
totalCount: number;
|
|
273
|
+
/** Total number of pages */
|
|
274
|
+
totalPages: number;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Query parameters for plugin listing
|
|
278
|
+
* Used to filter, sort, and paginate plugin results.
|
|
279
|
+
*/
|
|
280
|
+
interface PluginQueryParams {
|
|
281
|
+
/** Filter by category */
|
|
282
|
+
category?: string;
|
|
283
|
+
/** Locale for localized content */
|
|
284
|
+
locale?: string;
|
|
285
|
+
/** Sort direction */
|
|
286
|
+
order?: 'asc' | 'desc';
|
|
287
|
+
/** Page number (1-based) */
|
|
288
|
+
page?: number;
|
|
289
|
+
/** Number of items per page */
|
|
290
|
+
pageSize?: number;
|
|
291
|
+
/** Search query string */
|
|
292
|
+
q?: string;
|
|
293
|
+
/** Field to sort by */
|
|
294
|
+
sort?: 'installCount' | 'createdAt' | 'updatedAt' | 'ratingAverage';
|
|
295
|
+
/** Filter by tags (comma-separated) */
|
|
296
|
+
tags?: string;
|
|
169
297
|
}
|
|
170
298
|
|
|
171
299
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
300
|
+
* Base SDK class
|
|
301
|
+
*
|
|
302
|
+
* Provides shared request handling and authentication functionality that is used
|
|
303
|
+
* by both the Market SDK and Admin SDK. This class handles the common concerns:
|
|
304
|
+
* - API endpoint configuration
|
|
305
|
+
* - Authentication header management
|
|
306
|
+
* - HTTP request handling
|
|
307
|
+
* - Error handling
|
|
308
|
+
* - Query string building
|
|
174
309
|
*/
|
|
175
310
|
declare class BaseSDK {
|
|
311
|
+
/** Base API URL */
|
|
176
312
|
protected baseUrl: string;
|
|
313
|
+
/** Default locale for requests that require localization */
|
|
177
314
|
protected defaultLocale: string;
|
|
315
|
+
/** HTTP headers to include with all requests */
|
|
178
316
|
protected headers: Record<string, string>;
|
|
179
317
|
/**
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* @param
|
|
318
|
+
* Creates a new BaseSDK instance
|
|
319
|
+
*
|
|
320
|
+
* @param options - Configuration options for the SDK
|
|
321
|
+
* @param sharedHeaders - Optional shared headers object for reuse across services
|
|
183
322
|
*/
|
|
184
323
|
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
185
324
|
/**
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* @param
|
|
189
|
-
* @
|
|
325
|
+
* Sends an HTTP request to the API and handles the response
|
|
326
|
+
*
|
|
327
|
+
* @param url - Request URL path (will be appended to baseUrl)
|
|
328
|
+
* @param options - Fetch API request options
|
|
329
|
+
* @returns Promise resolving to the parsed JSON response
|
|
330
|
+
* @throws Error if the request fails
|
|
190
331
|
*/
|
|
191
332
|
protected request<T>(url: string, options?: RequestInit): Promise<T>;
|
|
192
333
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
* @
|
|
334
|
+
* Builds a URL query string from a parameters object
|
|
335
|
+
*
|
|
336
|
+
* @param params - Object containing query parameters
|
|
337
|
+
* @returns Formatted query string (including leading ? if params exist)
|
|
196
338
|
*/
|
|
197
339
|
protected buildQueryString(params: Record<string, any>): string;
|
|
198
340
|
/**
|
|
199
|
-
*
|
|
200
|
-
*
|
|
341
|
+
* Sets an authentication token for API requests
|
|
342
|
+
*
|
|
343
|
+
* @param token - API authentication token
|
|
201
344
|
*/
|
|
202
345
|
setAuthToken(token: string): void;
|
|
203
346
|
/**
|
|
204
|
-
*
|
|
347
|
+
* Clears the authentication token
|
|
205
348
|
*/
|
|
206
349
|
clearAuthToken(): void;
|
|
207
350
|
}
|
|
208
351
|
|
|
209
352
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* 创建插件服务实例
|
|
216
|
-
* @param options SDK 配置选项
|
|
217
|
-
* @param sharedHeaders 共享的 headers 对象(可选)
|
|
218
|
-
*/
|
|
219
|
-
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
220
|
-
/**
|
|
221
|
-
* 获取插件列表
|
|
222
|
-
* @param params 查询参数
|
|
223
|
-
* @returns 插件列表响应
|
|
224
|
-
*/
|
|
225
|
-
getPluginList(params?: PluginQueryParams): Promise<PluginListResponse>;
|
|
226
|
-
/**
|
|
227
|
-
* 获取插件清单
|
|
228
|
-
* @param identifier 插件标识符
|
|
229
|
-
* @param locale 语言
|
|
230
|
-
* @param version 版本
|
|
231
|
-
* @returns 插件清单
|
|
232
|
-
*/
|
|
233
|
-
getPluginManifest(identifier: string, locale?: string, version?: string): Promise<PluginManifest>;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* LobeHub Market SDK Client
|
|
238
|
-
* 采用组合模式组合各个领域服务
|
|
239
|
-
*/
|
|
240
|
-
declare class MarketSDK extends BaseSDK {
|
|
241
|
-
/**
|
|
242
|
-
* 插件服务
|
|
243
|
-
*/
|
|
244
|
-
readonly plugins: PluginsService;
|
|
245
|
-
/**
|
|
246
|
-
* 发现服务
|
|
247
|
-
*/
|
|
248
|
-
private readonly discovery;
|
|
249
|
-
/**
|
|
250
|
-
* Create MarketSDK instance
|
|
251
|
-
* @param options SDK configuration options
|
|
252
|
-
*/
|
|
253
|
-
constructor(options?: MarketSDKOptions);
|
|
254
|
-
/**
|
|
255
|
-
* Get market service discovery document
|
|
256
|
-
* @returns Service discovery document
|
|
257
|
-
*/
|
|
258
|
-
getDiscoveryDocument(): Promise<DiscoveryDocument>;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* 插件管理服务
|
|
263
|
-
* 处理插件相关的管理功能
|
|
353
|
+
* Plugin Management Service
|
|
354
|
+
*
|
|
355
|
+
* Provides administrative functionality for managing plugins in the marketplace.
|
|
356
|
+
* This service handles CRUD operations for plugins, plugin versions, and deployment options.
|
|
264
357
|
*/
|
|
265
358
|
declare class PluginService extends BaseSDK {
|
|
266
359
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
* @param
|
|
360
|
+
* Creates a new PluginService instance
|
|
361
|
+
*
|
|
362
|
+
* @param options - Configuration options for the SDK
|
|
363
|
+
* @param sharedHeaders - Optional shared headers object for reuse across services
|
|
270
364
|
*/
|
|
271
365
|
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
272
366
|
/**
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
367
|
+
* Imports plugin manifests (requires admin privileges)
|
|
368
|
+
*
|
|
369
|
+
* Allows batch importing of plugin manifests into the marketplace.
|
|
370
|
+
*
|
|
371
|
+
* @param manifests - Array of plugin manifests to import
|
|
372
|
+
* @param ownerId - Optional owner ID to associate with the imported plugins
|
|
373
|
+
* @returns Promise resolving to the import results with counts of success and failure
|
|
277
374
|
*/
|
|
278
375
|
importManifests(manifests: PluginManifest[], ownerId?: number): Promise<{
|
|
279
|
-
success: number;
|
|
280
376
|
failed: number;
|
|
377
|
+
success: number;
|
|
281
378
|
}>;
|
|
282
379
|
/**
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
380
|
+
* Retrieves a list of plugins with admin details
|
|
381
|
+
*
|
|
382
|
+
* Supports filtering, pagination, and sorting of results.
|
|
383
|
+
*
|
|
384
|
+
* @param params - Query parameters for filtering and pagination
|
|
385
|
+
* @returns Promise resolving to the plugin list response with admin details
|
|
286
386
|
*/
|
|
287
387
|
getPlugins(params?: AdminListQueryParams): Promise<AdminListResponse<AdminPluginItem>>;
|
|
288
388
|
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
* @
|
|
389
|
+
* Retrieves a single plugin with full admin details
|
|
390
|
+
*
|
|
391
|
+
* @param id - Plugin ID or identifier
|
|
392
|
+
* @returns Promise resolving to the detailed plugin information with version history
|
|
292
393
|
*/
|
|
293
|
-
getPlugin(id: number | string): Promise<
|
|
294
|
-
versions: PluginVersion[];
|
|
295
|
-
}>;
|
|
394
|
+
getPlugin(id: number | string): Promise<AdminPluginItemDetail>;
|
|
296
395
|
/**
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
* @param
|
|
300
|
-
* @
|
|
396
|
+
* Updates plugin information
|
|
397
|
+
*
|
|
398
|
+
* @param id - Plugin ID
|
|
399
|
+
* @param data - Plugin update data containing fields to update
|
|
400
|
+
* @returns Promise resolving to the updated plugin
|
|
301
401
|
*/
|
|
302
402
|
updatePlugin(id: number, data: PluginUpdateParams): Promise<AdminPluginItem>;
|
|
303
403
|
/**
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
* @param
|
|
307
|
-
* @
|
|
404
|
+
* Updates plugin publication status
|
|
405
|
+
*
|
|
406
|
+
* @param id - Plugin ID
|
|
407
|
+
* @param status - New status to set
|
|
408
|
+
* @returns Promise resolving to success response
|
|
308
409
|
*/
|
|
309
410
|
updatePluginStatus(id: number, status: 'published' | 'draft' | 'review' | 'rejected'): Promise<{
|
|
310
|
-
success: boolean;
|
|
311
411
|
message: string;
|
|
412
|
+
success: boolean;
|
|
312
413
|
}>;
|
|
313
414
|
/**
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
* @
|
|
415
|
+
* Deletes a plugin
|
|
416
|
+
*
|
|
417
|
+
* @param id - Plugin ID
|
|
418
|
+
* @returns Promise resolving to success response
|
|
317
419
|
*/
|
|
318
420
|
deletePlugin(id: number): Promise<{
|
|
319
|
-
success: boolean;
|
|
320
421
|
message: string;
|
|
422
|
+
success: boolean;
|
|
321
423
|
}>;
|
|
322
424
|
/**
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
* @
|
|
425
|
+
* Retrieves the version history for a plugin
|
|
426
|
+
*
|
|
427
|
+
* @param pluginId - Plugin ID
|
|
428
|
+
* @returns Promise resolving to an array of plugin versions
|
|
326
429
|
*/
|
|
327
430
|
getPluginVersions(pluginId: number): Promise<PluginVersion[]>;
|
|
328
431
|
/**
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
* @param
|
|
332
|
-
* @
|
|
432
|
+
* Retrieves a specific plugin version
|
|
433
|
+
*
|
|
434
|
+
* @param pluginId - Plugin ID
|
|
435
|
+
* @param versionId - Version ID
|
|
436
|
+
* @returns Promise resolving to the plugin version details
|
|
333
437
|
*/
|
|
334
438
|
getPluginVersion(pluginId: number, versionId: number): Promise<PluginVersion>;
|
|
335
439
|
/**
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
* @param
|
|
339
|
-
* @
|
|
440
|
+
* Creates a new plugin version
|
|
441
|
+
*
|
|
442
|
+
* @param pluginId - Plugin ID
|
|
443
|
+
* @param data - Version creation data including manifest and version string
|
|
444
|
+
* @returns Promise resolving to the created plugin version
|
|
340
445
|
*/
|
|
341
446
|
createPluginVersion(pluginId: number, data: PluginVersionCreateParams): Promise<PluginVersion>;
|
|
342
447
|
/**
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* @param
|
|
346
|
-
* @param
|
|
347
|
-
* @
|
|
448
|
+
* Updates a plugin version
|
|
449
|
+
*
|
|
450
|
+
* @param pluginId - Plugin ID
|
|
451
|
+
* @param versionId - Version ID
|
|
452
|
+
* @param data - Version update data
|
|
453
|
+
* @returns Promise resolving to the updated plugin version
|
|
348
454
|
*/
|
|
349
455
|
updatePluginVersion(pluginId: number, versionId: number, data: PluginVersionUpdateParams): Promise<PluginVersion>;
|
|
350
456
|
/**
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
* @param
|
|
354
|
-
* @
|
|
457
|
+
* Deletes a plugin version
|
|
458
|
+
*
|
|
459
|
+
* @param pluginId - Plugin ID
|
|
460
|
+
* @param versionId - Version ID
|
|
461
|
+
* @returns Promise resolving to success response
|
|
355
462
|
*/
|
|
356
463
|
deletePluginVersion(pluginId: number, versionId: number): Promise<{
|
|
357
|
-
success: boolean;
|
|
358
464
|
message: string;
|
|
465
|
+
success: boolean;
|
|
359
466
|
}>;
|
|
360
467
|
/**
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
* @param
|
|
364
|
-
* @
|
|
468
|
+
* Sets a specific version as the latest version of a plugin
|
|
469
|
+
*
|
|
470
|
+
* @param pluginId - Plugin ID
|
|
471
|
+
* @param versionId - Version ID to set as latest
|
|
472
|
+
* @returns Promise resolving to success response
|
|
365
473
|
*/
|
|
366
474
|
setPluginVersionAsLatest(pluginId: number, versionId: number): Promise<{
|
|
367
|
-
success: boolean;
|
|
368
475
|
message: string;
|
|
476
|
+
success: boolean;
|
|
369
477
|
}>;
|
|
370
478
|
/**
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
* @param
|
|
374
|
-
* @
|
|
479
|
+
* Updates plugin visibility
|
|
480
|
+
*
|
|
481
|
+
* @param id - Plugin ID
|
|
482
|
+
* @param visibility - New visibility setting
|
|
483
|
+
* @returns Promise resolving to success response
|
|
375
484
|
*/
|
|
376
485
|
updatePluginVisibility(id: number, visibility: 'public' | 'private' | 'unlisted'): Promise<{
|
|
377
|
-
success: boolean;
|
|
378
486
|
message: string;
|
|
487
|
+
success: boolean;
|
|
379
488
|
}>;
|
|
380
489
|
/**
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
* @param
|
|
384
|
-
* @
|
|
490
|
+
* Updates status for multiple plugins in a single operation
|
|
491
|
+
*
|
|
492
|
+
* @param ids - Array of plugin IDs to update
|
|
493
|
+
* @param status - New status to set for all specified plugins
|
|
494
|
+
* @returns Promise resolving to success response
|
|
385
495
|
*/
|
|
386
496
|
batchUpdatePluginStatus(ids: number[], status: 'published' | 'draft' | 'review' | 'rejected'): Promise<{
|
|
387
|
-
success: boolean;
|
|
388
497
|
message: string;
|
|
498
|
+
success: boolean;
|
|
389
499
|
}>;
|
|
390
500
|
/**
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
* @
|
|
501
|
+
* Deletes multiple plugins in a single operation
|
|
502
|
+
*
|
|
503
|
+
* @param ids - Array of plugin IDs to delete
|
|
504
|
+
* @returns Promise resolving to success response
|
|
394
505
|
*/
|
|
395
506
|
batchDeletePlugins(ids: number[]): Promise<{
|
|
396
|
-
success: boolean;
|
|
397
507
|
message: string;
|
|
508
|
+
success: boolean;
|
|
398
509
|
}>;
|
|
399
510
|
/**
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
* @param
|
|
403
|
-
* @
|
|
511
|
+
* Retrieves detailed information about a plugin version including deployment options
|
|
512
|
+
*
|
|
513
|
+
* @param pluginId - Plugin ID
|
|
514
|
+
* @param versionId - Version ID
|
|
515
|
+
* @returns Promise resolving to version details with deployment options
|
|
404
516
|
*/
|
|
405
517
|
getPluginVersionDetails(pluginId: number, versionId: number): Promise<PluginVersion & {
|
|
406
518
|
deploymentOptions: any;
|
|
407
519
|
}>;
|
|
408
520
|
/**
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
* @param
|
|
412
|
-
* @param
|
|
413
|
-
* @
|
|
521
|
+
* Updates detailed information for a plugin version
|
|
522
|
+
*
|
|
523
|
+
* @param pluginId - Plugin ID
|
|
524
|
+
* @param versionId - Version ID
|
|
525
|
+
* @param data - Detailed version update data including metadata and capabilities
|
|
526
|
+
* @returns Promise resolving to the updated plugin version
|
|
414
527
|
*/
|
|
415
528
|
updatePluginVersionDetails(pluginId: number, versionId: number, data: {
|
|
416
529
|
author?: string;
|
|
417
530
|
authorUrl?: string;
|
|
418
|
-
name?: string;
|
|
419
|
-
description?: string;
|
|
420
|
-
tags?: string[];
|
|
421
|
-
icon?: string;
|
|
422
|
-
category?: string;
|
|
423
|
-
capabilitiesTools?: boolean;
|
|
424
531
|
capabilitiesPrompts?: boolean;
|
|
425
532
|
capabilitiesResources?: boolean;
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
533
|
+
capabilitiesTools?: boolean;
|
|
534
|
+
category?: string;
|
|
535
|
+
description?: string;
|
|
536
|
+
icon?: string;
|
|
429
537
|
isValidated?: boolean;
|
|
430
538
|
meta?: Record<string, any>;
|
|
539
|
+
name?: string;
|
|
540
|
+
prompts?: any;
|
|
541
|
+
resources?: any;
|
|
542
|
+
tags?: string[];
|
|
543
|
+
tools?: any;
|
|
431
544
|
}): Promise<PluginVersion>;
|
|
432
545
|
/**
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
* @param
|
|
436
|
-
* @
|
|
546
|
+
* Retrieves deployment options for a specific plugin version
|
|
547
|
+
*
|
|
548
|
+
* @param pluginId - Plugin ID
|
|
549
|
+
* @param versionId - Version ID
|
|
550
|
+
* @returns Promise resolving to an array of deployment options
|
|
437
551
|
*/
|
|
438
552
|
getDeploymentOptions(pluginId: number, versionId: number): Promise<AdminDeploymentOption[]>;
|
|
439
553
|
/**
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
* @param
|
|
443
|
-
* @param
|
|
444
|
-
* @
|
|
554
|
+
* Creates a new deployment option for a plugin version
|
|
555
|
+
*
|
|
556
|
+
* @param pluginId - Plugin ID
|
|
557
|
+
* @param versionId - Version ID
|
|
558
|
+
* @param data - Deployment option configuration data
|
|
559
|
+
* @returns Promise resolving to the created deployment option
|
|
445
560
|
*/
|
|
446
561
|
createDeploymentOption(pluginId: number, versionId: number, data: {
|
|
447
|
-
installationMethod: string;
|
|
448
|
-
installationDetails: Record<string, any>;
|
|
449
|
-
connectionType: string;
|
|
450
|
-
connectionCommand?: string;
|
|
451
562
|
connectionArgs?: string[];
|
|
452
|
-
|
|
563
|
+
connectionCommand?: string;
|
|
564
|
+
connectionType: string;
|
|
453
565
|
description?: string;
|
|
566
|
+
installationDetails?: InstallationDetails;
|
|
567
|
+
installationMethod: string;
|
|
568
|
+
isRecommended?: boolean;
|
|
454
569
|
}): Promise<AdminDeploymentOption>;
|
|
455
570
|
/**
|
|
456
|
-
*
|
|
457
|
-
*
|
|
458
|
-
* @param
|
|
459
|
-
* @param
|
|
460
|
-
* @param
|
|
461
|
-
* @
|
|
571
|
+
* Updates an existing deployment option
|
|
572
|
+
*
|
|
573
|
+
* @param pluginId - Plugin ID
|
|
574
|
+
* @param versionId - Version ID
|
|
575
|
+
* @param optionId - Deployment option ID
|
|
576
|
+
* @param data - Updated deployment option configuration
|
|
577
|
+
* @returns Promise resolving to the updated deployment option
|
|
462
578
|
*/
|
|
463
579
|
updateDeploymentOption(pluginId: number, versionId: number, optionId: number, data: {
|
|
464
|
-
installationMethod?: string;
|
|
465
|
-
installationDetails?: Record<string, any>;
|
|
466
|
-
connectionType?: string;
|
|
467
|
-
connectionCommand?: string;
|
|
468
580
|
connectionArgs?: string[];
|
|
469
|
-
|
|
581
|
+
connectionCommand?: string;
|
|
582
|
+
connectionType?: string;
|
|
470
583
|
description?: string;
|
|
584
|
+
installationDetails?: Record<string, any>;
|
|
585
|
+
installationMethod?: string;
|
|
586
|
+
isRecommended?: boolean;
|
|
471
587
|
}): Promise<AdminDeploymentOption>;
|
|
472
588
|
/**
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
* @param
|
|
476
|
-
* @param
|
|
477
|
-
* @
|
|
589
|
+
* Deletes a deployment option
|
|
590
|
+
*
|
|
591
|
+
* @param pluginId - Plugin ID
|
|
592
|
+
* @param versionId - Version ID
|
|
593
|
+
* @param optionId - Deployment option ID
|
|
594
|
+
* @returns Promise resolving to success response
|
|
478
595
|
*/
|
|
479
596
|
deleteDeploymentOption(pluginId: number, versionId: number, optionId: number): Promise<{
|
|
480
|
-
success: boolean;
|
|
481
597
|
message: string;
|
|
598
|
+
success: boolean;
|
|
482
599
|
}>;
|
|
483
600
|
/**
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
* @param
|
|
487
|
-
* @param
|
|
488
|
-
* @
|
|
601
|
+
* Retrieves system dependencies for a deployment option
|
|
602
|
+
*
|
|
603
|
+
* @param pluginId - Plugin ID
|
|
604
|
+
* @param versionId - Version ID
|
|
605
|
+
* @param optionId - Deployment option ID
|
|
606
|
+
* @returns Promise resolving to an array of system dependencies
|
|
489
607
|
*/
|
|
490
608
|
getDeploymentOptionSystemDependencies(pluginId: number, versionId: number, optionId: number): Promise<SystemDependency[]>;
|
|
491
609
|
}
|
|
492
610
|
|
|
493
611
|
/**
|
|
494
|
-
*
|
|
612
|
+
* System Dependency Management Service
|
|
613
|
+
*
|
|
614
|
+
* Provides administrative functionality for managing system dependencies
|
|
615
|
+
* required by plugins. This service handles creating, updating, deleting,
|
|
616
|
+
* and listing system dependencies that plugins may require.
|
|
495
617
|
*/
|
|
496
618
|
declare class SystemDependencyService extends BaseSDK {
|
|
497
619
|
/**
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
* @param
|
|
620
|
+
* Creates a new SystemDependencyService instance
|
|
621
|
+
*
|
|
622
|
+
* @param options - Configuration options for the SDK
|
|
623
|
+
* @param sharedHeaders - Optional shared headers object for reuse across services
|
|
501
624
|
*/
|
|
502
625
|
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
503
626
|
/**
|
|
504
|
-
*
|
|
505
|
-
*
|
|
627
|
+
* Retrieves all system dependencies
|
|
628
|
+
*
|
|
629
|
+
* Gets a list of all defined system dependencies that plugins may require.
|
|
630
|
+
*
|
|
631
|
+
* @returns Promise resolving to an array of system dependencies
|
|
506
632
|
*/
|
|
507
633
|
getSystemDependencies(): Promise<SystemDependency[]>;
|
|
508
634
|
/**
|
|
509
|
-
*
|
|
510
|
-
*
|
|
511
|
-
* @
|
|
635
|
+
* Retrieves a specific system dependency by ID
|
|
636
|
+
*
|
|
637
|
+
* @param id - System dependency ID
|
|
638
|
+
* @returns Promise resolving to the system dependency details
|
|
512
639
|
*/
|
|
513
640
|
getSystemDependency(id: number): Promise<SystemDependency>;
|
|
514
641
|
/**
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
* @
|
|
642
|
+
* Creates a new system dependency
|
|
643
|
+
*
|
|
644
|
+
* @param data - System dependency creation data
|
|
645
|
+
* @returns Promise resolving to the created system dependency
|
|
518
646
|
*/
|
|
519
647
|
createSystemDependency(data: Omit<SystemDependency, 'id'>): Promise<SystemDependency>;
|
|
520
648
|
/**
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
* @param
|
|
524
|
-
* @
|
|
649
|
+
* Updates an existing system dependency
|
|
650
|
+
*
|
|
651
|
+
* @param id - System dependency ID
|
|
652
|
+
* @param data - System dependency update data
|
|
653
|
+
* @returns Promise resolving to the updated system dependency
|
|
525
654
|
*/
|
|
526
655
|
updateSystemDependency(id: number, data: Partial<SystemDependency>): Promise<SystemDependency>;
|
|
527
656
|
/**
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
* @
|
|
657
|
+
* Deletes a system dependency
|
|
658
|
+
*
|
|
659
|
+
* @param id - System dependency ID
|
|
660
|
+
* @returns Promise resolving to success response
|
|
531
661
|
*/
|
|
532
662
|
deleteSystemDependency(id: number): Promise<{
|
|
533
|
-
success: boolean;
|
|
534
663
|
message: string;
|
|
664
|
+
success: boolean;
|
|
535
665
|
}>;
|
|
536
666
|
}
|
|
537
667
|
|
|
668
|
+
/**
|
|
669
|
+
* Settings entity representing a system setting
|
|
670
|
+
*/
|
|
538
671
|
interface Settings {
|
|
672
|
+
/** Creation timestamp (ISO 8601 format) */
|
|
673
|
+
createdAt: string;
|
|
674
|
+
/** Optional description of the setting's purpose */
|
|
675
|
+
description?: string;
|
|
676
|
+
/** Unique identifier for the setting */
|
|
539
677
|
id: number;
|
|
678
|
+
/** Setting key name used for retrieving the setting */
|
|
540
679
|
key: string;
|
|
541
|
-
|
|
542
|
-
description?: string;
|
|
543
|
-
createdAt: string;
|
|
680
|
+
/** Last update timestamp (ISO 8601 format) */
|
|
544
681
|
updatedAt: string;
|
|
682
|
+
/** Setting value (stored as string) */
|
|
683
|
+
value: string;
|
|
545
684
|
}
|
|
685
|
+
/**
|
|
686
|
+
* Configuration for enabled resource types
|
|
687
|
+
*/
|
|
546
688
|
interface EnabledResources {
|
|
547
|
-
|
|
689
|
+
/** Whether agent resources are enabled */
|
|
548
690
|
agents: boolean;
|
|
691
|
+
/** Whether plugin resources are enabled */
|
|
692
|
+
plugins: boolean;
|
|
549
693
|
}
|
|
694
|
+
/**
|
|
695
|
+
* Authentication configuration
|
|
696
|
+
*/
|
|
550
697
|
interface AuthenticationConfig {
|
|
698
|
+
/** Whether authentication is required */
|
|
551
699
|
enabled: boolean;
|
|
700
|
+
/** Supported authentication schemes */
|
|
552
701
|
schemes: string[];
|
|
553
702
|
}
|
|
703
|
+
/**
|
|
704
|
+
* Documentation URL configuration
|
|
705
|
+
*/
|
|
554
706
|
interface DocumentationConfig {
|
|
707
|
+
/** URL to API documentation */
|
|
555
708
|
apiUrl?: string;
|
|
709
|
+
/** URL to privacy policy */
|
|
556
710
|
policyUrl?: string;
|
|
711
|
+
/** URL to terms of service */
|
|
557
712
|
termsOfServiceUrl?: string;
|
|
558
713
|
}
|
|
714
|
+
/**
|
|
715
|
+
* Map of all system settings with typed properties
|
|
716
|
+
*/
|
|
559
717
|
interface SettingsMap {
|
|
560
|
-
|
|
561
|
-
|
|
718
|
+
/** Additional settings (dynamically added) */
|
|
719
|
+
[key: string]: any;
|
|
720
|
+
/** Authentication configuration */
|
|
562
721
|
authentication: AuthenticationConfig;
|
|
722
|
+
/** Base URL for the marketplace */
|
|
723
|
+
baseURL: string;
|
|
724
|
+
/** Documentation URL configuration */
|
|
563
725
|
documentation: DocumentationConfig;
|
|
726
|
+
/** Configuration for enabled resource types */
|
|
727
|
+
enabledResources: EnabledResources;
|
|
728
|
+
/** Supported locales */
|
|
564
729
|
locales: string[];
|
|
565
|
-
[key: string]: any;
|
|
566
730
|
}
|
|
731
|
+
/**
|
|
732
|
+
* Parameters for creating a new setting
|
|
733
|
+
*/
|
|
567
734
|
interface CreateSettingsParams {
|
|
735
|
+
/** Optional description of the setting's purpose */
|
|
736
|
+
description?: string;
|
|
737
|
+
/** Setting key name */
|
|
568
738
|
key: string;
|
|
739
|
+
/** Setting value (will be stored as string) */
|
|
569
740
|
value: string;
|
|
570
|
-
description?: string;
|
|
571
741
|
}
|
|
742
|
+
/**
|
|
743
|
+
* Parameters for updating an existing setting
|
|
744
|
+
*/
|
|
572
745
|
interface UpdateSettingsParams {
|
|
573
|
-
|
|
746
|
+
/** Optional new description */
|
|
574
747
|
description?: string;
|
|
748
|
+
/** New setting value */
|
|
749
|
+
value: string;
|
|
575
750
|
}
|
|
576
751
|
/**
|
|
577
|
-
*
|
|
578
|
-
*
|
|
752
|
+
* Settings Management Service
|
|
753
|
+
*
|
|
754
|
+
* Provides administrative functionality for managing system settings.
|
|
755
|
+
* This service handles getting, creating, updating, and deleting
|
|
756
|
+
* configuration settings for the marketplace.
|
|
579
757
|
*/
|
|
580
758
|
declare class SettingsService extends BaseSDK {
|
|
581
759
|
/**
|
|
582
|
-
*
|
|
583
|
-
*
|
|
584
|
-
*
|
|
760
|
+
* Retrieves all system settings
|
|
761
|
+
*
|
|
762
|
+
* Returns a consolidated map of all settings with typed values
|
|
763
|
+
* for known setting keys.
|
|
764
|
+
*
|
|
765
|
+
* @returns Promise resolving to the settings map
|
|
585
766
|
*/
|
|
586
767
|
getSettings(): Promise<SettingsMap>;
|
|
587
768
|
/**
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
* @
|
|
769
|
+
* Retrieves a specific setting by key
|
|
770
|
+
*
|
|
771
|
+
* @param key - Setting key name
|
|
772
|
+
* @returns Promise resolving to the setting details
|
|
591
773
|
*/
|
|
592
774
|
getSettingByKey(key: string): Promise<{
|
|
593
775
|
data: Settings;
|
|
594
776
|
}>;
|
|
595
777
|
/**
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
* @
|
|
778
|
+
* Creates a new system setting
|
|
779
|
+
*
|
|
780
|
+
* @param data - Setting creation parameters
|
|
781
|
+
* @returns Promise resolving to the created setting
|
|
599
782
|
*/
|
|
600
783
|
createSetting(data: CreateSettingsParams): Promise<{
|
|
601
784
|
data: Settings;
|
|
602
785
|
}>;
|
|
603
786
|
/**
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
* @param
|
|
607
|
-
* @
|
|
787
|
+
* Updates an existing setting
|
|
788
|
+
*
|
|
789
|
+
* @param key - Setting key name
|
|
790
|
+
* @param data - Setting update parameters
|
|
791
|
+
* @returns Promise resolving to the updated setting
|
|
608
792
|
*/
|
|
609
793
|
updateSetting(key: string, data: UpdateSettingsParams): Promise<{
|
|
610
794
|
data: Settings;
|
|
611
795
|
}>;
|
|
612
796
|
/**
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
* @
|
|
797
|
+
* Deletes a setting
|
|
798
|
+
*
|
|
799
|
+
* @param key - Setting key name
|
|
800
|
+
* @returns Promise resolving to success message
|
|
616
801
|
*/
|
|
617
802
|
deleteSetting(key: string): Promise<{
|
|
618
803
|
message: string;
|
|
619
804
|
}>;
|
|
620
805
|
}
|
|
621
806
|
|
|
807
|
+
/**
|
|
808
|
+
* Review entity representing a plugin review
|
|
809
|
+
*/
|
|
622
810
|
interface Review {
|
|
811
|
+
/** Optional comment providing feedback */
|
|
812
|
+
comment?: string;
|
|
813
|
+
/** Creation timestamp (ISO 8601 format) */
|
|
814
|
+
createdAt: string;
|
|
815
|
+
/** Unique identifier for the review */
|
|
623
816
|
id: number;
|
|
817
|
+
/** ID of the plugin being reviewed */
|
|
624
818
|
pluginId: number;
|
|
625
|
-
|
|
626
|
-
comment?: string;
|
|
819
|
+
/** ID of the reviewer (if available) */
|
|
627
820
|
reviewerId?: number;
|
|
628
|
-
|
|
821
|
+
/** Current status of the review */
|
|
822
|
+
status: ReviewStatus;
|
|
823
|
+
/** Last update timestamp (ISO 8601 format) */
|
|
629
824
|
updatedAt: string;
|
|
630
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* Extended review information with related entities
|
|
828
|
+
*/
|
|
631
829
|
interface PluginReviewWithRelations extends Review {
|
|
830
|
+
/** Related plugin information */
|
|
632
831
|
plugin?: any;
|
|
832
|
+
/** Related version information */
|
|
633
833
|
version?: any;
|
|
634
834
|
}
|
|
835
|
+
/**
|
|
836
|
+
* Parameters for updating a review
|
|
837
|
+
*/
|
|
635
838
|
interface UpdateReviewParams {
|
|
636
|
-
|
|
839
|
+
/** Optional comment or feedback */
|
|
637
840
|
comment?: string;
|
|
841
|
+
/** New status to set for the review */
|
|
842
|
+
status: ReviewStatus;
|
|
638
843
|
}
|
|
639
844
|
/**
|
|
640
|
-
*
|
|
641
|
-
*
|
|
845
|
+
* Review Management Service
|
|
846
|
+
*
|
|
847
|
+
* Provides administrative functionality for managing plugin reviews.
|
|
848
|
+
* This service handles listing, fetching, and updating review statuses
|
|
849
|
+
* for plugins in the marketplace.
|
|
642
850
|
*/
|
|
643
851
|
declare class ReviewService extends BaseSDK {
|
|
644
852
|
/**
|
|
645
|
-
*
|
|
646
|
-
*
|
|
647
|
-
* @param
|
|
853
|
+
* Creates a new ReviewService instance
|
|
854
|
+
*
|
|
855
|
+
* @param options - Configuration options for the SDK
|
|
856
|
+
* @param sharedHeaders - Optional shared headers object for reuse across services
|
|
648
857
|
*/
|
|
649
858
|
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
650
859
|
/**
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
* @
|
|
860
|
+
* Retrieves a list of reviews with filtering options
|
|
861
|
+
*
|
|
862
|
+
* @param params - Query parameters for filtering and pagination
|
|
863
|
+
* @returns Promise resolving to the review list response
|
|
654
864
|
*/
|
|
655
865
|
getReviews(params?: AdminListQueryParams): Promise<AdminListResponse<PluginReviewWithRelations>>;
|
|
656
866
|
/**
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
* @
|
|
867
|
+
* Retrieves a specific review by ID
|
|
868
|
+
*
|
|
869
|
+
* @param id - Review ID
|
|
870
|
+
* @returns Promise resolving to the review details
|
|
660
871
|
*/
|
|
661
872
|
getReviewById(id: number): Promise<Review>;
|
|
662
873
|
/**
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
* @param
|
|
666
|
-
* @
|
|
874
|
+
* Updates a review's status and comment
|
|
875
|
+
*
|
|
876
|
+
* @param id - Review ID
|
|
877
|
+
* @param data - Update parameters containing new status and optional comment
|
|
878
|
+
* @returns Promise resolving to the updated review
|
|
667
879
|
*/
|
|
668
880
|
updateReview(id: number, data: UpdateReviewParams): Promise<Review>;
|
|
669
881
|
/**
|
|
670
|
-
*
|
|
671
|
-
*
|
|
672
|
-
* @
|
|
882
|
+
* Retrieves the review history for a specific plugin
|
|
883
|
+
*
|
|
884
|
+
* @param pluginId - Plugin ID
|
|
885
|
+
* @returns Promise resolving to an array of reviews for the plugin
|
|
673
886
|
*/
|
|
674
887
|
getPluginReviews(pluginId: number): Promise<{
|
|
675
888
|
data: Review[];
|
|
@@ -677,31 +890,122 @@ declare class ReviewService extends BaseSDK {
|
|
|
677
890
|
}
|
|
678
891
|
|
|
679
892
|
/**
|
|
680
|
-
* LobeHub
|
|
681
|
-
*
|
|
893
|
+
* LobeHub Market Admin SDK Client
|
|
894
|
+
*
|
|
895
|
+
* Client for accessing administrative functionality of the LobeHub Marketplace.
|
|
896
|
+
* This SDK provides privileged operations for managing plugins, reviews,
|
|
897
|
+
* system settings, and dependencies. It requires admin-level authentication.
|
|
682
898
|
*/
|
|
683
899
|
declare class MarketAdmin extends BaseSDK {
|
|
684
900
|
/**
|
|
685
|
-
*
|
|
901
|
+
* Plugin management service
|
|
902
|
+
* Provides methods for creating, updating, and managing plugins
|
|
686
903
|
*/
|
|
687
904
|
readonly plugins: PluginService;
|
|
688
905
|
/**
|
|
689
|
-
*
|
|
906
|
+
* Review management service
|
|
907
|
+
* Provides methods for moderating and managing user reviews
|
|
690
908
|
*/
|
|
691
909
|
readonly reviews: ReviewService;
|
|
692
910
|
/**
|
|
693
|
-
*
|
|
911
|
+
* System settings management service
|
|
912
|
+
* Provides methods for configuring marketplace settings
|
|
694
913
|
*/
|
|
695
914
|
readonly settings: SettingsService;
|
|
696
915
|
/**
|
|
697
|
-
*
|
|
916
|
+
* System dependency management service
|
|
917
|
+
* Provides methods for managing system dependencies required by plugins
|
|
698
918
|
*/
|
|
699
919
|
readonly dependencies: SystemDependencyService;
|
|
700
920
|
/**
|
|
701
|
-
*
|
|
702
|
-
*
|
|
921
|
+
* Creates a new MarketAdmin instance
|
|
922
|
+
*
|
|
923
|
+
* @param options - Configuration options for the SDK
|
|
924
|
+
*/
|
|
925
|
+
constructor(options?: MarketSDKOptions);
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Plugins Service
|
|
930
|
+
*
|
|
931
|
+
* Provides access to plugin-related functionality in the LobeHub Marketplace.
|
|
932
|
+
* This service handles listing, searching, and retrieving detailed information
|
|
933
|
+
* about plugins available in the marketplace.
|
|
934
|
+
*/
|
|
935
|
+
declare class PluginsService extends BaseSDK {
|
|
936
|
+
/**
|
|
937
|
+
* Creates a new PluginsService instance
|
|
938
|
+
*
|
|
939
|
+
* @param options - Configuration options for the SDK
|
|
940
|
+
* @param sharedHeaders - Optional shared headers object for reuse across services
|
|
941
|
+
*/
|
|
942
|
+
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
943
|
+
/**
|
|
944
|
+
* Retrieves a list of plugins from the marketplace
|
|
945
|
+
*
|
|
946
|
+
* Supports filtering, pagination, and localization of results.
|
|
947
|
+
*
|
|
948
|
+
* @param params - Query parameters for filtering and pagination
|
|
949
|
+
* @returns Promise resolving to the plugin list response containing items and pagination info
|
|
950
|
+
*/
|
|
951
|
+
getPluginList(params?: PluginQueryParams): Promise<PluginListResponse>;
|
|
952
|
+
/**
|
|
953
|
+
* Retrieves all plugin categories and their counts
|
|
954
|
+
*
|
|
955
|
+
* Returns a list of categories along with the number of plugins in each category.
|
|
956
|
+
* Useful for building category filters in a UI.
|
|
957
|
+
*
|
|
958
|
+
* @returns Promise resolving to an array of category items with counts
|
|
959
|
+
*/
|
|
960
|
+
getCategories(): Promise<CategoryItem[]>;
|
|
961
|
+
/**
|
|
962
|
+
* Retrieves the manifest for a specific plugin
|
|
963
|
+
*
|
|
964
|
+
* The manifest contains detailed information about a plugin, including
|
|
965
|
+
* its capabilities, tools, prompts, and resources.
|
|
966
|
+
*
|
|
967
|
+
* @param identifier - Unique identifier of the plugin
|
|
968
|
+
* @param locale - Optional locale for localized content (defaults to SDK default locale)
|
|
969
|
+
* @param version - Optional specific version to retrieve (defaults to latest)
|
|
970
|
+
* @returns Promise resolving to the plugin manifest
|
|
971
|
+
*/
|
|
972
|
+
getPluginManifest(identifier: string, locale?: string, version?: string): Promise<PluginManifest>;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* LobeHub Market SDK Client
|
|
977
|
+
*
|
|
978
|
+
* Main client for accessing the LobeHub Marketplace API.
|
|
979
|
+
* This class provides access to marketplace resources like plugins, agents,
|
|
980
|
+
* and service discovery information. It follows a composition pattern
|
|
981
|
+
* by combining specialized domain services.
|
|
982
|
+
*/
|
|
983
|
+
declare class MarketSDK extends BaseSDK {
|
|
984
|
+
/**
|
|
985
|
+
* Plugins service for accessing plugin-related functionality
|
|
986
|
+
* Provides methods to list, search, and retrieve plugin information
|
|
987
|
+
*/
|
|
988
|
+
readonly plugins: PluginsService;
|
|
989
|
+
/**
|
|
990
|
+
* Discovery service for retrieving API service information
|
|
991
|
+
* Used to get information about available endpoints and services
|
|
992
|
+
*/
|
|
993
|
+
private readonly discovery;
|
|
994
|
+
/**
|
|
995
|
+
* Creates a new MarketSDK instance
|
|
996
|
+
*
|
|
997
|
+
* @param options - Configuration options for the SDK
|
|
703
998
|
*/
|
|
704
999
|
constructor(options?: MarketSDKOptions);
|
|
1000
|
+
/**
|
|
1001
|
+
* Retrieves the service discovery document
|
|
1002
|
+
*
|
|
1003
|
+
* The discovery document provides information about available API endpoints,
|
|
1004
|
+
* versions, and capabilities of the Market API.
|
|
1005
|
+
*
|
|
1006
|
+
* @returns Promise resolving to the service discovery document
|
|
1007
|
+
*/
|
|
1008
|
+
getDiscoveryDocument(): Promise<DiscoveryDocument>;
|
|
705
1009
|
}
|
|
706
1010
|
|
|
707
|
-
export { type AdminListQueryParams, type AdminListResponse, type AdminPluginParams, type DiscoveryDocument, MarketAdmin, MarketSDK, type MarketSDKOptions, type PluginItem, type PluginListResponse, type PluginQueryParams, type PluginUpdateParams, type
|
|
1011
|
+
export { type AdminListQueryParams, type AdminListResponse, type AdminPluginParams, type CategoryItem, type DiscoveryDocument, MarketAdmin, MarketSDK, type MarketSDKOptions, type PluginItem, type PluginListResponse, type PluginQueryParams, type PluginUpdateParams, type PluginVersionCreateParams, type PluginVersionUpdateParams, type ReviewStatus, ReviewStatusEnumSchema, StatusEnumSchema, VisibilityEnumSchema };
|