Skip to content

Commit

Permalink
Release 0.0.589
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jan 18, 2024
1 parent a01ff94 commit 166845d
Show file tree
Hide file tree
Showing 276 changed files with 1,702 additions and 1,799 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@revertdotdev/node",
"version": "0.0.587",
"version": "0.0.589",
"private": false,
"repository": "https://github.com/revertinc/revert-node-ts",
"main": "./index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { Crm } from "./api/resources/crm/client/Client";
import { Metadata } from "./api/resources/metadata/client/Client";
import { Ticket } from "./api/resources/ticket/client/Client";

export declare namespace RevertRevertApiClient {
export declare namespace VellumClient {
interface Options {
environment?: core.Supplier<environments.RevertRevertApiEnvironment | string>;
environment?: core.Supplier<environments.VellumEnvironment | string>;
}

interface RequestOptions {
Expand All @@ -21,8 +21,8 @@ export declare namespace RevertRevertApiClient {
}
}

export class RevertRevertApiClient {
constructor(protected readonly _options: RevertRevertApiClient.Options = {}) {}
export class VellumClient {
constructor(protected readonly _options: VellumClient.Options = {}) {}

protected _chat: Chat | undefined;

Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/chat/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Users } from "../resources/users/client/Client";

export declare namespace Chat {
interface Options {
environment?: core.Supplier<environments.RevertRevertApiEnvironment | string>;
environment?: core.Supplier<environments.VellumEnvironment | string>;
}

interface RequestOptions {
Expand Down
35 changes: 17 additions & 18 deletions src/api/resources/chat/resources/channels/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

import * as environments from "../../../../../../environments";
import * as core from "../../../../../../core";
import * as RevertRevertApi from "../../../../..";
import * as Vellum from "../../../../..";
import urlJoin from "url-join";
import * as serializers from "../../../../../../serialization";
import * as errors from "../../../../../../errors";

export declare namespace Channels {
interface Options {
environment?: core.Supplier<environments.RevertRevertApiEnvironment | string>;
environment?: core.Supplier<environments.VellumEnvironment | string>;
}

interface RequestOptions {
Expand All @@ -25,14 +25,14 @@ export class Channels {

/**
* Get all the channels
* @throws {@link RevertRevertApi.common.UnAuthorizedError}
* @throws {@link RevertRevertApi.common.InternalServerError}
* @throws {@link RevertRevertApi.common.NotFoundError}
* @throws {@link Vellum.common.UnAuthorizedError}
* @throws {@link Vellum.common.InternalServerError}
* @throws {@link Vellum.common.NotFoundError}
*/
public async getChannels(
request: RevertRevertApi.chat.GetChannelsRequest,
request: Vellum.chat.GetChannelsRequest,
requestOptions?: Channels.RequestOptions
): Promise<RevertRevertApi.chat.GetChannelsResponse> {
): Promise<Vellum.chat.GetChannelsResponse> {
const { fields, pageSize, cursor, xRevertApiToken, xRevertTId, xApiVersion } = request;
const _queryParams: Record<string, string | string[]> = {};
if (fields != null) {
Expand All @@ -49,22 +49,21 @@ export class Channels {

const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ??
environments.RevertRevertApiEnvironment.Production,
(await core.Supplier.get(this._options.environment)) ?? environments.VellumEnvironment.Production,
"/chat/channels"
),
method: "GET",
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.587",
"X-Fern-SDK-Version": "0.0.589",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand All @@ -79,7 +78,7 @@ export class Channels {
if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 401:
throw new RevertRevertApi.common.UnAuthorizedError(
throw new Vellum.common.UnAuthorizedError(
await serializers.common.BaseError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
Expand All @@ -88,7 +87,7 @@ export class Channels {
})
);
case 500:
throw new RevertRevertApi.common.InternalServerError(
throw new Vellum.common.InternalServerError(
await serializers.common.BaseError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
Expand All @@ -97,7 +96,7 @@ export class Channels {
})
);
case 404:
throw new RevertRevertApi.common.NotFoundError(
throw new Vellum.common.NotFoundError(
await serializers.common.BaseError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
Expand All @@ -106,7 +105,7 @@ export class Channels {
})
);
default:
throw new errors.RevertRevertApiError({
throw new errors.VellumError({
statusCode: _response.error.statusCode,
body: _response.error.body,
});
Expand All @@ -115,14 +114,14 @@ export class Channels {

switch (_response.error.reason) {
case "non-json":
throw new errors.RevertRevertApiError({
throw new errors.VellumError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
});
case "timeout":
throw new errors.RevertRevertApiTimeoutError();
throw new errors.VellumTimeoutError();
case "unknown":
throw new errors.RevertRevertApiError({
throw new errors.VellumError({
message: _response.error.errorMessage,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as RevertRevertApi from "../../../../..";
import * as Vellum from "../../../../..";

export interface GetChannelsResponse {
status: RevertRevertApi.common.ResponseStatus;
status: Vellum.common.ResponseStatus;
next?: string;
previous?: string;
results: RevertRevertApi.common.Channel[];
results: Vellum.common.Channel[];
}
39 changes: 19 additions & 20 deletions src/api/resources/chat/resources/messages/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

import * as environments from "../../../../../../environments";
import * as core from "../../../../../../core";
import * as RevertRevertApi from "../../../../..";
import * as Vellum from "../../../../..";
import * as serializers from "../../../../../../serialization";
import urlJoin from "url-join";
import * as errors from "../../../../../../errors";

export declare namespace Messages {
interface Options {
environment?: core.Supplier<environments.RevertRevertApiEnvironment | string>;
environment?: core.Supplier<environments.VellumEnvironment | string>;
}

interface RequestOptions {
Expand All @@ -25,27 +25,26 @@ export class Messages {

/**
* Create a new message
* @throws {@link RevertRevertApi.common.UnAuthorizedError}
* @throws {@link RevertRevertApi.common.InternalServerError}
* @throws {@link RevertRevertApi.common.NotFoundError}
* @throws {@link RevertRevertApi.common.BadRequestError}
* @throws {@link Vellum.common.UnAuthorizedError}
* @throws {@link Vellum.common.InternalServerError}
* @throws {@link Vellum.common.NotFoundError}
* @throws {@link Vellum.common.BadRequestError}
*/
public async createMessage(
request: RevertRevertApi.chat.CreateMessageRequest,
request: Vellum.chat.CreateMessageRequest,
requestOptions?: Messages.RequestOptions
): Promise<RevertRevertApi.chat.CreateorUpdateMessageResponse> {
): Promise<Vellum.chat.CreateorUpdateMessageResponse> {
const { xRevertApiToken, xRevertTId, xApiVersion, body: _body } = request;
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ??
environments.RevertRevertApiEnvironment.Production,
(await core.Supplier.get(this._options.environment)) ?? environments.VellumEnvironment.Production,
"/chat/message"
),
method: "POST",
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.587",
"X-Fern-SDK-Version": "0.0.589",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand All @@ -54,7 +53,7 @@ export class Messages {
body: await serializers.chat.CreateorUpdateMessageRequest.jsonOrThrow(_body, {
unrecognizedObjectKeys: "strip",
}),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
Expand All @@ -69,7 +68,7 @@ export class Messages {
if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 401:
throw new RevertRevertApi.common.UnAuthorizedError(
throw new Vellum.common.UnAuthorizedError(
await serializers.common.BaseError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
Expand All @@ -78,7 +77,7 @@ export class Messages {
})
);
case 500:
throw new RevertRevertApi.common.InternalServerError(
throw new Vellum.common.InternalServerError(
await serializers.common.BaseError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
Expand All @@ -87,7 +86,7 @@ export class Messages {
})
);
case 404:
throw new RevertRevertApi.common.NotFoundError(
throw new Vellum.common.NotFoundError(
await serializers.common.BaseError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
Expand All @@ -96,7 +95,7 @@ export class Messages {
})
);
case 400:
throw new RevertRevertApi.common.BadRequestError(
throw new Vellum.common.BadRequestError(
await serializers.common.BaseError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
Expand All @@ -105,7 +104,7 @@ export class Messages {
})
);
default:
throw new errors.RevertRevertApiError({
throw new errors.VellumError({
statusCode: _response.error.statusCode,
body: _response.error.body,
});
Expand All @@ -114,14 +113,14 @@ export class Messages {

switch (_response.error.reason) {
case "non-json":
throw new errors.RevertRevertApiError({
throw new errors.VellumError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
});
case "timeout":
throw new errors.RevertRevertApiTimeoutError();
throw new errors.VellumTimeoutError();
case "unknown":
throw new errors.RevertRevertApiError({
throw new errors.VellumError({
message: _response.error.errorMessage,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as RevertRevertApi from "../../../../../..";
import * as Vellum from "../../../../../..";

export interface CreateMessageRequest {
/**
Expand All @@ -17,5 +17,5 @@ export interface CreateMessageRequest {
* Optional Revert API version you're using. If missing we default to the latest version of the API.
*/
xApiVersion?: string;
body: RevertRevertApi.chat.CreateorUpdateMessageRequest;
body: Vellum.chat.CreateorUpdateMessageRequest;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as RevertRevertApi from "../../../../..";
import * as Vellum from "../../../../..";

export interface CreateorUpdateMessageRequest extends RevertRevertApi.common.Message {}
export interface CreateorUpdateMessageRequest extends Vellum.common.Message {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as RevertRevertApi from "../../../../..";
import * as Vellum from "../../../../..";

export interface CreateorUpdateMessageResponse {
status: RevertRevertApi.common.ResponseStatus;
result: RevertRevertApi.common.Message;
status: Vellum.common.ResponseStatus;
result: Vellum.common.Message;
}
Loading

0 comments on commit 166845d

Please sign in to comment.