Skip to content

Commit

Permalink
Release v0.1.47
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Dec 22, 2023
1 parent f693435 commit 25ac27c
Show file tree
Hide file tree
Showing 26 changed files with 237 additions and 92 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superagentai-js",
"version": "v0.1.45",
"version": "v0.1.47",
"private": false,
"repository": "https://github.com/homanp/superagent-js",
"main": "./index.js",
Expand Down
67 changes: 47 additions & 20 deletions src/api/resources/agent/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,22 @@ export class Agent {

/**
* List all agents
* @throws {@link SuperAgent.UnprocessableEntityError}
*/
public async list(requestOptions?: Agent.RequestOptions): Promise<SuperAgent.AgentList> {
public async list(
request: SuperAgent.ListApiV1AgentsGetRequest = {},
requestOptions?: Agent.RequestOptions
): Promise<SuperAgent.AgentList> {
const { skip, limit } = request;
const _queryParams: Record<string, string | string[]> = {};
if (skip != null) {
_queryParams["skip"] = skip.toString();
}

if (limit != null) {
_queryParams["limit"] = limit.toString();
}

const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.SuperAgentEnvironment.Default,
Expand All @@ -38,9 +52,10 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
Expand All @@ -54,10 +69,22 @@ export class Agent {
}

if (_response.error.reason === "status-code") {
throw new errors.SuperAgentError({
statusCode: _response.error.statusCode,
body: _response.error.body,
});
switch (_response.error.statusCode) {
case 422:
throw new SuperAgent.UnprocessableEntityError(
await serializers.HttpValidationError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
breadcrumbsPrefix: ["response"],
})
);
default:
throw new errors.SuperAgentError({
statusCode: _response.error.statusCode,
body: _response.error.body,
});
}
}

switch (_response.error.reason) {
Expand Down Expand Up @@ -93,7 +120,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -161,7 +188,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -225,7 +252,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -288,7 +315,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -357,7 +384,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestAgentInvoke.jsonOrThrow(request, {
Expand Down Expand Up @@ -428,7 +455,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestAgentLlm.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -493,7 +520,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -552,7 +579,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -620,7 +647,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestAgentTool.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -685,7 +712,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -747,7 +774,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -815,7 +842,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestAgentDatasource.jsonOrThrow(request, {
Expand Down Expand Up @@ -886,7 +913,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -945,7 +972,7 @@ export class Agent {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface ListApiV1AgentsGetRequest {
skip?: number;
limit?: number;
}
1 change: 1 addition & 0 deletions src/api/resources/agent/client/requests/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { ListApiV1AgentsGetRequest } from "./ListApiV1AgentsGetRequest";
export { AppModelsRequestAgentInvoke } from "./AppModelsRequestAgentInvoke";
export { AppModelsRequestAgentLlm } from "./AppModelsRequestAgentLlm";
export { AppModelsRequestAgentTool } from "./AppModelsRequestAgentTool";
Expand Down
6 changes: 3 additions & 3 deletions src/api/resources/apiUser/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class ApiUser {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestApiUser.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -106,7 +106,7 @@ export class ApiUser {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -157,7 +157,7 @@ export class ApiUser {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/datasource/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class Datasource {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -93,7 +93,7 @@ export class Datasource {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestDatasource.jsonOrThrow(request, {
Expand Down Expand Up @@ -163,7 +163,7 @@ export class Datasource {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -227,7 +227,7 @@ export class Datasource {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -290,7 +290,7 @@ export class Datasource {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestDatasource.jsonOrThrow(request, {
Expand Down
8 changes: 4 additions & 4 deletions src/api/resources/llm/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class Llm {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -93,7 +93,7 @@ export class Llm {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestLlm.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -158,7 +158,7 @@ export class Llm {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -226,7 +226,7 @@ export class Llm {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestLlm.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/tool/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class Tool {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -93,7 +93,7 @@ export class Tool {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestTool.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -158,7 +158,7 @@ export class Tool {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -222,7 +222,7 @@ export class Tool {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -285,7 +285,7 @@ export class Tool {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "superagentai-js",
"X-Fern-SDK-Version": "v0.1.45",
"X-Fern-SDK-Version": "v0.1.47",
},
contentType: "application/json",
body: await serializers.AppModelsRequestTool.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down
Loading

0 comments on commit 25ac27c

Please sign in to comment.