From df548c184ba5285b53060b703e6a54efbfdcc2f6 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 05:02:28 +0000 Subject: [PATCH] Release 0.0.1068 --- package.json | 2 +- src/Client.ts | 7 + src/api/resources/ats/client/Client.ts | 56 ++ src/api/resources/ats/client/index.ts | 1 + src/api/resources/ats/index.ts | 2 + .../ats/resources/candidate/client/Client.ts | 522 ++++++++++++++++++ .../ats/resources/candidate/client/index.ts | 1 + .../client/requests/CreateCandidateRequest.ts | 22 + .../client/requests/DeleteCandidateRequest.ts | 19 + .../client/requests/GetCandidateRequest.ts | 19 + .../client/requests/GetCandidatesRequest.ts | 21 + .../client/requests/UpdateCandidateRequest.ts | 22 + .../candidate/client/requests/index.ts | 5 + .../ats/resources/candidate/index.ts | 2 + .../types/CreateOrUpdateCandidateRequest.ts | 5 + .../types/CreateOrUpdateCandidateResponse.ts | 11 + .../types/DeleteCandidateResponse.ts | 10 + .../candidate/types/GetCandidateResponse.ts | 10 + .../candidate/types/GetCandidatesResponse.ts | 12 + .../ats/resources/candidate/types/index.ts | 5 + .../ats/resources/department/client/Client.ts | 522 ++++++++++++++++++ .../ats/resources/department/client/index.ts | 1 + .../requests/CreateDepartmentRequest.ts | 22 + .../requests/DeleteDepartmentRequest.ts | 19 + .../client/requests/GetDepartmentRequest.ts | 19 + .../client/requests/GetDepartmentsRequest.ts | 21 + .../requests/UpdateDepartmentRequest.ts | 22 + .../department/client/requests/index.ts | 5 + .../ats/resources/department/index.ts | 2 + .../types/CreateOrUpdateDepartmentRequest.ts | 5 + .../types/CreateOrUpdateDepartmentResponse.ts | 11 + .../types/DeleteDepartmentResponse.ts | 10 + .../department/types/GetDepartmentResponse.ts | 10 + .../types/GetDepartmentsResponse.ts | 12 + .../ats/resources/department/types/index.ts | 5 + src/api/resources/ats/resources/index.ts | 15 + .../ats/resources/job/client/Client.ts | 522 ++++++++++++++++++ .../ats/resources/job/client/index.ts | 1 + .../job/client/requests/CreateJobRequest.ts | 22 + .../job/client/requests/DeleteJobRequest.ts | 19 + .../job/client/requests/GetJobRequest.ts | 19 + .../job/client/requests/GetJobsRequest.ts | 21 + .../job/client/requests/UpdateJobRequest.ts | 22 + .../resources/job/client/requests/index.ts | 5 + src/api/resources/ats/resources/job/index.ts | 2 + .../job/types/CreateOrUpdateJobRequest.ts | 5 + .../job/types/CreateOrUpdateJobResponse.ts | 11 + .../resources/job/types/DeleteJobResponse.ts | 10 + .../ats/resources/job/types/GetJobResponse.ts | 10 + .../resources/job/types/GetJobsResponse.ts | 12 + .../ats/resources/job/types/index.ts | 5 + .../ats/resources/offer/client/Client.ts | 522 ++++++++++++++++++ .../ats/resources/offer/client/index.ts | 1 + .../client/requests/CreateOfferRequest.ts | 22 + .../client/requests/DeleteOfferRequest.ts | 19 + .../offer/client/requests/GetOfferRequest.ts | 19 + .../offer/client/requests/GetOffersRequest.ts | 21 + .../client/requests/UpdateOfferRequest.ts | 22 + .../resources/offer/client/requests/index.ts | 5 + .../resources/ats/resources/offer/index.ts | 2 + .../offer/types/CreateOrUpdateOfferRequest.ts | 5 + .../types/CreateOrUpdateOfferResponse.ts | 11 + .../offer/types/DeleteOfferResponse.ts | 10 + .../resources/offer/types/GetOfferResponse.ts | 10 + .../offer/types/GetOffersResponse.ts | 12 + .../ats/resources/offer/types/index.ts | 5 + .../ats/resources/proxy/client/Client.ts | 116 ++++ .../ats/resources/proxy/client/index.ts | 1 + .../proxy/client/requests/PostProxyRequest.ts | 21 + .../resources/proxy/client/requests/index.ts | 1 + .../resources/ats/resources/proxy/index.ts | 2 + .../proxy/types/PostProxyRequestBody.ts | 10 + .../resources/proxy/types/ProxyResponse.ts | 7 + .../ats/resources/proxy/types/index.ts | 2 + .../chat/resources/channels/client/Client.ts | 2 +- .../chat/resources/messages/client/Client.ts | 2 +- .../chat/resources/users/client/Client.ts | 2 +- src/api/resources/connection/client/Client.ts | 16 +- .../crm/resources/company/client/Client.ts | 10 +- .../crm/resources/contact/client/Client.ts | 10 +- .../crm/resources/deal/client/Client.ts | 10 +- .../crm/resources/event/client/Client.ts | 12 +- .../crm/resources/lead/client/Client.ts | 10 +- .../crm/resources/note/client/Client.ts | 10 +- .../crm/resources/properties/client/Client.ts | 4 +- .../crm/resources/proxy/client/Client.ts | 2 +- .../crm/resources/task/client/Client.ts | 10 +- .../crm/resources/user/client/Client.ts | 6 +- .../resources/fieldMapping/client/Client.ts | 12 +- src/api/resources/index.ts | 1 + src/api/resources/metadata/client/Client.ts | 2 +- src/api/resources/sync/client/Client.ts | 2 +- .../resources/collection/client/Client.ts | 2 +- .../ticket/resources/comment/client/Client.ts | 8 +- .../ticket/resources/proxy/client/Client.ts | 2 +- .../ticket/resources/task/client/Client.ts | 8 +- .../ticket/resources/user/client/Client.ts | 4 +- src/serialization/resources/ats/index.ts | 1 + .../ats/resources/candidate/index.ts | 1 + .../types/CreateOrUpdateCandidateRequest.ts | 16 + .../types/CreateOrUpdateCandidateResponse.ts | 24 + .../types/DeleteCandidateResponse.ts | 22 + .../candidate/types/GetCandidateResponse.ts | 22 + .../candidate/types/GetCandidatesResponse.ts | 26 + .../ats/resources/candidate/types/index.ts | 5 + .../ats/resources/department/index.ts | 1 + .../types/CreateOrUpdateDepartmentRequest.ts | 16 + .../types/CreateOrUpdateDepartmentResponse.ts | 24 + .../types/DeleteDepartmentResponse.ts | 22 + .../department/types/GetDepartmentResponse.ts | 22 + .../types/GetDepartmentsResponse.ts | 26 + .../ats/resources/department/types/index.ts | 5 + .../resources/ats/resources/index.ts | 10 + .../resources/ats/resources/job/index.ts | 1 + .../job/types/CreateOrUpdateJobRequest.ts | 16 + .../job/types/CreateOrUpdateJobResponse.ts | 24 + .../resources/job/types/DeleteJobResponse.ts | 22 + .../ats/resources/job/types/GetJobResponse.ts | 22 + .../resources/job/types/GetJobsResponse.ts | 26 + .../ats/resources/job/types/index.ts | 5 + .../resources/ats/resources/offer/index.ts | 1 + .../offer/types/CreateOrUpdateOfferRequest.ts | 16 + .../types/CreateOrUpdateOfferResponse.ts | 24 + .../offer/types/DeleteOfferResponse.ts | 22 + .../resources/offer/types/GetOfferResponse.ts | 22 + .../offer/types/GetOffersResponse.ts | 26 + .../ats/resources/offer/types/index.ts | 5 + .../resources/ats/resources/proxy/index.ts | 1 + .../proxy/types/PostProxyRequestBody.ts | 26 + .../resources/proxy/types/ProxyResponse.ts | 20 + .../ats/resources/proxy/types/index.ts | 2 + src/serialization/resources/index.ts | 1 + 132 files changed, 3585 insertions(+), 74 deletions(-) create mode 100644 src/api/resources/ats/client/Client.ts create mode 100644 src/api/resources/ats/client/index.ts create mode 100644 src/api/resources/ats/index.ts create mode 100644 src/api/resources/ats/resources/candidate/client/Client.ts create mode 100644 src/api/resources/ats/resources/candidate/client/index.ts create mode 100644 src/api/resources/ats/resources/candidate/client/requests/CreateCandidateRequest.ts create mode 100644 src/api/resources/ats/resources/candidate/client/requests/DeleteCandidateRequest.ts create mode 100644 src/api/resources/ats/resources/candidate/client/requests/GetCandidateRequest.ts create mode 100644 src/api/resources/ats/resources/candidate/client/requests/GetCandidatesRequest.ts create mode 100644 src/api/resources/ats/resources/candidate/client/requests/UpdateCandidateRequest.ts create mode 100644 src/api/resources/ats/resources/candidate/client/requests/index.ts create mode 100644 src/api/resources/ats/resources/candidate/index.ts create mode 100644 src/api/resources/ats/resources/candidate/types/CreateOrUpdateCandidateRequest.ts create mode 100644 src/api/resources/ats/resources/candidate/types/CreateOrUpdateCandidateResponse.ts create mode 100644 src/api/resources/ats/resources/candidate/types/DeleteCandidateResponse.ts create mode 100644 src/api/resources/ats/resources/candidate/types/GetCandidateResponse.ts create mode 100644 src/api/resources/ats/resources/candidate/types/GetCandidatesResponse.ts create mode 100644 src/api/resources/ats/resources/candidate/types/index.ts create mode 100644 src/api/resources/ats/resources/department/client/Client.ts create mode 100644 src/api/resources/ats/resources/department/client/index.ts create mode 100644 src/api/resources/ats/resources/department/client/requests/CreateDepartmentRequest.ts create mode 100644 src/api/resources/ats/resources/department/client/requests/DeleteDepartmentRequest.ts create mode 100644 src/api/resources/ats/resources/department/client/requests/GetDepartmentRequest.ts create mode 100644 src/api/resources/ats/resources/department/client/requests/GetDepartmentsRequest.ts create mode 100644 src/api/resources/ats/resources/department/client/requests/UpdateDepartmentRequest.ts create mode 100644 src/api/resources/ats/resources/department/client/requests/index.ts create mode 100644 src/api/resources/ats/resources/department/index.ts create mode 100644 src/api/resources/ats/resources/department/types/CreateOrUpdateDepartmentRequest.ts create mode 100644 src/api/resources/ats/resources/department/types/CreateOrUpdateDepartmentResponse.ts create mode 100644 src/api/resources/ats/resources/department/types/DeleteDepartmentResponse.ts create mode 100644 src/api/resources/ats/resources/department/types/GetDepartmentResponse.ts create mode 100644 src/api/resources/ats/resources/department/types/GetDepartmentsResponse.ts create mode 100644 src/api/resources/ats/resources/department/types/index.ts create mode 100644 src/api/resources/ats/resources/index.ts create mode 100644 src/api/resources/ats/resources/job/client/Client.ts create mode 100644 src/api/resources/ats/resources/job/client/index.ts create mode 100644 src/api/resources/ats/resources/job/client/requests/CreateJobRequest.ts create mode 100644 src/api/resources/ats/resources/job/client/requests/DeleteJobRequest.ts create mode 100644 src/api/resources/ats/resources/job/client/requests/GetJobRequest.ts create mode 100644 src/api/resources/ats/resources/job/client/requests/GetJobsRequest.ts create mode 100644 src/api/resources/ats/resources/job/client/requests/UpdateJobRequest.ts create mode 100644 src/api/resources/ats/resources/job/client/requests/index.ts create mode 100644 src/api/resources/ats/resources/job/index.ts create mode 100644 src/api/resources/ats/resources/job/types/CreateOrUpdateJobRequest.ts create mode 100644 src/api/resources/ats/resources/job/types/CreateOrUpdateJobResponse.ts create mode 100644 src/api/resources/ats/resources/job/types/DeleteJobResponse.ts create mode 100644 src/api/resources/ats/resources/job/types/GetJobResponse.ts create mode 100644 src/api/resources/ats/resources/job/types/GetJobsResponse.ts create mode 100644 src/api/resources/ats/resources/job/types/index.ts create mode 100644 src/api/resources/ats/resources/offer/client/Client.ts create mode 100644 src/api/resources/ats/resources/offer/client/index.ts create mode 100644 src/api/resources/ats/resources/offer/client/requests/CreateOfferRequest.ts create mode 100644 src/api/resources/ats/resources/offer/client/requests/DeleteOfferRequest.ts create mode 100644 src/api/resources/ats/resources/offer/client/requests/GetOfferRequest.ts create mode 100644 src/api/resources/ats/resources/offer/client/requests/GetOffersRequest.ts create mode 100644 src/api/resources/ats/resources/offer/client/requests/UpdateOfferRequest.ts create mode 100644 src/api/resources/ats/resources/offer/client/requests/index.ts create mode 100644 src/api/resources/ats/resources/offer/index.ts create mode 100644 src/api/resources/ats/resources/offer/types/CreateOrUpdateOfferRequest.ts create mode 100644 src/api/resources/ats/resources/offer/types/CreateOrUpdateOfferResponse.ts create mode 100644 src/api/resources/ats/resources/offer/types/DeleteOfferResponse.ts create mode 100644 src/api/resources/ats/resources/offer/types/GetOfferResponse.ts create mode 100644 src/api/resources/ats/resources/offer/types/GetOffersResponse.ts create mode 100644 src/api/resources/ats/resources/offer/types/index.ts create mode 100644 src/api/resources/ats/resources/proxy/client/Client.ts create mode 100644 src/api/resources/ats/resources/proxy/client/index.ts create mode 100644 src/api/resources/ats/resources/proxy/client/requests/PostProxyRequest.ts create mode 100644 src/api/resources/ats/resources/proxy/client/requests/index.ts create mode 100644 src/api/resources/ats/resources/proxy/index.ts create mode 100644 src/api/resources/ats/resources/proxy/types/PostProxyRequestBody.ts create mode 100644 src/api/resources/ats/resources/proxy/types/ProxyResponse.ts create mode 100644 src/api/resources/ats/resources/proxy/types/index.ts create mode 100644 src/serialization/resources/ats/index.ts create mode 100644 src/serialization/resources/ats/resources/candidate/index.ts create mode 100644 src/serialization/resources/ats/resources/candidate/types/CreateOrUpdateCandidateRequest.ts create mode 100644 src/serialization/resources/ats/resources/candidate/types/CreateOrUpdateCandidateResponse.ts create mode 100644 src/serialization/resources/ats/resources/candidate/types/DeleteCandidateResponse.ts create mode 100644 src/serialization/resources/ats/resources/candidate/types/GetCandidateResponse.ts create mode 100644 src/serialization/resources/ats/resources/candidate/types/GetCandidatesResponse.ts create mode 100644 src/serialization/resources/ats/resources/candidate/types/index.ts create mode 100644 src/serialization/resources/ats/resources/department/index.ts create mode 100644 src/serialization/resources/ats/resources/department/types/CreateOrUpdateDepartmentRequest.ts create mode 100644 src/serialization/resources/ats/resources/department/types/CreateOrUpdateDepartmentResponse.ts create mode 100644 src/serialization/resources/ats/resources/department/types/DeleteDepartmentResponse.ts create mode 100644 src/serialization/resources/ats/resources/department/types/GetDepartmentResponse.ts create mode 100644 src/serialization/resources/ats/resources/department/types/GetDepartmentsResponse.ts create mode 100644 src/serialization/resources/ats/resources/department/types/index.ts create mode 100644 src/serialization/resources/ats/resources/index.ts create mode 100644 src/serialization/resources/ats/resources/job/index.ts create mode 100644 src/serialization/resources/ats/resources/job/types/CreateOrUpdateJobRequest.ts create mode 100644 src/serialization/resources/ats/resources/job/types/CreateOrUpdateJobResponse.ts create mode 100644 src/serialization/resources/ats/resources/job/types/DeleteJobResponse.ts create mode 100644 src/serialization/resources/ats/resources/job/types/GetJobResponse.ts create mode 100644 src/serialization/resources/ats/resources/job/types/GetJobsResponse.ts create mode 100644 src/serialization/resources/ats/resources/job/types/index.ts create mode 100644 src/serialization/resources/ats/resources/offer/index.ts create mode 100644 src/serialization/resources/ats/resources/offer/types/CreateOrUpdateOfferRequest.ts create mode 100644 src/serialization/resources/ats/resources/offer/types/CreateOrUpdateOfferResponse.ts create mode 100644 src/serialization/resources/ats/resources/offer/types/DeleteOfferResponse.ts create mode 100644 src/serialization/resources/ats/resources/offer/types/GetOfferResponse.ts create mode 100644 src/serialization/resources/ats/resources/offer/types/GetOffersResponse.ts create mode 100644 src/serialization/resources/ats/resources/offer/types/index.ts create mode 100644 src/serialization/resources/ats/resources/proxy/index.ts create mode 100644 src/serialization/resources/ats/resources/proxy/types/PostProxyRequestBody.ts create mode 100644 src/serialization/resources/ats/resources/proxy/types/ProxyResponse.ts create mode 100644 src/serialization/resources/ats/resources/proxy/types/index.ts diff --git a/package.json b/package.json index 9cfe4e8..7fe8c82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@revertdotdev/node", - "version": "0.0.1067", + "version": "0.0.1068", "private": false, "repository": "https://github.com/revertinc/revert-node-ts", "main": "./index.js", diff --git a/src/Client.ts b/src/Client.ts index 0cfe009..06296fb 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -4,6 +4,7 @@ import * as environments from "./environments"; import * as core from "./core"; +import { Ats } from "./api/resources/ats/client/Client"; import { Chat } from "./api/resources/chat/client/Client"; import { Connection } from "./api/resources/connection/client/Client"; import { Crm } from "./api/resources/crm/client/Client"; @@ -26,6 +27,12 @@ export declare namespace RevertClient { export class RevertClient { constructor(protected readonly _options: RevertClient.Options = {}) {} + protected _ats: Ats | undefined; + + public get ats(): Ats { + return (this._ats ??= new Ats(this._options)); + } + protected _chat: Chat | undefined; public get chat(): Chat { diff --git a/src/api/resources/ats/client/Client.ts b/src/api/resources/ats/client/Client.ts new file mode 100644 index 0000000..e55fbce --- /dev/null +++ b/src/api/resources/ats/client/Client.ts @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import { Candidate } from "../resources/candidate/client/Client"; +import { Department } from "../resources/department/client/Client"; +import { Job } from "../resources/job/client/Client"; +import { Offer } from "../resources/offer/client/Client"; +import { Proxy } from "../resources/proxy/client/Client"; + +export declare namespace Ats { + interface Options { + environment?: core.Supplier; + } + + interface RequestOptions { + timeoutInSeconds?: number; + maxRetries?: number; + } +} + +export class Ats { + constructor(protected readonly _options: Ats.Options = {}) {} + + protected _candidate: Candidate | undefined; + + public get candidate(): Candidate { + return (this._candidate ??= new Candidate(this._options)); + } + + protected _department: Department | undefined; + + public get department(): Department { + return (this._department ??= new Department(this._options)); + } + + protected _job: Job | undefined; + + public get job(): Job { + return (this._job ??= new Job(this._options)); + } + + protected _offer: Offer | undefined; + + public get offer(): Offer { + return (this._offer ??= new Offer(this._options)); + } + + protected _proxy: Proxy | undefined; + + public get proxy(): Proxy { + return (this._proxy ??= new Proxy(this._options)); + } +} diff --git a/src/api/resources/ats/client/index.ts b/src/api/resources/ats/client/index.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/api/resources/ats/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/ats/index.ts b/src/api/resources/ats/index.ts new file mode 100644 index 0000000..4ce0f39 --- /dev/null +++ b/src/api/resources/ats/index.ts @@ -0,0 +1,2 @@ +export * from "./resources"; +export * from "./client"; diff --git a/src/api/resources/ats/resources/candidate/client/Client.ts b/src/api/resources/ats/resources/candidate/client/Client.ts new file mode 100644 index 0000000..11d3e04 --- /dev/null +++ b/src/api/resources/ats/resources/candidate/client/Client.ts @@ -0,0 +1,522 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../../../environments"; +import * as core from "../../../../../../core"; +import * as Revert from "../../../../.."; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization"; +import * as errors from "../../../../../../errors"; + +export declare namespace Candidate { + interface Options { + environment?: core.Supplier; + } + + interface RequestOptions { + timeoutInSeconds?: number; + maxRetries?: number; + } +} + +export class Candidate { + constructor(protected readonly _options: Candidate.Options = {}) {} + + /** + * Get details of a candidate. + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async getCandidate( + id: string, + request: Revert.ats.GetCandidateRequest, + requestOptions?: Candidate.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/candidates/${id}` + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.GetCandidateResponse.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, + }); + } + } + + /** + * Get all the Candidates. + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async getCandidates( + request: Revert.ats.GetCandidatesRequest, + requestOptions?: Candidate.RequestOptions + ): Promise { + const { fields, pageSize, cursor, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + if (pageSize != null) { + _queryParams["pageSize"] = pageSize; + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + "/ats/candidates" + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.GetCandidatesResponse.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, + }); + } + } + + /** + * Create a new Candidate + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async createCandidate( + request: Revert.ats.CreateCandidateRequest, + requestOptions?: Candidate.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion, body: _body } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + "/ats/candidates" + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "x-revert-api-token": xRevertApiToken, + "x-revert-t-id": xRevertTId, + "x-api-version": xApiVersion != null ? xApiVersion : undefined, + }, + contentType: "application/json", + queryParameters: _queryParams, + body: await serializers.ats.CreateOrUpdateCandidateRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.CreateOrUpdateCandidateResponse.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, + }); + } + } + + /** + * Update a Candidate + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async updateCandidate( + id: string, + request: Revert.ats.UpdateCandidateRequest, + requestOptions?: Candidate.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion, body: _body } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/candidates/${id}` + ), + method: "PATCH", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "x-revert-api-token": xRevertApiToken, + "x-revert-t-id": xRevertTId, + "x-api-version": xApiVersion != null ? xApiVersion : undefined, + }, + contentType: "application/json", + queryParameters: _queryParams, + body: await serializers.ats.CreateOrUpdateCandidateRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.CreateOrUpdateCandidateResponse.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, + }); + } + } + + /** + * Delete details of an Candidate + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async deleteCandidate( + id: string, + request: Revert.ats.DeleteCandidateRequest, + requestOptions?: Candidate.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/candidates/${id}` + ), + method: "DELETE", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.DeleteCandidateResponse.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, + }); + } + } +} diff --git a/src/api/resources/ats/resources/candidate/client/index.ts b/src/api/resources/ats/resources/candidate/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/ats/resources/candidate/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/ats/resources/candidate/client/requests/CreateCandidateRequest.ts b/src/api/resources/ats/resources/candidate/client/requests/CreateCandidateRequest.ts new file mode 100644 index 0000000..d2a84ef --- /dev/null +++ b/src/api/resources/ats/resources/candidate/client/requests/CreateCandidateRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../../.."; + +export interface CreateCandidateRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; + body?: Revert.ats.CreateOrUpdateCandidateRequest; +} diff --git a/src/api/resources/ats/resources/candidate/client/requests/DeleteCandidateRequest.ts b/src/api/resources/ats/resources/candidate/client/requests/DeleteCandidateRequest.ts new file mode 100644 index 0000000..a8d4fdf --- /dev/null +++ b/src/api/resources/ats/resources/candidate/client/requests/DeleteCandidateRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface DeleteCandidateRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/candidate/client/requests/GetCandidateRequest.ts b/src/api/resources/ats/resources/candidate/client/requests/GetCandidateRequest.ts new file mode 100644 index 0000000..0747980 --- /dev/null +++ b/src/api/resources/ats/resources/candidate/client/requests/GetCandidateRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface GetCandidateRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/candidate/client/requests/GetCandidatesRequest.ts b/src/api/resources/ats/resources/candidate/client/requests/GetCandidatesRequest.ts new file mode 100644 index 0000000..a808c93 --- /dev/null +++ b/src/api/resources/ats/resources/candidate/client/requests/GetCandidatesRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface GetCandidatesRequest { + fields?: string; + pageSize?: string; + cursor?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/candidate/client/requests/UpdateCandidateRequest.ts b/src/api/resources/ats/resources/candidate/client/requests/UpdateCandidateRequest.ts new file mode 100644 index 0000000..8f31acd --- /dev/null +++ b/src/api/resources/ats/resources/candidate/client/requests/UpdateCandidateRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../../.."; + +export interface UpdateCandidateRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; + body?: Revert.ats.CreateOrUpdateCandidateRequest; +} diff --git a/src/api/resources/ats/resources/candidate/client/requests/index.ts b/src/api/resources/ats/resources/candidate/client/requests/index.ts new file mode 100644 index 0000000..34985d0 --- /dev/null +++ b/src/api/resources/ats/resources/candidate/client/requests/index.ts @@ -0,0 +1,5 @@ +export { GetCandidateRequest } from "./GetCandidateRequest"; +export { GetCandidatesRequest } from "./GetCandidatesRequest"; +export { CreateCandidateRequest } from "./CreateCandidateRequest"; +export { UpdateCandidateRequest } from "./UpdateCandidateRequest"; +export { DeleteCandidateRequest } from "./DeleteCandidateRequest"; diff --git a/src/api/resources/ats/resources/candidate/index.ts b/src/api/resources/ats/resources/candidate/index.ts new file mode 100644 index 0000000..c9240f8 --- /dev/null +++ b/src/api/resources/ats/resources/candidate/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/ats/resources/candidate/types/CreateOrUpdateCandidateRequest.ts b/src/api/resources/ats/resources/candidate/types/CreateOrUpdateCandidateRequest.ts new file mode 100644 index 0000000..942d588 --- /dev/null +++ b/src/api/resources/ats/resources/candidate/types/CreateOrUpdateCandidateRequest.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type CreateOrUpdateCandidateRequest = unknown; diff --git a/src/api/resources/ats/resources/candidate/types/CreateOrUpdateCandidateResponse.ts b/src/api/resources/ats/resources/candidate/types/CreateOrUpdateCandidateResponse.ts new file mode 100644 index 0000000..29d7a73 --- /dev/null +++ b/src/api/resources/ats/resources/candidate/types/CreateOrUpdateCandidateResponse.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface CreateOrUpdateCandidateResponse { + status: Revert.common.ResponseStatus; + message: string; + result?: unknown; +} diff --git a/src/api/resources/ats/resources/candidate/types/DeleteCandidateResponse.ts b/src/api/resources/ats/resources/candidate/types/DeleteCandidateResponse.ts new file mode 100644 index 0000000..0796a59 --- /dev/null +++ b/src/api/resources/ats/resources/candidate/types/DeleteCandidateResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface DeleteCandidateResponse { + status: Revert.common.ResponseStatus; + message: string; +} diff --git a/src/api/resources/ats/resources/candidate/types/GetCandidateResponse.ts b/src/api/resources/ats/resources/candidate/types/GetCandidateResponse.ts new file mode 100644 index 0000000..9797067 --- /dev/null +++ b/src/api/resources/ats/resources/candidate/types/GetCandidateResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface GetCandidateResponse { + status: Revert.common.ResponseStatus; + result?: unknown; +} diff --git a/src/api/resources/ats/resources/candidate/types/GetCandidatesResponse.ts b/src/api/resources/ats/resources/candidate/types/GetCandidatesResponse.ts new file mode 100644 index 0000000..4eff4fd --- /dev/null +++ b/src/api/resources/ats/resources/candidate/types/GetCandidatesResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface GetCandidatesResponse { + status: Revert.common.ResponseStatus; + next?: string; + previous?: string; + results?: unknown; +} diff --git a/src/api/resources/ats/resources/candidate/types/index.ts b/src/api/resources/ats/resources/candidate/types/index.ts new file mode 100644 index 0000000..079f77f --- /dev/null +++ b/src/api/resources/ats/resources/candidate/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetCandidateResponse"; +export * from "./GetCandidatesResponse"; +export * from "./CreateOrUpdateCandidateRequest"; +export * from "./CreateOrUpdateCandidateResponse"; +export * from "./DeleteCandidateResponse"; diff --git a/src/api/resources/ats/resources/department/client/Client.ts b/src/api/resources/ats/resources/department/client/Client.ts new file mode 100644 index 0000000..167dcc6 --- /dev/null +++ b/src/api/resources/ats/resources/department/client/Client.ts @@ -0,0 +1,522 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../../../environments"; +import * as core from "../../../../../../core"; +import * as Revert from "../../../../.."; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization"; +import * as errors from "../../../../../../errors"; + +export declare namespace Department { + interface Options { + environment?: core.Supplier; + } + + interface RequestOptions { + timeoutInSeconds?: number; + maxRetries?: number; + } +} + +export class Department { + constructor(protected readonly _options: Department.Options = {}) {} + + /** + * Get details of a department. + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async getDepartment( + id: string, + request: Revert.ats.GetDepartmentRequest, + requestOptions?: Department.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/departments/${id}` + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.GetDepartmentResponse.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, + }); + } + } + + /** + * Get all the departments. + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async getDepartments( + request: Revert.ats.GetDepartmentsRequest, + requestOptions?: Department.RequestOptions + ): Promise { + const { fields, pageSize, cursor, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + if (pageSize != null) { + _queryParams["pageSize"] = pageSize; + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + "/ats/departments" + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.GetDepartmentsResponse.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, + }); + } + } + + /** + * Create a new Department + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async createDepartment( + request: Revert.ats.CreateDepartmentRequest, + requestOptions?: Department.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion, body: _body } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + "/ats/departments" + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "x-revert-api-token": xRevertApiToken, + "x-revert-t-id": xRevertTId, + "x-api-version": xApiVersion != null ? xApiVersion : undefined, + }, + contentType: "application/json", + queryParameters: _queryParams, + body: await serializers.ats.CreateOrUpdateDepartmentRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.CreateOrUpdateDepartmentResponse.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, + }); + } + } + + /** + * Update a Department + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async updateDepartment( + id: string, + request: Revert.ats.UpdateDepartmentRequest, + requestOptions?: Department.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion, body: _body } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/departments/${id}` + ), + method: "PATCH", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "x-revert-api-token": xRevertApiToken, + "x-revert-t-id": xRevertTId, + "x-api-version": xApiVersion != null ? xApiVersion : undefined, + }, + contentType: "application/json", + queryParameters: _queryParams, + body: await serializers.ats.CreateOrUpdateDepartmentRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.CreateOrUpdateDepartmentResponse.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, + }); + } + } + + /** + * Delete details of an Department + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async deleteDepartment( + id: string, + request: Revert.ats.DeleteDepartmentRequest, + requestOptions?: Department.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/departments/${id}` + ), + method: "DELETE", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.DeleteDepartmentResponse.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, + }); + } + } +} diff --git a/src/api/resources/ats/resources/department/client/index.ts b/src/api/resources/ats/resources/department/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/ats/resources/department/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/ats/resources/department/client/requests/CreateDepartmentRequest.ts b/src/api/resources/ats/resources/department/client/requests/CreateDepartmentRequest.ts new file mode 100644 index 0000000..a52f390 --- /dev/null +++ b/src/api/resources/ats/resources/department/client/requests/CreateDepartmentRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../../.."; + +export interface CreateDepartmentRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; + body?: Revert.ats.CreateOrUpdateDepartmentRequest; +} diff --git a/src/api/resources/ats/resources/department/client/requests/DeleteDepartmentRequest.ts b/src/api/resources/ats/resources/department/client/requests/DeleteDepartmentRequest.ts new file mode 100644 index 0000000..a2f33be --- /dev/null +++ b/src/api/resources/ats/resources/department/client/requests/DeleteDepartmentRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface DeleteDepartmentRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/department/client/requests/GetDepartmentRequest.ts b/src/api/resources/ats/resources/department/client/requests/GetDepartmentRequest.ts new file mode 100644 index 0000000..25e9530 --- /dev/null +++ b/src/api/resources/ats/resources/department/client/requests/GetDepartmentRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface GetDepartmentRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/department/client/requests/GetDepartmentsRequest.ts b/src/api/resources/ats/resources/department/client/requests/GetDepartmentsRequest.ts new file mode 100644 index 0000000..b07c7a4 --- /dev/null +++ b/src/api/resources/ats/resources/department/client/requests/GetDepartmentsRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface GetDepartmentsRequest { + fields?: string; + pageSize?: string; + cursor?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/department/client/requests/UpdateDepartmentRequest.ts b/src/api/resources/ats/resources/department/client/requests/UpdateDepartmentRequest.ts new file mode 100644 index 0000000..cefb6cb --- /dev/null +++ b/src/api/resources/ats/resources/department/client/requests/UpdateDepartmentRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../../.."; + +export interface UpdateDepartmentRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; + body?: Revert.ats.CreateOrUpdateDepartmentRequest; +} diff --git a/src/api/resources/ats/resources/department/client/requests/index.ts b/src/api/resources/ats/resources/department/client/requests/index.ts new file mode 100644 index 0000000..71ba949 --- /dev/null +++ b/src/api/resources/ats/resources/department/client/requests/index.ts @@ -0,0 +1,5 @@ +export { GetDepartmentRequest } from "./GetDepartmentRequest"; +export { GetDepartmentsRequest } from "./GetDepartmentsRequest"; +export { CreateDepartmentRequest } from "./CreateDepartmentRequest"; +export { UpdateDepartmentRequest } from "./UpdateDepartmentRequest"; +export { DeleteDepartmentRequest } from "./DeleteDepartmentRequest"; diff --git a/src/api/resources/ats/resources/department/index.ts b/src/api/resources/ats/resources/department/index.ts new file mode 100644 index 0000000..c9240f8 --- /dev/null +++ b/src/api/resources/ats/resources/department/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/ats/resources/department/types/CreateOrUpdateDepartmentRequest.ts b/src/api/resources/ats/resources/department/types/CreateOrUpdateDepartmentRequest.ts new file mode 100644 index 0000000..1fe622f --- /dev/null +++ b/src/api/resources/ats/resources/department/types/CreateOrUpdateDepartmentRequest.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type CreateOrUpdateDepartmentRequest = unknown; diff --git a/src/api/resources/ats/resources/department/types/CreateOrUpdateDepartmentResponse.ts b/src/api/resources/ats/resources/department/types/CreateOrUpdateDepartmentResponse.ts new file mode 100644 index 0000000..3389ef1 --- /dev/null +++ b/src/api/resources/ats/resources/department/types/CreateOrUpdateDepartmentResponse.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface CreateOrUpdateDepartmentResponse { + status: Revert.common.ResponseStatus; + message: string; + result?: unknown; +} diff --git a/src/api/resources/ats/resources/department/types/DeleteDepartmentResponse.ts b/src/api/resources/ats/resources/department/types/DeleteDepartmentResponse.ts new file mode 100644 index 0000000..64c3031 --- /dev/null +++ b/src/api/resources/ats/resources/department/types/DeleteDepartmentResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface DeleteDepartmentResponse { + status: Revert.common.ResponseStatus; + message: string; +} diff --git a/src/api/resources/ats/resources/department/types/GetDepartmentResponse.ts b/src/api/resources/ats/resources/department/types/GetDepartmentResponse.ts new file mode 100644 index 0000000..bb801ab --- /dev/null +++ b/src/api/resources/ats/resources/department/types/GetDepartmentResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface GetDepartmentResponse { + status: Revert.common.ResponseStatus; + result?: unknown; +} diff --git a/src/api/resources/ats/resources/department/types/GetDepartmentsResponse.ts b/src/api/resources/ats/resources/department/types/GetDepartmentsResponse.ts new file mode 100644 index 0000000..2ba1ea8 --- /dev/null +++ b/src/api/resources/ats/resources/department/types/GetDepartmentsResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface GetDepartmentsResponse { + status: Revert.common.ResponseStatus; + next?: string; + previous?: string; + results?: unknown; +} diff --git a/src/api/resources/ats/resources/department/types/index.ts b/src/api/resources/ats/resources/department/types/index.ts new file mode 100644 index 0000000..f3c0d6e --- /dev/null +++ b/src/api/resources/ats/resources/department/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetDepartmentResponse"; +export * from "./GetDepartmentsResponse"; +export * from "./CreateOrUpdateDepartmentRequest"; +export * from "./CreateOrUpdateDepartmentResponse"; +export * from "./DeleteDepartmentResponse"; diff --git a/src/api/resources/ats/resources/index.ts b/src/api/resources/ats/resources/index.ts new file mode 100644 index 0000000..e08421f --- /dev/null +++ b/src/api/resources/ats/resources/index.ts @@ -0,0 +1,15 @@ +export * as candidate from "./candidate"; +export * from "./candidate/types"; +export * as department from "./department"; +export * from "./department/types"; +export * as job from "./job"; +export * from "./job/types"; +export * as offer from "./offer"; +export * from "./offer/types"; +export * as proxy from "./proxy"; +export * from "./proxy/types"; +export * from "./candidate/client/requests"; +export * from "./department/client/requests"; +export * from "./job/client/requests"; +export * from "./offer/client/requests"; +export * from "./proxy/client/requests"; diff --git a/src/api/resources/ats/resources/job/client/Client.ts b/src/api/resources/ats/resources/job/client/Client.ts new file mode 100644 index 0000000..f112ca7 --- /dev/null +++ b/src/api/resources/ats/resources/job/client/Client.ts @@ -0,0 +1,522 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../../../environments"; +import * as core from "../../../../../../core"; +import * as Revert from "../../../../.."; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization"; +import * as errors from "../../../../../../errors"; + +export declare namespace Job { + interface Options { + environment?: core.Supplier; + } + + interface RequestOptions { + timeoutInSeconds?: number; + maxRetries?: number; + } +} + +export class Job { + constructor(protected readonly _options: Job.Options = {}) {} + + /** + * Get details of a job. + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async getJob( + id: string, + request: Revert.ats.GetJobRequest, + requestOptions?: Job.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/jobs/${id}` + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.GetJobResponse.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, + }); + } + } + + /** + * Get all the jobs. + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async getJobs( + request: Revert.ats.GetJobsRequest, + requestOptions?: Job.RequestOptions + ): Promise { + const { fields, pageSize, cursor, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + if (pageSize != null) { + _queryParams["pageSize"] = pageSize; + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + "/ats/jobs" + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.GetJobsResponse.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, + }); + } + } + + /** + * Create a new Job + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async createJob( + request: Revert.ats.CreateJobRequest, + requestOptions?: Job.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion, body: _body } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + "/ats/jobs" + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "x-revert-api-token": xRevertApiToken, + "x-revert-t-id": xRevertTId, + "x-api-version": xApiVersion != null ? xApiVersion : undefined, + }, + contentType: "application/json", + queryParameters: _queryParams, + body: await serializers.ats.CreateOrUpdateJobRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.CreateOrUpdateJobResponse.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, + }); + } + } + + /** + * Update a Job + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async updateJob( + id: string, + request: Revert.ats.UpdateJobRequest, + requestOptions?: Job.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion, body: _body } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/jobs/${id}` + ), + method: "PATCH", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "x-revert-api-token": xRevertApiToken, + "x-revert-t-id": xRevertTId, + "x-api-version": xApiVersion != null ? xApiVersion : undefined, + }, + contentType: "application/json", + queryParameters: _queryParams, + body: await serializers.ats.CreateOrUpdateJobRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.CreateOrUpdateJobResponse.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, + }); + } + } + + /** + * Delete details of an Job + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async deleteJob( + id: string, + request: Revert.ats.DeleteJobRequest, + requestOptions?: Job.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/jobs/${id}` + ), + method: "DELETE", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.DeleteJobResponse.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, + }); + } + } +} diff --git a/src/api/resources/ats/resources/job/client/index.ts b/src/api/resources/ats/resources/job/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/ats/resources/job/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/ats/resources/job/client/requests/CreateJobRequest.ts b/src/api/resources/ats/resources/job/client/requests/CreateJobRequest.ts new file mode 100644 index 0000000..ad33561 --- /dev/null +++ b/src/api/resources/ats/resources/job/client/requests/CreateJobRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../../.."; + +export interface CreateJobRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; + body?: Revert.ats.CreateOrUpdateJobRequest; +} diff --git a/src/api/resources/ats/resources/job/client/requests/DeleteJobRequest.ts b/src/api/resources/ats/resources/job/client/requests/DeleteJobRequest.ts new file mode 100644 index 0000000..9be2f05 --- /dev/null +++ b/src/api/resources/ats/resources/job/client/requests/DeleteJobRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface DeleteJobRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/job/client/requests/GetJobRequest.ts b/src/api/resources/ats/resources/job/client/requests/GetJobRequest.ts new file mode 100644 index 0000000..afc3c0f --- /dev/null +++ b/src/api/resources/ats/resources/job/client/requests/GetJobRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface GetJobRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/job/client/requests/GetJobsRequest.ts b/src/api/resources/ats/resources/job/client/requests/GetJobsRequest.ts new file mode 100644 index 0000000..22f8bcc --- /dev/null +++ b/src/api/resources/ats/resources/job/client/requests/GetJobsRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface GetJobsRequest { + fields?: string; + pageSize?: string; + cursor?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/job/client/requests/UpdateJobRequest.ts b/src/api/resources/ats/resources/job/client/requests/UpdateJobRequest.ts new file mode 100644 index 0000000..26d896f --- /dev/null +++ b/src/api/resources/ats/resources/job/client/requests/UpdateJobRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../../.."; + +export interface UpdateJobRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; + body?: Revert.ats.CreateOrUpdateJobRequest; +} diff --git a/src/api/resources/ats/resources/job/client/requests/index.ts b/src/api/resources/ats/resources/job/client/requests/index.ts new file mode 100644 index 0000000..b412e42 --- /dev/null +++ b/src/api/resources/ats/resources/job/client/requests/index.ts @@ -0,0 +1,5 @@ +export { GetJobRequest } from "./GetJobRequest"; +export { GetJobsRequest } from "./GetJobsRequest"; +export { CreateJobRequest } from "./CreateJobRequest"; +export { UpdateJobRequest } from "./UpdateJobRequest"; +export { DeleteJobRequest } from "./DeleteJobRequest"; diff --git a/src/api/resources/ats/resources/job/index.ts b/src/api/resources/ats/resources/job/index.ts new file mode 100644 index 0000000..c9240f8 --- /dev/null +++ b/src/api/resources/ats/resources/job/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/ats/resources/job/types/CreateOrUpdateJobRequest.ts b/src/api/resources/ats/resources/job/types/CreateOrUpdateJobRequest.ts new file mode 100644 index 0000000..d3c97df --- /dev/null +++ b/src/api/resources/ats/resources/job/types/CreateOrUpdateJobRequest.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type CreateOrUpdateJobRequest = unknown; diff --git a/src/api/resources/ats/resources/job/types/CreateOrUpdateJobResponse.ts b/src/api/resources/ats/resources/job/types/CreateOrUpdateJobResponse.ts new file mode 100644 index 0000000..160bb01 --- /dev/null +++ b/src/api/resources/ats/resources/job/types/CreateOrUpdateJobResponse.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface CreateOrUpdateJobResponse { + status: Revert.common.ResponseStatus; + message: string; + result?: unknown; +} diff --git a/src/api/resources/ats/resources/job/types/DeleteJobResponse.ts b/src/api/resources/ats/resources/job/types/DeleteJobResponse.ts new file mode 100644 index 0000000..b9b0524 --- /dev/null +++ b/src/api/resources/ats/resources/job/types/DeleteJobResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface DeleteJobResponse { + status: Revert.common.ResponseStatus; + message: string; +} diff --git a/src/api/resources/ats/resources/job/types/GetJobResponse.ts b/src/api/resources/ats/resources/job/types/GetJobResponse.ts new file mode 100644 index 0000000..644fa36 --- /dev/null +++ b/src/api/resources/ats/resources/job/types/GetJobResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface GetJobResponse { + status: Revert.common.ResponseStatus; + result?: unknown; +} diff --git a/src/api/resources/ats/resources/job/types/GetJobsResponse.ts b/src/api/resources/ats/resources/job/types/GetJobsResponse.ts new file mode 100644 index 0000000..a09b802 --- /dev/null +++ b/src/api/resources/ats/resources/job/types/GetJobsResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface GetJobsResponse { + status: Revert.common.ResponseStatus; + next?: string; + previous?: string; + results?: unknown; +} diff --git a/src/api/resources/ats/resources/job/types/index.ts b/src/api/resources/ats/resources/job/types/index.ts new file mode 100644 index 0000000..e3fede7 --- /dev/null +++ b/src/api/resources/ats/resources/job/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetJobResponse"; +export * from "./GetJobsResponse"; +export * from "./CreateOrUpdateJobRequest"; +export * from "./CreateOrUpdateJobResponse"; +export * from "./DeleteJobResponse"; diff --git a/src/api/resources/ats/resources/offer/client/Client.ts b/src/api/resources/ats/resources/offer/client/Client.ts new file mode 100644 index 0000000..cb698b2 --- /dev/null +++ b/src/api/resources/ats/resources/offer/client/Client.ts @@ -0,0 +1,522 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../../../environments"; +import * as core from "../../../../../../core"; +import * as Revert from "../../../../.."; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization"; +import * as errors from "../../../../../../errors"; + +export declare namespace Offer { + interface Options { + environment?: core.Supplier; + } + + interface RequestOptions { + timeoutInSeconds?: number; + maxRetries?: number; + } +} + +export class Offer { + constructor(protected readonly _options: Offer.Options = {}) {} + + /** + * Get details of a offer. + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async getOffer( + id: string, + request: Revert.ats.GetOfferRequest, + requestOptions?: Offer.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/offers/${id}` + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.GetOfferResponse.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, + }); + } + } + + /** + * Get all the offers. + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async getOffers( + request: Revert.ats.GetOffersRequest, + requestOptions?: Offer.RequestOptions + ): Promise { + const { fields, pageSize, cursor, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + if (pageSize != null) { + _queryParams["pageSize"] = pageSize; + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + "/ats/offers" + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.GetOffersResponse.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, + }); + } + } + + /** + * Create a new Offer + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async createOffer( + request: Revert.ats.CreateOfferRequest, + requestOptions?: Offer.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion, body: _body } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + "/ats/offers" + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "x-revert-api-token": xRevertApiToken, + "x-revert-t-id": xRevertTId, + "x-api-version": xApiVersion != null ? xApiVersion : undefined, + }, + contentType: "application/json", + queryParameters: _queryParams, + body: await serializers.ats.CreateOrUpdateOfferRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.CreateOrUpdateOfferResponse.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, + }); + } + } + + /** + * Update a Offer + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async updateOffer( + id: string, + request: Revert.ats.UpdateOfferRequest, + requestOptions?: Offer.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion, body: _body } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/offers/${id}` + ), + method: "PATCH", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "x-revert-api-token": xRevertApiToken, + "x-revert-t-id": xRevertTId, + "x-api-version": xApiVersion != null ? xApiVersion : undefined, + }, + contentType: "application/json", + queryParameters: _queryParams, + body: await serializers.ats.CreateOrUpdateOfferRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.CreateOrUpdateOfferResponse.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, + }); + } + } + + /** + * Delete details of an Offer + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async deleteOffer( + id: string, + request: Revert.ats.DeleteOfferRequest, + requestOptions?: Offer.RequestOptions + ): Promise { + const { fields, xRevertApiToken, xRevertTId, xApiVersion } = request; + const _queryParams: Record = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + `/ats/offers/${id}` + ), + method: "DELETE", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "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 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.DeleteOfferResponse.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, + }); + } + } +} diff --git a/src/api/resources/ats/resources/offer/client/index.ts b/src/api/resources/ats/resources/offer/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/ats/resources/offer/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/ats/resources/offer/client/requests/CreateOfferRequest.ts b/src/api/resources/ats/resources/offer/client/requests/CreateOfferRequest.ts new file mode 100644 index 0000000..e157bc5 --- /dev/null +++ b/src/api/resources/ats/resources/offer/client/requests/CreateOfferRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../../.."; + +export interface CreateOfferRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; + body?: Revert.ats.CreateOrUpdateOfferRequest; +} diff --git a/src/api/resources/ats/resources/offer/client/requests/DeleteOfferRequest.ts b/src/api/resources/ats/resources/offer/client/requests/DeleteOfferRequest.ts new file mode 100644 index 0000000..6bb4b63 --- /dev/null +++ b/src/api/resources/ats/resources/offer/client/requests/DeleteOfferRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface DeleteOfferRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/offer/client/requests/GetOfferRequest.ts b/src/api/resources/ats/resources/offer/client/requests/GetOfferRequest.ts new file mode 100644 index 0000000..6e8e46d --- /dev/null +++ b/src/api/resources/ats/resources/offer/client/requests/GetOfferRequest.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface GetOfferRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/offer/client/requests/GetOffersRequest.ts b/src/api/resources/ats/resources/offer/client/requests/GetOffersRequest.ts new file mode 100644 index 0000000..6986b70 --- /dev/null +++ b/src/api/resources/ats/resources/offer/client/requests/GetOffersRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface GetOffersRequest { + fields?: string; + pageSize?: string; + cursor?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; +} diff --git a/src/api/resources/ats/resources/offer/client/requests/UpdateOfferRequest.ts b/src/api/resources/ats/resources/offer/client/requests/UpdateOfferRequest.ts new file mode 100644 index 0000000..7d072bd --- /dev/null +++ b/src/api/resources/ats/resources/offer/client/requests/UpdateOfferRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../../.."; + +export interface UpdateOfferRequest { + fields?: string; + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; + body?: Revert.ats.CreateOrUpdateOfferRequest; +} diff --git a/src/api/resources/ats/resources/offer/client/requests/index.ts b/src/api/resources/ats/resources/offer/client/requests/index.ts new file mode 100644 index 0000000..b63fd99 --- /dev/null +++ b/src/api/resources/ats/resources/offer/client/requests/index.ts @@ -0,0 +1,5 @@ +export { GetOfferRequest } from "./GetOfferRequest"; +export { GetOffersRequest } from "./GetOffersRequest"; +export { CreateOfferRequest } from "./CreateOfferRequest"; +export { UpdateOfferRequest } from "./UpdateOfferRequest"; +export { DeleteOfferRequest } from "./DeleteOfferRequest"; diff --git a/src/api/resources/ats/resources/offer/index.ts b/src/api/resources/ats/resources/offer/index.ts new file mode 100644 index 0000000..c9240f8 --- /dev/null +++ b/src/api/resources/ats/resources/offer/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/ats/resources/offer/types/CreateOrUpdateOfferRequest.ts b/src/api/resources/ats/resources/offer/types/CreateOrUpdateOfferRequest.ts new file mode 100644 index 0000000..ff0d019 --- /dev/null +++ b/src/api/resources/ats/resources/offer/types/CreateOrUpdateOfferRequest.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type CreateOrUpdateOfferRequest = unknown; diff --git a/src/api/resources/ats/resources/offer/types/CreateOrUpdateOfferResponse.ts b/src/api/resources/ats/resources/offer/types/CreateOrUpdateOfferResponse.ts new file mode 100644 index 0000000..0ac39c2 --- /dev/null +++ b/src/api/resources/ats/resources/offer/types/CreateOrUpdateOfferResponse.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface CreateOrUpdateOfferResponse { + status: Revert.common.ResponseStatus; + message: string; + result?: unknown; +} diff --git a/src/api/resources/ats/resources/offer/types/DeleteOfferResponse.ts b/src/api/resources/ats/resources/offer/types/DeleteOfferResponse.ts new file mode 100644 index 0000000..1a2fd1a --- /dev/null +++ b/src/api/resources/ats/resources/offer/types/DeleteOfferResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface DeleteOfferResponse { + status: Revert.common.ResponseStatus; + message: string; +} diff --git a/src/api/resources/ats/resources/offer/types/GetOfferResponse.ts b/src/api/resources/ats/resources/offer/types/GetOfferResponse.ts new file mode 100644 index 0000000..56b1c63 --- /dev/null +++ b/src/api/resources/ats/resources/offer/types/GetOfferResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface GetOfferResponse { + status: Revert.common.ResponseStatus; + result?: unknown; +} diff --git a/src/api/resources/ats/resources/offer/types/GetOffersResponse.ts b/src/api/resources/ats/resources/offer/types/GetOffersResponse.ts new file mode 100644 index 0000000..46ea841 --- /dev/null +++ b/src/api/resources/ats/resources/offer/types/GetOffersResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../.."; + +export interface GetOffersResponse { + status: Revert.common.ResponseStatus; + next?: string; + previous?: string; + results?: unknown; +} diff --git a/src/api/resources/ats/resources/offer/types/index.ts b/src/api/resources/ats/resources/offer/types/index.ts new file mode 100644 index 0000000..abefdc0 --- /dev/null +++ b/src/api/resources/ats/resources/offer/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetOfferResponse"; +export * from "./GetOffersResponse"; +export * from "./CreateOrUpdateOfferRequest"; +export * from "./CreateOrUpdateOfferResponse"; +export * from "./DeleteOfferResponse"; diff --git a/src/api/resources/ats/resources/proxy/client/Client.ts b/src/api/resources/ats/resources/proxy/client/Client.ts new file mode 100644 index 0000000..d662201 --- /dev/null +++ b/src/api/resources/ats/resources/proxy/client/Client.ts @@ -0,0 +1,116 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../../../environments"; +import * as core from "../../../../../../core"; +import * as Revert from "../../../../.."; +import * as serializers from "../../../../../../serialization"; +import urlJoin from "url-join"; +import * as errors from "../../../../../../errors"; + +export declare namespace Proxy { + interface Options { + environment?: core.Supplier; + } + + interface RequestOptions { + timeoutInSeconds?: number; + maxRetries?: number; + } +} + +export class Proxy { + constructor(protected readonly _options: Proxy.Options = {}) {} + + /** + * Call the native ATS api for a specific connection + * @throws {@link Revert.common.UnAuthorizedError} + * @throws {@link Revert.common.InternalServerError} + * @throws {@link Revert.common.NotFoundError} + */ + public async tunnel( + request: Revert.ats.PostProxyRequest, + requestOptions?: Proxy.RequestOptions + ): Promise { + const { xRevertApiToken, xRevertTId, xApiVersion, body: _body } = request; + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.RevertEnvironment.Production, + "/ats/proxy" + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@revertdotdev/node", + "X-Fern-SDK-Version": "0.0.1068", + "x-revert-api-token": xRevertApiToken, + "x-revert-t-id": xRevertTId, + "x-api-version": xApiVersion != null ? xApiVersion : undefined, + }, + contentType: "application/json", + body: await serializers.ats.PostProxyRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : undefined, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.ats.ProxyResponse.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, + }); + } + } +} diff --git a/src/api/resources/ats/resources/proxy/client/index.ts b/src/api/resources/ats/resources/proxy/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/ats/resources/proxy/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/ats/resources/proxy/client/requests/PostProxyRequest.ts b/src/api/resources/ats/resources/proxy/client/requests/PostProxyRequest.ts new file mode 100644 index 0000000..ad6493f --- /dev/null +++ b/src/api/resources/ats/resources/proxy/client/requests/PostProxyRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Revert from "../../../../../.."; + +export interface PostProxyRequest { + /** + * Your official API key for accessing revert apis. + */ + xRevertApiToken: string; + /** + * The unique customer id used when the customer linked their account. + */ + xRevertTId: string; + /** + * Optional Revert API version you're using. If missing we default to the latest version of the API. + */ + xApiVersion?: string; + body: Revert.ats.PostProxyRequestBody; +} diff --git a/src/api/resources/ats/resources/proxy/client/requests/index.ts b/src/api/resources/ats/resources/proxy/client/requests/index.ts new file mode 100644 index 0000000..c6efc6f --- /dev/null +++ b/src/api/resources/ats/resources/proxy/client/requests/index.ts @@ -0,0 +1 @@ +export { PostProxyRequest } from "./PostProxyRequest"; diff --git a/src/api/resources/ats/resources/proxy/index.ts b/src/api/resources/ats/resources/proxy/index.ts new file mode 100644 index 0000000..c9240f8 --- /dev/null +++ b/src/api/resources/ats/resources/proxy/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/ats/resources/proxy/types/PostProxyRequestBody.ts b/src/api/resources/ats/resources/proxy/types/PostProxyRequestBody.ts new file mode 100644 index 0000000..da33060 --- /dev/null +++ b/src/api/resources/ats/resources/proxy/types/PostProxyRequestBody.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PostProxyRequestBody { + path: string; + body?: unknown; + method: string; + queryParams?: unknown; +} diff --git a/src/api/resources/ats/resources/proxy/types/ProxyResponse.ts b/src/api/resources/ats/resources/proxy/types/ProxyResponse.ts new file mode 100644 index 0000000..d65a6b2 --- /dev/null +++ b/src/api/resources/ats/resources/proxy/types/ProxyResponse.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ProxyResponse { + result?: unknown; +} diff --git a/src/api/resources/ats/resources/proxy/types/index.ts b/src/api/resources/ats/resources/proxy/types/index.ts new file mode 100644 index 0000000..772915c --- /dev/null +++ b/src/api/resources/ats/resources/proxy/types/index.ts @@ -0,0 +1,2 @@ +export * from "./ProxyResponse"; +export * from "./PostProxyRequestBody"; diff --git a/src/api/resources/chat/resources/channels/client/Client.ts b/src/api/resources/chat/resources/channels/client/Client.ts index fdfd0e1..55601bb 100644 --- a/src/api/resources/chat/resources/channels/client/Client.ts +++ b/src/api/resources/chat/resources/channels/client/Client.ts @@ -56,7 +56,7 @@ export class Channels { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/chat/resources/messages/client/Client.ts b/src/api/resources/chat/resources/messages/client/Client.ts index f3fd275..44c5675 100644 --- a/src/api/resources/chat/resources/messages/client/Client.ts +++ b/src/api/resources/chat/resources/messages/client/Client.ts @@ -44,7 +44,7 @@ export class Messages { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/chat/resources/users/client/Client.ts b/src/api/resources/chat/resources/users/client/Client.ts index d82712c..a645b99 100644 --- a/src/api/resources/chat/resources/users/client/Client.ts +++ b/src/api/resources/chat/resources/users/client/Client.ts @@ -56,7 +56,7 @@ export class Users { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/connection/client/Client.ts b/src/api/resources/connection/client/Client.ts index 3324913..30fa892 100644 --- a/src/api/resources/connection/client/Client.ts +++ b/src/api/resources/connection/client/Client.ts @@ -43,7 +43,7 @@ export class Connection { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-api-version": xApiVersion != null ? xApiVersion : undefined, "x-revert-t-id": xRevertTId, @@ -133,7 +133,7 @@ export class Connection { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-api-version": xApiVersion != null ? xApiVersion : undefined, "x-revert-t-id": xRevertTId, @@ -223,7 +223,7 @@ export class Connection { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-api-version": xApiVersion != null ? xApiVersion : undefined, }, @@ -312,7 +312,7 @@ export class Connection { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-api-version": xApiVersion != null ? xApiVersion : undefined, "x-revert-t-id": xRevertTId, @@ -405,7 +405,7 @@ export class Connection { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-api-version": xApiVersion != null ? xApiVersion : undefined, "x-revert-t-id": xRevertTId, @@ -495,7 +495,7 @@ export class Connection { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-api-version": xApiVersion != null ? xApiVersion : undefined, "x-revert-t-id": xRevertTId, @@ -587,7 +587,7 @@ export class Connection { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-api-version": xApiVersion != null ? xApiVersion : undefined, }, @@ -668,7 +668,7 @@ export class Connection { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-api-version": xApiVersion != null ? xApiVersion : undefined, "x-revert-t-id": xRevertTId, diff --git a/src/api/resources/crm/resources/company/client/Client.ts b/src/api/resources/crm/resources/company/client/Client.ts index 379182e..1d8d4f2 100644 --- a/src/api/resources/crm/resources/company/client/Client.ts +++ b/src/api/resources/crm/resources/company/client/Client.ts @@ -53,7 +53,7 @@ export class Company { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -161,7 +161,7 @@ export class Company { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -252,7 +252,7 @@ export class Company { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -346,7 +346,7 @@ export class Company { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -450,7 +450,7 @@ export class Company { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/crm/resources/contact/client/Client.ts b/src/api/resources/crm/resources/contact/client/Client.ts index 83004e0..f09581b 100644 --- a/src/api/resources/crm/resources/contact/client/Client.ts +++ b/src/api/resources/crm/resources/contact/client/Client.ts @@ -53,7 +53,7 @@ export class Contact { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -161,7 +161,7 @@ export class Contact { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -253,7 +253,7 @@ export class Contact { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -357,7 +357,7 @@ export class Contact { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -472,7 +472,7 @@ export class Contact { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/crm/resources/deal/client/Client.ts b/src/api/resources/crm/resources/deal/client/Client.ts index 1e2b4f2..2e6d6f5 100644 --- a/src/api/resources/crm/resources/deal/client/Client.ts +++ b/src/api/resources/crm/resources/deal/client/Client.ts @@ -53,7 +53,7 @@ export class Deal { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -161,7 +161,7 @@ export class Deal { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -252,7 +252,7 @@ export class Deal { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -346,7 +346,7 @@ export class Deal { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -452,7 +452,7 @@ export class Deal { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/crm/resources/event/client/Client.ts b/src/api/resources/crm/resources/event/client/Client.ts index d7169ba..ca18758 100644 --- a/src/api/resources/crm/resources/event/client/Client.ts +++ b/src/api/resources/crm/resources/event/client/Client.ts @@ -53,7 +53,7 @@ export class Event { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -161,7 +161,7 @@ export class Event { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -252,7 +252,7 @@ export class Event { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -346,7 +346,7 @@ export class Event { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -452,7 +452,7 @@ export class Event { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -545,7 +545,7 @@ export class Event { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/crm/resources/lead/client/Client.ts b/src/api/resources/crm/resources/lead/client/Client.ts index 19471c2..98091de 100644 --- a/src/api/resources/crm/resources/lead/client/Client.ts +++ b/src/api/resources/crm/resources/lead/client/Client.ts @@ -53,7 +53,7 @@ export class Lead { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -161,7 +161,7 @@ export class Lead { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -252,7 +252,7 @@ export class Lead { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -346,7 +346,7 @@ export class Lead { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -452,7 +452,7 @@ export class Lead { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/crm/resources/note/client/Client.ts b/src/api/resources/crm/resources/note/client/Client.ts index af516b1..ffb2c1a 100644 --- a/src/api/resources/crm/resources/note/client/Client.ts +++ b/src/api/resources/crm/resources/note/client/Client.ts @@ -53,7 +53,7 @@ export class Note { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -161,7 +161,7 @@ export class Note { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -252,7 +252,7 @@ export class Note { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -346,7 +346,7 @@ export class Note { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -452,7 +452,7 @@ export class Note { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/crm/resources/properties/client/Client.ts b/src/api/resources/crm/resources/properties/client/Client.ts index 0c11226..7a1668d 100644 --- a/src/api/resources/crm/resources/properties/client/Client.ts +++ b/src/api/resources/crm/resources/properties/client/Client.ts @@ -44,7 +44,7 @@ export class Properties { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -135,7 +135,7 @@ export class Properties { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/crm/resources/proxy/client/Client.ts b/src/api/resources/crm/resources/proxy/client/Client.ts index f4cad75..920fdd8 100644 --- a/src/api/resources/crm/resources/proxy/client/Client.ts +++ b/src/api/resources/crm/resources/proxy/client/Client.ts @@ -43,7 +43,7 @@ export class Proxy { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/crm/resources/task/client/Client.ts b/src/api/resources/crm/resources/task/client/Client.ts index 62ae2a0..2ed7b9a 100644 --- a/src/api/resources/crm/resources/task/client/Client.ts +++ b/src/api/resources/crm/resources/task/client/Client.ts @@ -53,7 +53,7 @@ export class Task { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -161,7 +161,7 @@ export class Task { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -252,7 +252,7 @@ export class Task { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -346,7 +346,7 @@ export class Task { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -452,7 +452,7 @@ export class Task { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/crm/resources/user/client/Client.ts b/src/api/resources/crm/resources/user/client/Client.ts index 472044c..e6b970e 100644 --- a/src/api/resources/crm/resources/user/client/Client.ts +++ b/src/api/resources/crm/resources/user/client/Client.ts @@ -53,7 +53,7 @@ export class User { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -161,7 +161,7 @@ export class User { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -252,7 +252,7 @@ export class User { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/fieldMapping/client/Client.ts b/src/api/resources/fieldMapping/client/Client.ts index 37bc337..2e5ac9b 100644 --- a/src/api/resources/fieldMapping/client/Client.ts +++ b/src/api/resources/fieldMapping/client/Client.ts @@ -42,7 +42,7 @@ export class FieldMapping { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-public-token": xRevertPublicToken, "x-revert-t-id": xRevertTId, "x-revert-t-token": xRevertTToken, @@ -123,7 +123,7 @@ export class FieldMapping { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, }, @@ -212,7 +212,7 @@ export class FieldMapping { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-public-token": xRevertPublicToken, "x-revert-t-id": xRevertTId, "x-revert-t-token": xRevertTToken, @@ -305,7 +305,7 @@ export class FieldMapping { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, }, @@ -394,7 +394,7 @@ export class FieldMapping { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, }, contentType: "application/json", @@ -485,7 +485,7 @@ export class FieldMapping { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, }, contentType: "application/json", diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index fb8a55a..e4b28c2 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,3 +1,4 @@ +export * as ats from "./ats"; export * as chat from "./chat"; export * as common from "./common"; export * as connection from "./connection"; diff --git a/src/api/resources/metadata/client/Client.ts b/src/api/resources/metadata/client/Client.ts index 6f29e7d..c8b9a4f 100644 --- a/src/api/resources/metadata/client/Client.ts +++ b/src/api/resources/metadata/client/Client.ts @@ -42,7 +42,7 @@ export class Metadata { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-public-token": xRevertPublicToken, }, contentType: "application/json", diff --git a/src/api/resources/sync/client/Client.ts b/src/api/resources/sync/client/Client.ts index 43a0619..9f57423 100644 --- a/src/api/resources/sync/client/Client.ts +++ b/src/api/resources/sync/client/Client.ts @@ -44,7 +44,7 @@ export class Sync { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-connection-api-key": xConnectionApiKey != null ? xConnectionApiKey : undefined, diff --git a/src/api/resources/ticket/resources/collection/client/Client.ts b/src/api/resources/ticket/resources/collection/client/Client.ts index 36d1c1a..dbdd153 100644 --- a/src/api/resources/ticket/resources/collection/client/Client.ts +++ b/src/api/resources/ticket/resources/collection/client/Client.ts @@ -56,7 +56,7 @@ export class Collection { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/ticket/resources/comment/client/Client.ts b/src/api/resources/ticket/resources/comment/client/Client.ts index f33798e..fdfdeeb 100644 --- a/src/api/resources/ticket/resources/comment/client/Client.ts +++ b/src/api/resources/ticket/resources/comment/client/Client.ts @@ -49,7 +49,7 @@ export class Comment { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -153,7 +153,7 @@ export class Comment { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -249,7 +249,7 @@ export class Comment { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -349,7 +349,7 @@ export class Comment { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/ticket/resources/proxy/client/Client.ts b/src/api/resources/ticket/resources/proxy/client/Client.ts index a3c4bfa..7c6dbe3 100644 --- a/src/api/resources/ticket/resources/proxy/client/Client.ts +++ b/src/api/resources/ticket/resources/proxy/client/Client.ts @@ -43,7 +43,7 @@ export class Proxy { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/ticket/resources/task/client/Client.ts b/src/api/resources/ticket/resources/task/client/Client.ts index 15815d1..eef2c89 100644 --- a/src/api/resources/ticket/resources/task/client/Client.ts +++ b/src/api/resources/ticket/resources/task/client/Client.ts @@ -49,7 +49,7 @@ export class Task { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -153,7 +153,7 @@ export class Task { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -248,7 +248,7 @@ export class Task { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -349,7 +349,7 @@ export class Task { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/api/resources/ticket/resources/user/client/Client.ts b/src/api/resources/ticket/resources/user/client/Client.ts index cd7cdd8..bf8bba7 100644 --- a/src/api/resources/ticket/resources/user/client/Client.ts +++ b/src/api/resources/ticket/resources/user/client/Client.ts @@ -49,7 +49,7 @@ export class User { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, @@ -153,7 +153,7 @@ export class User { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@revertdotdev/node", - "X-Fern-SDK-Version": "0.0.1067", + "X-Fern-SDK-Version": "0.0.1068", "x-revert-api-token": xRevertApiToken, "x-revert-t-id": xRevertTId, "x-api-version": xApiVersion != null ? xApiVersion : undefined, diff --git a/src/serialization/resources/ats/index.ts b/src/serialization/resources/ats/index.ts new file mode 100644 index 0000000..3e5335f --- /dev/null +++ b/src/serialization/resources/ats/index.ts @@ -0,0 +1 @@ +export * from "./resources"; diff --git a/src/serialization/resources/ats/resources/candidate/index.ts b/src/serialization/resources/ats/resources/candidate/index.ts new file mode 100644 index 0000000..eea524d --- /dev/null +++ b/src/serialization/resources/ats/resources/candidate/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/src/serialization/resources/ats/resources/candidate/types/CreateOrUpdateCandidateRequest.ts b/src/serialization/resources/ats/resources/candidate/types/CreateOrUpdateCandidateRequest.ts new file mode 100644 index 0000000..4380bab --- /dev/null +++ b/src/serialization/resources/ats/resources/candidate/types/CreateOrUpdateCandidateRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const CreateOrUpdateCandidateRequest: core.serialization.Schema< + serializers.ats.CreateOrUpdateCandidateRequest.Raw, + Revert.ats.CreateOrUpdateCandidateRequest +> = core.serialization.unknown(); + +export declare namespace CreateOrUpdateCandidateRequest { + type Raw = unknown; +} diff --git a/src/serialization/resources/ats/resources/candidate/types/CreateOrUpdateCandidateResponse.ts b/src/serialization/resources/ats/resources/candidate/types/CreateOrUpdateCandidateResponse.ts new file mode 100644 index 0000000..c3308c2 --- /dev/null +++ b/src/serialization/resources/ats/resources/candidate/types/CreateOrUpdateCandidateResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const CreateOrUpdateCandidateResponse: core.serialization.ObjectSchema< + serializers.ats.CreateOrUpdateCandidateResponse.Raw, + Revert.ats.CreateOrUpdateCandidateResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + message: core.serialization.string(), + result: core.serialization.unknown(), +}); + +export declare namespace CreateOrUpdateCandidateResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + message: string; + result?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/candidate/types/DeleteCandidateResponse.ts b/src/serialization/resources/ats/resources/candidate/types/DeleteCandidateResponse.ts new file mode 100644 index 0000000..a202138 --- /dev/null +++ b/src/serialization/resources/ats/resources/candidate/types/DeleteCandidateResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const DeleteCandidateResponse: core.serialization.ObjectSchema< + serializers.ats.DeleteCandidateResponse.Raw, + Revert.ats.DeleteCandidateResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + message: core.serialization.string(), +}); + +export declare namespace DeleteCandidateResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + message: string; + } +} diff --git a/src/serialization/resources/ats/resources/candidate/types/GetCandidateResponse.ts b/src/serialization/resources/ats/resources/candidate/types/GetCandidateResponse.ts new file mode 100644 index 0000000..6c8eb5b --- /dev/null +++ b/src/serialization/resources/ats/resources/candidate/types/GetCandidateResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const GetCandidateResponse: core.serialization.ObjectSchema< + serializers.ats.GetCandidateResponse.Raw, + Revert.ats.GetCandidateResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + result: core.serialization.unknown(), +}); + +export declare namespace GetCandidateResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + result?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/candidate/types/GetCandidatesResponse.ts b/src/serialization/resources/ats/resources/candidate/types/GetCandidatesResponse.ts new file mode 100644 index 0000000..d4495cb --- /dev/null +++ b/src/serialization/resources/ats/resources/candidate/types/GetCandidatesResponse.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const GetCandidatesResponse: core.serialization.ObjectSchema< + serializers.ats.GetCandidatesResponse.Raw, + Revert.ats.GetCandidatesResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + next: core.serialization.string().optional(), + previous: core.serialization.string().optional(), + results: core.serialization.unknown(), +}); + +export declare namespace GetCandidatesResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + next?: string | null; + previous?: string | null; + results?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/candidate/types/index.ts b/src/serialization/resources/ats/resources/candidate/types/index.ts new file mode 100644 index 0000000..079f77f --- /dev/null +++ b/src/serialization/resources/ats/resources/candidate/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetCandidateResponse"; +export * from "./GetCandidatesResponse"; +export * from "./CreateOrUpdateCandidateRequest"; +export * from "./CreateOrUpdateCandidateResponse"; +export * from "./DeleteCandidateResponse"; diff --git a/src/serialization/resources/ats/resources/department/index.ts b/src/serialization/resources/ats/resources/department/index.ts new file mode 100644 index 0000000..eea524d --- /dev/null +++ b/src/serialization/resources/ats/resources/department/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/src/serialization/resources/ats/resources/department/types/CreateOrUpdateDepartmentRequest.ts b/src/serialization/resources/ats/resources/department/types/CreateOrUpdateDepartmentRequest.ts new file mode 100644 index 0000000..e02e9a5 --- /dev/null +++ b/src/serialization/resources/ats/resources/department/types/CreateOrUpdateDepartmentRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const CreateOrUpdateDepartmentRequest: core.serialization.Schema< + serializers.ats.CreateOrUpdateDepartmentRequest.Raw, + Revert.ats.CreateOrUpdateDepartmentRequest +> = core.serialization.unknown(); + +export declare namespace CreateOrUpdateDepartmentRequest { + type Raw = unknown; +} diff --git a/src/serialization/resources/ats/resources/department/types/CreateOrUpdateDepartmentResponse.ts b/src/serialization/resources/ats/resources/department/types/CreateOrUpdateDepartmentResponse.ts new file mode 100644 index 0000000..68f65d4 --- /dev/null +++ b/src/serialization/resources/ats/resources/department/types/CreateOrUpdateDepartmentResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const CreateOrUpdateDepartmentResponse: core.serialization.ObjectSchema< + serializers.ats.CreateOrUpdateDepartmentResponse.Raw, + Revert.ats.CreateOrUpdateDepartmentResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + message: core.serialization.string(), + result: core.serialization.unknown(), +}); + +export declare namespace CreateOrUpdateDepartmentResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + message: string; + result?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/department/types/DeleteDepartmentResponse.ts b/src/serialization/resources/ats/resources/department/types/DeleteDepartmentResponse.ts new file mode 100644 index 0000000..386b14a --- /dev/null +++ b/src/serialization/resources/ats/resources/department/types/DeleteDepartmentResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const DeleteDepartmentResponse: core.serialization.ObjectSchema< + serializers.ats.DeleteDepartmentResponse.Raw, + Revert.ats.DeleteDepartmentResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + message: core.serialization.string(), +}); + +export declare namespace DeleteDepartmentResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + message: string; + } +} diff --git a/src/serialization/resources/ats/resources/department/types/GetDepartmentResponse.ts b/src/serialization/resources/ats/resources/department/types/GetDepartmentResponse.ts new file mode 100644 index 0000000..094b8cf --- /dev/null +++ b/src/serialization/resources/ats/resources/department/types/GetDepartmentResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const GetDepartmentResponse: core.serialization.ObjectSchema< + serializers.ats.GetDepartmentResponse.Raw, + Revert.ats.GetDepartmentResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + result: core.serialization.unknown(), +}); + +export declare namespace GetDepartmentResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + result?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/department/types/GetDepartmentsResponse.ts b/src/serialization/resources/ats/resources/department/types/GetDepartmentsResponse.ts new file mode 100644 index 0000000..5a6ef74 --- /dev/null +++ b/src/serialization/resources/ats/resources/department/types/GetDepartmentsResponse.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const GetDepartmentsResponse: core.serialization.ObjectSchema< + serializers.ats.GetDepartmentsResponse.Raw, + Revert.ats.GetDepartmentsResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + next: core.serialization.string().optional(), + previous: core.serialization.string().optional(), + results: core.serialization.unknown(), +}); + +export declare namespace GetDepartmentsResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + next?: string | null; + previous?: string | null; + results?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/department/types/index.ts b/src/serialization/resources/ats/resources/department/types/index.ts new file mode 100644 index 0000000..f3c0d6e --- /dev/null +++ b/src/serialization/resources/ats/resources/department/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetDepartmentResponse"; +export * from "./GetDepartmentsResponse"; +export * from "./CreateOrUpdateDepartmentRequest"; +export * from "./CreateOrUpdateDepartmentResponse"; +export * from "./DeleteDepartmentResponse"; diff --git a/src/serialization/resources/ats/resources/index.ts b/src/serialization/resources/ats/resources/index.ts new file mode 100644 index 0000000..71d79b2 --- /dev/null +++ b/src/serialization/resources/ats/resources/index.ts @@ -0,0 +1,10 @@ +export * as candidate from "./candidate"; +export * from "./candidate/types"; +export * as department from "./department"; +export * from "./department/types"; +export * as job from "./job"; +export * from "./job/types"; +export * as offer from "./offer"; +export * from "./offer/types"; +export * as proxy from "./proxy"; +export * from "./proxy/types"; diff --git a/src/serialization/resources/ats/resources/job/index.ts b/src/serialization/resources/ats/resources/job/index.ts new file mode 100644 index 0000000..eea524d --- /dev/null +++ b/src/serialization/resources/ats/resources/job/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/src/serialization/resources/ats/resources/job/types/CreateOrUpdateJobRequest.ts b/src/serialization/resources/ats/resources/job/types/CreateOrUpdateJobRequest.ts new file mode 100644 index 0000000..39b9a53 --- /dev/null +++ b/src/serialization/resources/ats/resources/job/types/CreateOrUpdateJobRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const CreateOrUpdateJobRequest: core.serialization.Schema< + serializers.ats.CreateOrUpdateJobRequest.Raw, + Revert.ats.CreateOrUpdateJobRequest +> = core.serialization.unknown(); + +export declare namespace CreateOrUpdateJobRequest { + type Raw = unknown; +} diff --git a/src/serialization/resources/ats/resources/job/types/CreateOrUpdateJobResponse.ts b/src/serialization/resources/ats/resources/job/types/CreateOrUpdateJobResponse.ts new file mode 100644 index 0000000..ea14a99 --- /dev/null +++ b/src/serialization/resources/ats/resources/job/types/CreateOrUpdateJobResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const CreateOrUpdateJobResponse: core.serialization.ObjectSchema< + serializers.ats.CreateOrUpdateJobResponse.Raw, + Revert.ats.CreateOrUpdateJobResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + message: core.serialization.string(), + result: core.serialization.unknown(), +}); + +export declare namespace CreateOrUpdateJobResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + message: string; + result?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/job/types/DeleteJobResponse.ts b/src/serialization/resources/ats/resources/job/types/DeleteJobResponse.ts new file mode 100644 index 0000000..7b49435 --- /dev/null +++ b/src/serialization/resources/ats/resources/job/types/DeleteJobResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const DeleteJobResponse: core.serialization.ObjectSchema< + serializers.ats.DeleteJobResponse.Raw, + Revert.ats.DeleteJobResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + message: core.serialization.string(), +}); + +export declare namespace DeleteJobResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + message: string; + } +} diff --git a/src/serialization/resources/ats/resources/job/types/GetJobResponse.ts b/src/serialization/resources/ats/resources/job/types/GetJobResponse.ts new file mode 100644 index 0000000..507aa79 --- /dev/null +++ b/src/serialization/resources/ats/resources/job/types/GetJobResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const GetJobResponse: core.serialization.ObjectSchema< + serializers.ats.GetJobResponse.Raw, + Revert.ats.GetJobResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + result: core.serialization.unknown(), +}); + +export declare namespace GetJobResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + result?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/job/types/GetJobsResponse.ts b/src/serialization/resources/ats/resources/job/types/GetJobsResponse.ts new file mode 100644 index 0000000..677856b --- /dev/null +++ b/src/serialization/resources/ats/resources/job/types/GetJobsResponse.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const GetJobsResponse: core.serialization.ObjectSchema< + serializers.ats.GetJobsResponse.Raw, + Revert.ats.GetJobsResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + next: core.serialization.string().optional(), + previous: core.serialization.string().optional(), + results: core.serialization.unknown(), +}); + +export declare namespace GetJobsResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + next?: string | null; + previous?: string | null; + results?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/job/types/index.ts b/src/serialization/resources/ats/resources/job/types/index.ts new file mode 100644 index 0000000..e3fede7 --- /dev/null +++ b/src/serialization/resources/ats/resources/job/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetJobResponse"; +export * from "./GetJobsResponse"; +export * from "./CreateOrUpdateJobRequest"; +export * from "./CreateOrUpdateJobResponse"; +export * from "./DeleteJobResponse"; diff --git a/src/serialization/resources/ats/resources/offer/index.ts b/src/serialization/resources/ats/resources/offer/index.ts new file mode 100644 index 0000000..eea524d --- /dev/null +++ b/src/serialization/resources/ats/resources/offer/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/src/serialization/resources/ats/resources/offer/types/CreateOrUpdateOfferRequest.ts b/src/serialization/resources/ats/resources/offer/types/CreateOrUpdateOfferRequest.ts new file mode 100644 index 0000000..388df03 --- /dev/null +++ b/src/serialization/resources/ats/resources/offer/types/CreateOrUpdateOfferRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const CreateOrUpdateOfferRequest: core.serialization.Schema< + serializers.ats.CreateOrUpdateOfferRequest.Raw, + Revert.ats.CreateOrUpdateOfferRequest +> = core.serialization.unknown(); + +export declare namespace CreateOrUpdateOfferRequest { + type Raw = unknown; +} diff --git a/src/serialization/resources/ats/resources/offer/types/CreateOrUpdateOfferResponse.ts b/src/serialization/resources/ats/resources/offer/types/CreateOrUpdateOfferResponse.ts new file mode 100644 index 0000000..886f25d --- /dev/null +++ b/src/serialization/resources/ats/resources/offer/types/CreateOrUpdateOfferResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const CreateOrUpdateOfferResponse: core.serialization.ObjectSchema< + serializers.ats.CreateOrUpdateOfferResponse.Raw, + Revert.ats.CreateOrUpdateOfferResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + message: core.serialization.string(), + result: core.serialization.unknown(), +}); + +export declare namespace CreateOrUpdateOfferResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + message: string; + result?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/offer/types/DeleteOfferResponse.ts b/src/serialization/resources/ats/resources/offer/types/DeleteOfferResponse.ts new file mode 100644 index 0000000..aee48dd --- /dev/null +++ b/src/serialization/resources/ats/resources/offer/types/DeleteOfferResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const DeleteOfferResponse: core.serialization.ObjectSchema< + serializers.ats.DeleteOfferResponse.Raw, + Revert.ats.DeleteOfferResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + message: core.serialization.string(), +}); + +export declare namespace DeleteOfferResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + message: string; + } +} diff --git a/src/serialization/resources/ats/resources/offer/types/GetOfferResponse.ts b/src/serialization/resources/ats/resources/offer/types/GetOfferResponse.ts new file mode 100644 index 0000000..714bb76 --- /dev/null +++ b/src/serialization/resources/ats/resources/offer/types/GetOfferResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const GetOfferResponse: core.serialization.ObjectSchema< + serializers.ats.GetOfferResponse.Raw, + Revert.ats.GetOfferResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + result: core.serialization.unknown(), +}); + +export declare namespace GetOfferResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + result?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/offer/types/GetOffersResponse.ts b/src/serialization/resources/ats/resources/offer/types/GetOffersResponse.ts new file mode 100644 index 0000000..d04c31d --- /dev/null +++ b/src/serialization/resources/ats/resources/offer/types/GetOffersResponse.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const GetOffersResponse: core.serialization.ObjectSchema< + serializers.ats.GetOffersResponse.Raw, + Revert.ats.GetOffersResponse +> = core.serialization.object({ + status: core.serialization.lazy(async () => (await import("../../../../..")).common.ResponseStatus), + next: core.serialization.string().optional(), + previous: core.serialization.string().optional(), + results: core.serialization.unknown(), +}); + +export declare namespace GetOffersResponse { + interface Raw { + status: serializers.common.ResponseStatus.Raw; + next?: string | null; + previous?: string | null; + results?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/offer/types/index.ts b/src/serialization/resources/ats/resources/offer/types/index.ts new file mode 100644 index 0000000..abefdc0 --- /dev/null +++ b/src/serialization/resources/ats/resources/offer/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetOfferResponse"; +export * from "./GetOffersResponse"; +export * from "./CreateOrUpdateOfferRequest"; +export * from "./CreateOrUpdateOfferResponse"; +export * from "./DeleteOfferResponse"; diff --git a/src/serialization/resources/ats/resources/proxy/index.ts b/src/serialization/resources/ats/resources/proxy/index.ts new file mode 100644 index 0000000..eea524d --- /dev/null +++ b/src/serialization/resources/ats/resources/proxy/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/src/serialization/resources/ats/resources/proxy/types/PostProxyRequestBody.ts b/src/serialization/resources/ats/resources/proxy/types/PostProxyRequestBody.ts new file mode 100644 index 0000000..3c9d27b --- /dev/null +++ b/src/serialization/resources/ats/resources/proxy/types/PostProxyRequestBody.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const PostProxyRequestBody: core.serialization.ObjectSchema< + serializers.ats.PostProxyRequestBody.Raw, + Revert.ats.PostProxyRequestBody +> = core.serialization.object({ + path: core.serialization.string(), + body: core.serialization.unknown().optional(), + method: core.serialization.string(), + queryParams: core.serialization.unknown().optional(), +}); + +export declare namespace PostProxyRequestBody { + interface Raw { + path: string; + body?: unknown | null; + method: string; + queryParams?: unknown | null; + } +} diff --git a/src/serialization/resources/ats/resources/proxy/types/ProxyResponse.ts b/src/serialization/resources/ats/resources/proxy/types/ProxyResponse.ts new file mode 100644 index 0000000..5ce4282 --- /dev/null +++ b/src/serialization/resources/ats/resources/proxy/types/ProxyResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../.."; +import * as Revert from "../../../../../../api"; +import * as core from "../../../../../../core"; + +export const ProxyResponse: core.serialization.ObjectSchema< + serializers.ats.ProxyResponse.Raw, + Revert.ats.ProxyResponse +> = core.serialization.object({ + result: core.serialization.unknown(), +}); + +export declare namespace ProxyResponse { + interface Raw { + result?: unknown; + } +} diff --git a/src/serialization/resources/ats/resources/proxy/types/index.ts b/src/serialization/resources/ats/resources/proxy/types/index.ts new file mode 100644 index 0000000..772915c --- /dev/null +++ b/src/serialization/resources/ats/resources/proxy/types/index.ts @@ -0,0 +1,2 @@ +export * from "./ProxyResponse"; +export * from "./PostProxyRequestBody"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index 0e077b0..008752f 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,3 +1,4 @@ +export * as ats from "./ats"; export * as chat from "./chat"; export * as common from "./common"; export * as connection from "./connection";