@lobehub/market-sdk 0.38.0-beta.0 → 0.39.0-beta.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 +71 -2
- package/dist/index.mjs +71 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -2796,6 +2796,7 @@ interface TaskTemplateRecommendationQuery {
|
|
|
2796
2796
|
interestKeys: string[];
|
|
2797
2797
|
locale?: string;
|
|
2798
2798
|
refreshSeed?: string;
|
|
2799
|
+
seedKey?: string;
|
|
2799
2800
|
}
|
|
2800
2801
|
interface TaskTemplateRecommendationResponse {
|
|
2801
2802
|
items: TaskTemplateItem[];
|
|
@@ -7064,8 +7065,9 @@ declare class MarketTaskTemplateService extends BaseSDK {
|
|
|
7064
7065
|
/**
|
|
7065
7066
|
* Retrieves personalized task template recommendations.
|
|
7066
7067
|
*
|
|
7067
|
-
* Recommendations
|
|
7068
|
-
*
|
|
7068
|
+
* Recommendations use authenticated account identity when available, or the
|
|
7069
|
+
* provided anonymous seed key when calling without Market authentication.
|
|
7070
|
+
* Results are deterministic for the same seed, UTC day, and refresh seed.
|
|
7069
7071
|
*
|
|
7070
7072
|
* @param params - Recommendation inputs such as interests, count, enabled connectors, and refresh seed
|
|
7071
7073
|
* @param options - Optional request options
|
|
@@ -8020,6 +8022,37 @@ interface UpdateStatusResponse {
|
|
|
8020
8022
|
status: string;
|
|
8021
8023
|
success: boolean;
|
|
8022
8024
|
}
|
|
8025
|
+
/** Owner-provided localization for a single locale. */
|
|
8026
|
+
interface PluginLocalizationInput {
|
|
8027
|
+
description?: string;
|
|
8028
|
+
/** Locale code, e.g. "zh-CN", "ja-JP", "en-US" */
|
|
8029
|
+
locale: string;
|
|
8030
|
+
name?: string;
|
|
8031
|
+
summary?: string;
|
|
8032
|
+
tags?: string[];
|
|
8033
|
+
}
|
|
8034
|
+
interface PluginLocalizationItem {
|
|
8035
|
+
description: string;
|
|
8036
|
+
locale: string;
|
|
8037
|
+
name: string;
|
|
8038
|
+
summary: string | null;
|
|
8039
|
+
tags: string[];
|
|
8040
|
+
}
|
|
8041
|
+
interface PluginLocalizationsResponse {
|
|
8042
|
+
identifier: string;
|
|
8043
|
+
localizations: PluginLocalizationItem[];
|
|
8044
|
+
version: string;
|
|
8045
|
+
}
|
|
8046
|
+
interface UpsertPluginLocalizationsResponse {
|
|
8047
|
+
identifier: string;
|
|
8048
|
+
locales: string[];
|
|
8049
|
+
message: string;
|
|
8050
|
+
version: string;
|
|
8051
|
+
}
|
|
8052
|
+
interface DeletePluginLocalizationResponse {
|
|
8053
|
+
locale: string;
|
|
8054
|
+
success: boolean;
|
|
8055
|
+
}
|
|
8023
8056
|
interface PluginPublishData {
|
|
8024
8057
|
author?: string;
|
|
8025
8058
|
authorUrl?: string;
|
|
@@ -8028,6 +8061,8 @@ interface PluginPublishData {
|
|
|
8028
8061
|
description?: string;
|
|
8029
8062
|
homepage?: string;
|
|
8030
8063
|
icon?: string;
|
|
8064
|
+
/** Owner-provided per-locale translations (en-US also updates the version row) */
|
|
8065
|
+
localizations?: PluginLocalizationInput[];
|
|
8031
8066
|
name: string;
|
|
8032
8067
|
prompts?: Record<string, unknown>[];
|
|
8033
8068
|
resources?: Record<string, unknown>[];
|
|
@@ -8141,6 +8176,40 @@ declare class UserPublishService extends BaseSDK {
|
|
|
8141
8176
|
* @returns Promise resolving to the publish result
|
|
8142
8177
|
*/
|
|
8143
8178
|
publishPluginVersion(identifier: string, data: PluginPublishData, options?: globalThis.RequestInit): Promise<PublishVersionResponse>;
|
|
8179
|
+
/**
|
|
8180
|
+
* Lists the localizations of an owned plugin version
|
|
8181
|
+
*
|
|
8182
|
+
* @param identifier - The plugin identifier
|
|
8183
|
+
* @param version - Optional version (defaults to the latest version)
|
|
8184
|
+
* @param options - Optional request options (must include authentication)
|
|
8185
|
+
* @returns Promise resolving to the plugin's localizations
|
|
8186
|
+
*/
|
|
8187
|
+
getPluginLocalizations(identifier: string, version?: string, options?: globalThis.RequestInit): Promise<PluginLocalizationsResponse>;
|
|
8188
|
+
/**
|
|
8189
|
+
* Creates or updates owner-provided localizations for a plugin version.
|
|
8190
|
+
*
|
|
8191
|
+
* Merge semantics per locale: only supplied fields overwrite. Creating a brand
|
|
8192
|
+
* new locale requires both name and description. Editing en-US also updates
|
|
8193
|
+
* the version row (source of truth).
|
|
8194
|
+
*
|
|
8195
|
+
* @param identifier - The plugin identifier
|
|
8196
|
+
* @param localizations - Per-locale content to upsert
|
|
8197
|
+
* @param version - Optional version (defaults to the latest version)
|
|
8198
|
+
* @param options - Optional request options (must include authentication)
|
|
8199
|
+
* @returns Promise resolving to the upsert result
|
|
8200
|
+
*/
|
|
8201
|
+
updatePluginLocalizations(identifier: string, localizations: PluginLocalizationInput[], version?: string, options?: globalThis.RequestInit): Promise<UpsertPluginLocalizationsResponse>;
|
|
8202
|
+
/**
|
|
8203
|
+
* Deletes a single localization of a plugin version. The source locale (en-US)
|
|
8204
|
+
* cannot be deleted.
|
|
8205
|
+
*
|
|
8206
|
+
* @param identifier - The plugin identifier
|
|
8207
|
+
* @param locale - The locale to remove
|
|
8208
|
+
* @param version - Optional version (defaults to the latest version)
|
|
8209
|
+
* @param options - Optional request options (must include authentication)
|
|
8210
|
+
* @returns Promise resolving to the delete result
|
|
8211
|
+
*/
|
|
8212
|
+
deletePluginLocalization(identifier: string, locale: string, version?: string, options?: globalThis.RequestInit): Promise<DeletePluginLocalizationResponse>;
|
|
8144
8213
|
}
|
|
8145
8214
|
|
|
8146
8215
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -4413,8 +4413,9 @@ var MarketTaskTemplateService = class extends BaseSDK {
|
|
|
4413
4413
|
/**
|
|
4414
4414
|
* Retrieves personalized task template recommendations.
|
|
4415
4415
|
*
|
|
4416
|
-
* Recommendations
|
|
4417
|
-
*
|
|
4416
|
+
* Recommendations use authenticated account identity when available, or the
|
|
4417
|
+
* provided anonymous seed key when calling without Market authentication.
|
|
4418
|
+
* Results are deterministic for the same seed, UTC day, and refresh seed.
|
|
4418
4419
|
*
|
|
4419
4420
|
* @param params - Recommendation inputs such as interests, count, enabled connectors, and refresh seed
|
|
4420
4421
|
* @param options - Optional request options
|
|
@@ -4428,7 +4429,8 @@ var MarketTaskTemplateService = class extends BaseSDK {
|
|
|
4428
4429
|
excludeIds: params.excludeIds,
|
|
4429
4430
|
interestKeys: params.interestKeys,
|
|
4430
4431
|
locale,
|
|
4431
|
-
refreshSeed: params.refreshSeed
|
|
4432
|
+
refreshSeed: params.refreshSeed,
|
|
4433
|
+
seedKey: params.seedKey
|
|
4432
4434
|
};
|
|
4433
4435
|
log22("Getting task template recommendations: %O", body);
|
|
4434
4436
|
const result = await this.request(
|
|
@@ -6186,6 +6188,72 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6186
6188
|
log31("Published plugin version: %s@%s", identifier, result.version);
|
|
6187
6189
|
return result;
|
|
6188
6190
|
}
|
|
6191
|
+
/**
|
|
6192
|
+
* Lists the localizations of an owned plugin version
|
|
6193
|
+
*
|
|
6194
|
+
* @param identifier - The plugin identifier
|
|
6195
|
+
* @param version - Optional version (defaults to the latest version)
|
|
6196
|
+
* @param options - Optional request options (must include authentication)
|
|
6197
|
+
* @returns Promise resolving to the plugin's localizations
|
|
6198
|
+
*/
|
|
6199
|
+
async getPluginLocalizations(identifier, version, options) {
|
|
6200
|
+
var _a;
|
|
6201
|
+
log31("Listing localizations for plugin: %s", identifier);
|
|
6202
|
+
const query = version ? `?version=${encodeURIComponent(version)}` : "";
|
|
6203
|
+
const result = await this.request(
|
|
6204
|
+
`/v1/user/plugins/${encodeURIComponent(identifier)}/localizations${query}`,
|
|
6205
|
+
options
|
|
6206
|
+
);
|
|
6207
|
+
log31("Found %d localizations for %s", ((_a = result.localizations) == null ? void 0 : _a.length) || 0, identifier);
|
|
6208
|
+
return result;
|
|
6209
|
+
}
|
|
6210
|
+
/**
|
|
6211
|
+
* Creates or updates owner-provided localizations for a plugin version.
|
|
6212
|
+
*
|
|
6213
|
+
* Merge semantics per locale: only supplied fields overwrite. Creating a brand
|
|
6214
|
+
* new locale requires both name and description. Editing en-US also updates
|
|
6215
|
+
* the version row (source of truth).
|
|
6216
|
+
*
|
|
6217
|
+
* @param identifier - The plugin identifier
|
|
6218
|
+
* @param localizations - Per-locale content to upsert
|
|
6219
|
+
* @param version - Optional version (defaults to the latest version)
|
|
6220
|
+
* @param options - Optional request options (must include authentication)
|
|
6221
|
+
* @returns Promise resolving to the upsert result
|
|
6222
|
+
*/
|
|
6223
|
+
async updatePluginLocalizations(identifier, localizations, version, options) {
|
|
6224
|
+
log31("Upserting %d localization(s) for plugin: %s", localizations.length, identifier);
|
|
6225
|
+
const result = await this.request(
|
|
6226
|
+
`/v1/user/plugins/${encodeURIComponent(identifier)}/localizations`,
|
|
6227
|
+
{
|
|
6228
|
+
body: JSON.stringify({ localizations, version }),
|
|
6229
|
+
headers: { "Content-Type": "application/json" },
|
|
6230
|
+
method: "PUT",
|
|
6231
|
+
...options
|
|
6232
|
+
}
|
|
6233
|
+
);
|
|
6234
|
+
log31("Upserted localizations for %s@%s", identifier, result.version);
|
|
6235
|
+
return result;
|
|
6236
|
+
}
|
|
6237
|
+
/**
|
|
6238
|
+
* Deletes a single localization of a plugin version. The source locale (en-US)
|
|
6239
|
+
* cannot be deleted.
|
|
6240
|
+
*
|
|
6241
|
+
* @param identifier - The plugin identifier
|
|
6242
|
+
* @param locale - The locale to remove
|
|
6243
|
+
* @param version - Optional version (defaults to the latest version)
|
|
6244
|
+
* @param options - Optional request options (must include authentication)
|
|
6245
|
+
* @returns Promise resolving to the delete result
|
|
6246
|
+
*/
|
|
6247
|
+
async deletePluginLocalization(identifier, locale, version, options) {
|
|
6248
|
+
log31("Deleting localization %s for plugin: %s", locale, identifier);
|
|
6249
|
+
const query = version ? `?version=${encodeURIComponent(version)}` : "";
|
|
6250
|
+
const result = await this.request(
|
|
6251
|
+
`/v1/user/plugins/${encodeURIComponent(identifier)}/localizations/${encodeURIComponent(locale)}${query}`,
|
|
6252
|
+
{ method: "DELETE", ...options }
|
|
6253
|
+
);
|
|
6254
|
+
log31("Deleted localization %s for %s", locale, identifier);
|
|
6255
|
+
return result;
|
|
6256
|
+
}
|
|
6189
6257
|
};
|
|
6190
6258
|
|
|
6191
6259
|
// src/market/market-sdk.ts
|