@joai/sdk 0.3.0 → 0.4.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 +2 -1
- package/dist/index.mjs +6 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -938,7 +938,7 @@ declare class WarpsResource {
|
|
|
938
938
|
brand: string;
|
|
939
939
|
definition: Record<string, any>;
|
|
940
940
|
public?: boolean;
|
|
941
|
-
}
|
|
941
|
+
}): Promise<IAppResponse<{
|
|
942
942
|
id: string;
|
|
943
943
|
}>>;
|
|
944
944
|
destroy(identifier: string): Promise<IAppResponse<unknown>>;
|
|
@@ -949,6 +949,7 @@ interface JoAiClientConfig {
|
|
|
949
949
|
apiToken?: string;
|
|
950
950
|
team?: string;
|
|
951
951
|
env?: AppEnv;
|
|
952
|
+
agentAuthKey?: string;
|
|
952
953
|
}
|
|
953
954
|
declare class JoAiClient {
|
|
954
955
|
readonly http: IHttpService;
|
package/dist/index.mjs
CHANGED
|
@@ -455,8 +455,8 @@ var WarpsResource = class {
|
|
|
455
455
|
show(identifier) {
|
|
456
456
|
return this.http.get(`warps/${identifier}`);
|
|
457
457
|
}
|
|
458
|
-
create(data
|
|
459
|
-
return this.http.post("warps", data
|
|
458
|
+
create(data) {
|
|
459
|
+
return this.http.post("warps", data);
|
|
460
460
|
}
|
|
461
461
|
destroy(identifier) {
|
|
462
462
|
return this.http.delete(`warps/${identifier}`);
|
|
@@ -472,7 +472,10 @@ function toWarpEnv(env) {
|
|
|
472
472
|
var JoAiClient = class {
|
|
473
473
|
constructor(config) {
|
|
474
474
|
this.env = config.env ?? "mainnet";
|
|
475
|
-
|
|
475
|
+
const headers = {};
|
|
476
|
+
if (config.team) headers["X-Team"] = config.team;
|
|
477
|
+
if (config.agentAuthKey) headers["X-Agent-Auth-Key"] = config.agentAuthKey;
|
|
478
|
+
this.http = new HttpService(`${getApiBaseUrl(config.env ?? "mainnet")}/v1`, void 0, config.apiToken, { headers });
|
|
476
479
|
this.hub = new HubResource(this.http);
|
|
477
480
|
this.teams = new TeamsResource(this.http);
|
|
478
481
|
this.agents = new AgentsResource(this.http);
|