@lobehub/market-sdk 0.0.28 → 0.0.30
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 +690 -366
- package/dist/index.mjs +467 -380
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -29
package/dist/index.d.mts
CHANGED
|
@@ -1,655 +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
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Review status options
|
|
54
|
+
* - pending: Awaiting review
|
|
55
|
+
* - approved: Review approved
|
|
56
|
+
* - rejected: Review rejected
|
|
57
|
+
*/
|
|
106
58
|
type ReviewStatus = 'pending' | 'approved' | 'rejected';
|
|
59
|
+
/**
|
|
60
|
+
* Review status schema for validation
|
|
61
|
+
*/
|
|
107
62
|
declare const ReviewStatusEnumSchema: z.ZodEnum<["published", "draft", "review", "rejected"]>;
|
|
108
63
|
/**
|
|
109
|
-
*
|
|
64
|
+
* Parameters for admin plugin listing
|
|
65
|
+
* Extends the common query parameters with plugin-specific filters.
|
|
110
66
|
*/
|
|
111
67
|
interface AdminPluginParams {
|
|
112
|
-
|
|
113
|
-
visibility?: 'public' | 'private' | 'unlisted';
|
|
68
|
+
/** Filter for featured plugins */
|
|
114
69
|
featured?: boolean;
|
|
115
|
-
|
|
70
|
+
/** Maximum number of items to return */
|
|
116
71
|
limit?: number;
|
|
72
|
+
/** Number of items to skip */
|
|
117
73
|
offset?: number;
|
|
118
|
-
|
|
119
|
-
orderBy?: 'createdAt' | 'updatedAt' | 'installCount' | 'ratingAverage';
|
|
74
|
+
/** Sort direction */
|
|
120
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';
|
|
121
86
|
}
|
|
122
87
|
/**
|
|
123
|
-
*
|
|
88
|
+
* Parameters for creating a new plugin version
|
|
124
89
|
*/
|
|
125
90
|
interface PluginVersionCreateParams {
|
|
126
|
-
version
|
|
127
|
-
manifest: PluginManifest;
|
|
128
|
-
manifestUrl?: string;
|
|
91
|
+
/** Whether this is the latest version */
|
|
129
92
|
isLatest?: boolean;
|
|
93
|
+
/** Whether this version has been validated */
|
|
130
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 */
|
|
131
100
|
meta?: Record<string, any>;
|
|
101
|
+
/** Semantic version string (e.g., "1.0.0") */
|
|
102
|
+
version: string;
|
|
132
103
|
}
|
|
133
104
|
/**
|
|
134
|
-
*
|
|
105
|
+
* Parameters for updating an existing plugin version
|
|
135
106
|
*/
|
|
136
107
|
interface PluginVersionUpdateParams {
|
|
137
|
-
|
|
108
|
+
/** Whether this version has been validated */
|
|
138
109
|
isValidated?: boolean;
|
|
110
|
+
/** URL to the manifest file */
|
|
111
|
+
manifestUrl?: string;
|
|
112
|
+
/** Additional metadata for the version */
|
|
139
113
|
meta?: Record<string, any>;
|
|
140
114
|
}
|
|
141
115
|
/**
|
|
142
|
-
*
|
|
116
|
+
* Parameters for updating a plugin
|
|
143
117
|
*/
|
|
144
118
|
interface PluginUpdateParams {
|
|
119
|
+
/** Unique identifier for the plugin */
|
|
145
120
|
identifier?: string;
|
|
146
|
-
|
|
147
|
-
status?: 'published' | 'draft' | 'review' | 'rejected';
|
|
121
|
+
/** Whether this plugin is featured */
|
|
148
122
|
isFeatured?: boolean;
|
|
149
|
-
|
|
123
|
+
/** Additional metadata for the plugin */
|
|
150
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';
|
|
151
131
|
}
|
|
152
132
|
|
|
153
133
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
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;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
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
|
|
156
309
|
*/
|
|
157
310
|
declare class BaseSDK {
|
|
311
|
+
/** Base API URL */
|
|
158
312
|
protected baseUrl: string;
|
|
313
|
+
/** Default locale for requests that require localization */
|
|
159
314
|
protected defaultLocale: string;
|
|
315
|
+
/** HTTP headers to include with all requests */
|
|
160
316
|
protected headers: Record<string, string>;
|
|
161
317
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* @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
|
|
165
322
|
*/
|
|
166
323
|
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
167
324
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* @param
|
|
171
|
-
* @
|
|
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
|
|
172
331
|
*/
|
|
173
332
|
protected request<T>(url: string, options?: RequestInit): Promise<T>;
|
|
174
333
|
/**
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* @
|
|
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)
|
|
178
338
|
*/
|
|
179
339
|
protected buildQueryString(params: Record<string, any>): string;
|
|
180
340
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
341
|
+
* Sets an authentication token for API requests
|
|
342
|
+
*
|
|
343
|
+
* @param token - API authentication token
|
|
183
344
|
*/
|
|
184
345
|
setAuthToken(token: string): void;
|
|
185
346
|
/**
|
|
186
|
-
*
|
|
347
|
+
* Clears the authentication token
|
|
187
348
|
*/
|
|
188
349
|
clearAuthToken(): void;
|
|
189
350
|
}
|
|
190
351
|
|
|
191
352
|
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* 创建插件服务实例
|
|
198
|
-
* @param options SDK 配置选项
|
|
199
|
-
* @param sharedHeaders 共享的 headers 对象(可选)
|
|
200
|
-
*/
|
|
201
|
-
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
202
|
-
/**
|
|
203
|
-
* 获取插件列表
|
|
204
|
-
* @param params 查询参数
|
|
205
|
-
* @returns 插件列表响应
|
|
206
|
-
*/
|
|
207
|
-
getPluginList(params?: PluginQueryParams): Promise<PluginListResponse>;
|
|
208
|
-
/**
|
|
209
|
-
* 获取插件清单
|
|
210
|
-
* @param identifier 插件标识符
|
|
211
|
-
* @param locale 语言
|
|
212
|
-
* @param version 版本
|
|
213
|
-
* @returns 插件清单
|
|
214
|
-
*/
|
|
215
|
-
getPluginManifest(identifier: string, locale?: string, version?: string): Promise<PluginManifest>;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* LobeHub Market SDK Client
|
|
220
|
-
* 采用组合模式组合各个领域服务
|
|
221
|
-
*/
|
|
222
|
-
declare class MarketSDK extends BaseSDK {
|
|
223
|
-
/**
|
|
224
|
-
* 插件服务
|
|
225
|
-
*/
|
|
226
|
-
readonly plugins: PluginsService;
|
|
227
|
-
/**
|
|
228
|
-
* 发现服务
|
|
229
|
-
*/
|
|
230
|
-
private readonly discovery;
|
|
231
|
-
/**
|
|
232
|
-
* Create MarketSDK instance
|
|
233
|
-
* @param options SDK configuration options
|
|
234
|
-
*/
|
|
235
|
-
constructor(options?: MarketSDKOptions);
|
|
236
|
-
/**
|
|
237
|
-
* Get market service discovery document
|
|
238
|
-
* @returns Service discovery document
|
|
239
|
-
*/
|
|
240
|
-
getDiscoveryDocument(): Promise<DiscoveryDocument>;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* 插件管理服务
|
|
245
|
-
* 处理插件相关的管理功能
|
|
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.
|
|
246
357
|
*/
|
|
247
358
|
declare class PluginService extends BaseSDK {
|
|
248
359
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
* @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
|
|
252
364
|
*/
|
|
253
365
|
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
254
366
|
/**
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
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
|
|
259
374
|
*/
|
|
260
375
|
importManifests(manifests: PluginManifest[], ownerId?: number): Promise<{
|
|
261
|
-
success: number;
|
|
262
376
|
failed: number;
|
|
377
|
+
success: number;
|
|
263
378
|
}>;
|
|
264
379
|
/**
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
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
|
|
268
386
|
*/
|
|
269
387
|
getPlugins(params?: AdminListQueryParams): Promise<AdminListResponse<AdminPluginItem>>;
|
|
270
388
|
/**
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
* @
|
|
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
|
|
274
393
|
*/
|
|
275
394
|
getPlugin(id: number | string): Promise<AdminPluginItemDetail>;
|
|
276
395
|
/**
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* @param
|
|
280
|
-
* @
|
|
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
|
|
281
401
|
*/
|
|
282
402
|
updatePlugin(id: number, data: PluginUpdateParams): Promise<AdminPluginItem>;
|
|
283
403
|
/**
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
* @param
|
|
287
|
-
* @
|
|
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
|
|
288
409
|
*/
|
|
289
410
|
updatePluginStatus(id: number, status: 'published' | 'draft' | 'review' | 'rejected'): Promise<{
|
|
290
|
-
success: boolean;
|
|
291
411
|
message: string;
|
|
412
|
+
success: boolean;
|
|
292
413
|
}>;
|
|
293
414
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
* @
|
|
415
|
+
* Deletes a plugin
|
|
416
|
+
*
|
|
417
|
+
* @param id - Plugin ID
|
|
418
|
+
* @returns Promise resolving to success response
|
|
297
419
|
*/
|
|
298
420
|
deletePlugin(id: number): Promise<{
|
|
299
|
-
success: boolean;
|
|
300
421
|
message: string;
|
|
422
|
+
success: boolean;
|
|
301
423
|
}>;
|
|
302
424
|
/**
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
* @
|
|
425
|
+
* Retrieves the version history for a plugin
|
|
426
|
+
*
|
|
427
|
+
* @param pluginId - Plugin ID
|
|
428
|
+
* @returns Promise resolving to an array of plugin versions
|
|
306
429
|
*/
|
|
307
430
|
getPluginVersions(pluginId: number): Promise<PluginVersion[]>;
|
|
308
431
|
/**
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
* @param
|
|
312
|
-
* @
|
|
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
|
|
313
437
|
*/
|
|
314
438
|
getPluginVersion(pluginId: number, versionId: number): Promise<PluginVersion>;
|
|
315
439
|
/**
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
* @param
|
|
319
|
-
* @
|
|
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
|
|
320
445
|
*/
|
|
321
446
|
createPluginVersion(pluginId: number, data: PluginVersionCreateParams): Promise<PluginVersion>;
|
|
322
447
|
/**
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
* @param
|
|
326
|
-
* @param
|
|
327
|
-
* @
|
|
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
|
|
328
454
|
*/
|
|
329
455
|
updatePluginVersion(pluginId: number, versionId: number, data: PluginVersionUpdateParams): Promise<PluginVersion>;
|
|
330
456
|
/**
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
* @param
|
|
334
|
-
* @
|
|
457
|
+
* Deletes a plugin version
|
|
458
|
+
*
|
|
459
|
+
* @param pluginId - Plugin ID
|
|
460
|
+
* @param versionId - Version ID
|
|
461
|
+
* @returns Promise resolving to success response
|
|
335
462
|
*/
|
|
336
463
|
deletePluginVersion(pluginId: number, versionId: number): Promise<{
|
|
337
|
-
success: boolean;
|
|
338
464
|
message: string;
|
|
465
|
+
success: boolean;
|
|
339
466
|
}>;
|
|
340
467
|
/**
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
* @param
|
|
344
|
-
* @
|
|
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
|
|
345
473
|
*/
|
|
346
474
|
setPluginVersionAsLatest(pluginId: number, versionId: number): Promise<{
|
|
347
|
-
success: boolean;
|
|
348
475
|
message: string;
|
|
476
|
+
success: boolean;
|
|
349
477
|
}>;
|
|
350
478
|
/**
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
* @param
|
|
354
|
-
* @
|
|
479
|
+
* Updates plugin visibility
|
|
480
|
+
*
|
|
481
|
+
* @param id - Plugin ID
|
|
482
|
+
* @param visibility - New visibility setting
|
|
483
|
+
* @returns Promise resolving to success response
|
|
355
484
|
*/
|
|
356
485
|
updatePluginVisibility(id: number, visibility: 'public' | 'private' | 'unlisted'): Promise<{
|
|
357
|
-
success: boolean;
|
|
358
486
|
message: string;
|
|
487
|
+
success: boolean;
|
|
359
488
|
}>;
|
|
360
489
|
/**
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
* @param
|
|
364
|
-
* @
|
|
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
|
|
365
495
|
*/
|
|
366
496
|
batchUpdatePluginStatus(ids: number[], status: 'published' | 'draft' | 'review' | 'rejected'): Promise<{
|
|
367
|
-
success: boolean;
|
|
368
497
|
message: string;
|
|
498
|
+
success: boolean;
|
|
369
499
|
}>;
|
|
370
500
|
/**
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
* @
|
|
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
|
|
374
505
|
*/
|
|
375
506
|
batchDeletePlugins(ids: number[]): Promise<{
|
|
376
|
-
success: boolean;
|
|
377
507
|
message: string;
|
|
508
|
+
success: boolean;
|
|
378
509
|
}>;
|
|
379
510
|
/**
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
* @param
|
|
383
|
-
* @
|
|
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
|
|
384
516
|
*/
|
|
385
517
|
getPluginVersionDetails(pluginId: number, versionId: number): Promise<PluginVersion & {
|
|
386
518
|
deploymentOptions: any;
|
|
387
519
|
}>;
|
|
388
520
|
/**
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
* @param
|
|
392
|
-
* @param
|
|
393
|
-
* @
|
|
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
|
|
394
527
|
*/
|
|
395
528
|
updatePluginVersionDetails(pluginId: number, versionId: number, data: {
|
|
396
529
|
author?: string;
|
|
397
530
|
authorUrl?: string;
|
|
398
|
-
name?: string;
|
|
399
|
-
description?: string;
|
|
400
|
-
tags?: string[];
|
|
401
|
-
icon?: string;
|
|
402
|
-
category?: string;
|
|
403
|
-
capabilitiesTools?: boolean;
|
|
404
531
|
capabilitiesPrompts?: boolean;
|
|
405
532
|
capabilitiesResources?: boolean;
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
533
|
+
capabilitiesTools?: boolean;
|
|
534
|
+
category?: string;
|
|
535
|
+
description?: string;
|
|
536
|
+
icon?: string;
|
|
409
537
|
isValidated?: boolean;
|
|
410
538
|
meta?: Record<string, any>;
|
|
539
|
+
name?: string;
|
|
540
|
+
prompts?: any;
|
|
541
|
+
resources?: any;
|
|
542
|
+
tags?: string[];
|
|
543
|
+
tools?: any;
|
|
411
544
|
}): Promise<PluginVersion>;
|
|
412
545
|
/**
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
* @param
|
|
416
|
-
* @
|
|
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
|
|
417
551
|
*/
|
|
418
552
|
getDeploymentOptions(pluginId: number, versionId: number): Promise<AdminDeploymentOption[]>;
|
|
419
553
|
/**
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
* @param
|
|
423
|
-
* @param
|
|
424
|
-
* @
|
|
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
|
|
425
560
|
*/
|
|
426
561
|
createDeploymentOption(pluginId: number, versionId: number, data: {
|
|
427
|
-
installationMethod: string;
|
|
428
|
-
installationDetails: Record<string, any>;
|
|
429
|
-
connectionType: string;
|
|
430
|
-
connectionCommand?: string;
|
|
431
562
|
connectionArgs?: string[];
|
|
432
|
-
|
|
563
|
+
connectionCommand?: string;
|
|
564
|
+
connectionType: string;
|
|
433
565
|
description?: string;
|
|
566
|
+
installationDetails?: InstallationDetails;
|
|
567
|
+
installationMethod: string;
|
|
568
|
+
isRecommended?: boolean;
|
|
434
569
|
}): Promise<AdminDeploymentOption>;
|
|
435
570
|
/**
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
* @param
|
|
439
|
-
* @param
|
|
440
|
-
* @param
|
|
441
|
-
* @
|
|
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
|
|
442
578
|
*/
|
|
443
579
|
updateDeploymentOption(pluginId: number, versionId: number, optionId: number, data: {
|
|
444
|
-
installationMethod?: string;
|
|
445
|
-
installationDetails?: Record<string, any>;
|
|
446
|
-
connectionType?: string;
|
|
447
|
-
connectionCommand?: string;
|
|
448
580
|
connectionArgs?: string[];
|
|
449
|
-
|
|
581
|
+
connectionCommand?: string;
|
|
582
|
+
connectionType?: string;
|
|
450
583
|
description?: string;
|
|
584
|
+
installationDetails?: Record<string, any>;
|
|
585
|
+
installationMethod?: string;
|
|
586
|
+
isRecommended?: boolean;
|
|
451
587
|
}): Promise<AdminDeploymentOption>;
|
|
452
588
|
/**
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
* @param
|
|
456
|
-
* @param
|
|
457
|
-
* @
|
|
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
|
|
458
595
|
*/
|
|
459
596
|
deleteDeploymentOption(pluginId: number, versionId: number, optionId: number): Promise<{
|
|
460
|
-
success: boolean;
|
|
461
597
|
message: string;
|
|
598
|
+
success: boolean;
|
|
462
599
|
}>;
|
|
463
600
|
/**
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
* @param
|
|
467
|
-
* @param
|
|
468
|
-
* @
|
|
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
|
|
469
607
|
*/
|
|
470
608
|
getDeploymentOptionSystemDependencies(pluginId: number, versionId: number, optionId: number): Promise<SystemDependency[]>;
|
|
471
609
|
}
|
|
472
610
|
|
|
473
611
|
/**
|
|
474
|
-
*
|
|
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.
|
|
475
617
|
*/
|
|
476
618
|
declare class SystemDependencyService extends BaseSDK {
|
|
477
619
|
/**
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
* @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
|
|
481
624
|
*/
|
|
482
625
|
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
483
626
|
/**
|
|
484
|
-
*
|
|
485
|
-
*
|
|
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
|
|
486
632
|
*/
|
|
487
633
|
getSystemDependencies(): Promise<SystemDependency[]>;
|
|
488
634
|
/**
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
* @
|
|
635
|
+
* Retrieves a specific system dependency by ID
|
|
636
|
+
*
|
|
637
|
+
* @param id - System dependency ID
|
|
638
|
+
* @returns Promise resolving to the system dependency details
|
|
492
639
|
*/
|
|
493
640
|
getSystemDependency(id: number): Promise<SystemDependency>;
|
|
494
641
|
/**
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
* @
|
|
642
|
+
* Creates a new system dependency
|
|
643
|
+
*
|
|
644
|
+
* @param data - System dependency creation data
|
|
645
|
+
* @returns Promise resolving to the created system dependency
|
|
498
646
|
*/
|
|
499
647
|
createSystemDependency(data: Omit<SystemDependency, 'id'>): Promise<SystemDependency>;
|
|
500
648
|
/**
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
* @param
|
|
504
|
-
* @
|
|
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
|
|
505
654
|
*/
|
|
506
655
|
updateSystemDependency(id: number, data: Partial<SystemDependency>): Promise<SystemDependency>;
|
|
507
656
|
/**
|
|
508
|
-
*
|
|
509
|
-
*
|
|
510
|
-
* @
|
|
657
|
+
* Deletes a system dependency
|
|
658
|
+
*
|
|
659
|
+
* @param id - System dependency ID
|
|
660
|
+
* @returns Promise resolving to success response
|
|
511
661
|
*/
|
|
512
662
|
deleteSystemDependency(id: number): Promise<{
|
|
513
|
-
success: boolean;
|
|
514
663
|
message: string;
|
|
664
|
+
success: boolean;
|
|
515
665
|
}>;
|
|
516
666
|
}
|
|
517
667
|
|
|
668
|
+
/**
|
|
669
|
+
* Settings entity representing a system setting
|
|
670
|
+
*/
|
|
518
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 */
|
|
519
677
|
id: number;
|
|
678
|
+
/** Setting key name used for retrieving the setting */
|
|
520
679
|
key: string;
|
|
521
|
-
|
|
522
|
-
description?: string;
|
|
523
|
-
createdAt: string;
|
|
680
|
+
/** Last update timestamp (ISO 8601 format) */
|
|
524
681
|
updatedAt: string;
|
|
682
|
+
/** Setting value (stored as string) */
|
|
683
|
+
value: string;
|
|
525
684
|
}
|
|
685
|
+
/**
|
|
686
|
+
* Configuration for enabled resource types
|
|
687
|
+
*/
|
|
526
688
|
interface EnabledResources {
|
|
527
|
-
|
|
689
|
+
/** Whether agent resources are enabled */
|
|
528
690
|
agents: boolean;
|
|
691
|
+
/** Whether plugin resources are enabled */
|
|
692
|
+
plugins: boolean;
|
|
529
693
|
}
|
|
694
|
+
/**
|
|
695
|
+
* Authentication configuration
|
|
696
|
+
*/
|
|
530
697
|
interface AuthenticationConfig {
|
|
698
|
+
/** Whether authentication is required */
|
|
531
699
|
enabled: boolean;
|
|
700
|
+
/** Supported authentication schemes */
|
|
532
701
|
schemes: string[];
|
|
533
702
|
}
|
|
703
|
+
/**
|
|
704
|
+
* Documentation URL configuration
|
|
705
|
+
*/
|
|
534
706
|
interface DocumentationConfig {
|
|
707
|
+
/** URL to API documentation */
|
|
535
708
|
apiUrl?: string;
|
|
709
|
+
/** URL to privacy policy */
|
|
536
710
|
policyUrl?: string;
|
|
711
|
+
/** URL to terms of service */
|
|
537
712
|
termsOfServiceUrl?: string;
|
|
538
713
|
}
|
|
714
|
+
/**
|
|
715
|
+
* Map of all system settings with typed properties
|
|
716
|
+
*/
|
|
539
717
|
interface SettingsMap {
|
|
540
|
-
|
|
541
|
-
|
|
718
|
+
/** Additional settings (dynamically added) */
|
|
719
|
+
[key: string]: any;
|
|
720
|
+
/** Authentication configuration */
|
|
542
721
|
authentication: AuthenticationConfig;
|
|
722
|
+
/** Base URL for the marketplace */
|
|
723
|
+
baseURL: string;
|
|
724
|
+
/** Documentation URL configuration */
|
|
543
725
|
documentation: DocumentationConfig;
|
|
726
|
+
/** Configuration for enabled resource types */
|
|
727
|
+
enabledResources: EnabledResources;
|
|
728
|
+
/** Supported locales */
|
|
544
729
|
locales: string[];
|
|
545
|
-
[key: string]: any;
|
|
546
730
|
}
|
|
731
|
+
/**
|
|
732
|
+
* Parameters for creating a new setting
|
|
733
|
+
*/
|
|
547
734
|
interface CreateSettingsParams {
|
|
735
|
+
/** Optional description of the setting's purpose */
|
|
736
|
+
description?: string;
|
|
737
|
+
/** Setting key name */
|
|
548
738
|
key: string;
|
|
739
|
+
/** Setting value (will be stored as string) */
|
|
549
740
|
value: string;
|
|
550
|
-
description?: string;
|
|
551
741
|
}
|
|
742
|
+
/**
|
|
743
|
+
* Parameters for updating an existing setting
|
|
744
|
+
*/
|
|
552
745
|
interface UpdateSettingsParams {
|
|
553
|
-
|
|
746
|
+
/** Optional new description */
|
|
554
747
|
description?: string;
|
|
748
|
+
/** New setting value */
|
|
749
|
+
value: string;
|
|
555
750
|
}
|
|
556
751
|
/**
|
|
557
|
-
*
|
|
558
|
-
*
|
|
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.
|
|
559
757
|
*/
|
|
560
758
|
declare class SettingsService extends BaseSDK {
|
|
561
759
|
/**
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
*
|
|
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
|
|
565
766
|
*/
|
|
566
767
|
getSettings(): Promise<SettingsMap>;
|
|
567
768
|
/**
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
* @
|
|
769
|
+
* Retrieves a specific setting by key
|
|
770
|
+
*
|
|
771
|
+
* @param key - Setting key name
|
|
772
|
+
* @returns Promise resolving to the setting details
|
|
571
773
|
*/
|
|
572
774
|
getSettingByKey(key: string): Promise<{
|
|
573
775
|
data: Settings;
|
|
574
776
|
}>;
|
|
575
777
|
/**
|
|
576
|
-
*
|
|
577
|
-
*
|
|
578
|
-
* @
|
|
778
|
+
* Creates a new system setting
|
|
779
|
+
*
|
|
780
|
+
* @param data - Setting creation parameters
|
|
781
|
+
* @returns Promise resolving to the created setting
|
|
579
782
|
*/
|
|
580
783
|
createSetting(data: CreateSettingsParams): Promise<{
|
|
581
784
|
data: Settings;
|
|
582
785
|
}>;
|
|
583
786
|
/**
|
|
584
|
-
*
|
|
585
|
-
*
|
|
586
|
-
* @param
|
|
587
|
-
* @
|
|
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
|
|
588
792
|
*/
|
|
589
793
|
updateSetting(key: string, data: UpdateSettingsParams): Promise<{
|
|
590
794
|
data: Settings;
|
|
591
795
|
}>;
|
|
592
796
|
/**
|
|
593
|
-
*
|
|
594
|
-
*
|
|
595
|
-
* @
|
|
797
|
+
* Deletes a setting
|
|
798
|
+
*
|
|
799
|
+
* @param key - Setting key name
|
|
800
|
+
* @returns Promise resolving to success message
|
|
596
801
|
*/
|
|
597
802
|
deleteSetting(key: string): Promise<{
|
|
598
803
|
message: string;
|
|
599
804
|
}>;
|
|
600
805
|
}
|
|
601
806
|
|
|
807
|
+
/**
|
|
808
|
+
* Review entity representing a plugin review
|
|
809
|
+
*/
|
|
602
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 */
|
|
603
816
|
id: number;
|
|
817
|
+
/** ID of the plugin being reviewed */
|
|
604
818
|
pluginId: number;
|
|
605
|
-
|
|
606
|
-
comment?: string;
|
|
819
|
+
/** ID of the reviewer (if available) */
|
|
607
820
|
reviewerId?: number;
|
|
608
|
-
|
|
821
|
+
/** Current status of the review */
|
|
822
|
+
status: ReviewStatus;
|
|
823
|
+
/** Last update timestamp (ISO 8601 format) */
|
|
609
824
|
updatedAt: string;
|
|
610
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* Extended review information with related entities
|
|
828
|
+
*/
|
|
611
829
|
interface PluginReviewWithRelations extends Review {
|
|
830
|
+
/** Related plugin information */
|
|
612
831
|
plugin?: any;
|
|
832
|
+
/** Related version information */
|
|
613
833
|
version?: any;
|
|
614
834
|
}
|
|
835
|
+
/**
|
|
836
|
+
* Parameters for updating a review
|
|
837
|
+
*/
|
|
615
838
|
interface UpdateReviewParams {
|
|
616
|
-
|
|
839
|
+
/** Optional comment or feedback */
|
|
617
840
|
comment?: string;
|
|
841
|
+
/** New status to set for the review */
|
|
842
|
+
status: ReviewStatus;
|
|
618
843
|
}
|
|
619
844
|
/**
|
|
620
|
-
*
|
|
621
|
-
*
|
|
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.
|
|
622
850
|
*/
|
|
623
851
|
declare class ReviewService extends BaseSDK {
|
|
624
852
|
/**
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
* @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
|
|
628
857
|
*/
|
|
629
858
|
constructor(options?: MarketSDKOptions, sharedHeaders?: Record<string, string>);
|
|
630
859
|
/**
|
|
631
|
-
*
|
|
632
|
-
*
|
|
633
|
-
* @
|
|
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
|
|
634
864
|
*/
|
|
635
865
|
getReviews(params?: AdminListQueryParams): Promise<AdminListResponse<PluginReviewWithRelations>>;
|
|
636
866
|
/**
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
* @
|
|
867
|
+
* Retrieves a specific review by ID
|
|
868
|
+
*
|
|
869
|
+
* @param id - Review ID
|
|
870
|
+
* @returns Promise resolving to the review details
|
|
640
871
|
*/
|
|
641
872
|
getReviewById(id: number): Promise<Review>;
|
|
642
873
|
/**
|
|
643
|
-
*
|
|
644
|
-
*
|
|
645
|
-
* @param
|
|
646
|
-
* @
|
|
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
|
|
647
879
|
*/
|
|
648
880
|
updateReview(id: number, data: UpdateReviewParams): Promise<Review>;
|
|
649
881
|
/**
|
|
650
|
-
*
|
|
651
|
-
*
|
|
652
|
-
* @
|
|
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
|
|
653
886
|
*/
|
|
654
887
|
getPluginReviews(pluginId: number): Promise<{
|
|
655
888
|
data: Review[];
|
|
@@ -657,31 +890,122 @@ declare class ReviewService extends BaseSDK {
|
|
|
657
890
|
}
|
|
658
891
|
|
|
659
892
|
/**
|
|
660
|
-
* LobeHub
|
|
661
|
-
*
|
|
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.
|
|
662
898
|
*/
|
|
663
899
|
declare class MarketAdmin extends BaseSDK {
|
|
664
900
|
/**
|
|
665
|
-
*
|
|
901
|
+
* Plugin management service
|
|
902
|
+
* Provides methods for creating, updating, and managing plugins
|
|
666
903
|
*/
|
|
667
904
|
readonly plugins: PluginService;
|
|
668
905
|
/**
|
|
669
|
-
*
|
|
906
|
+
* Review management service
|
|
907
|
+
* Provides methods for moderating and managing user reviews
|
|
670
908
|
*/
|
|
671
909
|
readonly reviews: ReviewService;
|
|
672
910
|
/**
|
|
673
|
-
*
|
|
911
|
+
* System settings management service
|
|
912
|
+
* Provides methods for configuring marketplace settings
|
|
674
913
|
*/
|
|
675
914
|
readonly settings: SettingsService;
|
|
676
915
|
/**
|
|
677
|
-
*
|
|
916
|
+
* System dependency management service
|
|
917
|
+
* Provides methods for managing system dependencies required by plugins
|
|
678
918
|
*/
|
|
679
919
|
readonly dependencies: SystemDependencyService;
|
|
680
920
|
/**
|
|
681
|
-
*
|
|
682
|
-
*
|
|
921
|
+
* Creates a new MarketAdmin instance
|
|
922
|
+
*
|
|
923
|
+
* @param options - Configuration options for the SDK
|
|
683
924
|
*/
|
|
684
925
|
constructor(options?: MarketSDKOptions);
|
|
685
926
|
}
|
|
686
927
|
|
|
687
|
-
|
|
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
|
|
998
|
+
*/
|
|
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>;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
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 };
|