@lobehub/market-sdk 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -879,6 +879,73 @@ declare class ReviewService extends BaseSDK {
879
879
  }>;
880
880
  }
881
881
 
882
+ type AdminPluginEnvListQuery = any;
883
+ type PluginEnv = any;
884
+ interface AdminPluginEnvCreateParams {
885
+ identifier: string;
886
+ key: string;
887
+ value: string;
888
+ description?: string;
889
+ }
890
+ interface AdminPluginEnvUpdateParams {
891
+ value?: string;
892
+ description?: string;
893
+ }
894
+ /**
895
+ * Plugin Environment Variable Management Service
896
+ *
897
+ * Provides administrative functionality for managing plugin environment variables.
898
+ */
899
+ declare class PluginEnvService extends BaseSDK {
900
+ /**
901
+ * Retrieves a paginated list of plugin environment variables
902
+ *
903
+ * @param params - Query parameters for filtering and pagination
904
+ * @returns Promise resolving to the env list response
905
+ */
906
+ getPluginEnvs(params?: AdminPluginEnvListQuery): Promise<AdminListResponse<PluginEnv>>;
907
+ /**
908
+ * Retrieves a single plugin environment variable by ID
909
+ *
910
+ * @param id - Env ID
911
+ * @returns Promise resolving to the env item
912
+ */
913
+ getPluginEnv(id: number): Promise<PluginEnv>;
914
+ /**
915
+ * Creates a new plugin environment variable
916
+ *
917
+ * @param data - Env creation data
918
+ * @returns Promise resolving to the created env item
919
+ */
920
+ createPluginEnv(data: AdminPluginEnvCreateParams): Promise<PluginEnv>;
921
+ /**
922
+ * Updates a plugin environment variable
923
+ *
924
+ * @param id - Env ID
925
+ * @param data - Env update data
926
+ * @returns Promise resolving to the updated env item
927
+ */
928
+ updatePluginEnv(id: number, data: AdminPluginEnvUpdateParams): Promise<PluginEnv>;
929
+ /**
930
+ * Deletes a plugin environment variable
931
+ *
932
+ * @param id - Env ID
933
+ * @returns Promise resolving to success response
934
+ */
935
+ deletePluginEnv(id: number): Promise<{
936
+ success: boolean;
937
+ }>;
938
+ /**
939
+ * Batch import plugin environment variables
940
+ *
941
+ * @param data - Batch import data, format: { [plugin: string]: { [envKey: string]: string } }
942
+ * @returns Promise resolving to import result
943
+ */
944
+ importPluginEnvs(data: Record<string, Record<string, string>>): Promise<{
945
+ success: number;
946
+ }>;
947
+ }
948
+
882
949
  /**
883
950
  * LobeHub Market Admin SDK Client
884
951
  *
@@ -892,6 +959,7 @@ declare class MarketAdmin extends BaseSDK {
892
959
  * Provides methods for creating, updating, and managing plugins
893
960
  */
894
961
  readonly plugins: PluginService;
962
+ readonly env: PluginEnvService;
895
963
  /**
896
964
  * Review management service
897
965
  * Provides methods for moderating and managing user reviews
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/admin/MarketAdmin.ts
2
- import debug6 from "debug";
2
+ import debug7 from "debug";
3
3
 
4
4
  // src/core/BaseSDK.ts
5
5
  import debug from "debug";
@@ -745,8 +745,100 @@ var ReviewService = class extends BaseSDK {
745
745
  }
746
746
  };
747
747
 
748
+ // src/admin/services/PluginEnvService.ts
749
+ import debug6 from "debug";
750
+ var log6 = debug6("lobe-market-sdk:admin:plugin-env");
751
+ var PluginEnvService = class extends BaseSDK {
752
+ /**
753
+ * Retrieves a paginated list of plugin environment variables
754
+ *
755
+ * @param params - Query parameters for filtering and pagination
756
+ * @returns Promise resolving to the env list response
757
+ */
758
+ async getPluginEnvs(params = {}) {
759
+ log6("Getting plugin envs with params: %O", params);
760
+ const queryString = this.buildQueryString(params);
761
+ const url = `/admin/plugins/env${queryString}`;
762
+ const result = await this.request(url);
763
+ log6("Retrieved %d plugin envs", result.data.length);
764
+ return result;
765
+ }
766
+ /**
767
+ * Retrieves a single plugin environment variable by ID
768
+ *
769
+ * @param id - Env ID
770
+ * @returns Promise resolving to the env item
771
+ */
772
+ async getPluginEnv(id) {
773
+ log6("Getting plugin env: %d", id);
774
+ const result = await this.request(`/admin/plugins/env/${id}`);
775
+ log6("Retrieved plugin env: %d", id);
776
+ return result;
777
+ }
778
+ /**
779
+ * Creates a new plugin environment variable
780
+ *
781
+ * @param data - Env creation data
782
+ * @returns Promise resolving to the created env item
783
+ */
784
+ async createPluginEnv(data) {
785
+ log6("Creating plugin env: %O", data);
786
+ const result = await this.request(`/admin/plugins/env`, {
787
+ body: JSON.stringify(data),
788
+ method: "POST"
789
+ });
790
+ log6("Plugin env created successfully");
791
+ return result;
792
+ }
793
+ /**
794
+ * Updates a plugin environment variable
795
+ *
796
+ * @param id - Env ID
797
+ * @param data - Env update data
798
+ * @returns Promise resolving to the updated env item
799
+ */
800
+ async updatePluginEnv(id, data) {
801
+ log6("Updating plugin env: %d, data: %O", id, data);
802
+ const result = await this.request(`/admin/plugins/env/${id}`, {
803
+ body: JSON.stringify(data),
804
+ method: "PUT"
805
+ });
806
+ log6("Plugin env updated successfully");
807
+ return result;
808
+ }
809
+ /**
810
+ * Deletes a plugin environment variable
811
+ *
812
+ * @param id - Env ID
813
+ * @returns Promise resolving to success response
814
+ */
815
+ async deletePluginEnv(id) {
816
+ log6("Deleting plugin env: %d", id);
817
+ const result = await this.request(`/admin/plugins/env/${id}`, {
818
+ method: "DELETE"
819
+ });
820
+ log6("Plugin env deleted successfully");
821
+ return result;
822
+ }
823
+ /**
824
+ * Batch import plugin environment variables
825
+ *
826
+ * @param data - Batch import data, format: { [plugin: string]: { [envKey: string]: string } }
827
+ * @returns Promise resolving to import result
828
+ */
829
+ async importPluginEnvs(data) {
830
+ log6("Batch importing plugin envs: %O", data);
831
+ const result = await this.request(`/admin/plugins/env/import`, {
832
+ body: JSON.stringify(data),
833
+ method: "POST"
834
+ });
835
+ log6("Batch import completed: %d envs imported", result.success);
836
+ return result;
837
+ }
838
+ };
839
+
748
840
  // src/admin/MarketAdmin.ts
749
- var log6 = debug6("lobe-market-sdk:admin");
841
+ var log7 = debug7("lobe-market-sdk:admin");
750
842
  var MarketAdmin = class extends BaseSDK {
751
843
  /**
752
844
  * Creates a new MarketAdmin instance
@@ -756,20 +848,21 @@ var MarketAdmin = class extends BaseSDK {
756
848
  constructor(options = {}) {
757
849
  const apiKey = options.apiKey || process.env.MARKET_ADMIN_API_KEY;
758
850
  super({ ...options, apiKey });
759
- log6("MarketAdmin instance created");
851
+ log7("MarketAdmin instance created");
760
852
  this.plugins = new PluginService(options, this.headers);
761
853
  this.reviews = new ReviewService(options, this.headers);
762
854
  this.settings = new SettingsService(options, this.headers);
763
855
  this.dependencies = new SystemDependencyService(options, this.headers);
856
+ this.env = new PluginEnvService(options, this.headers);
764
857
  }
765
858
  };
766
859
 
767
860
  // src/market/market-sdk.ts
768
- import debug9 from "debug";
861
+ import debug10 from "debug";
769
862
 
770
863
  // src/market/services/DiscoveryService.ts
771
- import debug7 from "debug";
772
- var log7 = debug7("lobe-market-sdk:discovery");
864
+ import debug8 from "debug";
865
+ var log8 = debug8("lobe-market-sdk:discovery");
773
866
  var DiscoveryService = class extends BaseSDK {
774
867
  /**
775
868
  * Creates a new DiscoveryService instance
@@ -779,7 +872,7 @@ var DiscoveryService = class extends BaseSDK {
779
872
  */
780
873
  constructor(options = {}, sharedHeaders) {
781
874
  super(options, sharedHeaders);
782
- log7("DiscoveryService instance created");
875
+ log8("DiscoveryService instance created");
783
876
  }
784
877
  /**
785
878
  * Retrieves the service discovery document
@@ -791,20 +884,20 @@ var DiscoveryService = class extends BaseSDK {
791
884
  * @returns Promise resolving to the service discovery document
792
885
  */
793
886
  async getDiscoveryDocument() {
794
- log7("Fetching discovery document");
887
+ log8("Fetching discovery document");
795
888
  if (this.discoveryDoc) {
796
- log7("Returning cached discovery document");
889
+ log8("Returning cached discovery document");
797
890
  return this.discoveryDoc;
798
891
  }
799
892
  this.discoveryDoc = await this.request("/market/.well-known/discovery");
800
- log7("Discovery document successfully fetched");
893
+ log8("Discovery document successfully fetched");
801
894
  return this.discoveryDoc;
802
895
  }
803
896
  };
804
897
 
805
898
  // src/market/services/PluginsService.ts
806
- import debug8 from "debug";
807
- var log8 = debug8("lobe-market-sdk:plugins");
899
+ import debug9 from "debug";
900
+ var log9 = debug9("lobe-market-sdk:plugins");
808
901
  var PluginsService = class extends BaseSDK {
809
902
  /**
810
903
  * Creates a new PluginsService instance
@@ -814,7 +907,7 @@ var PluginsService = class extends BaseSDK {
814
907
  */
815
908
  constructor(options = {}, sharedHeaders) {
816
909
  super(options, sharedHeaders);
817
- log8("PluginsService instance created");
910
+ log9("PluginsService instance created");
818
911
  }
819
912
  /**
820
913
  * Retrieves a list of plugins from the marketplace
@@ -828,9 +921,9 @@ var PluginsService = class extends BaseSDK {
828
921
  const locale = params.locale || this.defaultLocale;
829
922
  const queryParams = { ...params, locale };
830
923
  const queryString = this.buildQueryString(queryParams);
831
- log8("Getting plugin list: %O", queryParams);
924
+ log9("Getting plugin list: %O", queryParams);
832
925
  const result = await this.request(`/v1/plugins${queryString}`);
833
- log8("Retrieved %d plugins", result.items.length);
926
+ log9("Retrieved %d plugins", result.items.length);
834
927
  return result;
835
928
  }
836
929
  /**
@@ -842,9 +935,9 @@ var PluginsService = class extends BaseSDK {
842
935
  * @returns Promise resolving to an array of category items with counts
843
936
  */
844
937
  async getCategories() {
845
- log8("Getting plugin categories");
938
+ log9("Getting plugin categories");
846
939
  const result = await this.request("/v1/plugins/categories");
847
- log8("Retrieved %d categories", result.length);
940
+ log9("Retrieved %d categories", result.length);
848
941
  return result;
849
942
  }
850
943
  /**
@@ -857,9 +950,9 @@ var PluginsService = class extends BaseSDK {
857
950
  * @returns Promise resolving to an array containing identifiers array and last modified time
858
951
  */
859
952
  async getPublishedIdentifiers() {
860
- log8("Getting published plugin identifiers");
953
+ log9("Getting published plugin identifiers");
861
954
  const result = await this.request("/v1/plugins/identifiers");
862
- log8("Retrieved %d published plugin identifiers", result.length);
955
+ log9("Retrieved %d published plugin identifiers", result.length);
863
956
  return result;
864
957
  }
865
958
  /**
@@ -874,7 +967,7 @@ var PluginsService = class extends BaseSDK {
874
967
  * @returns Promise resolving to the plugin manifest
875
968
  */
876
969
  async getPluginManifest(identifier, locale, version) {
877
- log8("Getting plugin manifest: %O", { identifier, locale, version });
970
+ log9("Getting plugin manifest: %O", { identifier, locale, version });
878
971
  const localeParam = locale || this.defaultLocale;
879
972
  const params = { locale: localeParam };
880
973
  if (version) {
@@ -884,7 +977,7 @@ var PluginsService = class extends BaseSDK {
884
977
  const manifest = await this.request(
885
978
  `/v1/plugins/${identifier}/manifest${queryString}`
886
979
  );
887
- log8("Plugin manifest successfully retrieved: %s", identifier);
980
+ log9("Plugin manifest successfully retrieved: %s", identifier);
888
981
  return manifest;
889
982
  }
890
983
  /**
@@ -897,7 +990,7 @@ var PluginsService = class extends BaseSDK {
897
990
  * @returns Promise resolving to the plugin manifest
898
991
  */
899
992
  async getPluginDetail(identifier, locale, version) {
900
- log8("Getting plugin detail: %O", { identifier, locale, version });
993
+ log9("Getting plugin detail: %O", { identifier, locale, version });
901
994
  const localeParam = locale || this.defaultLocale;
902
995
  const params = { locale: localeParam };
903
996
  if (version) {
@@ -907,13 +1000,13 @@ var PluginsService = class extends BaseSDK {
907
1000
  const manifest = await this.request(
908
1001
  `/v1/plugins/${identifier}${queryString}`
909
1002
  );
910
- log8("Plugin manifest successfully retrieved: %s", identifier);
1003
+ log9("Plugin manifest successfully retrieved: %s", identifier);
911
1004
  return manifest;
912
1005
  }
913
1006
  };
914
1007
 
915
1008
  // src/market/market-sdk.ts
916
- var log9 = debug9("lobe-market-sdk");
1009
+ var log10 = debug10("lobe-market-sdk");
917
1010
  var MarketSDK = class extends BaseSDK {
918
1011
  /**
919
1012
  * Creates a new MarketSDK instance
@@ -922,7 +1015,7 @@ var MarketSDK = class extends BaseSDK {
922
1015
  */
923
1016
  constructor(options = {}) {
924
1017
  super(options);
925
- log9("MarketSDK instance created");
1018
+ log10("MarketSDK instance created");
926
1019
  this.plugins = new PluginsService(options, this.headers);
927
1020
  this.discovery = new DiscoveryService(options, this.headers);
928
1021
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/admin/MarketAdmin.ts","../src/core/BaseSDK.ts","../src/admin/services/PluginService.ts","../src/admin/services/SystemDependencyService.ts","../src/admin/services/SettingsService.ts","../src/admin/services/ReviewService.ts","../src/market/market-sdk.ts","../src/market/services/DiscoveryService.ts","../src/market/services/PluginsService.ts","../src/types/admin.ts","../src/index.ts"],"sourcesContent":["import debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\nimport { MarketSDKOptions } from '@/types';\n\nimport { PluginService, ReviewService, SettingsService, SystemDependencyService } from './services';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:admin');\n\n/**\n * LobeHub Market Admin SDK Client\n *\n * Client for accessing administrative functionality of the LobeHub Marketplace.\n * This SDK provides privileged operations for managing plugins, reviews,\n * system settings, and dependencies. It requires admin-level authentication.\n */\nexport class MarketAdmin extends BaseSDK {\n /**\n * Plugin management service\n * Provides methods for creating, updating, and managing plugins\n */\n readonly plugins: PluginService;\n\n /**\n * Review management service\n * Provides methods for moderating and managing user reviews\n */\n readonly reviews: ReviewService;\n\n /**\n * System settings management service\n * Provides methods for configuring marketplace settings\n */\n readonly settings: SettingsService;\n\n /**\n * System dependency management service\n * Provides methods for managing system dependencies required by plugins\n */\n readonly dependencies: SystemDependencyService;\n\n /**\n * Creates a new MarketAdmin instance\n *\n * @param options - Configuration options for the SDK\n */\n constructor(options: MarketSDKOptions = {}) {\n // Use admin-specific API key if available\n const apiKey = options.apiKey || process.env.MARKET_ADMIN_API_KEY;\n\n super({ ...options, apiKey });\n log('MarketAdmin instance created');\n\n // Initialize admin services with shared headers for efficient header reuse\n this.plugins = new PluginService(options, this.headers);\n this.reviews = new ReviewService(options, this.headers);\n this.settings = new SettingsService(options, this.headers);\n this.dependencies = new SystemDependencyService(options, this.headers);\n }\n}\n","import debug from 'debug';\n\nimport type { MarketSDKOptions } from '../types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:core');\n\n/**\n * Base SDK class\n *\n * Provides shared request handling and authentication functionality that is used\n * by both the Market SDK and Admin SDK. This class handles the common concerns:\n * - API endpoint configuration\n * - Authentication header management\n * - HTTP request handling\n * - Error handling\n * - Query string building\n */\nexport class BaseSDK {\n /** Base API URL */\n protected baseUrl: string;\n\n /** Default locale for requests that require localization */\n protected defaultLocale: string;\n\n /** HTTP headers to include with all requests */\n protected headers: Record<string, string>;\n\n /**\n * Creates a new BaseSDK instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n // Set base URL from options, environment variable, or default to production URL\n this.baseUrl =\n options.baseURL || process.env.MARKET_BASE_URL || 'https://market.lobehub.com/api';\n\n // Set default locale from options or use English as default\n this.defaultLocale = options.defaultLocale || 'en-US';\n\n // Get API key from options or environment variable\n const apiKey = options.apiKey || process.env.MARKET_API_KEY;\n\n // Either use shared headers or create new headers object\n if (sharedHeaders) {\n this.headers = sharedHeaders;\n log('Using shared headers object');\n } else {\n this.headers = {\n 'Content-Type': 'application/json',\n ...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {}),\n };\n log('Created new headers object');\n }\n\n log('BaseSDK instance created: %O', {\n baseUrl: this.baseUrl,\n defaultLocale: this.defaultLocale,\n });\n }\n\n /**\n * Sends an HTTP request to the API and handles the response\n *\n * @param url - Request URL path (will be appended to baseUrl)\n * @param options - Fetch API request options\n * @returns Promise resolving to the parsed JSON response\n * @throws Error if the request fails\n */\n // eslint-disable-next-line no-undef\n protected async request<T>(url: string, options: RequestInit = {}): Promise<T> {\n log('Sending request: %s', `${this.baseUrl}${url}`);\n\n const response = await fetch(`${this.baseUrl}${url}`, {\n ...options,\n headers: {\n ...this.headers,\n ...options.headers,\n },\n });\n\n if (!response.ok) {\n const errorMsg = `Request failed: ${response.status} ${response.statusText}`;\n log('Request error: %s', errorMsg);\n throw new Error(errorMsg);\n }\n\n log('Request successful: %s', url);\n return response.json() as Promise<T>;\n }\n\n /**\n * Builds a URL query string from a parameters object\n *\n * @param params - Object containing query parameters\n * @returns Formatted query string (including leading ? if params exist)\n */\n protected buildQueryString(params: Record<string, any>): string {\n const query = Object.entries(params)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .filter(([_, value]) => value !== undefined && value !== null)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`)\n .join('&');\n\n return query ? `?${query}` : '';\n }\n\n /**\n * Sets an authentication token for API requests\n *\n * @param token - API authentication token\n */\n setAuthToken(token: string): void {\n log('Setting authentication token');\n this.headers.Authorization = `Bearer ${token}`;\n }\n\n /**\n * Clears the authentication token\n */\n clearAuthToken(): void {\n log('Clearing authentication token');\n delete this.headers.Authorization;\n }\n}\n","import type {\n AdminDeploymentOption,\n AdminPluginItem,\n AdminPluginItemDetail,\n InstallationDetails,\n PluginManifest,\n PluginVersion,\n SystemDependency,\n} from '@lobehub/market-types';\nimport debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\nimport type {\n AdminListQueryParams,\n AdminListResponse,\n MarketSDKOptions,\n PluginUpdateParams,\n PluginVersionCreateParams,\n PluginVersionUpdateParams,\n} from '@/types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:admin:plugin');\n\n/**\n * Plugin Management Service\n *\n * Provides administrative functionality for managing plugins in the marketplace.\n * This service handles CRUD operations for plugins, plugin versions, and deployment options.\n */\nexport class PluginService extends BaseSDK {\n /**\n * Creates a new PluginService instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n super(options, sharedHeaders);\n log('PluginService instance created');\n }\n\n /**\n * Imports plugin manifests (requires admin privileges)\n *\n * Allows batch importing of plugin manifests into the marketplace.\n *\n * @param manifests - Array of plugin manifests to import\n * @param ownerId - Optional owner ID to associate with the imported plugins\n * @returns Promise resolving to the import results with counts of success and failure\n */\n async importManifests(\n manifests: PluginManifest[],\n ownerId?: number,\n ): Promise<{ failed: number; success: number }> {\n log(`Starting batch import of ${manifests.length} manifests`);\n if (ownerId) {\n log(`Using specified owner ID: ${ownerId}`);\n }\n\n const response = await this.request<{ failed: number; success: number }>(\n '/admin/plugins/import',\n {\n body: JSON.stringify({\n manifests,\n ownerId,\n }),\n method: 'POST',\n },\n );\n\n log(`Batch import completed: ${response.success} succeeded, ${response.failed} failed`);\n return response;\n }\n\n /**\n * Retrieves a list of plugins with admin details\n *\n * Supports filtering, pagination, and sorting of results.\n *\n * @param params - Query parameters for filtering and pagination\n * @returns Promise resolving to the plugin list response with admin details\n */\n async getPlugins(params: AdminListQueryParams = {}): Promise<AdminListResponse<AdminPluginItem>> {\n log('Getting plugins with params: %O', params);\n\n const queryString = this.buildQueryString(params);\n const url = `/admin/plugins${queryString}`;\n\n const result = await this.request<AdminListResponse<AdminPluginItem>>(url);\n\n log('Retrieved %d plugins', result.data.length);\n return result;\n }\n\n /**\n * Retrieves all published plugin identifiers\n *\n * Returns a lightweight list of all published plugin identifiers without\n * full plugin metadata. This is useful for admin operations that need to know\n * which plugins are currently published and available to users.\n *\n * @returns Promise resolving to an array containing identifiers array and last modified time\n */\n async getPublishedIdentifiers(): Promise<{ identifier: string; lastModified: string }[]> {\n log('Getting published plugin identifiers (admin)');\n\n const result =\n await this.request<{ identifier: string; lastModified: string }[]>('/v1/plugins/identifiers');\n log('Retrieved %d published plugin identifiers (admin)', result.length);\n return result;\n }\n\n /**\n * Retrieves a single plugin with full admin details\n *\n * @param id - Plugin ID or identifier\n * @returns Promise resolving to the detailed plugin information with version history\n */\n async getPlugin(id: number | string): Promise<AdminPluginItemDetail> {\n log('Getting plugin details (admin): %d', id);\n\n const result = await this.request<AdminPluginItemDetail>(`/admin/plugins/${id}`);\n log('Retrieved plugin with %d versions', result.versions.length);\n return result;\n }\n\n /**\n * Updates plugin information\n *\n * @param id - Plugin ID\n * @param data - Plugin update data containing fields to update\n * @returns Promise resolving to the updated plugin\n */\n async updatePlugin(id: number, data: PluginUpdateParams): Promise<AdminPluginItem> {\n log('Updating plugin: %d, data: %O', id, data);\n\n const result = await this.request<AdminPluginItem>(`/admin/plugins/${id}`, {\n body: JSON.stringify(data),\n method: 'PUT',\n });\n log('Plugin updated successfully');\n return result;\n }\n\n /**\n * Updates plugin publication status\n *\n * @param id - Plugin ID\n * @param status - New status to set\n * @returns Promise resolving to success response\n */\n async updatePluginStatus(\n id: number,\n status: 'published' | 'draft' | 'review' | 'rejected',\n ): Promise<{ message: string; success: boolean }> {\n log('Updating plugin status: %d to %s', id, status);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${id}/status`,\n {\n body: JSON.stringify({ status }),\n method: 'PATCH',\n },\n );\n log('Plugin status updated successfully');\n return result;\n }\n\n /**\n * Deletes a plugin\n *\n * @param id - Plugin ID\n * @returns Promise resolving to success response\n */\n async deletePlugin(id: number): Promise<{ message: string; success: boolean }> {\n log('Deleting plugin: %d', id);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${id}`,\n { method: 'DELETE' },\n );\n log('Plugin deleted successfully');\n return result;\n }\n\n /**\n * Retrieves the version history for a plugin\n *\n * @param pluginId - Plugin ID\n * @returns Promise resolving to an array of plugin versions\n */\n async getPluginVersions(pluginId: number): Promise<PluginVersion[]> {\n log('Getting plugin versions: pluginId=%d', pluginId);\n\n const result = await this.request<PluginVersion[]>(`/admin/plugins/${pluginId}/versions`);\n\n log('Retrieved %d versions', result.length);\n return result;\n }\n\n /**\n * Retrieves a specific plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @returns Promise resolving to the plugin version details\n */\n async getPluginVersion(pluginId: number, versionId: number): Promise<PluginVersion> {\n log('Getting version details: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<PluginVersion>(\n `/admin/plugins/${pluginId}/versions/${versionId}`,\n );\n log('Version details retrieved');\n return result;\n }\n\n /**\n * Creates a new plugin version\n *\n * @param pluginId - Plugin ID\n * @param data - Version creation data including manifest and version string\n * @returns Promise resolving to the created plugin version\n */\n async createPluginVersion(\n pluginId: number,\n data: PluginVersionCreateParams,\n ): Promise<PluginVersion> {\n log('Creating new version: pluginId=%d', pluginId);\n\n const result = await this.request<PluginVersion>(`/admin/plugins/${pluginId}/versions`, {\n body: JSON.stringify(data),\n method: 'POST',\n });\n log('Plugin version created successfully');\n return result;\n }\n\n /**\n * Updates a plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param data - Version update data\n * @returns Promise resolving to the updated plugin version\n */\n async updatePluginVersion(\n pluginId: number,\n versionId: number,\n data: PluginVersionUpdateParams,\n ): Promise<PluginVersion> {\n log('Updating version: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<PluginVersion>(\n `/admin/plugins/${pluginId}/versions/${versionId}`,\n {\n body: JSON.stringify(data),\n method: 'PUT',\n },\n );\n log('Plugin version updated successfully');\n return result;\n }\n\n /**\n * Deletes a plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @returns Promise resolving to success response\n */\n async deletePluginVersion(\n pluginId: number,\n versionId: number,\n ): Promise<{ message: string; success: boolean }> {\n log('Deleting version: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${pluginId}/versions/${versionId}`,\n { method: 'DELETE' },\n );\n log('Plugin version deleted successfully');\n return result;\n }\n\n /**\n * Sets a specific version as the latest version of a plugin\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID to set as latest\n * @returns Promise resolving to success response\n */\n async setPluginVersionAsLatest(\n pluginId: number,\n versionId: number,\n ): Promise<{ message: string; success: boolean }> {\n log('Setting version as latest: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${pluginId}/versions/${versionId}/latest`,\n { method: 'POST' },\n );\n log('Version set as latest');\n return result;\n }\n\n /**\n * Updates plugin visibility\n *\n * @param id - Plugin ID\n * @param visibility - New visibility setting\n * @returns Promise resolving to success response\n */\n async updatePluginVisibility(\n id: number,\n visibility: 'public' | 'private' | 'unlisted',\n ): Promise<{ message: string; success: boolean }> {\n log('Updating plugin visibility: %d to %s', id, visibility);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${id}/visibility`,\n {\n body: JSON.stringify({ visibility }),\n method: 'PATCH',\n },\n );\n log('Plugin visibility updated successfully');\n return result;\n }\n\n /**\n * Updates status for multiple plugins in a single operation\n *\n * @param ids - Array of plugin IDs to update\n * @param status - New status to set for all specified plugins\n * @returns Promise resolving to success response\n */\n async batchUpdatePluginStatus(\n ids: number[],\n status: 'published' | 'draft' | 'review' | 'rejected',\n ): Promise<{ message: string; success: boolean }> {\n log('Batch updating plugin status: %O to %s', ids, status);\n\n const result = await this.request<{ message: string; success: boolean }>(\n '/admin/plugins/batch/status',\n {\n body: JSON.stringify({ ids, status }),\n method: 'PATCH',\n },\n );\n log('Batch plugin status update completed');\n return result;\n }\n\n /**\n * Deletes multiple plugins in a single operation\n *\n * @param ids - Array of plugin IDs to delete\n * @returns Promise resolving to success response\n */\n async batchDeletePlugins(ids: number[]): Promise<{ message: string; success: boolean }> {\n log('Batch deleting plugins: %O', ids);\n\n const result = await this.request<{ message: string; success: boolean }>(\n '/admin/plugins/batch/delete',\n {\n body: JSON.stringify({ ids }),\n method: 'DELETE',\n },\n );\n log('Batch plugin deletion completed');\n return result;\n }\n\n /**\n * Retrieves detailed information about a plugin version including deployment options\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @returns Promise resolving to version details with deployment options\n */\n async getPluginVersionDetails(\n pluginId: number,\n versionId: number,\n ): Promise<PluginVersion & { deploymentOptions: any }> {\n log(\n 'Getting version details with deployment options: pluginId=%d, versionId=%d',\n pluginId,\n versionId,\n );\n\n const result = await this.request<PluginVersion & { deploymentOptions: any }>(\n `/admin/plugins/${pluginId}/versions/${versionId}`,\n );\n log('Version details with deployment options retrieved');\n return result;\n }\n\n /**\n * Updates detailed information for a plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param data - Detailed version update data including metadata and capabilities\n * @returns Promise resolving to the updated plugin version\n */\n async updatePluginVersionDetails(\n pluginId: number,\n versionId: number,\n data: {\n author?: string;\n authorUrl?: string;\n capabilitiesPrompts?: boolean;\n capabilitiesResources?: boolean;\n capabilitiesTools?: boolean;\n category?: string;\n description?: string;\n icon?: string;\n isValidated?: boolean;\n meta?: Record<string, any>;\n name?: string;\n prompts?: any;\n resources?: any;\n tags?: string[];\n tools?: any;\n },\n ): Promise<PluginVersion> {\n log('Updating version details: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<PluginVersion>(\n `/admin/plugins/${pluginId}/versions/${versionId}`,\n {\n body: JSON.stringify(data),\n method: 'PUT',\n },\n );\n log('Version details updated successfully');\n return result;\n }\n\n /**\n * Retrieves deployment options for a specific plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @returns Promise resolving to an array of deployment options\n */\n async getDeploymentOptions(\n pluginId: number,\n versionId: number,\n ): Promise<AdminDeploymentOption[]> {\n log('Getting deployment options: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<AdminDeploymentOption[]>(\n `/admin/plugins/${pluginId}/versions/${versionId}/deployment-options`,\n );\n log('Retrieved %d deployment options', result.length);\n return result;\n }\n\n /**\n * Creates a new deployment option for a plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param data - Deployment option configuration data\n * @returns Promise resolving to the created deployment option\n */\n async createDeploymentOption(\n pluginId: number,\n versionId: number,\n data: {\n connectionArgs?: string[];\n connectionCommand?: string;\n connectionType: string;\n description?: string;\n installationDetails?: InstallationDetails;\n installationMethod: string;\n isRecommended?: boolean;\n },\n ): Promise<AdminDeploymentOption> {\n log('Creating deployment option: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<AdminDeploymentOption>(\n `/admin/plugins/${pluginId}/versions/${versionId}/deployment-options`,\n {\n body: JSON.stringify(data),\n method: 'POST',\n },\n );\n log('Deployment option created successfully');\n return result;\n }\n\n /**\n * Updates an existing deployment option\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param optionId - Deployment option ID\n * @param data - Updated deployment option configuration\n * @returns Promise resolving to the updated deployment option\n */\n async updateDeploymentOption(\n pluginId: number,\n versionId: number,\n optionId: number,\n data: {\n connectionArgs?: string[];\n connectionCommand?: string;\n connectionType?: string;\n description?: string;\n installationDetails?: Record<string, any>;\n installationMethod?: string;\n isRecommended?: boolean;\n },\n ): Promise<AdminDeploymentOption> {\n log(\n 'Updating deployment option: pluginId=%d, versionId=%d, optionId=%d',\n pluginId,\n versionId,\n optionId,\n );\n\n const result = await this.request<AdminDeploymentOption>(\n `/admin/plugins/${pluginId}/versions/${versionId}/deployment-options/${optionId}`,\n {\n body: JSON.stringify(data),\n method: 'PUT',\n },\n );\n log('Deployment option updated successfully');\n return result;\n }\n\n /**\n * Deletes a deployment option\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param optionId - Deployment option ID\n * @returns Promise resolving to success response\n */\n async deleteDeploymentOption(\n pluginId: number,\n versionId: number,\n optionId: number,\n ): Promise<{ message: string; success: boolean }> {\n log(\n 'Deleting deployment option: pluginId=%d, versionId=%d, optionId=%d',\n pluginId,\n versionId,\n optionId,\n );\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${pluginId}/versions/${versionId}/deployment-options/${optionId}`,\n { method: 'DELETE' },\n );\n log('Deployment option deleted successfully');\n return result;\n }\n\n /**\n * Retrieves system dependencies for a deployment option\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param optionId - Deployment option ID\n * @returns Promise resolving to an array of system dependencies\n */\n async getDeploymentOptionSystemDependencies(\n pluginId: number,\n versionId: number,\n optionId: number,\n ): Promise<SystemDependency[]> {\n log(\n 'Getting system dependencies: pluginId=%d, versionId=%d, optionId=%d',\n pluginId,\n versionId,\n optionId,\n );\n\n const result = await this.request<SystemDependency[]>(\n `/admin/plugins/${pluginId}/versions/${versionId}/deployment-options/${optionId}/system-dependencies`,\n );\n log('Retrieved %d system dependencies', result.length);\n return result;\n }\n}\n","import type { SystemDependency } from '@lobehub/market-types';\nimport debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\nimport type { MarketSDKOptions } from '@/types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:admin:dependency');\n\n/**\n * System Dependency Management Service\n *\n * Provides administrative functionality for managing system dependencies\n * required by plugins. This service handles creating, updating, deleting,\n * and listing system dependencies that plugins may require.\n */\nexport class SystemDependencyService extends BaseSDK {\n /**\n * Creates a new SystemDependencyService instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n super(options, sharedHeaders);\n log('SystemDependencyService instance created');\n }\n\n /**\n * Retrieves all system dependencies\n *\n * Gets a list of all defined system dependencies that plugins may require.\n *\n * @returns Promise resolving to an array of system dependencies\n */\n async getSystemDependencies(): Promise<SystemDependency[]> {\n log('Getting all system dependencies');\n\n const result = await this.request<SystemDependency[]>(`/admin/plugins/dependencies`);\n log('Retrieved %d system dependencies', result.length);\n return result;\n }\n\n /**\n * Retrieves a specific system dependency by ID\n *\n * @param id - System dependency ID\n * @returns Promise resolving to the system dependency details\n */\n async getSystemDependency(id: number): Promise<SystemDependency> {\n log('Getting system dependency details: %d', id);\n\n const result = await this.request<SystemDependency>(`/admin/plugins/dependencies/${id}`);\n log('System dependency details retrieved');\n return result;\n }\n\n /**\n * Creates a new system dependency\n *\n * @param data - System dependency creation data\n * @returns Promise resolving to the created system dependency\n */\n async createSystemDependency(data: Omit<SystemDependency, 'id'>): Promise<SystemDependency> {\n log('Creating system dependency: %O', data);\n\n const result = await this.request<SystemDependency>(`/admin/plugins/dependencies`, {\n body: JSON.stringify(data),\n method: 'POST',\n });\n log('System dependency created successfully');\n return result;\n }\n\n /**\n * Updates an existing system dependency\n *\n * @param id - System dependency ID\n * @param data - System dependency update data\n * @returns Promise resolving to the updated system dependency\n */\n async updateSystemDependency(\n id: number,\n data: Partial<SystemDependency>,\n ): Promise<SystemDependency> {\n log('Updating system dependency: %d, data: %O', id, data);\n\n const result = await this.request<SystemDependency>(`/admin/plugins/dependencies/${id}`, {\n body: JSON.stringify(data),\n method: 'PUT',\n });\n log('System dependency updated successfully');\n return result;\n }\n\n /**\n * Deletes a system dependency\n *\n * @param id - System dependency ID\n * @returns Promise resolving to success response\n */\n async deleteSystemDependency(id: number): Promise<{ message: string; success: boolean }> {\n log('Deleting system dependency: %d', id);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/dependencies/${id}`,\n { method: 'DELETE' },\n );\n log('System dependency deleted successfully');\n return result;\n }\n}\n","import debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:admin:settings');\n\n/**\n * Settings entity representing a system setting\n */\nexport interface Settings {\n /** Creation timestamp (ISO 8601 format) */\n createdAt: string;\n /** Optional description of the setting's purpose */\n description?: string;\n /** Unique identifier for the setting */\n id: number;\n /** Setting key name used for retrieving the setting */\n key: string;\n /** Last update timestamp (ISO 8601 format) */\n updatedAt: string;\n /** Setting value (stored as string) */\n value: string;\n}\n\n/**\n * Configuration for enabled resource types\n */\nexport interface EnabledResources {\n /** Whether agent resources are enabled */\n agents: boolean;\n /** Whether plugin resources are enabled */\n plugins: boolean;\n}\n\n/**\n * Authentication configuration\n */\nexport interface AuthenticationConfig {\n /** Whether authentication is required */\n enabled: boolean;\n /** Supported authentication schemes */\n schemes: string[];\n}\n\n/**\n * Documentation URL configuration\n */\nexport interface DocumentationConfig {\n /** URL to API documentation */\n apiUrl?: string;\n /** URL to privacy policy */\n policyUrl?: string;\n /** URL to terms of service */\n termsOfServiceUrl?: string;\n}\n\n/**\n * Map of all system settings with typed properties\n */\nexport interface SettingsMap {\n /** Additional settings (dynamically added) */\n [key: string]: any;\n /** Authentication configuration */\n authentication: AuthenticationConfig;\n /** Base URL for the marketplace */\n baseURL: string;\n /** Documentation URL configuration */\n documentation: DocumentationConfig;\n /** Configuration for enabled resource types */\n enabledResources: EnabledResources;\n /** Supported locales */\n locales: string[];\n}\n\n/**\n * Parameters for creating a new setting\n */\nexport interface CreateSettingsParams {\n /** Optional description of the setting's purpose */\n description?: string;\n /** Setting key name */\n key: string;\n /** Setting value (will be stored as string) */\n value: string;\n}\n\n/**\n * Parameters for updating an existing setting\n */\nexport interface UpdateSettingsParams {\n /** Optional new description */\n description?: string;\n /** New setting value */\n value: string;\n}\n\n/**\n * Settings Management Service\n *\n * Provides administrative functionality for managing system settings.\n * This service handles getting, creating, updating, and deleting\n * configuration settings for the marketplace.\n */\nexport class SettingsService extends BaseSDK {\n /**\n * Retrieves all system settings\n *\n * Returns a consolidated map of all settings with typed values\n * for known setting keys.\n *\n * @returns Promise resolving to the settings map\n */\n async getSettings(): Promise<SettingsMap> {\n return await this.request<SettingsMap>('/admin/settings');\n }\n\n /**\n * Retrieves a specific setting by key\n *\n * @param key - Setting key name\n * @returns Promise resolving to the setting details\n */\n async getSettingByKey(key: string): Promise<{ data: Settings }> {\n log('Getting setting: %s', key);\n\n const result = await this.request<{ data: Settings }>(`/admin/settings/${key}`);\n log('Setting retrieved');\n return result;\n }\n\n /**\n * Creates a new system setting\n *\n * @param data - Setting creation parameters\n * @returns Promise resolving to the created setting\n */\n async createSetting(data: CreateSettingsParams): Promise<{ data: Settings }> {\n log('Creating setting: %O', data);\n\n const result = await this.request<{ data: Settings }>('/admin/settings', {\n body: JSON.stringify(data),\n method: 'POST',\n });\n log('Setting created successfully');\n return result;\n }\n\n /**\n * Updates an existing setting\n *\n * @param key - Setting key name\n * @param data - Setting update parameters\n * @returns Promise resolving to the updated setting\n */\n async updateSetting(key: string, data: UpdateSettingsParams): Promise<{ data: Settings }> {\n log('Updating setting: %s, data: %O', key, data);\n\n const result = await this.request<{ data: Settings }>(`/admin/settings/${key}`, {\n body: JSON.stringify(data),\n method: 'PUT',\n });\n log('Setting updated successfully');\n return result;\n }\n\n /**\n * Deletes a setting\n *\n * @param key - Setting key name\n * @returns Promise resolving to success message\n */\n async deleteSetting(key: string): Promise<{ message: string }> {\n log('Deleting setting: %s', key);\n\n const result = await this.request<{ message: string }>(`/admin/settings/${key}`, {\n method: 'DELETE',\n });\n log('Setting deleted successfully');\n return result;\n }\n}\n","import debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\nimport type {\n AdminListQueryParams,\n AdminListResponse,\n MarketSDKOptions,\n ReviewStatus,\n} from '@/types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:admin:review');\n\n/**\n * Review entity representing a plugin review\n */\nexport interface Review {\n /** Optional comment providing feedback */\n comment?: string;\n /** Creation timestamp (ISO 8601 format) */\n createdAt: string;\n /** Unique identifier for the review */\n id: number;\n /** ID of the plugin being reviewed */\n pluginId: number;\n /** ID of the reviewer (if available) */\n reviewerId?: number;\n /** Current status of the review */\n status: ReviewStatus;\n /** Last update timestamp (ISO 8601 format) */\n updatedAt: string;\n}\n\n/**\n * Extended review information with related entities\n */\nexport interface PluginReviewWithRelations extends Review {\n /** Related plugin information */\n plugin?: any;\n /** Related version information */\n version?: any;\n}\n\n/**\n * Parameters for updating a review\n */\nexport interface UpdateReviewParams {\n /** Optional comment or feedback */\n comment?: string;\n /** New status to set for the review */\n status: ReviewStatus;\n}\n\n/**\n * Review Management Service\n *\n * Provides administrative functionality for managing plugin reviews.\n * This service handles listing, fetching, and updating review statuses\n * for plugins in the marketplace.\n */\nexport class ReviewService extends BaseSDK {\n /**\n * Creates a new ReviewService instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n super(options, sharedHeaders);\n log('ReviewService instance created');\n }\n\n /**\n * Retrieves a list of reviews with filtering options\n *\n * @param params - Query parameters for filtering and pagination\n * @returns Promise resolving to the review list response\n */\n async getReviews(\n params: AdminListQueryParams = {},\n ): Promise<AdminListResponse<PluginReviewWithRelations>> {\n log('Getting reviews with params: %O', params);\n\n const queryString = this.buildQueryString(params);\n const url = `/admin/reviews${queryString ? `?${queryString}` : ''}`;\n\n const result = await this.request<AdminListResponse<PluginReviewWithRelations>>(url);\n\n log('Retrieved %d reviews', result.data.length);\n return result;\n }\n\n /**\n * Retrieves a specific review by ID\n *\n * @param id - Review ID\n * @returns Promise resolving to the review details\n */\n async getReviewById(id: number): Promise<Review> {\n log('Getting review details: %d', id);\n\n const result = await this.request<Review>(`/admin/reviews/${id}`);\n log('Review details retrieved');\n return result;\n }\n\n /**\n * Updates a review's status and comment\n *\n * @param id - Review ID\n * @param data - Update parameters containing new status and optional comment\n * @returns Promise resolving to the updated review\n */\n async updateReview(id: number, data: UpdateReviewParams): Promise<Review> {\n log('Updating review: %d, data: %O', id, data);\n\n const result = await this.request<Review>(`/admin/reviews/${id}`, {\n body: JSON.stringify(data),\n method: 'PUT',\n });\n log('Review updated successfully');\n return result;\n }\n\n /**\n * Retrieves the review history for a specific plugin\n *\n * @param pluginId - Plugin ID\n * @returns Promise resolving to an array of reviews for the plugin\n */\n async getPluginReviews(pluginId: number): Promise<{ data: Review[] }> {\n log('Getting plugin reviews: pluginId=%d', pluginId);\n\n const result = await this.request<{ data: Review[] }>(`/admin/reviews/plugin/${pluginId}`);\n log('Retrieved %d reviews for plugin', result.data.length);\n return result;\n }\n}\n","import debug from 'debug';\n\nimport { BaseSDK } from '../core/BaseSDK';\nimport type { DiscoveryDocument, MarketSDKOptions } from '../types';\nimport { DiscoveryService, PluginsService } from './services';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk');\n\n/**\n * LobeHub Market SDK Client\n *\n * Main client for accessing the LobeHub Marketplace API.\n * This class provides access to marketplace resources like plugins, agents,\n * and service discovery information. It follows a composition pattern\n * by combining specialized domain services.\n */\nexport class MarketSDK extends BaseSDK {\n /**\n * Plugins service for accessing plugin-related functionality\n * Provides methods to list, search, and retrieve plugin information\n */\n readonly plugins: PluginsService;\n\n /**\n * Discovery service for retrieving API service information\n * Used to get information about available endpoints and services\n */\n private readonly discovery: DiscoveryService;\n\n /**\n * Creates a new MarketSDK instance\n *\n * @param options - Configuration options for the SDK\n */\n constructor(options: MarketSDKOptions = {}) {\n super(options);\n log('MarketSDK instance created');\n\n // Initialize domain services with shared headers for efficient header reuse\n this.plugins = new PluginsService(options, this.headers);\n this.discovery = new DiscoveryService(options, this.headers);\n }\n\n /**\n * Retrieves the service discovery document\n *\n * The discovery document provides information about available API endpoints,\n * versions, and capabilities of the Market API.\n *\n * @returns Promise resolving to the service discovery document\n */\n async getDiscoveryDocument(): Promise<DiscoveryDocument> {\n return this.discovery.getDiscoveryDocument();\n }\n}\n","import debug from 'debug';\n\nimport { BaseSDK } from '../../core/BaseSDK';\nimport type { DiscoveryDocument, MarketSDKOptions } from '../../types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:discovery');\n\n/**\n * Discovery Service\n *\n * Provides functionality for retrieving service discovery information\n * from the LobeHub Marketplace API. The discovery document contains\n * metadata about available endpoints, authentication methods, and\n * other capabilities of the API.\n */\nexport class DiscoveryService extends BaseSDK {\n /** Cached discovery document to avoid repeated requests */\n private discoveryDoc?: DiscoveryDocument;\n\n /**\n * Creates a new DiscoveryService instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n super(options, sharedHeaders);\n log('DiscoveryService instance created');\n }\n\n /**\n * Retrieves the service discovery document\n *\n * This document contains information about available API endpoints,\n * authentication methods, and other capabilities of the Market API.\n * The result is cached after the first request to improve performance.\n *\n * @returns Promise resolving to the service discovery document\n */\n async getDiscoveryDocument(): Promise<DiscoveryDocument> {\n log('Fetching discovery document');\n if (this.discoveryDoc) {\n log('Returning cached discovery document');\n return this.discoveryDoc;\n }\n\n this.discoveryDoc = await this.request<DiscoveryDocument>('/market/.well-known/discovery');\n log('Discovery document successfully fetched');\n return this.discoveryDoc;\n }\n}\n","import type { PluginItemDetail, PluginManifest } from '@lobehub/market-types';\nimport debug from 'debug';\n\nimport { BaseSDK } from '../../core/BaseSDK';\nimport type {\n CategoryItem,\n MarketSDKOptions,\n PluginListResponse,\n PluginQueryParams,\n} from '../../types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:plugins');\n\n/**\n * Plugins Service\n *\n * Provides access to plugin-related functionality in the LobeHub Marketplace.\n * This service handles listing, searching, and retrieving detailed information\n * about plugins available in the marketplace.\n */\nexport class PluginsService extends BaseSDK {\n /**\n * Creates a new PluginsService instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n super(options, sharedHeaders);\n log('PluginsService instance created');\n }\n\n /**\n * Retrieves a list of plugins from the marketplace\n *\n * Supports filtering, pagination, and localization of results.\n *\n * @param params - Query parameters for filtering and pagination\n * @returns Promise resolving to the plugin list response containing items and pagination info\n */\n async getPluginList(params: PluginQueryParams = {}): Promise<PluginListResponse> {\n const locale = params.locale || this.defaultLocale;\n const queryParams = { ...params, locale };\n const queryString = this.buildQueryString(queryParams);\n\n log('Getting plugin list: %O', queryParams);\n\n const result = await this.request<PluginListResponse>(`/v1/plugins${queryString}`);\n log('Retrieved %d plugins', result.items.length);\n return result;\n }\n\n /**\n * Retrieves all plugin categories and their counts\n *\n * Returns a list of categories along with the number of plugins in each category.\n * Useful for building category filters in a UI.\n *\n * @returns Promise resolving to an array of category items with counts\n */\n async getCategories(): Promise<CategoryItem[]> {\n log('Getting plugin categories');\n\n const result = await this.request<CategoryItem[]>('/v1/plugins/categories');\n log('Retrieved %d categories', result.length);\n return result;\n }\n\n /**\n * Retrieves all published plugin identifiers\n *\n * Returns a lightweight list of all published plugin identifiers without\n * full plugin metadata. This is useful for clients that need to know which\n * plugins are available without fetching complete plugin information.\n *\n * @returns Promise resolving to an array containing identifiers array and last modified time\n */\n async getPublishedIdentifiers(): Promise<{ identifier: string; lastModified: string }[]> {\n log('Getting published plugin identifiers');\n\n const result =\n await this.request<{ identifier: string; lastModified: string }[]>('/v1/plugins/identifiers');\n log('Retrieved %d published plugin identifiers', result.length);\n return result;\n }\n\n /**\n * Retrieves the manifest for a specific plugin\n *\n * The manifest contains detailed information about a plugin, including\n * its capabilities, tools, prompts, and resources.\n *\n * @param identifier - Unique identifier of the plugin\n * @param locale - Optional locale for localized content (defaults to SDK default locale)\n * @param version - Optional specific version to retrieve (defaults to latest)\n * @returns Promise resolving to the plugin manifest\n */\n async getPluginManifest(\n identifier: string,\n locale?: string,\n version?: string,\n ): Promise<PluginManifest> {\n log('Getting plugin manifest: %O', { identifier, locale, version });\n const localeParam = locale || this.defaultLocale;\n const params: Record<string, string> = { locale: localeParam };\n if (version) {\n params.version = version;\n }\n const queryString = this.buildQueryString(params);\n\n const manifest = await this.request<PluginManifest>(\n `/v1/plugins/${identifier}/manifest${queryString}`,\n );\n log('Plugin manifest successfully retrieved: %s', identifier);\n return manifest;\n }\n\n /**\n * Retrieves the plugin detailed information about a plugin, including\n * its capabilities, tools, prompts, and resources.\n *\n * @param identifier - Unique identifier of the plugin\n * @param locale - Optional locale for localized content (defaults to SDK default locale)\n * @param version - Optional specific version to retrieve (defaults to latest)\n * @returns Promise resolving to the plugin manifest\n */\n async getPluginDetail(\n identifier: string,\n locale?: string,\n version?: string,\n ): Promise<PluginItemDetail> {\n log('Getting plugin detail: %O', { identifier, locale, version });\n const localeParam = locale || this.defaultLocale;\n const params: Record<string, string> = { locale: localeParam };\n if (version) {\n params.version = version;\n }\n const queryString = this.buildQueryString(params);\n\n const manifest = await this.request<PluginItemDetail>(\n `/v1/plugins/${identifier}${queryString}`,\n );\n log('Plugin manifest successfully retrieved: %s', identifier);\n return manifest;\n }\n}\n","import type { PluginManifest } from '@lobehub/market-types';\nimport { z } from 'zod';\n\n/**\n * Visibility levels for plugins in the marketplace\n * - public: Visible to all users\n * - private: Visible only to the owner and authorized users\n * - internal: Visible only within the organization\n */\nexport const VisibilityEnumSchema = z.enum(['public', 'private', 'internal']);\n\n/**\n * Publication status options for plugins\n * - published: Publicly available in the marketplace\n * - unpublished: Not publicly visible\n * - archived: Marked as no longer maintained\n * - deprecated: Marked as deprecated, but still available\n */\nexport const StatusEnumSchema = z.enum(['published', 'unpublished', 'archived', 'deprecated']);\n\n/**\n * Common query parameters for admin list endpoints\n * These parameters are used for pagination, filtering, and sorting.\n */\nexport interface AdminListQueryParams {\n /** Current page number (1-based) */\n current?: number;\n /** Search keyword for filtering results */\n keyword?: string;\n /** Number of items per page */\n pageSize?: number;\n /** Field to sort results by */\n sortField?: string;\n /** Sort direction */\n sortOrder?: 'ascend' | 'descend';\n}\n\n/**\n * Common response format for paginated admin list endpoints\n * This structure provides both the data and pagination information.\n */\nexport interface AdminListResponse<T> {\n /** Current page number (1-based) */\n current: number;\n /** Array of items for the current page */\n data: T[];\n /** Number of items per page */\n pageSize: number;\n /** Total number of items across all pages */\n total: number;\n /** Total number of pages */\n totalPages: number;\n}\n\n/**\n * Review status options\n * - pending: Awaiting review\n * - approved: Review approved\n * - rejected: Review rejected\n */\nexport type ReviewStatus = 'pending' | 'approved' | 'rejected';\n\n/**\n * Review status schema for validation\n */\nexport const ReviewStatusEnumSchema = z.enum(['published', 'draft', 'review', 'rejected']);\n\n/**\n * Parameters for admin plugin listing\n * Extends the common query parameters with plugin-specific filters.\n */\nexport interface AdminPluginParams {\n /** Filter for featured plugins */\n featured?: boolean;\n /** Maximum number of items to return */\n limit?: number;\n /** Number of items to skip */\n offset?: number;\n /** Sort direction */\n order?: 'asc' | 'desc';\n /** Field to sort by */\n orderBy?: 'createdAt' | 'updatedAt' | 'installCount' | 'ratingAverage';\n /** Filter by owner ID */\n ownerId?: number;\n /** Search query string */\n query?: string;\n /** Filter by plugin status */\n status?: 'published' | 'draft' | 'review' | 'rejected';\n /** Filter by visibility level */\n visibility?: 'public' | 'private' | 'unlisted';\n}\n\n/**\n * Parameters for creating a new plugin version\n */\nexport interface PluginVersionCreateParams {\n /** Whether this is the latest version */\n isLatest?: boolean;\n /** Whether this version has been validated */\n isValidated?: boolean;\n /** The complete plugin manifest */\n manifest: PluginManifest;\n /** Optional URL to the manifest file */\n manifestUrl?: string;\n /** Additional metadata for the version */\n meta?: Record<string, any>;\n /** Semantic version string (e.g., \"1.0.0\") */\n version: string;\n}\n\n/**\n * Parameters for updating an existing plugin version\n */\nexport interface PluginVersionUpdateParams {\n /** Whether this version has been validated */\n isValidated?: boolean;\n /** URL to the manifest file */\n manifestUrl?: string;\n /** Additional metadata for the version */\n meta?: Record<string, any>;\n}\n\n/**\n * Parameters for updating a plugin\n */\nexport interface PluginUpdateParams {\n /** Unique identifier for the plugin */\n identifier?: string;\n /** Whether this plugin is featured */\n isFeatured?: boolean;\n /** Additional metadata for the plugin */\n meta?: Record<string, any>;\n /** Publication status */\n status?: 'published' | 'draft' | 'review' | 'rejected';\n /** Tags for categorization */\n tags?: string[];\n /** Visibility level */\n visibility?: 'public' | 'private' | 'unlisted';\n}\n","/**\n * LobeHub Market JavaScript SDK\n *\n * This is the main entry point for the LobeHub Market SDK.\n * It exports the primary client classes and all type definitions.\n */\n\n// Export admin-related functionality\nexport { MarketAdmin } from './admin';\n\n// Export market-related functionality\nexport { MarketSDK } from './market';\n\n// Export SDK-specific types\nexport * from './types';\n\n// Re-export all type definitions from the types package\nexport * from '@lobehub/market-types';\n"],"mappings":";AAAA,OAAOA,YAAW;;;ACAlB,OAAO,WAAW;AAKlB,IAAM,MAAM,MAAM,sBAAsB;AAajC,IAAM,UAAN,MAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBnB,YAAY,UAA4B,CAAC,GAAG,eAAwC;AAElF,SAAK,UACH,QAAQ,WAAW,QAAQ,IAAI,mBAAmB;AAGpD,SAAK,gBAAgB,QAAQ,iBAAiB;AAG9C,UAAM,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AAiB,SAAS,KAAK,OAAO;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,uBAAmD;AACvD,WAAO,KAAK,UAAU,qBAAqB;AAAA,EAC7C;AACF;;;AGtDA,SAAS,SAAS;AAQX,IAAM,uBAAuB,EAAE,KAAK,CAAC,UAAU,WAAW,UAAU,CAAC;AASrE,IAAM,mBAAmB,EAAE,KAAK,CAAC,aAAa,eAAe,YAAY,YAAY,CAAC;AA+CtF,IAAM,yBAAyB,EAAE,KAAK,CAAC,aAAa,SAAS,UAAU,UAAU,CAAC;;;AChDzF,cAAc;","names":["debug","debug","log","debug","debug","log","debug","debug","log","debug","debug","log","debug","log","debug","debug","debug","log","debug","debug","log","debug","log","debug"]}
1
+ {"version":3,"sources":["../src/admin/MarketAdmin.ts","../src/core/BaseSDK.ts","../src/admin/services/PluginService.ts","../src/admin/services/SystemDependencyService.ts","../src/admin/services/SettingsService.ts","../src/admin/services/ReviewService.ts","../src/admin/services/PluginEnvService.ts","../src/market/market-sdk.ts","../src/market/services/DiscoveryService.ts","../src/market/services/PluginsService.ts","../src/types/admin.ts","../src/index.ts"],"sourcesContent":["import debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\nimport { MarketSDKOptions } from '@/types';\n\nimport {\n PluginEnvService,\n PluginService,\n ReviewService,\n SettingsService,\n SystemDependencyService,\n} from './services';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:admin');\n\n/**\n * LobeHub Market Admin SDK Client\n *\n * Client for accessing administrative functionality of the LobeHub Marketplace.\n * This SDK provides privileged operations for managing plugins, reviews,\n * system settings, and dependencies. It requires admin-level authentication.\n */\nexport class MarketAdmin extends BaseSDK {\n /**\n * Plugin management service\n * Provides methods for creating, updating, and managing plugins\n */\n readonly plugins: PluginService;\n\n readonly env: PluginEnvService;\n\n /**\n * Review management service\n * Provides methods for moderating and managing user reviews\n */\n readonly reviews: ReviewService;\n\n /**\n * System settings management service\n * Provides methods for configuring marketplace settings\n */\n readonly settings: SettingsService;\n\n /**\n * System dependency management service\n * Provides methods for managing system dependencies required by plugins\n */\n readonly dependencies: SystemDependencyService;\n\n /**\n * Creates a new MarketAdmin instance\n *\n * @param options - Configuration options for the SDK\n */\n constructor(options: MarketSDKOptions = {}) {\n // Use admin-specific API key if available\n const apiKey = options.apiKey || process.env.MARKET_ADMIN_API_KEY;\n\n super({ ...options, apiKey });\n log('MarketAdmin instance created');\n\n // Initialize admin services with shared headers for efficient header reuse\n this.plugins = new PluginService(options, this.headers);\n this.reviews = new ReviewService(options, this.headers);\n this.settings = new SettingsService(options, this.headers);\n this.dependencies = new SystemDependencyService(options, this.headers);\n this.env = new PluginEnvService(options, this.headers);\n }\n}\n","import debug from 'debug';\n\nimport type { MarketSDKOptions } from '../types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:core');\n\n/**\n * Base SDK class\n *\n * Provides shared request handling and authentication functionality that is used\n * by both the Market SDK and Admin SDK. This class handles the common concerns:\n * - API endpoint configuration\n * - Authentication header management\n * - HTTP request handling\n * - Error handling\n * - Query string building\n */\nexport class BaseSDK {\n /** Base API URL */\n protected baseUrl: string;\n\n /** Default locale for requests that require localization */\n protected defaultLocale: string;\n\n /** HTTP headers to include with all requests */\n protected headers: Record<string, string>;\n\n /**\n * Creates a new BaseSDK instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n // Set base URL from options, environment variable, or default to production URL\n this.baseUrl =\n options.baseURL || process.env.MARKET_BASE_URL || 'https://market.lobehub.com/api';\n\n // Set default locale from options or use English as default\n this.defaultLocale = options.defaultLocale || 'en-US';\n\n // Get API key from options or environment variable\n const apiKey = options.apiKey || process.env.MARKET_API_KEY;\n\n // Either use shared headers or create new headers object\n if (sharedHeaders) {\n this.headers = sharedHeaders;\n log('Using shared headers object');\n } else {\n this.headers = {\n 'Content-Type': 'application/json',\n ...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {}),\n };\n log('Created new headers object');\n }\n\n log('BaseSDK instance created: %O', {\n baseUrl: this.baseUrl,\n defaultLocale: this.defaultLocale,\n });\n }\n\n /**\n * Sends an HTTP request to the API and handles the response\n *\n * @param url - Request URL path (will be appended to baseUrl)\n * @param options - Fetch API request options\n * @returns Promise resolving to the parsed JSON response\n * @throws Error if the request fails\n */\n // eslint-disable-next-line no-undef\n protected async request<T>(url: string, options: RequestInit = {}): Promise<T> {\n log('Sending request: %s', `${this.baseUrl}${url}`);\n\n const response = await fetch(`${this.baseUrl}${url}`, {\n ...options,\n headers: {\n ...this.headers,\n ...options.headers,\n },\n });\n\n if (!response.ok) {\n const errorMsg = `Request failed: ${response.status} ${response.statusText}`;\n log('Request error: %s', errorMsg);\n throw new Error(errorMsg);\n }\n\n log('Request successful: %s', url);\n return response.json() as Promise<T>;\n }\n\n /**\n * Builds a URL query string from a parameters object\n *\n * @param params - Object containing query parameters\n * @returns Formatted query string (including leading ? if params exist)\n */\n protected buildQueryString(params: Record<string, any>): string {\n const query = Object.entries(params)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .filter(([_, value]) => value !== undefined && value !== null)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`)\n .join('&');\n\n return query ? `?${query}` : '';\n }\n\n /**\n * Sets an authentication token for API requests\n *\n * @param token - API authentication token\n */\n setAuthToken(token: string): void {\n log('Setting authentication token');\n this.headers.Authorization = `Bearer ${token}`;\n }\n\n /**\n * Clears the authentication token\n */\n clearAuthToken(): void {\n log('Clearing authentication token');\n delete this.headers.Authorization;\n }\n}\n","import type {\n AdminDeploymentOption,\n AdminPluginItem,\n AdminPluginItemDetail,\n InstallationDetails,\n PluginManifest,\n PluginVersion,\n SystemDependency,\n} from '@lobehub/market-types';\nimport debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\nimport type {\n AdminListQueryParams,\n AdminListResponse,\n MarketSDKOptions,\n PluginUpdateParams,\n PluginVersionCreateParams,\n PluginVersionUpdateParams,\n} from '@/types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:admin:plugin');\n\n/**\n * Plugin Management Service\n *\n * Provides administrative functionality for managing plugins in the marketplace.\n * This service handles CRUD operations for plugins, plugin versions, and deployment options.\n */\nexport class PluginService extends BaseSDK {\n /**\n * Creates a new PluginService instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n super(options, sharedHeaders);\n log('PluginService instance created');\n }\n\n /**\n * Imports plugin manifests (requires admin privileges)\n *\n * Allows batch importing of plugin manifests into the marketplace.\n *\n * @param manifests - Array of plugin manifests to import\n * @param ownerId - Optional owner ID to associate with the imported plugins\n * @returns Promise resolving to the import results with counts of success and failure\n */\n async importManifests(\n manifests: PluginManifest[],\n ownerId?: number,\n ): Promise<{ failed: number; success: number }> {\n log(`Starting batch import of ${manifests.length} manifests`);\n if (ownerId) {\n log(`Using specified owner ID: ${ownerId}`);\n }\n\n const response = await this.request<{ failed: number; success: number }>(\n '/admin/plugins/import',\n {\n body: JSON.stringify({\n manifests,\n ownerId,\n }),\n method: 'POST',\n },\n );\n\n log(`Batch import completed: ${response.success} succeeded, ${response.failed} failed`);\n return response;\n }\n\n /**\n * Retrieves a list of plugins with admin details\n *\n * Supports filtering, pagination, and sorting of results.\n *\n * @param params - Query parameters for filtering and pagination\n * @returns Promise resolving to the plugin list response with admin details\n */\n async getPlugins(params: AdminListQueryParams = {}): Promise<AdminListResponse<AdminPluginItem>> {\n log('Getting plugins with params: %O', params);\n\n const queryString = this.buildQueryString(params);\n const url = `/admin/plugins${queryString}`;\n\n const result = await this.request<AdminListResponse<AdminPluginItem>>(url);\n\n log('Retrieved %d plugins', result.data.length);\n return result;\n }\n\n /**\n * Retrieves all published plugin identifiers\n *\n * Returns a lightweight list of all published plugin identifiers without\n * full plugin metadata. This is useful for admin operations that need to know\n * which plugins are currently published and available to users.\n *\n * @returns Promise resolving to an array containing identifiers array and last modified time\n */\n async getPublishedIdentifiers(): Promise<{ identifier: string; lastModified: string }[]> {\n log('Getting published plugin identifiers (admin)');\n\n const result =\n await this.request<{ identifier: string; lastModified: string }[]>('/v1/plugins/identifiers');\n log('Retrieved %d published plugin identifiers (admin)', result.length);\n return result;\n }\n\n /**\n * Retrieves a single plugin with full admin details\n *\n * @param id - Plugin ID or identifier\n * @returns Promise resolving to the detailed plugin information with version history\n */\n async getPlugin(id: number | string): Promise<AdminPluginItemDetail> {\n log('Getting plugin details (admin): %d', id);\n\n const result = await this.request<AdminPluginItemDetail>(`/admin/plugins/${id}`);\n log('Retrieved plugin with %d versions', result.versions.length);\n return result;\n }\n\n /**\n * Updates plugin information\n *\n * @param id - Plugin ID\n * @param data - Plugin update data containing fields to update\n * @returns Promise resolving to the updated plugin\n */\n async updatePlugin(id: number, data: PluginUpdateParams): Promise<AdminPluginItem> {\n log('Updating plugin: %d, data: %O', id, data);\n\n const result = await this.request<AdminPluginItem>(`/admin/plugins/${id}`, {\n body: JSON.stringify(data),\n method: 'PUT',\n });\n log('Plugin updated successfully');\n return result;\n }\n\n /**\n * Updates plugin publication status\n *\n * @param id - Plugin ID\n * @param status - New status to set\n * @returns Promise resolving to success response\n */\n async updatePluginStatus(\n id: number,\n status: 'published' | 'draft' | 'review' | 'rejected',\n ): Promise<{ message: string; success: boolean }> {\n log('Updating plugin status: %d to %s', id, status);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${id}/status`,\n {\n body: JSON.stringify({ status }),\n method: 'PATCH',\n },\n );\n log('Plugin status updated successfully');\n return result;\n }\n\n /**\n * Deletes a plugin\n *\n * @param id - Plugin ID\n * @returns Promise resolving to success response\n */\n async deletePlugin(id: number): Promise<{ message: string; success: boolean }> {\n log('Deleting plugin: %d', id);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${id}`,\n { method: 'DELETE' },\n );\n log('Plugin deleted successfully');\n return result;\n }\n\n /**\n * Retrieves the version history for a plugin\n *\n * @param pluginId - Plugin ID\n * @returns Promise resolving to an array of plugin versions\n */\n async getPluginVersions(pluginId: number): Promise<PluginVersion[]> {\n log('Getting plugin versions: pluginId=%d', pluginId);\n\n const result = await this.request<PluginVersion[]>(`/admin/plugins/${pluginId}/versions`);\n\n log('Retrieved %d versions', result.length);\n return result;\n }\n\n /**\n * Retrieves a specific plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @returns Promise resolving to the plugin version details\n */\n async getPluginVersion(pluginId: number, versionId: number): Promise<PluginVersion> {\n log('Getting version details: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<PluginVersion>(\n `/admin/plugins/${pluginId}/versions/${versionId}`,\n );\n log('Version details retrieved');\n return result;\n }\n\n /**\n * Creates a new plugin version\n *\n * @param pluginId - Plugin ID\n * @param data - Version creation data including manifest and version string\n * @returns Promise resolving to the created plugin version\n */\n async createPluginVersion(\n pluginId: number,\n data: PluginVersionCreateParams,\n ): Promise<PluginVersion> {\n log('Creating new version: pluginId=%d', pluginId);\n\n const result = await this.request<PluginVersion>(`/admin/plugins/${pluginId}/versions`, {\n body: JSON.stringify(data),\n method: 'POST',\n });\n log('Plugin version created successfully');\n return result;\n }\n\n /**\n * Updates a plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param data - Version update data\n * @returns Promise resolving to the updated plugin version\n */\n async updatePluginVersion(\n pluginId: number,\n versionId: number,\n data: PluginVersionUpdateParams,\n ): Promise<PluginVersion> {\n log('Updating version: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<PluginVersion>(\n `/admin/plugins/${pluginId}/versions/${versionId}`,\n {\n body: JSON.stringify(data),\n method: 'PUT',\n },\n );\n log('Plugin version updated successfully');\n return result;\n }\n\n /**\n * Deletes a plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @returns Promise resolving to success response\n */\n async deletePluginVersion(\n pluginId: number,\n versionId: number,\n ): Promise<{ message: string; success: boolean }> {\n log('Deleting version: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${pluginId}/versions/${versionId}`,\n { method: 'DELETE' },\n );\n log('Plugin version deleted successfully');\n return result;\n }\n\n /**\n * Sets a specific version as the latest version of a plugin\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID to set as latest\n * @returns Promise resolving to success response\n */\n async setPluginVersionAsLatest(\n pluginId: number,\n versionId: number,\n ): Promise<{ message: string; success: boolean }> {\n log('Setting version as latest: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${pluginId}/versions/${versionId}/latest`,\n { method: 'POST' },\n );\n log('Version set as latest');\n return result;\n }\n\n /**\n * Updates plugin visibility\n *\n * @param id - Plugin ID\n * @param visibility - New visibility setting\n * @returns Promise resolving to success response\n */\n async updatePluginVisibility(\n id: number,\n visibility: 'public' | 'private' | 'unlisted',\n ): Promise<{ message: string; success: boolean }> {\n log('Updating plugin visibility: %d to %s', id, visibility);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${id}/visibility`,\n {\n body: JSON.stringify({ visibility }),\n method: 'PATCH',\n },\n );\n log('Plugin visibility updated successfully');\n return result;\n }\n\n /**\n * Updates status for multiple plugins in a single operation\n *\n * @param ids - Array of plugin IDs to update\n * @param status - New status to set for all specified plugins\n * @returns Promise resolving to success response\n */\n async batchUpdatePluginStatus(\n ids: number[],\n status: 'published' | 'draft' | 'review' | 'rejected',\n ): Promise<{ message: string; success: boolean }> {\n log('Batch updating plugin status: %O to %s', ids, status);\n\n const result = await this.request<{ message: string; success: boolean }>(\n '/admin/plugins/batch/status',\n {\n body: JSON.stringify({ ids, status }),\n method: 'PATCH',\n },\n );\n log('Batch plugin status update completed');\n return result;\n }\n\n /**\n * Deletes multiple plugins in a single operation\n *\n * @param ids - Array of plugin IDs to delete\n * @returns Promise resolving to success response\n */\n async batchDeletePlugins(ids: number[]): Promise<{ message: string; success: boolean }> {\n log('Batch deleting plugins: %O', ids);\n\n const result = await this.request<{ message: string; success: boolean }>(\n '/admin/plugins/batch/delete',\n {\n body: JSON.stringify({ ids }),\n method: 'DELETE',\n },\n );\n log('Batch plugin deletion completed');\n return result;\n }\n\n /**\n * Retrieves detailed information about a plugin version including deployment options\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @returns Promise resolving to version details with deployment options\n */\n async getPluginVersionDetails(\n pluginId: number,\n versionId: number,\n ): Promise<PluginVersion & { deploymentOptions: any }> {\n log(\n 'Getting version details with deployment options: pluginId=%d, versionId=%d',\n pluginId,\n versionId,\n );\n\n const result = await this.request<PluginVersion & { deploymentOptions: any }>(\n `/admin/plugins/${pluginId}/versions/${versionId}`,\n );\n log('Version details with deployment options retrieved');\n return result;\n }\n\n /**\n * Updates detailed information for a plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param data - Detailed version update data including metadata and capabilities\n * @returns Promise resolving to the updated plugin version\n */\n async updatePluginVersionDetails(\n pluginId: number,\n versionId: number,\n data: {\n author?: string;\n authorUrl?: string;\n capabilitiesPrompts?: boolean;\n capabilitiesResources?: boolean;\n capabilitiesTools?: boolean;\n category?: string;\n description?: string;\n icon?: string;\n isValidated?: boolean;\n meta?: Record<string, any>;\n name?: string;\n prompts?: any;\n resources?: any;\n tags?: string[];\n tools?: any;\n },\n ): Promise<PluginVersion> {\n log('Updating version details: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<PluginVersion>(\n `/admin/plugins/${pluginId}/versions/${versionId}`,\n {\n body: JSON.stringify(data),\n method: 'PUT',\n },\n );\n log('Version details updated successfully');\n return result;\n }\n\n /**\n * Retrieves deployment options for a specific plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @returns Promise resolving to an array of deployment options\n */\n async getDeploymentOptions(\n pluginId: number,\n versionId: number,\n ): Promise<AdminDeploymentOption[]> {\n log('Getting deployment options: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<AdminDeploymentOption[]>(\n `/admin/plugins/${pluginId}/versions/${versionId}/deployment-options`,\n );\n log('Retrieved %d deployment options', result.length);\n return result;\n }\n\n /**\n * Creates a new deployment option for a plugin version\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param data - Deployment option configuration data\n * @returns Promise resolving to the created deployment option\n */\n async createDeploymentOption(\n pluginId: number,\n versionId: number,\n data: {\n connectionArgs?: string[];\n connectionCommand?: string;\n connectionType: string;\n description?: string;\n installationDetails?: InstallationDetails;\n installationMethod: string;\n isRecommended?: boolean;\n },\n ): Promise<AdminDeploymentOption> {\n log('Creating deployment option: pluginId=%d, versionId=%d', pluginId, versionId);\n\n const result = await this.request<AdminDeploymentOption>(\n `/admin/plugins/${pluginId}/versions/${versionId}/deployment-options`,\n {\n body: JSON.stringify(data),\n method: 'POST',\n },\n );\n log('Deployment option created successfully');\n return result;\n }\n\n /**\n * Updates an existing deployment option\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param optionId - Deployment option ID\n * @param data - Updated deployment option configuration\n * @returns Promise resolving to the updated deployment option\n */\n async updateDeploymentOption(\n pluginId: number,\n versionId: number,\n optionId: number,\n data: {\n connectionArgs?: string[];\n connectionCommand?: string;\n connectionType?: string;\n description?: string;\n installationDetails?: Record<string, any>;\n installationMethod?: string;\n isRecommended?: boolean;\n },\n ): Promise<AdminDeploymentOption> {\n log(\n 'Updating deployment option: pluginId=%d, versionId=%d, optionId=%d',\n pluginId,\n versionId,\n optionId,\n );\n\n const result = await this.request<AdminDeploymentOption>(\n `/admin/plugins/${pluginId}/versions/${versionId}/deployment-options/${optionId}`,\n {\n body: JSON.stringify(data),\n method: 'PUT',\n },\n );\n log('Deployment option updated successfully');\n return result;\n }\n\n /**\n * Deletes a deployment option\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param optionId - Deployment option ID\n * @returns Promise resolving to success response\n */\n async deleteDeploymentOption(\n pluginId: number,\n versionId: number,\n optionId: number,\n ): Promise<{ message: string; success: boolean }> {\n log(\n 'Deleting deployment option: pluginId=%d, versionId=%d, optionId=%d',\n pluginId,\n versionId,\n optionId,\n );\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/${pluginId}/versions/${versionId}/deployment-options/${optionId}`,\n { method: 'DELETE' },\n );\n log('Deployment option deleted successfully');\n return result;\n }\n\n /**\n * Retrieves system dependencies for a deployment option\n *\n * @param pluginId - Plugin ID\n * @param versionId - Version ID\n * @param optionId - Deployment option ID\n * @returns Promise resolving to an array of system dependencies\n */\n async getDeploymentOptionSystemDependencies(\n pluginId: number,\n versionId: number,\n optionId: number,\n ): Promise<SystemDependency[]> {\n log(\n 'Getting system dependencies: pluginId=%d, versionId=%d, optionId=%d',\n pluginId,\n versionId,\n optionId,\n );\n\n const result = await this.request<SystemDependency[]>(\n `/admin/plugins/${pluginId}/versions/${versionId}/deployment-options/${optionId}/system-dependencies`,\n );\n log('Retrieved %d system dependencies', result.length);\n return result;\n }\n}\n","import type { SystemDependency } from '@lobehub/market-types';\nimport debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\nimport type { MarketSDKOptions } from '@/types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:admin:dependency');\n\n/**\n * System Dependency Management Service\n *\n * Provides administrative functionality for managing system dependencies\n * required by plugins. This service handles creating, updating, deleting,\n * and listing system dependencies that plugins may require.\n */\nexport class SystemDependencyService extends BaseSDK {\n /**\n * Creates a new SystemDependencyService instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n super(options, sharedHeaders);\n log('SystemDependencyService instance created');\n }\n\n /**\n * Retrieves all system dependencies\n *\n * Gets a list of all defined system dependencies that plugins may require.\n *\n * @returns Promise resolving to an array of system dependencies\n */\n async getSystemDependencies(): Promise<SystemDependency[]> {\n log('Getting all system dependencies');\n\n const result = await this.request<SystemDependency[]>(`/admin/plugins/dependencies`);\n log('Retrieved %d system dependencies', result.length);\n return result;\n }\n\n /**\n * Retrieves a specific system dependency by ID\n *\n * @param id - System dependency ID\n * @returns Promise resolving to the system dependency details\n */\n async getSystemDependency(id: number): Promise<SystemDependency> {\n log('Getting system dependency details: %d', id);\n\n const result = await this.request<SystemDependency>(`/admin/plugins/dependencies/${id}`);\n log('System dependency details retrieved');\n return result;\n }\n\n /**\n * Creates a new system dependency\n *\n * @param data - System dependency creation data\n * @returns Promise resolving to the created system dependency\n */\n async createSystemDependency(data: Omit<SystemDependency, 'id'>): Promise<SystemDependency> {\n log('Creating system dependency: %O', data);\n\n const result = await this.request<SystemDependency>(`/admin/plugins/dependencies`, {\n body: JSON.stringify(data),\n method: 'POST',\n });\n log('System dependency created successfully');\n return result;\n }\n\n /**\n * Updates an existing system dependency\n *\n * @param id - System dependency ID\n * @param data - System dependency update data\n * @returns Promise resolving to the updated system dependency\n */\n async updateSystemDependency(\n id: number,\n data: Partial<SystemDependency>,\n ): Promise<SystemDependency> {\n log('Updating system dependency: %d, data: %O', id, data);\n\n const result = await this.request<SystemDependency>(`/admin/plugins/dependencies/${id}`, {\n body: JSON.stringify(data),\n method: 'PUT',\n });\n log('System dependency updated successfully');\n return result;\n }\n\n /**\n * Deletes a system dependency\n *\n * @param id - System dependency ID\n * @returns Promise resolving to success response\n */\n async deleteSystemDependency(id: number): Promise<{ message: string; success: boolean }> {\n log('Deleting system dependency: %d', id);\n\n const result = await this.request<{ message: string; success: boolean }>(\n `/admin/plugins/dependencies/${id}`,\n { method: 'DELETE' },\n );\n log('System dependency deleted successfully');\n return result;\n }\n}\n","import debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:admin:settings');\n\n/**\n * Settings entity representing a system setting\n */\nexport interface Settings {\n /** Creation timestamp (ISO 8601 format) */\n createdAt: string;\n /** Optional description of the setting's purpose */\n description?: string;\n /** Unique identifier for the setting */\n id: number;\n /** Setting key name used for retrieving the setting */\n key: string;\n /** Last update timestamp (ISO 8601 format) */\n updatedAt: string;\n /** Setting value (stored as string) */\n value: string;\n}\n\n/**\n * Configuration for enabled resource types\n */\nexport interface EnabledResources {\n /** Whether agent resources are enabled */\n agents: boolean;\n /** Whether plugin resources are enabled */\n plugins: boolean;\n}\n\n/**\n * Authentication configuration\n */\nexport interface AuthenticationConfig {\n /** Whether authentication is required */\n enabled: boolean;\n /** Supported authentication schemes */\n schemes: string[];\n}\n\n/**\n * Documentation URL configuration\n */\nexport interface DocumentationConfig {\n /** URL to API documentation */\n apiUrl?: string;\n /** URL to privacy policy */\n policyUrl?: string;\n /** URL to terms of service */\n termsOfServiceUrl?: string;\n}\n\n/**\n * Map of all system settings with typed properties\n */\nexport interface SettingsMap {\n /** Additional settings (dynamically added) */\n [key: string]: any;\n /** Authentication configuration */\n authentication: AuthenticationConfig;\n /** Base URL for the marketplace */\n baseURL: string;\n /** Documentation URL configuration */\n documentation: DocumentationConfig;\n /** Configuration for enabled resource types */\n enabledResources: EnabledResources;\n /** Supported locales */\n locales: string[];\n}\n\n/**\n * Parameters for creating a new setting\n */\nexport interface CreateSettingsParams {\n /** Optional description of the setting's purpose */\n description?: string;\n /** Setting key name */\n key: string;\n /** Setting value (will be stored as string) */\n value: string;\n}\n\n/**\n * Parameters for updating an existing setting\n */\nexport interface UpdateSettingsParams {\n /** Optional new description */\n description?: string;\n /** New setting value */\n value: string;\n}\n\n/**\n * Settings Management Service\n *\n * Provides administrative functionality for managing system settings.\n * This service handles getting, creating, updating, and deleting\n * configuration settings for the marketplace.\n */\nexport class SettingsService extends BaseSDK {\n /**\n * Retrieves all system settings\n *\n * Returns a consolidated map of all settings with typed values\n * for known setting keys.\n *\n * @returns Promise resolving to the settings map\n */\n async getSettings(): Promise<SettingsMap> {\n return await this.request<SettingsMap>('/admin/settings');\n }\n\n /**\n * Retrieves a specific setting by key\n *\n * @param key - Setting key name\n * @returns Promise resolving to the setting details\n */\n async getSettingByKey(key: string): Promise<{ data: Settings }> {\n log('Getting setting: %s', key);\n\n const result = await this.request<{ data: Settings }>(`/admin/settings/${key}`);\n log('Setting retrieved');\n return result;\n }\n\n /**\n * Creates a new system setting\n *\n * @param data - Setting creation parameters\n * @returns Promise resolving to the created setting\n */\n async createSetting(data: CreateSettingsParams): Promise<{ data: Settings }> {\n log('Creating setting: %O', data);\n\n const result = await this.request<{ data: Settings }>('/admin/settings', {\n body: JSON.stringify(data),\n method: 'POST',\n });\n log('Setting created successfully');\n return result;\n }\n\n /**\n * Updates an existing setting\n *\n * @param key - Setting key name\n * @param data - Setting update parameters\n * @returns Promise resolving to the updated setting\n */\n async updateSetting(key: string, data: UpdateSettingsParams): Promise<{ data: Settings }> {\n log('Updating setting: %s, data: %O', key, data);\n\n const result = await this.request<{ data: Settings }>(`/admin/settings/${key}`, {\n body: JSON.stringify(data),\n method: 'PUT',\n });\n log('Setting updated successfully');\n return result;\n }\n\n /**\n * Deletes a setting\n *\n * @param key - Setting key name\n * @returns Promise resolving to success message\n */\n async deleteSetting(key: string): Promise<{ message: string }> {\n log('Deleting setting: %s', key);\n\n const result = await this.request<{ message: string }>(`/admin/settings/${key}`, {\n method: 'DELETE',\n });\n log('Setting deleted successfully');\n return result;\n }\n}\n","import debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\nimport type {\n AdminListQueryParams,\n AdminListResponse,\n MarketSDKOptions,\n ReviewStatus,\n} from '@/types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:admin:review');\n\n/**\n * Review entity representing a plugin review\n */\nexport interface Review {\n /** Optional comment providing feedback */\n comment?: string;\n /** Creation timestamp (ISO 8601 format) */\n createdAt: string;\n /** Unique identifier for the review */\n id: number;\n /** ID of the plugin being reviewed */\n pluginId: number;\n /** ID of the reviewer (if available) */\n reviewerId?: number;\n /** Current status of the review */\n status: ReviewStatus;\n /** Last update timestamp (ISO 8601 format) */\n updatedAt: string;\n}\n\n/**\n * Extended review information with related entities\n */\nexport interface PluginReviewWithRelations extends Review {\n /** Related plugin information */\n plugin?: any;\n /** Related version information */\n version?: any;\n}\n\n/**\n * Parameters for updating a review\n */\nexport interface UpdateReviewParams {\n /** Optional comment or feedback */\n comment?: string;\n /** New status to set for the review */\n status: ReviewStatus;\n}\n\n/**\n * Review Management Service\n *\n * Provides administrative functionality for managing plugin reviews.\n * This service handles listing, fetching, and updating review statuses\n * for plugins in the marketplace.\n */\nexport class ReviewService extends BaseSDK {\n /**\n * Creates a new ReviewService instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n super(options, sharedHeaders);\n log('ReviewService instance created');\n }\n\n /**\n * Retrieves a list of reviews with filtering options\n *\n * @param params - Query parameters for filtering and pagination\n * @returns Promise resolving to the review list response\n */\n async getReviews(\n params: AdminListQueryParams = {},\n ): Promise<AdminListResponse<PluginReviewWithRelations>> {\n log('Getting reviews with params: %O', params);\n\n const queryString = this.buildQueryString(params);\n const url = `/admin/reviews${queryString ? `?${queryString}` : ''}`;\n\n const result = await this.request<AdminListResponse<PluginReviewWithRelations>>(url);\n\n log('Retrieved %d reviews', result.data.length);\n return result;\n }\n\n /**\n * Retrieves a specific review by ID\n *\n * @param id - Review ID\n * @returns Promise resolving to the review details\n */\n async getReviewById(id: number): Promise<Review> {\n log('Getting review details: %d', id);\n\n const result = await this.request<Review>(`/admin/reviews/${id}`);\n log('Review details retrieved');\n return result;\n }\n\n /**\n * Updates a review's status and comment\n *\n * @param id - Review ID\n * @param data - Update parameters containing new status and optional comment\n * @returns Promise resolving to the updated review\n */\n async updateReview(id: number, data: UpdateReviewParams): Promise<Review> {\n log('Updating review: %d, data: %O', id, data);\n\n const result = await this.request<Review>(`/admin/reviews/${id}`, {\n body: JSON.stringify(data),\n method: 'PUT',\n });\n log('Review updated successfully');\n return result;\n }\n\n /**\n * Retrieves the review history for a specific plugin\n *\n * @param pluginId - Plugin ID\n * @returns Promise resolving to an array of reviews for the plugin\n */\n async getPluginReviews(pluginId: number): Promise<{ data: Review[] }> {\n log('Getting plugin reviews: pluginId=%d', pluginId);\n\n const result = await this.request<{ data: Review[] }>(`/admin/reviews/plugin/${pluginId}`);\n log('Retrieved %d reviews for plugin', result.data.length);\n return result;\n }\n}\n","import debug from 'debug';\n\nimport { BaseSDK } from '@/core/BaseSDK';\nimport type { MarketSDKOptions } from '@/types';\nimport type { AdminListResponse } from '@/types/admin';\n\ntype AdminPluginEnvListQuery = any;\ntype PluginEnv = any;\n\nconst log = debug('lobe-market-sdk:admin:plugin-env');\n\nexport interface AdminPluginEnvCreateParams {\n identifier: string;\n key: string;\n value: string;\n description?: string;\n}\n\nexport interface AdminPluginEnvUpdateParams {\n value?: string;\n description?: string;\n}\n\n/**\n * Plugin Environment Variable Management Service\n *\n * Provides administrative functionality for managing plugin environment variables.\n */\nexport class PluginEnvService extends BaseSDK {\n /**\n * Retrieves a paginated list of plugin environment variables\n *\n * @param params - Query parameters for filtering and pagination\n * @returns Promise resolving to the env list response\n */\n async getPluginEnvs(params: AdminPluginEnvListQuery = {}): Promise<AdminListResponse<PluginEnv>> {\n log('Getting plugin envs with params: %O', params);\n const queryString = this.buildQueryString(params);\n const url = `/admin/plugins/env${queryString}`;\n const result = await this.request<AdminListResponse<PluginEnv>>(url);\n log('Retrieved %d plugin envs', result.data.length);\n return result;\n }\n\n /**\n * Retrieves a single plugin environment variable by ID\n *\n * @param id - Env ID\n * @returns Promise resolving to the env item\n */\n async getPluginEnv(id: number): Promise<PluginEnv> {\n log('Getting plugin env: %d', id);\n const result = await this.request<PluginEnv>(`/admin/plugins/env/${id}`);\n log('Retrieved plugin env: %d', id);\n return result;\n }\n\n /**\n * Creates a new plugin environment variable\n *\n * @param data - Env creation data\n * @returns Promise resolving to the created env item\n */\n async createPluginEnv(data: AdminPluginEnvCreateParams): Promise<PluginEnv> {\n log('Creating plugin env: %O', data);\n const result = await this.request<PluginEnv>(`/admin/plugins/env`, {\n body: JSON.stringify(data),\n method: 'POST',\n });\n log('Plugin env created successfully');\n return result;\n }\n\n /**\n * Updates a plugin environment variable\n *\n * @param id - Env ID\n * @param data - Env update data\n * @returns Promise resolving to the updated env item\n */\n async updatePluginEnv(id: number, data: AdminPluginEnvUpdateParams): Promise<PluginEnv> {\n log('Updating plugin env: %d, data: %O', id, data);\n const result = await this.request<PluginEnv>(`/admin/plugins/env/${id}`, {\n body: JSON.stringify(data),\n method: 'PUT',\n });\n log('Plugin env updated successfully');\n return result;\n }\n\n /**\n * Deletes a plugin environment variable\n *\n * @param id - Env ID\n * @returns Promise resolving to success response\n */\n async deletePluginEnv(id: number): Promise<{ success: boolean }> {\n log('Deleting plugin env: %d', id);\n const result = await this.request<{ success: boolean }>(`/admin/plugins/env/${id}`, {\n method: 'DELETE',\n });\n log('Plugin env deleted successfully');\n return result;\n }\n\n /**\n * Batch import plugin environment variables\n *\n * @param data - Batch import data, format: { [plugin: string]: { [envKey: string]: string } }\n * @returns Promise resolving to import result\n */\n async importPluginEnvs(\n data: Record<string, Record<string, string>>,\n ): Promise<{ success: number }> {\n log('Batch importing plugin envs: %O', data);\n const result = await this.request<{ success: number }>(`/admin/plugins/env/import`, {\n body: JSON.stringify(data),\n method: 'POST',\n });\n log('Batch import completed: %d envs imported', result.success);\n return result;\n }\n}\n","import debug from 'debug';\n\nimport { BaseSDK } from '../core/BaseSDK';\nimport type { DiscoveryDocument, MarketSDKOptions } from '../types';\nimport { DiscoveryService, PluginsService } from './services';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk');\n\n/**\n * LobeHub Market SDK Client\n *\n * Main client for accessing the LobeHub Marketplace API.\n * This class provides access to marketplace resources like plugins, agents,\n * and service discovery information. It follows a composition pattern\n * by combining specialized domain services.\n */\nexport class MarketSDK extends BaseSDK {\n /**\n * Plugins service for accessing plugin-related functionality\n * Provides methods to list, search, and retrieve plugin information\n */\n readonly plugins: PluginsService;\n\n /**\n * Discovery service for retrieving API service information\n * Used to get information about available endpoints and services\n */\n private readonly discovery: DiscoveryService;\n\n /**\n * Creates a new MarketSDK instance\n *\n * @param options - Configuration options for the SDK\n */\n constructor(options: MarketSDKOptions = {}) {\n super(options);\n log('MarketSDK instance created');\n\n // Initialize domain services with shared headers for efficient header reuse\n this.plugins = new PluginsService(options, this.headers);\n this.discovery = new DiscoveryService(options, this.headers);\n }\n\n /**\n * Retrieves the service discovery document\n *\n * The discovery document provides information about available API endpoints,\n * versions, and capabilities of the Market API.\n *\n * @returns Promise resolving to the service discovery document\n */\n async getDiscoveryDocument(): Promise<DiscoveryDocument> {\n return this.discovery.getDiscoveryDocument();\n }\n}\n","import debug from 'debug';\n\nimport { BaseSDK } from '../../core/BaseSDK';\nimport type { DiscoveryDocument, MarketSDKOptions } from '../../types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:discovery');\n\n/**\n * Discovery Service\n *\n * Provides functionality for retrieving service discovery information\n * from the LobeHub Marketplace API. The discovery document contains\n * metadata about available endpoints, authentication methods, and\n * other capabilities of the API.\n */\nexport class DiscoveryService extends BaseSDK {\n /** Cached discovery document to avoid repeated requests */\n private discoveryDoc?: DiscoveryDocument;\n\n /**\n * Creates a new DiscoveryService instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n super(options, sharedHeaders);\n log('DiscoveryService instance created');\n }\n\n /**\n * Retrieves the service discovery document\n *\n * This document contains information about available API endpoints,\n * authentication methods, and other capabilities of the Market API.\n * The result is cached after the first request to improve performance.\n *\n * @returns Promise resolving to the service discovery document\n */\n async getDiscoveryDocument(): Promise<DiscoveryDocument> {\n log('Fetching discovery document');\n if (this.discoveryDoc) {\n log('Returning cached discovery document');\n return this.discoveryDoc;\n }\n\n this.discoveryDoc = await this.request<DiscoveryDocument>('/market/.well-known/discovery');\n log('Discovery document successfully fetched');\n return this.discoveryDoc;\n }\n}\n","import type { PluginItemDetail, PluginManifest } from '@lobehub/market-types';\nimport debug from 'debug';\n\nimport { BaseSDK } from '../../core/BaseSDK';\nimport type {\n CategoryItem,\n MarketSDKOptions,\n PluginListResponse,\n PluginQueryParams,\n} from '../../types';\n\n// Create debug instance for logging\nconst log = debug('lobe-market-sdk:plugins');\n\n/**\n * Plugins Service\n *\n * Provides access to plugin-related functionality in the LobeHub Marketplace.\n * This service handles listing, searching, and retrieving detailed information\n * about plugins available in the marketplace.\n */\nexport class PluginsService extends BaseSDK {\n /**\n * Creates a new PluginsService instance\n *\n * @param options - Configuration options for the SDK\n * @param sharedHeaders - Optional shared headers object for reuse across services\n */\n constructor(options: MarketSDKOptions = {}, sharedHeaders?: Record<string, string>) {\n super(options, sharedHeaders);\n log('PluginsService instance created');\n }\n\n /**\n * Retrieves a list of plugins from the marketplace\n *\n * Supports filtering, pagination, and localization of results.\n *\n * @param params - Query parameters for filtering and pagination\n * @returns Promise resolving to the plugin list response containing items and pagination info\n */\n async getPluginList(params: PluginQueryParams = {}): Promise<PluginListResponse> {\n const locale = params.locale || this.defaultLocale;\n const queryParams = { ...params, locale };\n const queryString = this.buildQueryString(queryParams);\n\n log('Getting plugin list: %O', queryParams);\n\n const result = await this.request<PluginListResponse>(`/v1/plugins${queryString}`);\n log('Retrieved %d plugins', result.items.length);\n return result;\n }\n\n /**\n * Retrieves all plugin categories and their counts\n *\n * Returns a list of categories along with the number of plugins in each category.\n * Useful for building category filters in a UI.\n *\n * @returns Promise resolving to an array of category items with counts\n */\n async getCategories(): Promise<CategoryItem[]> {\n log('Getting plugin categories');\n\n const result = await this.request<CategoryItem[]>('/v1/plugins/categories');\n log('Retrieved %d categories', result.length);\n return result;\n }\n\n /**\n * Retrieves all published plugin identifiers\n *\n * Returns a lightweight list of all published plugin identifiers without\n * full plugin metadata. This is useful for clients that need to know which\n * plugins are available without fetching complete plugin information.\n *\n * @returns Promise resolving to an array containing identifiers array and last modified time\n */\n async getPublishedIdentifiers(): Promise<{ identifier: string; lastModified: string }[]> {\n log('Getting published plugin identifiers');\n\n const result =\n await this.request<{ identifier: string; lastModified: string }[]>('/v1/plugins/identifiers');\n log('Retrieved %d published plugin identifiers', result.length);\n return result;\n }\n\n /**\n * Retrieves the manifest for a specific plugin\n *\n * The manifest contains detailed information about a plugin, including\n * its capabilities, tools, prompts, and resources.\n *\n * @param identifier - Unique identifier of the plugin\n * @param locale - Optional locale for localized content (defaults to SDK default locale)\n * @param version - Optional specific version to retrieve (defaults to latest)\n * @returns Promise resolving to the plugin manifest\n */\n async getPluginManifest(\n identifier: string,\n locale?: string,\n version?: string,\n ): Promise<PluginManifest> {\n log('Getting plugin manifest: %O', { identifier, locale, version });\n const localeParam = locale || this.defaultLocale;\n const params: Record<string, string> = { locale: localeParam };\n if (version) {\n params.version = version;\n }\n const queryString = this.buildQueryString(params);\n\n const manifest = await this.request<PluginManifest>(\n `/v1/plugins/${identifier}/manifest${queryString}`,\n );\n log('Plugin manifest successfully retrieved: %s', identifier);\n return manifest;\n }\n\n /**\n * Retrieves the plugin detailed information about a plugin, including\n * its capabilities, tools, prompts, and resources.\n *\n * @param identifier - Unique identifier of the plugin\n * @param locale - Optional locale for localized content (defaults to SDK default locale)\n * @param version - Optional specific version to retrieve (defaults to latest)\n * @returns Promise resolving to the plugin manifest\n */\n async getPluginDetail(\n identifier: string,\n locale?: string,\n version?: string,\n ): Promise<PluginItemDetail> {\n log('Getting plugin detail: %O', { identifier, locale, version });\n const localeParam = locale || this.defaultLocale;\n const params: Record<string, string> = { locale: localeParam };\n if (version) {\n params.version = version;\n }\n const queryString = this.buildQueryString(params);\n\n const manifest = await this.request<PluginItemDetail>(\n `/v1/plugins/${identifier}${queryString}`,\n );\n log('Plugin manifest successfully retrieved: %s', identifier);\n return manifest;\n }\n}\n","import type { PluginManifest } from '@lobehub/market-types';\nimport { z } from 'zod';\n\n/**\n * Visibility levels for plugins in the marketplace\n * - public: Visible to all users\n * - private: Visible only to the owner and authorized users\n * - internal: Visible only within the organization\n */\nexport const VisibilityEnumSchema = z.enum(['public', 'private', 'internal']);\n\n/**\n * Publication status options for plugins\n * - published: Publicly available in the marketplace\n * - unpublished: Not publicly visible\n * - archived: Marked as no longer maintained\n * - deprecated: Marked as deprecated, but still available\n */\nexport const StatusEnumSchema = z.enum(['published', 'unpublished', 'archived', 'deprecated']);\n\n/**\n * Common query parameters for admin list endpoints\n * These parameters are used for pagination, filtering, and sorting.\n */\nexport interface AdminListQueryParams {\n /** Current page number (1-based) */\n current?: number;\n /** Search keyword for filtering results */\n keyword?: string;\n /** Number of items per page */\n pageSize?: number;\n /** Field to sort results by */\n sortField?: string;\n /** Sort direction */\n sortOrder?: 'ascend' | 'descend';\n}\n\n/**\n * Common response format for paginated admin list endpoints\n * This structure provides both the data and pagination information.\n */\nexport interface AdminListResponse<T> {\n /** Current page number (1-based) */\n current: number;\n /** Array of items for the current page */\n data: T[];\n /** Number of items per page */\n pageSize: number;\n /** Total number of items across all pages */\n total: number;\n /** Total number of pages */\n totalPages: number;\n}\n\n/**\n * Review status options\n * - pending: Awaiting review\n * - approved: Review approved\n * - rejected: Review rejected\n */\nexport type ReviewStatus = 'pending' | 'approved' | 'rejected';\n\n/**\n * Review status schema for validation\n */\nexport const ReviewStatusEnumSchema = z.enum(['published', 'draft', 'review', 'rejected']);\n\n/**\n * Parameters for admin plugin listing\n * Extends the common query parameters with plugin-specific filters.\n */\nexport interface AdminPluginParams {\n /** Filter for featured plugins */\n featured?: boolean;\n /** Maximum number of items to return */\n limit?: number;\n /** Number of items to skip */\n offset?: number;\n /** Sort direction */\n order?: 'asc' | 'desc';\n /** Field to sort by */\n orderBy?: 'createdAt' | 'updatedAt' | 'installCount' | 'ratingAverage';\n /** Filter by owner ID */\n ownerId?: number;\n /** Search query string */\n query?: string;\n /** Filter by plugin status */\n status?: 'published' | 'draft' | 'review' | 'rejected';\n /** Filter by visibility level */\n visibility?: 'public' | 'private' | 'unlisted';\n}\n\n/**\n * Parameters for creating a new plugin version\n */\nexport interface PluginVersionCreateParams {\n /** Whether this is the latest version */\n isLatest?: boolean;\n /** Whether this version has been validated */\n isValidated?: boolean;\n /** The complete plugin manifest */\n manifest: PluginManifest;\n /** Optional URL to the manifest file */\n manifestUrl?: string;\n /** Additional metadata for the version */\n meta?: Record<string, any>;\n /** Semantic version string (e.g., \"1.0.0\") */\n version: string;\n}\n\n/**\n * Parameters for updating an existing plugin version\n */\nexport interface PluginVersionUpdateParams {\n /** Whether this version has been validated */\n isValidated?: boolean;\n /** URL to the manifest file */\n manifestUrl?: string;\n /** Additional metadata for the version */\n meta?: Record<string, any>;\n}\n\n/**\n * Parameters for updating a plugin\n */\nexport interface PluginUpdateParams {\n /** Unique identifier for the plugin */\n identifier?: string;\n /** Whether this plugin is featured */\n isFeatured?: boolean;\n /** Additional metadata for the plugin */\n meta?: Record<string, any>;\n /** Publication status */\n status?: 'published' | 'draft' | 'review' | 'rejected';\n /** Tags for categorization */\n tags?: string[];\n /** Visibility level */\n visibility?: 'public' | 'private' | 'unlisted';\n}\n","/**\n * LobeHub Market JavaScript SDK\n *\n * This is the main entry point for the LobeHub Market SDK.\n * It exports the primary client classes and all type definitions.\n */\n\n// Export admin-related functionality\nexport { MarketAdmin } from './admin';\n\n// Export market-related functionality\nexport { MarketSDK } from './market';\n\n// Export SDK-specific types\nexport * from './types';\n\n// Re-export all type definitions from the types package\nexport * from '@lobehub/market-types';\n"],"mappings":";AAAA,OAAOA,YAAW;;;ACAlB,OAAO,WAAW;AAKlB,IAAM,MAAM,MAAM,sBAAsB;AAajC,IAAM,UAAN,MAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBnB,YAAY,UAA4B,CAAC,GAAG,eAAwC;AAElF,SAAK,UACH,QAAQ,WAAW,QAAQ,IAAI,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AA6B,EAAE,YAAY,QAAQ,QAAQ,CAAC;AAChE,UAAM,cAAc,UAAU,KAAK;AACnC,UAAM,SAAiC,EAAE,QAAQ,YAAY;AAC7D,QAAI,SAAS;AACX,aAAO,UAAU;AAAA,IACnB;AACA,UAAM,cAAc,KAAK,iBAAiB,MAAM;AAEhD,UAAM,WAAW,MAAM,KAAK;AAAA,MAC1B,eAAe,UAAU,GAAG,WAAW;AAAA,IACzC;AACA,IAAAA,KAAI,8CAA8C,UAAU;AAC5D,WAAO;AAAA,EACT;AACF;;;AF3IA,IAAME,QAAMC,QAAM,iBAAiB;AAU5B,IAAM,YAAN,cAAwB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBrC,YAAY,UAA4B,CAAC,GAAG;AAC1C,UAAM,OAAO;AACb,IAAAD,MAAI,4BAA4B;AAGhC,SAAK,UAAU,IAAI,eAAe,SAAS,KAAK,OAAO;AACvD,SAAK,YAAY,IAAI,iBAAiB,SAAS,KAAK,OAAO;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,uBAAmD;AACvD,WAAO,KAAK,UAAU,qBAAqB;AAAA,EAC7C;AACF;;;AGtDA,SAAS,SAAS;AAQX,IAAM,uBAAuB,EAAE,KAAK,CAAC,UAAU,WAAW,UAAU,CAAC;AASrE,IAAM,mBAAmB,EAAE,KAAK,CAAC,aAAa,eAAe,YAAY,YAAY,CAAC;AA+CtF,IAAM,yBAAyB,EAAE,KAAK,CAAC,aAAa,SAAS,UAAU,UAAU,CAAC;;;AChDzF,cAAc;","names":["debug","debug","log","debug","debug","log","debug","debug","log","debug","debug","log","debug","debug","log","debug","log","debug","debug","debug","log","debug","debug","log","debug","log","debug"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/market-sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "LobeHub Market JavaScript SDK",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -25,11 +25,11 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@lobehub/market-types": "1.4.1",
28
+ "@lobehub/market-types": "1.5.0",
29
29
  "debug": "^4.4.1"
30
30
  },
31
31
  "peerDependencies": {
32
- "@lobehub/market-types": "1.4.1",
32
+ "@lobehub/market-types": "1.5.0",
33
33
  "zod": "^3.24.4"
34
34
  }
35
35
  }