@lobehub/market-sdk 0.28.2 → 0.28.3
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 +93 -1
- package/dist/index.mjs +39 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1908,6 +1908,71 @@ interface UpdateUserInfoResponse {
|
|
|
1908
1908
|
/** Updated user profile */
|
|
1909
1909
|
user: UserProfile;
|
|
1910
1910
|
}
|
|
1911
|
+
/**
|
|
1912
|
+
* User Registration Request
|
|
1913
|
+
*
|
|
1914
|
+
* Request body for user registration via trust token
|
|
1915
|
+
*/
|
|
1916
|
+
interface RegisterUserRequest {
|
|
1917
|
+
/** User's avatar URL (optional) */
|
|
1918
|
+
avatarUrl?: string;
|
|
1919
|
+
/** User's display name (optional) */
|
|
1920
|
+
displayName?: string;
|
|
1921
|
+
/** User ID to follow after registration (optional) */
|
|
1922
|
+
followUserId?: string;
|
|
1923
|
+
/** Extended metadata (optional) */
|
|
1924
|
+
meta?: AccountMeta;
|
|
1925
|
+
/** The Clerk user ID to register (required) */
|
|
1926
|
+
registerUserId: string;
|
|
1927
|
+
/** Unique username (optional) */
|
|
1928
|
+
userName?: string;
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Registered User Profile
|
|
1932
|
+
*
|
|
1933
|
+
* User profile returned after registration
|
|
1934
|
+
*/
|
|
1935
|
+
interface RegisteredUserProfile {
|
|
1936
|
+
/** User's avatar URL */
|
|
1937
|
+
avatarUrl: string | null;
|
|
1938
|
+
/** Clerk user ID */
|
|
1939
|
+
clerkId: string | null;
|
|
1940
|
+
/** Account creation timestamp */
|
|
1941
|
+
createdAt: string;
|
|
1942
|
+
/** User's display name */
|
|
1943
|
+
displayName: string | null;
|
|
1944
|
+
/** User's email */
|
|
1945
|
+
email: string | null;
|
|
1946
|
+
/** Whether email is verified */
|
|
1947
|
+
emailVerified: boolean | null;
|
|
1948
|
+
/** Number of followers */
|
|
1949
|
+
followerCount: number;
|
|
1950
|
+
/** Number of users this user is following */
|
|
1951
|
+
followingCount: number;
|
|
1952
|
+
/** Account ID (primary key) */
|
|
1953
|
+
id: number;
|
|
1954
|
+
/** Extended metadata for user profile */
|
|
1955
|
+
meta: AccountMeta | null;
|
|
1956
|
+
/** User's unique namespace */
|
|
1957
|
+
namespace: string;
|
|
1958
|
+
/** Account type (user or organization) */
|
|
1959
|
+
type: string | null;
|
|
1960
|
+
/** Unique username */
|
|
1961
|
+
userName: string | null;
|
|
1962
|
+
}
|
|
1963
|
+
/**
|
|
1964
|
+
* User Registration Response
|
|
1965
|
+
*
|
|
1966
|
+
* Response structure for user registration endpoint
|
|
1967
|
+
*/
|
|
1968
|
+
interface RegisterUserResponse {
|
|
1969
|
+
/** Whether this is a newly created account */
|
|
1970
|
+
created: boolean;
|
|
1971
|
+
/** Whether the registration was successful */
|
|
1972
|
+
success: boolean;
|
|
1973
|
+
/** Registered user profile */
|
|
1974
|
+
user: RegisteredUserProfile;
|
|
1975
|
+
}
|
|
1911
1976
|
/**
|
|
1912
1977
|
* Follow Request
|
|
1913
1978
|
*
|
|
@@ -4308,6 +4373,33 @@ declare class UserService extends BaseSDK {
|
|
|
4308
4373
|
* @throws Error if userName is already taken or update fails
|
|
4309
4374
|
*/
|
|
4310
4375
|
updateUserInfo(data: UpdateUserInfoRequest, options?: globalThis.RequestInit): Promise<UpdateUserInfoResponse>;
|
|
4376
|
+
/**
|
|
4377
|
+
* Registers a new user via trust token authentication
|
|
4378
|
+
*
|
|
4379
|
+
* This endpoint ONLY accepts x-lobe-trust-token header authentication (Bearer tokens are not supported).
|
|
4380
|
+
* User information (email, username) is automatically fetched from app.lobehub.com.
|
|
4381
|
+
* If the user already exists (by email or userId), returns the existing user info.
|
|
4382
|
+
*
|
|
4383
|
+
* @param data - Registration data including registerUserId (required) and optional followUserId
|
|
4384
|
+
* @param options - Optional request options (must include x-lobe-trust-token header)
|
|
4385
|
+
* @returns Promise resolving to the registration response with user profile
|
|
4386
|
+
* @throws Error if user is banned, follow user is banned, or registration fails
|
|
4387
|
+
*
|
|
4388
|
+
* @example
|
|
4389
|
+
* ```typescript
|
|
4390
|
+
* const result = await userService.register({
|
|
4391
|
+
* registerUserId: 'user_abc123',
|
|
4392
|
+
* followUserId: 'user_xyz789', // Optional
|
|
4393
|
+
* displayName: 'John Doe',
|
|
4394
|
+
* userName: 'johndoe'
|
|
4395
|
+
* }, {
|
|
4396
|
+
* headers: {
|
|
4397
|
+
* 'x-lobe-trust-token': trustToken
|
|
4398
|
+
* }
|
|
4399
|
+
* });
|
|
4400
|
+
* ```
|
|
4401
|
+
*/
|
|
4402
|
+
register(data: RegisterUserRequest, options?: globalThis.RequestInit): Promise<RegisterUserResponse>;
|
|
4311
4403
|
}
|
|
4312
4404
|
|
|
4313
4405
|
/**
|
|
@@ -4772,4 +4864,4 @@ declare function buildTrustedClientPayload(params: {
|
|
|
4772
4864
|
userId: string;
|
|
4773
4865
|
}): TrustedClientPayload;
|
|
4774
4866
|
|
|
4775
|
-
export { type AccountMeta, type AdminListQueryParams, type AdminListResponse, type AdminPluginParams, type AgentCreateRequest, type AgentCreateResponse, type AgentDetailQuery, type AgentExtension, type AgentInstallCountRequest, type AgentInstallCountResponse, type AgentInterface, type AgentItemDetail, type AgentListQuery, type AgentListResponse, type AgentModifyRequest, type AgentModifyResponse, 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 ClientRegistrationError, type ClientRegistrationRequest, type ClientRegistrationResponse, type CodeInterpreterToolName, type CodeInterpreterToolParams, type ConnectProvider, type ConnectProviderDetail, type ConnectProviderScopes, type ConnectionHealth, type ConnectionStats, 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 GetSkillStatusResponse, type GetSkillToolResponse, type GlobLocalFilesParams, type GrepContentParams, type InteractionTargetType, type KillCommandParams, type LikeListResponse, type LikeQuery, type LikeRequest, type ListConnectProvidersResponse, type ListConnectionsResponse, type ListLocalFilesParams, type ListSkillProvidersResponse, type ListSkillToolsResponse, MarketAPIError, MarketAdmin, MarketSDK, type MarketSDKOptions, type MoveLocalFilesParams, type MoveOperation, type OAuthConnection, type OAuthTokenResponse, type OwnAgentListQuery, type PaginationQuery, type PluginI18nImportParams, type PluginI18nImportResponse, type PluginItem, type PluginListResponse, type PluginLocalization, type PluginQueryParams, type PluginUpdateParams, type PluginVersionCreateParams, type PluginVersionUpdateParams, type ProgrammingLanguage, type ReadLocalFileParams, type RefreshConnectionResponse, type RefreshTokenRequest, type RenameLocalFileParams, type ReviewStatus, ReviewStatusEnumSchema, type RevokeConnectionResponse, type RunBuildInToolsError, type RunBuildInToolsRequest, type RunBuildInToolsResponse, type RunBuildInToolsSuccessData, type RunCommandParams, type SearchLocalFilesParams, type SharedTokenState, type SkillCallParams, type SkillErrorResponse, type SkillProviderInfo, type SkillProviderStatus, type SkillTool, StatusEnumSchema, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SuccessResponse, type ToggleLikeResponse, type TrustedClientPayload, type UnclaimedPluginItem, type UpdateUserInfoRequest, type UpdateUserInfoResponse, type UserAgentItem, type UserInfoQuery, type UserInfoResponse, type UserProfile, VisibilityEnumSchema, type WriteLocalFileParams, buildTrustedClientPayload, createTrustedClientToken, generateNonce };
|
|
4867
|
+
export { type AccountMeta, type AdminListQueryParams, type AdminListResponse, type AdminPluginParams, type AgentCreateRequest, type AgentCreateResponse, type AgentDetailQuery, type AgentExtension, type AgentInstallCountRequest, type AgentInstallCountResponse, type AgentInterface, type AgentItemDetail, type AgentListQuery, type AgentListResponse, type AgentModifyRequest, type AgentModifyResponse, 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 ClientRegistrationError, type ClientRegistrationRequest, type ClientRegistrationResponse, type CodeInterpreterToolName, type CodeInterpreterToolParams, type ConnectProvider, type ConnectProviderDetail, type ConnectProviderScopes, type ConnectionHealth, type ConnectionStats, 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 GetSkillStatusResponse, type GetSkillToolResponse, type GlobLocalFilesParams, type GrepContentParams, type InteractionTargetType, type KillCommandParams, type LikeListResponse, type LikeQuery, type LikeRequest, type ListConnectProvidersResponse, type ListConnectionsResponse, type ListLocalFilesParams, type ListSkillProvidersResponse, type ListSkillToolsResponse, MarketAPIError, MarketAdmin, MarketSDK, type MarketSDKOptions, type MoveLocalFilesParams, type MoveOperation, type OAuthConnection, type OAuthTokenResponse, type OwnAgentListQuery, type PaginationQuery, type PluginI18nImportParams, type PluginI18nImportResponse, type PluginItem, type PluginListResponse, type PluginLocalization, type PluginQueryParams, 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, type SearchLocalFilesParams, type SharedTokenState, type SkillCallParams, type SkillErrorResponse, type SkillProviderInfo, type SkillProviderStatus, type SkillTool, StatusEnumSchema, type SubmitFeedbackRequest, type SubmitFeedbackResponse, type SuccessResponse, type ToggleLikeResponse, type TrustedClientPayload, type UnclaimedPluginItem, type UpdateUserInfoRequest, type UpdateUserInfoResponse, type UserAgentItem, type UserInfoQuery, type UserInfoResponse, type UserProfile, VisibilityEnumSchema, type WriteLocalFileParams, buildTrustedClientPayload, createTrustedClientToken, generateNonce };
|
package/dist/index.mjs
CHANGED
|
@@ -3114,6 +3114,45 @@ var UserService = class extends BaseSDK {
|
|
|
3114
3114
|
log17("User info updated successfully");
|
|
3115
3115
|
return result;
|
|
3116
3116
|
}
|
|
3117
|
+
/**
|
|
3118
|
+
* Registers a new user via trust token authentication
|
|
3119
|
+
*
|
|
3120
|
+
* This endpoint ONLY accepts x-lobe-trust-token header authentication (Bearer tokens are not supported).
|
|
3121
|
+
* User information (email, username) is automatically fetched from app.lobehub.com.
|
|
3122
|
+
* If the user already exists (by email or userId), returns the existing user info.
|
|
3123
|
+
*
|
|
3124
|
+
* @param data - Registration data including registerUserId (required) and optional followUserId
|
|
3125
|
+
* @param options - Optional request options (must include x-lobe-trust-token header)
|
|
3126
|
+
* @returns Promise resolving to the registration response with user profile
|
|
3127
|
+
* @throws Error if user is banned, follow user is banned, or registration fails
|
|
3128
|
+
*
|
|
3129
|
+
* @example
|
|
3130
|
+
* ```typescript
|
|
3131
|
+
* const result = await userService.register({
|
|
3132
|
+
* registerUserId: 'user_abc123',
|
|
3133
|
+
* followUserId: 'user_xyz789', // Optional
|
|
3134
|
+
* displayName: 'John Doe',
|
|
3135
|
+
* userName: 'johndoe'
|
|
3136
|
+
* }, {
|
|
3137
|
+
* headers: {
|
|
3138
|
+
* 'x-lobe-trust-token': trustToken
|
|
3139
|
+
* }
|
|
3140
|
+
* });
|
|
3141
|
+
* ```
|
|
3142
|
+
*/
|
|
3143
|
+
async register(data, options) {
|
|
3144
|
+
log17("Registering user: %O", { registerUserId: data.registerUserId, followUserId: data.followUserId });
|
|
3145
|
+
const result = await this.request("/v1/user/register", {
|
|
3146
|
+
body: JSON.stringify(data),
|
|
3147
|
+
headers: {
|
|
3148
|
+
"Content-Type": "application/json"
|
|
3149
|
+
},
|
|
3150
|
+
method: "POST",
|
|
3151
|
+
...options
|
|
3152
|
+
});
|
|
3153
|
+
log17("User registered successfully: created=%s, userId=%s", result.created, result.user.clerkId);
|
|
3154
|
+
return result;
|
|
3155
|
+
}
|
|
3117
3156
|
};
|
|
3118
3157
|
|
|
3119
3158
|
// src/market/services/UserFollowService.ts
|