Code Monkey home page Code Monkey logo

merge-ats-node's Introduction

Deprecation Notice

Merge has released a new version of our Typescript SDK. As part of that release, we are providing a deprecation notice of our legacy SDKs.

To help give you time to plan your migration to our latest SDK:

  • August 2023: SDK deprecation notice on our legacy Typescript SDKs.
  • Until February 2024: we’ll support updates as needed and address bugs in priority order
  • After February 2024: we’ll no longer make updates or bug fixes to the deprecated SDKs

For information about the deprecation notice see our help center and for information about migrating to the Typescript SDK, see the Typescript Migration Guide.

Merge ATS API TypeScript SDK

The unified API for building rich integrations with multiple Applicant Tracking System platforms.

This TypeScript package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: 1.0.9
  • Build package: org.openapitools.codegen.languages.TypeScriptNodeClientCodegen For more information, please visit https://www.merge.dev/

Requirements

Dependencies

  • bluebird: ^3.5.0
  • request: ^2.81.0
  • @types/bluebird: *
  • @types/request: *
  • rewire: ^3.0.2

Dev Dependencies

  • typescript: ^4.3.3
  • @types/node: ^15.12.2

Getting Started

Here is an example auth configuration for calling a Merge API:

import { AccountDetailsApi, HttpBearerAuth } from "@mergeapi/merge-ats-node";

const auth = new HttpBearerAuth();
auth.accessToken = "YOUR_API_KEY";

// Substitute AccountDetailsApi with the API you're trying to use
const apiInstance = new AccountDetailsApi();
apiInstance.setDefaultAuthentication(auth);

merge-ats-node's People

Contributors

dan-merge avatar david-merge avatar eltonkl avatar gallinaryoso avatar rmkonnur avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

merge-ats-node's Issues

Version 1.0.7 has some seriously breaking changes from 1.0.5

Performing a minor npm update on my project automatically updated 1.0.5 to 1.0.7. However, 1.0.7 introduced breaking changes to the type signatures of several functions. It probably should have been a 1.1.0 and marked as containing breaking changes.

I ran into two breaking issues personally, but I assume there were more:

  • All of the exported SomethingEnums are no longer enums?? The proper enum has been renamed from X to XExpected and the name X is now XEnum | string, which breaks any use of the enums that depended on them being enums. (Additionally, the enums are less useful now since they're basically defined as "one of these strings, unless its not in which case it could be any string.")
  • The method signature for candidatesList is substantially different, dropping emailAddresses and tag while adding includeDeleteData (I'm just lucky the number of arguments changed, otherwise my code would have kept calling it and it would have just mysteriously broken!)

Improve API usability

Some API functions accept a large number of optional arguments, like

public async applicationsList (xAccountToken: string, candidateId?: string, createdAfter?: Date, createdBefore?: Date, creditedToId?: string, currentStageId?: string, cursor?: string, expand?: 'candidate' | 'candidate,credited_to' | 'candidate,credited_to,current_stage' | 'candidate,credited_to,current_stage,reject_reason' | 'candidate,credited_to,reject_reason' | 'candidate,current_stage' | 'candidate,current_stage,reject_reason' | 'candidate,job' | 'candidate,job,credited_to' | 'candidate,job,credited_to,current_stage' | 'candidate,job,credited_to,current_stage,reject_reason' | 'candidate,job,credited_to,reject_reason' | 'candidate,job,current_stage' | 'candidate,job,current_stage,reject_reason' | 'candidate,job,reject_reason' | 'candidate,reject_reason' | 'credited_to' | 'credited_to,current_stage' | 'credited_to,current_stage,reject_reason' | 'credited_to,reject_reason' | 'current_stage' | 'current_stage,reject_reason' | 'job' | 'job,credited_to' | 'job,credited_to,current_stage' | 'job,credited_to,current_stage,reject_reason' | 'job,credited_to,reject_reason' | 'job,current_stage' | 'job,current_stage,reject_reason' | 'job,reject_reason' | 'reject_reason', includeRemoteData?: boolean, jobId?: string, modifiedAfter?: Date, modifiedBefore?: Date, pageSize?: number, rejectReasonId?: string, remoteId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PaginatedApplicationList;  }> 

(https://github.com/merge-api/merge-ats-node/blob/9a10a0fd8d230977ed5fac56bac5990c9fddbe15/api/applicationsApi.ts)

We need to filter by modifiedAfter so we have to use it like this:

await applicationsList(token, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, modifiedAfter)

It would be more practical to accept an object so we can simply call

await applicationsList({ xAccountToken, modifiedAfter }) or await applicationsList(xAccountToken, { modifiedAfter })

Module '"http"' has no default export.

[7:21:43 AM] Found 21 errors. Watching for file changes.
[7:27:43 AM] File change detected. Starting incremental compilation...

../node_modules/@mergeapi/merge-ats-node/dist/api/accountDetailsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/accountTokenApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/activitiesApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/applicationsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/attachmentsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/availableActionsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/candidatesApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/deleteAccountApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/departmentsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/eeocsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/generateKeyApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/interviewsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/issuesApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/jobInterviewStagesApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/jobsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/linkTokenApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/offersApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/officesApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/passthroughApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/regenerateKeyApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/rejectReasonsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/scorecardsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/syncStatusApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/tagsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/api/usersApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

../node_modules/@mergeapi/merge-ats-node/dist/model/models.d.ts:2:8 - error TS1259: Module '"/Users/daniel/Projects/isotalent/node_modules/@types/request/index"' can only be default-imported using the 'esModuleInterop' flag

2 import localVarRequest from 'request';
         ~~~~~~~~~~~~~~~

  ../node_modules/@types/request/index.d.ts:404:1
    404 export = request;
        ~~~~~~~~~~~~~~~~~
    This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.

[7:27:44 AM] Found 26 errors. Watching for file changes.

Dependency on `request` generating deprecation warnings

This library depends on request at version ^2.88.2. However, request is itself has been deprecated for the past 3 years and depends on an ancient version of uuid which introduces cryptographically unsound uuid generation.

axios includes all the features of request and is currently maintained with node LTS support, so I would suggest migrating to using that library since node-native fetch is still a few years away from major LTS availability.

Feature request: Consume API Key from environment variable

Hello,

I am currently authenticating calls this way:

const api = new mergeAPI.CandidatesApi()
api.defaultHeaders = {
  Authorization: 'Bearer ' + process.env.MERGE_API_KEY,
}

const res = await api.candidatesList('TEST_ACCOUNT_TOKEN')
// ...

It would be handy if the SDK could directly consume an environment variable without having to configure the authentication at every API class insantiation

Unable to fetch jobs list

Hi Merge Team,

I was testing out the node client for your ATS API and I ran into an issue with the GET: /jobs endpoint. Seems like there are some undefined fields for this API.

Api version "@mergeapi/merge_ats_api": "^1.0.7",

Code

const MergeAtsApi = require('@mergeapi/merge_ats_api')
  // specific to individual organizations
  const accountToken = '<TOKEN>';
  const opts = {}

  let client = MergeAtsApi.ApiClient.instance
  client.authentications['tokenAuth'] = {type: "bearer", accessToken: process.env.MERGE_API_KEY}
  const api = new MergeAtsApi.JobsApi()

  api.jobsList(accountToken, opts, (error, data) => {
    if (error) {
      console.log(error)
      res.status(400).json({ error })
    } else {
      res.status(200).json({ data })
    }
  });

Error

ReferenceError: Office is not defined
    at Function.constructFromObject (/Users/zack/app/node_modules/@mergeapi/merge_ats_api/dist/model/Job.js:105:68)
    at Function.convertToType (/Users/zack/app/node_modules/@mergeapi/merge_ats_api/dist/ApiClient.js:667:25)
    at /Users/zack/app/node_modules/@mergeapi/merge_ats_api/dist/ApiClient.js:672:32
    at Array.map (<anonymous>)
    at Function.convertToType (/Users/zack/app/node_modules/@mergeapi/merge_ats_api/dist/ApiClient.js:671:25)
    at Function.constructFromObject (/Users/zack/app/node_modules/@mergeapi/merge_ats_api/dist/model/PaginatedJobList.js:68:50)
    at Function.convertToType (/Users/zack/app/node_modules/@mergeapi/merge_ats_api/dist/ApiClient.js:667:25)
    at ApiClient.deserialize (/Users/zack/app/node_modules/@mergeapi/merge_ats_api/dist/ApiClient.js:405:24)
    at /Users/zack/app/node_modules/@mergeapi/merge_ats_api/dist/ApiClient.js:533:29
    at Request.callback (/Users/zack/app/node_modules/superagent/lib/node/index.js:894:12)
    at /Users/zack/app/node_modules/superagent/lib/node/index.js:1126:20
    at IncomingMessage.<anonymous> (/Users/zack/app/node_modules/superagent/lib/node/parsers/json.js:22:7)
    at Stream.emit (node:events:394:28)
    at Stream.emit (node:domain:532:15)
    at Unzip.<anonymous> (/Users/zack/app/node_modules/superagent/lib/node/unzip.js:53:12)
    at Unzip.emit (node:events:394:28)

MERGE_API_KEY vs X-Account-Token

I know this module is largely autogenerated from the OpenAPI specification, but it could really use a thin wrapper specific to Merge. It's not clear how to configure this module to pass MERGE_API_KEY, and it'd also be nice if the library exposed a "factory" for configuring client objects that use different X-Account-Token values.

I used to work at Nylas so I'm somewhat biased, but this is what I'd expected to see here:

const Merge = require('merge-ats-node');

Merge.config({
  rootApiKey: MERGE_API_KEY,
});

// Make API requests to the LinkTokenApi, etc. using this global token

// Make API requests to a specific ATS integration like this:
const mergeForCustomerA = Merge.with(customer.mergeAccountToken);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.