@lobehub/market-sdk 0.42.0 → 0.44.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 +88 -5
- package/dist/index.mjs +302 -202
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2062,6 +2062,10 @@ var SandboxStorageService = class extends BaseSDK {
|
|
|
2062
2062
|
list(params = {}) {
|
|
2063
2063
|
return this.request(`/admin/sandbox-storage${this.buildQueryString(params)}`);
|
|
2064
2064
|
}
|
|
2065
|
+
/** Usage added up per workspace: its shared disk plus every member's own disk. */
|
|
2066
|
+
listWorkspaces(params = {}) {
|
|
2067
|
+
return this.request(`/admin/sandbox-storage/workspaces${this.buildQueryString(params)}`);
|
|
2068
|
+
}
|
|
2065
2069
|
get(key) {
|
|
2066
2070
|
return this.request(`/admin/sandbox-storage/${encodeURIComponent(key)}`);
|
|
2067
2071
|
}
|
|
@@ -2102,7 +2106,7 @@ var MarketAdmin = class extends BaseSDK {
|
|
|
2102
2106
|
|
|
2103
2107
|
// src/market/market-sdk.ts
|
|
2104
2108
|
import { getAssetImagePath, getAssetInitialPath } from "@lobehub/market-types";
|
|
2105
|
-
import
|
|
2109
|
+
import debug39 from "debug";
|
|
2106
2110
|
|
|
2107
2111
|
// src/market/services/AgentProfileService.ts
|
|
2108
2112
|
import debug15 from "debug";
|
|
@@ -4660,15 +4664,72 @@ var PluginsService = class extends BaseSDK {
|
|
|
4660
4664
|
}
|
|
4661
4665
|
};
|
|
4662
4666
|
|
|
4663
|
-
// src/market/services/
|
|
4667
|
+
// src/market/services/SandboxService.ts
|
|
4664
4668
|
import debug25 from "debug";
|
|
4665
|
-
var log25 = debug25("lobe-market-sdk:sandbox
|
|
4669
|
+
var log25 = debug25("lobe-market-sdk:sandbox");
|
|
4670
|
+
function encodeBase642(input) {
|
|
4671
|
+
if (typeof Buffer !== "undefined") {
|
|
4672
|
+
return Buffer.from(input, "utf8").toString("base64");
|
|
4673
|
+
}
|
|
4674
|
+
const bytes = new TextEncoder().encode(input);
|
|
4675
|
+
let binary = "";
|
|
4676
|
+
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
4677
|
+
return btoa(binary);
|
|
4678
|
+
}
|
|
4679
|
+
var SandboxService = class extends BaseSDK {
|
|
4680
|
+
/**
|
|
4681
|
+
* Run a script once in a fresh sandbox and return its output.
|
|
4682
|
+
*
|
|
4683
|
+
* A non-zero `exitCode` or `timedOut: true` is a normal result, not an error.
|
|
4684
|
+
* Non-2xx responses (validation, `rate_limited`, `sandbox_unavailable`, …)
|
|
4685
|
+
* throw like every other SDK call.
|
|
4686
|
+
*
|
|
4687
|
+
* @example
|
|
4688
|
+
* ```typescript
|
|
4689
|
+
* const result = await sdk.sandbox.run({
|
|
4690
|
+
* egress: {
|
|
4691
|
+
* allow: ['api.github.com'],
|
|
4692
|
+
* inject: [{ header: 'Authorization', host: 'api.github.com', prefix: 'Bearer ', secretRef: { key: 'github' } }],
|
|
4693
|
+
* },
|
|
4694
|
+
* runtime: 'node',
|
|
4695
|
+
* script: 'const r = await fetch("https://api.github.com/user"); console.log(JSON.stringify(await r.json()))',
|
|
4696
|
+
* subject: { id: widgetId, kind: 'widget' },
|
|
4697
|
+
* timeoutMs: 20_000,
|
|
4698
|
+
* });
|
|
4699
|
+
* ```
|
|
4700
|
+
*/
|
|
4701
|
+
async run(params, options) {
|
|
4702
|
+
const { script, ...rest } = params;
|
|
4703
|
+
log25(
|
|
4704
|
+
"Running %s sandbox script for %s %s",
|
|
4705
|
+
params.runtime,
|
|
4706
|
+
params.subject.kind,
|
|
4707
|
+
params.subject.id
|
|
4708
|
+
);
|
|
4709
|
+
return this.request("/v1/sandbox/runs", {
|
|
4710
|
+
body: JSON.stringify({ ...rest, scriptB64: encodeBase642(script), scriptEncoding: "base64" }),
|
|
4711
|
+
headers: { "Content-Type": "application/json" },
|
|
4712
|
+
method: "POST",
|
|
4713
|
+
...options
|
|
4714
|
+
});
|
|
4715
|
+
}
|
|
4716
|
+
};
|
|
4717
|
+
|
|
4718
|
+
// src/market/services/SandboxStorageService.ts
|
|
4719
|
+
import debug26 from "debug";
|
|
4720
|
+
var log26 = debug26("lobe-market-sdk:sandbox-storage");
|
|
4666
4721
|
var SandboxStorageService2 = class extends BaseSDK {
|
|
4667
|
-
/**
|
|
4668
|
-
|
|
4669
|
-
|
|
4722
|
+
/**
|
|
4723
|
+
* Storage directory, quota and the last measured usage.
|
|
4724
|
+
*
|
|
4725
|
+
* `query.drives` also lists every disk in a workspace-billed storage's pool
|
|
4726
|
+
* with its stored figure (`workspaceDrives`), in this one read.
|
|
4727
|
+
*/
|
|
4728
|
+
async getStorage(key = "current", options, query) {
|
|
4729
|
+
log26("Getting sandbox storage: %s", key);
|
|
4730
|
+
const suffix = (query == null ? void 0 : query.drives) ? "?drives=true" : "";
|
|
4670
4731
|
const result = await this.request(
|
|
4671
|
-
`/v1/sandbox/storages/${encodeURIComponent(key)}`,
|
|
4732
|
+
`/v1/sandbox/storages/${encodeURIComponent(key)}${suffix}`,
|
|
4672
4733
|
{ ...options, method: "GET" }
|
|
4673
4734
|
);
|
|
4674
4735
|
return result.data;
|
|
@@ -4678,7 +4739,7 @@ var SandboxStorageService2 = class extends BaseSDK {
|
|
|
4678
4739
|
* whole directory, so call it on demand rather than on every render.
|
|
4679
4740
|
*/
|
|
4680
4741
|
async refreshUsage(key = "current", context2 = {}, options) {
|
|
4681
|
-
|
|
4742
|
+
log26("Refreshing sandbox storage usage: %s", key);
|
|
4682
4743
|
const result = await this.request(
|
|
4683
4744
|
`/v1/sandbox/storages/${encodeURIComponent(key)}/usage`,
|
|
4684
4745
|
{ ...options, body: JSON.stringify(context2), method: "POST" }
|
|
@@ -4687,7 +4748,7 @@ var SandboxStorageService2 = class extends BaseSDK {
|
|
|
4687
4748
|
}
|
|
4688
4749
|
async listFiles(params = {}, options) {
|
|
4689
4750
|
const { key = "current", path, recursive, topicId } = params;
|
|
4690
|
-
|
|
4751
|
+
log26("Listing sandbox storage files: %s/%s", key, path != null ? path : "");
|
|
4691
4752
|
const query = new URLSearchParams();
|
|
4692
4753
|
if (path) query.set("path", path);
|
|
4693
4754
|
if (recursive) query.set("recursive", "true");
|
|
@@ -4700,7 +4761,7 @@ var SandboxStorageService2 = class extends BaseSDK {
|
|
|
4700
4761
|
}
|
|
4701
4762
|
async readFile(params, options) {
|
|
4702
4763
|
const { key = "current", path, topicId } = params;
|
|
4703
|
-
|
|
4764
|
+
log26("Reading sandbox storage file: %s/%s", key, path);
|
|
4704
4765
|
const query = new URLSearchParams({ path });
|
|
4705
4766
|
if (topicId) query.set("topicId", topicId);
|
|
4706
4767
|
const result = await this.request(
|
|
@@ -4711,7 +4772,7 @@ var SandboxStorageService2 = class extends BaseSDK {
|
|
|
4711
4772
|
}
|
|
4712
4773
|
async writeFile(params, options) {
|
|
4713
4774
|
const { content, key = "current", path, topicId } = params;
|
|
4714
|
-
|
|
4775
|
+
log26("Writing sandbox storage file: %s/%s (%d bytes)", key, path, content.length);
|
|
4715
4776
|
const result = await this.request(
|
|
4716
4777
|
`/v1/sandbox/storages/${encodeURIComponent(key)}/file`,
|
|
4717
4778
|
{
|
|
@@ -4764,6 +4825,23 @@ var SandboxStorageService2 = class extends BaseSDK {
|
|
|
4764
4825
|
);
|
|
4765
4826
|
return result.data;
|
|
4766
4827
|
}
|
|
4828
|
+
/**
|
|
4829
|
+
* Stop the sandbox holding an instance and release it, instead of waiting for
|
|
4830
|
+
* the idle sweep. The sandbox is snapshotted first.
|
|
4831
|
+
*
|
|
4832
|
+
* Refused retryably with 503 `SNAPSHOT_IN_PROGRESS` while that snapshot is
|
|
4833
|
+
* still packing, and with 409 `INSTANCE_STARTING`, `INSTANCE_BUILDING` or
|
|
4834
|
+
* `INSTANCE_BUSY` while what holds it cannot be stopped yet. `stopped: false`
|
|
4835
|
+
* means nothing held the instance.
|
|
4836
|
+
*/
|
|
4837
|
+
async stopInstance(params, options) {
|
|
4838
|
+
const { key = "current", name } = params;
|
|
4839
|
+
const result = await this.request(
|
|
4840
|
+
`/v1/sandbox/storages/${encodeURIComponent(key)}/instances/${encodeURIComponent(name)}/stop`,
|
|
4841
|
+
{ ...options, method: "POST" }
|
|
4842
|
+
);
|
|
4843
|
+
return result.data;
|
|
4844
|
+
}
|
|
4767
4845
|
/**
|
|
4768
4846
|
* Delete an instance.
|
|
4769
4847
|
*
|
|
@@ -4788,7 +4866,7 @@ var SandboxStorageService2 = class extends BaseSDK {
|
|
|
4788
4866
|
*/
|
|
4789
4867
|
async createDirectory(params, options) {
|
|
4790
4868
|
const { key = "current", path, topicId } = params;
|
|
4791
|
-
|
|
4869
|
+
log26("Creating sandbox storage directory: %s/%s", key, path);
|
|
4792
4870
|
const result = await this.request(
|
|
4793
4871
|
`/v1/sandbox/storages/${encodeURIComponent(key)}/directory`,
|
|
4794
4872
|
{
|
|
@@ -4801,7 +4879,7 @@ var SandboxStorageService2 = class extends BaseSDK {
|
|
|
4801
4879
|
}
|
|
4802
4880
|
async deleteFile(params, options) {
|
|
4803
4881
|
const { key = "current", path, recursive, topicId } = params;
|
|
4804
|
-
|
|
4882
|
+
log26("Deleting sandbox storage path: %s/%s", key, path);
|
|
4805
4883
|
const query = new URLSearchParams({ path });
|
|
4806
4884
|
if (recursive) query.set("recursive", "true");
|
|
4807
4885
|
if (topicId) query.set("topicId", topicId);
|
|
@@ -4811,11 +4889,32 @@ var SandboxStorageService2 = class extends BaseSDK {
|
|
|
4811
4889
|
);
|
|
4812
4890
|
return result.data;
|
|
4813
4891
|
}
|
|
4892
|
+
/**
|
|
4893
|
+
* Rename or move a file or folder inside the storage.
|
|
4894
|
+
*
|
|
4895
|
+
* Never overwrites: an existing `newPath` is refused with 409
|
|
4896
|
+
* `FILE_ALREADY_EXISTS`. The destination folder must already exist.
|
|
4897
|
+
* Always runs in a sandbox session, so it is slower than the other file
|
|
4898
|
+
* operations on a deployment that serves those directly.
|
|
4899
|
+
*/
|
|
4900
|
+
async renameFile(params, options) {
|
|
4901
|
+
const { key = "current", newPath, path, topicId } = params;
|
|
4902
|
+
log26("Renaming sandbox storage path: %s/%s -> %s", key, path, newPath);
|
|
4903
|
+
const result = await this.request(
|
|
4904
|
+
`/v1/sandbox/storages/${encodeURIComponent(key)}/rename`,
|
|
4905
|
+
{
|
|
4906
|
+
...options,
|
|
4907
|
+
body: JSON.stringify({ newPath, path, topicId }),
|
|
4908
|
+
method: "POST"
|
|
4909
|
+
}
|
|
4910
|
+
);
|
|
4911
|
+
return result.data;
|
|
4912
|
+
}
|
|
4814
4913
|
};
|
|
4815
4914
|
|
|
4816
4915
|
// src/market/services/SkillService.ts
|
|
4817
|
-
import
|
|
4818
|
-
var
|
|
4916
|
+
import debug27 from "debug";
|
|
4917
|
+
var log27 = debug27("lobe-market-sdk:skill");
|
|
4819
4918
|
var SkillService2 = class extends BaseSDK {
|
|
4820
4919
|
/**
|
|
4821
4920
|
* Lists all available skill providers
|
|
@@ -4828,9 +4927,9 @@ var SkillService2 = class extends BaseSDK {
|
|
|
4828
4927
|
*/
|
|
4829
4928
|
async listProviders(options) {
|
|
4830
4929
|
var _a;
|
|
4831
|
-
|
|
4930
|
+
log27("Listing skill providers");
|
|
4832
4931
|
const result = await this.request("/v1/skill/providers", options);
|
|
4833
|
-
|
|
4932
|
+
log27("Found %d skill providers", ((_a = result.providers) == null ? void 0 : _a.length) || 0);
|
|
4834
4933
|
return result;
|
|
4835
4934
|
}
|
|
4836
4935
|
/**
|
|
@@ -4845,12 +4944,12 @@ var SkillService2 = class extends BaseSDK {
|
|
|
4845
4944
|
*/
|
|
4846
4945
|
async listTools(provider, options) {
|
|
4847
4946
|
var _a;
|
|
4848
|
-
|
|
4947
|
+
log27("Listing tools for provider: %s", provider);
|
|
4849
4948
|
const result = await this.request(
|
|
4850
4949
|
`/v1/skill/${encodeURIComponent(provider)}/tools`,
|
|
4851
4950
|
options
|
|
4852
4951
|
);
|
|
4853
|
-
|
|
4952
|
+
log27("Found %d tools for provider %s", ((_a = result.tools) == null ? void 0 : _a.length) || 0, provider);
|
|
4854
4953
|
return result;
|
|
4855
4954
|
}
|
|
4856
4955
|
/**
|
|
@@ -4867,12 +4966,12 @@ var SkillService2 = class extends BaseSDK {
|
|
|
4867
4966
|
*/
|
|
4868
4967
|
async listLiveTools(provider, options) {
|
|
4869
4968
|
var _a;
|
|
4870
|
-
|
|
4969
|
+
log27("Listing live tools for provider: %s", provider);
|
|
4871
4970
|
const result = await this.request(
|
|
4872
4971
|
`/v1/skill/${encodeURIComponent(provider)}/tools/live`,
|
|
4873
4972
|
options
|
|
4874
4973
|
);
|
|
4875
|
-
|
|
4974
|
+
log27("Found %d live tools for provider %s", ((_a = result.tools) == null ? void 0 : _a.length) || 0, provider);
|
|
4876
4975
|
return result;
|
|
4877
4976
|
}
|
|
4878
4977
|
/**
|
|
@@ -4888,12 +4987,12 @@ var SkillService2 = class extends BaseSDK {
|
|
|
4888
4987
|
*/
|
|
4889
4988
|
async getTool(provider, toolName, options) {
|
|
4890
4989
|
var _a;
|
|
4891
|
-
|
|
4990
|
+
log27("Getting tool %s from provider %s", toolName, provider);
|
|
4892
4991
|
const result = await this.request(
|
|
4893
4992
|
`/v1/skill/${encodeURIComponent(provider)}/tool/${encodeURIComponent(toolName)}`,
|
|
4894
4993
|
options
|
|
4895
4994
|
);
|
|
4896
|
-
|
|
4995
|
+
log27("Retrieved tool: %s", (_a = result.tool) == null ? void 0 : _a.name);
|
|
4897
4996
|
return result;
|
|
4898
4997
|
}
|
|
4899
4998
|
/**
|
|
@@ -4907,12 +5006,12 @@ var SkillService2 = class extends BaseSDK {
|
|
|
4907
5006
|
* @returns Promise resolving to the connection status
|
|
4908
5007
|
*/
|
|
4909
5008
|
async getStatus(provider, options) {
|
|
4910
|
-
|
|
5009
|
+
log27("Getting status for provider: %s", provider);
|
|
4911
5010
|
const result = await this.request(
|
|
4912
5011
|
`/v1/skill/${encodeURIComponent(provider)}/status`,
|
|
4913
5012
|
options
|
|
4914
5013
|
);
|
|
4915
|
-
|
|
5014
|
+
log27("Provider %s status: connected=%s", provider, result.connected);
|
|
4916
5015
|
return result;
|
|
4917
5016
|
}
|
|
4918
5017
|
/**
|
|
@@ -4940,7 +5039,7 @@ var SkillService2 = class extends BaseSDK {
|
|
|
4940
5039
|
* ```
|
|
4941
5040
|
*/
|
|
4942
5041
|
async callTool(provider, params, options) {
|
|
4943
|
-
|
|
5042
|
+
log27("Calling tool %s on provider %s", params.tool, provider);
|
|
4944
5043
|
const { args, tool, ...rest } = params;
|
|
4945
5044
|
const result = await this.request(
|
|
4946
5045
|
`/v1/skill/${encodeURIComponent(provider)}/call`,
|
|
@@ -4957,14 +5056,14 @@ var SkillService2 = class extends BaseSDK {
|
|
|
4957
5056
|
...options
|
|
4958
5057
|
}
|
|
4959
5058
|
);
|
|
4960
|
-
|
|
5059
|
+
log27("Tool %s call completed: success=%s", params.tool, result.success);
|
|
4961
5060
|
return result;
|
|
4962
5061
|
}
|
|
4963
5062
|
};
|
|
4964
5063
|
|
|
4965
5064
|
// src/market/services/MarketTaskTemplateService.ts
|
|
4966
|
-
import
|
|
4967
|
-
var
|
|
5065
|
+
import debug28 from "debug";
|
|
5066
|
+
var log28 = debug28("lobe-market-sdk:task-templates");
|
|
4968
5067
|
var MarketTaskTemplateService = class extends BaseSDK {
|
|
4969
5068
|
/**
|
|
4970
5069
|
* Retrieves personalized task template recommendations.
|
|
@@ -4987,7 +5086,7 @@ var MarketTaskTemplateService = class extends BaseSDK {
|
|
|
4987
5086
|
refreshSeed: params.refreshSeed,
|
|
4988
5087
|
seedKey: params.seedKey
|
|
4989
5088
|
};
|
|
4990
|
-
|
|
5089
|
+
log28("Getting task template recommendations: %O", body);
|
|
4991
5090
|
const result = await this.request(
|
|
4992
5091
|
"/v1/task-templates/recommendations",
|
|
4993
5092
|
{
|
|
@@ -4996,14 +5095,14 @@ var MarketTaskTemplateService = class extends BaseSDK {
|
|
|
4996
5095
|
method: "POST"
|
|
4997
5096
|
}
|
|
4998
5097
|
);
|
|
4999
|
-
|
|
5098
|
+
log28("Retrieved %d task template recommendations", result.items.length);
|
|
5000
5099
|
return result;
|
|
5001
5100
|
}
|
|
5002
5101
|
};
|
|
5003
5102
|
|
|
5004
5103
|
// src/market/services/MarketSkillCollectionService.ts
|
|
5005
|
-
import
|
|
5006
|
-
var
|
|
5104
|
+
import debug29 from "debug";
|
|
5105
|
+
var log29 = debug29("lobe-market-sdk:skill-collections");
|
|
5007
5106
|
var MarketSkillCollectionService = class extends BaseSDK {
|
|
5008
5107
|
async getSkillCollectionDetail(slug, params = {}, options) {
|
|
5009
5108
|
const locale = params.locale || this.defaultLocale;
|
|
@@ -5012,12 +5111,12 @@ var MarketSkillCollectionService = class extends BaseSDK {
|
|
|
5012
5111
|
locale
|
|
5013
5112
|
};
|
|
5014
5113
|
const queryString = this.buildQueryString(queryParams);
|
|
5015
|
-
|
|
5114
|
+
log29("Getting skill collection detail: %s %O", slug, queryParams);
|
|
5016
5115
|
const result = await this.request(
|
|
5017
5116
|
`/v1/skills/collections/${encodeURIComponent(slug)}${queryString}`,
|
|
5018
5117
|
options
|
|
5019
5118
|
);
|
|
5020
|
-
|
|
5119
|
+
log29("Skill collection detail retrieved: %s (%d items)", slug, result.items.length);
|
|
5021
5120
|
return result;
|
|
5022
5121
|
}
|
|
5023
5122
|
async getSkillCollections(params = {}, options) {
|
|
@@ -5027,19 +5126,19 @@ var MarketSkillCollectionService = class extends BaseSDK {
|
|
|
5027
5126
|
locale
|
|
5028
5127
|
};
|
|
5029
5128
|
const queryString = this.buildQueryString(queryParams);
|
|
5030
|
-
|
|
5129
|
+
log29("Getting skill collections: %O", queryParams);
|
|
5031
5130
|
const result = await this.request(
|
|
5032
5131
|
`/v1/skills/collections${queryString}`,
|
|
5033
5132
|
options
|
|
5034
5133
|
);
|
|
5035
|
-
|
|
5134
|
+
log29("Retrieved %d skill collections", result.length);
|
|
5036
5135
|
return result;
|
|
5037
5136
|
}
|
|
5038
5137
|
};
|
|
5039
5138
|
|
|
5040
5139
|
// src/market/services/MarketSkillService.ts
|
|
5041
|
-
import
|
|
5042
|
-
var
|
|
5140
|
+
import debug30 from "debug";
|
|
5141
|
+
var log30 = debug30("lobe-market-sdk:market-skills");
|
|
5043
5142
|
var MarketSkillService = class extends BaseSDK {
|
|
5044
5143
|
/**
|
|
5045
5144
|
* Retrieves a list of skills from the marketplace
|
|
@@ -5074,9 +5173,9 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5074
5173
|
const locale = params.locale || this.defaultLocale;
|
|
5075
5174
|
const queryParams = { ...params, locale };
|
|
5076
5175
|
const queryString = this.buildQueryString(queryParams);
|
|
5077
|
-
|
|
5176
|
+
log30("Getting skill list: %O", queryParams);
|
|
5078
5177
|
const result = await this.request(`/v1/skills${queryString}`, options);
|
|
5079
|
-
|
|
5178
|
+
log30(
|
|
5080
5179
|
"Retrieved %d skills (page %d/%d)",
|
|
5081
5180
|
result.items.length,
|
|
5082
5181
|
result.currentPage,
|
|
@@ -5115,12 +5214,12 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5115
5214
|
queryParams.version = params.version;
|
|
5116
5215
|
}
|
|
5117
5216
|
const queryString = this.buildQueryString(queryParams);
|
|
5118
|
-
|
|
5217
|
+
log30("Getting skill detail: %s %O", identifier, params);
|
|
5119
5218
|
const result = await this.request(
|
|
5120
5219
|
`/v1/skills/${encodeURIComponent(identifier)}${queryString}`,
|
|
5121
5220
|
options
|
|
5122
5221
|
);
|
|
5123
|
-
|
|
5222
|
+
log30("Skill detail retrieved: %s (v%s)", identifier, result.version);
|
|
5124
5223
|
return result;
|
|
5125
5224
|
}
|
|
5126
5225
|
/**
|
|
@@ -5151,7 +5250,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5151
5250
|
if (version) {
|
|
5152
5251
|
url += `?version=${encodeURIComponent(version)}`;
|
|
5153
5252
|
}
|
|
5154
|
-
|
|
5253
|
+
log30("Generated download URL: %s", url);
|
|
5155
5254
|
return url;
|
|
5156
5255
|
}
|
|
5157
5256
|
/**
|
|
@@ -5175,7 +5274,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5175
5274
|
* ```
|
|
5176
5275
|
*/
|
|
5177
5276
|
async downloadSkill(identifier, version, options) {
|
|
5178
|
-
|
|
5277
|
+
log30("Downloading skill: %s (version: %s)", identifier, version || "latest");
|
|
5179
5278
|
const queryParams = {};
|
|
5180
5279
|
if (version) {
|
|
5181
5280
|
queryParams.version = version;
|
|
@@ -5191,7 +5290,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5191
5290
|
});
|
|
5192
5291
|
if (!response.ok) {
|
|
5193
5292
|
const errorText = await response.text();
|
|
5194
|
-
|
|
5293
|
+
log30("Download failed: %s %s", response.status, errorText);
|
|
5195
5294
|
throw new Error(`Failed to download skill: ${response.statusText}`);
|
|
5196
5295
|
}
|
|
5197
5296
|
const contentDisposition = response.headers.get("content-disposition");
|
|
@@ -5203,7 +5302,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5203
5302
|
}
|
|
5204
5303
|
}
|
|
5205
5304
|
const buffer = await response.arrayBuffer();
|
|
5206
|
-
|
|
5305
|
+
log30("Downloaded skill: %s (%d bytes)", filename, buffer.byteLength);
|
|
5207
5306
|
return { buffer, filename };
|
|
5208
5307
|
}
|
|
5209
5308
|
/**
|
|
@@ -5231,12 +5330,12 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5231
5330
|
const locale = params.locale || this.defaultLocale;
|
|
5232
5331
|
const queryParams = { ...params, locale };
|
|
5233
5332
|
const queryString = this.buildQueryString(queryParams);
|
|
5234
|
-
|
|
5333
|
+
log30("Getting skill categories: %O", queryParams);
|
|
5235
5334
|
const result = await this.request(
|
|
5236
5335
|
`/v1/skills/categories${queryString}`,
|
|
5237
5336
|
options
|
|
5238
5337
|
);
|
|
5239
|
-
|
|
5338
|
+
log30("Retrieved %d categories", result.length);
|
|
5240
5339
|
return result;
|
|
5241
5340
|
}
|
|
5242
5341
|
/**
|
|
@@ -5251,12 +5350,12 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5251
5350
|
* @returns Promise resolving to an array of identifiers with last modified times
|
|
5252
5351
|
*/
|
|
5253
5352
|
async getPublishedIdentifiers(options) {
|
|
5254
|
-
|
|
5353
|
+
log30("Getting published skill identifiers");
|
|
5255
5354
|
const result = await this.request(
|
|
5256
5355
|
"/v1/skills/identifiers",
|
|
5257
5356
|
options
|
|
5258
5357
|
);
|
|
5259
|
-
|
|
5358
|
+
log30("Retrieved %d published skill identifiers", result.length);
|
|
5260
5359
|
return result;
|
|
5261
5360
|
}
|
|
5262
5361
|
/**
|
|
@@ -5267,9 +5366,9 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5267
5366
|
*/
|
|
5268
5367
|
async getSitemap(params = {}, options) {
|
|
5269
5368
|
const queryString = this.buildQueryString(params);
|
|
5270
|
-
|
|
5369
|
+
log30("Getting skill sitemap%s", queryString);
|
|
5271
5370
|
const result = await this.request(`/v1/skills/sitemap${queryString}`, options);
|
|
5272
|
-
|
|
5371
|
+
log30(
|
|
5273
5372
|
"Retrieved skill sitemap page %d/%d (%d items)",
|
|
5274
5373
|
result.currentPage,
|
|
5275
5374
|
result.totalPages,
|
|
@@ -5285,13 +5384,13 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5285
5384
|
* @returns Promise resolving to true if skill exists, false otherwise
|
|
5286
5385
|
*/
|
|
5287
5386
|
async checkSkillExists(identifier, options) {
|
|
5288
|
-
|
|
5387
|
+
log30("Checking if skill exists: %s", identifier);
|
|
5289
5388
|
try {
|
|
5290
5389
|
await this.getSkillDetail(identifier, {}, options);
|
|
5291
|
-
|
|
5390
|
+
log30("Skill exists: %s", identifier);
|
|
5292
5391
|
return true;
|
|
5293
5392
|
} catch (e) {
|
|
5294
|
-
|
|
5393
|
+
log30("Skill does not exist: %s", identifier);
|
|
5295
5394
|
return false;
|
|
5296
5395
|
}
|
|
5297
5396
|
}
|
|
@@ -5312,12 +5411,12 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5312
5411
|
* ```
|
|
5313
5412
|
*/
|
|
5314
5413
|
async getSkillVersions(identifier, options) {
|
|
5315
|
-
|
|
5414
|
+
log30("Getting skill versions: %s", identifier);
|
|
5316
5415
|
const result = await this.request(
|
|
5317
5416
|
`/v1/skills/${encodeURIComponent(identifier)}/versions`,
|
|
5318
5417
|
options
|
|
5319
5418
|
);
|
|
5320
|
-
|
|
5419
|
+
log30("Retrieved %d versions for skill %s", result.data.length, identifier);
|
|
5321
5420
|
return result.data;
|
|
5322
5421
|
}
|
|
5323
5422
|
/**
|
|
@@ -5341,12 +5440,12 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5341
5440
|
const locale = params.locale || this.defaultLocale;
|
|
5342
5441
|
const queryParams = { locale };
|
|
5343
5442
|
const queryString = this.buildQueryString(queryParams);
|
|
5344
|
-
|
|
5443
|
+
log30("Getting skill version: %s@%s", identifier, version);
|
|
5345
5444
|
const result = await this.request(
|
|
5346
5445
|
`/v1/skills/${encodeURIComponent(identifier)}/versions/${encodeURIComponent(version)}${queryString}`,
|
|
5347
5446
|
options
|
|
5348
5447
|
);
|
|
5349
|
-
|
|
5448
|
+
log30("Skill version detail retrieved: %s@%s", identifier, version);
|
|
5350
5449
|
return result;
|
|
5351
5450
|
}
|
|
5352
5451
|
/**
|
|
@@ -5375,13 +5474,13 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5375
5474
|
* ```
|
|
5376
5475
|
*/
|
|
5377
5476
|
async reportGitHubSkill(params, options) {
|
|
5378
|
-
|
|
5477
|
+
log30("Reporting GitHub skill: %s", params.gitUrl);
|
|
5379
5478
|
const result = await this.request("/v1/skills/report/github", {
|
|
5380
5479
|
...options,
|
|
5381
5480
|
body: JSON.stringify(params),
|
|
5382
5481
|
method: "POST"
|
|
5383
5482
|
});
|
|
5384
|
-
|
|
5483
|
+
log30("GitHub skill reported: %s (status: %s)", result.identifier, result.status);
|
|
5385
5484
|
return result;
|
|
5386
5485
|
}
|
|
5387
5486
|
/**
|
|
@@ -5406,7 +5505,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5406
5505
|
* ```
|
|
5407
5506
|
*/
|
|
5408
5507
|
async reportSkillInstall(params, options) {
|
|
5409
|
-
|
|
5508
|
+
log30("Reporting skill install: %s (success: %s)", params.identifier, params.success);
|
|
5410
5509
|
const result = await this.request(
|
|
5411
5510
|
"/v1/skills/report/installation",
|
|
5412
5511
|
{
|
|
@@ -5415,7 +5514,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5415
5514
|
method: "POST"
|
|
5416
5515
|
}
|
|
5417
5516
|
);
|
|
5418
|
-
|
|
5517
|
+
log30("Skill install reported: %s", result.message);
|
|
5419
5518
|
return result;
|
|
5420
5519
|
}
|
|
5421
5520
|
/**
|
|
@@ -5427,7 +5526,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5427
5526
|
* @returns Promise resolving to the submitted score
|
|
5428
5527
|
*/
|
|
5429
5528
|
async submitRating(identifier, score, options) {
|
|
5430
|
-
|
|
5529
|
+
log30("Submitting rating for skill %s: %d", identifier, score);
|
|
5431
5530
|
const result = await this.request(
|
|
5432
5531
|
`/v1/skills/${encodeURIComponent(identifier)}/ratings`,
|
|
5433
5532
|
{
|
|
@@ -5436,7 +5535,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5436
5535
|
method: "POST"
|
|
5437
5536
|
}
|
|
5438
5537
|
);
|
|
5439
|
-
|
|
5538
|
+
log30("Rating submitted for skill %s: %d", identifier, result.score);
|
|
5440
5539
|
return result;
|
|
5441
5540
|
}
|
|
5442
5541
|
/**
|
|
@@ -5447,12 +5546,12 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5447
5546
|
* @returns Promise resolving to the rating distribution
|
|
5448
5547
|
*/
|
|
5449
5548
|
async getRatingDistribution(identifier, options) {
|
|
5450
|
-
|
|
5549
|
+
log30("Getting rating distribution for skill: %s", identifier);
|
|
5451
5550
|
const result = await this.request(
|
|
5452
5551
|
`/v1/skills/${encodeURIComponent(identifier)}/ratings/distribution`,
|
|
5453
5552
|
options
|
|
5454
5553
|
);
|
|
5455
|
-
|
|
5554
|
+
log30("Rating distribution retrieved for skill %s: %d total", identifier, result.totalCount);
|
|
5456
5555
|
return result;
|
|
5457
5556
|
}
|
|
5458
5557
|
/**
|
|
@@ -5465,12 +5564,12 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5465
5564
|
*/
|
|
5466
5565
|
async getComments(identifier, params = {}, options) {
|
|
5467
5566
|
const queryString = this.buildQueryString(params);
|
|
5468
|
-
|
|
5567
|
+
log30("Getting comments for skill %s: %O", identifier, params);
|
|
5469
5568
|
const result = await this.request(
|
|
5470
5569
|
`/v1/skills/${encodeURIComponent(identifier)}/comments${queryString}`,
|
|
5471
5570
|
options
|
|
5472
5571
|
);
|
|
5473
|
-
|
|
5572
|
+
log30(
|
|
5474
5573
|
"Retrieved %d comments for skill %s (page %d/%d)",
|
|
5475
5574
|
result.items.length,
|
|
5476
5575
|
identifier,
|
|
@@ -5487,15 +5586,15 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5487
5586
|
* @returns Promise resolving to the latest own comment or null when none exists
|
|
5488
5587
|
*/
|
|
5489
5588
|
async getLatestOwnComment(identifier, options) {
|
|
5490
|
-
|
|
5589
|
+
log30("Getting latest own comment for skill %s", identifier);
|
|
5491
5590
|
const result = await this.request(
|
|
5492
5591
|
`/v1/skills/${encodeURIComponent(identifier)}/comments/latest`,
|
|
5493
5592
|
options
|
|
5494
5593
|
);
|
|
5495
5594
|
if (result) {
|
|
5496
|
-
|
|
5595
|
+
log30("Retrieved latest own comment for skill %s: id=%d", identifier, result.id);
|
|
5497
5596
|
} else {
|
|
5498
|
-
|
|
5597
|
+
log30("No own comments found for skill %s", identifier);
|
|
5499
5598
|
}
|
|
5500
5599
|
return result;
|
|
5501
5600
|
}
|
|
@@ -5508,7 +5607,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5508
5607
|
* @returns Promise resolving to the created comment (with optional rating field)
|
|
5509
5608
|
*/
|
|
5510
5609
|
async createComment(identifier, data, options) {
|
|
5511
|
-
|
|
5610
|
+
log30("Creating comment on skill %s", identifier);
|
|
5512
5611
|
const result = await this.request(
|
|
5513
5612
|
`/v1/skills/${encodeURIComponent(identifier)}/comments`,
|
|
5514
5613
|
{
|
|
@@ -5517,7 +5616,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5517
5616
|
method: "POST"
|
|
5518
5617
|
}
|
|
5519
5618
|
);
|
|
5520
|
-
|
|
5619
|
+
log30("Comment created on skill %s: id=%d", identifier, result.id);
|
|
5521
5620
|
return result;
|
|
5522
5621
|
}
|
|
5523
5622
|
/**
|
|
@@ -5529,7 +5628,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5529
5628
|
* @returns Promise resolving to success status
|
|
5530
5629
|
*/
|
|
5531
5630
|
async deleteComment(identifier, commentId, options) {
|
|
5532
|
-
|
|
5631
|
+
log30("Deleting comment %d from skill %s", commentId, identifier);
|
|
5533
5632
|
const result = await this.request(
|
|
5534
5633
|
`/v1/skills/${encodeURIComponent(identifier)}/comments/${commentId}`,
|
|
5535
5634
|
{
|
|
@@ -5537,7 +5636,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5537
5636
|
method: "DELETE"
|
|
5538
5637
|
}
|
|
5539
5638
|
);
|
|
5540
|
-
|
|
5639
|
+
log30("Comment %d deleted from skill %s", commentId, identifier);
|
|
5541
5640
|
return result;
|
|
5542
5641
|
}
|
|
5543
5642
|
/**
|
|
@@ -5549,7 +5648,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5549
5648
|
* @returns Promise resolving to the created reaction
|
|
5550
5649
|
*/
|
|
5551
5650
|
async addReaction(commentId, type, options) {
|
|
5552
|
-
|
|
5651
|
+
log30("Adding %s reaction to comment %d", type, commentId);
|
|
5553
5652
|
const result = await this.request(
|
|
5554
5653
|
`/v1/skills/comments/${commentId}/reactions`,
|
|
5555
5654
|
{
|
|
@@ -5558,7 +5657,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5558
5657
|
method: "POST"
|
|
5559
5658
|
}
|
|
5560
5659
|
);
|
|
5561
|
-
|
|
5660
|
+
log30("Reaction added to comment %d: %s (id=%d)", commentId, result.type, result.id);
|
|
5562
5661
|
return result;
|
|
5563
5662
|
}
|
|
5564
5663
|
/**
|
|
@@ -5569,7 +5668,7 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5569
5668
|
* @returns Promise resolving to success status
|
|
5570
5669
|
*/
|
|
5571
5670
|
async removeReaction(commentId, options) {
|
|
5572
|
-
|
|
5671
|
+
log30("Removing reaction from comment %d", commentId);
|
|
5573
5672
|
const result = await this.request(
|
|
5574
5673
|
`/v1/skills/comments/${commentId}/reactions`,
|
|
5575
5674
|
{
|
|
@@ -5577,19 +5676,19 @@ var MarketSkillService = class extends BaseSDK {
|
|
|
5577
5676
|
method: "DELETE"
|
|
5578
5677
|
}
|
|
5579
5678
|
);
|
|
5580
|
-
|
|
5679
|
+
log30("Reaction removed from comment %d", commentId);
|
|
5581
5680
|
return result;
|
|
5582
5681
|
}
|
|
5583
5682
|
};
|
|
5584
5683
|
|
|
5585
5684
|
// src/market/services/OrganizationCredsService.ts
|
|
5586
|
-
import
|
|
5685
|
+
import debug31 from "debug";
|
|
5587
5686
|
|
|
5588
5687
|
// src/utils/orgRef.ts
|
|
5589
5688
|
var orgRefToPathSegment = (ref) => typeof ref === "number" ? String(ref) : `workspace:${encodeURIComponent(ref.workspaceId)}`;
|
|
5590
5689
|
|
|
5591
5690
|
// src/market/services/OrganizationCredsService.ts
|
|
5592
|
-
var
|
|
5691
|
+
var log31 = debug31("lobe-market-sdk:org-creds");
|
|
5593
5692
|
var OrganizationCredsService = class extends BaseSDK {
|
|
5594
5693
|
constructor(orgId, options = {}, sharedHeaders, sharedTokenState) {
|
|
5595
5694
|
super(options, sharedHeaders, sharedTokenState);
|
|
@@ -5621,9 +5720,9 @@ var OrganizationCredsService = class extends BaseSDK {
|
|
|
5621
5720
|
*/
|
|
5622
5721
|
async list(options) {
|
|
5623
5722
|
var _a;
|
|
5624
|
-
|
|
5723
|
+
log31("Listing org %s credentials", this.orgSegment);
|
|
5625
5724
|
const result = await this.request(this.base(), options);
|
|
5626
|
-
|
|
5725
|
+
log31("Found %d credentials for org %s", ((_a = result.data) == null ? void 0 : _a.length) || 0, this.orgSegment);
|
|
5627
5726
|
return result;
|
|
5628
5727
|
}
|
|
5629
5728
|
/**
|
|
@@ -5632,20 +5731,20 @@ var OrganizationCredsService = class extends BaseSDK {
|
|
|
5632
5731
|
* owner via `CredService.get(id, { decrypt: true })`.
|
|
5633
5732
|
*/
|
|
5634
5733
|
async get(id, getOptions, options) {
|
|
5635
|
-
|
|
5734
|
+
log31("Getting org %s credential %d (decrypt=%s)", this.orgSegment, id, getOptions == null ? void 0 : getOptions.decrypt);
|
|
5636
5735
|
const queryString = this.buildQueryString((getOptions == null ? void 0 : getOptions.decrypt) ? { decrypt: "true" } : {});
|
|
5637
5736
|
const result = await this.request(
|
|
5638
5737
|
`${this.base()}/${id}${queryString}`,
|
|
5639
5738
|
options
|
|
5640
5739
|
);
|
|
5641
|
-
|
|
5740
|
+
log31("Retrieved org credential: %s", result.key);
|
|
5642
5741
|
return result;
|
|
5643
5742
|
}
|
|
5644
5743
|
// ===========================================================================
|
|
5645
5744
|
// Create
|
|
5646
5745
|
// ===========================================================================
|
|
5647
5746
|
async createKV(data, options) {
|
|
5648
|
-
|
|
5747
|
+
log31("Creating org %s KV credential: %s (type=%s)", this.orgSegment, data.key, data.type);
|
|
5649
5748
|
return this.request(`${this.base()}/kv`, {
|
|
5650
5749
|
body: JSON.stringify(data),
|
|
5651
5750
|
headers: { "Content-Type": "application/json" },
|
|
@@ -5654,7 +5753,7 @@ var OrganizationCredsService = class extends BaseSDK {
|
|
|
5654
5753
|
});
|
|
5655
5754
|
}
|
|
5656
5755
|
async createOAuth(data, options) {
|
|
5657
|
-
|
|
5756
|
+
log31("Creating org %s OAuth credential: %s", this.orgSegment, data.key);
|
|
5658
5757
|
return this.request(`${this.base()}/oauth`, {
|
|
5659
5758
|
body: JSON.stringify(data),
|
|
5660
5759
|
headers: { "Content-Type": "application/json" },
|
|
@@ -5663,7 +5762,7 @@ var OrganizationCredsService = class extends BaseSDK {
|
|
|
5663
5762
|
});
|
|
5664
5763
|
}
|
|
5665
5764
|
async createFile(data, options) {
|
|
5666
|
-
|
|
5765
|
+
log31("Creating org %s file credential: %s", this.orgSegment, data.key);
|
|
5667
5766
|
return this.request(`${this.base()}/file`, {
|
|
5668
5767
|
body: JSON.stringify(data),
|
|
5669
5768
|
headers: { "Content-Type": "application/json" },
|
|
@@ -5675,7 +5774,7 @@ var OrganizationCredsService = class extends BaseSDK {
|
|
|
5675
5774
|
// Update
|
|
5676
5775
|
// ===========================================================================
|
|
5677
5776
|
async update(id, data, options) {
|
|
5678
|
-
|
|
5777
|
+
log31("Updating org %s credential %d", this.orgSegment, id);
|
|
5679
5778
|
return this.request(`${this.base()}/${id}`, {
|
|
5680
5779
|
body: JSON.stringify(data),
|
|
5681
5780
|
headers: { "Content-Type": "application/json" },
|
|
@@ -5687,14 +5786,14 @@ var OrganizationCredsService = class extends BaseSDK {
|
|
|
5687
5786
|
// Delete
|
|
5688
5787
|
// ===========================================================================
|
|
5689
5788
|
async delete(id, options) {
|
|
5690
|
-
|
|
5789
|
+
log31("Deleting org %s credential %d", this.orgSegment, id);
|
|
5691
5790
|
return this.request(`${this.base()}/${id}`, {
|
|
5692
5791
|
method: "DELETE",
|
|
5693
5792
|
...options
|
|
5694
5793
|
});
|
|
5695
5794
|
}
|
|
5696
5795
|
async deleteByKey(key, options) {
|
|
5697
|
-
|
|
5796
|
+
log31("Deleting org %s credential by key: %s", this.orgSegment, key);
|
|
5698
5797
|
return this.request(`${this.base()}/key/${encodeURIComponent(key)}`, {
|
|
5699
5798
|
method: "DELETE",
|
|
5700
5799
|
...options
|
|
@@ -5708,7 +5807,7 @@ var OrganizationCredsService = class extends BaseSDK {
|
|
|
5708
5807
|
* the org has bound vs. is missing. Reads only; any org member may call.
|
|
5709
5808
|
*/
|
|
5710
5809
|
async getSkillCredStatus(skillIdentifier, options) {
|
|
5711
|
-
|
|
5810
|
+
log31("Getting org %s skill cred status: %s", this.orgSegment, skillIdentifier);
|
|
5712
5811
|
const path = `/v1/organizations/${this.orgSegment}/skills/${encodeURIComponent(skillIdentifier)}/creds/status`;
|
|
5713
5812
|
const result = await this.request(
|
|
5714
5813
|
path,
|
|
@@ -5719,8 +5818,8 @@ var OrganizationCredsService = class extends BaseSDK {
|
|
|
5719
5818
|
};
|
|
5720
5819
|
|
|
5721
5820
|
// src/market/services/OrganizationService.ts
|
|
5722
|
-
import
|
|
5723
|
-
var
|
|
5821
|
+
import debug32 from "debug";
|
|
5822
|
+
var log32 = debug32("lobe-market-sdk:organization");
|
|
5724
5823
|
var OrganizationService2 = class extends BaseSDK {
|
|
5725
5824
|
constructor(options = {}, sharedHeaders, sharedTokenState) {
|
|
5726
5825
|
super(options, sharedHeaders, sharedTokenState);
|
|
@@ -5768,12 +5867,12 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5768
5867
|
async getOrganizationInfo(idOrNamespace, params = {}, options) {
|
|
5769
5868
|
const locale = params.locale || this.defaultLocale;
|
|
5770
5869
|
const queryString = this.buildQueryString({ locale });
|
|
5771
|
-
|
|
5870
|
+
log32("Getting organization info: %O", { idOrNamespace, ...params });
|
|
5772
5871
|
const result = await this.request(
|
|
5773
5872
|
`/v1/organizations/info/${idOrNamespace}${queryString}`,
|
|
5774
5873
|
options
|
|
5775
5874
|
);
|
|
5776
|
-
|
|
5875
|
+
log32("Organization info retrieved for: %s", idOrNamespace);
|
|
5777
5876
|
return result;
|
|
5778
5877
|
}
|
|
5779
5878
|
/**
|
|
@@ -5783,7 +5882,7 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5783
5882
|
* @returns Promise resolving to the user's organizations
|
|
5784
5883
|
*/
|
|
5785
5884
|
async listMyOrganizations(options) {
|
|
5786
|
-
|
|
5885
|
+
log32("Listing organizations for current user");
|
|
5787
5886
|
const result = await this.request(
|
|
5788
5887
|
"/v1/organizations/me",
|
|
5789
5888
|
options
|
|
@@ -5801,7 +5900,7 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5801
5900
|
* @returns The created/existing organization and whether it was newly created
|
|
5802
5901
|
*/
|
|
5803
5902
|
async createOrganization(data, options) {
|
|
5804
|
-
|
|
5903
|
+
log32("Creating organization: %s", data.clerkId);
|
|
5805
5904
|
return this.request("/v1/organizations", {
|
|
5806
5905
|
...options,
|
|
5807
5906
|
body: JSON.stringify(data),
|
|
@@ -5816,7 +5915,7 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5816
5915
|
* @returns The updated organization
|
|
5817
5916
|
*/
|
|
5818
5917
|
async updateOrganization(orgId, data, options) {
|
|
5819
|
-
|
|
5918
|
+
log32("Updating organization %d: %O", orgId, data);
|
|
5820
5919
|
const result = await this.request(
|
|
5821
5920
|
`/v1/organizations/${orgRefToPathSegment(orgId)}`,
|
|
5822
5921
|
{
|
|
@@ -5835,7 +5934,7 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5835
5934
|
* @returns The archived organization
|
|
5836
5935
|
*/
|
|
5837
5936
|
async archiveOrganization(orgId, options) {
|
|
5838
|
-
|
|
5937
|
+
log32("Archiving organization %d", orgId);
|
|
5839
5938
|
const result = await this.request(
|
|
5840
5939
|
`/v1/organizations/${orgRefToPathSegment(orgId)}/archive`,
|
|
5841
5940
|
{ ...options, method: "POST" }
|
|
@@ -5849,7 +5948,7 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5849
5948
|
* @returns The reactivated organization
|
|
5850
5949
|
*/
|
|
5851
5950
|
async unarchiveOrganization(orgId, options) {
|
|
5852
|
-
|
|
5951
|
+
log32("Unarchiving organization %d", orgId);
|
|
5853
5952
|
const result = await this.request(
|
|
5854
5953
|
`/v1/organizations/${orgRefToPathSegment(orgId)}/unarchive`,
|
|
5855
5954
|
{ ...options, method: "POST" }
|
|
@@ -5863,7 +5962,7 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5863
5962
|
* @returns Hydrated member rows
|
|
5864
5963
|
*/
|
|
5865
5964
|
async listMembers(orgId, options) {
|
|
5866
|
-
|
|
5965
|
+
log32("Listing members of organization %d", orgId);
|
|
5867
5966
|
const result = await this.request(
|
|
5868
5967
|
`/v1/organizations/${orgRefToPathSegment(orgId)}/members`,
|
|
5869
5968
|
options
|
|
@@ -5880,7 +5979,7 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5880
5979
|
* @returns Whether the member was newly added and their effective role
|
|
5881
5980
|
*/
|
|
5882
5981
|
async addMember(orgId, userAccountId, role, options) {
|
|
5883
|
-
|
|
5982
|
+
log32("Adding member %d to organization %d (role=%s)", userAccountId, orgId, role);
|
|
5884
5983
|
return this.request(
|
|
5885
5984
|
`/v1/organizations/${orgRefToPathSegment(orgId)}/members`,
|
|
5886
5985
|
{
|
|
@@ -5899,7 +5998,7 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5899
5998
|
* @returns Whether a membership row was removed
|
|
5900
5999
|
*/
|
|
5901
6000
|
async removeMember(orgId, userAccountId, options) {
|
|
5902
|
-
|
|
6001
|
+
log32("Removing member %d from organization %d", userAccountId, orgId);
|
|
5903
6002
|
return this.request(
|
|
5904
6003
|
`/v1/organizations/${orgRefToPathSegment(orgId)}/members/${userAccountId}`,
|
|
5905
6004
|
{ ...options, method: "DELETE" }
|
|
@@ -5915,7 +6014,7 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5915
6014
|
* @returns The effective role and whether it changed
|
|
5916
6015
|
*/
|
|
5917
6016
|
async updateMemberRole(orgId, userAccountId, role, options) {
|
|
5918
|
-
|
|
6017
|
+
log32("Updating member %d role to %s in organization %d", userAccountId, role, orgId);
|
|
5919
6018
|
return this.request(
|
|
5920
6019
|
`/v1/organizations/${orgRefToPathSegment(orgId)}/members/${userAccountId}`,
|
|
5921
6020
|
{ ...options, body: JSON.stringify({ role }), method: "PATCH" }
|
|
@@ -5933,7 +6032,7 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5933
6032
|
* @returns Counts of added / removed / updated members and skipped ids
|
|
5934
6033
|
*/
|
|
5935
6034
|
async reconcileMembers(orgId, members, options) {
|
|
5936
|
-
|
|
6035
|
+
log32("Reconciling %d members for organization %d", members.length, orgId);
|
|
5937
6036
|
return this.request(
|
|
5938
6037
|
`/v1/organizations/${orgRefToPathSegment(orgId)}/members`,
|
|
5939
6038
|
{
|
|
@@ -5946,8 +6045,8 @@ var OrganizationService2 = class extends BaseSDK {
|
|
|
5946
6045
|
};
|
|
5947
6046
|
|
|
5948
6047
|
// src/market/services/UserService.ts
|
|
5949
|
-
import
|
|
5950
|
-
var
|
|
6048
|
+
import debug33 from "debug";
|
|
6049
|
+
var log33 = debug33("lobe-market-sdk:user");
|
|
5951
6050
|
var UserService = class extends BaseSDK {
|
|
5952
6051
|
/**
|
|
5953
6052
|
* Retrieves user information by account ID or userName
|
|
@@ -5964,12 +6063,12 @@ var UserService = class extends BaseSDK {
|
|
|
5964
6063
|
const locale = params.locale || this.defaultLocale;
|
|
5965
6064
|
const queryParams = { locale };
|
|
5966
6065
|
const queryString = this.buildQueryString(queryParams);
|
|
5967
|
-
|
|
6066
|
+
log33("Getting user info: %O", { idOrUserName, ...params });
|
|
5968
6067
|
const result = await this.request(
|
|
5969
6068
|
`/v1/user/info/${idOrUserName}${queryString}`,
|
|
5970
6069
|
options
|
|
5971
6070
|
);
|
|
5972
|
-
|
|
6071
|
+
log33("User info successfully retrieved for: %s", idOrUserName);
|
|
5973
6072
|
return result;
|
|
5974
6073
|
}
|
|
5975
6074
|
/**
|
|
@@ -5984,7 +6083,7 @@ var UserService = class extends BaseSDK {
|
|
|
5984
6083
|
* @throws Error if userName is already taken or update fails
|
|
5985
6084
|
*/
|
|
5986
6085
|
async updateUserInfo(data, options) {
|
|
5987
|
-
|
|
6086
|
+
log33("Updating user info: %O", data);
|
|
5988
6087
|
const result = await this.request("/v1/user/update", {
|
|
5989
6088
|
body: JSON.stringify(data),
|
|
5990
6089
|
headers: {
|
|
@@ -5993,7 +6092,7 @@ var UserService = class extends BaseSDK {
|
|
|
5993
6092
|
method: "POST",
|
|
5994
6093
|
...options
|
|
5995
6094
|
});
|
|
5996
|
-
|
|
6095
|
+
log33("User info updated successfully");
|
|
5997
6096
|
return result;
|
|
5998
6097
|
}
|
|
5999
6098
|
/**
|
|
@@ -6023,7 +6122,7 @@ var UserService = class extends BaseSDK {
|
|
|
6023
6122
|
* ```
|
|
6024
6123
|
*/
|
|
6025
6124
|
async register(data, options) {
|
|
6026
|
-
|
|
6125
|
+
log33("Registering user: %O", {
|
|
6027
6126
|
followUserId: data.followUserId,
|
|
6028
6127
|
registerUserId: data.registerUserId
|
|
6029
6128
|
});
|
|
@@ -6035,14 +6134,14 @@ var UserService = class extends BaseSDK {
|
|
|
6035
6134
|
method: "POST",
|
|
6036
6135
|
...options
|
|
6037
6136
|
});
|
|
6038
|
-
|
|
6137
|
+
log33("User registered successfully: created=%s, userId=%s", result.created, result.user.clerkId);
|
|
6039
6138
|
return result;
|
|
6040
6139
|
}
|
|
6041
6140
|
};
|
|
6042
6141
|
|
|
6043
6142
|
// src/market/services/UserFollowService.ts
|
|
6044
|
-
import
|
|
6045
|
-
var
|
|
6143
|
+
import debug34 from "debug";
|
|
6144
|
+
var log34 = debug34("lobe-market-sdk:user-follow");
|
|
6046
6145
|
var UserFollowService = class extends BaseSDK {
|
|
6047
6146
|
/**
|
|
6048
6147
|
* Follow a user
|
|
@@ -6056,7 +6155,7 @@ var UserFollowService = class extends BaseSDK {
|
|
|
6056
6155
|
* @throws Error if already following or cannot follow yourself
|
|
6057
6156
|
*/
|
|
6058
6157
|
async follow(followingId, options) {
|
|
6059
|
-
|
|
6158
|
+
log34("Following user: %d", followingId);
|
|
6060
6159
|
const body = { followingId };
|
|
6061
6160
|
const result = await this.request("/v1/user/follows", {
|
|
6062
6161
|
body: JSON.stringify(body),
|
|
@@ -6066,7 +6165,7 @@ var UserFollowService = class extends BaseSDK {
|
|
|
6066
6165
|
method: "POST",
|
|
6067
6166
|
...options
|
|
6068
6167
|
});
|
|
6069
|
-
|
|
6168
|
+
log34("Successfully followed user: %d", followingId);
|
|
6070
6169
|
return result;
|
|
6071
6170
|
}
|
|
6072
6171
|
/**
|
|
@@ -6081,7 +6180,7 @@ var UserFollowService = class extends BaseSDK {
|
|
|
6081
6180
|
* @throws Error if follow relationship not found
|
|
6082
6181
|
*/
|
|
6083
6182
|
async unfollow(followingId, options) {
|
|
6084
|
-
|
|
6183
|
+
log34("Unfollowing user: %d", followingId);
|
|
6085
6184
|
const body = { followingId };
|
|
6086
6185
|
const result = await this.request("/v1/user/follows", {
|
|
6087
6186
|
body: JSON.stringify(body),
|
|
@@ -6091,7 +6190,7 @@ var UserFollowService = class extends BaseSDK {
|
|
|
6091
6190
|
method: "DELETE",
|
|
6092
6191
|
...options
|
|
6093
6192
|
});
|
|
6094
|
-
|
|
6193
|
+
log34("Successfully unfollowed user: %d", followingId);
|
|
6095
6194
|
return result;
|
|
6096
6195
|
}
|
|
6097
6196
|
/**
|
|
@@ -6105,13 +6204,13 @@ var UserFollowService = class extends BaseSDK {
|
|
|
6105
6204
|
* @returns Promise resolving to follow status (isFollowing, isMutual)
|
|
6106
6205
|
*/
|
|
6107
6206
|
async checkFollowStatus(targetUserId, options) {
|
|
6108
|
-
|
|
6207
|
+
log34("Checking follow status for user: %d", targetUserId);
|
|
6109
6208
|
const queryString = this.buildQueryString({ targetUserId: String(targetUserId) });
|
|
6110
6209
|
const result = await this.request(
|
|
6111
6210
|
`/v1/user/follows/check${queryString}`,
|
|
6112
6211
|
options
|
|
6113
6212
|
);
|
|
6114
|
-
|
|
6213
|
+
log34("Follow status retrieved: %O", result);
|
|
6115
6214
|
return result;
|
|
6116
6215
|
}
|
|
6117
6216
|
/**
|
|
@@ -6126,7 +6225,7 @@ var UserFollowService = class extends BaseSDK {
|
|
|
6126
6225
|
* @returns Promise resolving to list of following users
|
|
6127
6226
|
*/
|
|
6128
6227
|
async getFollowing(userId, params = {}, options) {
|
|
6129
|
-
|
|
6228
|
+
log34("Getting following list for user: %d", userId);
|
|
6130
6229
|
const queryParams = {};
|
|
6131
6230
|
if (params.limit !== void 0) queryParams.limit = String(params.limit);
|
|
6132
6231
|
if (params.offset !== void 0) queryParams.offset = String(params.offset);
|
|
@@ -6135,7 +6234,7 @@ var UserFollowService = class extends BaseSDK {
|
|
|
6135
6234
|
`/v1/user/follows/${userId}/following${queryString}`,
|
|
6136
6235
|
options
|
|
6137
6236
|
);
|
|
6138
|
-
|
|
6237
|
+
log34("Following list retrieved for user: %d", userId);
|
|
6139
6238
|
return result;
|
|
6140
6239
|
}
|
|
6141
6240
|
/**
|
|
@@ -6150,7 +6249,7 @@ var UserFollowService = class extends BaseSDK {
|
|
|
6150
6249
|
* @returns Promise resolving to list of followers
|
|
6151
6250
|
*/
|
|
6152
6251
|
async getFollowers(userId, params = {}, options) {
|
|
6153
|
-
|
|
6252
|
+
log34("Getting followers list for user: %d", userId);
|
|
6154
6253
|
const queryParams = {};
|
|
6155
6254
|
if (params.limit !== void 0) queryParams.limit = String(params.limit);
|
|
6156
6255
|
if (params.offset !== void 0) queryParams.offset = String(params.offset);
|
|
@@ -6159,14 +6258,14 @@ var UserFollowService = class extends BaseSDK {
|
|
|
6159
6258
|
`/v1/user/follows/${userId}/followers${queryString}`,
|
|
6160
6259
|
options
|
|
6161
6260
|
);
|
|
6162
|
-
|
|
6261
|
+
log34("Followers list retrieved for user: %d", userId);
|
|
6163
6262
|
return result;
|
|
6164
6263
|
}
|
|
6165
6264
|
};
|
|
6166
6265
|
|
|
6167
6266
|
// src/market/services/UserFavoriteService.ts
|
|
6168
|
-
import
|
|
6169
|
-
var
|
|
6267
|
+
import debug35 from "debug";
|
|
6268
|
+
var log35 = debug35("lobe-market-sdk:user-favorite");
|
|
6170
6269
|
var UserFavoriteService = class extends BaseSDK {
|
|
6171
6270
|
/**
|
|
6172
6271
|
* Add to favorites
|
|
@@ -6181,7 +6280,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6181
6280
|
* @throws Error if already in favorites
|
|
6182
6281
|
*/
|
|
6183
6282
|
async addFavorite(targetType, targetId, options) {
|
|
6184
|
-
|
|
6283
|
+
log35("Adding favorite: %s %d", targetType, targetId);
|
|
6185
6284
|
const body = { targetId, targetType };
|
|
6186
6285
|
const result = await this.request("/v1/user/favorites", {
|
|
6187
6286
|
body: JSON.stringify(body),
|
|
@@ -6191,7 +6290,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6191
6290
|
method: "POST",
|
|
6192
6291
|
...options
|
|
6193
6292
|
});
|
|
6194
|
-
|
|
6293
|
+
log35("Successfully added favorite: %s %d", targetType, targetId);
|
|
6195
6294
|
return result;
|
|
6196
6295
|
}
|
|
6197
6296
|
/**
|
|
@@ -6207,7 +6306,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6207
6306
|
* @throws Error if favorite not found
|
|
6208
6307
|
*/
|
|
6209
6308
|
async removeFavorite(targetType, targetId, options) {
|
|
6210
|
-
|
|
6309
|
+
log35("Removing favorite: %s %d", targetType, targetId);
|
|
6211
6310
|
const body = { targetId, targetType };
|
|
6212
6311
|
const result = await this.request("/v1/user/favorites", {
|
|
6213
6312
|
body: JSON.stringify(body),
|
|
@@ -6217,7 +6316,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6217
6316
|
method: "DELETE",
|
|
6218
6317
|
...options
|
|
6219
6318
|
});
|
|
6220
|
-
|
|
6319
|
+
log35("Successfully removed favorite: %s %d", targetType, targetId);
|
|
6221
6320
|
return result;
|
|
6222
6321
|
}
|
|
6223
6322
|
/**
|
|
@@ -6232,7 +6331,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6232
6331
|
* @returns Promise resolving to favorite status
|
|
6233
6332
|
*/
|
|
6234
6333
|
async checkFavorite(targetType, targetId, options) {
|
|
6235
|
-
|
|
6334
|
+
log35("Checking favorite status: %s %d", targetType, targetId);
|
|
6236
6335
|
const queryString = this.buildQueryString({
|
|
6237
6336
|
targetId: String(targetId),
|
|
6238
6337
|
targetType
|
|
@@ -6241,7 +6340,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6241
6340
|
`/v1/user/favorites/check${queryString}`,
|
|
6242
6341
|
options
|
|
6243
6342
|
);
|
|
6244
|
-
|
|
6343
|
+
log35("Favorite status retrieved: %O", result);
|
|
6245
6344
|
return result;
|
|
6246
6345
|
}
|
|
6247
6346
|
/**
|
|
@@ -6255,7 +6354,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6255
6354
|
* @returns Promise resolving to list of favorites
|
|
6256
6355
|
*/
|
|
6257
6356
|
async getMyFavorites(params = {}, options) {
|
|
6258
|
-
|
|
6357
|
+
log35("Getting my favorites: %O", params);
|
|
6259
6358
|
const queryParams = {};
|
|
6260
6359
|
if (params.limit !== void 0) queryParams.limit = String(params.limit);
|
|
6261
6360
|
if (params.offset !== void 0) queryParams.offset = String(params.offset);
|
|
@@ -6265,7 +6364,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6265
6364
|
`/v1/user/favorites/me${queryString}`,
|
|
6266
6365
|
options
|
|
6267
6366
|
);
|
|
6268
|
-
|
|
6367
|
+
log35("My favorites retrieved");
|
|
6269
6368
|
return result;
|
|
6270
6369
|
}
|
|
6271
6370
|
/**
|
|
@@ -6280,7 +6379,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6280
6379
|
* @returns Promise resolving to list of favorites
|
|
6281
6380
|
*/
|
|
6282
6381
|
async getUserFavorites(userId, params = {}, options) {
|
|
6283
|
-
|
|
6382
|
+
log35("Getting favorites for user: %d", userId);
|
|
6284
6383
|
const queryParams = {};
|
|
6285
6384
|
if (params.limit !== void 0) queryParams.limit = String(params.limit);
|
|
6286
6385
|
if (params.offset !== void 0) queryParams.offset = String(params.offset);
|
|
@@ -6290,7 +6389,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6290
6389
|
`/v1/user/favorites/${userId}${queryString}`,
|
|
6291
6390
|
options
|
|
6292
6391
|
);
|
|
6293
|
-
|
|
6392
|
+
log35("Favorites retrieved for user: %d", userId);
|
|
6294
6393
|
return result;
|
|
6295
6394
|
}
|
|
6296
6395
|
/**
|
|
@@ -6305,7 +6404,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6305
6404
|
* @returns Promise resolving to list of favorite agents
|
|
6306
6405
|
*/
|
|
6307
6406
|
async getUserFavoriteAgents(userId, params = {}, options) {
|
|
6308
|
-
|
|
6407
|
+
log35("Getting favorite agents for user: %d", userId);
|
|
6309
6408
|
const queryParams = {};
|
|
6310
6409
|
if (params.limit !== void 0) queryParams.limit = String(params.limit);
|
|
6311
6410
|
if (params.offset !== void 0) queryParams.offset = String(params.offset);
|
|
@@ -6314,7 +6413,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6314
6413
|
`/v1/user/favorites/${userId}/agents${queryString}`,
|
|
6315
6414
|
options
|
|
6316
6415
|
);
|
|
6317
|
-
|
|
6416
|
+
log35("Favorite agents retrieved for user: %d", userId);
|
|
6318
6417
|
return result;
|
|
6319
6418
|
}
|
|
6320
6419
|
/**
|
|
@@ -6329,7 +6428,7 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6329
6428
|
* @returns Promise resolving to list of favorite plugins
|
|
6330
6429
|
*/
|
|
6331
6430
|
async getUserFavoritePlugins(userId, params = {}, options) {
|
|
6332
|
-
|
|
6431
|
+
log35("Getting favorite plugins for user: %d", userId);
|
|
6333
6432
|
const queryParams = {};
|
|
6334
6433
|
if (params.limit !== void 0) queryParams.limit = String(params.limit);
|
|
6335
6434
|
if (params.offset !== void 0) queryParams.offset = String(params.offset);
|
|
@@ -6338,14 +6437,14 @@ var UserFavoriteService = class extends BaseSDK {
|
|
|
6338
6437
|
`/v1/user/favorites/${userId}/plugins${queryString}`,
|
|
6339
6438
|
options
|
|
6340
6439
|
);
|
|
6341
|
-
|
|
6440
|
+
log35("Favorite plugins retrieved for user: %d", userId);
|
|
6342
6441
|
return result;
|
|
6343
6442
|
}
|
|
6344
6443
|
};
|
|
6345
6444
|
|
|
6346
6445
|
// src/market/services/UserLikeService.ts
|
|
6347
|
-
import
|
|
6348
|
-
var
|
|
6446
|
+
import debug36 from "debug";
|
|
6447
|
+
var log36 = debug36("lobe-market-sdk:user-like");
|
|
6349
6448
|
var UserLikeService = class extends BaseSDK {
|
|
6350
6449
|
/**
|
|
6351
6450
|
* Like content
|
|
@@ -6360,7 +6459,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6360
6459
|
* @throws Error if already liked
|
|
6361
6460
|
*/
|
|
6362
6461
|
async like(targetType, targetId, options) {
|
|
6363
|
-
|
|
6462
|
+
log36("Liking: %s %d", targetType, targetId);
|
|
6364
6463
|
const body = { targetId, targetType };
|
|
6365
6464
|
const result = await this.request("/v1/user/likes", {
|
|
6366
6465
|
body: JSON.stringify(body),
|
|
@@ -6370,7 +6469,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6370
6469
|
method: "POST",
|
|
6371
6470
|
...options
|
|
6372
6471
|
});
|
|
6373
|
-
|
|
6472
|
+
log36("Successfully liked: %s %d", targetType, targetId);
|
|
6374
6473
|
return result;
|
|
6375
6474
|
}
|
|
6376
6475
|
/**
|
|
@@ -6386,7 +6485,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6386
6485
|
* @throws Error if like not found
|
|
6387
6486
|
*/
|
|
6388
6487
|
async unlike(targetType, targetId, options) {
|
|
6389
|
-
|
|
6488
|
+
log36("Unliking: %s %d", targetType, targetId);
|
|
6390
6489
|
const body = { targetId, targetType };
|
|
6391
6490
|
const result = await this.request("/v1/user/likes", {
|
|
6392
6491
|
body: JSON.stringify(body),
|
|
@@ -6396,7 +6495,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6396
6495
|
method: "DELETE",
|
|
6397
6496
|
...options
|
|
6398
6497
|
});
|
|
6399
|
-
|
|
6498
|
+
log36("Successfully unliked: %s %d", targetType, targetId);
|
|
6400
6499
|
return result;
|
|
6401
6500
|
}
|
|
6402
6501
|
/**
|
|
@@ -6411,7 +6510,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6411
6510
|
* @returns Promise resolving to toggle response with new like status
|
|
6412
6511
|
*/
|
|
6413
6512
|
async toggleLike(targetType, targetId, options) {
|
|
6414
|
-
|
|
6513
|
+
log36("Toggling like: %s %d", targetType, targetId);
|
|
6415
6514
|
const body = { targetId, targetType };
|
|
6416
6515
|
const result = await this.request("/v1/user/likes/toggle", {
|
|
6417
6516
|
body: JSON.stringify(body),
|
|
@@ -6421,7 +6520,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6421
6520
|
method: "POST",
|
|
6422
6521
|
...options
|
|
6423
6522
|
});
|
|
6424
|
-
|
|
6523
|
+
log36("Like toggled, new status: %O", result);
|
|
6425
6524
|
return result;
|
|
6426
6525
|
}
|
|
6427
6526
|
/**
|
|
@@ -6436,7 +6535,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6436
6535
|
* @returns Promise resolving to like status
|
|
6437
6536
|
*/
|
|
6438
6537
|
async checkLike(targetType, targetId, options) {
|
|
6439
|
-
|
|
6538
|
+
log36("Checking like status: %s %d", targetType, targetId);
|
|
6440
6539
|
const queryString = this.buildQueryString({
|
|
6441
6540
|
targetId: String(targetId),
|
|
6442
6541
|
targetType
|
|
@@ -6445,7 +6544,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6445
6544
|
`/v1/user/likes/check${queryString}`,
|
|
6446
6545
|
options
|
|
6447
6546
|
);
|
|
6448
|
-
|
|
6547
|
+
log36("Like status retrieved: %O", result);
|
|
6449
6548
|
return result;
|
|
6450
6549
|
}
|
|
6451
6550
|
/**
|
|
@@ -6459,7 +6558,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6459
6558
|
* @returns Promise resolving to list of likes
|
|
6460
6559
|
*/
|
|
6461
6560
|
async getMyLikes(params = {}, options) {
|
|
6462
|
-
|
|
6561
|
+
log36("Getting my likes: %O", params);
|
|
6463
6562
|
const queryParams = {};
|
|
6464
6563
|
if (params.limit !== void 0) queryParams.limit = String(params.limit);
|
|
6465
6564
|
if (params.offset !== void 0) queryParams.offset = String(params.offset);
|
|
@@ -6469,7 +6568,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6469
6568
|
`/v1/user/likes/me${queryString}`,
|
|
6470
6569
|
options
|
|
6471
6570
|
);
|
|
6472
|
-
|
|
6571
|
+
log36("My likes retrieved");
|
|
6473
6572
|
return result;
|
|
6474
6573
|
}
|
|
6475
6574
|
/**
|
|
@@ -6484,7 +6583,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6484
6583
|
* @returns Promise resolving to list of likes
|
|
6485
6584
|
*/
|
|
6486
6585
|
async getUserLikes(userId, params = {}, options) {
|
|
6487
|
-
|
|
6586
|
+
log36("Getting likes for user: %d", userId);
|
|
6488
6587
|
const queryParams = {};
|
|
6489
6588
|
if (params.limit !== void 0) queryParams.limit = String(params.limit);
|
|
6490
6589
|
if (params.offset !== void 0) queryParams.offset = String(params.offset);
|
|
@@ -6494,7 +6593,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6494
6593
|
`/v1/user/likes/${userId}${queryString}`,
|
|
6495
6594
|
options
|
|
6496
6595
|
);
|
|
6497
|
-
|
|
6596
|
+
log36("Likes retrieved for user: %d", userId);
|
|
6498
6597
|
return result;
|
|
6499
6598
|
}
|
|
6500
6599
|
/**
|
|
@@ -6509,7 +6608,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6509
6608
|
* @returns Promise resolving to list of liked agents
|
|
6510
6609
|
*/
|
|
6511
6610
|
async getUserLikedAgents(userId, params = {}, options) {
|
|
6512
|
-
|
|
6611
|
+
log36("Getting liked agents for user: %d", userId);
|
|
6513
6612
|
const queryParams = {};
|
|
6514
6613
|
if (params.limit !== void 0) queryParams.limit = String(params.limit);
|
|
6515
6614
|
if (params.offset !== void 0) queryParams.offset = String(params.offset);
|
|
@@ -6518,7 +6617,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6518
6617
|
`/v1/user/likes/${userId}/agents${queryString}`,
|
|
6519
6618
|
options
|
|
6520
6619
|
);
|
|
6521
|
-
|
|
6620
|
+
log36("Liked agents retrieved for user: %d", userId);
|
|
6522
6621
|
return result;
|
|
6523
6622
|
}
|
|
6524
6623
|
/**
|
|
@@ -6533,7 +6632,7 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6533
6632
|
* @returns Promise resolving to list of liked plugins
|
|
6534
6633
|
*/
|
|
6535
6634
|
async getUserLikedPlugins(userId, params = {}, options) {
|
|
6536
|
-
|
|
6635
|
+
log36("Getting liked plugins for user: %d", userId);
|
|
6537
6636
|
const queryParams = {};
|
|
6538
6637
|
if (params.limit !== void 0) queryParams.limit = String(params.limit);
|
|
6539
6638
|
if (params.offset !== void 0) queryParams.offset = String(params.offset);
|
|
@@ -6542,14 +6641,14 @@ var UserLikeService = class extends BaseSDK {
|
|
|
6542
6641
|
`/v1/user/likes/${userId}/plugins${queryString}`,
|
|
6543
6642
|
options
|
|
6544
6643
|
);
|
|
6545
|
-
|
|
6644
|
+
log36("Liked plugins retrieved for user: %d", userId);
|
|
6546
6645
|
return result;
|
|
6547
6646
|
}
|
|
6548
6647
|
};
|
|
6549
6648
|
|
|
6550
6649
|
// src/market/services/UserPublishService.ts
|
|
6551
|
-
import
|
|
6552
|
-
var
|
|
6650
|
+
import debug37 from "debug";
|
|
6651
|
+
var log37 = debug37("lobe-market-sdk:user-publish");
|
|
6553
6652
|
var UserPublishService = class extends BaseSDK {
|
|
6554
6653
|
/**
|
|
6555
6654
|
* Lists all plugins owned by the authenticated user
|
|
@@ -6559,9 +6658,9 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6559
6658
|
*/
|
|
6560
6659
|
async listPlugins(options) {
|
|
6561
6660
|
var _a;
|
|
6562
|
-
|
|
6661
|
+
log37("Listing user plugins");
|
|
6563
6662
|
const result = await this.request("/v1/user/plugins", options);
|
|
6564
|
-
|
|
6663
|
+
log37("Found %d user plugins", ((_a = result.data) == null ? void 0 : _a.length) || 0);
|
|
6565
6664
|
return result;
|
|
6566
6665
|
}
|
|
6567
6666
|
/**
|
|
@@ -6572,9 +6671,9 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6572
6671
|
*/
|
|
6573
6672
|
async listSkills(options) {
|
|
6574
6673
|
var _a;
|
|
6575
|
-
|
|
6674
|
+
log37("Listing user skills");
|
|
6576
6675
|
const result = await this.request("/v1/user/skills", options);
|
|
6577
|
-
|
|
6676
|
+
log37("Found %d user skills", ((_a = result.data) == null ? void 0 : _a.length) || 0);
|
|
6578
6677
|
return result;
|
|
6579
6678
|
}
|
|
6580
6679
|
/**
|
|
@@ -6586,7 +6685,7 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6586
6685
|
* @returns Promise resolving to the publish result
|
|
6587
6686
|
*/
|
|
6588
6687
|
async publishSkillVersion(identifier, zipBuffer, options) {
|
|
6589
|
-
|
|
6688
|
+
log37("Publishing skill version for: %s", identifier);
|
|
6590
6689
|
const formData = new FormData();
|
|
6591
6690
|
const arrayBuffer = zipBuffer instanceof ArrayBuffer ? zipBuffer : zipBuffer.buffer.slice(
|
|
6592
6691
|
zipBuffer.byteOffset,
|
|
@@ -6602,7 +6701,7 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6602
6701
|
...options
|
|
6603
6702
|
}
|
|
6604
6703
|
);
|
|
6605
|
-
|
|
6704
|
+
log37("Published skill version: %s@%s", identifier, result.version);
|
|
6606
6705
|
return result;
|
|
6607
6706
|
}
|
|
6608
6707
|
/**
|
|
@@ -6613,11 +6712,11 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6613
6712
|
*/
|
|
6614
6713
|
async scanClaimableAssets(assetType) {
|
|
6615
6714
|
var _a;
|
|
6616
|
-
|
|
6715
|
+
log37("Scanning claimable %s", assetType);
|
|
6617
6716
|
const result = await this.request(
|
|
6618
6717
|
`/v1/user/claims/scan/${assetType}`
|
|
6619
6718
|
);
|
|
6620
|
-
|
|
6719
|
+
log37("Found %d claimable %s", ((_a = result.data) == null ? void 0 : _a.length) || 0, assetType);
|
|
6621
6720
|
return result;
|
|
6622
6721
|
}
|
|
6623
6722
|
/**
|
|
@@ -6628,13 +6727,13 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6628
6727
|
* @returns Promise resolving to the claim result
|
|
6629
6728
|
*/
|
|
6630
6729
|
async claimAsset(assetId, assetType) {
|
|
6631
|
-
|
|
6730
|
+
log37("Claiming %s with id: %d", assetType, assetId);
|
|
6632
6731
|
const result = await this.request("/v1/user/claims", {
|
|
6633
6732
|
body: JSON.stringify({ assetId, assetType }),
|
|
6634
6733
|
headers: { "Content-Type": "application/json" },
|
|
6635
6734
|
method: "POST"
|
|
6636
6735
|
});
|
|
6637
|
-
|
|
6736
|
+
log37("Claim result for %s %d: %s", assetType, assetId, result.success);
|
|
6638
6737
|
return result;
|
|
6639
6738
|
}
|
|
6640
6739
|
/**
|
|
@@ -6648,13 +6747,13 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6648
6747
|
* @returns Promise resolving to the claim result
|
|
6649
6748
|
*/
|
|
6650
6749
|
async claimAssetByIdentifier(identifier, assetType) {
|
|
6651
|
-
|
|
6750
|
+
log37("Claiming %s with identifier: %s", assetType, identifier);
|
|
6652
6751
|
const result = await this.request("/v1/user/claims", {
|
|
6653
6752
|
body: JSON.stringify({ assetType, identifier }),
|
|
6654
6753
|
headers: { "Content-Type": "application/json" },
|
|
6655
6754
|
method: "POST"
|
|
6656
6755
|
});
|
|
6657
|
-
|
|
6756
|
+
log37("Claim result for %s %s: %s", assetType, identifier, result.success);
|
|
6658
6757
|
return result;
|
|
6659
6758
|
}
|
|
6660
6759
|
/**
|
|
@@ -6669,14 +6768,14 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6669
6768
|
* @returns Promise resolving to the submission result
|
|
6670
6769
|
*/
|
|
6671
6770
|
async submitRepo(params, options) {
|
|
6672
|
-
|
|
6771
|
+
log37("Submitting repository for import: %s (%s)", params.gitUrl, params.type);
|
|
6673
6772
|
const result = await this.request("/v1/user/claims/submit-repo", {
|
|
6674
6773
|
body: JSON.stringify(params),
|
|
6675
6774
|
headers: { "Content-Type": "application/json" },
|
|
6676
6775
|
method: "POST",
|
|
6677
6776
|
...options
|
|
6678
6777
|
});
|
|
6679
|
-
|
|
6778
|
+
log37("Submit result for %s: %s", params.gitUrl, result.success);
|
|
6680
6779
|
return result;
|
|
6681
6780
|
}
|
|
6682
6781
|
/**
|
|
@@ -6687,14 +6786,14 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6687
6786
|
* @returns Promise resolving immediately with the plugin identifier and version
|
|
6688
6787
|
*/
|
|
6689
6788
|
async publishPlugin(params, options) {
|
|
6690
|
-
|
|
6789
|
+
log37("Publishing plugin: %s@%s", params.identifier, params.version);
|
|
6691
6790
|
const result = await this.request("/v1/user/plugins", {
|
|
6692
6791
|
body: JSON.stringify(params),
|
|
6693
6792
|
headers: { "Content-Type": "application/json" },
|
|
6694
6793
|
method: "POST",
|
|
6695
6794
|
...options
|
|
6696
6795
|
});
|
|
6697
|
-
|
|
6796
|
+
log37("Published plugin: %s@%s (%s)", result.identifier, result.version, result.status);
|
|
6698
6797
|
return result;
|
|
6699
6798
|
}
|
|
6700
6799
|
/**
|
|
@@ -6705,12 +6804,12 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6705
6804
|
* @returns Promise resolving to the delete result
|
|
6706
6805
|
*/
|
|
6707
6806
|
async deleteSkill(identifier, options) {
|
|
6708
|
-
|
|
6807
|
+
log37("Deleting skill: %s", identifier);
|
|
6709
6808
|
const result = await this.request(
|
|
6710
6809
|
`/v1/user/skills/${encodeURIComponent(identifier)}`,
|
|
6711
6810
|
{ method: "DELETE", ...options }
|
|
6712
6811
|
);
|
|
6713
|
-
|
|
6812
|
+
log37("Deleted skill: %s", identifier);
|
|
6714
6813
|
return result;
|
|
6715
6814
|
}
|
|
6716
6815
|
/**
|
|
@@ -6722,7 +6821,7 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6722
6821
|
* @returns Promise resolving to the updated status
|
|
6723
6822
|
*/
|
|
6724
6823
|
async updateSkillStatus(identifier, status, options) {
|
|
6725
|
-
|
|
6824
|
+
log37("Updating skill status: %s \u2192 %s", identifier, status);
|
|
6726
6825
|
const result = await this.request(
|
|
6727
6826
|
`/v1/user/skills/${encodeURIComponent(identifier)}/status`,
|
|
6728
6827
|
{
|
|
@@ -6732,7 +6831,7 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6732
6831
|
...options
|
|
6733
6832
|
}
|
|
6734
6833
|
);
|
|
6735
|
-
|
|
6834
|
+
log37("Updated skill status: %s \u2192 %s", identifier, result.status);
|
|
6736
6835
|
return result;
|
|
6737
6836
|
}
|
|
6738
6837
|
/**
|
|
@@ -6743,12 +6842,12 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6743
6842
|
* @returns Promise resolving to the delete result
|
|
6744
6843
|
*/
|
|
6745
6844
|
async deletePlugin(identifier, options) {
|
|
6746
|
-
|
|
6845
|
+
log37("Deleting plugin: %s", identifier);
|
|
6747
6846
|
const result = await this.request(
|
|
6748
6847
|
`/v1/user/plugins/${encodeURIComponent(identifier)}`,
|
|
6749
6848
|
{ method: "DELETE", ...options }
|
|
6750
6849
|
);
|
|
6751
|
-
|
|
6850
|
+
log37("Deleted plugin: %s", identifier);
|
|
6752
6851
|
return result;
|
|
6753
6852
|
}
|
|
6754
6853
|
/**
|
|
@@ -6760,7 +6859,7 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6760
6859
|
* @returns Promise resolving to the updated status
|
|
6761
6860
|
*/
|
|
6762
6861
|
async updatePluginStatus(identifier, status, options) {
|
|
6763
|
-
|
|
6862
|
+
log37("Updating plugin status: %s \u2192 %s", identifier, status);
|
|
6764
6863
|
const result = await this.request(
|
|
6765
6864
|
`/v1/user/plugins/${encodeURIComponent(identifier)}/status`,
|
|
6766
6865
|
{
|
|
@@ -6770,7 +6869,7 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6770
6869
|
...options
|
|
6771
6870
|
}
|
|
6772
6871
|
);
|
|
6773
|
-
|
|
6872
|
+
log37("Updated plugin status: %s \u2192 %s", identifier, result.status);
|
|
6774
6873
|
return result;
|
|
6775
6874
|
}
|
|
6776
6875
|
/**
|
|
@@ -6782,7 +6881,7 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6782
6881
|
* @returns Promise resolving to the publish result
|
|
6783
6882
|
*/
|
|
6784
6883
|
async publishPluginVersion(identifier, data, options) {
|
|
6785
|
-
|
|
6884
|
+
log37("Publishing plugin version for: %s", identifier);
|
|
6786
6885
|
const result = await this.request(
|
|
6787
6886
|
`/v1/user/plugins/${encodeURIComponent(identifier)}/versions`,
|
|
6788
6887
|
{
|
|
@@ -6792,7 +6891,7 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6792
6891
|
...options
|
|
6793
6892
|
}
|
|
6794
6893
|
);
|
|
6795
|
-
|
|
6894
|
+
log37("Published plugin version: %s@%s", identifier, result.version);
|
|
6796
6895
|
return result;
|
|
6797
6896
|
}
|
|
6798
6897
|
/**
|
|
@@ -6805,13 +6904,13 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6805
6904
|
*/
|
|
6806
6905
|
async getPluginLocalizations(identifier, version, options) {
|
|
6807
6906
|
var _a;
|
|
6808
|
-
|
|
6907
|
+
log37("Listing localizations for plugin: %s", identifier);
|
|
6809
6908
|
const query = version ? `?version=${encodeURIComponent(version)}` : "";
|
|
6810
6909
|
const result = await this.request(
|
|
6811
6910
|
`/v1/user/plugins/${encodeURIComponent(identifier)}/localizations${query}`,
|
|
6812
6911
|
options
|
|
6813
6912
|
);
|
|
6814
|
-
|
|
6913
|
+
log37("Found %d localizations for %s", ((_a = result.localizations) == null ? void 0 : _a.length) || 0, identifier);
|
|
6815
6914
|
return result;
|
|
6816
6915
|
}
|
|
6817
6916
|
/**
|
|
@@ -6828,7 +6927,7 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6828
6927
|
* @returns Promise resolving to the upsert result
|
|
6829
6928
|
*/
|
|
6830
6929
|
async updatePluginLocalizations(identifier, localizations, version, options) {
|
|
6831
|
-
|
|
6930
|
+
log37("Upserting %d localization(s) for plugin: %s", localizations.length, identifier);
|
|
6832
6931
|
const result = await this.request(
|
|
6833
6932
|
`/v1/user/plugins/${encodeURIComponent(identifier)}/localizations`,
|
|
6834
6933
|
{
|
|
@@ -6838,7 +6937,7 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6838
6937
|
...options
|
|
6839
6938
|
}
|
|
6840
6939
|
);
|
|
6841
|
-
|
|
6940
|
+
log37("Upserted localizations for %s@%s", identifier, result.version);
|
|
6842
6941
|
return result;
|
|
6843
6942
|
}
|
|
6844
6943
|
/**
|
|
@@ -6852,31 +6951,31 @@ var UserPublishService = class extends BaseSDK {
|
|
|
6852
6951
|
* @returns Promise resolving to the delete result
|
|
6853
6952
|
*/
|
|
6854
6953
|
async deletePluginLocalization(identifier, locale, version, options) {
|
|
6855
|
-
|
|
6954
|
+
log37("Deleting localization %s for plugin: %s", locale, identifier);
|
|
6856
6955
|
const query = version ? `?version=${encodeURIComponent(version)}` : "";
|
|
6857
6956
|
const result = await this.request(
|
|
6858
6957
|
`/v1/user/plugins/${encodeURIComponent(identifier)}/localizations/${encodeURIComponent(locale)}${query}`,
|
|
6859
6958
|
{ method: "DELETE", ...options }
|
|
6860
6959
|
);
|
|
6861
|
-
|
|
6960
|
+
log37("Deleted localization %s for %s", locale, identifier);
|
|
6862
6961
|
return result;
|
|
6863
6962
|
}
|
|
6864
6963
|
};
|
|
6865
6964
|
|
|
6866
6965
|
// src/market/services/CategoryService.ts
|
|
6867
|
-
import
|
|
6868
|
-
var
|
|
6966
|
+
import debug38 from "debug";
|
|
6967
|
+
var log38 = debug38("lobe-market-sdk:market:categories");
|
|
6869
6968
|
var CategoryService2 = class extends BaseSDK {
|
|
6870
6969
|
/** Lists configured categories with nullable HTTP(S) image URLs or lucide:<name> icons and public asset counts, including empty categories. */
|
|
6871
6970
|
async list(assetType, locale) {
|
|
6872
|
-
|
|
6971
|
+
log38("Listing categories for %s", assetType);
|
|
6873
6972
|
const query = this.buildQueryString({ assetType, locale });
|
|
6874
6973
|
return this.request(`/v1/categories${query}`);
|
|
6875
6974
|
}
|
|
6876
6975
|
};
|
|
6877
6976
|
|
|
6878
6977
|
// src/market/market-sdk.ts
|
|
6879
|
-
var
|
|
6978
|
+
var log39 = debug39("lobe-market-sdk");
|
|
6880
6979
|
var MarketSDK = class extends BaseSDK {
|
|
6881
6980
|
/** Anonymous WebP byte URL. No signed token or public bucket is required. */
|
|
6882
6981
|
getAssetImageUrl(id) {
|
|
@@ -6897,7 +6996,7 @@ var MarketSDK = class extends BaseSDK {
|
|
|
6897
6996
|
tokenExpiry: void 0
|
|
6898
6997
|
};
|
|
6899
6998
|
super(options, void 0, sharedTokenState);
|
|
6900
|
-
|
|
6999
|
+
log39("MarketSDK instance created");
|
|
6901
7000
|
this.agentProfile = new AgentProfileService(options, this.headers, sharedTokenState);
|
|
6902
7001
|
this.categories = new CategoryService2(options, this.headers, sharedTokenState);
|
|
6903
7002
|
this.agents = new AgentService2(options, this.headers, sharedTokenState);
|
|
@@ -6907,6 +7006,7 @@ var MarketSDK = class extends BaseSDK {
|
|
|
6907
7006
|
this.creds = new CredService(options, this.headers, sharedTokenState);
|
|
6908
7007
|
this.deployments = new DeploymentService(options, this.headers, sharedTokenState);
|
|
6909
7008
|
this.plugins = new PluginsService(options, this.headers, sharedTokenState);
|
|
7009
|
+
this.sandbox = new SandboxService(options, this.headers, sharedTokenState);
|
|
6910
7010
|
this.sandboxStorage = new SandboxStorageService2(options, this.headers, sharedTokenState);
|
|
6911
7011
|
this.organizations = new OrganizationService2(options, this.headers, sharedTokenState);
|
|
6912
7012
|
this.user = new UserService(options, this.headers, sharedTokenState);
|
|
@@ -6949,7 +7049,7 @@ var MarketSDK = class extends BaseSDK {
|
|
|
6949
7049
|
* @deprecated Use auth.registerClient() instead
|
|
6950
7050
|
*/
|
|
6951
7051
|
async registerClient(request) {
|
|
6952
|
-
|
|
7052
|
+
log39("Registering client (deprecated method, use auth.registerClient): %s", request.clientName);
|
|
6953
7053
|
return this.auth.registerClient(request);
|
|
6954
7054
|
}
|
|
6955
7055
|
};
|