Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: tickets & users types + adjustments on types exports + option to throwOriginalException #422

Merged
merged 6 commits into from
Aug 1, 2024

Conversation

onhate
Copy link
Contributor

@onhate onhate commented Aug 1, 2024

Pull Request Description

Updated some types on tickets and users clients;

Updated exports config on package.json so we can import types directly from the client;

before the update

import { ZendeskClient } from 'node-zendesk';

export type ZendeskInstanceType = InstanceType<typeof ZendeskClient>;
export type CreateOrUpdateTicket = Parameters<ZendeskInstanceType['tickets']['create']>[0]['ticket']['comment'];

after the update

import { CreateOrUpdateTicket } from 'node-zendesk/clients/core/tickets';

Added option on createClient to allow rethrow the original exception;

In many scenarios the lib is just swallowing the original exception by creating a new exception with just a new message prefix, this is bad because you loose all the original fields of the exception thrown by the transporter request.

This option allows the lib to throw the original exception as is and let the user decide what to do with it.

createClient({
    throwOriginalException: true
});

Additional Information

  • This change is a breaking change (may require a major version update)
  • This change is a new feature (non-breaking change which adds functionality)
  • This change improves the code (e.g., refactoring, etc.)
  • This change includes dependency updates

Documentation

  • I have updated the documentation accordingly.
  • No updates are required.

Checklist

  • I have read the CONTRIBUTING documentation.
  • My code follows the coding standards of this project.
  • All new and existing tests passed.

@onhate onhate changed the title feat: tickets & users types + adjustments on types exports feat: tickets & users types + adjustments on types exports + option to throwOriginalException\ Aug 1, 2024
@onhate onhate changed the title feat: tickets & users types + adjustments on types exports + option to throwOriginalException\ feat: tickets & users types + adjustments on types exports + option to throwOriginalException Aug 1, 2024
Copy link

@inaciogu inaciogu left a comment

Choose a reason for hiding this comment

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

very useful

Copy link
Owner

@blakmatrix blakmatrix left a comment

Choose a reason for hiding this comment

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

Looks great! Love how it streamlines the code!

@blakmatrix blakmatrix merged commit 8654236 into blakmatrix:master Aug 1, 2024
3 checks passed
@onhate onhate deleted the feat-types branch August 1, 2024 19:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants