@lobehub/market-sdk 0.35.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;
@@ -8277,4 +8301,4 @@ declare function buildTrustedClientPayload(params: {
8277
8301
  workspaceId?: string;
8278
8302
  }): TrustedClientPayload;
8279
8303
 
8280
- 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 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 };
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
  *