Skip to content

Conversation

@jclusso
Copy link
Member

@jclusso jclusso commented Jun 4, 2025

  • Added ability to specify api_key or access_token at request time
  • Fixed bug with yarn test [file] not running just that file because it was combined with tsd. Made them two separate tasks.
  • Improved tests to catch errors when they don't instead of relying on mocha timeout to fail the test.
  • Updated CI

@jclusso jclusso requested a review from Copilot June 4, 2025 16:13
@jclusso jclusso force-pushed the add-access-token-auth branch from ddd93c5 to 5721e12 Compare June 4, 2025 16:14
@jclusso jclusso requested a review from n-older June 4, 2025 16:14

This comment was marked as outdated.

n-older
n-older previously approved these changes Jun 4, 2025
Copy link
Contributor

@n-older n-older left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good apart from the Copilot suggestions.

@jclusso jclusso requested a review from n-older June 4, 2025 17:15
@jclusso jclusso requested a review from Copilot June 4, 2025 17:15

This comment was marked as outdated.

n-older
n-older previously approved these changes Jun 4, 2025

This comment was marked as outdated.

@jclusso jclusso force-pushed the add-access-token-auth branch 2 times, most recently from 5721e12 to 72cf6c6 Compare June 4, 2025 17:56
@jclusso jclusso requested a review from Copilot June 4, 2025 18:02

This comment was marked as outdated.

@jclusso jclusso force-pushed the add-access-token-auth branch from 72cf6c6 to 7d7fb31 Compare June 4, 2025 18:06
- Added ability to specify api_key or access_token at request time
- Fixed bug with `yarn test [file]` not running just that file because it was combined with `tsd`. Made them two separate tasks.
- Improved tests to catch errors when they don't instead of relying on mocha timeout to fail the test.
- Updated CI
@jclusso jclusso force-pushed the add-access-token-auth branch from 7d7fb31 to 1f3f4ad Compare June 4, 2025 18:07
@jclusso jclusso requested a review from Copilot June 4, 2025 18:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances authentication by adding support for access tokens and refines testing and CI configurations.

  • Added support for specifying an accessToken (or apiKey) at request time.
  • Refactored promise error handling in tests and separated type testing in package.json.
  • Updated documentation and CI to reflect the new authentication options.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/verify.spec.js Added .catch(done) to promise chains in tests for consistent error handling.
test/emailable.test-d.ts Added a new test for the account endpoint accepting an apiKey parameter.
test/batches.spec.js Adjusted promise chains, but redundant .catch(done) calls were introduced in status tests.
test/authentication.spec.js Introduced comprehensive tests for different authentication mechanisms.
test/account.spec.js Updated error handling with .catch(done) affixed to promise chains.
package.json Split type tests into a separate task and updated package manager settings.
lib/emailable.js Modified constructor to support a default apiKey and updated the account method to accept options.
lib/client.js Implemented support for accessToken by merging it with apiKey and applied request filtering.
README.md Revised authentication documentation to cover both apiKey and accessToken usage.
.github/workflows/ci.yml Expanded the Node.js version matrix and added a step to run type definition tests.

@jclusso jclusso requested a review from n-older June 4, 2025 18:10
@jclusso jclusso requested a review from n-older June 4, 2025 18:30
@jclusso jclusso merged commit 43c8ccb into master Jun 4, 2025
6 checks passed
@jclusso jclusso deleted the add-access-token-auth branch June 4, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants