Skip to content

Commit

Permalink
Release 0.0.774
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Mar 15, 2024
1 parent 2d0cf33 commit d370343
Show file tree
Hide file tree
Showing 79 changed files with 485 additions and 348 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.744",
"version": "0.0.774",
"private": false,
"repository": "https://github.com/revertinc/revert-node-ts",
"main": "./index.js",
Expand Down
7 changes: 7 additions & 0 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as core from "./core";
import { Chat } from "./api/resources/chat/client/Client";
import { Connection } from "./api/resources/connection/client/Client";
import { Crm } from "./api/resources/crm/client/Client";
import { FieldMapping } from "./api/resources/fieldMapping/client/Client";
import { Metadata } from "./api/resources/metadata/client/Client";
import { Ticket } from "./api/resources/ticket/client/Client";

Expand Down Expand Up @@ -42,6 +43,12 @@ export class RevertClient {
return (this._crm ??= new Crm(this._options));
}

protected _fieldMapping: FieldMapping | undefined;

public get fieldMapping(): FieldMapping {
return (this._fieldMapping ??= new FieldMapping(this._options));
}

protected _metadata: Metadata | undefined;

public get metadata(): Metadata {
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/chat/resources/channels/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class Channels {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/chat/resources/messages/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Messages {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/chat/resources/users/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class Users {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down
95 changes: 89 additions & 6 deletions src/api/resources/connection/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class Connection {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
"x-revert-t-id": xRevertTId,
Expand Down Expand Up @@ -133,7 +133,7 @@ export class Connection {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
"x-revert-t-id": xRevertTId,
Expand Down Expand Up @@ -223,7 +223,7 @@ export class Connection {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
},
Expand Down Expand Up @@ -312,7 +312,7 @@ export class Connection {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
"x-revert-t-id": xRevertTId,
Expand Down Expand Up @@ -405,7 +405,7 @@ export class Connection {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
"x-revert-t-id": xRevertTId,
Expand Down Expand Up @@ -495,7 +495,7 @@ export class Connection {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
"x-revert-t-id": xRevertTId,
Expand Down Expand Up @@ -564,4 +564,87 @@ export class Connection {
});
}
}

/**
* Get the OAuth connection event status. This endpoint responds with a `http.ServerResponse` instead of `json`.
* @throws {@link Revert.common.UnAuthorizedError}
* @throws {@link Revert.common.InternalServerError}
*/
public async getIntegrationStatus(
revertPublicToken: string,
request: Revert.GetConnectStatusRequest,
requestOptions?: Connection.RequestOptions
): Promise<Revert.GetConnectStatusResponse> {
const { tenantId, xRevertApiToken, xApiVersion } = request;
const _queryParams: Record<string, string | string[]> = {};
_queryParams["tenantId"] = tenantId;
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production,
`connection/integration-status/${revertPublicToken}`
),
method: "GET",
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.GetConnectStatusResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
breadcrumbsPrefix: ["response"],
});
}

if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 401:
throw new Revert.common.UnAuthorizedError(
await serializers.common.BaseError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
breadcrumbsPrefix: ["response"],
})
);
case 500:
throw new Revert.common.InternalServerError(
await serializers.common.BaseError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
breadcrumbsPrefix: ["response"],
})
);
default:
throw new errors.RevertError({
statusCode: _response.error.statusCode,
body: _response.error.body,
});
}
}

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

export interface DeleteAccountFieldMappingConfigRequest {
export interface GetConnectStatusRequest {
tenantId: string;
/**
* Your official API key for accessing revert apis.
*/
xRevertApiToken?: string;
/**
* The unique customer id used when the customer linked their account.
*/
xRevertTId: string;
/**
* The temp used to identify tenant.
*/
xRevertTToken?: string;
xRevertApiToken: string;
/**
* Optional Revert API version you're using. If missing we default to the latest version of the API.
*/
Expand Down
1 change: 1 addition & 0 deletions src/api/resources/connection/client/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export { GetAllConnectionRequest } from "./GetAllConnectionRequest";
export { CreateWebhookRequest } from "./CreateWebhookRequest";
export { GetConnectionWebhookRequest } from "./GetConnectionWebhookRequest";
export { DeleteConnectionWebhookRequest } from "./DeleteConnectionWebhookRequest";
export { GetConnectStatusRequest } from "./GetConnectStatusRequest";
10 changes: 10 additions & 0 deletions src/api/resources/connection/types/ConnectionStatus.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export type ConnectionStatus = "SUCCESS" | "FAILED";

export const ConnectionStatus = {
Success: "SUCCESS",
Failed: "FAILED",
} as const;
13 changes: 13 additions & 0 deletions src/api/resources/connection/types/GetConnectStatusResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Revert from "../../..";

export interface GetConnectStatusResponse {
publicToken: string;
status: Revert.ConnectionStatus;
integrationName: string;
tenantId: string;
tenantSecretToken?: string;
}
2 changes: 2 additions & 0 deletions src/api/resources/connection/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ export * from "./CreateConnectionWebhookResponse";
export * from "./GetConnectionWebhookResponse";
export * from "./CreateConnectionWebhookRequest";
export * from "./DeleteConnectionWebhookResponse";
export * from "./GetConnectStatusResponse";
export * from "./ConnectionStatus";
7 changes: 0 additions & 7 deletions src/api/resources/crm/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Company } from "../resources/company/client/Client";
import { Contact } from "../resources/contact/client/Client";
import { Deal } from "../resources/deal/client/Client";
import { Event } from "../resources/event/client/Client";
import { FieldMapping } from "../resources/fieldMapping/client/Client";
import { Lead } from "../resources/lead/client/Client";
import { Note } from "../resources/note/client/Client";
import { Properties } from "../resources/properties/client/Client";
Expand Down Expand Up @@ -54,12 +53,6 @@ export class Crm {
return (this._event ??= new Event(this._options));
}

protected _fieldMapping: FieldMapping | undefined;

public get fieldMapping(): FieldMapping {
return (this._fieldMapping ??= new FieldMapping(this._options));
}

protected _lead: Lead | undefined;

public get lead(): Lead {
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/crm/resources/company/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class Company {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down Expand Up @@ -153,7 +153,7 @@ export class Company {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down Expand Up @@ -244,7 +244,7 @@ export class Company {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down Expand Up @@ -338,7 +338,7 @@ export class Company {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down Expand Up @@ -434,7 +434,7 @@ export class Company {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/crm/resources/contact/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class Contact {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down Expand Up @@ -153,7 +153,7 @@ export class Contact {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down Expand Up @@ -245,7 +245,7 @@ export class Contact {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down Expand Up @@ -349,7 +349,7 @@ export class Contact {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down Expand Up @@ -456,7 +456,7 @@ export class Contact {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.744",
"X-Fern-SDK-Version": "0.0.774",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down
Loading

0 comments on commit d370343

Please sign in to comment.