-
Notifications
You must be signed in to change notification settings - Fork 20
feat: comprehensive SDK improvements - error handling, build system, testing, and documentation #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
0682630
chore: update .github/workflows/publish.yml
haxurn e85ad8c
chore: update .gitignore
haxurn f195586
chore: update README.md
haxurn 4c99869
chore: update jest.config.js
haxurn a15fa78
chore: update package.json
haxurn ac2a7d2
chore: update pnpm-lock.yaml
haxurn 9391262
chore: update src/chapa.ts
haxurn cd57630
chore: update src/enums/chapa-urls.enum.ts
haxurn 6365ee6
chore: update src/http-exception.ts
haxurn 552c4bc
chore: update src/index.ts
haxurn f13b8d6
chore: update src/interfaces/chapa-options.interface.ts
haxurn e3fd7a4
chore: update src/interfaces/get-banks.interface.ts
haxurn ed685f2
chore: update src/interfaces/index.ts
haxurn 9e9b8d2
chore: update src/interfaces/payment.interface.ts
haxurn 02d560f
chore: update src/interfaces/refund.interface.ts
haxurn c0c298c
chore: update src/interfaces/transaction.interface.ts
haxurn 8e7a241
chore: update src/interfaces/transfer.interface.ts
haxurn bf86d2f
chore: update src/validations/create-subaccount.validation.ts
haxurn 82d9953
chore: update src/validations/direct-charge.validation.ts
haxurn ad4250a
chore: remove src/validations/gen-tx-ref.validation.ts
haxurn 01a10bd
chore: update src/validations/payment.validation.ts
haxurn e29c894
chore: update src/validations/refund.validation.ts
haxurn 9f736c9
chore: add changeset configuration
haxurn 93ff1c3
chore: add GitHub issue templates
haxurn 5fa1ccf
ci: add GitHub Actions CI workflow
haxurn 6a42a97
chore: add pull request template
haxurn c465920
chore: add husky pre-commit hook
haxurn 04aea88
feat(types): add error types and type guards
haxurn 707e822
chore: migrate validation schemas from yup to zod
haxurn 9449134
feat(http): add axios instance factory with logging and retry support
haxurn de7d6ae
feat(error-handler): add centralized error handling for axios and val…
haxurn 5f72afc
feat(utils): add error handling wrapper utility
haxurn f1c294d
feat(webhook): add webhook signature verification utility
haxurn 5cbe7f7
test(webhook): add signature verification test suite
haxurn fdd0d1c
test(validations): add comprehensive validation test suite
haxurn 147de52
chore(tsconfig): streamline TypeScript configuration
haxurn fc32dec
docs(security): add comprehensive security policy and guidelines
haxurn ac0f1e2
chore(build): add Rollup configuration for library bundling
haxurn 84a60fe
test(core): add comprehensive test suite for Chapa SDK
haxurn d1904db
docs(conduct): add code of conduct for community guidelines
haxurn ca33e9f
chore(editor): add EditorConfig for consistent code formatting
haxurn 5bfcfab
chore(config): add development tooling and npm publishing configuration
haxurn f0b5815
docs: add changelog, contributing guide, and version bump config
haxurn 5cb6701
docs(readme): remove codecov coverage badge
haxurn e9fc1fd
fix(publish): resolve things requested by the owner
haxurn 0314c0b
feat: add configurable timeout and exponential backoff for retries
haxurn 6541411
feat: add AbortSignal support for request cancellation, remove unnece…
haxurn 331a683
feat: add timeout option to ChapaOptions interface
haxurn d9ecaaf
chore: update TypeScript target to ES2020
haxurn d15d0a8
chore: add AbortSignal and AbortController to ESLint globals
haxurn 53023af
test: update tests to accommodate signal parameter
haxurn 48865fe
docs: update README with timeout, AbortSignal support, and exponentia…
haxurn f0e2c82
chore: bump version to 2.1.1
haxurn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Changesets | ||
|
|
||
| Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
| with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
| find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
|
||
| We have a quick list of common questions to get you started engaging with this project in | ||
| [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json", | ||
| "changelog": "@changesets/cli/changelog", | ||
| "commit": false, | ||
| "fixed": [], | ||
| "linked": [], | ||
| "access": "restricted", | ||
| "baseBranch": "main", | ||
| "updateInternalDependencies": "patch", | ||
| "ignore": [] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_style = space | ||
| indent_size = 2 | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [*.md] | ||
| trim_trailing_whitespace = false | ||
|
|
||
| [*.{yml,yaml}] | ||
| indent_size = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: Bug Report | ||
| description: Report a bug or issue with chapa-nodejs | ||
| title: "[Bug]: " | ||
| labels: ["bug", "triage"] | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Thanks for taking the time to report a bug! Please fill out the form below. | ||
|
|
||
| - type: textarea | ||
| id: description | ||
| attributes: | ||
| label: Bug Description | ||
| description: A clear and concise description of what the bug is. | ||
| placeholder: Tell us what you see! | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: reproduction | ||
| attributes: | ||
| label: Steps to Reproduce | ||
| description: Steps to reproduce the behavior | ||
| placeholder: | | ||
| 1. Initialize Chapa with... | ||
| 2. Call method... | ||
| 3. See error... | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: expected | ||
| attributes: | ||
| label: Expected Behavior | ||
| description: What did you expect to happen? | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: code | ||
| attributes: | ||
| label: Code Sample | ||
| description: Please provide a minimal code sample that reproduces the issue | ||
| render: typescript | ||
| validations: | ||
| required: false | ||
|
|
||
| - type: input | ||
| id: version | ||
| attributes: | ||
| label: Package Version | ||
| description: What version of chapa-nodejs are you using? | ||
| placeholder: e.g., 2.3.1 | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: input | ||
| id: node-version | ||
| attributes: | ||
| label: Node.js Version | ||
| description: What version of Node.js are you using? | ||
| placeholder: e.g., 20.10.0 | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: dropdown | ||
| id: environment | ||
| attributes: | ||
| label: Environment | ||
| description: Where are you running this? | ||
| options: | ||
| - Development | ||
| - Production | ||
| - Testing | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: additional | ||
| attributes: | ||
| label: Additional Context | ||
| description: Add any other context about the problem here | ||
| validations: | ||
| required: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| blank_issues_enabled: false | ||
| contact_links: | ||
| - name: Documentation | ||
| url: https://github.com/fireayehu/chapa-nodejs#readme | ||
| about: Check the documentation for usage examples | ||
| - name: Chapa API Documentation | ||
| url: https://developer.chapa.co/docs | ||
| about: Official Chapa API documentation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Feature Request | ||
| description: Suggest a new feature or enhancement | ||
| title: "[Feature]: " | ||
| labels: ["enhancement"] | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Thanks for suggesting a new feature! | ||
|
|
||
| - type: textarea | ||
| id: problem | ||
| attributes: | ||
| label: Problem Statement | ||
| description: Is your feature request related to a problem? Please describe. | ||
| placeholder: I'm always frustrated when... | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: solution | ||
| attributes: | ||
| label: Proposed Solution | ||
| description: Describe the solution you'd like | ||
| placeholder: I would like to see... | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: alternatives | ||
| attributes: | ||
| label: Alternatives Considered | ||
| description: Describe alternatives you've considered | ||
| validations: | ||
| required: false | ||
|
|
||
| - type: textarea | ||
| id: example | ||
| attributes: | ||
| label: Example Usage | ||
| description: Show how you'd like to use this feature | ||
| render: typescript | ||
| validations: | ||
| required: false | ||
|
|
||
| - type: textarea | ||
| id: additional | ||
| attributes: | ||
| label: Additional Context | ||
| description: Add any other context or screenshots about the feature request | ||
| validations: | ||
| required: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Question | ||
| description: Ask a question about chapa-nodejs | ||
| title: "[Question]: " | ||
| labels: ["question"] | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Have a question? We're here to help! | ||
|
|
||
| - type: textarea | ||
| id: question | ||
| attributes: | ||
| label: Your Question | ||
| description: What would you like to know? | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: context | ||
| attributes: | ||
| label: Context | ||
| description: Provide any relevant context or what you've tried so far | ||
| validations: | ||
| required: false | ||
|
|
||
| - type: textarea | ||
| id: code | ||
| attributes: | ||
| label: Code Sample | ||
| description: If applicable, provide a code sample | ||
| render: typescript | ||
| validations: | ||
| required: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| ## Description | ||
| <!-- Provide a brief description of the changes --> | ||
|
|
||
| ## Type of Change | ||
| <!-- Mark the relevant option with an "x" --> | ||
|
|
||
| - [ ] Bug fix (non-breaking change which fixes an issue) | ||
| - [ ] New feature (non-breaking change which adds functionality) | ||
| - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
| - [ ] Documentation update | ||
| - [ ] Code refactoring | ||
| - [ ] Performance improvement | ||
| - [ ] Test coverage improvement | ||
|
|
||
| ## Related Issue | ||
| <!-- Link to the issue this PR addresses --> | ||
| Closes # | ||
|
|
||
| ## Changes Made | ||
| <!-- List the specific changes made in this PR --> | ||
|
|
||
| - | ||
| - | ||
| - | ||
|
|
||
| ## Testing | ||
| <!-- Describe the tests you ran to verify your changes --> | ||
|
|
||
| - [ ] All existing tests pass | ||
| - [ ] Added new tests for new functionality | ||
| - [ ] Manual testing completed | ||
|
|
||
| ## Checklist | ||
| <!-- Mark completed items with an "x" --> | ||
|
|
||
| - [ ] My code follows the project's code style | ||
| - [ ] I have performed a self-review of my code | ||
| - [ ] I have commented my code, particularly in hard-to-understand areas | ||
| - [ ] I have made corresponding changes to the documentation | ||
| - [ ] My changes generate no new warnings | ||
| - [ ] I have added tests that prove my fix is effective or that my feature works | ||
| - [ ] New and existing unit tests pass locally with my changes | ||
| - [ ] Any dependent changes have been merged and published | ||
|
|
||
| ## Screenshots (if applicable) | ||
| <!-- Add screenshots to help explain your changes --> | ||
|
|
||
| ## Additional Notes | ||
| <!-- Add any additional notes or context --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, develop] | ||
| pull_request: | ||
| branches: [main, develop] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: [18.x, 20.x, 22.x] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10 | ||
|
|
||
| - name: Setup Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Format check | ||
| run: pnpm run format:check | ||
|
|
||
| - name: Lint | ||
| run: pnpm run lint | ||
|
|
||
| - name: Test | ||
| run: pnpm test | ||
|
|
||
| - name: Build | ||
| run: pnpm run build | ||
|
|
||
| - name: Upload coverage | ||
| if: matrix.node-version == '20.x' | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| files: ./coverage/lcov.info | ||
| flags: unittests | ||
| name: codecov-umbrella |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| pnpm lint | ||
| pnpm format:check | ||
| pnpm test |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.