@lobehub/market-sdk 0.34.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1770,6 +1770,17 @@ interface RefreshTokenRequest {
1770
1770
  /** Refresh token issued during a previous token response */
1771
1771
  refreshToken: string;
1772
1772
  }
1773
+ /**
1774
+ * OAuth 2.0 token revocation parameters (RFC 7009)
1775
+ */
1776
+ interface RevokeTokenRequest {
1777
+ /** Client identifier; required for public clients */
1778
+ clientId: string;
1779
+ /** The token to revoke (access token or refresh token) */
1780
+ token: string;
1781
+ /** Hint about the type of the submitted token */
1782
+ tokenTypeHint?: 'access_token' | 'refresh_token';
1783
+ }
1773
1784
  /**
1774
1785
  * Normalized OAuth token response payload
1775
1786
  */
@@ -5996,6 +6007,17 @@ declare class AuthService extends BaseSDK {
5996
6007
  * @returns Promise resolving to the OAuth token payload
5997
6008
  */
5998
6009
  exchangeOAuthToken(request: AuthorizationCodeTokenRequest | RefreshTokenRequest, options?: globalThis.RequestInit): Promise<OAuthTokenResponse>;
6010
+ /**
6011
+ * Revokes an access token or refresh token at the OIDC revocation endpoint (RFC 7009)
6012
+ *
6013
+ * Per the spec, the server responds with 200 even when the token is already
6014
+ * invalid or expired, so a resolved promise only means the token is no longer
6015
+ * usable — not that it was previously valid.
6016
+ *
6017
+ * @param request - Token revocation parameters
6018
+ * @param options - Optional fetch options (e.g., custom headers)
6019
+ */
6020
+ revokeOAuthToken(request: RevokeTokenRequest, options?: globalThis.RequestInit): Promise<void>;
5999
6021
  /**
6000
6022
  * Retrieves user information from the OIDC userinfo endpoint
6001
6023
  *
@@ -7892,6 +7914,8 @@ interface UserSkill {
7892
7914
  updatedAt: string;
7893
7915
  }
7894
7916
  interface PublishVersionResponse {
7917
+ /** Whether the publish created a new version or merged into an existing one (plugin publish only) */
7918
+ action?: 'created' | 'updated';
7895
7919
  identifier: string;
7896
7920
  message: string;
7897
7921
  version: string;
@@ -7905,6 +7929,25 @@ interface ClaimableAsset {
7905
7929
  interface ClaimAssetResponse {
7906
7930
  success: boolean;
7907
7931
  }
7932
+ interface SubmitRepoParams {
7933
+ /** Optional branch name (only used for skill imports) */
7934
+ branch?: string;
7935
+ /** GitHub repository URL (must be owned by the authenticated user) */
7936
+ gitUrl: string;
7937
+ /** Asset type to import the repository as */
7938
+ type: 'plugin' | 'skill';
7939
+ }
7940
+ interface SubmitRepoResponse {
7941
+ /** Predicted identifier (skills only; null for plugins — assigned during import) */
7942
+ identifier: string | null;
7943
+ message: string;
7944
+ parsedUrl: {
7945
+ fullName: string;
7946
+ owner: string;
7947
+ repo: string;
7948
+ };
7949
+ success: boolean;
7950
+ }
7908
7951
  interface DeleteAssetResponse {
7909
7952
  success: boolean;
7910
7953
  }
@@ -7979,6 +8022,18 @@ declare class UserPublishService extends BaseSDK {
7979
8022
  * @returns Promise resolving to the claim result
7980
8023
  */
7981
8024
  claimAsset(assetId: number, assetType: 'plugin' | 'skill'): Promise<ClaimAssetResponse>;
8025
+ /**
8026
+ * Submits a GitHub repository owned by the authenticated user for import as a
8027
+ * new marketplace listing (skill or MCP plugin)
8028
+ *
8029
+ * The import runs asynchronously on the server. The user must have a verified
8030
+ * GitHub profile and the repository owner must match their GitHub username.
8031
+ *
8032
+ * @param params - The repository submission parameters
8033
+ * @param options - Optional request options (must include authentication)
8034
+ * @returns Promise resolving to the submission result
8035
+ */
8036
+ submitRepo(params: SubmitRepoParams, options?: globalThis.RequestInit): Promise<SubmitRepoResponse>;
7982
8037
  /**
7983
8038
  * Deletes an owned skill permanently
7984
8039
  *
@@ -8246,4 +8301,4 @@ declare function buildTrustedClientPayload(params: {
8246
8301
  workspaceId?: string;
8247
8302
  }): TrustedClientPayload;
8248
8303
 
8249
- export { type AccountMeta, type AdminListQueryParams, type AdminListResponse, type AdminPluginParams, type AgentCreateRequest, type AgentCreateResponse, type AgentDetailQuery, type AgentExtension, type AgentForkItem, type AgentForkRequest, type AgentForkResponse, type AgentForkSourceResponse, type AgentForksResponse, type AgentGroupCreateRequest, type AgentGroupCreateResponse, type AgentGroupDetail, type AgentGroupDetailQuery, type AgentGroupForkItem, type AgentGroupForkRequest, type AgentGroupForkResponse, type AgentGroupForkSourceResponse, type AgentGroupForksResponse, type AgentGroupItem, type AgentGroupListQuery, type AgentGroupListResponse, type AgentGroupModifyRequest, type AgentGroupModifyResponse, type AgentGroupStatus, type AgentGroupStatusChangeResponse, type AgentGroupVersionCreateRequest, type AgentGroupVersionCreateResponse, type AgentInstallCountRequest, type AgentInstallCountResponse, type AgentInterface, type AgentItemDetail, type AgentListQuery, type AgentListResponse, type AgentModifyRequest, type AgentModifyResponse, type AgentProfileEntity, type AgentProfileResponse, type AgentSecurityRequirement, type AgentSecurityScheme, type AgentSkill, type AgentStatus, type AgentStatusChangeResponse, type AgentUploadRequest, type AgentUploadResponse, type AgentUploadVersion, type AgentVersionCreateRequest, type AgentVersionCreateResponse, type AgentVersionLocalization, type AgentVersionModifyRequest, type AgentVersionModifyResponse, type AuthorizationCodeTokenRequest, type AuthorizeParams, type AuthorizeResponse, type CallSkillToolResponse, type CheckFavoriteQuery, type CheckFavoriteResponse, type CheckFollowQuery, type CheckFollowResponse, type CheckLikeQuery, type CheckLikeResponse, type CimdClientMetadata, type ClientRegistrationError, type ClientRegistrationRequest, type ClientRegistrationResponse, type CodeInterpreterToolName, type CodeInterpreterToolParams, type ConnectProvider, type ConnectProviderDetail, type ConnectProviderScopes, type ConnectionHealth, type ConnectionStats, type CreateFileCredRequest, type CreateKVCredRequest, type CreateMemberAgent, type CreateOAuthCredRequest, type CredWithPlaintext, type DeleteCredResponse, type DiscoveryDocument, type EditLocalFileParams, type ExecuteCodeParams, type ExportFileParams, type FavoriteListResponse, type FavoriteQuery, type FavoriteRequest, type FeedbackClientInfo, type FollowListItem, type FollowListResponse, type FollowRequest, type GetAllConnectionsHealthResponse, type GetAuthorizeUrlParams, type GetCommandOutputParams, type GetConnectProviderResponse, type GetConnectionHealthResponse, type GetConnectionStatsResponse, type GetConnectionStatusResponse, type GetCredOptions, type GetSkillStatusResponse, type GetSkillToolResponse, type GlobLocalFilesParams, type GrepContentParams, type InteractionTargetType, type KillCommandParams, type LikeListResponse, type LikeQuery, type LikeRequest, type ListConnectProvidersResponse, type ListConnectionsResponse, type ListCredsResponse, type ListLocalFilesParams, type ListSkillProvidersResponse, type ListSkillToolsResponse, MarketAPIError, MarketAdmin, type MarketReportGitHubSkillParams, type MarketReportGitHubSkillResponse, type MarketReportSkillInstallParams, type MarketReportSkillInstallResponse, MarketSDK, type MarketSDKOptions, type MarketSkillAuthor, type MarketSkillCategory, type MarketSkillCategoryQuery, type MarketSkillCollectionDetail, type MarketSkillCollectionDetailQuery, type MarketSkillCollectionItemSort, type MarketSkillCollectionListItem, type MarketSkillCollectionListQuery, type MarketSkillCollectionListResponse, type MarketSkillDetail, type MarketSkillDetailQuery, type MarketSkillGitHubMeta, type MarketSkillListItem, type MarketSkillListQuery, type MarketSkillListResponse, type MarketSkillManifest, type MarketSkillResource, type MarketSkillVersionSummary, type MarketSkillVersionsResponse, type MemberAgent, type MoveLocalFilesParams, type MoveOperation, type OAuthConnection, type OAuthTokenResponse, type OrgRef, type OrganizationInfoQuery, type OrganizationInfoResponse, type OrganizationProfile, type OwnAgentGroupListQuery, type OwnAgentListQuery, type PaginationQuery, type PluginCommentAuthor, type PluginCommentCreateItem, type PluginCommentCreateResponse, type PluginCommentDeleteResponse, type PluginCommentItem, type PluginCommentListQuery, type PluginCommentListResponse, type PluginCommentRating, type PluginCommentReactionResponse, type PluginI18nImportParams, type PluginI18nImportResponse, type PluginItem, type PluginLatestOwnComment, type PluginListResponse, type PluginLocalization, type PluginQueryParams, type PluginRatingDistribution, type PluginUpdateParams, type PluginVersionCreateParams, type PluginVersionUpdateParams, type ProgrammingLanguage, type ReadLocalFileParams, type RefreshConnectionResponse, type RefreshTokenRequest, type RegisterUserRequest, type RegisterUserResponse, type RegisteredUserProfile, type RenameLocalFileParams, type ReviewStatus, ReviewStatusEnumSchema, type RevokeConnectionResponse, type RunBuildInToolsError, type RunBuildInToolsRequest, type RunBuildInToolsResponse, type RunBuildInToolsSuccessData, type RunCommandParams, SDK_USER_AGENT, SDK_VERSION, type SearchLocalFilesParams, type SharedTokenState, type SkillCallParams, type SkillCommentAuthor, type SkillCommentCreateItem, type SkillCommentCreateResponse, type SkillCommentDeleteResponse, type SkillCommentItem, type SkillCommentListItem, type SkillCommentListQuery, type SkillCommentListResponse, type SkillCommentRating, type SkillErrorResponse, type SkillLatestOwnComment, type SkillProviderInfo, type SkillProviderStatus, type SkillRatingDistribution, type SkillTool, type SkillToolsSource, StatusEnumSchema, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SuccessResponse, type ToggleLikeResponse, type TrustedClientPayload, type UnclaimedPluginItem, type UpdateAgentProfileRequest, type UpdateAgentProfileResponse, type UpdateCredRequest, type UpdateMemberAgent, type UpdateUserInfoRequest, type UpdateUserInfoResponse, type UserAgentGroupItem, type UserAgentItem, type UserInfoQuery, type UserInfoResponse, type UserPluginItem, type UserProfile, type UserSkillItem, VisibilityEnumSchema, type WriteLocalFileParams, buildTrustedClientPayload, createTrustedClientToken, generateNonce, orgRefToPathSegment };
8304
+ export { type AccountMeta, type AdminListQueryParams, type AdminListResponse, type AdminPluginParams, type AgentCreateRequest, type AgentCreateResponse, type AgentDetailQuery, type AgentExtension, type AgentForkItem, type AgentForkRequest, type AgentForkResponse, type AgentForkSourceResponse, type AgentForksResponse, type AgentGroupCreateRequest, type AgentGroupCreateResponse, type AgentGroupDetail, type AgentGroupDetailQuery, type AgentGroupForkItem, type AgentGroupForkRequest, type AgentGroupForkResponse, type AgentGroupForkSourceResponse, type AgentGroupForksResponse, type AgentGroupItem, type AgentGroupListQuery, type AgentGroupListResponse, type AgentGroupModifyRequest, type AgentGroupModifyResponse, type AgentGroupStatus, type AgentGroupStatusChangeResponse, type AgentGroupVersionCreateRequest, type AgentGroupVersionCreateResponse, type AgentInstallCountRequest, type AgentInstallCountResponse, type AgentInterface, type AgentItemDetail, type AgentListQuery, type AgentListResponse, type AgentModifyRequest, type AgentModifyResponse, type AgentProfileEntity, type AgentProfileResponse, type AgentSecurityRequirement, type AgentSecurityScheme, type AgentSkill, type AgentStatus, type AgentStatusChangeResponse, type AgentUploadRequest, type AgentUploadResponse, type AgentUploadVersion, type AgentVersionCreateRequest, type AgentVersionCreateResponse, type AgentVersionLocalization, type AgentVersionModifyRequest, type AgentVersionModifyResponse, type AuthorizationCodeTokenRequest, type AuthorizeParams, type AuthorizeResponse, type CallSkillToolResponse, type CheckFavoriteQuery, type CheckFavoriteResponse, type CheckFollowQuery, type CheckFollowResponse, type CheckLikeQuery, type CheckLikeResponse, type CimdClientMetadata, type ClientRegistrationError, type ClientRegistrationRequest, type ClientRegistrationResponse, type CodeInterpreterToolName, type CodeInterpreterToolParams, type ConnectProvider, type ConnectProviderDetail, type ConnectProviderScopes, type ConnectionHealth, type ConnectionStats, type CreateFileCredRequest, type CreateKVCredRequest, type CreateMemberAgent, type CreateOAuthCredRequest, type CredWithPlaintext, type DeleteCredResponse, type DiscoveryDocument, type EditLocalFileParams, type ExecuteCodeParams, type ExportFileParams, type FavoriteListResponse, type FavoriteQuery, type FavoriteRequest, type FeedbackClientInfo, type FollowListItem, type FollowListResponse, type FollowRequest, type GetAllConnectionsHealthResponse, type GetAuthorizeUrlParams, type GetCommandOutputParams, type GetConnectProviderResponse, type GetConnectionHealthResponse, type GetConnectionStatsResponse, type GetConnectionStatusResponse, type GetCredOptions, type GetSkillStatusResponse, type GetSkillToolResponse, type GlobLocalFilesParams, type GrepContentParams, type InteractionTargetType, type KillCommandParams, type LikeListResponse, type LikeQuery, type LikeRequest, type ListConnectProvidersResponse, type ListConnectionsResponse, type ListCredsResponse, type ListLocalFilesParams, type ListSkillProvidersResponse, type ListSkillToolsResponse, MarketAPIError, MarketAdmin, type MarketReportGitHubSkillParams, type MarketReportGitHubSkillResponse, type MarketReportSkillInstallParams, type MarketReportSkillInstallResponse, MarketSDK, type MarketSDKOptions, type MarketSkillAuthor, type MarketSkillCategory, type MarketSkillCategoryQuery, type MarketSkillCollectionDetail, type MarketSkillCollectionDetailQuery, type MarketSkillCollectionItemSort, type MarketSkillCollectionListItem, type MarketSkillCollectionListQuery, type MarketSkillCollectionListResponse, type MarketSkillDetail, type MarketSkillDetailQuery, type MarketSkillGitHubMeta, type MarketSkillListItem, type MarketSkillListQuery, type MarketSkillListResponse, type MarketSkillManifest, type MarketSkillResource, type MarketSkillVersionSummary, type MarketSkillVersionsResponse, type MemberAgent, type MoveLocalFilesParams, type MoveOperation, type OAuthConnection, type OAuthTokenResponse, type OrgRef, type OrganizationInfoQuery, type OrganizationInfoResponse, type OrganizationProfile, type OwnAgentGroupListQuery, type OwnAgentListQuery, type PaginationQuery, type PluginCommentAuthor, type PluginCommentCreateItem, type PluginCommentCreateResponse, type PluginCommentDeleteResponse, type PluginCommentItem, type PluginCommentListQuery, type PluginCommentListResponse, type PluginCommentRating, type PluginCommentReactionResponse, type PluginI18nImportParams, type PluginI18nImportResponse, type PluginItem, type PluginLatestOwnComment, type PluginListResponse, type PluginLocalization, type PluginQueryParams, type PluginRatingDistribution, type PluginUpdateParams, type PluginVersionCreateParams, type PluginVersionUpdateParams, type ProgrammingLanguage, type ReadLocalFileParams, type RefreshConnectionResponse, type RefreshTokenRequest, type RegisterUserRequest, type RegisterUserResponse, type RegisteredUserProfile, type RenameLocalFileParams, type ReviewStatus, ReviewStatusEnumSchema, type RevokeConnectionResponse, type RevokeTokenRequest, type RunBuildInToolsError, type RunBuildInToolsRequest, type RunBuildInToolsResponse, type RunBuildInToolsSuccessData, type RunCommandParams, SDK_USER_AGENT, SDK_VERSION, type SearchLocalFilesParams, type SharedTokenState, type SkillCallParams, type SkillCommentAuthor, type SkillCommentCreateItem, type SkillCommentCreateResponse, type SkillCommentDeleteResponse, type SkillCommentItem, type SkillCommentListItem, type SkillCommentListQuery, type SkillCommentListResponse, type SkillCommentRating, type SkillErrorResponse, type SkillLatestOwnComment, type SkillProviderInfo, type SkillProviderStatus, type SkillRatingDistribution, type SkillTool, type SkillToolsSource, StatusEnumSchema, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SubmitRepoParams, type SubmitRepoResponse, type SuccessResponse, type ToggleLikeResponse, type TrustedClientPayload, type UnclaimedPluginItem, type UpdateAgentProfileRequest, type UpdateAgentProfileResponse, type UpdateCredRequest, type UpdateMemberAgent, type UpdateUserInfoRequest, type UpdateUserInfoResponse, type UserAgentGroupItem, type UserAgentItem, type UserInfoQuery, type UserInfoResponse, type UserPluginItem, type UserProfile, type UserSkillItem, VisibilityEnumSchema, type WriteLocalFileParams, buildTrustedClientPayload, createTrustedClientToken, generateNonce, orgRefToPathSegment };
package/dist/index.mjs CHANGED
@@ -2758,6 +2758,54 @@ var _AuthService = class _AuthService extends BaseSDK {
2758
2758
  log15("Token exchange successful");
2759
2759
  return _AuthService.normalizeTokenResponse(payload);
2760
2760
  }
2761
+ /**
2762
+ * Revokes an access token or refresh token at the OIDC revocation endpoint (RFC 7009)
2763
+ *
2764
+ * Per the spec, the server responds with 200 even when the token is already
2765
+ * invalid or expired, so a resolved promise only means the token is no longer
2766
+ * usable — not that it was previously valid.
2767
+ *
2768
+ * @param request - Token revocation parameters
2769
+ * @param options - Optional fetch options (e.g., custom headers)
2770
+ */
2771
+ async revokeOAuthToken(request, options) {
2772
+ const { clientId, token, tokenTypeHint } = request;
2773
+ if (!clientId || !token) {
2774
+ throw new Error("clientId and token are required for token revocation");
2775
+ }
2776
+ log15("Revoking OAuth token (hint=%s)", tokenTypeHint != null ? tokenTypeHint : "none");
2777
+ const revocationUrl = urlJoin2(this.baseUrl, "lobehub-oidc/token/revocation");
2778
+ const params = new URLSearchParams();
2779
+ params.set("client_id", clientId);
2780
+ params.set("token", token);
2781
+ if (tokenTypeHint) params.set("token_type_hint", tokenTypeHint);
2782
+ const headers = new Headers({
2783
+ "Content-Type": "application/x-www-form-urlencoded"
2784
+ });
2785
+ if (options == null ? void 0 : options.headers) {
2786
+ new Headers(options.headers).forEach((value, key) => {
2787
+ headers.set(key, value);
2788
+ });
2789
+ }
2790
+ const response = await fetch(revocationUrl, {
2791
+ ...options,
2792
+ body: params,
2793
+ headers,
2794
+ method: "POST"
2795
+ });
2796
+ if (!response.ok) {
2797
+ let errorDescription = response.statusText;
2798
+ try {
2799
+ const payload = await response.json();
2800
+ errorDescription = (payload == null ? void 0 : payload.error_description) || (payload == null ? void 0 : payload.error) || errorDescription;
2801
+ } catch (e) {
2802
+ }
2803
+ const errorMsg = `Token revocation failed: ${response.status} ${errorDescription}`;
2804
+ log15("Error: %s", errorMsg);
2805
+ throw new Error(errorMsg);
2806
+ }
2807
+ log15("Token revocation successful");
2808
+ }
2761
2809
  /**
2762
2810
  * Retrieves user information from the OIDC userinfo endpoint
2763
2811
  *
@@ -5980,6 +6028,28 @@ var UserPublishService = class extends BaseSDK {
5980
6028
  log30("Claim result for %s %d: %s", assetType, assetId, result.success);
5981
6029
  return result;
5982
6030
  }
6031
+ /**
6032
+ * Submits a GitHub repository owned by the authenticated user for import as a
6033
+ * new marketplace listing (skill or MCP plugin)
6034
+ *
6035
+ * The import runs asynchronously on the server. The user must have a verified
6036
+ * GitHub profile and the repository owner must match their GitHub username.
6037
+ *
6038
+ * @param params - The repository submission parameters
6039
+ * @param options - Optional request options (must include authentication)
6040
+ * @returns Promise resolving to the submission result
6041
+ */
6042
+ async submitRepo(params, options) {
6043
+ log30("Submitting repository for import: %s (%s)", params.gitUrl, params.type);
6044
+ const result = await this.request("/v1/user/claims/submit-repo", {
6045
+ body: JSON.stringify(params),
6046
+ headers: { "Content-Type": "application/json" },
6047
+ method: "POST",
6048
+ ...options
6049
+ });
6050
+ log30("Submit result for %s: %s", params.gitUrl, result.success);
6051
+ return result;
6052
+ }
5983
6053
  /**
5984
6054
  * Deletes an owned skill permanently
5985
6055
  *