Skip to content

Commit

Permalink
Release 0.0.835
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Apr 8, 2024
1 parent 30b7063 commit 3533348
Show file tree
Hide file tree
Showing 32 changed files with 311 additions and 72 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.796",
"version": "0.0.835",
"private": false,
"repository": "https://github.com/revertinc/revert-node-ts",
"main": "./index.js",
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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down
107 changes: 100 additions & 7 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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"x-revert-api-token": xRevertApiToken,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
"x-revert-t-id": xRevertTId,
Expand Down Expand Up @@ -587,7 +587,7 @@ export class Connection {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.796",
"X-Fern-SDK-Version": "0.0.835",
"x-revert-api-token": xRevertApiToken,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
},
Expand Down Expand Up @@ -647,4 +647,97 @@ export class Connection {
});
}
}

/**
* Import multiple connections for a specific environment. Use this to bulk import connections as a one-time exercise.
* @throws {@link Revert.common.UnAuthorizedError}
* @throws {@link Revert.common.InternalServerError}
* @throws {@link Revert.common.NotFoundError}
*/
public async importConnections(
request: Revert.ImportConnectionsRequest,
requestOptions?: Connection.RequestOptions
): Promise<Revert.ImportConnectionsResponse> {
const { xRevertApiToken, xApiVersion, xRevertTId, body: _body } = request;
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production,
"connection/import"
),
method: "POST",
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@revertdotdev/node",
"X-Fern-SDK-Version": "0.0.835",
"x-revert-api-token": xRevertApiToken,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
"x-revert-t-id": xRevertTId,
},
contentType: "application/json",
body: await serializers.ImportConnectionsRequestBody.jsonOrThrow(_body, {
unrecognizedObjectKeys: "strip",
}),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.ImportConnectionsResponse.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"],
})
);
case 404:
throw new Revert.common.NotFoundError(
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
@@ -0,0 +1,21 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

export interface ImportConnectionsRequest {
/**
* Your official API key for accessing revert apis.
*/
xRevertApiToken: string;
/**
* Optional Revert API version you're using. If missing we default to the latest version of the API.
*/
xApiVersion?: string;
/**
* The unique customer id used when the customer linked their account.
*/
xRevertTId: string;
body: Revert.ImportConnectionsRequestBody;
}
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 @@ -5,3 +5,4 @@ export { CreateWebhookRequest } from "./CreateWebhookRequest";
export { GetConnectionWebhookRequest } from "./GetConnectionWebhookRequest";
export { DeleteConnectionWebhookRequest } from "./DeleteConnectionWebhookRequest";
export { GetConnectStatusRequest } from "./GetConnectStatusRequest";
export { ImportConnectionsRequest } from "./ImportConnectionsRequest";
19 changes: 19 additions & 0 deletions src/api/resources/connection/types/ConnectionImport.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

export interface ConnectionImport {
tpId: Revert.common.Tpid;
tpAccessToken: string;
tpRefreshToken: string;
/** The emailId or a unique ID id of the user who connected the app. */
tpCustomerId: string;
tId: string;
tpAccountUrl?: string;
appClientId: string;
appClientSecret: string;
/** Can be obtained from the integration dashboard. */
appId: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

export interface ImportConnectionsRequestBody {
connections: Revert.ConnectionImport[];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

export interface ImportConnectionsResponse {
status: Revert.common.ResponseStatus;
}
3 changes: 3 additions & 0 deletions src/api/resources/connection/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ export * from "./CreateConnectionWebhookRequest";
export * from "./DeleteConnectionWebhookResponse";
export * from "./GetConnectStatusResponse";
export * from "./ConnectionStatus";
export * from "./ConnectionImport";
export * from "./ImportConnectionsRequestBody";
export * from "./ImportConnectionsResponse";
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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"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.796",
"X-Fern-SDK-Version": "0.0.835",
"x-revert-api-token": xRevertApiToken,
"x-revert-t-id": xRevertTId,
"x-api-version": xApiVersion != null ? xApiVersion : undefined,
Expand Down
Loading

0 comments on commit 3533348

Please sign in to comment.