@lobehub/market-sdk 0.32.0 → 0.32.1
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 +6 -1
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AgentItem, UserCredSummary, MarketItemBase, PluginConnectionType, InstallFailureAnalysisQuery, InstallFailureAnalysis, RangeQuery, RangeStats, TopPluginsQuery, TopPlugin, PluginManifest, AdminPluginItem, AdminPluginItemDetail, PluginVersion, PluginVersionLocalization, AdminDeploymentOption, InstallationDetails, SystemDependency, IncompleteI18nPlugin, BatchUpsertSkillCollectionLocalizationsRequest, SkillCollectionLocalizationBatchResponse, SkillCollectionLocalization, UpsertSkillCollectionLocalizationRequest, AgentEventRequest, SkillCredStatus, InjectCredsRequest, InjectCredsResponse, InjectCredsForSkillRequest, InjectCredsForSkillResponse, CategoryListQuery, CategoryItem, PluginItemDetail, InstallReportRequest, InstallReportResponse, CallReportRequest, CallReportResponse, PluginEventRequest, CloudGatewayRequest, CloudGatewayResponse } from '@lobehub/market-types';
|
|
2
|
+
import { AgentItem, UserCredSummary, MarketItemBase, PluginConnectionType, InstallFailureAnalysisQuery, InstallFailureAnalysis, RangeQuery, RangeStats, TopPluginsQuery, TopPlugin, PluginManifest, AdminPluginItem, AdminPluginItemDetail, PluginVersion, PluginVersionLocalization, AdminDeploymentOption, InstallationDetails, SystemDependency, IncompleteI18nPlugin, CreateSkillCollectionRequest, AdminSkillCollectionDetail, AdminSkillCollectionListQuery, AdminSkillCollectionListResponse, BatchUpsertSkillCollectionLocalizationsRequest, SkillCollectionLocalizationBatchResponse, SkillCollectionLocalization, UpdateSkillCollectionRequest, UpsertSkillCollectionLocalizationRequest, AgentEventRequest, SkillCredStatus, InjectCredsRequest, InjectCredsResponse, InjectCredsForSkillRequest, InjectCredsForSkillResponse, CategoryListQuery, CategoryItem, PluginItemDetail, InstallReportRequest, InstallReportResponse, CallReportRequest, CallReportResponse, PluginEventRequest, CloudGatewayRequest, CloudGatewayResponse } from '@lobehub/market-types';
|
|
3
3
|
export * from '@lobehub/market-types';
|
|
4
4
|
export { CategoryItem, CategoryListQuery, CategoryListResponse, CredType, InjectCredsForSkillRequest, InjectCredsForSkillResponse, InjectCredsRequest, InjectCredsResponse, InjectedFileInfo, SkillCredStatus, UserCredSummary } from '@lobehub/market-types';
|
|
5
5
|
import { JSONSchema7 } from 'json-schema';
|
|
@@ -4994,6 +4994,10 @@ declare class ReviewService extends BaseSDK {
|
|
|
4994
4994
|
}
|
|
4995
4995
|
|
|
4996
4996
|
declare class SkillCollectionService extends BaseSDK {
|
|
4997
|
+
createCollection(data: CreateSkillCollectionRequest): Promise<AdminSkillCollectionDetail>;
|
|
4998
|
+
deleteCollection(id: number): Promise<void>;
|
|
4999
|
+
getCollection(id: number): Promise<AdminSkillCollectionDetail>;
|
|
5000
|
+
getCollections(params?: AdminSkillCollectionListQuery): Promise<AdminSkillCollectionListResponse>;
|
|
4997
5001
|
batchUpsertLocalizations(collectionId: number, data: BatchUpsertSkillCollectionLocalizationsRequest): Promise<SkillCollectionLocalizationBatchResponse>;
|
|
4998
5002
|
deleteLocalization(collectionId: number, locale: string): Promise<{
|
|
4999
5003
|
message: string;
|
|
@@ -5001,6 +5005,7 @@ declare class SkillCollectionService extends BaseSDK {
|
|
|
5001
5005
|
}>;
|
|
5002
5006
|
getLocalization(collectionId: number, locale: string): Promise<SkillCollectionLocalization>;
|
|
5003
5007
|
getLocalizations(collectionId: number): Promise<SkillCollectionLocalization[]>;
|
|
5008
|
+
updateCollection(id: number, data: UpdateSkillCollectionRequest): Promise<AdminSkillCollectionDetail>;
|
|
5004
5009
|
upsertLocalization(collectionId: number, locale: string, data: UpsertSkillCollectionLocalizationRequest): Promise<SkillCollectionLocalization>;
|
|
5005
5010
|
}
|
|
5006
5011
|
|
package/dist/index.mjs
CHANGED
|
@@ -1515,6 +1515,39 @@ var ReviewService = class extends BaseSDK {
|
|
|
1515
1515
|
import debug8 from "debug";
|
|
1516
1516
|
var log8 = debug8("lobe-market-sdk:admin:skill-collections");
|
|
1517
1517
|
var SkillCollectionService = class extends BaseSDK {
|
|
1518
|
+
async createCollection(data) {
|
|
1519
|
+
log8("Creating skill collection: %O", data);
|
|
1520
|
+
const result = await this.request("/admin/skills/collections", {
|
|
1521
|
+
body: JSON.stringify(data),
|
|
1522
|
+
method: "POST"
|
|
1523
|
+
});
|
|
1524
|
+
log8("Created skill collection %d (%s)", result.id, result.slug);
|
|
1525
|
+
return result;
|
|
1526
|
+
}
|
|
1527
|
+
async deleteCollection(id) {
|
|
1528
|
+
log8("Deleting skill collection: %d", id);
|
|
1529
|
+
await this.request(`/admin/skills/collections/${id}`, {
|
|
1530
|
+
method: "DELETE"
|
|
1531
|
+
});
|
|
1532
|
+
log8("Deleted skill collection: %d", id);
|
|
1533
|
+
}
|
|
1534
|
+
async getCollection(id) {
|
|
1535
|
+
log8("Getting skill collection: %d", id);
|
|
1536
|
+
const result = await this.request(
|
|
1537
|
+
`/admin/skills/collections/${id}`
|
|
1538
|
+
);
|
|
1539
|
+
log8("Retrieved skill collection %d (%s)", result.id, result.slug);
|
|
1540
|
+
return result;
|
|
1541
|
+
}
|
|
1542
|
+
async getCollections(params = {}) {
|
|
1543
|
+
log8("Getting skill collections: %O", params);
|
|
1544
|
+
const queryString = this.buildQueryString(params);
|
|
1545
|
+
const result = await this.request(
|
|
1546
|
+
`/admin/skills/collections${queryString}`
|
|
1547
|
+
);
|
|
1548
|
+
log8("Retrieved %d skill collections", result.items.length);
|
|
1549
|
+
return result;
|
|
1550
|
+
}
|
|
1518
1551
|
async batchUpsertLocalizations(collectionId, data) {
|
|
1519
1552
|
log8("Batch upserting localizations for collection %d: %O", collectionId, data);
|
|
1520
1553
|
const result = await this.request(
|
|
@@ -1554,6 +1587,18 @@ var SkillCollectionService = class extends BaseSDK {
|
|
|
1554
1587
|
log8("Retrieved %d localizations for collection %d", result.length, collectionId);
|
|
1555
1588
|
return result;
|
|
1556
1589
|
}
|
|
1590
|
+
async updateCollection(id, data) {
|
|
1591
|
+
log8("Updating skill collection %d: %O", id, data);
|
|
1592
|
+
const result = await this.request(
|
|
1593
|
+
`/admin/skills/collections/${id}`,
|
|
1594
|
+
{
|
|
1595
|
+
body: JSON.stringify(data),
|
|
1596
|
+
method: "PUT"
|
|
1597
|
+
}
|
|
1598
|
+
);
|
|
1599
|
+
log8("Updated skill collection %d (%s)", result.id, result.slug);
|
|
1600
|
+
return result;
|
|
1601
|
+
}
|
|
1557
1602
|
async upsertLocalization(collectionId, locale, data) {
|
|
1558
1603
|
log8("Upserting localization for collection %d: %s %O", collectionId, locale, data);
|
|
1559
1604
|
const result = await this.request(
|