@lobehub/market-sdk 0.35.0 → 0.37.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;
@@ -7932,6 +7956,37 @@ interface UpdateStatusResponse {
7932
7956
  status: string;
7933
7957
  success: boolean;
7934
7958
  }
7959
+ /** Owner-provided localization for a single locale. */
7960
+ interface PluginLocalizationInput {
7961
+ description?: string;
7962
+ /** Locale code, e.g. "zh-CN", "ja-JP", "en-US" */
7963
+ locale: string;
7964
+ name?: string;
7965
+ summary?: string;
7966
+ tags?: string[];
7967
+ }
7968
+ interface PluginLocalizationItem {
7969
+ description: string;
7970
+ locale: string;
7971
+ name: string;
7972
+ summary: string | null;
7973
+ tags: string[];
7974
+ }
7975
+ interface PluginLocalizationsResponse {
7976
+ identifier: string;
7977
+ localizations: PluginLocalizationItem[];
7978
+ version: string;
7979
+ }
7980
+ interface UpsertPluginLocalizationsResponse {
7981
+ identifier: string;
7982
+ locales: string[];
7983
+ message: string;
7984
+ version: string;
7985
+ }
7986
+ interface DeletePluginLocalizationResponse {
7987
+ locale: string;
7988
+ success: boolean;
7989
+ }
7935
7990
  interface PluginPublishData {
7936
7991
  author?: string;
7937
7992
  authorUrl?: string;
@@ -7940,6 +7995,8 @@ interface PluginPublishData {
7940
7995
  description?: string;
7941
7996
  homepage?: string;
7942
7997
  icon?: string;
7998
+ /** Owner-provided per-locale translations (en-US also updates the version row) */
7999
+ localizations?: PluginLocalizationInput[];
7943
8000
  name: string;
7944
8001
  prompts?: Record<string, unknown>[];
7945
8002
  resources?: Record<string, unknown>[];
@@ -8053,6 +8110,40 @@ declare class UserPublishService extends BaseSDK {
8053
8110
  * @returns Promise resolving to the publish result
8054
8111
  */
8055
8112
  publishPluginVersion(identifier: string, data: PluginPublishData, options?: globalThis.RequestInit): Promise<PublishVersionResponse>;
8113
+ /**
8114
+ * Lists the localizations of an owned plugin version
8115
+ *
8116
+ * @param identifier - The plugin identifier
8117
+ * @param version - Optional version (defaults to the latest version)
8118
+ * @param options - Optional request options (must include authentication)
8119
+ * @returns Promise resolving to the plugin's localizations
8120
+ */
8121
+ getPluginLocalizations(identifier: string, version?: string, options?: globalThis.RequestInit): Promise<PluginLocalizationsResponse>;
8122
+ /**
8123
+ * Creates or updates owner-provided localizations for a plugin version.
8124
+ *
8125
+ * Merge semantics per locale: only supplied fields overwrite. Creating a brand
8126
+ * new locale requires both name and description. Editing en-US also updates
8127
+ * the version row (source of truth).
8128
+ *
8129
+ * @param identifier - The plugin identifier
8130
+ * @param localizations - Per-locale content to upsert
8131
+ * @param version - Optional version (defaults to the latest version)
8132
+ * @param options - Optional request options (must include authentication)
8133
+ * @returns Promise resolving to the upsert result
8134
+ */
8135
+ updatePluginLocalizations(identifier: string, localizations: PluginLocalizationInput[], version?: string, options?: globalThis.RequestInit): Promise<UpsertPluginLocalizationsResponse>;
8136
+ /**
8137
+ * Deletes a single localization of a plugin version. The source locale (en-US)
8138
+ * cannot be deleted.
8139
+ *
8140
+ * @param identifier - The plugin identifier
8141
+ * @param locale - The locale to remove
8142
+ * @param version - Optional version (defaults to the latest version)
8143
+ * @param options - Optional request options (must include authentication)
8144
+ * @returns Promise resolving to the delete result
8145
+ */
8146
+ deletePluginLocalization(identifier: string, locale: string, version?: string, options?: globalThis.RequestInit): Promise<DeletePluginLocalizationResponse>;
8056
8147
  }
8057
8148
 
8058
8149
  /**
@@ -8277,4 +8368,4 @@ declare function buildTrustedClientPayload(params: {
8277
8368
  workspaceId?: string;
8278
8369
  }): TrustedClientPayload;
8279
8370
 
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 };
8371
+ 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
  *
@@ -6100,6 +6148,72 @@ var UserPublishService = class extends BaseSDK {
6100
6148
  log30("Published plugin version: %s@%s", identifier, result.version);
6101
6149
  return result;
6102
6150
  }
6151
+ /**
6152
+ * Lists the localizations of an owned plugin version
6153
+ *
6154
+ * @param identifier - The plugin identifier
6155
+ * @param version - Optional version (defaults to the latest version)
6156
+ * @param options - Optional request options (must include authentication)
6157
+ * @returns Promise resolving to the plugin's localizations
6158
+ */
6159
+ async getPluginLocalizations(identifier, version, options) {
6160
+ var _a;
6161
+ log30("Listing localizations for plugin: %s", identifier);
6162
+ const query = version ? `?version=${encodeURIComponent(version)}` : "";
6163
+ const result = await this.request(
6164
+ `/v1/user/plugins/${encodeURIComponent(identifier)}/localizations${query}`,
6165
+ options
6166
+ );
6167
+ log30("Found %d localizations for %s", ((_a = result.localizations) == null ? void 0 : _a.length) || 0, identifier);
6168
+ return result;
6169
+ }
6170
+ /**
6171
+ * Creates or updates owner-provided localizations for a plugin version.
6172
+ *
6173
+ * Merge semantics per locale: only supplied fields overwrite. Creating a brand
6174
+ * new locale requires both name and description. Editing en-US also updates
6175
+ * the version row (source of truth).
6176
+ *
6177
+ * @param identifier - The plugin identifier
6178
+ * @param localizations - Per-locale content to upsert
6179
+ * @param version - Optional version (defaults to the latest version)
6180
+ * @param options - Optional request options (must include authentication)
6181
+ * @returns Promise resolving to the upsert result
6182
+ */
6183
+ async updatePluginLocalizations(identifier, localizations, version, options) {
6184
+ log30("Upserting %d localization(s) for plugin: %s", localizations.length, identifier);
6185
+ const result = await this.request(
6186
+ `/v1/user/plugins/${encodeURIComponent(identifier)}/localizations`,
6187
+ {
6188
+ body: JSON.stringify({ localizations, version }),
6189
+ headers: { "Content-Type": "application/json" },
6190
+ method: "PUT",
6191
+ ...options
6192
+ }
6193
+ );
6194
+ log30("Upserted localizations for %s@%s", identifier, result.version);
6195
+ return result;
6196
+ }
6197
+ /**
6198
+ * Deletes a single localization of a plugin version. The source locale (en-US)
6199
+ * cannot be deleted.
6200
+ *
6201
+ * @param identifier - The plugin identifier
6202
+ * @param locale - The locale to remove
6203
+ * @param version - Optional version (defaults to the latest version)
6204
+ * @param options - Optional request options (must include authentication)
6205
+ * @returns Promise resolving to the delete result
6206
+ */
6207
+ async deletePluginLocalization(identifier, locale, version, options) {
6208
+ log30("Deleting localization %s for plugin: %s", locale, identifier);
6209
+ const query = version ? `?version=${encodeURIComponent(version)}` : "";
6210
+ const result = await this.request(
6211
+ `/v1/user/plugins/${encodeURIComponent(identifier)}/localizations/${encodeURIComponent(locale)}${query}`,
6212
+ { method: "DELETE", ...options }
6213
+ );
6214
+ log30("Deleted localization %s for %s", locale, identifier);
6215
+ return result;
6216
+ }
6103
6217
  };
6104
6218
 
6105
6219
  // src/market/market-sdk.ts