diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..4e7f26a --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,23 @@ +env: + browser: true + es2021: true +extends: standard-with-typescript +parserOptions: + ecmaVersion: latest + sourceType: module +rules: + '@typescript-eslint/semi': 'off' + '@typescript-eslint/strict-boolean-expressions': 'off' + '@typescript-eslint/ban-types': 'off' + '@typescript-eslint/explicit-function-return-type': 'off' + '@typescript-eslint/restrict-template-expressions': 'off' + '@typescript-eslint/comma-dangle': 'off' + '@typescript-eslint/space-before-function-paren': 'off' + '@typescript-eslint/member-delimiter-style': 'off' + '@typescript-eslint/indent': 'off' + 'generator-star-spacing': 'off' + '@typescript-eslint/naming-convention': 'off' + '@typescript-eslint/no-extraneous-class': 'off' +ignorePatterns: + - 'jest.config.js' + - '**/__tests__/**' diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000..d386567 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,45 @@ +name: Bug report +description: Report a problem. +title: "[Bug]: " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Use this form to report a bug or problem with the Paddle Node.js SDK. + + Remember to remove sensitive information from screenshots, videos, or code samples before submitting. + + **Do not create issues for potential security vulnerabilities.** Please see the [Paddle Vulnerability Disclosure Policy](https://www.paddle.com/vulnerability-disclosure-policy) and report any vulnerabilities [using our form](https://vdp.paddle.com/p/Report-a-Vulnerability). + + Thanks for helping to make the Paddle platform better for everyone! + - type: textarea + id: description + attributes: + label: What happened? + description: Describe the bug in a sentence or two. Feel free to add screenshots or a video to better explain! + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: Steps to reproduce + description: Explain how to reproduce this issue. We prefer a step-by-step walkthrough, where possible. + value: | + 1. + 2. + 3. + ... + validations: + required: true + - type: textarea + id: expected-behavior + attributes: + label: What did you expect to happen? + description: Tell us what should happen when you encounter this bug. + - type: textarea + id: logs + attributes: + label: Logs + description: Copy and paste any relevant logs. This is automatically formatted into code, so no need for backticks. + render: shell \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3e03b03 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Get help + url: https://developer.paddle.com/ + about: For help with the Paddle Node.js SDK or building your integration, contact our support team at [sellers@paddle.com](mailto:sellers@paddle.com). + - name: Report a vulnerability + url: https://vdp.paddle.com/p/Report-a-Vulnerability + about: Please see the [Paddle Vulnerability Disclosure Policy](https://www.paddle.com/vulnerability-disclosure-policy) and report any vulnerabilities using https://vdp.paddle.com/p/Report-a-Vulnerability. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 0000000..eb17c06 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,44 @@ +name: Feature request +description: Suggest an idea. +title: "[Feature]: " +labels: ["feature"] +body: + - type: markdown + attributes: + value: | + Use this form to send us suggestions for improvements to the Paddle Node.js SDK. + + For general feedback about the Paddle API or developer platform, contact our DX team directly + at [team-dx@paddle.com](mailto:team-dx@paddle.com). + + Thanks for helping to make the Paddle platform better for everyone! + - type: textarea + id: request + attributes: + label: Tell us about your feature request + description: Describe what you'd like to see added or improved. + validations: + required: true + - type: textarea + id: problem + attributes: + label: What problem are you looking to solve? + description: Tell us how and why would implementing your suggestion would help. + validations: + required: true + - type: textarea + id: additional-information + attributes: + label: Additional context + description: Add any other context, screenshots, or illustrations about your suggestion here. + - type: dropdown + id: priority + attributes: + label: How important is this suggestion to you? + options: + - Nice to have + - Important + - Critical + default: 0 + validations: + required: true diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..8b01671 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,43 @@ +name: Build & Test + +on: + push: + branches: + - main + - v1.X + pull_request: + branches: + - main + - v1.X + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + run-build-test: + name: Run Build & test + runs-on: ubuntu-latest + + permissions: + contents: read + actions: write + + steps: + - name: Check out git repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: lts/* + cache: "yarn" + + - name: Install yarn dependencies + run: yarn install + + - name: Build + run: yarn build + + - name: Test + run: yarn test \ No newline at end of file diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..8808693 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,42 @@ +name: Lint + +on: + push: + branches: + - main + - v1.X + pull_request: + branches: + - main + - v1.X + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + run-linters: + name: Run linters + runs-on: ubuntu-latest + + permissions: + contents: read + actions: write + + steps: + - name: Check out git repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: lts/* + cache: "yarn" + + - name: Install yarn dependencies + run: yarn install + + - name: Lint + run: | + yarn lint + yarn prettier \ No newline at end of file diff --git a/.github/workflows/publish-latest.yml b/.github/workflows/publish-latest.yml new file mode 100644 index 0000000..c0a1923 --- /dev/null +++ b/.github/workflows/publish-latest.yml @@ -0,0 +1,40 @@ +name: Publish to latest Tag + +on: + push: + branches: + - main + +jobs: + run-publish: + name: Run publish + runs-on: ubuntu-latest + + permissions: + contents: read + actions: write + + steps: + - name: Check out git repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: lts/* + cache: "yarn" + registry-url: 'https://registry.npmjs.org' + + - name: Install yarn dependencies + run: yarn install + + - name: Build + run: yarn build + + - name: Test + run: yarn test + + - name: Publish + run: yarn publish:latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d52285 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/dist + +# misc +.DS_Store +*.pem +.idea + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env +.env.local +.env.development.local +.env.test.local +.env.production.local +src/version.ts +# Sentry +.sentryclirc + +*.tsbuildinfo diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..d264e2b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "singleQuote": true, + "semi": true, + "tabWidth": 2, + "printWidth": 120, + "trailingComma": "all", + "bracketSpacing": true, +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..152a1fa --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,219 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +> **Important:** While in early access (version 0.X.Y) we may introduce breaking changes. Where we can, we'll tag breaking changes in this changelog and communicate ahead of time. + +Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-node-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools. + +## 0.2.9 - 2024-01-11 + +### Fixed + +- Marked `endsAt` as optional in discount under Subscriptions entity. + +--- + +## 0.2.8 - 2024-01-09 + +### Fixed + +- Marked `unitPriceOverrides` as optional in Price entity. + +--- + +## 0.2.7 - 2024-01-04 + +### Fixed + +- Marked all properties in `ListNotificationQueryParameters` as optional. +- Removed additional `?` from URLS in List Reports and List Notifications functions. +- Fixed incorrect enum in Adjustment `type` + +--- + +## 0.2.6 - 2023-12-22 + +### Added + +- Added support for `address.imported`, `business.imported`, `customer.imported`, `price.imported` and `product.imported` notifications. + +### Changed + +- Added support to get available payment methods when previewing prices or transactions, see [related changelog](https://developer.paddle.com/changelog/2023/available-payment-methods?utm_source=dx&utm_medium=paddle-node-sdk). +- Added support to bill a one time non-catalog products and prices to subscription, see [related changelog](https://developer.paddle.com/changelog/2023/bill-custom-items-one-time-subscription-charge?utm_source=dx&utm_medium=paddle-node-sdk). +- Added support for non-catalog products and prices to transaction, see [related changelog](https://developer.paddle.com/changelog/2023/add-custom-items-transaction?utm_source=dx&utm_medium=paddle-node-sdk). +- Added `subscription.onPaymentFailure` to update subscriptions and preview update subscription operations, see [related changelog](https://developer.paddle.com/changelog/2023/payment-failure-behavior-update-subscription?utm_source=dx&utm_medium=paddle-node-sdk). + +--- + +## 0.2.5 - 2023-12-15 + +### Added + +- Added `reports.list()` to [list reports](https://developer.paddle.com/api-reference/reports/list-reports?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `reports.create()` to [create a new report](https://developer.paddle.com/api-reference/reports/create-report?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `reports.get()` to [get a report](https://developer.paddle.com/api-reference/reports/get-report?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `reports.getReportCsv()` to [get a CSV file for a report](https://developer.paddle.com/api-reference/reports/get-report-csv?utm_source=dx&utm_medium=paddle-node-sdk) + +--- + +## 0.2.4 - 2023-12-14 + +### Changed + +- Added `importMeta` to address, business, customer, discount and subscription entities +- Added `creditToBalance` to `transaction.details.payoutTotals` and `transaction.details.totals` +- Added `origin` query parameter to list transactions, see [related changelog](https://developer.paddle.com/changelog/2023/filter-transactions-origin?utm_source=dx&utm_medium=paddle-node-sdk). + +--- + +## 0.2.3 - 2023-12-12 + +### Added + +- Added `eventTypes.list()` to [list all event types](https://developer.paddle.com/api-reference/event-types/list-event-types?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `notificationSettings.list()` to [list all notification settings](https://developer.paddle.com/api-reference/notification-settings/list-notification-settings?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `notificationSettings.create()` to [create a notification settings](https://developer.paddle.com/api-reference/notification-settings/create-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `notificationSettings.get()` to [get a notification settings](https://developer.paddle.com/api-reference/notification-settings/get-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `notificationSettings.update()` to [update a notification settings](https://developer.paddle.com/api-reference/notification-settings/update-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `notificationSettings.delete()` to [delete a notification settings](https://developer.paddle.com/api-reference/notification-settings/delete-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `notifications.list()` to [list all notifications](https://developer.paddle.com/api-reference/notifications/list-notifications?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `notifications.get()` to [get a notification](https://developer.paddle.com/api-reference/notifications/get-notification?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `notifications.replay()` to [replay a notification](https://developer.paddle.com/api-reference/notifications/replay-notification?utm_source=dx&utm_medium=paddle-node-sdk) +- Added `notifications.getLogs()` to [get all logs for a notification](https://developer.paddle.com/api-reference/notification-logs/list-notification-logs?utm_source=dx&utm_medium=paddle-node-sdk) + +### Fixed + +- Fixed incorrect type of `action` in `subscriptions.scheduled_change` + +--- + +## 0.2.2 - 2023-12-01 + +### Added + +- Added `events.list()` to [list all events](https://developer.paddle.com/api-reference/events/list-events?utm_source=dx&utm_medium=paddle-node-sdk) +- Added helper function `paddle.webhooks.unmarshal` to [validate](https://developer.paddle.com/webhooks/signature-verification?utm_source=dx&utm_medium=paddle-node-sdk) and parse webhook events + +--- + +## 0.2.1 - 2023-11-29 + +### Added + +- Added helper function to archive supported entities +- Added `pricingPreview.preview()` to [preview calculations for one or more prices](https://developer.paddle.com/api-reference/pricing-preview/preview-prices?utm_source=dx&utm_medium=paddle-node-sdk) + +### Changed + +- **Breaking change:** Converted all `list` operations to be synchronous. They did not have any async operation within them, and it was incorrectly typed to return a `Promise`. + +--- + +## 0.2.0 - 2023-11-28 + +> **Breaking changes:** This version includes major improvements that introduce breaking changes. These are called out below. + +### Added + +- Added `lodash` as a dependency. +- Added `customData` to discount entity, see: [related changelog](https://developer.paddle.com/changelog/2023/custom-data-discounts?utm_source=dx&utm_medium=paddle-node-sdk). +- Added `name` to price entity, see [related changelog](https://developer.paddle.com/changelog/2023/price-name-description?utm_source=dx&utm_medium=paddle-node-sdk). +- Added `importMeta` to product and price entities. + +### Fixed + +- Fixed [list credit balances for a customer](https://developer.paddle.com/api-reference/customers/list-credit-balances?utm_source=dx&utm_medium=paddle-node-sdk) response entity. +- Fixed `adjustments` array in `next_transaction` object in subscription entity. + +### Changed + +- **Breaking change:** Converted all properties from `snake_case` to `camelCase`. This matches JavaScript conventions for field names. + +### Removed + +- **Breaking change:** Removed `toJson` function from all entities. + +--- + +## 0.1.8 - 2023-11-24 + +### Added + +- Added `transactions.preview()` to [preview a transaction](https://developer.paddle.com/api-reference/transactions/preview-transaction?utm_source=dx&utm_medium=paddle-node-sdk) operation. + +--- + +## 0.1.7 - 2023-11-23 + +### Added + +- Added changelog. + +--- + +## 0.1.6 - 2023-11-22 + +### Fixed + +- Fixed optional management URL object in subscription entities. + +--- + +## 0.1.5 - 2023-11-14 + +### Added + +- Added `transactions.getInvoicePDF()` for the [get a PDF invoice for a transaction](https://developer.paddle.com/api-reference/transactions/get-invoice-pdf?utm_source=dx&utm_medium=paddle-node-sdk) operation. +- Enabled request and response logging. + +--- + +## 0.1.4 - 2023-11-09 + +### Removed + +- Removed unused dependency `lodash`. + +--- + +## 0.1.3 - 2023-11-08 + +### Fixed + +- Added missing query parameters for the [list transactions](https://developer.paddle.com/api-reference/transactions/list-transactions?utm_source=dx&utm_medium=paddle-node-sdk) operation. + +--- + +## 0.1.2 - 2023-11-06 + +### Fixed + +- Fixed incorrect update subscription request body TypeScript definition. + +--- + +## 0.1.1 - 2023-11-06 + +### Added + +- Added `customers.getCreditBalance()` for the [list credit balances for a customer](https://developer.paddle.com/api-reference/customers/list-credit-balances?utm_source=dx&utm_medium=paddle-node-sdk) operation. +- Added `subscriptions.previewUpdate()` for the [preview an update to a subscription](https://developer.paddle.com/api-reference/subscriptions/preview-subscription?utm_source=dx&utm_medium=paddle-node-sdk) operation. +- Added `subscriptions.activate()` for the [activate a trialing subscription](https://developer.paddle.com/api-reference/subscriptions/activate-subscription?utm_source=dx&utm_medium=paddle-node-sdk) operation. +- Added `subscriptions.pause()` for the [pause a subscription](https://developer.paddle.com/api-reference/subscriptions/pause-subscription?utm_source=dx&utm_medium=paddle-node-sdk) operation. +- Added `subscriptions.resume()` for the [resume a paused subscription](https://developer.paddle.com/api-reference/subscriptions/resume-subscription?utm_source=dx&utm_medium=paddle-node-sdk) operation. +- Added `subscriptions.cancel()` for the [cancel a subscription](https://developer.paddle.com/api-reference/subscriptions/cancel-subscription?utm_source=dx&utm_medium=paddle-node-sdk) operation. +- Added `subscriptions.createOneTimeCharge()` for the [create a one-time charge for a subscription](https://developer.paddle.com/api-reference/subscriptions/create-one-time-charge?utm_source=dx&utm_medium=paddle-node-sdk) operation. +- Added `subscriptions.previewOneTimeCharge()` for the [preview a one-time charge for a subscription](https://developer.paddle.com/api-reference/subscriptions/preview-subscription-charge?utm_source=dx&utm_medium=paddle-node-sdk) operation. +- Added `subscriptions.getPaymentMethodChangeTransaction()` for the [get a transaction to update payment method](https://developer.paddle.com/api-reference/subscriptions/update-payment-method?utm_source=dx&utm_medium=paddle-node-sdk) operation. + +--- + +## 0.1.0 - 2023-11-03 + +### Added + +- Initial early access release. Added support for the most frequently used Paddle Billing entities and API operations. Check the [README](./README.md) for more information. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6c37ab1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +## Contributing + +If you've spotted a problem with this package or have a new feature request please open an issue. + +For help with the Paddle API or building your integration, contact our support team at [sellers@paddle.com](mailto:sellers@paddle.com). \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f49a4e1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7317e94 --- /dev/null +++ b/README.md @@ -0,0 +1,277 @@ +# Paddle Node.js SDK + +[Paddle Billing](https://www.paddle.com/billing?utm_source=dx&utm_medium=paddle-node-sdk) is a complete digital product sales and subscription management platform, designed for modern software businesses. It helps you increase your revenue, retain customers, and scale your operations. + +This is a [Node.js](https://nodejs.org/) SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript. + +For working with Paddle in your frontend, use [Paddle.js](https://developer.paddle.com/paddlejs/overview?utm_source=dx&utm_medium=paddle-node-sdk). You can open checkouts, securely collect payment information, build pricing pages, and integrate with Paddle Retain. + +> **Important:** This package works with Paddle Billing. It does not support Paddle Classic. To work with Paddle Classic, see: [Paddle Classic API reference](https://developer.paddle.com/classic/api-reference/1384a288aca7a-api-reference?utm_source=dx&utm_medium=paddle-node-sdk) + + +## Before you begin + +This SDK is in early access, which means that we're actively developing it based on feedback from our developer community. + +If you've used this SDK, we'd love to hear how you found it! Email us at [team-dx@paddle.com](mailto:team-dx@paddle.com) with any thoughts. + +While in early access, we may introduce breaking changes. Where we can, we'll tag breaking changes and communicate ahead of time. Please pin the version of the SDK in your `package.json` to avoid downloading newer versions with potential breaking changes. + +## Installation + +Install using `npm`: + +```sh +npm install @paddle/paddle-node-sdk +``` + +Install using `yarn`: + +```sh +yarn add @paddle/paddle-node-sdk +``` + +Install using `pnpm`: + +```sh +pnpm add @paddle/paddle-node-sdk +``` + +## Usage + +To authenticate, you'll need an API key. You can create and manage API keys in **Paddle > Developer tools > Authentication**. + +Pass your API key while initializing a new Paddle client. + +``` typescript +import { Environment, Paddle } from '@paddle/paddle-node-sdk' + +const paddle = new Paddle('API_KEY') +``` + +You can also pass an environment to work with the sandbox: + +```typescript +const paddle = new Paddle('API_KEY', { + environment: Environment.production, // or Environment.sandbox for accessing sandbox API +}) +``` + +Keep in mind that API keys are separate for your sandbox and live accounts, so you'll need to generate keys for each environment. + +## Work with TypeScript + +This SDK comes with TypeScript definitions for the Paddle API. We recommend that you update frequently to keep the TypeScript definitions up-to-date with the API. Use `// @ts-ignore` to prevent any type error if you don't want to update. + +## Naming conventions + +Properties in the Paddle API use `snake_case`. To follow JavaScript conventions, properties in this SDK use `camelCase`. This means: + +* Convert `snake_case` field names in the API docs to `camelCase` when creating or updating entities using the SDK. +* Responses match the API docs, but field names are `camelCase` rather than `snake_case`. + +## Examples + +### List entities + +You can list supported entities with the `list` function in the resource. It returns an iterator to help when working with multiple pages. + +``` typescript +import { Paddle } from '@paddle/paddle-node-sdk' + +const paddle = new Paddle('API_KEY') + +function getProducts() { + // creates an iterator instance + const productCollection = paddle.products.list() + return productCollection +} + +try { + // Creates an iterator to loop through paginated data. + // At this point, It does not hold any data. + const productCollection = getProducts() + + // Call `next()` to retrieve first page of the dataset + const firstPage = await productCollection.next() + console.log("First page data", firstPage) + + // Calling `next()` again will retrieve subsequent pages. + const secondPage = await productCollection.next() + console.log("Second page data", secondPage) +} catch (e) { + // Handle Network/API errors +} +``` + +### Create an entity + +You can create a supported entity with the `create` function in the resource. It accepts the body to be created. The created entity is returned. + +``` typescript +import { Paddle, CreateProductRequestBody } from '@paddle/paddle-node-sdk' + +const paddle = new Paddle('API_KEY') + +async function createProduct(requestBody: CreateProductRequestBody) { + try { + // Pass the request body with the attributes required to create + const product = await paddle.products.create(requestBody) + // Returns a product entity + return product + } catch (e) { + // Handle Network/API errors + } +} + +const product = await createProduct({ name: 'ChatApp Education', taxCategory: 'standard' }) +console.log("Product", product) +``` + +### Update an entity + +You can update a supported entity with the `update` function in the resource. It accepts the `id` of the entity to update and an object with the attributes to be updated. The updated entity is returned. + +``` typescript +import { Paddle, UpdateProductRequestBody } from '@paddle/paddle-node-sdk' + +const paddle = new Paddle('API_KEY') + +async function updateProduct(productId: string, requestBody: UpdateProductRequestBody) { + try { + // Pass the product id and request body with the attributes to update + const product = await paddle.products.update(productId, requestBody) + // Returns an updated product entity + return product + } catch (e) { + // Handle Network/API errors + } +} + +const product = await updateProduct('id', { name: 'ChatApp for Schools' }) +console.log('Updated product', product) +``` + +Where operations require more than one `id`, the `update` function accepts multiple arguments. For example, to update an address for a customer, pass the `customerId` and the `addressId`: + +```typescript +const address = await paddle.addresses.update(customerId, addressId, requestBody) +``` + +### Get an entity + +You can get an entity with the `get` function in the resource. It accepts the `id` of the entity to get. The entity is returned. + +``` typescript +import { Paddle } from '@paddle/paddle-node-sdk' + +const paddle = new Paddle('API_KEY') + +async function getProduct(productId: string) { + try { + // Pass the product id get + const product = await paddle.products.get(productId) + // Returns a product entity + return product + } catch (e) { + // Handle Network/API errors + } +} + +const product = await getProduct('id') +console.log('Product', product) +``` + +### Archive an entity + +You can archive an entity with the `archive` function in the resource. It accepts the `id` of the entity to archive. The entity is returned. + +#### Entities that support archival + +- Products +- Prices +- Discounts +- Customers +- Addresses +- Businesses + +``` typescript +import { Paddle } from '@paddle/paddle-node-sdk' + +const paddle = new Paddle('API_KEY') + +async function archiveProduct(productId: string) { + try { + // Pass the product id archive + const product = await paddle.products.archive(productId) + // Returns an archived product entity + return product + } catch (e) { + // Handle Network/API errors + } +} + +const product = await archiveProduct('id') +console.log('Product', product) +``` + +## Resources + +### Webhook signature verification + +The SDK includes a helper function to verify webhook signatures sent by Notifications from Paddle. + +```typescript +import { Paddle, EventName } from '@paddle/paddle-node-sdk' +import express, { Request, Response } from 'express' + +const paddle = new Paddle('API_KEY') +const app = express() + +// Create a `POST` endpoint to accept webhooks sent by Paddle. +// We need `raw` request body to validate the integrity. Use express raw middleware to ensure express doesn't convert the request body to JSON. +app.post('/webhooks', express.raw({ type: 'application/json' }), (req: Request, res: Response) => { + const signature = (req.headers['paddle-signature'] as string) || ''; + // req.body should be of type `buffer`, convert to string before passing it to `unmarshal`. + // If express returned a JSON, remove any other middleware that might have processed raw request to object + const rawRequestBody = req.body.toString(); + // Replace `WEBHOOK_SECRET_KEY` with the secret key in notifications from vendor dashboard + const secretKey = process.env['WEBHOOK_SECRET_KEY'] || ''; + + try { + if (signature && rawRequestBody) { + // The `unmarshal` function will validate the integrity of the webhook and return an entity + const eventData = paddle.webhooks.unmarshal(rawRequestBody, secretKey, signature); + switch (eventData.eventType) { + case EventName.ProductUpdated: + console.log(`Product ${eventData.data.id} was updated`); + break; + case EventName.SubscriptionUpdated: + console.log(`Subscription ${eventData.data.id} was updated`); + break; + default: + console.log(eventData.eventType); + } + } else { + console.log('Signature missing in header'); + } + } catch (e) { + // Handle signature mismatch or other runtime errors + console.log(e); + } + // Return a response to acknowledge + res.send('Processed webhook event'); +}); + +app.listen(3000) + +``` + +## Feature parity + +The Node.js SDK has complete feature parity with the Paddle API. All operations in the Paddle API are supported. + +## Learn more + +- [Paddle API reference](https://developer.paddle.com/api-reference/overview?utm_source=dx&utm_medium=paddle-node-sdk) +- [Sign up for Paddle Billing](https://login.paddle.com/signup?utm_source=dx&utm_medium=paddle-node-sdk) \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..7bd6d90 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,14 @@ +- [Security Policy](#security-policy) + - [Reporting a Vulnerability](#reporting-a-vulnerability) + +# Security policy + +## Reporting a vulnerability + +Please see the [Paddle Vulnerability Disclosure Policy](https://www.paddle.com/vulnerability-disclosure-policy) and +report any vulnerabilities using https://vdp.paddle.com/p/Report-a-Vulnerability. + +> [!WARNING] +> Do not create issues for potential security vulnerabilities. Issues are public and can be seen by potentially malicious actors. + +Thanks for helping to make the Paddle platform safe for everyone. \ No newline at end of file diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..8165fe4 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,6 @@ +module.exports = { + presets: [ + ['@babel/preset-env', { targets: { node: 'current' } }], + '@babel/preset-typescript', + ], +}; diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..1488a1a --- /dev/null +++ b/jest.config.js @@ -0,0 +1,15 @@ +/** @type {import('jest').Config} */ +const config = { + verbose: true, + collectCoverage: true, + coverageReporters: ['text'], + roots: [''], + modulePaths: [''], + moduleDirectories: ['node_modules'], + testMatch: ['**/__tests__/**/*.test.ts'], + testPathIgnorePatterns: ['/node_modules/', '/dist/'], + cacheDirectory: process.env.JEST_CACHE_FOLDER || '/tmp/node-sdk/.jest-cache', + coveragePathIgnorePatterns: ['/src/types/', '__tests__', '/src/enums/', 'operations'], +}; + +module.exports = config; diff --git a/package.json b/package.json new file mode 100644 index 0000000..777d7d1 --- /dev/null +++ b/package.json @@ -0,0 +1,54 @@ +{ + "name": "@paddle/paddle-node-sdk", + "version": "0.2.9", + "description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "scripts": { + "test": "jest", + "prebuild": "node ./scripts/update-env-vars.js", + "build": "yarn clean && tsc", + "prettier": "prettier --check ./src", + "prettier:fix": "prettier --check ./src --write", + "lint": "eslint --ext .ts,.tsx ./src", + "lint:fix": "eslint --ext .ts,.tsx ./src --fix", + "clean": "rm -rf ./dist", + "release:beta": "yarn version --prerelease --preid beta --no-git-tag-version --no-commit-hooks", + "publish:beta": "yarn publish --tag beta --access public", + "publish:latest": "yarn publish --access public" + }, + "files": [ + "dist" + ], + "keywords": [ + "Paddle", + "SDK" + ], + "author": "paddle.com", + "license": "Apache-2.0", + "homepage": "https://developer.paddle.com/api-reference/overview", + "devDependencies": { + "@babel/core": "^7.23.0", + "@babel/preset-env": "^7.22.20", + "@babel/preset-typescript": "^7.23.0", + "@types/jest": "^29.5.6", + "@types/lodash": "^4.14.202", + "@types/node": "^20.6.0", + "@types/node-fetch": "^2.6.6", + "@typescript-eslint/eslint-plugin": "^6.4.0", + "babel-jest": "^29.7.0", + "dotenv": "^16.3.1", + "eslint": "^8.0.1", + "eslint-config-standard-with-typescript": "^39.1.1", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^16.0.0 ", + "eslint-plugin-promise": "^6.0.0", + "jest": "^29.7.0", + "prettier": "^3.0.3", + "typescript": "^5.2.2" + }, + "dependencies": { + "lodash": "^4.17.21", + "node-fetch": "^2.7.0" + } +} diff --git a/scripts/update-env-vars.js b/scripts/update-env-vars.js new file mode 100644 index 0000000..6228542 --- /dev/null +++ b/scripts/update-env-vars.js @@ -0,0 +1,3 @@ +const fs = require('fs'); + +fs.writeFileSync('./src/version.ts', `export const SDK_VERSION = '${process.env.npm_package_version}';`); diff --git a/src/__tests__/helpers/test-client.ts b/src/__tests__/helpers/test-client.ts new file mode 100644 index 0000000..1c0b450 --- /dev/null +++ b/src/__tests__/helpers/test-client.ts @@ -0,0 +1,6 @@ +import { Client } from '../../internal/api/client'; +import { Environment } from '../../internal'; + +export function getPaddleTestClient() { + return new Client('TEST_API_KEY', { environment: Environment.sandbox }); +} diff --git a/src/__tests__/internal/paddle.test.ts b/src/__tests__/internal/paddle.test.ts new file mode 100644 index 0000000..ae938e5 --- /dev/null +++ b/src/__tests__/internal/paddle.test.ts @@ -0,0 +1,10 @@ +import { Environment, Paddle } from '../../index'; + +describe('Paddle', () => { + test('Paddle class can be constructed', () => { + expect(new Paddle('...')).toBeInstanceOf(Paddle); + }); + test('Paddle class can be constructed with options', () => { + expect(new Paddle('...', { environment: Environment.sandbox })).toBeInstanceOf(Paddle); + }); +}); diff --git a/src/__tests__/mocks/notifications/address-created.mock.ts b/src/__tests__/mocks/notifications/address-created.mock.ts new file mode 100644 index 0000000..00e1624 --- /dev/null +++ b/src/__tests__/mocks/notifications/address-created.mock.ts @@ -0,0 +1,50 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IAddressResponse } from '../../../types'; + +export const AddressCreatedMock: IEventsResponse = { + event_id: 'evt_01h848pezaj15tkt3dsa36xe59', + event_type: 'address.created', + occurred_at: '2023-08-18T12:07:37.194676Z', + notification_id: 'ntf_01h848pf2kbkz7j9fd1554029j', + data: { + id: 'add_01h848pep46enq8y372x7maj0p', + city: 'New York', + region: 'NY', + status: 'active', + created_at: '2023-08-18T12:07:36.9Z', + first_line: '4050 Jefferson Plaza, 41st Floor', + updated_at: '2023-08-18T12:07:36.9Z', + description: 'Head Office', + postal_code: '10021', + second_line: null, + country_code: 'US', + custom_data: null, + }, +}; + +export const AddressCreatedMockExpectation = { + data: { + city: 'New York', + countryCode: 'US', + createdAt: '2023-08-18T12:07:36.9Z', + customData: null, + description: 'Head Office', + firstLine: '4050 Jefferson Plaza, 41st Floor', + id: 'add_01h848pep46enq8y372x7maj0p', + importMeta: null, + postalCode: '10021', + region: 'NY', + secondLine: null, + status: 'active', + updatedAt: '2023-08-18T12:07:36.9Z', + }, + eventId: 'evt_01h848pezaj15tkt3dsa36xe59', + eventType: 'address.created', + notificationId: 'ntf_01h848pf2kbkz7j9fd1554029j', + occurredAt: '2023-08-18T12:07:37.194676Z', +}; diff --git a/src/__tests__/mocks/notifications/address-imported.mock.ts b/src/__tests__/mocks/notifications/address-imported.mock.ts new file mode 100644 index 0000000..0ba22e5 --- /dev/null +++ b/src/__tests__/mocks/notifications/address-imported.mock.ts @@ -0,0 +1,54 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IAddressResponse } from '../../../types'; + +export const AddressImportedMock: IEventsResponse = { + event_id: 'evt_01hhy7cva3jgaez82k6n4n3x4b', + event_type: 'address.imported', + occurred_at: '2023-08-18T12:07:37.194676Z', + notification_id: 'ntf_01hhvz7kcx82qj48zwna584bc0', + data: { + id: 'add_01h848pep46enq8y372x7maj0p', + city: 'New York', + region: 'NY', + status: 'active', + created_at: '2023-08-18T12:07:36.9Z', + first_line: '4050 Jefferson Plaza, 41st Floor', + updated_at: '2023-08-18T12:07:36.9Z', + description: 'Head Office', + postal_code: '10021', + second_line: null, + country_code: 'US', + custom_data: null, + import_meta: { external_id: '59f25141-28c3-4447-b77c-dae5677537f0', imported_from: 'billing_platform' }, + }, +}; + +export const AddressImportedMockExpectation = { + data: { + city: 'New York', + countryCode: 'US', + createdAt: '2023-08-18T12:07:36.9Z', + customData: null, + description: 'Head Office', + firstLine: '4050 Jefferson Plaza, 41st Floor', + id: 'add_01h848pep46enq8y372x7maj0p', + importMeta: { + externalId: '59f25141-28c3-4447-b77c-dae5677537f0', + importedFrom: 'billing_platform', + }, + postalCode: '10021', + region: 'NY', + secondLine: null, + status: 'active', + updatedAt: '2023-08-18T12:07:36.9Z', + }, + eventId: 'evt_01hhy7cva3jgaez82k6n4n3x4b', + eventType: 'address.imported', + notificationId: 'ntf_01hhvz7kcx82qj48zwna584bc0', + occurredAt: '2023-08-18T12:07:37.194676Z', +}; diff --git a/src/__tests__/mocks/notifications/address-updated.mock.ts b/src/__tests__/mocks/notifications/address-updated.mock.ts new file mode 100644 index 0000000..637ec10 --- /dev/null +++ b/src/__tests__/mocks/notifications/address-updated.mock.ts @@ -0,0 +1,50 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IAddressResponse } from '../../../types'; + +export const AddressUpdatedMock: IEventsResponse = { + event_id: 'evt_01h849k5rs5jxgctb45s6pmkat', + event_type: 'address.updated', + occurred_at: '2023-08-18T12:23:18.041154Z', + notification_id: 'ntf_01h849k5vexw8kw4r74tm2w2g3', + data: { + id: 'add_01h849j51zpxv1e3zy2vgrrk6a', + city: 'San Jose', + region: 'CA', + status: 'active', + created_at: '2023-08-18T12:22:44.543Z', + first_line: '5400 E Washington Drive, Floor 2', + updated_at: '2023-08-18T12:23:17.773852Z', + description: 'California Office', + postal_code: '95314', + second_line: null, + country_code: 'US', + custom_data: null, + }, +}; + +export const AddressUpdatedMockExpectation = { + data: { + city: 'San Jose', + countryCode: 'US', + createdAt: '2023-08-18T12:22:44.543Z', + customData: null, + description: 'California Office', + firstLine: '5400 E Washington Drive, Floor 2', + id: 'add_01h849j51zpxv1e3zy2vgrrk6a', + importMeta: null, + postalCode: '95314', + region: 'CA', + secondLine: null, + status: 'active', + updatedAt: '2023-08-18T12:23:17.773852Z', + }, + eventId: 'evt_01h849k5rs5jxgctb45s6pmkat', + eventType: 'address.updated', + notificationId: 'ntf_01h849k5vexw8kw4r74tm2w2g3', + occurredAt: '2023-08-18T12:23:18.041154Z', +}; diff --git a/src/__tests__/mocks/notifications/adjustment-created.mock.ts b/src/__tests__/mocks/notifications/adjustment-created.mock.ts new file mode 100644 index 0000000..700834e --- /dev/null +++ b/src/__tests__/mocks/notifications/adjustment-created.mock.ts @@ -0,0 +1,90 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IAdjustmentResponse } from '../../../types'; + +export const AdjustmentCreatedMock: IEventsResponse = { + event_id: 'evt_01h8c6tc8aa58zqj6h8a13r103', + event_type: 'adjustment.created', + occurred_at: '2023-08-21T14:08:43.786457Z', + notification_id: 'ntf_01h8c6tcaga3vyfv0w5x9mznhg', + data: { + id: 'adj_01h8c6tbrkpdd7vx61w7b1r0ap', + items: [ + { + id: 'adjitm_01h8c6tbrkpdd7vx61w86e52t8', + type: 'partial', + amount: '100', + totals: { tax: '8', total: '100', subtotal: '92' }, + item_id: 'txnitm_01h8bxryv3065dyh6103p3yg28', + proration: null, + }, + ], + action: 'refund', + reason: 'error', + status: 'pending_approval', + totals: { fee: '5', tax: '8', total: '100', earnings: '87', subtotal: '92', currency_code: 'USD' }, + created_at: '2023-08-21T14:08:43.297512Z', + updated_at: '0001-01-01T00:00:00Z', + customer_id: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + currency_code: 'USD', + payout_totals: { fee: '5', tax: '8', total: '100', earnings: '87', subtotal: '92', currency_code: 'USD' }, + transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5', + subscription_id: 'sub_01h8bxswamxysj44zt5n48njwh', + credit_applied_to_balance: true, + }, +}; + +export const AdjustmentCreatedMockExpectation = { + data: { + action: 'refund', + createdAt: '2023-08-21T14:08:43.297512Z', + creditAppliedToBalance: true, + currencyCode: 'USD', + customerId: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + id: 'adj_01h8c6tbrkpdd7vx61w7b1r0ap', + items: [ + { + amount: '100', + id: 'adjitm_01h8c6tbrkpdd7vx61w86e52t8', + itemId: 'txnitm_01h8bxryv3065dyh6103p3yg28', + proration: null, + totals: { + subtotal: '92', + tax: '8', + total: '100', + }, + type: 'partial', + }, + ], + payoutTotals: { + chargebackFee: null, + currencyCode: 'USD', + earnings: '87', + fee: '5', + subtotal: '92', + tax: '8', + total: '100', + }, + reason: 'error', + status: 'pending_approval', + subscriptionId: 'sub_01h8bxswamxysj44zt5n48njwh', + totals: { + currencyCode: 'USD', + earnings: '87', + fee: '5', + subtotal: '92', + tax: '8', + total: '100', + }, + transactionId: 'txn_01h8bxpvx398a7zbawb77y0kp5', + updatedAt: '0001-01-01T00:00:00Z', + }, + eventId: 'evt_01h8c6tc8aa58zqj6h8a13r103', + eventType: 'adjustment.created', + notificationId: 'ntf_01h8c6tcaga3vyfv0w5x9mznhg', + occurredAt: '2023-08-21T14:08:43.786457Z', +}; diff --git a/src/__tests__/mocks/notifications/adjustment-updated.mock.ts b/src/__tests__/mocks/notifications/adjustment-updated.mock.ts new file mode 100644 index 0000000..c2cf1eb --- /dev/null +++ b/src/__tests__/mocks/notifications/adjustment-updated.mock.ts @@ -0,0 +1,90 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IAdjustmentResponse } from '../../../types'; + +export const AdjustmentUpdatedMock: IEventsResponse = { + event_id: 'evt_01h8c6wz4ac017hxdehrgdvpz4', + event_type: 'adjustment.updated', + occurred_at: '2023-08-21T14:10:08.650443Z', + notification_id: 'ntf_01h8c6wz6bvsvae9t76xap5twy', + data: { + id: 'adj_01h8c6tbrkpdd7vx61w7b1r0ap', + items: [ + { + id: 'adjitm_01h8c6tbrkpdd7vx61w86e52t8', + type: 'partial', + amount: '100', + totals: { tax: '8', total: '100', subtotal: '92' }, + item_id: 'txnitm_01h8bxryv3065dyh6103p3yg28', + proration: null, + }, + ], + action: 'refund', + reason: 'error', + status: 'approved', + totals: { fee: '5', tax: '8', total: '100', earnings: '87', subtotal: '92', currency_code: 'USD' }, + created_at: '2023-08-21T14:08:43.297512Z', + updated_at: '2023-08-21T14:10:08.42549Z', + customer_id: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + currency_code: 'USD', + payout_totals: { fee: '5', tax: '8', total: '100', earnings: '87', subtotal: '92', currency_code: 'USD' }, + transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5', + subscription_id: 'sub_01h8bxswamxysj44zt5n48njwh', + credit_applied_to_balance: true, + }, +}; + +export const AdjustmentUpdatedMockExpectation = { + data: { + action: 'refund', + createdAt: '2023-08-21T14:08:43.297512Z', + creditAppliedToBalance: true, + currencyCode: 'USD', + customerId: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + id: 'adj_01h8c6tbrkpdd7vx61w7b1r0ap', + items: [ + { + amount: '100', + id: 'adjitm_01h8c6tbrkpdd7vx61w86e52t8', + itemId: 'txnitm_01h8bxryv3065dyh6103p3yg28', + proration: null, + totals: { + subtotal: '92', + tax: '8', + total: '100', + }, + type: 'partial', + }, + ], + payoutTotals: { + chargebackFee: null, + currencyCode: 'USD', + earnings: '87', + fee: '5', + subtotal: '92', + tax: '8', + total: '100', + }, + reason: 'error', + status: 'approved', + subscriptionId: 'sub_01h8bxswamxysj44zt5n48njwh', + totals: { + currencyCode: 'USD', + earnings: '87', + fee: '5', + subtotal: '92', + tax: '8', + total: '100', + }, + transactionId: 'txn_01h8bxpvx398a7zbawb77y0kp5', + updatedAt: '2023-08-21T14:10:08.42549Z', + }, + eventId: 'evt_01h8c6wz4ac017hxdehrgdvpz4', + eventType: 'adjustment.updated', + notificationId: 'ntf_01h8c6wz6bvsvae9t76xap5twy', + occurredAt: '2023-08-21T14:10:08.650443Z', +}; diff --git a/src/__tests__/mocks/notifications/business-created.mock.ts b/src/__tests__/mocks/notifications/business-created.mock.ts new file mode 100644 index 0000000..fd09838 --- /dev/null +++ b/src/__tests__/mocks/notifications/business-created.mock.ts @@ -0,0 +1,51 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IBusinessResponse } from '../../../types'; + +export const BusinessCreatedMock: IEventsResponse = { + event_id: 'evt_01h84a7j1cpqtrcdqs63ph1pqe', + event_type: 'business.created', + occurred_at: '2023-08-18T12:34:25.964234Z', + notification_id: 'ntf_01h84a7j47t67znhbhf633yek6', + data: { + id: 'biz_01h84a7hr4pzhsajkm8tev89ev', + name: 'ChatApp Inc.', + status: 'active', + contacts: [{ name: 'Parker Jones', email: 'parker@example.com' }], + custom_data: { customer_reference_id: 'abcd1234' }, + created_at: '2023-08-18T12:34:25.668Z', + updated_at: '2023-08-18T12:34:25.668Z', + company_number: '555775291485', + tax_identifier: '555952383', + }, +}; + +export const BusinessCreatedMockExpectation = { + data: { + companyNumber: '555775291485', + contacts: [ + { + email: 'parker@example.com', + name: 'Parker Jones', + }, + ], + createdAt: '2023-08-18T12:34:25.668Z', + customData: { + customer_reference_id: 'abcd1234', + }, + id: 'biz_01h84a7hr4pzhsajkm8tev89ev', + importMeta: null, + name: 'ChatApp Inc.', + status: 'active', + taxIdentifier: '555952383', + updatedAt: '2023-08-18T12:34:25.668Z', + }, + eventId: 'evt_01h84a7j1cpqtrcdqs63ph1pqe', + eventType: 'business.created', + notificationId: 'ntf_01h84a7j47t67znhbhf633yek6', + occurredAt: '2023-08-18T12:34:25.964234Z', +}; diff --git a/src/__tests__/mocks/notifications/business-imported.mock.ts b/src/__tests__/mocks/notifications/business-imported.mock.ts new file mode 100644 index 0000000..1aefa3f --- /dev/null +++ b/src/__tests__/mocks/notifications/business-imported.mock.ts @@ -0,0 +1,55 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IBusinessResponse } from '../../../types'; + +export const BusinessImportedMock: IEventsResponse = { + event_id: 'evt_01hhvz7k9kekw1wfxw8v8gbqcy', + event_type: 'business.imported', + occurred_at: '2023-08-18T12:34:25.964234Z', + notification_id: 'ntf_01hhvz7kcr2nv50zddzx4w4sgx', + data: { + id: 'biz_01h84a7hr4pzhsajkm8tev89ev', + name: 'ChatApp Inc.', + status: 'active', + contacts: [{ name: 'Parker Jones', email: 'parker@example.com' }], + custom_data: { customer_reference_id: 'abcd1234' }, + created_at: '2023-08-18T12:34:25.668Z', + updated_at: '2023-08-18T12:34:25.668Z', + company_number: '555775291485', + tax_identifier: '555952383', + import_meta: { external_id: '1fc0727f-d3d5-43a0-907a-f3c002535ca0', imported_from: 'billing_platform' }, + }, +}; + +export const BusinessImportedMockExpectation = { + data: { + companyNumber: '555775291485', + contacts: [ + { + email: 'parker@example.com', + name: 'Parker Jones', + }, + ], + createdAt: '2023-08-18T12:34:25.668Z', + customData: { + customer_reference_id: 'abcd1234', + }, + id: 'biz_01h84a7hr4pzhsajkm8tev89ev', + importMeta: { + externalId: '1fc0727f-d3d5-43a0-907a-f3c002535ca0', + importedFrom: 'billing_platform', + }, + name: 'ChatApp Inc.', + status: 'active', + taxIdentifier: '555952383', + updatedAt: '2023-08-18T12:34:25.668Z', + }, + eventId: 'evt_01hhvz7k9kekw1wfxw8v8gbqcy', + eventType: 'business.imported', + notificationId: 'ntf_01hhvz7kcr2nv50zddzx4w4sgx', + occurredAt: '2023-08-18T12:34:25.964234Z', +}; diff --git a/src/__tests__/mocks/notifications/business-updated.mock.ts b/src/__tests__/mocks/notifications/business-updated.mock.ts new file mode 100644 index 0000000..2492c45 --- /dev/null +++ b/src/__tests__/mocks/notifications/business-updated.mock.ts @@ -0,0 +1,63 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IBusinessResponse } from '../../../types'; + +export const BusinessUpdatedMock: IEventsResponse = { + event_id: 'evt_01h84b8sq18asjb0m3tvn4g0dn', + event_type: 'business.updated', + occurred_at: '2023-08-18T12:52:35.169192Z', + notification_id: 'ntf_01h84b8ss7b9bza3c831md1a4d', + data: { + id: 'biz_01h84a7hr4pzhsajkm8tev89ev', + name: 'ChatApp Inc.', + status: 'active', + contacts: [ + { name: 'Parker Jones', email: 'parker@example.com' }, + { name: 'Jo Riley', email: 'jo@example.com' }, + { name: 'Jesse Garcia', email: 'jo@example.com' }, + ], + custom_data: { customer_reference_id: 'abcd1234' }, + created_at: '2023-08-18T12:34:25.668Z', + updated_at: '2023-08-18T12:52:34.871482Z', + company_number: '555775291485', + tax_identifier: '555952383', + }, +}; + +export const BusinessUpdatedMockExpectation = { + data: { + companyNumber: '555775291485', + contacts: [ + { + email: 'parker@example.com', + name: 'Parker Jones', + }, + { + email: 'jo@example.com', + name: 'Jo Riley', + }, + { + email: 'jo@example.com', + name: 'Jesse Garcia', + }, + ], + createdAt: '2023-08-18T12:34:25.668Z', + customData: { + customer_reference_id: 'abcd1234', + }, + id: 'biz_01h84a7hr4pzhsajkm8tev89ev', + importMeta: null, + name: 'ChatApp Inc.', + status: 'active', + taxIdentifier: '555952383', + updatedAt: '2023-08-18T12:52:34.871482Z', + }, + eventId: 'evt_01h84b8sq18asjb0m3tvn4g0dn', + eventType: 'business.updated', + notificationId: 'ntf_01h84b8ss7b9bza3c831md1a4d', + occurredAt: '2023-08-18T12:52:35.169192Z', +}; diff --git a/src/__tests__/mocks/notifications/customer-created.mock.ts b/src/__tests__/mocks/notifications/customer-created.mock.ts new file mode 100644 index 0000000..a634eac --- /dev/null +++ b/src/__tests__/mocks/notifications/customer-created.mock.ts @@ -0,0 +1,46 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ICustomerResponse } from '../../../types'; + +export const CustomerCreatedMock: IEventsResponse = { + event_id: 'evt_01h8441jx8x1q971q9ksksqh82', + event_type: 'customer.created', + occurred_at: '2023-08-18T10:46:18.792661Z', + notification_id: 'ntf_01h8441jz6fr97hv7zemswj8cw', + data: { + id: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + name: 'Sam Miller', + email: 'sam@example.com', + locale: 'en', + status: 'active', + custom_data: { customer_reference_id: 'abcd1234' }, + created_at: '2023-08-18T10:46:18.533Z', + updated_at: '2023-08-18T10:46:18.533Z', + marketing_consent: false, + }, +}; + +export const CustomerCreatedMockExpectation = { + data: { + createdAt: '2023-08-18T10:46:18.533Z', + customData: { + customer_reference_id: 'abcd1234', + }, + email: 'sam@example.com', + id: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + importMeta: null, + locale: 'en', + marketingConsent: false, + name: 'Sam Miller', + status: 'active', + updatedAt: '2023-08-18T10:46:18.533Z', + }, + eventId: 'evt_01h8441jx8x1q971q9ksksqh82', + eventType: 'customer.created', + notificationId: 'ntf_01h8441jz6fr97hv7zemswj8cw', + occurredAt: '2023-08-18T10:46:18.792661Z', +}; diff --git a/src/__tests__/mocks/notifications/customer-imported.mock.ts b/src/__tests__/mocks/notifications/customer-imported.mock.ts new file mode 100644 index 0000000..94cdeaf --- /dev/null +++ b/src/__tests__/mocks/notifications/customer-imported.mock.ts @@ -0,0 +1,50 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ICustomerResponse } from '../../../types'; + +export const CustomerImportedMock: IEventsResponse = { + event_id: 'evt_01hhvz7k8twkw75ez34836tj0x', + event_type: 'customer.imported', + occurred_at: '2023-08-18T10:46:18.792661Z', + notification_id: 'ntf_01hhvz7kcgagx9afxemvb9gb1n', + data: { + id: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + name: 'Sam Miller', + email: 'sam@example.com', + locale: 'en', + status: 'active', + custom_data: { customer_reference_id: 'abcd1234' }, + created_at: '2023-08-18T10:46:18.533Z', + updated_at: '2023-08-18T10:46:18.533Z', + marketing_consent: false, + import_meta: { external_id: '4f626321-f3af-46f6-925e-d1cb315e89f0', imported_from: 'billing_platform' }, + }, +}; + +export const CustomerImportedMockExpectation = { + data: { + createdAt: '2023-08-18T10:46:18.533Z', + customData: { + customer_reference_id: 'abcd1234', + }, + email: 'sam@example.com', + id: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + importMeta: { + externalId: '4f626321-f3af-46f6-925e-d1cb315e89f0', + importedFrom: 'billing_platform', + }, + locale: 'en', + marketingConsent: false, + name: 'Sam Miller', + status: 'active', + updatedAt: '2023-08-18T10:46:18.533Z', + }, + eventId: 'evt_01hhvz7k8twkw75ez34836tj0x', + eventType: 'customer.imported', + notificationId: 'ntf_01hhvz7kcgagx9afxemvb9gb1n', + occurredAt: '2023-08-18T10:46:18.792661Z', +}; diff --git a/src/__tests__/mocks/notifications/customer-updated.mock.ts b/src/__tests__/mocks/notifications/customer-updated.mock.ts new file mode 100644 index 0000000..786e585 --- /dev/null +++ b/src/__tests__/mocks/notifications/customer-updated.mock.ts @@ -0,0 +1,46 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ICustomerResponse } from '../../../types'; + +export const CustomerUpdatedMock: IEventsResponse = { + event_id: 'evt_01h845v9ynfsazmdq3wntb3dzt', + event_type: 'customer.updated', + occurred_at: '2023-08-18T11:17:50.165823Z', + notification_id: 'ntf_01h845va1290rf078arfaar9b9', + data: { + id: 'ctm_01h844p3h41s12zs5mn4axja51', + name: 'Alex Wilson', + email: 'alex@example.com', + locale: 'en', + status: 'active', + custom_data: { customer_reference_id: 'abcd1234' }, + created_at: '2023-08-18T10:57:31.172Z', + updated_at: '2023-08-18T11:17:49.884487Z', + marketing_consent: false, + }, +}; + +export const CustomerUpdatedMockExpectation = { + data: { + createdAt: '2023-08-18T10:57:31.172Z', + customData: { + customer_reference_id: 'abcd1234', + }, + email: 'alex@example.com', + id: 'ctm_01h844p3h41s12zs5mn4axja51', + importMeta: null, + locale: 'en', + marketingConsent: false, + name: 'Alex Wilson', + status: 'active', + updatedAt: '2023-08-18T11:17:49.884487Z', + }, + eventId: 'evt_01h845v9ynfsazmdq3wntb3dzt', + eventType: 'customer.updated', + notificationId: 'ntf_01h845va1290rf078arfaar9b9', + occurredAt: '2023-08-18T11:17:50.165823Z', +}; diff --git a/src/__tests__/mocks/notifications/discount-created.mock.ts b/src/__tests__/mocks/notifications/discount-created.mock.ts new file mode 100644 index 0000000..89e5a14 --- /dev/null +++ b/src/__tests__/mocks/notifications/discount-created.mock.ts @@ -0,0 +1,61 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IDiscountResponse } from '../../../types'; + +export const DiscountCreatedMock: IEventsResponse = { + event_id: 'evt_01h8441jx8x1q971q9ksksqh82', + event_type: 'discount.created', + occurred_at: '2023-08-18T10:46:18.792661Z', + notification_id: 'ntf_01h8441jz6fr97hv7zemswj8cw', + data: { + id: 'dsc_01h8441jn5pcwrfhwh78jqt8hk', + status: 'active', + description: 'New customer discount', + enabled_for_checkout: true, + code: 'SG6JNMJQ3D', + type: 'flat', + amount: '5000', + currency_code: 'USD', + recur: false, + times_used: 0, + maximum_recurring_intervals: null, + usage_limit: 100, + restrict_to: ['pro_01h90yj132e28vzwsrdc83927j'], + custom_data: null, + import_meta: null, + expires_at: '2024-08-15T00:00:00.000Z', + created_at: '2023-08-18T10:46:18.792Z', + updated_at: '2023-08-18T10:46:18.792Z', + }, +}; + +export const DiscountCreatedMockExpectation = { + data: { + amount: '5000', + code: 'SG6JNMJQ3D', + createdAt: '2023-08-18T10:46:18.792Z', + currencyCode: 'USD', + customData: null, + description: 'New customer discount', + enabledForCheckout: true, + expiresAt: '2024-08-15T00:00:00.000Z', + id: 'dsc_01h8441jn5pcwrfhwh78jqt8hk', + importMeta: null, + maximumRecurringIntervals: null, + recur: false, + restrictTo: ['pro_01h90yj132e28vzwsrdc83927j'], + status: 'active', + timesUsed: 0, + type: 'flat', + updatedAt: '2023-08-18T10:46:18.792Z', + usageLimit: 100, + }, + eventId: 'evt_01h8441jx8x1q971q9ksksqh82', + eventType: 'discount.created', + notificationId: 'ntf_01h8441jz6fr97hv7zemswj8cw', + occurredAt: '2023-08-18T10:46:18.792661Z', +}; diff --git a/src/__tests__/mocks/notifications/discount-imported.mock.ts b/src/__tests__/mocks/notifications/discount-imported.mock.ts new file mode 100644 index 0000000..296af75 --- /dev/null +++ b/src/__tests__/mocks/notifications/discount-imported.mock.ts @@ -0,0 +1,64 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IDiscountResponse } from '../../../types'; + +export const DiscountImportedMock: IEventsResponse = { + event_id: 'evt_01hdnnd4x84s4r5br068y3rm6d', + event_type: 'discount.imported', + occurred_at: '2023-10-26T09:35:17.929027Z', + notification_id: 'ntf_01hdnnd505rcs80ss56rfn7qa2', + data: { + id: 'dsc_01gv599b6zkj42fkpxftjeca8f', + status: 'active', + description: 'Legacy customer discount', + enabled_for_checkout: true, + code: 'ZJFYC3K9KT', + type: 'flat', + amount: '1000', + currency_code: 'USD', + recur: true, + maximum_recurring_intervals: null, + usage_limit: null, + times_used: 0, + restrict_to: ['pri_01h19fp7wgbasj0h1627jknp7f'], + custom_data: null, + import_meta: { external_id: 'fc1ba9bc-8ddb-11ee-b9d1-0242ac120002', imported_from: 'billing_platform' }, + expires_at: '2023-06-12T09:18:00Z', + created_at: '2023-03-10T08:13:06.655Z', + updated_at: '2023-06-05T09:18:46.63Z', + }, +}; + +export const DiscountImportedMockExpectation = { + data: { + amount: '1000', + code: 'ZJFYC3K9KT', + createdAt: '2023-03-10T08:13:06.655Z', + currencyCode: 'USD', + customData: null, + description: 'Legacy customer discount', + enabledForCheckout: true, + expiresAt: '2023-06-12T09:18:00Z', + id: 'dsc_01gv599b6zkj42fkpxftjeca8f', + importMeta: { + externalId: 'fc1ba9bc-8ddb-11ee-b9d1-0242ac120002', + importedFrom: 'billing_platform', + }, + maximumRecurringIntervals: null, + recur: true, + restrictTo: ['pri_01h19fp7wgbasj0h1627jknp7f'], + status: 'active', + timesUsed: 0, + type: 'flat', + updatedAt: '2023-06-05T09:18:46.63Z', + usageLimit: null, + }, + eventId: 'evt_01hdnnd4x84s4r5br068y3rm6d', + eventType: 'discount.imported', + notificationId: 'ntf_01hdnnd505rcs80ss56rfn7qa2', + occurredAt: '2023-10-26T09:35:17.929027Z', +}; diff --git a/src/__tests__/mocks/notifications/discount-updated.mock.ts b/src/__tests__/mocks/notifications/discount-updated.mock.ts new file mode 100644 index 0000000..080867f --- /dev/null +++ b/src/__tests__/mocks/notifications/discount-updated.mock.ts @@ -0,0 +1,64 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IDiscountResponse } from '../../../types'; + +export const DiscountUpdatedMock: IEventsResponse = { + event_id: 'evt_01h90nmenze2c4yv1sfnx5ye17', + event_type: 'discount.updated', + occurred_at: '2023-08-29T12:52:26.944045Z', + notification_id: 'ntf_01h90nmerv7vrn93f97j5v72p7', + data: { + id: 'dsc_01h8441jn5pcwrfhwh78jqt8hk', + status: 'active', + description: 'New customer discount', + enabled_for_checkout: true, + code: 'WELCOME', + type: 'flat', + amount: '5000', + currency_code: 'USD', + recur: false, + maximum_recurring_intervals: null, + usage_limit: 100, + times_used: 0, + restrict_to: ['pro_01h90yj132e28vzwsrdc83927j'], + custom_data: null, + import_meta: { external_id: 'fc1ba9bc-8ddb-11ee-b9d1-0242ac120002', imported_from: 'billing_platform' }, + expires_at: '2024-08-15T00:00:00.000Z', + created_at: '2023-08-18T10:46:18.792Z', + updated_at: '2023-08-29T12:52:26.944Z', + }, +}; + +export const DiscountUpdatedMockExpectation = { + data: { + amount: '5000', + code: 'WELCOME', + createdAt: '2023-08-18T10:46:18.792Z', + currencyCode: 'USD', + customData: null, + description: 'New customer discount', + enabledForCheckout: true, + expiresAt: '2024-08-15T00:00:00.000Z', + id: 'dsc_01h8441jn5pcwrfhwh78jqt8hk', + importMeta: { + externalId: 'fc1ba9bc-8ddb-11ee-b9d1-0242ac120002', + importedFrom: 'billing_platform', + }, + maximumRecurringIntervals: null, + recur: false, + restrictTo: ['pro_01h90yj132e28vzwsrdc83927j'], + status: 'active', + timesUsed: 0, + type: 'flat', + updatedAt: '2023-08-29T12:52:26.944Z', + usageLimit: 100, + }, + eventId: 'evt_01h90nmenze2c4yv1sfnx5ye17', + eventType: 'discount.updated', + notificationId: 'ntf_01h90nmerv7vrn93f97j5v72p7', + occurredAt: '2023-08-29T12:52:26.944045Z', +}; diff --git a/src/__tests__/mocks/notifications/payout-created.mock.ts b/src/__tests__/mocks/notifications/payout-created.mock.ts new file mode 100644 index 0000000..620687c --- /dev/null +++ b/src/__tests__/mocks/notifications/payout-created.mock.ts @@ -0,0 +1,28 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IPayoutResponse } from '../../../types'; + +export const PayoutCreatedMock: IEventsResponse = { + event_id: 'evt_01h2b06f69w9aw3eymqs1dfa2q', + event_type: 'payout.created', + occurred_at: '2023-06-01T13:30:38.138984Z', + notification_id: 'ntf_01h2b06f84qsjzdw8rywe3j4gt', + data: { id: 'pay_01gsz4vmqbjk3x4vvtafffd540', status: 'unpaid', amount: '10000', currency_code: 'USD' }, +}; + +export const PayoutCreatedMockExpectation = { + data: { + amount: '10000', + currencyCode: 'USD', + id: 'pay_01gsz4vmqbjk3x4vvtafffd540', + status: 'unpaid', + }, + eventId: 'evt_01h2b06f69w9aw3eymqs1dfa2q', + eventType: 'payout.created', + notificationId: 'ntf_01h2b06f84qsjzdw8rywe3j4gt', + occurredAt: '2023-06-01T13:30:38.138984Z', +}; diff --git a/src/__tests__/mocks/notifications/payout-paid.mock.ts b/src/__tests__/mocks/notifications/payout-paid.mock.ts new file mode 100644 index 0000000..1803e57 --- /dev/null +++ b/src/__tests__/mocks/notifications/payout-paid.mock.ts @@ -0,0 +1,28 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IPayoutResponse } from '../../../types'; + +export const PayoutPaidMock: IEventsResponse = { + event_id: 'evt_01h2b0tqg1xkgnkfmprsnrjn0s', + event_type: 'payout.paid', + occurred_at: '2023-06-07T13:30:38.138984Z', + notification_id: 'ntf_01h2b0tqkhfqd094y9pys30xyw', + data: { id: 'pay_01gsz4vmqbjk3x4vvtafffd540', status: 'paid', amount: '10000', currency_code: 'USD' }, +}; + +export const PayoutPaidMockExpectation = { + data: { + amount: '10000', + currencyCode: 'USD', + id: 'pay_01gsz4vmqbjk3x4vvtafffd540', + status: 'paid', + }, + eventId: 'evt_01h2b0tqg1xkgnkfmprsnrjn0s', + eventType: 'payout.paid', + notificationId: 'ntf_01h2b0tqkhfqd094y9pys30xyw', + occurredAt: '2023-06-07T13:30:38.138984Z', +}; diff --git a/src/__tests__/mocks/notifications/price-created.mock.ts b/src/__tests__/mocks/notifications/price-created.mock.ts new file mode 100644 index 0000000..cc1d970 --- /dev/null +++ b/src/__tests__/mocks/notifications/price-created.mock.ts @@ -0,0 +1,65 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IPriceResponse } from '../../../types'; + +export const PriceCreatedMock: IEventsResponse = { + event_id: 'evt_01h7zd9n8vch227m3dgwqcvf6t', + event_type: 'price.created', + occurred_at: '2023-08-16T14:51:48.380054Z', + notification_id: 'ntf_01h7zd9nb2j92yhbfys5zam0gq', + data: { + id: 'pri_01h7zd9mzfq79850w4ryc39v38', + status: 'active', + type: 'standard', + quantity: { maximum: 999, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01h7zcgmdc6tmwtjehp3sh7azf', + unit_price: { amount: '500', currency_code: 'USD' }, + custom_data: null, + description: 'Monthly (per seat)', + name: 'Monthly (per seat)', + trial_period: { interval: 'day', frequency: 3 }, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [], + import_meta: null, + }, +}; + +export const PriceCreatedMockExpectation = { + data: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (per seat)', + id: 'pri_01h7zd9mzfq79850w4ryc39v38', + importMeta: null, + name: 'Monthly (per seat)', + productId: 'pro_01h7zcgmdc6tmwtjehp3sh7azf', + quantity: { + maximum: 999, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: { + frequency: 3, + interval: 'day', + }, + type: 'standard', + unitPrice: { + amount: '500', + currencyCode: 'USD', + }, + unitPriceOverrides: [], + }, + eventId: 'evt_01h7zd9n8vch227m3dgwqcvf6t', + eventType: 'price.created', + notificationId: 'ntf_01h7zd9nb2j92yhbfys5zam0gq', + occurredAt: '2023-08-16T14:51:48.380054Z', +}; diff --git a/src/__tests__/mocks/notifications/price-imported.mock.ts b/src/__tests__/mocks/notifications/price-imported.mock.ts new file mode 100644 index 0000000..e66eced --- /dev/null +++ b/src/__tests__/mocks/notifications/price-imported.mock.ts @@ -0,0 +1,65 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IPriceResponse } from '../../../types'; + +export const PriceImportedMock: IEventsResponse = { + event_id: 'evt_01hgarz844zdfws6djn9rz6qm7', + event_type: 'price.imported', + occurred_at: '2023-11-28T10:53:03.492854Z', + notification_id: 'ntf_01hd46rrqkrbndwzrarcew6t21', + data: { + id: 'pri_01h1vjg3sqjj1y9tvazkdqe5vt', + status: 'active', + type: 'standard', + description: 'Annual (recurring addon)', + name: 'Annual (recurring addon)', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + billing_cycle: { interval: 'year', frequency: 1 }, + trial_period: null, + tax_mode: 'account_setting', + unit_price: { amount: '100000', currency_code: 'USD' }, + unit_price_overrides: [], + quantity: { maximum: 1, minimum: 1 }, + custom_data: null, + import_meta: { external_id: 'fc1ba9bc-8ddb-11ee-b9d1-0242ac120002', imported_from: 'billing_platform' }, + }, +}; + +export const PriceImportedMockExpectation = { + data: { + billingCycle: { + frequency: 1, + interval: 'year', + }, + customData: null, + description: 'Annual (recurring addon)', + id: 'pri_01h1vjg3sqjj1y9tvazkdqe5vt', + importMeta: { + externalId: 'fc1ba9bc-8ddb-11ee-b9d1-0242ac120002', + importedFrom: 'billing_platform', + }, + name: 'Annual (recurring addon)', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '100000', + currencyCode: 'USD', + }, + unitPriceOverrides: [], + }, + eventId: 'evt_01hgarz844zdfws6djn9rz6qm7', + eventType: 'price.imported', + notificationId: 'ntf_01hd46rrqkrbndwzrarcew6t21', + occurredAt: '2023-11-28T10:53:03.492854Z', +}; diff --git a/src/__tests__/mocks/notifications/price-updated.mock.ts b/src/__tests__/mocks/notifications/price-updated.mock.ts new file mode 100644 index 0000000..b6300b1 --- /dev/null +++ b/src/__tests__/mocks/notifications/price-updated.mock.ts @@ -0,0 +1,65 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IPriceResponse } from '../../../types'; + +export const PriceUpdatedMock: IEventsResponse = { + event_id: 'evt_01h83wg1aqxmf897qqb47tre5s', + event_type: 'price.updated', + occurred_at: '2023-08-18T08:34:23.703674Z', + notification_id: 'ntf_01h83wg1d7rhxjk2m811bk9ky8', + data: { + id: 'pri_01h7zdqstxe6djaefkqbkjy4k2', + status: 'active', + type: 'standard', + quantity: { maximum: 999, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01h7zcgmdc6tmwtjehp3sh7azf', + unit_price: { amount: '5000', currency_code: 'USD' }, + custom_data: null, + description: 'Annual (per seat)', + name: 'Annual (per seat)', + trial_period: { interval: 'day', frequency: 30 }, + billing_cycle: { interval: 'year', frequency: 1 }, + unit_price_overrides: [], + import_meta: null, + }, +}; + +export const PriceUpdatedMockExpectation = { + data: { + billingCycle: { + frequency: 1, + interval: 'year', + }, + customData: null, + description: 'Annual (per seat)', + id: 'pri_01h7zdqstxe6djaefkqbkjy4k2', + importMeta: null, + name: 'Annual (per seat)', + productId: 'pro_01h7zcgmdc6tmwtjehp3sh7azf', + quantity: { + maximum: 999, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: { + frequency: 30, + interval: 'day', + }, + type: 'standard', + unitPrice: { + amount: '5000', + currencyCode: 'USD', + }, + unitPriceOverrides: [], + }, + eventId: 'evt_01h83wg1aqxmf897qqb47tre5s', + eventType: 'price.updated', + notificationId: 'ntf_01h83wg1d7rhxjk2m811bk9ky8', + occurredAt: '2023-08-18T08:34:23.703674Z', +}; diff --git a/src/__tests__/mocks/notifications/product-created.mock.ts b/src/__tests__/mocks/notifications/product-created.mock.ts new file mode 100644 index 0000000..e7afe17 --- /dev/null +++ b/src/__tests__/mocks/notifications/product-created.mock.ts @@ -0,0 +1,53 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IProductResponse } from '../../../types'; + +export const ProductCreatedMock: IEventsResponse = { + event_id: 'evt_01h7zcgmnv3ee9cqrj9fpww3mg', + event_type: 'product.created', + occurred_at: '2023-08-16T14:38:08.571366Z', + notification_id: 'ntf_01h7zcgmqvxgv1a7vhm399vdm2', + data: { + id: 'pro_01h7zcgmdc6tmwtjehp3sh7azf', + name: 'ChatApp Education', + status: 'active', + type: 'standard', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + created_at: '2023-08-16T14:38:08.3Z', + custom_data: { features: { crm: false, reports: true, data_retention: true } }, + description: + 'Spend more time engaging with students with ChataApp Education. Includes features from our Pro plan, plus tools to help educators track student progress.', + tax_category: 'standard', + import_meta: null, + }, +}; + +export const ProductCreatedMockExpectation = { + data: { + createdAt: '2023-08-16T14:38:08.3Z', + customData: { + features: { + crm: false, + data_retention: true, + reports: true, + }, + }, + description: + 'Spend more time engaging with students with ChataApp Education. Includes features from our Pro plan, plus tools to help educators track student progress.', + id: 'pro_01h7zcgmdc6tmwtjehp3sh7azf', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + importMeta: null, + name: 'ChatApp Education', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + eventId: 'evt_01h7zcgmnv3ee9cqrj9fpww3mg', + eventType: 'product.created', + notificationId: 'ntf_01h7zcgmqvxgv1a7vhm399vdm2', + occurredAt: '2023-08-16T14:38:08.571366Z', +}; diff --git a/src/__tests__/mocks/notifications/product-imported.mock.ts b/src/__tests__/mocks/notifications/product-imported.mock.ts new file mode 100644 index 0000000..bb665c4 --- /dev/null +++ b/src/__tests__/mocks/notifications/product-imported.mock.ts @@ -0,0 +1,50 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IProductResponse } from '../../../types'; + +export const ProductImportedMock: IEventsResponse = { + event_id: 'evt_01hgas2cm8r02nxryp83jqvg6k', + event_type: 'product.imported', + occurred_at: '2023-11-28T10:54:46.408439Z', + notification_id: 'ntf_01hd46rqryfc8d7d5yz595k2k6', + data: { + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + status: 'active', + type: 'standard', + name: 'Voice rooms addon', + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + tax_category: 'standard', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + custom_data: null, + created_at: '2023-06-01T13:30:50.302Z', + import_meta: { external_id: '16a2c842-8ddc-11ee-b9d1-0242ac120002', imported_from: 'billing_platform' }, + }, +}; + +export const ProductImportedMockExpectation = { + data: { + createdAt: '2023-06-01T13:30:50.302Z', + customData: null, + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + importMeta: { + externalId: '16a2c842-8ddc-11ee-b9d1-0242ac120002', + importedFrom: 'billing_platform', + }, + name: 'Voice rooms addon', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + eventId: 'evt_01hgas2cm8r02nxryp83jqvg6k', + eventType: 'product.imported', + notificationId: 'ntf_01hd46rqryfc8d7d5yz595k2k6', + occurredAt: '2023-11-28T10:54:46.408439Z', +}; diff --git a/src/__tests__/mocks/notifications/product-updated.mock.ts b/src/__tests__/mocks/notifications/product-updated.mock.ts new file mode 100644 index 0000000..24bf77b --- /dev/null +++ b/src/__tests__/mocks/notifications/product-updated.mock.ts @@ -0,0 +1,53 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IProductResponse } from '../../../types'; + +export const ProductUpdatedMock: IEventsResponse = { + event_id: 'evt_01h7zcr13xte50ncas1jkgpbfk', + event_type: 'product.updated', + occurred_at: '2023-08-16T14:42:10.685247Z', + notification_id: 'ntf_01h7zcr1683yvnvxf9mn8k7vcw', + data: { + id: 'pro_01h7zcgmdc6tmwtjehp3sh7azf', + name: 'ChatApp for Schools', + status: 'active', + type: 'standard', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + created_at: '2023-08-16T14:38:08.3Z', + custom_data: { features: { crm: false, reports: true, data_retention: true } }, + description: + 'Spend more time engaging with students with ChataApp Education. Includes features from our Pro plan, plus tools to help educators track student progress.', + tax_category: 'standard', + import_meta: null, + }, +}; + +export const ProductUpdatedMockExpectation = { + data: { + createdAt: '2023-08-16T14:38:08.3Z', + customData: { + features: { + crm: false, + data_retention: true, + reports: true, + }, + }, + description: + 'Spend more time engaging with students with ChataApp Education. Includes features from our Pro plan, plus tools to help educators track student progress.', + id: 'pro_01h7zcgmdc6tmwtjehp3sh7azf', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + importMeta: null, + name: 'ChatApp for Schools', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + eventId: 'evt_01h7zcr13xte50ncas1jkgpbfk', + eventType: 'product.updated', + notificationId: 'ntf_01h7zcr1683yvnvxf9mn8k7vcw', + occurredAt: '2023-08-16T14:42:10.685247Z', +}; diff --git a/src/__tests__/mocks/notifications/report-created.mock.ts b/src/__tests__/mocks/notifications/report-created.mock.ts new file mode 100644 index 0000000..dac4809 --- /dev/null +++ b/src/__tests__/mocks/notifications/report-created.mock.ts @@ -0,0 +1,59 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IReportResponse } from '../../../types'; + +export const ReportCreatedMock: IEventsResponse = { + event_id: 'evt_01hhq4c3nf0jrz7c46k4d8bc0x', + event_type: 'report.created', + occurred_at: '2023-12-15T16:18:54.255762Z', + notification_id: 'ntf_01h8441jz6fr97hv7zemswj8cw', + data: { + id: 'rep_01hhq4c3b03g3x2kpkj8aecjv6', + status: 'pending', + rows: null, + type: 'transactions', + filters: [ + { name: 'updated_at', value: '2023-12-15', operator: 'lt' }, + { name: 'updated_at', value: '2023-11-16', operator: 'gte' }, + { name: 'collection_mode', value: ['manual'], operator: null }, + ], + expires_at: null, + created_at: '2023-12-15T16:18:53.92Z', + }, +}; + +export const ReportCreatedMockExpectation = { + data: { + createdAt: '2023-12-15T16:18:53.92Z', + expiresAt: null, + filters: [ + { + name: 'updated_at', + operator: 'lt', + value: '2023-12-15', + }, + { + name: 'updated_at', + operator: 'gte', + value: '2023-11-16', + }, + { + name: 'collection_mode', + operator: null, + value: ['manual'], + }, + ], + id: 'rep_01hhq4c3b03g3x2kpkj8aecjv6', + rows: null, + status: 'pending', + type: 'transactions', + }, + eventId: 'evt_01hhq4c3nf0jrz7c46k4d8bc0x', + eventType: 'report.created', + notificationId: 'ntf_01h8441jz6fr97hv7zemswj8cw', + occurredAt: '2023-12-15T16:18:54.255762Z', +}; diff --git a/src/__tests__/mocks/notifications/report-updated.mock.ts b/src/__tests__/mocks/notifications/report-updated.mock.ts new file mode 100644 index 0000000..aee0640 --- /dev/null +++ b/src/__tests__/mocks/notifications/report-updated.mock.ts @@ -0,0 +1,59 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type IReportResponse } from '../../../types'; + +export const ReportUpdatedMock: IEventsResponse = { + event_id: 'evt_01hhq4ck8bcaw47kyy3bk2vs8v', + event_type: 'report.updated', + occurred_at: '2023-12-15T16:19:10.219138Z', + notification_id: 'nft_01hhjebfbgnrnyegsmcchyscxd', + data: { + id: 'rep_01hhq4c3b03g3x2kpkj8aecjv6', + status: 'ready', + rows: 10, + type: 'transactions', + filters: [ + { name: 'updated_at', value: '2023-12-15', operator: 'lt' }, + { name: 'updated_at', value: '2023-11-16', operator: 'gte' }, + { name: 'collection_mode', value: ['manual'], operator: null }, + ], + expires_at: '2023-12-29T16:19:09.214771Z', + created_at: '2023-12-15T16:18:53.92Z', + }, +}; + +export const ReportUpdatedMockExpectation = { + data: { + createdAt: '2023-12-15T16:18:53.92Z', + expiresAt: '2023-12-29T16:19:09.214771Z', + filters: [ + { + name: 'updated_at', + operator: 'lt', + value: '2023-12-15', + }, + { + name: 'updated_at', + operator: 'gte', + value: '2023-11-16', + }, + { + name: 'collection_mode', + operator: null, + value: ['manual'], + }, + ], + id: 'rep_01hhq4c3b03g3x2kpkj8aecjv6', + rows: 10, + status: 'ready', + type: 'transactions', + }, + eventId: 'evt_01hhq4ck8bcaw47kyy3bk2vs8v', + eventType: 'report.updated', + notificationId: 'nft_01hhjebfbgnrnyegsmcchyscxd', + occurredAt: '2023-12-15T16:19:10.219138Z', +}; diff --git a/src/__tests__/mocks/notifications/subscription-activated.mock.ts b/src/__tests__/mocks/notifications/subscription-activated.mock.ts new file mode 100644 index 0000000..444ef2c --- /dev/null +++ b/src/__tests__/mocks/notifications/subscription-activated.mock.ts @@ -0,0 +1,165 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export const SubscriptionActivatedMock: IEventsResponse = { + event_id: 'evt_01h7ht60mmw6d4sf4h38g3t4yq', + event_type: 'subscription.activated', + occurred_at: '2023-08-11T08:07:38.388239Z', + notification_id: 'ntf_01h7ht60qc1tcdk0hfms98bmhp', + data: { + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3240', currency_code: 'USD' }, + description: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 10, + recurring: true, + created_at: '2023-08-11T08:07:36.892823Z', + updated_at: '2023-08-11T08:07:36.892823Z', + trial_dates: null, + next_billed_at: '2023-09-11T08:07:35.449123Z', + previously_billed_at: '2023-08-11T08:07:35.449123Z', + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10800', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 1, + recurring: true, + created_at: '2023-08-11T08:07:36.892827Z', + updated_at: '2023-08-11T08:07:36.892827Z', + trial_dates: null, + next_billed_at: '2023-09-11T08:07:35.449123Z', + previously_billed_at: '2023-08-11T08:07:35.449123Z', + }, + ], + status: 'active', + paused_at: null, + address_id: 'add_01h7hswbfjqez51ezfhk7s6400', + created_at: '2023-08-11T08:07:36.892822Z', + started_at: '2023-08-11T08:07:35.449123Z', + updated_at: '2023-08-11T08:07:36.892822Z', + business_id: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceled_at: null, + discount: null, + custom_data: null, + customer_id: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + billing_cycle: { interval: 'month', frequency: 1 }, + currency_code: 'USD', + next_billed_at: '2023-09-11T08:07:35.449123Z', + billing_details: null, + collection_mode: 'automatic', + first_billed_at: '2023-08-11T08:07:35.449123Z', + scheduled_change: null, + current_billing_period: { ends_at: '2023-09-11T08:07:35.449123Z', starts_at: '2023-08-11T08:07:35.449123Z' }, + }, +}; + +export const SubscriptionActivatedMockExpectation = { + data: { + addressId: 'add_01h7hswbfjqez51ezfhk7s6400', + billingCycle: { + frequency: 1, + interval: 'month', + }, + billingDetails: null, + businessId: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceledAt: null, + collectionMode: 'automatic', + createdAt: '2023-08-11T08:07:36.892822Z', + currencyCode: 'USD', + currentBillingPeriod: { + endsAt: '2023-09-11T08:07:35.449123Z', + startsAt: '2023-08-11T08:07:35.449123Z', + }, + customData: null, + customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + discount: null, + firstBilledAt: '2023-08-11T08:07:35.449123Z', + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + items: [ + { + createdAt: '2023-08-11T08:07:36.892823Z', + nextBilledAt: '2023-09-11T08:07:35.449123Z', + previouslyBilledAt: '2023-08-11T08:07:35.449123Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '3240', + currencyCode: 'USD', + }, + }, + quantity: 10, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-08-11T08:07:36.892823Z', + }, + { + createdAt: '2023-08-11T08:07:36.892827Z', + nextBilledAt: '2023-09-11T08:07:35.449123Z', + previouslyBilledAt: '2023-08-11T08:07:35.449123Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '10800', + currencyCode: 'USD', + }, + }, + quantity: 1, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-08-11T08:07:36.892827Z', + }, + ], + nextBilledAt: '2023-09-11T08:07:35.449123Z', + pausedAt: null, + scheduledChange: null, + startedAt: '2023-08-11T08:07:35.449123Z', + status: 'active', + transactionId: 'txn_01h8bxpvx398a7zbawb77y0kp5', + updatedAt: '2023-08-11T08:07:36.892822Z', + }, + eventId: 'evt_01h7ht60mmw6d4sf4h38g3t4yq', + eventType: 'subscription.activated', + notificationId: 'ntf_01h7ht60qc1tcdk0hfms98bmhp', + occurredAt: '2023-08-11T08:07:38.388239Z', +}; diff --git a/src/__tests__/mocks/notifications/subscription-canceled.mock.ts b/src/__tests__/mocks/notifications/subscription-canceled.mock.ts new file mode 100644 index 0000000..9b9068a --- /dev/null +++ b/src/__tests__/mocks/notifications/subscription-canceled.mock.ts @@ -0,0 +1,205 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export const SubscriptionCanceledMock: IEventsResponse = { + event_id: 'evt_01h7jk37p1ezj1k5b4kt83t35j', + event_type: 'subscription.canceled', + occurred_at: '2023-08-11T15:23:01.697145Z', + notification_id: 'ntf_01h7jk37xbxzq9f7fdery7eab5', + data: { + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3240', currency_code: 'USD' }, + description: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 10, + recurring: true, + created_at: '2023-08-11T08:07:36.892823Z', + updated_at: '2024-01-11T08:34:01.799627882Z', + next_billed_at: null, + previously_billed_at: '2023-12-11T08:33:04.443903Z', + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10800', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 1, + recurring: true, + created_at: '2023-08-11T08:07:36.892827Z', + updated_at: '2024-01-11T08:34:01.80092405Z', + trial_dates: null, + next_billed_at: null, + previously_billed_at: '2023-12-11T08:33:04.443903Z', + }, + { + price: { + id: 'pri_01gsz95g2zrkagg294kpstx54r', + tax_mode: 'account_setting', + product_id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + unit_price: { amount: '30000', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 1, + recurring: true, + created_at: '2023-11-11T08:50:20.669523Z', + updated_at: '2024-01-11T08:34:01.803004169Z', + trial_dates: null, + next_billed_at: null, + previously_billed_at: '2023-12-11T08:33:04.443903Z', + }, + ], + status: 'canceled', + paused_at: null, + address_id: 'add_01h7hswbfjqez51ezfhk7s6400', + created_at: '2023-08-11T08:07:36.892822Z', + started_at: '2023-08-11T08:07:35.449123Z', + updated_at: '2024-01-11T08:34:01.798065409Z', + business_id: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceled_at: '2024-01-11T08:34:01.787929969Z', + discount: null, + custom_data: null, + customer_id: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + billing_cycle: { interval: 'month', frequency: 1 }, + currency_code: 'USD', + next_billed_at: null, + billing_details: null, + collection_mode: 'automatic', + first_billed_at: '2023-08-11T08:07:35.449123Z', + scheduled_change: null, + current_billing_period: null, + }, +}; + +export const SubscriptionCanceledMockExpectation = { + data: { + addressId: 'add_01h7hswbfjqez51ezfhk7s6400', + billingCycle: { + frequency: 1, + interval: 'month', + }, + billingDetails: null, + businessId: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceledAt: '2024-01-11T08:34:01.787929969Z', + collectionMode: 'automatic', + createdAt: '2023-08-11T08:07:36.892822Z', + currencyCode: 'USD', + currentBillingPeriod: null, + customData: null, + customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + discount: null, + firstBilledAt: '2023-08-11T08:07:35.449123Z', + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + items: [ + { + createdAt: '2023-08-11T08:07:36.892823Z', + nextBilledAt: null, + previouslyBilledAt: '2023-12-11T08:33:04.443903Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '3240', + currencyCode: 'USD', + }, + }, + quantity: 10, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2024-01-11T08:34:01.799627882Z', + }, + { + createdAt: '2023-08-11T08:07:36.892827Z', + nextBilledAt: null, + previouslyBilledAt: '2023-12-11T08:33:04.443903Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '10800', + currencyCode: 'USD', + }, + }, + quantity: 1, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2024-01-11T08:34:01.80092405Z', + }, + { + createdAt: '2023-11-11T08:50:20.669523Z', + nextBilledAt: null, + previouslyBilledAt: '2023-12-11T08:33:04.443903Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (recurring addon)', + id: 'pri_01gsz95g2zrkagg294kpstx54r', + productId: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '30000', + currencyCode: 'USD', + }, + }, + quantity: 1, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2024-01-11T08:34:01.803004169Z', + }, + ], + nextBilledAt: null, + pausedAt: null, + scheduledChange: null, + startedAt: '2023-08-11T08:07:35.449123Z', + status: 'canceled', + transactionId: 'txn_01h8bxpvx398a7zbawb77y0kp5', + updatedAt: '2024-01-11T08:34:01.798065409Z', + }, + eventId: 'evt_01h7jk37p1ezj1k5b4kt83t35j', + eventType: 'subscription.canceled', + notificationId: 'ntf_01h7jk37xbxzq9f7fdery7eab5', + occurredAt: '2023-08-11T15:23:01.697145Z', +}; diff --git a/src/__tests__/mocks/notifications/subscription-created.mock.ts b/src/__tests__/mocks/notifications/subscription-created.mock.ts new file mode 100644 index 0000000..f3342fd --- /dev/null +++ b/src/__tests__/mocks/notifications/subscription-created.mock.ts @@ -0,0 +1,165 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export const SubscriptionCreatedMock: IEventsResponse = { + event_id: 'evt_01h7ht60jy5hpdv5x8tfsaxje4', + event_type: 'subscription.created', + occurred_at: '2023-08-11T08:07:38.334150Z', + notification_id: 'ntf_01h7ht60n4grsa2a5ddd54h1j0', + data: { + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3240', currency_code: 'USD' }, + description: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 10, + recurring: true, + created_at: '2023-08-11T08:07:36.892823Z', + updated_at: '2023-08-11T08:07:36.892823Z', + trial_dates: null, + next_billed_at: '2023-09-11T08:07:35.449123Z', + previously_billed_at: '2023-08-11T08:07:35.449123Z', + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10800', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 1, + recurring: true, + created_at: '2023-08-11T08:07:36.892827Z', + updated_at: '2023-08-11T08:07:36.892827Z', + trial_dates: null, + next_billed_at: '2023-09-11T08:07:35.449123Z', + previously_billed_at: '2023-08-11T08:07:35.449123Z', + }, + ], + status: 'active', + paused_at: null, + address_id: 'add_01h7hswbfjqez51ezfhk7s6400', + created_at: '2023-08-11T08:07:36.892822Z', + started_at: '2023-08-11T08:07:35.449123Z', + updated_at: '2023-08-11T08:07:36.892822Z', + business_id: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceled_at: null, + discount: null, + custom_data: null, + customer_id: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + billing_cycle: { interval: 'month', frequency: 1 }, + currency_code: 'USD', + next_billed_at: '2023-09-11T08:07:35.449123Z', + transaction_id: 'txn_01h7hst69d7tar4rm6vyeb0j36', + billing_details: null, + collection_mode: 'automatic', + first_billed_at: '2023-08-11T08:07:35.449123Z', + scheduled_change: null, + current_billing_period: { ends_at: '2023-09-11T08:07:35.449123Z', starts_at: '2023-08-11T08:07:35.449123Z' }, + }, +}; + +export const SubscriptionCreatedMockExpectation = { + data: { + addressId: 'add_01h7hswbfjqez51ezfhk7s6400', + billingCycle: { + frequency: 1, + interval: 'month', + }, + billingDetails: null, + businessId: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceledAt: null, + collectionMode: 'automatic', + createdAt: '2023-08-11T08:07:36.892822Z', + currencyCode: 'USD', + currentBillingPeriod: { + endsAt: '2023-09-11T08:07:35.449123Z', + startsAt: '2023-08-11T08:07:35.449123Z', + }, + customData: null, + customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + discount: null, + firstBilledAt: '2023-08-11T08:07:35.449123Z', + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + items: [ + { + createdAt: '2023-08-11T08:07:36.892823Z', + nextBilledAt: '2023-09-11T08:07:35.449123Z', + previouslyBilledAt: '2023-08-11T08:07:35.449123Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '3240', + currencyCode: 'USD', + }, + }, + quantity: 10, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-08-11T08:07:36.892823Z', + }, + { + createdAt: '2023-08-11T08:07:36.892827Z', + nextBilledAt: '2023-09-11T08:07:35.449123Z', + previouslyBilledAt: '2023-08-11T08:07:35.449123Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '10800', + currencyCode: 'USD', + }, + }, + quantity: 1, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-08-11T08:07:36.892827Z', + }, + ], + nextBilledAt: '2023-09-11T08:07:35.449123Z', + pausedAt: null, + scheduledChange: null, + startedAt: '2023-08-11T08:07:35.449123Z', + status: 'active', + transactionId: 'txn_01h7hst69d7tar4rm6vyeb0j36', + updatedAt: '2023-08-11T08:07:36.892822Z', + }, + eventId: 'evt_01h7ht60jy5hpdv5x8tfsaxje4', + eventType: 'subscription.created', + notificationId: 'ntf_01h7ht60n4grsa2a5ddd54h1j0', + occurredAt: '2023-08-11T08:07:38.334150Z', +}; diff --git a/src/__tests__/mocks/notifications/subscription-imported.mock.ts b/src/__tests__/mocks/notifications/subscription-imported.mock.ts new file mode 100644 index 0000000..30eee48 --- /dev/null +++ b/src/__tests__/mocks/notifications/subscription-imported.mock.ts @@ -0,0 +1,202 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export const SubscriptionImportedMock: IEventsResponse = { + event_id: 'evt_01gxwxwnghn8xa7amfwqb0992q', + event_type: 'subscription.imported', + occurred_at: '2023-04-13T09:07:06.642209Z', + notification_id: 'ntf_01gxwxwnjq16bhp2pz9p78cbk1', + data: { + id: 'sub_01gxwxwn84xqf0690d7qn5r2g7', + transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3600', currency_code: 'GBP' }, + description: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 10, + recurring: true, + created_at: '2023-04-13T09:07:06.628578Z', + updated_at: '2023-04-13T09:07:06.628578Z', + next_billed_at: '2023-05-13T09:07:04.730931Z', + previously_billed_at: '2023-04-13T09:07:04.730931Z', + }, + { + price: { + id: 'pri_01gsz95g2zrkagg294kpstx54r', + tax_mode: 'account_setting', + product_id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + unit_price: { amount: '30000', currency_code: 'GBP' }, + description: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 1, + recurring: true, + created_at: '2023-04-13T09:07:06.628581Z', + updated_at: '2023-04-13T09:07:06.628581Z', + next_billed_at: '2023-05-13T09:07:04.730931Z', + previously_billed_at: '2023-04-13T09:07:04.730931Z', + }, + { + price: { + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + tax_mode: 'account_setting', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { amount: '23880', currency_code: 'GBP' }, + description: 'One-time charge', + trial_period: null, + billing_cycle: null, + }, + status: 'active', + quantity: 1, + recurring: false, + created_at: '2023-04-13T09:07:06.628582Z', + updated_at: '2023-04-13T09:07:06.628582Z', + next_billed_at: null, + previously_billed_at: '2023-04-13T09:07:04.730931Z', + }, + ], + status: 'active', + paused_at: null, + address_id: 'add_01gxwxqjh878r4mj3b1ex6xkxt', + created_at: '2023-04-13T09:07:06.628577Z', + started_at: '2023-04-13T09:07:04.730931Z', + updated_at: '2023-04-13T09:07:06.628577Z', + business_id: 'biz_01gxwxqjjwmdyd03q13aht3x1h', + canceled_at: null, + custom_data: null, + customer_id: 'ctm_01gxwxe6vzgz6hcsbwjs6zrszr', + billing_cycle: { interval: 'month', frequency: 1 }, + currency_code: 'GBP', + next_billed_at: '2023-05-13T09:07:04.730931Z', + billing_details: null, + collection_mode: 'automatic', + first_billed_at: '2023-04-13T09:07:04.730931Z', + scheduled_change: null, + current_billing_period: { ends_at: '2023-05-13T09:07:04.730931Z', starts_at: '2023-04-13T09:07:04.730931Z' }, + }, +}; + +export const SubscriptionImportedMockExpectation = { + data: { + addressId: 'add_01gxwxqjh878r4mj3b1ex6xkxt', + billingCycle: { + frequency: 1, + interval: 'month', + }, + billingDetails: null, + businessId: 'biz_01gxwxqjjwmdyd03q13aht3x1h', + canceledAt: null, + collectionMode: 'automatic', + createdAt: '2023-04-13T09:07:06.628577Z', + currencyCode: 'GBP', + currentBillingPeriod: { + endsAt: '2023-05-13T09:07:04.730931Z', + startsAt: '2023-04-13T09:07:04.730931Z', + }, + customData: null, + customerId: 'ctm_01gxwxe6vzgz6hcsbwjs6zrszr', + discount: null, + firstBilledAt: '2023-04-13T09:07:04.730931Z', + id: 'sub_01gxwxwn84xqf0690d7qn5r2g7', + items: [ + { + createdAt: '2023-04-13T09:07:06.628578Z', + nextBilledAt: '2023-05-13T09:07:04.730931Z', + previouslyBilledAt: '2023-04-13T09:07:04.730931Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '3600', + currencyCode: 'GBP', + }, + }, + quantity: 10, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-04-13T09:07:06.628578Z', + }, + { + createdAt: '2023-04-13T09:07:06.628581Z', + nextBilledAt: '2023-05-13T09:07:04.730931Z', + previouslyBilledAt: '2023-04-13T09:07:04.730931Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (recurring addon)', + id: 'pri_01gsz95g2zrkagg294kpstx54r', + productId: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '30000', + currencyCode: 'GBP', + }, + }, + quantity: 1, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-04-13T09:07:06.628581Z', + }, + { + createdAt: '2023-04-13T09:07:06.628582Z', + nextBilledAt: null, + previouslyBilledAt: '2023-04-13T09:07:04.730931Z', + price: { + billingCycle: null, + description: 'One-time charge', + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + productId: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '23880', + currencyCode: 'GBP', + }, + }, + quantity: 1, + recurring: false, + status: 'active', + trialDates: null, + updatedAt: '2023-04-13T09:07:06.628582Z', + }, + ], + nextBilledAt: '2023-05-13T09:07:04.730931Z', + pausedAt: null, + scheduledChange: null, + startedAt: '2023-04-13T09:07:04.730931Z', + status: 'active', + transactionId: 'txn_01h8bxpvx398a7zbawb77y0kp5', + updatedAt: '2023-04-13T09:07:06.628577Z', + }, + eventId: 'evt_01gxwxwnghn8xa7amfwqb0992q', + eventType: 'subscription.imported', + notificationId: 'ntf_01gxwxwnjq16bhp2pz9p78cbk1', + occurredAt: '2023-04-13T09:07:06.642209Z', +}; diff --git a/src/__tests__/mocks/notifications/subscription-past-due.mock.ts b/src/__tests__/mocks/notifications/subscription-past-due.mock.ts new file mode 100644 index 0000000..de3c770 --- /dev/null +++ b/src/__tests__/mocks/notifications/subscription-past-due.mock.ts @@ -0,0 +1,165 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export const SubscriptionPastDueMock: IEventsResponse = { + event_id: 'evt_01h7jagte1wnq80w5bw5gbmrwk', + event_type: 'subscription.past_due', + occurred_at: '2023-08-11T12:53:09.697239Z', + notification_id: 'ntf_01h7jagthb2kg1vqtf6rr8xspa', + data: { + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3240', currency_code: 'USD' }, + description: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 10, + recurring: true, + created_at: '2023-08-11T08:07:36.892823Z', + updated_at: '2023-10-11T08:08:04.930567Z', + trial_dates: null, + next_billed_at: '2023-11-11T08:07:35.449123Z', + previously_billed_at: '2023-10-11T08:07:35.449123Z', + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10800', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 1, + recurring: true, + created_at: '2023-08-11T08:07:36.892827Z', + updated_at: '2023-10-11T08:08:04.931695Z', + trial_dates: null, + next_billed_at: '2023-11-11T08:07:35.449123Z', + previously_billed_at: '2023-10-11T08:07:35.449123Z', + }, + ], + status: 'past_due', + paused_at: null, + address_id: 'add_01h7hswbfjqez51ezfhk7s6400', + created_at: '2023-08-11T08:07:36.892822Z', + started_at: '2023-08-11T08:07:35.449123Z', + updated_at: '2023-10-11T08:08:04.929417Z', + business_id: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceled_at: null, + discount: null, + custom_data: null, + customer_id: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + billing_cycle: { interval: 'month', frequency: 1 }, + currency_code: 'USD', + next_billed_at: '2023-11-11T08:07:35.449123Z', + billing_details: null, + collection_mode: 'automatic', + first_billed_at: '2023-08-11T08:07:35.449123Z', + scheduled_change: null, + current_billing_period: { ends_at: '2023-11-11T08:07:35.449123Z', starts_at: '2023-10-11T08:07:35.449123Z' }, + }, +}; + +export const SubscriptionPastDueMockExpectation = { + data: { + addressId: 'add_01h7hswbfjqez51ezfhk7s6400', + billingCycle: { + frequency: 1, + interval: 'month', + }, + billingDetails: null, + businessId: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceledAt: null, + collectionMode: 'automatic', + createdAt: '2023-08-11T08:07:36.892822Z', + currencyCode: 'USD', + currentBillingPeriod: { + endsAt: '2023-11-11T08:07:35.449123Z', + startsAt: '2023-10-11T08:07:35.449123Z', + }, + customData: null, + customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + discount: null, + firstBilledAt: '2023-08-11T08:07:35.449123Z', + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + items: [ + { + createdAt: '2023-08-11T08:07:36.892823Z', + nextBilledAt: '2023-11-11T08:07:35.449123Z', + previouslyBilledAt: '2023-10-11T08:07:35.449123Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '3240', + currencyCode: 'USD', + }, + }, + quantity: 10, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-10-11T08:08:04.930567Z', + }, + { + createdAt: '2023-08-11T08:07:36.892827Z', + nextBilledAt: '2023-11-11T08:07:35.449123Z', + previouslyBilledAt: '2023-10-11T08:07:35.449123Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '10800', + currencyCode: 'USD', + }, + }, + quantity: 1, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-10-11T08:08:04.931695Z', + }, + ], + nextBilledAt: '2023-11-11T08:07:35.449123Z', + pausedAt: null, + scheduledChange: null, + startedAt: '2023-08-11T08:07:35.449123Z', + status: 'past_due', + transactionId: 'txn_01h8bxpvx398a7zbawb77y0kp5', + updatedAt: '2023-10-11T08:08:04.929417Z', + }, + eventId: 'evt_01h7jagte1wnq80w5bw5gbmrwk', + eventType: 'subscription.past_due', + notificationId: 'ntf_01h7jagthb2kg1vqtf6rr8xspa', + occurredAt: '2023-08-11T12:53:09.697239Z', +}; diff --git a/src/__tests__/mocks/notifications/subscription-paused.mock.ts b/src/__tests__/mocks/notifications/subscription-paused.mock.ts new file mode 100644 index 0000000..11d1f27 --- /dev/null +++ b/src/__tests__/mocks/notifications/subscription-paused.mock.ts @@ -0,0 +1,162 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export const SubscriptionPausedMock: IEventsResponse = { + event_id: 'evt_01h7jcst3syp03dk5f0m8h204f', + event_type: 'subscription.paused', + occurred_at: '2023-08-11T13:33:01.433149Z', + notification_id: 'ntf_01h7jcst74a4417kz8eedqty0e', + data: { + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3240', currency_code: 'USD' }, + description: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'inactive', + quantity: 10, + recurring: true, + created_at: '2023-08-11T08:07:36.892823Z', + updated_at: '2023-11-11T08:08:19.865524296Z', + trial_dates: null, + next_billed_at: null, + previously_billed_at: '2023-10-11T08:07:35.449123Z', + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10800', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'inactive', + quantity: 1, + recurring: true, + created_at: '2023-08-11T08:07:36.892827Z', + updated_at: '2023-11-11T08:08:19.886606477Z', + trial_dates: null, + next_billed_at: null, + previously_billed_at: '2023-10-11T08:07:35.449123Z', + }, + ], + status: 'paused', + paused_at: '2023-11-11T08:08:19.833481556Z', + address_id: 'add_01h7hswbfjqez51ezfhk7s6400', + created_at: '2023-08-11T08:07:36.892822Z', + started_at: '2023-08-11T08:07:35.449123Z', + updated_at: '2023-11-11T08:08:19.863737035Z', + business_id: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceled_at: null, + discount: null, + custom_data: null, + customer_id: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + billing_cycle: { interval: 'month', frequency: 1 }, + currency_code: 'USD', + next_billed_at: null, + billing_details: null, + collection_mode: 'automatic', + first_billed_at: '2023-08-11T08:07:35.449123Z', + scheduled_change: null, + current_billing_period: null, + }, +}; + +export const SubscriptionPausedMockExpectation = { + data: { + addressId: 'add_01h7hswbfjqez51ezfhk7s6400', + billingCycle: { + frequency: 1, + interval: 'month', + }, + billingDetails: null, + businessId: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceledAt: null, + collectionMode: 'automatic', + createdAt: '2023-08-11T08:07:36.892822Z', + currencyCode: 'USD', + currentBillingPeriod: null, + customData: null, + customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + discount: null, + firstBilledAt: '2023-08-11T08:07:35.449123Z', + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + items: [ + { + createdAt: '2023-08-11T08:07:36.892823Z', + nextBilledAt: null, + previouslyBilledAt: '2023-10-11T08:07:35.449123Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '3240', + currencyCode: 'USD', + }, + }, + quantity: 10, + recurring: true, + status: 'inactive', + trialDates: null, + updatedAt: '2023-11-11T08:08:19.865524296Z', + }, + { + createdAt: '2023-08-11T08:07:36.892827Z', + nextBilledAt: null, + previouslyBilledAt: '2023-10-11T08:07:35.449123Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '10800', + currencyCode: 'USD', + }, + }, + quantity: 1, + recurring: true, + status: 'inactive', + trialDates: null, + updatedAt: '2023-11-11T08:08:19.886606477Z', + }, + ], + nextBilledAt: null, + pausedAt: '2023-11-11T08:08:19.833481556Z', + scheduledChange: null, + startedAt: '2023-08-11T08:07:35.449123Z', + status: 'paused', + transactionId: 'txn_01h8bxpvx398a7zbawb77y0kp5', + updatedAt: '2023-11-11T08:08:19.863737035Z', + }, + eventId: 'evt_01h7jcst3syp03dk5f0m8h204f', + eventType: 'subscription.paused', + notificationId: 'ntf_01h7jcst74a4417kz8eedqty0e', + occurredAt: '2023-08-11T13:33:01.433149Z', +}; diff --git a/src/__tests__/mocks/notifications/subscription-resumed.mock.ts b/src/__tests__/mocks/notifications/subscription-resumed.mock.ts new file mode 100644 index 0000000..af37f51 --- /dev/null +++ b/src/__tests__/mocks/notifications/subscription-resumed.mock.ts @@ -0,0 +1,165 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export const SubscriptionResumedMock: IEventsResponse = { + event_id: 'evt_01h7je74dkvjc4b2pt8sgsfm7f', + event_type: 'subscription.resumed', + occurred_at: '2023-08-11T13:57:46.547419Z', + notification_id: 'ntf_01h7je74gef2bx0d5e9qkzyvrb', + data: { + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3240', currency_code: 'USD' }, + description: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 10, + recurring: true, + created_at: '2023-08-11T08:07:36.892823Z', + updated_at: '2023-11-11T08:33:04.45451Z', + trial_dates: null, + next_billed_at: '2023-12-11T08:33:04.443903Z', + previously_billed_at: '2023-11-11T08:33:04.443903Z', + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10800', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 1, + recurring: true, + created_at: '2023-08-11T08:07:36.892827Z', + updated_at: '2023-11-11T08:33:04.45572Z', + trial_dates: null, + next_billed_at: '2023-12-11T08:33:04.443903Z', + previously_billed_at: '2023-11-11T08:33:04.443903Z', + }, + ], + status: 'active', + paused_at: null, + address_id: 'add_01h7hswbfjqez51ezfhk7s6400', + created_at: '2023-08-11T08:07:36.892822Z', + started_at: '2023-08-11T08:07:35.449123Z', + updated_at: '2023-11-11T08:33:04.453253Z', + business_id: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceled_at: null, + custom_data: null, + discount: null, + customer_id: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + billing_cycle: { interval: 'month', frequency: 1 }, + currency_code: 'USD', + next_billed_at: '2023-12-11T08:33:04.443903Z', + billing_details: null, + collection_mode: 'automatic', + first_billed_at: '2023-08-11T08:07:35.449123Z', + scheduled_change: null, + current_billing_period: { ends_at: '2023-12-11T08:33:04.443903Z', starts_at: '2023-11-11T08:33:04.443903Z' }, + }, +}; + +export const SubscriptionResumedMockExpectation = { + data: { + addressId: 'add_01h7hswbfjqez51ezfhk7s6400', + billingCycle: { + frequency: 1, + interval: 'month', + }, + billingDetails: null, + businessId: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceledAt: null, + collectionMode: 'automatic', + createdAt: '2023-08-11T08:07:36.892822Z', + currencyCode: 'USD', + currentBillingPeriod: { + endsAt: '2023-12-11T08:33:04.443903Z', + startsAt: '2023-11-11T08:33:04.443903Z', + }, + customData: null, + customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + discount: null, + firstBilledAt: '2023-08-11T08:07:35.449123Z', + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + items: [ + { + createdAt: '2023-08-11T08:07:36.892823Z', + nextBilledAt: '2023-12-11T08:33:04.443903Z', + previouslyBilledAt: '2023-11-11T08:33:04.443903Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '3240', + currencyCode: 'USD', + }, + }, + quantity: 10, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-11-11T08:33:04.45451Z', + }, + { + createdAt: '2023-08-11T08:07:36.892827Z', + nextBilledAt: '2023-12-11T08:33:04.443903Z', + previouslyBilledAt: '2023-11-11T08:33:04.443903Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '10800', + currencyCode: 'USD', + }, + }, + quantity: 1, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-11-11T08:33:04.45572Z', + }, + ], + nextBilledAt: '2023-12-11T08:33:04.443903Z', + pausedAt: null, + scheduledChange: null, + startedAt: '2023-08-11T08:07:35.449123Z', + status: 'active', + transactionId: 'txn_01h8bxpvx398a7zbawb77y0kp5', + updatedAt: '2023-11-11T08:33:04.453253Z', + }, + eventId: 'evt_01h7je74dkvjc4b2pt8sgsfm7f', + eventType: 'subscription.resumed', + notificationId: 'ntf_01h7je74gef2bx0d5e9qkzyvrb', + occurredAt: '2023-08-11T13:57:46.547419Z', +}; diff --git a/src/__tests__/mocks/notifications/subscription-trialing.mock.ts b/src/__tests__/mocks/notifications/subscription-trialing.mock.ts new file mode 100644 index 0000000..cea8a31 --- /dev/null +++ b/src/__tests__/mocks/notifications/subscription-trialing.mock.ts @@ -0,0 +1,127 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export const SubscriptionTrialingMock: IEventsResponse = { + event_id: 'evt_01h84cka4p40e737vm1ajb2bc5', + event_type: 'subscription.trialing', + occurred_at: '2023-08-18T13:15:48.246292Z', + notification_id: 'ntf_01h84cka91b65gy90qhe2tw2q6', + data: { + id: 'sub_01h84ck8sg4ebkpzqb9x2mtjjf', + transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5', + items: [ + { + price: { + id: 'pri_01h84cdy3xatsp16afda2gekzy', + tax_mode: 'account_setting', + product_id: 'pro_01h84cd36f900f3wmpdfamgv8w', + unit_price: { amount: '0', currency_code: 'USD' }, + description: 'Annual plan', + trial_period: { interval: 'day', frequency: 10 }, + billing_cycle: { interval: 'year', frequency: 1 }, + }, + status: 'trialing', + quantity: 1, + recurring: true, + created_at: '2023-08-18T13:15:46.864164Z', + updated_at: '2023-08-18T13:15:46.864164Z', + trial_dates: { ends_at: '2023-08-28T13:15:46.864158Z', starts_at: '2023-08-18T13:15:46.864158Z' }, + next_billed_at: '2023-08-28T13:15:46.864158Z', + previously_billed_at: null, + }, + ], + status: 'trialing', + paused_at: null, + address_id: 'add_01h84cjfy5411jpjes4hmafqry', + created_at: '2023-08-18T13:15:46.864163Z', + started_at: '2023-08-18T13:15:46.864158Z', + updated_at: '2023-08-18T13:15:46.864163Z', + business_id: null, + canceled_at: null, + custom_data: null, + discount: null, + customer_id: 'ctm_01h84cjfwmdph1k8kgsyjt3k7g', + billing_cycle: { interval: 'year', frequency: 1 }, + currency_code: 'USD', + next_billed_at: '2023-08-28T13:15:46.864158Z', + billing_details: null, + collection_mode: 'automatic', + first_billed_at: null, + scheduled_change: null, + current_billing_period: { ends_at: '2023-08-28T13:15:46.864158Z', starts_at: '2023-08-18T13:15:46.864158Z' }, + }, +}; + +export const SubscriptionTrialingMockExpectation = { + data: { + addressId: 'add_01h84cjfy5411jpjes4hmafqry', + billingCycle: { + frequency: 1, + interval: 'year', + }, + billingDetails: null, + businessId: null, + canceledAt: null, + collectionMode: 'automatic', + createdAt: '2023-08-18T13:15:46.864163Z', + currencyCode: 'USD', + currentBillingPeriod: { + endsAt: '2023-08-28T13:15:46.864158Z', + startsAt: '2023-08-18T13:15:46.864158Z', + }, + customData: null, + customerId: 'ctm_01h84cjfwmdph1k8kgsyjt3k7g', + discount: null, + firstBilledAt: null, + id: 'sub_01h84ck8sg4ebkpzqb9x2mtjjf', + items: [ + { + createdAt: '2023-08-18T13:15:46.864164Z', + nextBilledAt: '2023-08-28T13:15:46.864158Z', + previouslyBilledAt: null, + price: { + billingCycle: { + frequency: 1, + interval: 'year', + }, + description: 'Annual plan', + id: 'pri_01h84cdy3xatsp16afda2gekzy', + productId: 'pro_01h84cd36f900f3wmpdfamgv8w', + taxMode: 'account_setting', + trialPeriod: { + frequency: 10, + interval: 'day', + }, + unitPrice: { + amount: '0', + currencyCode: 'USD', + }, + }, + quantity: 1, + recurring: true, + status: 'trialing', + trialDates: { + endsAt: '2023-08-28T13:15:46.864158Z', + startsAt: '2023-08-18T13:15:46.864158Z', + }, + updatedAt: '2023-08-18T13:15:46.864164Z', + }, + ], + nextBilledAt: '2023-08-28T13:15:46.864158Z', + pausedAt: null, + scheduledChange: null, + startedAt: '2023-08-18T13:15:46.864158Z', + status: 'trialing', + updatedAt: '2023-08-18T13:15:46.864163Z', + transactionId: 'txn_01h8bxpvx398a7zbawb77y0kp5', + }, + eventId: 'evt_01h84cka4p40e737vm1ajb2bc5', + eventType: 'subscription.trialing', + notificationId: 'ntf_01h84cka91b65gy90qhe2tw2q6', + occurredAt: '2023-08-18T13:15:48.246292Z', +}; diff --git a/src/__tests__/mocks/notifications/subscription-updated.mock.ts b/src/__tests__/mocks/notifications/subscription-updated.mock.ts new file mode 100644 index 0000000..c6e6f6e --- /dev/null +++ b/src/__tests__/mocks/notifications/subscription-updated.mock.ts @@ -0,0 +1,165 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export const SubscriptionUpdatedMock: IEventsResponse = { + event_id: 'evt_01h7j296f40h99m4dcrr6h4as8', + event_type: 'subscription.updated', + occurred_at: '2023-08-11T10:29:11.268117Z', + notification_id: 'ntf_01h7j296hkp15d34485ywewrgd', + data: { + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3240', currency_code: 'USD' }, + description: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 10, + recurring: true, + created_at: '2023-08-11T08:07:36.892823Z', + updated_at: '2023-09-11T08:07:47.342665Z', + trial_dates: null, + next_billed_at: '2023-10-11T08:07:35.449123Z', + previously_billed_at: '2023-09-11T08:07:35.449123Z', + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10800', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + }, + status: 'active', + quantity: 1, + recurring: true, + created_at: '2023-08-11T08:07:36.892827Z', + updated_at: '2023-09-11T08:07:47.343778Z', + trial_dates: null, + next_billed_at: '2023-10-11T08:07:35.449123Z', + previously_billed_at: '2023-09-11T08:07:35.449123Z', + }, + ], + status: 'active', + paused_at: null, + address_id: 'add_01h7hswbfjqez51ezfhk7s6400', + created_at: '2023-08-11T08:07:36.892822Z', + started_at: '2023-08-11T08:07:35.449123Z', + updated_at: '2023-09-11T08:07:47.341611Z', + business_id: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceled_at: null, + custom_data: null, + discount: null, + customer_id: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + billing_cycle: { interval: 'month', frequency: 1 }, + currency_code: 'USD', + next_billed_at: '2023-10-11T08:07:35.449123Z', + billing_details: null, + collection_mode: 'automatic', + first_billed_at: '2023-08-11T08:07:35.449123Z', + scheduled_change: null, + current_billing_period: { ends_at: '2023-10-11T08:07:35.449123Z', starts_at: '2023-09-11T08:07:35.449123Z' }, + }, +}; + +export const SubscriptionUpdatedMockExpectation = { + data: { + addressId: 'add_01h7hswbfjqez51ezfhk7s6400', + billingCycle: { + frequency: 1, + interval: 'month', + }, + billingDetails: null, + businessId: 'biz_01h7ht30avfmwa4kvkfeg4ef8e', + canceledAt: null, + collectionMode: 'automatic', + createdAt: '2023-08-11T08:07:36.892822Z', + currencyCode: 'USD', + currentBillingPeriod: { + endsAt: '2023-10-11T08:07:35.449123Z', + startsAt: '2023-09-11T08:07:35.449123Z', + }, + customData: null, + customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw', + discount: null, + firstBilledAt: '2023-08-11T08:07:35.449123Z', + id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k', + items: [ + { + createdAt: '2023-08-11T08:07:36.892823Z', + nextBilledAt: '2023-10-11T08:07:35.449123Z', + previouslyBilledAt: '2023-09-11T08:07:35.449123Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '3240', + currencyCode: 'USD', + }, + }, + quantity: 10, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-09-11T08:07:47.342665Z', + }, + { + createdAt: '2023-08-11T08:07:36.892827Z', + nextBilledAt: '2023-10-11T08:07:35.449123Z', + previouslyBilledAt: '2023-09-11T08:07:35.449123Z', + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + taxMode: 'account_setting', + trialPeriod: null, + unitPrice: { + amount: '10800', + currencyCode: 'USD', + }, + }, + quantity: 1, + recurring: true, + status: 'active', + trialDates: null, + updatedAt: '2023-09-11T08:07:47.343778Z', + }, + ], + nextBilledAt: '2023-10-11T08:07:35.449123Z', + pausedAt: null, + scheduledChange: null, + startedAt: '2023-08-11T08:07:35.449123Z', + status: 'active', + transactionId: 'txn_01h8bxpvx398a7zbawb77y0kp5', + updatedAt: '2023-09-11T08:07:47.341611Z', + }, + eventId: 'evt_01h7j296f40h99m4dcrr6h4as8', + eventType: 'subscription.updated', + notificationId: 'ntf_01h7j296hkp15d34485ywewrgd', + occurredAt: '2023-08-11T10:29:11.268117Z', +}; diff --git a/src/__tests__/mocks/notifications/transaction-billed.mock.ts b/src/__tests__/mocks/notifications/transaction-billed.mock.ts new file mode 100644 index 0000000..aa110ef --- /dev/null +++ b/src/__tests__/mocks/notifications/transaction-billed.mock.ts @@ -0,0 +1,459 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export const TransactionBilledMock: IEventsResponse = { + event_id: 'evt_01h8e3a5029s6xrd5qj89beawp', + event_type: 'transaction.billed', + occurred_at: '2023-08-22T07:45:55.202630Z', + notification_id: 'ntf_01h8e3a52eayz16zsgzjzxmkcz', + data: { + id: 'txn_01h8e0d5sej61d5n18bth8d7se', + items: [ + { + price: { + id: 'pri_01gsz91wy9k1yn7kx82aafwvea', + status: 'active', + quantity: { maximum: 100, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz4vmqbjk3x4vvtafffd540', + unit_price: { amount: '50000', currency_code: 'USD' }, + description: 'Annual (per seat)', + name: 'Annual (per seat)', + trial_period: null, + billing_cycle: { interval: 'year', frequency: 1 }, + unit_price_overrides: [], + type: 'standard', + custom_data: null, + }, + quantity: 20, + }, + { + price: { + id: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + unit_price: { amount: '300000', currency_code: 'USD' }, + description: 'Annual (recurring addon)', + name: 'Annual (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'year', frequency: 1 }, + unit_price_overrides: [], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + { + price: { + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { amount: '19900', currency_code: 'USD' }, + description: 'One-time charge', + name: 'One-time charge', + trial_period: null, + billing_cycle: null, + unit_price_overrides: [{ unit_price: { amount: '40000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + ], + origin: 'api', + status: 'billed', + details: { + totals: { + fee: null, + tax: '117141', + total: '1437041', + credit: '0', + credit_to_balance: '0', + balance: '1437041', + discount: '0', + earnings: null, + subtotal: '1319900', + grand_total: '1437041', + currency_code: 'USD', + }, + line_items: [ + { + id: 'txnitm_01h8e0d66yv89b4wrcv4ys3ggp', + totals: { tax: '88750', total: '1088750', discount: '0', subtotal: '1000000' }, + product: { + id: 'pro_01gsz4vmqbjk3x4vvtafffd540', + name: 'ChatApp Enterprise', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + description: + 'The ultimate solution for businesses that require top-of-the-line features and customizations. Includes all the features of the Pro plan, plus personalized onboarding, dedicated account management, and the ability to pay via invoice.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz91wy9k1yn7kx82aafwvea', + quantity: 20, + tax_rate: '0.08875', + unit_totals: { tax: '4437', total: '54437', discount: '0', subtotal: '50000' }, + }, + { + id: 'txnitm_01h8e0d66yv89b4wrcv7mhcr0y', + totals: { tax: '26625', total: '326625', discount: '0', subtotal: '300000' }, + product: { + id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + name: 'VIP support', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + description: + 'Get exclusive access to our expert team of product specialists, available to help you make the most of your ChatApp subscription.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '26625', total: '326625', discount: '0', subtotal: '300000' }, + }, + { + id: 'txnitm_01h8e0d66yv89b4wrcv9r3ehhp', + totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Custom domains', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + }, + ], + payout_totals: null, + tax_rates_used: [ + { totals: { tax: '117141', total: '1437041', discount: '0', subtotal: '1319900' }, tax_rate: '0.08875' }, + ], + adjusted_totals: { + fee: null, + tax: '117141', + total: '1437041', + earnings: null, + subtotal: '1319900', + grand_total: '1437041', + currency_code: 'USD', + }, + adjusted_payout_totals: null, + }, + checkout: { url: null }, + payments: [], + billed_at: '2023-08-22T07:45:54.783994887Z', + address_id: 'add_01h848pep46enq8y372x7maj0p', + created_at: '2023-08-22T06:55:09.047391Z', + invoice_id: 'inv_01h8e0d6zvkbs5cgezqjptysee', + updated_at: '2023-08-22T07:45:54.81387658Z', + business_id: null, + custom_data: null, + customer_id: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + discount_id: null, + currency_code: 'USD', + billing_period: { ends_at: '2024-07-31T23:59:00Z', starts_at: '2023-08-01T00:00:00Z' }, + invoice_number: null, + billing_details: { + payment_terms: { interval: 'day', frequency: 14 }, + enable_checkout: false, + purchase_order_number: 'PO-123', + additional_information: null, + }, + collection_mode: 'manual', + subscription_id: null, + }, +}; + +export const TransactionBilledMockExpectation = { + data: { + addressId: 'add_01h848pep46enq8y372x7maj0p', + billedAt: '2023-08-22T07:45:54.783994887Z', + billingDetails: { + additionalInformation: null, + enableCheckout: false, + paymentTerms: { + frequency: 14, + interval: 'day', + }, + purchaseOrderNumber: 'PO-123', + }, + billingPeriod: { + endsAt: '2024-07-31T23:59:00Z', + startsAt: '2023-08-01T00:00:00Z', + }, + businessId: null, + checkout: { + url: null, + }, + collectionMode: 'manual', + createdAt: '2023-08-22T06:55:09.047391Z', + currencyCode: 'USD', + customData: null, + customerId: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + details: { + adjustedPayoutTotals: null, + adjustedTotals: { + currencyCode: 'USD', + earnings: null, + fee: null, + grandTotal: '1437041', + subtotal: '1319900', + tax: '117141', + total: '1437041', + }, + lineItems: [ + { + id: 'txnitm_01h8e0d66yv89b4wrcv4ys3ggp', + priceId: 'pri_01gsz91wy9k1yn7kx82aafwvea', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'The ultimate solution for businesses that require top-of-the-line features and customizations. Includes all the features of the Pro plan, plus personalized onboarding, dedicated account management, and the ability to pay via invoice.', + id: 'pro_01gsz4vmqbjk3x4vvtafffd540', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + importMeta: null, + name: 'ChatApp Enterprise', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 20, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '1000000', + tax: '88750', + total: '1088750', + }, + unitTotals: { + discount: '0', + subtotal: '50000', + tax: '4437', + total: '54437', + }, + }, + { + id: 'txnitm_01h8e0d66yv89b4wrcv7mhcr0y', + priceId: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Get exclusive access to our expert team of product specialists, available to help you make the most of your ChatApp subscription.', + id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + importMeta: null, + name: 'VIP support', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '300000', + tax: '26625', + total: '326625', + }, + unitTotals: { + discount: '0', + subtotal: '300000', + tax: '26625', + total: '326625', + }, + }, + { + id: 'txnitm_01h8e0d66yv89b4wrcv9r3ehhp', + priceId: 'pri_01gsz98e27ak2tyhexptwc58yk', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + importMeta: null, + name: 'Custom domains', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + unitTotals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + }, + ], + payoutTotals: null, + taxRatesUsed: [ + { + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '1319900', + tax: '117141', + total: '1437041', + }, + }, + ], + totals: { + balance: '1437041', + credit: '0', + creditToBalance: '0', + currencyCode: 'USD', + discount: '0', + earnings: null, + fee: null, + grandTotal: '1437041', + subtotal: '1319900', + tax: '117141', + total: '1437041', + }, + }, + discountId: null, + id: 'txn_01h8e0d5sej61d5n18bth8d7se', + invoiceId: 'inv_01h8e0d6zvkbs5cgezqjptysee', + invoiceNumber: null, + items: [ + { + price: { + billingCycle: { + frequency: 1, + interval: 'year', + }, + customData: null, + description: 'Annual (per seat)', + id: 'pri_01gsz91wy9k1yn7kx82aafwvea', + importMeta: null, + name: 'Annual (per seat)', + productId: 'pro_01gsz4vmqbjk3x4vvtafffd540', + quantity: { + maximum: 100, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '50000', + currencyCode: 'USD', + }, + unitPriceOverrides: [], + }, + proration: null, + quantity: 20, + }, + { + price: { + billingCycle: { + frequency: 1, + interval: 'year', + }, + customData: null, + description: 'Annual (recurring addon)', + id: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + importMeta: null, + name: 'Annual (recurring addon)', + productId: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '300000', + currencyCode: 'USD', + }, + unitPriceOverrides: [], + }, + proration: null, + quantity: 1, + }, + { + price: { + billingCycle: null, + customData: null, + description: 'One-time charge', + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + importMeta: null, + name: 'One-time charge', + productId: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '19900', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '40000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + ], + origin: 'api', + payments: [], + status: 'billed', + subscriptionId: null, + updatedAt: '2023-08-22T07:45:54.81387658Z', + }, + eventId: 'evt_01h8e3a5029s6xrd5qj89beawp', + eventType: 'transaction.billed', + notificationId: 'ntf_01h8e3a52eayz16zsgzjzxmkcz', + occurredAt: '2023-08-22T07:45:55.202630Z', +}; diff --git a/src/__tests__/mocks/notifications/transaction-canceled.mock.ts b/src/__tests__/mocks/notifications/transaction-canceled.mock.ts new file mode 100644 index 0000000..d975ea7 --- /dev/null +++ b/src/__tests__/mocks/notifications/transaction-canceled.mock.ts @@ -0,0 +1,459 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export const TransactionCanceledMock: IEventsResponse = { + event_id: 'evt_01h8e3dvbz4y98ge4q3raptg16', + event_type: 'transaction.canceled', + occurred_at: '2023-08-22T07:47:56.415447Z', + notification_id: 'ntf_01h8e3dvejvh0n2t0fvy3a9bz7', + data: { + id: 'txn_01h8e0d5sej61d5n18bth8d7se', + items: [ + { + price: { + id: 'pri_01gsz91wy9k1yn7kx82aafwvea', + status: 'active', + quantity: { maximum: 100, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz4vmqbjk3x4vvtafffd540', + unit_price: { amount: '50000', currency_code: 'USD' }, + description: 'Annual (per seat)', + name: 'Annual (per seat)', + trial_period: null, + billing_cycle: { interval: 'year', frequency: 1 }, + unit_price_overrides: [], + type: 'standard', + custom_data: null, + }, + quantity: 20, + }, + { + price: { + id: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + unit_price: { amount: '300000', currency_code: 'USD' }, + description: 'Annual (recurring addon)', + name: 'Annual (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'year', frequency: 1 }, + unit_price_overrides: [], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + { + price: { + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { amount: '19900', currency_code: 'USD' }, + description: 'One-time charge', + name: 'One-time charge', + trial_period: null, + billing_cycle: null, + unit_price_overrides: [{ unit_price: { amount: '40000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + ], + origin: 'api', + status: 'canceled', + details: { + totals: { + fee: null, + tax: '117141', + total: '1437041', + credit: '0', + credit_to_balance: '0', + balance: '1437041', + discount: '0', + earnings: null, + subtotal: '1319900', + grand_total: '1437041', + currency_code: 'USD', + }, + line_items: [ + { + id: 'txnitm_01h8e0d66yv89b4wrcv4ys3ggp', + totals: { tax: '88750', total: '1088750', discount: '0', subtotal: '1000000' }, + product: { + id: 'pro_01gsz4vmqbjk3x4vvtafffd540', + name: 'ChatApp Enterprise', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + description: + 'The ultimate solution for businesses that require top-of-the-line features and customizations. Includes all the features of the Pro plan, plus personalized onboarding, dedicated account management, and the ability to pay via invoice.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz91wy9k1yn7kx82aafwvea', + quantity: 20, + tax_rate: '0.08875', + unit_totals: { tax: '4437', total: '54437', discount: '0', subtotal: '50000' }, + }, + { + id: 'txnitm_01h8e0d66yv89b4wrcv7mhcr0y', + totals: { tax: '26625', total: '326625', discount: '0', subtotal: '300000' }, + product: { + id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + name: 'VIP support', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + description: + 'Get exclusive access to our expert team of product specialists, available to help you make the most of your ChatApp subscription.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '26625', total: '326625', discount: '0', subtotal: '300000' }, + }, + { + id: 'txnitm_01h8e0d66yv89b4wrcv9r3ehhp', + totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Custom domains', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + }, + ], + payout_totals: null, + tax_rates_used: [ + { totals: { tax: '117141', total: '1437041', discount: '0', subtotal: '1319900' }, tax_rate: '0.08875' }, + ], + adjusted_totals: { + fee: null, + tax: '117141', + total: '1437041', + earnings: null, + subtotal: '1319900', + grand_total: '1437041', + currency_code: 'USD', + }, + adjusted_payout_totals: null, + }, + checkout: { url: null }, + payments: [], + billed_at: '2023-08-22T07:45:54.783994Z', + address_id: 'add_01h848pep46enq8y372x7maj0p', + created_at: '2023-08-22T06:55:09.047391Z', + invoice_id: 'inv_01h8e0d6zvkbs5cgezqjptysee', + updated_at: '2023-08-22T07:47:55.822654296Z', + business_id: null, + custom_data: null, + customer_id: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + discount_id: null, + currency_code: 'USD', + billing_period: { ends_at: '2024-07-31T23:59:00Z', starts_at: '2023-08-01T00:00:00Z' }, + invoice_number: '325-10148', + billing_details: { + payment_terms: { interval: 'day', frequency: 14 }, + enable_checkout: false, + purchase_order_number: 'PO-123', + additional_information: null, + }, + collection_mode: 'manual', + subscription_id: 'sub_01h8e3a4xydvszvmnm61x1t0kt', + }, +}; + +export const TransactionCanceledMockExpectation = { + data: { + addressId: 'add_01h848pep46enq8y372x7maj0p', + billedAt: '2023-08-22T07:45:54.783994Z', + billingDetails: { + additionalInformation: null, + enableCheckout: false, + paymentTerms: { + frequency: 14, + interval: 'day', + }, + purchaseOrderNumber: 'PO-123', + }, + billingPeriod: { + endsAt: '2024-07-31T23:59:00Z', + startsAt: '2023-08-01T00:00:00Z', + }, + businessId: null, + checkout: { + url: null, + }, + collectionMode: 'manual', + createdAt: '2023-08-22T06:55:09.047391Z', + currencyCode: 'USD', + customData: null, + customerId: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + details: { + adjustedPayoutTotals: null, + adjustedTotals: { + currencyCode: 'USD', + earnings: null, + fee: null, + grandTotal: '1437041', + subtotal: '1319900', + tax: '117141', + total: '1437041', + }, + lineItems: [ + { + id: 'txnitm_01h8e0d66yv89b4wrcv4ys3ggp', + priceId: 'pri_01gsz91wy9k1yn7kx82aafwvea', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'The ultimate solution for businesses that require top-of-the-line features and customizations. Includes all the features of the Pro plan, plus personalized onboarding, dedicated account management, and the ability to pay via invoice.', + id: 'pro_01gsz4vmqbjk3x4vvtafffd540', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + importMeta: null, + name: 'ChatApp Enterprise', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 20, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '1000000', + tax: '88750', + total: '1088750', + }, + unitTotals: { + discount: '0', + subtotal: '50000', + tax: '4437', + total: '54437', + }, + }, + { + id: 'txnitm_01h8e0d66yv89b4wrcv7mhcr0y', + priceId: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Get exclusive access to our expert team of product specialists, available to help you make the most of your ChatApp subscription.', + id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + importMeta: null, + name: 'VIP support', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '300000', + tax: '26625', + total: '326625', + }, + unitTotals: { + discount: '0', + subtotal: '300000', + tax: '26625', + total: '326625', + }, + }, + { + id: 'txnitm_01h8e0d66yv89b4wrcv9r3ehhp', + priceId: 'pri_01gsz98e27ak2tyhexptwc58yk', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + importMeta: null, + name: 'Custom domains', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + unitTotals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + }, + ], + payoutTotals: null, + taxRatesUsed: [ + { + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '1319900', + tax: '117141', + total: '1437041', + }, + }, + ], + totals: { + balance: '1437041', + credit: '0', + creditToBalance: '0', + currencyCode: 'USD', + discount: '0', + earnings: null, + fee: null, + grandTotal: '1437041', + subtotal: '1319900', + tax: '117141', + total: '1437041', + }, + }, + discountId: null, + id: 'txn_01h8e0d5sej61d5n18bth8d7se', + invoiceId: 'inv_01h8e0d6zvkbs5cgezqjptysee', + invoiceNumber: '325-10148', + items: [ + { + price: { + billingCycle: { + frequency: 1, + interval: 'year', + }, + customData: null, + description: 'Annual (per seat)', + id: 'pri_01gsz91wy9k1yn7kx82aafwvea', + importMeta: null, + name: 'Annual (per seat)', + productId: 'pro_01gsz4vmqbjk3x4vvtafffd540', + quantity: { + maximum: 100, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '50000', + currencyCode: 'USD', + }, + unitPriceOverrides: [], + }, + proration: null, + quantity: 20, + }, + { + price: { + billingCycle: { + frequency: 1, + interval: 'year', + }, + customData: null, + description: 'Annual (recurring addon)', + id: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + importMeta: null, + name: 'Annual (recurring addon)', + productId: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '300000', + currencyCode: 'USD', + }, + unitPriceOverrides: [], + }, + proration: null, + quantity: 1, + }, + { + price: { + billingCycle: null, + customData: null, + description: 'One-time charge', + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + importMeta: null, + name: 'One-time charge', + productId: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '19900', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '40000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + ], + origin: 'api', + payments: [], + status: 'canceled', + subscriptionId: 'sub_01h8e3a4xydvszvmnm61x1t0kt', + updatedAt: '2023-08-22T07:47:55.822654296Z', + }, + eventId: 'evt_01h8e3dvbz4y98ge4q3raptg16', + eventType: 'transaction.canceled', + notificationId: 'ntf_01h8e3dvejvh0n2t0fvy3a9bz7', + occurredAt: '2023-08-22T07:47:56.415447Z', +}; diff --git a/src/__tests__/mocks/notifications/transaction-completed.mock.ts b/src/__tests__/mocks/notifications/transaction-completed.mock.ts new file mode 100644 index 0000000..97a66a7 --- /dev/null +++ b/src/__tests__/mocks/notifications/transaction-completed.mock.ts @@ -0,0 +1,569 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export const TransactionCompletedMock: IEventsResponse = { + event_id: 'evt_01h8e1jxjnw9ra6zarhnz1a7y1', + event_type: 'transaction.completed', + occurred_at: '2023-08-22T07:15:45.366122Z', + notification_id: 'ntf_01h8e1jxna32kc43ev1vkqsq8x', + data: { + id: 'txn_01h8dzxgkvdwemdhbpcapj2tbj', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + status: 'active', + quantity: { maximum: 999, minimum: 10 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3000', currency_code: 'USD' }, + description: 'Monthly (per seat)', + name: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [{ unit_price: { amount: '5000', currency_code: 'AUD' }, country_codes: ['AU'] }], + custom_data: null, + }, + quantity: 10, + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + status: 'active', + quantity: { maximum: 100, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10000', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + name: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [{ unit_price: { amount: '20000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + { + price: { + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { amount: '19900', currency_code: 'USD' }, + description: 'One-time charge', + name: 'One-time charge', + trial_period: null, + billing_cycle: null, + unit_price_overrides: [{ unit_price: { amount: '40000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + ], + origin: 'web', + status: 'completed', + details: { + totals: { + fee: '3311', + tax: '5315', + total: '65215', + credit: '0', + credit_to_balance: '0', + balance: '0', + discount: '0', + earnings: '56589', + subtotal: '59900', + grand_total: '65215', + currency_code: 'USD', + }, + line_items: [ + { + id: 'txnitm_01h8e18cjzkpvj81m223nvag50', + totals: { tax: '2662', total: '32662', discount: '0', subtotal: '30000' }, + product: { + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + name: 'ChatApp Pro', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + quantity: 10, + tax_rate: '0.08875', + unit_totals: { tax: '266', total: '3266', discount: '0', subtotal: '3000' }, + }, + { + id: 'txnitm_01h8e18cjzkpvj81m225yfzsdz', + totals: { tax: '887', total: '10887', discount: '0', subtotal: '10000' }, + product: { + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + name: 'Voice rooms addon', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01h1vjfevh5etwq3rb416a23h2', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '887', total: '10887', discount: '0', subtotal: '10000' }, + }, + { + id: 'txnitm_01h8e18ck0g6b9r0247mdrh34r', + totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Custom domains', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + }, + ], + payout_totals: { + fee: '3311', + tax: '5315', + total: '65215', + credit: '0', + credit_to_balance: '0', + balance: '0', + discount: '0', + earnings: '56589', + subtotal: '59900', + grand_total: '65215', + currency_code: 'USD', + }, + tax_rates_used: [ + { totals: { tax: '5315', total: '65215', discount: '0', subtotal: '59900' }, tax_rate: '0.08875' }, + ], + adjusted_totals: { + fee: '3311', + tax: '5315', + total: '65215', + earnings: '56589', + subtotal: '59900', + grand_total: '65215', + currency_code: 'USD', + }, + adjusted_payout_totals: { + fee: '3311', + tax: '5315', + total: '65215', + earnings: '56589', + subtotal: '59900', + currency_code: 'USD', + chargeback_fee: { amount: '0', original: null }, + }, + }, + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01h8dzxgkvdwemdhbpcapj2tbj', + }, + payments: [ + { + amount: '65215', + status: 'captured', + created_at: '2023-08-22T07:15:37.09387Z', + error_code: null, + captured_at: '2023-08-22T07:15:43.792797Z', + method_details: { + card: { type: 'visa', last4: '4242', expiry_year: 2025, expiry_month: 12, cardholder_name: 'Joe Bloggs' }, + type: 'card', + }, + payment_attempt_id: '72d47ad6-d938-4e70-8743-b8678b4ae1b6', + stored_payment_method_id: '7330719b-627c-4bb2-9f83-f34d07ce7d2f', + }, + { + amount: '65215', + status: 'error', + created_at: '2023-08-22T07:13:26.837726Z', + error_code: 'declined', + captured_at: null, + method_details: { + card: { type: 'visa', last4: '0000', expiry_year: 2025, expiry_month: 12, cardholder_name: 'Joe Bloggs' }, + type: 'card', + }, + payment_attempt_id: '3e575fab-e1f2-4168-9ef7-3dd724f450a0', + stored_payment_method_id: '6fd9d503-085a-4af1-a562-f05d7217cdd2', + }, + ], + billed_at: '2023-08-22T07:15:44.296865Z', + address_id: 'add_01h8e18bzb5av13cd16m5gz214', + created_at: '2023-08-22T06:46:35.440187Z', + invoice_id: null, + updated_at: '2023-08-22T07:15:44.296867Z', + business_id: null, + custom_data: null, + customer_id: 'ctm_01h8e18bxp9hby49dnm8ewf0m0', + discount_id: null, + currency_code: 'USD', + billing_period: null, + invoice_number: null, + billing_details: null, + collection_mode: 'automatic', + subscription_id: null, + }, +}; + +export const TransactionCompletedMockExpectation = { + data: { + addressId: 'add_01h8e18bzb5av13cd16m5gz214', + billedAt: '2023-08-22T07:15:44.296865Z', + billingDetails: null, + billingPeriod: null, + businessId: null, + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01h8dzxgkvdwemdhbpcapj2tbj', + }, + collectionMode: 'automatic', + createdAt: '2023-08-22T06:46:35.440187Z', + currencyCode: 'USD', + customData: null, + customerId: 'ctm_01h8e18bxp9hby49dnm8ewf0m0', + details: { + adjustedPayoutTotals: { + chargebackFee: { + amount: '0', + original: null, + }, + currencyCode: 'USD', + earnings: '56589', + fee: '3311', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + adjustedTotals: { + currencyCode: 'USD', + earnings: '56589', + fee: '3311', + grandTotal: '65215', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + lineItems: [ + { + id: 'txnitm_01h8e18cjzkpvj81m223nvag50', + priceId: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + importMeta: null, + name: 'ChatApp Pro', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 10, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '30000', + tax: '2662', + total: '32662', + }, + unitTotals: { + discount: '0', + subtotal: '3000', + tax: '266', + total: '3266', + }, + }, + { + id: 'txnitm_01h8e18cjzkpvj81m225yfzsdz', + priceId: 'pri_01h1vjfevh5etwq3rb416a23h2', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + importMeta: null, + name: 'Voice rooms addon', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '10000', + tax: '887', + total: '10887', + }, + unitTotals: { + discount: '0', + subtotal: '10000', + tax: '887', + total: '10887', + }, + }, + { + id: 'txnitm_01h8e18ck0g6b9r0247mdrh34r', + priceId: 'pri_01gsz98e27ak2tyhexptwc58yk', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + importMeta: null, + name: 'Custom domains', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + unitTotals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + }, + ], + payoutTotals: { + balance: '0', + credit: '0', + creditToBalance: '0', + currencyCode: 'USD', + discount: '0', + earnings: '56589', + fee: '3311', + grandTotal: '65215', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + taxRatesUsed: [ + { + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + }, + ], + totals: { + balance: '0', + credit: '0', + creditToBalance: '0', + currencyCode: 'USD', + discount: '0', + earnings: '56589', + fee: '3311', + grandTotal: '65215', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + }, + discountId: null, + id: 'txn_01h8dzxgkvdwemdhbpcapj2tbj', + invoiceId: null, + invoiceNumber: null, + items: [ + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + importMeta: null, + name: 'Monthly (per seat)', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + quantity: { + maximum: 999, + minimum: 10, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: null, + unitPrice: { + amount: '3000', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '5000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 10, + }, + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + importMeta: null, + name: 'Monthly (recurring addon)', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + quantity: { + maximum: 100, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '10000', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '20000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + { + price: { + billingCycle: null, + customData: null, + description: 'One-time charge', + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + importMeta: null, + name: 'One-time charge', + productId: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '19900', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '40000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + ], + origin: 'web', + payments: [ + { + amount: '65215', + capturedAt: '2023-08-22T07:15:43.792797Z', + createdAt: '2023-08-22T07:15:37.09387Z', + errorCode: null, + methodDetails: { + card: { + cardholderName: 'Joe Bloggs', + expiryMonth: 12, + expiryYear: 2025, + last4: '4242', + type: 'visa', + }, + type: 'card', + }, + paymentAttemptId: '72d47ad6-d938-4e70-8743-b8678b4ae1b6', + status: 'captured', + storedPaymentMethodId: '7330719b-627c-4bb2-9f83-f34d07ce7d2f', + }, + { + amount: '65215', + capturedAt: null, + createdAt: '2023-08-22T07:13:26.837726Z', + errorCode: 'declined', + methodDetails: { + card: { + cardholderName: 'Joe Bloggs', + expiryMonth: 12, + expiryYear: 2025, + last4: '0000', + type: 'visa', + }, + type: 'card', + }, + paymentAttemptId: '3e575fab-e1f2-4168-9ef7-3dd724f450a0', + status: 'error', + storedPaymentMethodId: '6fd9d503-085a-4af1-a562-f05d7217cdd2', + }, + ], + status: 'completed', + subscriptionId: null, + updatedAt: '2023-08-22T07:15:44.296867Z', + }, + eventId: 'evt_01h8e1jxjnw9ra6zarhnz1a7y1', + eventType: 'transaction.completed', + notificationId: 'ntf_01h8e1jxna32kc43ev1vkqsq8x', + occurredAt: '2023-08-22T07:15:45.366122Z', +}; diff --git a/src/__tests__/mocks/notifications/transaction-created.mock.ts b/src/__tests__/mocks/notifications/transaction-created.mock.ts new file mode 100644 index 0000000..7388402 --- /dev/null +++ b/src/__tests__/mocks/notifications/transaction-created.mock.ts @@ -0,0 +1,447 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export const TransactionCreatedMock: IEventsResponse = { + event_id: 'evt_01h8dzxgzb5af0yzd0mv5v11e2', + event_type: 'transaction.created', + occurred_at: '2023-08-22T06:46:35.755631Z', + notification_id: 'ntf_01h8dzxh1vezfx6j8yesfv4ew7', + data: { + id: 'txn_01h8dzxgkvdwemdhbpcapj2tbj', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + status: 'active', + quantity: { maximum: 999, minimum: 10 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3000', currency_code: 'USD' }, + description: 'Monthly (per seat)', + name: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [{ unit_price: { amount: '5000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + price_id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + quantity: 10, + proration: null, + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + status: 'active', + quantity: { maximum: 100, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10000', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + name: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [{ unit_price: { amount: '20000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + price_id: 'pri_01h1vjfevh5etwq3rb416a23h2', + quantity: 1, + proration: null, + }, + { + price: { + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { amount: '19900', currency_code: 'USD' }, + description: 'One-time charge', + name: 'One-time charge', + trial_period: null, + billing_cycle: null, + unit_price_overrides: [{ unit_price: { amount: '40000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + proration: null, + }, + ], + origin: 'web', + status: 'draft', + details: { + totals: { + fee: null, + tax: '11980', + total: '71880', + credit: '0', + credit_to_balance: '0', + balance: '71880', + discount: '0', + earnings: null, + subtotal: '59900', + grand_total: '71880', + currency_code: 'USD', + }, + line_items: [ + { + id: 'txnitm_01h8dzxgmzys6xwzza1nnz3vx5', + totals: { tax: '6000', total: '36000', discount: '0', subtotal: '30000' }, + product: { + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + name: 'ChatApp Pro', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + quantity: 10, + tax_rate: '0.2', + unit_totals: { tax: '600', total: '3600', discount: '0', subtotal: '3000' }, + }, + { + id: 'txnitm_01h8dzxgmzys6xwzza1rh8dp2s', + totals: { tax: '2000', total: '12000', discount: '0', subtotal: '10000' }, + product: { + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + name: 'Voice rooms addon', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01h1vjfevh5etwq3rb416a23h2', + quantity: 1, + tax_rate: '0.2', + unit_totals: { tax: '2000', total: '12000', discount: '0', subtotal: '10000' }, + }, + { + id: 'txnitm_01h8dzxgmzys6xwzza1stmrrnh', + totals: { tax: '3980', total: '23880', discount: '0', subtotal: '19900' }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Custom domains', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + tax_rate: '0.2', + unit_totals: { tax: '3980', total: '23880', discount: '0', subtotal: '19900' }, + }, + ], + payout_totals: null, + tax_rates_used: [{ totals: { tax: '11980', total: '71880', discount: '0', subtotal: '59900' }, tax_rate: '0.2' }], + }, + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01h8dzxgkvdwemdhbpcapj2tbj', + }, + payments: [], + billed_at: null, + address_id: null, + created_at: '2023-08-22T06:46:35.440187078Z', + invoice_id: null, + updated_at: '2023-08-22T06:46:35.440187078Z', + business_id: null, + custom_data: null, + customer_id: null, + discount_id: null, + currency_code: 'USD', + billing_period: null, + invoice_number: null, + billing_details: null, + collection_mode: 'automatic', + subscription_id: null, + }, +}; + +export const TransactionCreatedMockExpectation = { + data: { + addressId: null, + billedAt: null, + billingDetails: null, + billingPeriod: null, + businessId: null, + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01h8dzxgkvdwemdhbpcapj2tbj', + }, + collectionMode: 'automatic', + createdAt: '2023-08-22T06:46:35.440187078Z', + currencyCode: 'USD', + customData: null, + customerId: null, + details: { + adjustedPayoutTotals: null, + adjustedTotals: null, + lineItems: [ + { + id: 'txnitm_01h8dzxgmzys6xwzza1nnz3vx5', + priceId: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + importMeta: null, + name: 'ChatApp Pro', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 10, + taxRate: '0.2', + totals: { + discount: '0', + subtotal: '30000', + tax: '6000', + total: '36000', + }, + unitTotals: { + discount: '0', + subtotal: '3000', + tax: '600', + total: '3600', + }, + }, + { + id: 'txnitm_01h8dzxgmzys6xwzza1rh8dp2s', + priceId: 'pri_01h1vjfevh5etwq3rb416a23h2', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + importMeta: null, + name: 'Voice rooms addon', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.2', + totals: { + discount: '0', + subtotal: '10000', + tax: '2000', + total: '12000', + }, + unitTotals: { + discount: '0', + subtotal: '10000', + tax: '2000', + total: '12000', + }, + }, + { + id: 'txnitm_01h8dzxgmzys6xwzza1stmrrnh', + priceId: 'pri_01gsz98e27ak2tyhexptwc58yk', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + importMeta: null, + name: 'Custom domains', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.2', + totals: { + discount: '0', + subtotal: '19900', + tax: '3980', + total: '23880', + }, + unitTotals: { + discount: '0', + subtotal: '19900', + tax: '3980', + total: '23880', + }, + }, + ], + payoutTotals: null, + taxRatesUsed: [ + { + taxRate: '0.2', + totals: { + discount: '0', + subtotal: '59900', + tax: '11980', + total: '71880', + }, + }, + ], + totals: { + balance: '71880', + credit: '0', + creditToBalance: '0', + currencyCode: 'USD', + discount: '0', + earnings: null, + fee: null, + grandTotal: '71880', + subtotal: '59900', + tax: '11980', + total: '71880', + }, + }, + discountId: null, + id: 'txn_01h8dzxgkvdwemdhbpcapj2tbj', + invoiceId: null, + invoiceNumber: null, + items: [ + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + importMeta: null, + name: 'Monthly (per seat)', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + quantity: { + maximum: 999, + minimum: 10, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '3000', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '5000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 10, + }, + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + importMeta: null, + name: 'Monthly (recurring addon)', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + quantity: { + maximum: 100, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '10000', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '20000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + { + price: { + billingCycle: null, + customData: null, + description: 'One-time charge', + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + importMeta: null, + name: 'One-time charge', + productId: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '19900', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '40000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + ], + origin: 'web', + payments: [], + status: 'draft', + subscriptionId: null, + updatedAt: '2023-08-22T06:46:35.440187078Z', + }, + eventId: 'evt_01h8dzxgzb5af0yzd0mv5v11e2', + eventType: 'transaction.created', + notificationId: 'ntf_01h8dzxh1vezfx6j8yesfv4ew7', + occurredAt: '2023-08-22T06:46:35.755631Z', +}; diff --git a/src/__tests__/mocks/notifications/transaction-paid.mock.ts b/src/__tests__/mocks/notifications/transaction-paid.mock.ts new file mode 100644 index 0000000..bac5c77 --- /dev/null +++ b/src/__tests__/mocks/notifications/transaction-paid.mock.ts @@ -0,0 +1,465 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export const TransactionPaidMock: IEventsResponse = { + data: { + id: 'txn_01gxwxqj0rd5m8j1zdhvk05twz', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + status: 'active', + quantity: { maximum: 999, minimum: 10 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3000', currency_code: 'GBP' }, + description: 'Monthly (per seat)', + name: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [], + type: 'standard', + custom_data: null, + }, + quantity: 10, + }, + { + price: { + id: 'pri_01gsz95g2zrkagg294kpstx54r', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + unit_price: { amount: '25000', currency_code: 'GBP' }, + description: 'Monthly (recurring addon)', + name: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + { + price: { + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { amount: '19900', currency_code: 'GBP' }, + description: 'One-time charge', + name: 'One-time charge', + trial_period: null, + unit_price_overrides: [], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + ], + origin: 'api', + status: 'paid', + details: { + totals: { + fee: '5674', + tax: '14980', + total: '89880', + credit: '0', + credit_to_balance: '0', + balance: '89880', + discount: '0', + earnings: '69226', + subtotal: '74900', + currency_code: 'GBP', + grand_total: '89880', + }, + adjusted_totals: { + fee: '5674', + tax: '14980', + total: '89880', + grand_total: '89880', + earnings: '69226', + subtotal: '74900', + currency_code: 'GBP', + }, + line_items: [ + { + id: 'txnitm_01gxwxqjt7pp15pk36zg6qgmgn', + totals: { tax: '6000', total: '36000', discount: '0', subtotal: '30000' }, + product: { + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + name: 'ChatApp Pro', + status: 'active', + image_url: 'https://twemoji.maxcdn.com/v/latest/72x72/2708.png', + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level. Enjoy advanced integrations, improved admin controls, and cross-company chat.", + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + quantity: 10, + tax_rate: '0.2', + unit_totals: { tax: '600', total: '3600', discount: '0', subtotal: '3000' }, + }, + { + id: 'txnitm_01gxwxqjt7pp15pk36zj1s44ws', + totals: { tax: '5000', total: '30000', discount: '0', subtotal: '25000' }, + product: { + id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + name: 'VIP support', + status: 'active', + image_url: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/72x72/1f481-1f3fe.png', + description: + "Get exclusive access to our expert team of product specialists, available to help you make the most of your ChatApp subscription. We're also on hand to help with technical questions or billing issues.", + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz95g2zrkagg294kpstx54r', + quantity: 1, + tax_rate: '0.2', + unit_totals: { tax: '5000', total: '30000', discount: '0', subtotal: '25000' }, + }, + { + id: 'txnitm_01gxwxqjt7pp15pk36zj88w0dm', + totals: { tax: '3980', total: '23880', discount: '0', subtotal: '19900' }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Custom domains', + status: 'active', + image_url: 'https://twemoji.maxcdn.com/v/latest/72x72/1f30e.png', + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + tax_rate: '0.2', + unit_totals: { tax: '3980', total: '23880', discount: '0', subtotal: '19900' }, + }, + ], + payout_totals: null, + adjusted_payout_totals: null, + tax_rates_used: [{ totals: { tax: '14980', total: '89880', discount: '0', subtotal: '74900' }, tax_rate: '0.2' }], + }, + checkout: { url: '' }, + payments: [ + { + amount: '89880', + status: 'captured', + created_at: '2023-04-13T09:06:53.839276Z', + error_code: null, + captured_at: '2023-04-13T09:07:04.730931Z', + method_details: { + card: { type: 'visa', last4: '3184', expiry_year: 2024, expiry_month: 1, cardholder_name: 'Jo Williams' }, + type: 'card', + }, + payment_attempt_id: '44d59371-1d3b-4053-8631-7d02be0d1093', + stored_payment_method_id: 'a52e8eff-2a4d-4928-b7c7-980411fd8802', + }, + ], + address_id: 'add_01gxwxqjh878r4mj3b1ex6xkxt', + created_at: '2023-04-13T09:04:19.578342Z', + invoice_id: null, + updated_at: '2023-04-13T09:07:05.788733Z', + business_id: 'biz_01gxwxqjjwmdyd03q13aht3x1h', + custom_data: null, + customer_id: 'ctm_01gxwxe6vzgz6hcsbwjs6zrszr', + discount_id: null, + currency_code: 'GBP', + billing_period: null, + invoice_number: null, + billing_details: null, + collection_mode: 'automatic', + subscription_id: null, + }, + event_id: 'evt_01gxwxwnba186hj04xy8hf6wkd', + event_type: 'transaction.paid', + occurred_at: '2023-04-13T09:07:06.401607Z', + notification_id: 'ntf_01gxwxwndpbwrq43b9zrgppaev', +}; + +export const TransactionPaidMockExpectation = { + data: { + addressId: 'add_01gxwxqjh878r4mj3b1ex6xkxt', + billedAt: null, + billingDetails: null, + billingPeriod: null, + businessId: 'biz_01gxwxqjjwmdyd03q13aht3x1h', + checkout: { + url: null, + }, + collectionMode: 'automatic', + createdAt: '2023-04-13T09:04:19.578342Z', + currencyCode: 'GBP', + customData: null, + customerId: 'ctm_01gxwxe6vzgz6hcsbwjs6zrszr', + details: { + adjustedPayoutTotals: null, + adjustedTotals: { + currencyCode: 'GBP', + earnings: '69226', + fee: '5674', + grandTotal: '89880', + subtotal: '74900', + tax: '14980', + total: '89880', + }, + lineItems: [ + { + id: 'txnitm_01gxwxqjt7pp15pk36zg6qgmgn', + priceId: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level. Enjoy advanced integrations, improved admin controls, and cross-company chat.", + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + imageUrl: 'https://twemoji.maxcdn.com/v/latest/72x72/2708.png', + importMeta: null, + name: 'ChatApp Pro', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 10, + taxRate: '0.2', + totals: { + discount: '0', + subtotal: '30000', + tax: '6000', + total: '36000', + }, + unitTotals: { + discount: '0', + subtotal: '3000', + tax: '600', + total: '3600', + }, + }, + { + id: 'txnitm_01gxwxqjt7pp15pk36zj1s44ws', + priceId: 'pri_01gsz95g2zrkagg294kpstx54r', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + "Get exclusive access to our expert team of product specialists, available to help you make the most of your ChatApp subscription. We're also on hand to help with technical questions or billing issues.", + id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + imageUrl: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/72x72/1f481-1f3fe.png', + importMeta: null, + name: 'VIP support', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.2', + totals: { + discount: '0', + subtotal: '25000', + tax: '5000', + total: '30000', + }, + unitTotals: { + discount: '0', + subtotal: '25000', + tax: '5000', + total: '30000', + }, + }, + { + id: 'txnitm_01gxwxqjt7pp15pk36zj88w0dm', + priceId: 'pri_01gsz98e27ak2tyhexptwc58yk', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + imageUrl: 'https://twemoji.maxcdn.com/v/latest/72x72/1f30e.png', + importMeta: null, + name: 'Custom domains', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.2', + totals: { + discount: '0', + subtotal: '19900', + tax: '3980', + total: '23880', + }, + unitTotals: { + discount: '0', + subtotal: '19900', + tax: '3980', + total: '23880', + }, + }, + ], + payoutTotals: null, + taxRatesUsed: [ + { + taxRate: '0.2', + totals: { + discount: '0', + subtotal: '74900', + tax: '14980', + total: '89880', + }, + }, + ], + totals: { + balance: '89880', + credit: '0', + creditToBalance: '0', + currencyCode: 'GBP', + discount: '0', + earnings: '69226', + fee: '5674', + grandTotal: '89880', + subtotal: '74900', + tax: '14980', + total: '89880', + }, + }, + discountId: null, + id: 'txn_01gxwxqj0rd5m8j1zdhvk05twz', + invoiceId: null, + invoiceNumber: null, + items: [ + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + importMeta: null, + name: 'Monthly (per seat)', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + quantity: { + maximum: 999, + minimum: 10, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '3000', + currencyCode: 'GBP', + }, + unitPriceOverrides: [], + }, + proration: null, + quantity: 10, + }, + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (recurring addon)', + id: 'pri_01gsz95g2zrkagg294kpstx54r', + importMeta: null, + name: 'Monthly (recurring addon)', + productId: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '25000', + currencyCode: 'GBP', + }, + unitPriceOverrides: [], + }, + proration: null, + quantity: 1, + }, + { + price: { + billingCycle: null, + customData: null, + description: 'One-time charge', + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + importMeta: null, + name: 'One-time charge', + productId: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '19900', + currencyCode: 'GBP', + }, + unitPriceOverrides: [], + }, + proration: null, + quantity: 1, + }, + ], + origin: 'api', + payments: [ + { + amount: '89880', + capturedAt: '2023-04-13T09:07:04.730931Z', + createdAt: '2023-04-13T09:06:53.839276Z', + errorCode: null, + methodDetails: { + card: { + cardholderName: 'Jo Williams', + expiryMonth: 1, + expiryYear: 2024, + last4: '3184', + type: 'visa', + }, + type: 'card', + }, + paymentAttemptId: '44d59371-1d3b-4053-8631-7d02be0d1093', + status: 'captured', + storedPaymentMethodId: 'a52e8eff-2a4d-4928-b7c7-980411fd8802', + }, + ], + status: 'paid', + subscriptionId: null, + updatedAt: '2023-04-13T09:07:05.788733Z', + }, + eventId: 'evt_01gxwxwnba186hj04xy8hf6wkd', + eventType: 'transaction.paid', + notificationId: 'ntf_01gxwxwndpbwrq43b9zrgppaev', + occurredAt: '2023-04-13T09:07:06.401607Z', +}; diff --git a/src/__tests__/mocks/notifications/transaction-past-due.mock.ts b/src/__tests__/mocks/notifications/transaction-past-due.mock.ts new file mode 100644 index 0000000..036159f --- /dev/null +++ b/src/__tests__/mocks/notifications/transaction-past-due.mock.ts @@ -0,0 +1,394 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export const TransactionPastDueMock: IEventsResponse = { + event_id: 'evt_01h8e2sys80rn6y8xz31mstgt9', + event_type: 'transaction.past_due', + occurred_at: '2023-08-22T07:37:04.552638Z', + notification_id: 'ntf_01h8e2syvt2n0sk9m8csp27k5q', + data: { + id: 'txn_01h8e2svn94ze7bfj0zfh7z6wm', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + status: 'active', + quantity: { maximum: 999, minimum: 10 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3000', currency_code: 'USD' }, + description: 'Monthly (per seat)', + name: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [{ unit_price: { amount: '5000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 10, + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + status: 'active', + quantity: { maximum: 100, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10000', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + name: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [{ unit_price: { amount: '20000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + ], + origin: 'subscription_recurring', + status: 'past_due', + details: { + totals: { + fee: null, + tax: '3549', + total: '43549', + credit: '0', + credit_to_balance: '0', + balance: '43549', + discount: '0', + earnings: null, + subtotal: '40000', + grand_total: '43549', + currency_code: 'USD', + }, + line_items: [ + { + id: 'txnitm_01h8e2sw1tnpykpxvc9f231w0t', + totals: { tax: '2662', total: '32662', discount: '0', subtotal: '30000' }, + product: { + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + name: 'ChatApp Pro', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + quantity: 10, + tax_rate: '0.08875', + unit_totals: { tax: '266', total: '3266', discount: '0', subtotal: '3000' }, + }, + { + id: 'txnitm_01h8e2sw1tnpykpxvc9frtchfj', + totals: { tax: '887', total: '10887', discount: '0', subtotal: '10000' }, + product: { + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + name: 'Voice rooms addon', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01h1vjfevh5etwq3rb416a23h2', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '887', total: '10887', discount: '0', subtotal: '10000' }, + }, + ], + payout_totals: null, + tax_rates_used: [ + { totals: { tax: '3549', total: '43549', discount: '0', subtotal: '40000' }, tax_rate: '0.08875' }, + ], + adjusted_totals: { + fee: null, + tax: '3549', + total: '43549', + earnings: null, + subtotal: '40000', + grand_total: '43549', + currency_code: 'USD', + }, + adjusted_payout_totals: null, + }, + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01h8e2svn94ze7bfj0zfh7z6wm', + }, + payments: [ + { + amount: '43549', + status: 'error', + created_at: '2023-08-22T07:37:01.90043Z', + error_code: 'authentication_failed', + captured_at: null, + method_details: { + card: { type: 'visa', last4: '3184', expiry_year: 2025, expiry_month: 1, cardholder_name: 'Jo Williams' }, + type: 'card', + }, + payment_attempt_id: 'b9032892-96e8-4658-a822-c8177c94147e', + stored_payment_method_id: '37bb3dd6-aba6-4eb4-8bf0-e1079a3df543', + }, + ], + billed_at: '2023-08-22T07:37:01.353611Z', + address_id: 'add_01h8e18bzb5av13cd16m5gz214', + created_at: '2023-08-22T07:37:01.767524Z', + invoice_id: null, + updated_at: '2023-08-22T07:37:04.308718968Z', + business_id: null, + custom_data: null, + customer_id: 'ctm_01h8e18bxp9hby49dnm8ewf0m0', + discount_id: null, + currency_code: 'USD', + billing_period: { ends_at: '2023-10-22T07:15:43.792797Z', starts_at: '2023-09-22T07:15:43.792797Z' }, + invoice_number: null, + billing_details: null, + collection_mode: 'automatic', + subscription_id: 'sub_01h8e1jxhhss1a6agahb2xh9j0', + }, +}; + +export const TransactionPastDueMockExpectation = { + data: { + addressId: 'add_01h8e18bzb5av13cd16m5gz214', + billedAt: '2023-08-22T07:37:01.353611Z', + billingDetails: null, + billingPeriod: { + endsAt: '2023-10-22T07:15:43.792797Z', + startsAt: '2023-09-22T07:15:43.792797Z', + }, + businessId: null, + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01h8e2svn94ze7bfj0zfh7z6wm', + }, + collectionMode: 'automatic', + createdAt: '2023-08-22T07:37:01.767524Z', + currencyCode: 'USD', + customData: null, + customerId: 'ctm_01h8e18bxp9hby49dnm8ewf0m0', + details: { + adjustedPayoutTotals: null, + adjustedTotals: { + currencyCode: 'USD', + earnings: null, + fee: null, + grandTotal: '43549', + subtotal: '40000', + tax: '3549', + total: '43549', + }, + lineItems: [ + { + id: 'txnitm_01h8e2sw1tnpykpxvc9f231w0t', + priceId: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + importMeta: null, + name: 'ChatApp Pro', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 10, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '30000', + tax: '2662', + total: '32662', + }, + unitTotals: { + discount: '0', + subtotal: '3000', + tax: '266', + total: '3266', + }, + }, + { + id: 'txnitm_01h8e2sw1tnpykpxvc9frtchfj', + priceId: 'pri_01h1vjfevh5etwq3rb416a23h2', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + importMeta: null, + name: 'Voice rooms addon', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '10000', + tax: '887', + total: '10887', + }, + unitTotals: { + discount: '0', + subtotal: '10000', + tax: '887', + total: '10887', + }, + }, + ], + payoutTotals: null, + taxRatesUsed: [ + { + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '40000', + tax: '3549', + total: '43549', + }, + }, + ], + totals: { + balance: '43549', + credit: '0', + creditToBalance: '0', + currencyCode: 'USD', + discount: '0', + earnings: null, + fee: null, + grandTotal: '43549', + subtotal: '40000', + tax: '3549', + total: '43549', + }, + }, + discountId: null, + id: 'txn_01h8e2svn94ze7bfj0zfh7z6wm', + invoiceId: null, + invoiceNumber: null, + items: [ + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + importMeta: null, + name: 'Monthly (per seat)', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + quantity: { + maximum: 999, + minimum: 10, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '3000', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '5000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 10, + }, + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + importMeta: null, + name: 'Monthly (recurring addon)', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + quantity: { + maximum: 100, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '10000', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '20000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + ], + origin: 'subscription_recurring', + payments: [ + { + amount: '43549', + capturedAt: null, + createdAt: '2023-08-22T07:37:01.90043Z', + errorCode: 'authentication_failed', + methodDetails: { + card: { + cardholderName: 'Jo Williams', + expiryMonth: 1, + expiryYear: 2025, + last4: '3184', + type: 'visa', + }, + type: 'card', + }, + paymentAttemptId: 'b9032892-96e8-4658-a822-c8177c94147e', + status: 'error', + storedPaymentMethodId: '37bb3dd6-aba6-4eb4-8bf0-e1079a3df543', + }, + ], + status: 'past_due', + subscriptionId: 'sub_01h8e1jxhhss1a6agahb2xh9j0', + updatedAt: '2023-08-22T07:37:04.308718968Z', + }, + eventId: 'evt_01h8e2sys80rn6y8xz31mstgt9', + eventType: 'transaction.past_due', + notificationId: 'ntf_01h8e2syvt2n0sk9m8csp27k5q', + occurredAt: '2023-08-22T07:37:04.552638Z', +}; diff --git a/src/__tests__/mocks/notifications/transaction-payment-failed.mock.ts b/src/__tests__/mocks/notifications/transaction-payment-failed.mock.ts new file mode 100644 index 0000000..477119c --- /dev/null +++ b/src/__tests__/mocks/notifications/transaction-payment-failed.mock.ts @@ -0,0 +1,495 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export const TransactionPaymentFailedMock: IEventsResponse = { + event_id: 'evt_01h8e1exw67n96j6n0h3k2qq5x', + event_type: 'transaction.payment_failed', + occurred_at: '2023-08-22T07:13:34.599095Z', + notification_id: 'ntf_01h8e1exynb84v9qs8bam1dp4z', + data: { + id: 'txn_01h8dzxgkvdwemdhbpcapj2tbj', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + status: 'active', + quantity: { maximum: 999, minimum: 10 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3000', currency_code: 'USD' }, + description: 'Monthly (per seat)', + name: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [{ unit_price: { amount: '5000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 10, + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + status: 'active', + quantity: { maximum: 100, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10000', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + name: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [{ unit_price: { amount: '20000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + { + price: { + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { amount: '19900', currency_code: 'USD' }, + description: 'One-time charge', + name: 'One-time charge', + trial_period: null, + billing_cycle: null, + unit_price_overrides: [{ unit_price: { amount: '40000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + ], + origin: 'web', + status: 'ready', + details: { + totals: { + fee: null, + tax: '5315', + total: '65215', + credit: '0', + credit_to_balance: '0', + balance: '65215', + discount: '0', + earnings: null, + subtotal: '59900', + grand_total: '65215', + currency_code: 'USD', + }, + line_items: [ + { + id: 'txnitm_01h8e18cjzkpvj81m223nvag50', + totals: { tax: '2662', total: '32662', discount: '0', subtotal: '30000' }, + product: { + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + name: 'ChatApp Pro', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + quantity: 10, + tax_rate: '0.08875', + unit_totals: { tax: '266', total: '3266', discount: '0', subtotal: '3000' }, + }, + { + id: 'txnitm_01h8e18cjzkpvj81m225yfzsdz', + totals: { tax: '887', total: '10887', discount: '0', subtotal: '10000' }, + product: { + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + name: 'Voice rooms addon', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01h1vjfevh5etwq3rb416a23h2', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '887', total: '10887', discount: '0', subtotal: '10000' }, + }, + { + id: 'txnitm_01h8e18ck0g6b9r0247mdrh34r', + totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Custom domains', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + }, + ], + payout_totals: null, + tax_rates_used: [ + { totals: { tax: '5315', total: '65215', discount: '0', subtotal: '59900' }, tax_rate: '0.08875' }, + ], + adjusted_totals: { + fee: null, + tax: '5315', + total: '65215', + earnings: null, + subtotal: '59900', + grand_total: '65215', + currency_code: 'USD', + }, + adjusted_payout_totals: null, + }, + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01h8dzxgkvdwemdhbpcapj2tbj', + }, + payments: [ + { + amount: '65215', + status: 'error', + created_at: '2023-08-22T07:13:26.837726Z', + error_code: 'declined', + captured_at: null, + method_details: { + card: { type: 'visa', last4: '0000', expiry_year: 2025, expiry_month: 12, cardholder_name: 'Jo Williams' }, + type: 'card', + }, + payment_attempt_id: '3e575fab-e1f2-4168-9ef7-3dd724f450a0', + stored_payment_method_id: '6fd9d503-085a-4af1-a562-f05d7217cdd2', + }, + ], + billed_at: null, + address_id: 'add_01h8e18bzb5av13cd16m5gz214', + created_at: '2023-08-22T06:46:35.440187Z', + invoice_id: null, + updated_at: '2023-08-22T07:10:00.300009Z', + business_id: null, + custom_data: null, + customer_id: 'ctm_01h8e18bxp9hby49dnm8ewf0m0', + discount_id: null, + currency_code: 'USD', + billing_period: null, + invoice_number: null, + billing_details: null, + collection_mode: 'automatic', + subscription_id: null, + }, +}; + +export const TransactionPaymentFailedMockExpectation = { + data: { + addressId: 'add_01h8e18bzb5av13cd16m5gz214', + billedAt: null, + billingDetails: null, + billingPeriod: null, + businessId: null, + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01h8dzxgkvdwemdhbpcapj2tbj', + }, + collectionMode: 'automatic', + createdAt: '2023-08-22T06:46:35.440187Z', + currencyCode: 'USD', + customData: null, + customerId: 'ctm_01h8e18bxp9hby49dnm8ewf0m0', + details: { + adjustedPayoutTotals: null, + adjustedTotals: { + currencyCode: 'USD', + earnings: null, + fee: null, + grandTotal: '65215', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + lineItems: [ + { + id: 'txnitm_01h8e18cjzkpvj81m223nvag50', + priceId: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + importMeta: null, + name: 'ChatApp Pro', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 10, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '30000', + tax: '2662', + total: '32662', + }, + unitTotals: { + discount: '0', + subtotal: '3000', + tax: '266', + total: '3266', + }, + }, + { + id: 'txnitm_01h8e18cjzkpvj81m225yfzsdz', + priceId: 'pri_01h1vjfevh5etwq3rb416a23h2', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + importMeta: null, + name: 'Voice rooms addon', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '10000', + tax: '887', + total: '10887', + }, + unitTotals: { + discount: '0', + subtotal: '10000', + tax: '887', + total: '10887', + }, + }, + { + id: 'txnitm_01h8e18ck0g6b9r0247mdrh34r', + priceId: 'pri_01gsz98e27ak2tyhexptwc58yk', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + importMeta: null, + name: 'Custom domains', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + unitTotals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + }, + ], + payoutTotals: null, + taxRatesUsed: [ + { + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + }, + ], + totals: { + balance: '65215', + credit: '0', + creditToBalance: '0', + currencyCode: 'USD', + discount: '0', + earnings: null, + fee: null, + grandTotal: '65215', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + }, + discountId: null, + id: 'txn_01h8dzxgkvdwemdhbpcapj2tbj', + invoiceId: null, + invoiceNumber: null, + items: [ + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + importMeta: null, + name: 'Monthly (per seat)', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + quantity: { + maximum: 999, + minimum: 10, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '3000', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '5000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 10, + }, + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + importMeta: null, + name: 'Monthly (recurring addon)', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + quantity: { + maximum: 100, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '10000', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '20000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + { + price: { + billingCycle: null, + customData: null, + description: 'One-time charge', + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + importMeta: null, + name: 'One-time charge', + productId: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '19900', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '40000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + ], + origin: 'web', + payments: [ + { + amount: '65215', + capturedAt: null, + createdAt: '2023-08-22T07:13:26.837726Z', + errorCode: 'declined', + methodDetails: { + card: { + cardholderName: 'Jo Williams', + expiryMonth: 12, + expiryYear: 2025, + last4: '0000', + type: 'visa', + }, + type: 'card', + }, + paymentAttemptId: '3e575fab-e1f2-4168-9ef7-3dd724f450a0', + status: 'error', + storedPaymentMethodId: '6fd9d503-085a-4af1-a562-f05d7217cdd2', + }, + ], + status: 'ready', + subscriptionId: null, + updatedAt: '2023-08-22T07:10:00.300009Z', + }, + eventId: 'evt_01h8e1exw67n96j6n0h3k2qq5x', + eventType: 'transaction.payment_failed', + notificationId: 'ntf_01h8e1exynb84v9qs8bam1dp4z', + occurredAt: '2023-08-22T07:13:34.599095Z', +}; diff --git a/src/__tests__/mocks/notifications/transaction-ready.mock.ts b/src/__tests__/mocks/notifications/transaction-ready.mock.ts new file mode 100644 index 0000000..3bee5d6 --- /dev/null +++ b/src/__tests__/mocks/notifications/transaction-ready.mock.ts @@ -0,0 +1,460 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export const TransactionReadyMock: IEventsResponse = { + event_id: 'evt_01h8e18cwy7atj440tjms1k8dk', + event_type: 'transaction.ready', + occurred_at: '2023-08-22T07:10:00.607018Z', + notification_id: 'ntf_01h8e18d03me7xsszayj7n4cqz', + data: { + id: 'txn_01h8dzxgkvdwemdhbpcapj2tbj', + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + status: 'active', + quantity: { maximum: 999, minimum: 10 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { amount: '3000', currency_code: 'USD' }, + description: 'Monthly (per seat)', + name: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [{ unit_price: { amount: '5000', currency_code: 'AUD' }, country_codes: ['AU'] }], + custom_data: null, + }, + quantity: 10, + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + status: 'active', + quantity: { maximum: 100, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { amount: '10000', currency_code: 'USD' }, + description: 'Monthly (recurring addon)', + name: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'month', frequency: 1 }, + unit_price_overrides: [{ unit_price: { amount: '20000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + { + price: { + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { amount: '19900', currency_code: 'USD' }, + description: 'One-time charge', + name: 'One-time charge', + trial_period: null, + billing_cycle: null, + unit_price_overrides: [{ unit_price: { amount: '40000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + ], + origin: 'web', + status: 'ready', + details: { + totals: { + fee: null, + tax: '5315', + total: '65215', + credit: '0', + credit_to_balance: '0', + balance: '65215', + discount: '0', + earnings: null, + subtotal: '59900', + grand_total: '65215', + currency_code: 'USD', + }, + line_items: [ + { + id: 'txnitm_01h8e18cjzkpvj81m223nvag50', + totals: { tax: '2662', total: '32662', discount: '0', subtotal: '30000' }, + product: { + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + name: 'ChatApp Pro', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + quantity: 10, + tax_rate: '0.08875', + unit_totals: { tax: '266', total: '3266', discount: '0', subtotal: '3000' }, + }, + { + id: 'txnitm_01h8e18cjzkpvj81m225yfzsdz', + totals: { tax: '887', total: '10887', discount: '0', subtotal: '10000' }, + product: { + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + name: 'Voice rooms addon', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01h1vjfevh5etwq3rb416a23h2', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '887', total: '10887', discount: '0', subtotal: '10000' }, + }, + { + id: 'txnitm_01h8e18ck0g6b9r0247mdrh34r', + totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Custom domains', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + }, + ], + payout_totals: null, + tax_rates_used: [ + { totals: { tax: '5315', total: '65215', discount: '0', subtotal: '59900' }, tax_rate: '0.08875' }, + ], + adjusted_totals: { + fee: null, + tax: '5315', + total: '65215', + earnings: null, + subtotal: '59900', + grand_total: '65215', + currency_code: 'USD', + }, + adjusted_payout_totals: null, + }, + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01h8dzxgkvdwemdhbpcapj2tbj', + }, + payments: [], + billed_at: null, + address_id: 'add_01h8e18bzb5av13cd16m5gz214', + created_at: '2023-08-22T06:46:35.440187Z', + invoice_id: null, + updated_at: '2023-08-22T07:10:00.300009217Z', + business_id: null, + custom_data: null, + customer_id: 'ctm_01h8e18bxp9hby49dnm8ewf0m0', + discount_id: null, + currency_code: 'USD', + billing_period: null, + invoice_number: null, + billing_details: null, + collection_mode: 'automatic', + subscription_id: null, + }, +}; + +export const TransactionReadyMockExpectation = { + data: { + addressId: 'add_01h8e18bzb5av13cd16m5gz214', + billedAt: null, + billingDetails: null, + billingPeriod: null, + businessId: null, + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01h8dzxgkvdwemdhbpcapj2tbj', + }, + collectionMode: 'automatic', + createdAt: '2023-08-22T06:46:35.440187Z', + currencyCode: 'USD', + customData: null, + customerId: 'ctm_01h8e18bxp9hby49dnm8ewf0m0', + details: { + adjustedPayoutTotals: null, + adjustedTotals: { + currencyCode: 'USD', + earnings: null, + fee: null, + grandTotal: '65215', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + lineItems: [ + { + id: 'txnitm_01h8e18cjzkpvj81m223nvag50', + priceId: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + importMeta: null, + name: 'ChatApp Pro', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 10, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '30000', + tax: '2662', + total: '32662', + }, + unitTotals: { + discount: '0', + subtotal: '3000', + tax: '266', + total: '3266', + }, + }, + { + id: 'txnitm_01h8e18cjzkpvj81m225yfzsdz', + priceId: 'pri_01h1vjfevh5etwq3rb416a23h2', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + importMeta: null, + name: 'Voice rooms addon', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '10000', + tax: '887', + total: '10887', + }, + unitTotals: { + discount: '0', + subtotal: '10000', + tax: '887', + total: '10887', + }, + }, + { + id: 'txnitm_01h8e18ck0g6b9r0247mdrh34r', + priceId: 'pri_01gsz98e27ak2tyhexptwc58yk', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + importMeta: null, + name: 'Custom domains', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + unitTotals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + }, + ], + payoutTotals: null, + taxRatesUsed: [ + { + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + }, + ], + totals: { + balance: '65215', + credit: '0', + creditToBalance: '0', + currencyCode: 'USD', + discount: '0', + earnings: null, + fee: null, + grandTotal: '65215', + subtotal: '59900', + tax: '5315', + total: '65215', + }, + }, + discountId: null, + id: 'txn_01h8dzxgkvdwemdhbpcapj2tbj', + invoiceId: null, + invoiceNumber: null, + items: [ + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (per seat)', + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + importMeta: null, + name: 'Monthly (per seat)', + productId: 'pro_01gsz4t5hdjse780zja8vvr7jg', + quantity: { + maximum: 999, + minimum: 10, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: null, + unitPrice: { + amount: '3000', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '5000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 10, + }, + { + price: { + billingCycle: { + frequency: 1, + interval: 'month', + }, + customData: null, + description: 'Monthly (recurring addon)', + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + importMeta: null, + name: 'Monthly (recurring addon)', + productId: 'pro_01h1vjes1y163xfj1rh1tkfb65', + quantity: { + maximum: 100, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '10000', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '20000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + { + price: { + billingCycle: null, + customData: null, + description: 'One-time charge', + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + importMeta: null, + name: 'One-time charge', + productId: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '19900', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '40000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + ], + origin: 'web', + payments: [], + status: 'ready', + subscriptionId: null, + updatedAt: '2023-08-22T07:10:00.300009217Z', + }, + eventId: 'evt_01h8e18cwy7atj440tjms1k8dk', + eventType: 'transaction.ready', + notificationId: 'ntf_01h8e18d03me7xsszayj7n4cqz', + occurredAt: '2023-08-22T07:10:00.607018Z', +}; diff --git a/src/__tests__/mocks/notifications/transaction-updated.mock.ts b/src/__tests__/mocks/notifications/transaction-updated.mock.ts new file mode 100644 index 0000000..52082bf --- /dev/null +++ b/src/__tests__/mocks/notifications/transaction-updated.mock.ts @@ -0,0 +1,458 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export const TransactionUpdatedMock: IEventsResponse = { + event_id: 'evt_01h8e43a7vf4qxy0waredf267h', + event_type: 'transaction.updated', + occurred_at: '2023-08-22T07:59:39.771451Z', + notification_id: 'ntf_01h8e43aac931gw6d52vhw0bam', + data: { + id: 'txn_01h8e3zqj6ychnn5s5sd2nd5py', + items: [ + { + price: { + id: 'pri_01gsz91wy9k1yn7kx82aafwvea', + status: 'active', + quantity: { maximum: 100, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz4vmqbjk3x4vvtafffd540', + unit_price: { amount: '50000', currency_code: 'USD' }, + description: 'Annual (per seat)', + name: 'Annual (per seat)', + trial_period: null, + billing_cycle: { interval: 'year', frequency: 1 }, + unit_price_overrides: [], + custom_data: null, + }, + quantity: 50, + }, + { + price: { + id: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + unit_price: { amount: '300000', currency_code: 'USD' }, + description: 'Annual (recurring addon)', + name: 'Annual (recurring addon)', + trial_period: null, + billing_cycle: { interval: 'year', frequency: 1 }, + unit_price_overrides: [], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + { + price: { + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + status: 'active', + quantity: { maximum: 1, minimum: 1 }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { amount: '19900', currency_code: 'USD' }, + description: 'One-time charge', + name: 'One-time charge', + trial_period: null, + billing_cycle: null, + unit_price_overrides: [{ unit_price: { amount: '40000', currency_code: 'AUD' }, country_codes: ['AU'] }], + type: 'standard', + custom_data: null, + }, + quantity: 1, + }, + ], + origin: 'api', + status: 'ready', + details: { + totals: { + fee: null, + tax: '250266', + total: '3070166', + credit: '0', + credit_to_balance: '0', + balance: '3070166', + discount: '0', + earnings: null, + subtotal: '2819900', + grand_total: '3070166', + currency_code: 'USD', + }, + line_items: [ + { + id: 'txnitm_01h8e439xwzdpnx3gat6he0krp', + totals: { tax: '221875', total: '2721875', discount: '0', subtotal: '2500000' }, + product: { + id: 'pro_01gsz4vmqbjk3x4vvtafffd540', + name: 'ChatApp Enterprise', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + description: + 'The ultimate solution for businesses that require top-of-the-line features and customizations. Includes all the features of the Pro plan, plus personalized onboarding, dedicated account management, and the ability to pay via invoice.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz91wy9k1yn7kx82aafwvea', + quantity: 50, + tax_rate: '0.08875', + unit_totals: { tax: '4437', total: '54437', discount: '0', subtotal: '50000' }, + }, + { + id: 'txnitm_01h8e439xwzdpnx3gat7mw4kh1', + totals: { tax: '26625', total: '326625', discount: '0', subtotal: '300000' }, + product: { + id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + name: 'VIP support', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + description: + 'Get exclusive access to our expert team of product specialists, available to help you make the most of your ChatApp subscription.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '26625', total: '326625', discount: '0', subtotal: '300000' }, + }, + { + id: 'txnitm_01h8e439xwzdpnx3gatakyaabq', + totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Custom domains', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + tax_category: 'standard', + type: 'standard', + custom_data: null, + created_at: '2023-08-22T07:59:39.771451Z', + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { tax: '1766', total: '21666', discount: '0', subtotal: '19900' }, + }, + ], + payout_totals: null, + tax_rates_used: [ + { totals: { tax: '250266', total: '3070166', discount: '0', subtotal: '2819900' }, tax_rate: '0.08875' }, + ], + adjusted_totals: { + fee: null, + tax: '250266', + total: '3070166', + earnings: null, + subtotal: '2819900', + grand_total: '3070166', + currency_code: 'USD', + }, + adjusted_payout_totals: null, + }, + checkout: { url: null }, + payments: [], + billed_at: null, + address_id: 'add_01h848pep46enq8y372x7maj0p', + created_at: '2023-08-22T07:57:42.866909Z', + invoice_id: 'inv_01h8e3zs2dkmq46xtpn18wvzd9', + updated_at: '2023-08-22T07:59:39.476640535Z', + business_id: null, + custom_data: null, + customer_id: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + discount_id: null, + currency_code: 'USD', + billing_period: { ends_at: '2024-07-31T23:59:00Z', starts_at: '2023-08-01T00:00:00Z' }, + invoice_number: null, + billing_details: { + payment_terms: { interval: 'day', frequency: 14 }, + enable_checkout: false, + purchase_order_number: 'PO-123', + additional_information: null, + }, + collection_mode: 'manual', + subscription_id: null, + }, +}; + +export const TransactionUpdatedMockExpectation = { + data: { + addressId: 'add_01h848pep46enq8y372x7maj0p', + billedAt: null, + billingDetails: { + additionalInformation: null, + enableCheckout: false, + paymentTerms: { + frequency: 14, + interval: 'day', + }, + purchaseOrderNumber: 'PO-123', + }, + billingPeriod: { + endsAt: '2024-07-31T23:59:00Z', + startsAt: '2023-08-01T00:00:00Z', + }, + businessId: null, + checkout: { + url: null, + }, + collectionMode: 'manual', + createdAt: '2023-08-22T07:57:42.866909Z', + currencyCode: 'USD', + customData: null, + customerId: 'ctm_01h8441jn5pcwrfhwh78jqt8hk', + details: { + adjustedPayoutTotals: null, + adjustedTotals: { + currencyCode: 'USD', + earnings: null, + fee: null, + grandTotal: '3070166', + subtotal: '2819900', + tax: '250266', + total: '3070166', + }, + lineItems: [ + { + id: 'txnitm_01h8e439xwzdpnx3gat6he0krp', + priceId: 'pri_01gsz91wy9k1yn7kx82aafwvea', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'The ultimate solution for businesses that require top-of-the-line features and customizations. Includes all the features of the Pro plan, plus personalized onboarding, dedicated account management, and the ability to pay via invoice.', + id: 'pro_01gsz4vmqbjk3x4vvtafffd540', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + importMeta: null, + name: 'ChatApp Enterprise', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 50, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '2500000', + tax: '221875', + total: '2721875', + }, + unitTotals: { + discount: '0', + subtotal: '50000', + tax: '4437', + total: '54437', + }, + }, + { + id: 'txnitm_01h8e439xwzdpnx3gat7mw4kh1', + priceId: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Get exclusive access to our expert team of product specialists, available to help you make the most of your ChatApp subscription.', + id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + importMeta: null, + name: 'VIP support', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '300000', + tax: '26625', + total: '326625', + }, + unitTotals: { + discount: '0', + subtotal: '300000', + tax: '26625', + total: '326625', + }, + }, + { + id: 'txnitm_01h8e439xwzdpnx3gatakyaabq', + priceId: 'pri_01gsz98e27ak2tyhexptwc58yk', + product: { + createdAt: '2023-08-22T07:59:39.771451Z', + customData: null, + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + importMeta: null, + name: 'Custom domains', + status: 'active', + taxCategory: 'standard', + type: 'standard', + }, + proration: null, + quantity: 1, + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + unitTotals: { + discount: '0', + subtotal: '19900', + tax: '1766', + total: '21666', + }, + }, + ], + payoutTotals: null, + taxRatesUsed: [ + { + taxRate: '0.08875', + totals: { + discount: '0', + subtotal: '2819900', + tax: '250266', + total: '3070166', + }, + }, + ], + totals: { + balance: '3070166', + credit: '0', + creditToBalance: '0', + currencyCode: 'USD', + discount: '0', + earnings: null, + fee: null, + grandTotal: '3070166', + subtotal: '2819900', + tax: '250266', + total: '3070166', + }, + }, + discountId: null, + id: 'txn_01h8e3zqj6ychnn5s5sd2nd5py', + invoiceId: 'inv_01h8e3zs2dkmq46xtpn18wvzd9', + invoiceNumber: null, + items: [ + { + price: { + billingCycle: { + frequency: 1, + interval: 'year', + }, + customData: null, + description: 'Annual (per seat)', + id: 'pri_01gsz91wy9k1yn7kx82aafwvea', + importMeta: null, + name: 'Annual (per seat)', + productId: 'pro_01gsz4vmqbjk3x4vvtafffd540', + quantity: { + maximum: 100, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: null, + unitPrice: { + amount: '50000', + currencyCode: 'USD', + }, + unitPriceOverrides: [], + }, + proration: null, + quantity: 50, + }, + { + price: { + billingCycle: { + frequency: 1, + interval: 'year', + }, + customData: null, + description: 'Annual (recurring addon)', + id: 'pri_01gsz96z29d88jrmsf2ztbfgjg', + importMeta: null, + name: 'Annual (recurring addon)', + productId: 'pro_01gsz92krfzy3hcx5h5rtgnfwz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '300000', + currencyCode: 'USD', + }, + unitPriceOverrides: [], + }, + proration: null, + quantity: 1, + }, + { + price: { + billingCycle: null, + customData: null, + description: 'One-time charge', + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + importMeta: null, + name: 'One-time charge', + productId: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + quantity: { + maximum: 1, + minimum: 1, + }, + status: 'active', + taxMode: 'account_setting', + trialPeriod: null, + type: 'standard', + unitPrice: { + amount: '19900', + currencyCode: 'USD', + }, + unitPriceOverrides: [ + { + countryCodes: ['AU'], + unitPrice: { + amount: '40000', + currencyCode: 'AUD', + }, + }, + ], + }, + proration: null, + quantity: 1, + }, + ], + origin: 'api', + payments: [], + status: 'ready', + subscriptionId: null, + updatedAt: '2023-08-22T07:59:39.476640535Z', + }, + eventId: 'evt_01h8e43a7vf4qxy0waredf267h', + eventType: 'transaction.updated', + notificationId: 'ntf_01h8e43aac931gw6d52vhw0bam', + occurredAt: '2023-08-22T07:59:39.771451Z', +}; diff --git a/src/__tests__/mocks/resources/addresses.mock.ts b/src/__tests__/mocks/resources/addresses.mock.ts new file mode 100644 index 0000000..7af3d60 --- /dev/null +++ b/src/__tests__/mocks/resources/addresses.mock.ts @@ -0,0 +1,77 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { IAddressResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; +import { CreateAddressRequestBody, UpdateAddressRequestBody } from '../../../resources'; + +export const CreateAddressMock: CreateAddressRequestBody = { + countryCode: 'AD', +}; + +export const CreateAddressExpectation = { + country_code: 'AD', +}; + +export const UpdateAddressMock: UpdateAddressRequestBody = { + description: 'Paddle.com', + firstLine: '3811 Ditmars Blvd', + secondLine: 'Suite 435', + city: 'Astoria', + postalCode: '11105-1803', + region: 'NY', + countryCode: 'AD', + customData: { customer_reference_id: 'abcd1234' }, + status: 'active', +}; + +export const UpdateAddressExpectation = { + description: 'Paddle.com', + first_line: '3811 Ditmars Blvd', + second_line: 'Suite 435', + city: 'Astoria', + postal_code: '11105-1803', + region: 'NY', + country_code: 'AD', + custom_data: { customer_reference_id: 'abcd1234' }, + status: 'active', +}; + +export const AddressMock: IAddressResponse = { + id: 'add_01gm302t81w94gyjpjpqypkzkf', + description: 'Paddle.com', + first_line: '3811 Ditmars Blvd', + second_line: 'Suite 671', + city: 'Astoria', + postal_code: '11105-1803', + region: 'NY', + country_code: 'AD', + custom_data: { customer_reference_id: 'abcd1234' }, + status: 'active', + created_at: '2024-10-12T07:20:50.52Z', + updated_at: '2024-10-13T07:20:50.52Z', + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, +}; + +export const AddressMockResponse: Response = { + data: AddressMock, + meta: { + request_id: '', + }, +}; + +export const ListAddressMockResponse: ResponsePaginated = { + data: [AddressMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/addresss?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/adjustments.mock.ts b/src/__tests__/mocks/resources/adjustments.mock.ts new file mode 100644 index 0000000..69f5ac6 --- /dev/null +++ b/src/__tests__/mocks/resources/adjustments.mock.ts @@ -0,0 +1,104 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { IAdjustmentResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; +import { CreateAdjustmentRequestBody } from '../../../resources'; + +export const CreateAdjustmentMock: CreateAdjustmentRequestBody = { + action: 'credit', + items: [ + { + itemId: 'txnitm_01gm302t81w94gyjpjpqypkzkf', + type: 'full', + amount: '1000', + }, + ], + reason: 'NO_VALUE', + transactionId: 'txn_01h04vsbhqc62t8hmd4z3b578c', +}; + +export const CreateAdjustmentExpectation = { + action: 'credit', + items: [ + { + item_id: 'txnitm_01gm302t81w94gyjpjpqypkzkf', + type: 'full', + amount: '1000', + }, + ], + reason: 'NO_VALUE', + transaction_id: 'txn_01h04vsbhqc62t8hmd4z3b578c', +}; + +export const AdjustmentMock: IAdjustmentResponse = { + action: 'credit', + items: [ + { + amount: '1000', + id: '1234', + item_id: '1245', + type: 'proration', + totals: { + subtotal: '1000', + tax: '50', + total: '1050', + }, + proration: { + billing_period: { + starts_at: '2024-10-12T07:20:50.52Z', + ends_at: '2024-11-12T07:20:50.52Z', + }, + rate: '10', + }, + }, + ], + created_at: '2024-10-12T07:20:50.52Z', + credit_applied_to_balance: false, + currency_code: 'USD', + customer_id: 'ctm_1234', + id: 'adj_1234', + reason: 'Refund', + status: 'approved', + transaction_id: 'txn_1234', + updated_at: '2024-10-12T07:20:50.52Z', + payout_totals: { + currency_code: 'USD', + earnings: '1', + total: '1', + fee: '1', + subtotal: '1', + tax: '1', + }, + totals: { + currency_code: 'USD', + earnings: '1', + total: '1', + fee: '1', + subtotal: '1', + tax: '1', + }, +}; + +export const AdjustmentMockResponse: Response = { + data: AdjustmentMock, + meta: { + request_id: '', + }, +}; + +export const ListAdjustmentMockResponse: ResponsePaginated = { + data: [AdjustmentMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/adjustments?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/businesses.mock.ts b/src/__tests__/mocks/resources/businesses.mock.ts new file mode 100644 index 0000000..9ff1f2f --- /dev/null +++ b/src/__tests__/mocks/resources/businesses.mock.ts @@ -0,0 +1,59 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { IBusinessResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; + +export const UpdateBusinessMock = { + name: 'Maryjane', + companyNumber: '123456789', + taxIdentifier: 'AB0123456789', + status: 'active', + contacts: [{ name: 'Lindsay', email: 'weloveyourproduct@paddle.com' }], + customData: { customer_reference_id: 'abcd1234' }, +}; + +export const UpdateBusinessExpectation = { + name: 'Maryjane', + company_number: '123456789', + tax_identifier: 'AB0123456789', + status: 'active', + contacts: [{ name: 'Lindsay', email: 'weloveyourproduct@paddle.com' }], + custom_data: { customer_reference_id: 'abcd1234' }, +}; + +export const BusinessMock: IBusinessResponse = { + id: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + name: 'Lyda', + company_number: '123456789', + tax_identifier: 'AB0123456789', + status: 'active', + contacts: [{ name: 'Nettie', email: 'weloveyourproduct@paddle.com' }], + created_at: '2024-10-12T07:20:50.52Z', + updated_at: '2024-10-13T07:20:50.52Z', + custom_data: { customer_reference_id: 'abcd1234' }, + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, +}; + +export const BusinessMockResponse: Response = { + data: BusinessMock, + meta: { + request_id: '', + }, +}; + +export const ListBusinessMockResponse: ResponsePaginated = { + data: [BusinessMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/businesss?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/customers.mock.ts b/src/__tests__/mocks/resources/customers.mock.ts new file mode 100644 index 0000000..afef83f --- /dev/null +++ b/src/__tests__/mocks/resources/customers.mock.ts @@ -0,0 +1,74 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICreditBalanceResponse, ICustomerResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; + +export const UpdateCustomerMock = { + name: 'Casper', + email: 'weloveyourproduct@paddle.com', + status: 'active', + customData: { customer_reference_id: 'abcd1234' }, + locale: 'en', +}; + +export const UpdateCustomerExpectation = { + name: 'Casper', + email: 'weloveyourproduct@paddle.com', + status: 'active', + custom_data: { customer_reference_id: 'abcd1234' }, + locale: 'en', +}; + +export const CustomerMock: ICustomerResponse = { + id: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + name: 'Mackenzie', + email: 'weloveyourproduct@paddle.com', + marketing_consent: true, + status: 'active', + custom_data: { customer_reference_id: 'abcd1234' }, + locale: 'en', + created_at: '2024-10-12T07:20:50.52Z', + updated_at: '2024-10-13T07:20:50.52Z', + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, +}; + +export const CustomerCreditBalanceMock: ICreditBalanceResponse = { + balance: { + available: '200', + reserved: '10', + used: '90', + }, + currency_code: 'USD', + customer_id: 'ctm_1234', +}; + +export const CustomerMockResponse: Response = { + data: CustomerMock, + meta: { + request_id: '', + }, +}; + +export const CustomerCreditBalanceMockResponse: Response = { + data: [CustomerCreditBalanceMock], + meta: { + request_id: '', + }, +}; + +export const ListCustomerMockResponse: ResponsePaginated = { + data: [CustomerMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/customers?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/discounts.mock.ts b/src/__tests__/mocks/resources/discounts.mock.ts new file mode 100644 index 0000000..167f8a9 --- /dev/null +++ b/src/__tests__/mocks/resources/discounts.mock.ts @@ -0,0 +1,94 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { IDiscountResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; +import { CreateDiscountRequestBody, UpdateDiscountRequestBody } from '../../../resources'; + +export const CreateDiscountMock: CreateDiscountRequestBody = { + amount: '1000', + description: 'conspergo nesciunt vilis cumque crastinus capillus tenax venio tepidus natus', + type: 'flat', +}; + +export const UpdateDiscountMock: UpdateDiscountRequestBody = { + status: 'active', + description: 'cogito abbas ter provident argumentum compello nihil et absorbeo valde', + enabledForCheckout: true, + code: 'ABCDEF', + type: 'flat', + amount: '1000', + currencyCode: 'USD', + recur: true, + maximumRecurringIntervals: 10, + usageLimit: 10, + restrictTo: [], + expiresAt: '2024-10-12T07:20:50.52Z', + customData: { customer_reference_id: 'abcd1234' }, +}; + +export const CreateDiscountExpectation = { + amount: '1000', + description: 'conspergo nesciunt vilis cumque crastinus capillus tenax venio tepidus natus', + type: 'flat', +}; + +export const UpdateDiscountExpectation = { + status: 'active', + description: 'cogito abbas ter provident argumentum compello nihil et absorbeo valde', + enabled_for_checkout: true, + code: 'ABCDEF', + type: 'flat', + amount: '1000', + currency_code: 'USD', + recur: true, + maximum_recurring_intervals: 10, + usage_limit: 10, + restrict_to: [], + expires_at: '2024-10-12T07:20:50.52Z', + custom_data: { customer_reference_id: 'abcd1234' }, +}; + +export const DiscountMock: IDiscountResponse = { + id: 'dsc_01gv5kpg05xp104ek2fmgjwttf', + status: 'active', + description: 'sui consuasor deludo ver tendo qui deleo accendo censura vetus', + enabled_for_checkout: true, + code: 'ABCDEF', + type: 'flat', + amount: '1000', + currency_code: 'USD', + recur: true, + maximum_recurring_intervals: 10, + usage_limit: 10, + restrict_to: [], + expires_at: '2024-10-12T07:20:50.52Z', + custom_data: { customer_reference_id: 'abcd1234' }, + times_used: 10, + created_at: '2024-10-12T07:20:50.52Z', + updated_at: '2024-10-13T07:20:50.52Z', + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, +}; + +export const DiscountMockResponse: Response = { + data: DiscountMock, + meta: { + request_id: '', + }, +}; + +export const ListDiscountMockResponse: ResponsePaginated = { + data: [DiscountMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/discounts?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/event-types.mock.ts b/src/__tests__/mocks/resources/event-types.mock.ts new file mode 100644 index 0000000..41f4c7c --- /dev/null +++ b/src/__tests__/mocks/resources/event-types.mock.ts @@ -0,0 +1,208 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { IEventTypeResponse } from '../../../types'; +import { Response } from '../../../internal'; + +export const EventTypesMock: IEventTypeResponse[] = [ + { + name: 'transaction.billed', + description: 'Occurs when a transaction is billed. Its status field changes to billed and billed_at is populated.', + group: 'Transaction', + available_versions: [1], + }, + { + name: 'transaction.canceled', + description: 'Occurs when a transaction is canceled. Its status field changes to canceled.', + group: 'Transaction', + available_versions: [1], + }, + { + name: 'transaction.completed', + description: 'Occurs when a transaction is completed. Its status field changes to completed.', + group: 'Transaction', + available_versions: [1], + }, + { + name: 'transaction.created', + description: 'Occurs when a transaction is created.', + group: 'Transaction', + available_versions: [1], + }, + { + name: 'transaction.past_due', + description: 'Occurs when a transaction becomes past due. Its status field changes to past_due.', + group: 'Transaction', + available_versions: [1], + }, + { + name: 'transaction.payment_failed', + description: + 'Occurs when a payment fails for a transaction. The payments array is updated with details of the payment attempt.', + group: 'Transaction', + available_versions: [1], + }, + { + name: 'transaction.ready', + description: 'Occurs when a transaction is ready to be billed. Its status field changes to ready.', + group: 'Transaction', + available_versions: [1], + }, + { + name: 'transaction.updated', + description: 'Occurs when a transaction is updated.', + group: 'Transaction', + available_versions: [1], + }, + { + name: 'subscription.activated', + description: + 'Occurs when a subscription becomes active. Its status field changes to active. This means any trial period has elapsed and Paddle has successfully billed the customer.', + group: 'Subscription', + available_versions: [1], + }, + { + name: 'subscription.canceled', + description: 'Occurs when a subscription is canceled. Its status field changes to canceled.', + group: 'Subscription', + available_versions: [1], + }, + { + name: 'subscription.created', + description: + 'Occurs when a subscription is created. subscription.trialing or subscription.activated typically follow.', + group: 'Subscription', + available_versions: [1], + }, + { + name: 'subscription.imported', + description: 'Occurs when a subscription is imported.', + group: 'Subscription', + available_versions: [1], + }, + { + name: 'subscription.past_due', + description: 'Occurs when a subscription has an unpaid transaction. Its status changes to past_due.', + group: 'Subscription', + available_versions: [1], + }, + { + name: 'subscription.paused', + description: 'Occurs when a subscription is paused. Its status field changes to paused.', + group: 'Subscription', + available_versions: [1], + }, + { + name: 'subscription.resumed', + description: 'Occurs when a subscription is resumed after being paused. Its status field changes to active.', + group: 'Subscription', + available_versions: [1], + }, + { + name: 'subscription.trialing', + description: 'Occurs when a subscription enters trial period.', + group: 'Subscription', + available_versions: [1], + }, + { + name: 'subscription.updated', + description: 'Occurs when a subscription is updated.', + group: 'Subscription', + available_versions: [1], + }, + { + name: 'product.created', + description: 'Occurs when a product is created.', + group: 'Product', + available_versions: [1], + }, + { + name: 'product.updated', + description: 'Occurs when a product is updated.', + group: 'Product', + available_versions: [1], + }, + { + name: 'price.created', + description: 'Occurs when a price is created.', + group: 'Price', + available_versions: [1], + }, + { + name: 'price.updated', + description: 'Occurs when a price is updated.', + group: 'Price', + available_versions: [1], + }, + { + name: 'discount.created', + description: 'Occurs when a discount is created.', + group: 'Discount', + available_versions: [1], + }, + { + name: 'discount.updated', + description: 'Occurs when a discount is updated.', + group: 'Discount', + available_versions: [1], + }, + { + name: 'customer.created', + description: 'Occurs when a customer is created.', + group: 'Customer', + available_versions: [1], + }, + { + name: 'customer.updated', + description: 'Occurs when a customer is updated.', + group: 'Customer', + available_versions: [1], + }, + { + name: 'address.created', + description: 'Occurs when an address is created.', + group: 'Address', + available_versions: [1], + }, + { + name: 'address.updated', + description: 'Occurs when an address is updated.', + group: 'Address', + available_versions: [1], + }, + { + name: 'business.created', + description: 'Occurs when a business is created.', + group: 'Business', + available_versions: [1], + }, + { + name: 'business.updated', + description: 'Occurs when a business is updated.', + group: 'Business', + available_versions: [1], + }, + { + name: 'adjustment.created', + description: 'Occurs when an adjustment is created.', + group: 'Adjustment', + available_versions: [1], + }, + { + name: 'adjustment.updated', + description: + 'Occurs when an adjustment is updated, the only time an adjustment will be updated is when the status changes from pending to approved or from pending to rejected.', + group: 'Adjustment', + available_versions: [1], + }, +]; + +export const ListEventTypeMockResponse: Response = { + data: EventTypesMock, + meta: { + request_id: '', + }, +}; diff --git a/src/__tests__/mocks/resources/events.mock.ts b/src/__tests__/mocks/resources/events.mock.ts new file mode 100644 index 0000000..ac0d13e --- /dev/null +++ b/src/__tests__/mocks/resources/events.mock.ts @@ -0,0 +1,351 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { IEventsResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; + +export const EventMock: IEventsResponse = { + event_id: 'evt_01hj32ak5egqkzw5hxrf3vjgw3', + event_type: 'transaction.completed', + occurred_at: '2023-12-20T07:34:00.622748Z', + notification_id: 'ntf_1234', + data: { + id: 'txn_01hj327s2cpxh4mprx55p5qwdz', + status: 'completed', + customer_id: 'ctm_01hj3289s46amtzv8vr57xtnxp', + address_id: 'add_01hj3289stgx73kjryne7pwzh7', + business_id: null, + custom_data: null, + currency_code: 'USD', + origin: 'web', + subscription_id: 'sub_01hj32a99syawqhdkkbpxacwgb', + invoice_id: 'inv_01hj32a9cjfk6zf1q81ke0xgex', + invoice_number: '325-10335', + collection_mode: 'automatic', + discount_id: null, + billing_details: null, + billing_period: { + ends_at: '2024-01-20T07:33:49.542313Z', + starts_at: '2023-12-20T07:33:49.542313Z', + }, + items: [ + { + price: { + id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + type: 'standard', + status: 'active', + quantity: { + maximum: 999, + minimum: 1, + }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + unit_price: { + amount: '3000', + currency_code: 'USD', + }, + custom_data: { + features: { + crm: true, + reports: true, + data_retention: false, + }, + suggested_addons: ['pro_01h1vjes1y163xfj1rh1tkfb65', 'pro_01gsz97mq9pa4fkyy0wqenepkz'], + upgrade_description: + "Move from Basic to Pro to take advantage of advanced reporting and a CRM that's right where you're chatting.", + }, + description: 'Monthly (per seat)', + trial_period: null, + billing_cycle: { + interval: 'month', + frequency: 1, + }, + unit_price_overrides: [ + { + unit_price: { + amount: '5000', + currency_code: 'AUD', + }, + country_codes: ['AU'], + }, + ], + }, + price_id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + quantity: 10, + proration: null, + }, + { + price: { + id: 'pri_01h1vjfevh5etwq3rb416a23h2', + type: 'standard', + status: 'active', + quantity: { + maximum: 100, + minimum: 1, + }, + tax_mode: 'account_setting', + product_id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + unit_price: { + amount: '10000', + currency_code: 'USD', + }, + custom_data: null, + description: 'Monthly (recurring addon)', + trial_period: null, + billing_cycle: { + interval: 'month', + frequency: 1, + }, + unit_price_overrides: [ + { + unit_price: { + amount: '20000', + currency_code: 'AUD', + }, + country_codes: ['AU', 'AT', 'BE'], + }, + ], + }, + price_id: 'pri_01h1vjfevh5etwq3rb416a23h2', + quantity: 1, + proration: null, + }, + { + price: { + id: 'pri_01gsz98e27ak2tyhexptwc58yk', + type: 'standard', + status: 'active', + quantity: { + maximum: 1, + minimum: 1, + }, + tax_mode: 'account_setting', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { + amount: '19900', + currency_code: 'USD', + }, + custom_data: null, + description: 'One-time charge', + trial_period: null, + billing_cycle: null, + unit_price_overrides: [ + { + unit_price: { + amount: '40000', + currency_code: 'AUD', + }, + country_codes: ['AU'], + }, + ], + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + proration: null, + }, + ], + details: { + totals: { + fee: '3311', + tax: '5315', + total: '65215', + credit: '0', + balance: '0', + discount: '0', + earnings: '56589', + subtotal: '59900', + grand_total: '65215', + currency_code: 'USD', + credit_to_balance: '0', + }, + line_items: [ + { + id: 'txnitm_01hj328ac2ak7h82bjfzdk992c', + totals: { + tax: '2662', + total: '32662', + discount: '0', + subtotal: '30000', + }, + item_id: null, + product: { + id: 'pro_01gsz4t5hdjse780zja8vvr7jg', + name: 'ChatApp Pro', + type: 'standard', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png', + custom_data: { + features: { + crm: true, + reports: true, + data_retention: false, + }, + suggested_addons: ['pro_01h1vjes1y163xfj1rh1tkfb65', 'pro_01gsz97mq9pa4fkyy0wqenepkz'], + upgrade_description: + "Move from Basic to Pro to take advantage of advanced reporting and a CRM that's right where you're chatting.", + }, + description: + "Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.", + tax_category: 'standard', + }, + price_id: 'pri_01gsz8x8sawmvhz1pv30nge1ke', + quantity: 10, + tax_rate: '0.08875', + unit_totals: { + tax: '266', + total: '3266', + discount: '0', + subtotal: '3000', + }, + }, + { + id: 'txnitm_01hj328ac2ak7h82bjg443x4px', + totals: { + tax: '887', + total: '10887', + discount: '0', + subtotal: '10000', + }, + item_id: null, + product: { + id: 'pro_01h1vjes1y163xfj1rh1tkfb65', + name: 'Voice rooms addon', + type: 'standard', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png', + custom_data: null, + description: + 'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.', + tax_category: 'standard', + }, + price_id: 'pri_01h1vjfevh5etwq3rb416a23h2', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { + tax: '887', + total: '10887', + discount: '0', + subtotal: '10000', + }, + }, + { + id: 'txnitm_01hj328ac2ak7h82bjg8057m5r', + totals: { + tax: '1766', + total: '21666', + discount: '0', + subtotal: '19900', + }, + item_id: null, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Custom domains', + type: 'standard', + status: 'active', + image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png', + custom_data: { + crm_id: 'ABC', + }, + description: + 'Make ChatApp truly your own with custom domains! Custom domains reinforce your brand identity and make it easy for your team to access ChatApp.', + tax_category: 'standard', + }, + price_id: 'pri_01gsz98e27ak2tyhexptwc58yk', + quantity: 1, + tax_rate: '0.08875', + unit_totals: { + tax: '1766', + total: '21666', + discount: '0', + subtotal: '19900', + }, + }, + ], + payout_totals: { + fee: '3311', + tax: '5315', + total: '65215', + credit: '0', + balance: '0', + discount: '0', + earnings: '56589', + fee_rate: '0.05', + subtotal: '59900', + grand_total: '65215', + currency_code: 'USD', + exchange_rate: '1', + credit_to_balance: '0', + }, + tax_rates_used: [ + { + totals: { + tax: '5315', + total: '65215', + discount: '0', + subtotal: '59900', + }, + tax_rate: '0.08875', + }, + ], + adjusted_totals: { + fee: '3311', + tax: '5315', + total: '65215', + earnings: '56589', + subtotal: '59900', + grand_total: '65215', + currency_code: 'USD', + }, + }, + payments: [ + { + amount: '65215', + status: 'captured', + created_at: '2023-12-20T07:33:43.097909Z', + error_code: null, + captured_at: '2023-12-20T07:33:49.542313Z', + method_details: { + card: { + type: 'visa', + last4: '4242', + expiry_year: 2025, + expiry_month: 1, + cardholder_name: 'Michael McGovern', + }, + type: 'card', + }, + payment_attempt_id: 'b01f1321-289d-4932-b4af-6953e4910564', + stored_payment_method_id: 'fea52bf9-57dc-4b06-88e2-ca15387a985a', + }, + ], + checkout: { + url: 'https://magnificent-entremet-7ae0c6.netlify.app/default/overlay?_ptxn=txn_01hj327s2cpxh4mprx55p5qwdz', + }, + created_at: '2023-12-20T07:32:28.436703Z', + updated_at: '2023-12-20T07:33:59.31952849Z', + billed_at: '2023-12-20T07:33:50.110917Z', + }, +}; + +export const EventMockResponse: Response = { + data: EventMock, + meta: { + request_id: '', + }, +}; + +export const ListEventMockResponse: ResponsePaginated = { + data: [EventMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/events?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/notification-settings.mock.ts b/src/__tests__/mocks/resources/notification-settings.mock.ts new file mode 100644 index 0000000..767abdb --- /dev/null +++ b/src/__tests__/mocks/resources/notification-settings.mock.ts @@ -0,0 +1,80 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { INotificationSettingsResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; +import { CreateNotificationSettingsRequestBody, UpdateNotificationSettingsRequestBody } from '../../../resources'; + +export const CreateNotificationSettingsMock: CreateNotificationSettingsRequestBody = { + description: 'considero conscendo tenax centum consuasor vehemens tardus cursus uxor vobis', + destination: 'https://localhost', + subscribedEvents: ['address.updated'], + type: 'email', +}; + +export const UpdateNotificationSettingsMock: UpdateNotificationSettingsRequestBody = { + description: 'absum somnus deripio quasi aer amplus tersus vir advoco defaeco', + destination: 'https://localhost', + active: true, + apiVersion: 10, + includeSensitiveFields: true, + subscribedEvents: ['address.updated'], +}; + +export const CreateNotificationSettingsExpectation = { + description: 'considero conscendo tenax centum consuasor vehemens tardus cursus uxor vobis', + destination: 'https://localhost', + subscribed_events: ['address.updated'], + type: 'email', +}; + +export const UpdateNotificationSettingsExpectation = { + description: 'absum somnus deripio quasi aer amplus tersus vir advoco defaeco', + destination: 'https://localhost', + active: true, + api_version: 10, + include_sensitive_fields: true, + subscribed_events: ['address.updated'], +}; + +export const NotificationSettingsMock: INotificationSettingsResponse = { + id: '', + endpoint_secret_key: '', + type: 'url', + description: 'absum somnus deripio quasi aer amplus tersus vir advoco defaeco', + destination: 'https://localhost', + active: true, + api_version: 10, + include_sensitive_fields: true, + subscribed_events: [ + { + available_versions: [1], + description: 'Address updated', + group: 'address', + name: 'address.updated', + }, + ], +}; + +export const NotificationSettingsMockResponse: Response = { + data: NotificationSettingsMock, + meta: { + request_id: '', + }, +}; + +export const ListNotificationSettingsMockResponse: ResponsePaginated = { + data: [NotificationSettingsMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/notifications-settings?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/notifications.mock.ts b/src/__tests__/mocks/resources/notifications.mock.ts new file mode 100644 index 0000000..a6d3857 --- /dev/null +++ b/src/__tests__/mocks/resources/notifications.mock.ts @@ -0,0 +1,102 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type INotificationLogResponse, INotificationResponse, type IReplayNotificationResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; +import { EventName } from '../../../notifications'; + +export const NotificationMock: INotificationResponse = { + id: 'ntf_01ghbkd0frb9k95cnhwd1bxpvk', + type: 'address.updated', + status: 'not_attempted', + payload: { + event_id: 'evt_01gks14ge726w50ch2tmaw2a1x', + event_type: EventName.AddressUpdated, + occurred_at: '2024-10-12T07:20:50.52Z', + data: { + country_code: 'AD', + created_at: '', + id: '', + status: 'active', + updated_at: '', + }, + notification_id: 'ntf_01ghbkd0frb9k95cnhwd1bxpvk', + }, + occurred_at: '2024-10-12T07:20:50.52Z', + delivered_at: '2024-10-12T07:20:50.52Z', + replayed_at: '2024-10-12T07:20:50.52Z', + origin: 'event', + last_attempt_at: '2024-10-12T07:20:50.52Z', + retry_at: '2024-10-12T07:20:50.52Z', + times_attempted: 10, + notification_setting_id: 'ntfset_01gt21c5pdx9q1e4mh1xrsjjn6', +}; + +export const NotificationReplayMockResponse: Response = { + data: { + notification_id: 'ntf_1234', + }, + meta: { + request_id: '', + }, +}; + +export const NotificationMockResponse: Response = { + data: NotificationMock, + meta: { + request_id: '', + }, +}; + +export const NotificationLogMockResponse: INotificationLogResponse[] = [ + { + id: 'ntflog_01h8c0bswct46cwamynrzs6fwr', + response_code: 200, + response_content_type: 'text/plain; charset=UTF-8', + response_body: '', + attempted_at: '2023-08-21T12:15:54.764232Z', + }, + { + id: 'ntflog_01h8c04xjj1ybcgsawp54h5zkr', + response_code: 404, + response_content_type: 'application/json', + response_body: '{"success":false,"error":{"message":"Token not found","id":null}}', + attempted_at: '2023-08-21T12:12:09.170559Z', + }, + { + id: 'ntflog_01h8bzyx2g57ywng4edfnpycya', + response_code: 404, + response_content_type: 'application/json', + response_body: '{"success":false,"error":{"message":"Token not found","id":null}}', + attempted_at: '2023-08-21T12:08:52.049462Z', + }, +]; + +export const ListNotificationMockResponse: ResponsePaginated = { + data: [NotificationMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/notifications?after=1', + per_page: 10, + }, + }, +}; + +export const ListNotificationLogsMockResponse: ResponsePaginated = { + data: NotificationLogMockResponse, + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/notifications/ntf_1234/logs?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/prices.mock.ts b/src/__tests__/mocks/resources/prices.mock.ts new file mode 100644 index 0000000..c70f28f --- /dev/null +++ b/src/__tests__/mocks/resources/prices.mock.ts @@ -0,0 +1,101 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { IPriceResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; +import { CreatePriceRequestBody, UpdatePriceRequestBody } from '../../../resources'; + +export const CreatePriceMock: CreatePriceRequestBody = { + description: 'calculus acsi explicabo spargo vergo cur defluo laboriosam curvo aqua', + productId: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unitPrice: { amount: '1000', currencyCode: 'USD' }, +}; + +export const UpdatePriceMock: UpdatePriceRequestBody = { + description: 'vigor avaritia tergo thesaurus sumptus volo thorax combibo aliquam stultus', + type: 'custom', + name: 'Joshua', + billingCycle: { interval: 'day', frequency: 10 }, + trialPeriod: { interval: 'day', frequency: 10 }, + taxMode: 'account_setting', + unitPrice: { amount: '1000', currencyCode: 'USD' }, + unitPriceOverrides: [ + { + countryCodes: ['GB'], + unitPrice: { amount: '1000', currencyCode: 'USD' }, + }, + ], + quantity: { minimum: 1, maximum: 100 }, + status: 'active', + customData: { customer_reference_id: 'abcd1234' }, +}; + +export const CreatePriceExpectation = { + description: 'calculus acsi explicabo spargo vergo cur defluo laboriosam curvo aqua', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + unit_price: { amount: '1000', currency_code: 'USD' }, +}; + +export const UpdatePriceExpectation = { + description: 'vigor avaritia tergo thesaurus sumptus volo thorax combibo aliquam stultus', + type: 'custom', + name: 'Joshua', + billing_cycle: { interval: 'day', frequency: 10 }, + trial_period: { interval: 'day', frequency: 10 }, + tax_mode: 'account_setting', + unit_price: { amount: '1000', currency_code: 'USD' }, + unit_price_overrides: [ + { + country_codes: ['GB'], + unit_price: { amount: '1000', currency_code: 'USD' }, + }, + ], + quantity: { minimum: 1, maximum: 100 }, + status: 'active', + custom_data: { customer_reference_id: 'abcd1234' }, +}; + +export const PriceMock: IPriceResponse = { + id: 'pri_01gsz8z1q1n00f12qt82y31smh', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + description: 'utor uredo varius tricesimus ago tricesimus adflicto certe assentator adulatio', + type: 'custom', + name: 'Shad', + billing_cycle: { interval: 'day', frequency: 10 }, + trial_period: { interval: 'day', frequency: 10 }, + tax_mode: 'account_setting', + unit_price: { amount: '1000', currency_code: 'USD' }, + unit_price_overrides: [ + { + country_codes: ['GB'], + unit_price: { amount: '1000', currency_code: 'USD' }, + }, + ], + quantity: { minimum: 1, maximum: 100 }, + status: 'active', + custom_data: { customer_reference_id: 'abcd1234' }, + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, +}; + +export const PriceMockResponse: Response = { + data: PriceMock, + meta: { + request_id: '', + }, +}; + +export const ListPriceMockResponse: ResponsePaginated = { + data: [PriceMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/prices?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/pricing-preview.mock.ts b/src/__tests__/mocks/resources/pricing-preview.mock.ts new file mode 100644 index 0000000..1350a61 --- /dev/null +++ b/src/__tests__/mocks/resources/pricing-preview.mock.ts @@ -0,0 +1,130 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { IPricingPreviewResponse } from '../../../types'; +import { Response } from '../../../internal'; +import { PricingPreviewRequestBody } from '../../../resources'; + +export const PricingPreviewRequest: PricingPreviewRequestBody = { + currencyCode: 'USD', + items: [ + { + priceId: 'pri_1234', + quantity: 1, + }, + ], +}; +export const PricingPreviewMock: IPricingPreviewResponse = { + available_payment_method: 'apple_pay', + currency_code: 'USD', + address: { + country_code: 'US', + postal_code: 'CODE', + }, + details: { + line_items: [ + { + discounts: [ + { + discount: { + id: 'dsc_01gv5kpg05xp104ek2fmgjwttf', + status: 'active', + description: 'sui consuasor deludo ver tendo qui deleo accendo censura vetus', + enabled_for_checkout: true, + code: 'ABCDEF', + type: 'flat', + amount: '1000', + currency_code: 'USD', + recur: true, + maximum_recurring_intervals: 10, + usage_limit: 10, + restrict_to: [], + expires_at: '2024-10-12T07:20:50.52Z', + custom_data: { customer_reference_id: 'abcd1234' }, + times_used: 10, + created_at: '2024-10-12T07:20:50.52Z', + updated_at: '2024-10-13T07:20:50.52Z', + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, + }, + formatted_total: '$100', + total: '10000', + }, + ], + price: { + id: 'pri_01gsz8z1q1n00f12qt82y31smh', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + description: 'utor uredo varius tricesimus ago tricesimus adflicto certe assentator adulatio', + type: 'custom', + name: 'Shad', + billing_cycle: { interval: 'day', frequency: 10 }, + trial_period: { interval: 'day', frequency: 10 }, + tax_mode: 'account_setting', + unit_price: { amount: '1000', currency_code: 'USD' }, + unit_price_overrides: [ + { + country_codes: ['GB'], + unit_price: { amount: '1000', currency_code: 'USD' }, + }, + ], + quantity: { minimum: 1, maximum: 100 }, + status: 'active', + custom_data: { customer_reference_id: 'abcd1234' }, + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, + }, + formatted_totals: { + discount: '£0', + total: '£100', + tax: '£10', + subtotal: '£90', + }, + formatted_unit_totals: { + discount: '£0', + total: '£100', + tax: '£10', + subtotal: '£90', + }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Ezekiel', + description: 'spargo crux videlicet fugit tyrannus curatio coma stillicidium esse bardus', + type: 'custom', + tax_category: 'digital-goods', + image_url: 'https://loremflickr.com/640/480?lock=7909378724200448', + custom_data: { customer_reference_id: 'abcd1234' }, + status: 'active', + created_at: '2024-10-12T07:20:50.52Z', + }, + quantity: 10, + tax_rate: '10', + totals: { + discount: '£0', + total: '£100', + tax: '£10', + subtotal: '£90', + }, + unit_totals: { + discount: '£0', + total: '£100', + tax: '£10', + subtotal: '£90', + }, + }, + ], + }, + items: [ + { + price_id: 'pri_1234', + quantity: 1, + }, + ], +}; + +export const PricingPreviewMockResponse: Response = { + data: PricingPreviewMock, + meta: { + request_id: '', + }, +}; diff --git a/src/__tests__/mocks/resources/products.mock.ts b/src/__tests__/mocks/resources/products.mock.ts new file mode 100644 index 0000000..9d217d0 --- /dev/null +++ b/src/__tests__/mocks/resources/products.mock.ts @@ -0,0 +1,72 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { IProductResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; +import { CreateProductRequestBody, UpdateProductRequestBody } from '../../../resources'; + +export const CreateProductMock: CreateProductRequestBody = { + name: 'Hayley', + taxCategory: 'digital-goods', +}; + +export const UpdateProductMock: UpdateProductRequestBody = { + name: 'Zion', + description: 'suppellex vicissitudo a antiquus cognatus xiphias arca canto aliquam crux', + type: 'custom', + taxCategory: 'digital-goods', + imageUrl: 'https://loremflickr.com/640/480?lock=3493989330190336', + customData: { customer_reference_id: 'abcd1234' }, + status: 'active', +}; + +export const CreateProductExpectation = { + name: 'Hayley', + tax_category: 'digital-goods', +}; + +export const UpdateProductExpectation = { + name: 'Zion', + description: 'suppellex vicissitudo a antiquus cognatus xiphias arca canto aliquam crux', + type: 'custom', + tax_category: 'digital-goods', + image_url: 'https://loremflickr.com/640/480?lock=3493989330190336', + custom_data: { customer_reference_id: 'abcd1234' }, + status: 'active', +}; + +export const ProductMock: IProductResponse = { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Ezekiel', + description: 'spargo crux videlicet fugit tyrannus curatio coma stillicidium esse bardus', + type: 'custom', + tax_category: 'digital-goods', + image_url: 'https://loremflickr.com/640/480?lock=7909378724200448', + custom_data: { customer_reference_id: 'abcd1234' }, + status: 'active', + created_at: '2024-10-12T07:20:50.52Z', + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, +}; + +export const ProductMockResponse: Response = { + data: ProductMock, + meta: { + request_id: '', + }, +}; + +export const ListProductMockResponse: ResponsePaginated = { + data: [ProductMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/products?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/reports.mock.ts b/src/__tests__/mocks/resources/reports.mock.ts new file mode 100644 index 0000000..d6c5f3d --- /dev/null +++ b/src/__tests__/mocks/resources/reports.mock.ts @@ -0,0 +1,49 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IReportCsvResponse, IReportResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; + +export const ReportMock: IReportResponse = { + id: 'add_01gm302t81w94gyjpjpqypkzkf', + status: 'pending', + rows: 10, + type: 'transactions', + filters: [{ name: 'updated_at', operator: 'lt', value: '2024-10-13T07:20:50.52Z' }], + expires_at: '2019-10-12T07:20:50.52Z', + created_at: '2024-10-12T07:20:50.52Z', +}; + +export const ReportCsvMock: IReportCsvResponse = { + url: 'https://localhost', +}; + +export const ReportMockResponse: Response = { + data: ReportMock, + meta: { + request_id: '', + }, +}; + +export const ReportCsvMockResponse: Response = { + data: ReportCsvMock, + meta: { + request_id: '', + }, +}; + +export const ListReportMockResponse: ResponsePaginated = { + data: [ReportMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/reports?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/subscriptions.mock.ts b/src/__tests__/mocks/resources/subscriptions.mock.ts new file mode 100644 index 0000000..63a78c5 --- /dev/null +++ b/src/__tests__/mocks/resources/subscriptions.mock.ts @@ -0,0 +1,482 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionPreviewResponse, ISubscriptionResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; +import { CreateSubscriptionCharge, UpdateSubscriptionRequestBody } from '../../../resources'; + +export const CreateSubscriptionMock: CreateSubscriptionCharge = { + effectiveFrom: 'next_billing_period', + items: [ + { + priceId: 'pri_01gsz8z1q1n00f12qt82y31smh', + quantity: 5, + }, + ], +}; + +export const UpdateSubscriptionMock: UpdateSubscriptionRequestBody = { + customerId: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + addressId: 'add_01gm302t81w94gyjpjpqypkzkf', + businessId: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + currencyCode: 'USD', + nextBilledAt: '2024-10-12T07:20:50.52Z', + discount: { id: 'dsc_01gv5kpg05xp104ek2fmgjwttf', effectiveFrom: 'next_billing_period' }, + collectionMode: 'automatic', + billingDetails: { + enableCheckout: true, + purchaseOrderNumber: 'NO_VALUE', + additionalInformation: 'NO_VALUE', + paymentTerms: { interval: 'day', frequency: 10 }, + }, + scheduledChange: { + action: 'cancel', + effectiveAt: '', + }, + items: [{ priceId: 'pri_01gsz8z1q1n00f12qt82y31smh', quantity: 10 }], + customData: { customer_reference_id: 'abcd1234' }, + prorationBillingMode: 'prorated_immediately', + onPaymentFailure: 'prevent_change', +}; + +export const CreateSubscriptionExpectation = { + effective_from: 'next_billing_period', + items: [ + { + price_id: 'pri_01gsz8z1q1n00f12qt82y31smh', + quantity: 5, + }, + ], +}; + +export const UpdateSubscriptionExpectation = { + customer_id: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + address_id: 'add_01gm302t81w94gyjpjpqypkzkf', + business_id: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + currency_code: 'USD', + next_billed_at: '2024-10-12T07:20:50.52Z', + discount: { id: 'dsc_01gv5kpg05xp104ek2fmgjwttf', effective_from: 'next_billing_period' }, + collection_mode: 'automatic', + billing_details: { + enable_checkout: true, + purchase_order_number: 'NO_VALUE', + additional_information: 'NO_VALUE', + payment_terms: { interval: 'day', frequency: 10 }, + }, + scheduled_change: { + action: 'cancel', + effective_at: '', + }, + items: [{ price_id: 'pri_01gsz8z1q1n00f12qt82y31smh', quantity: 10 }], + custom_data: { customer_reference_id: 'abcd1234' }, + proration_billing_mode: 'prorated_immediately', + on_payment_failure: 'prevent_change', +}; + +export const SubscriptionMock: ISubscriptionResponse = { + id: 'sub_01h04vsc0qhwtsbsxh3422wjs4', + status: 'active', + customer_id: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + address_id: 'add_01gm302t81w94gyjpjpqypkzkf', + business_id: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + currency_code: 'USD', + created_at: '2024-10-12T07:20:50.52Z', + updated_at: '2024-10-13T07:20:50.52Z', + started_at: '2024-10-12T07:20:50.52Z', + first_billed_at: '2024-10-12T07:20:50.52Z', + next_billed_at: '2024-10-12T07:20:50.52Z', + paused_at: '2024-10-12T07:20:50.52Z', + canceled_at: '2024-10-12T07:20:50.52Z', + discount: { + id: 'dsc_01gv5kpg05xp104ek2fmgjwttf', + starts_at: '2024-10-12T07:20:50.52Z', + ends_at: '2024-10-12T07:20:50.52Z', + }, + collection_mode: 'automatic', + billing_details: { + enable_checkout: true, + purchase_order_number: 'NO_VALUE', + additional_information: 'NO_VALUE', + payment_terms: { interval: 'day', frequency: 10 }, + }, + current_billing_period: { starts_at: '2024-10-12T07:20:50.52Z', ends_at: '2024-10-12T07:20:50.52Z' }, + billing_cycle: { interval: 'day', frequency: 10 }, + scheduled_change: { action: 'cancel', effective_at: '2024-10-12T07:20:50.52Z', resume_at: '2024-10-12T07:20:50.52Z' }, + management_urls: { + update_payment_method: + 'https://buyer-portal.paddle.com/subscriptions/sub_01gtewvbsyeqyhtp2vtc2mctq8/update-payment-method?token=', + cancel: 'https://buyer-portal.paddle.com/subscriptions/sub_01gtewvbsyeqyhtp2vtc2mctq8/cancel?token=', + }, + items: [ + { + status: 'active', + quantity: 10, + recurring: true, + created_at: '2024-10-12T07:20:50.52Z', + updated_at: '2024-10-13T07:20:50.52Z', + previously_billed_at: '2024-10-12T07:20:50.52Z', + next_billed_at: '2024-10-12T07:20:50.52Z', + trial_dates: { starts_at: '2024-10-12T07:20:50.52Z', ends_at: '2024-10-12T07:20:50.52Z' }, + price: { + id: 'pri_01gsz8z1q1n00f12qt82y31smh', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + description: 'utor uredo varius tricesimus ago tricesimus adflicto certe assentator adulatio', + billing_cycle: { interval: 'day', frequency: 10 }, + trial_period: { interval: 'day', frequency: 10 }, + tax_mode: 'account_setting', + unit_price: { amount: '1000', currency_code: 'USD' }, + }, + }, + ], + custom_data: { customer_reference_id: 'abcd1234' }, + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, + next_transaction: { + adjustments: [ + { + items: [ + { + amount: '1000', + id: 'adj_1234', + item_id: '1234', + proration: { + billing_period: { + starts_at: '2024-10-12T07:20:50.52Z', + ends_at: '2024-11-12T07:20:50.52Z', + }, + rate: '10', + }, + totals: { + subtotal: '100', + total: '150', + tax: '50', + }, + type: 'full', + }, + ], + totals: { + currency_code: 'USD', + earnings: '1000', + tax: '100', + total: '100000', + fee: '200', + subtotal: '500', + }, + transaction_id: 'txn_1234', + }, + ], + billing_period: { + starts_at: '2024-10-12T07:20:50.52Z', + ends_at: '2024-11-12T07:20:50.52Z', + }, + details: { + totals: { + balance: '1000', + total: '1000', + grand_total: '1000', + tax: '1000', + currency_code: 'USD', + credit: '1000', + fee: '1000', + discount: '1000', + credit_to_balance: '1000', + earnings: '1000', + subtotal: '1000', + }, + tax_rates_used: [ + { + tax_rate: '1000', + totals: { + subtotal: '900', + tax: '100', + total: '1000', + discount: '10', + }, + }, + ], + line_items: [ + { + price_id: 'pri_1234', + quantity: 10, + totals: { + subtotal: '900', + tax: '100', + total: '1000', + discount: '10', + }, + tax_rate: '10', + unit_totals: { + subtotal: '900', + tax: '100', + total: '1000', + discount: '10', + }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Ezekiel', + description: 'spargo crux videlicet fugit tyrannus curatio coma stillicidium esse bardus', + type: 'custom', + tax_category: 'digital-goods', + image_url: 'https://loremflickr.com/640/480?lock=7909378724200448', + custom_data: { customer_reference_id: 'abcd1234' }, + status: 'active', + created_at: '2024-10-12T07:20:50.52Z', + }, + }, + ], + }, + }, + recurring_transaction_details: { + totals: { + balance: '1000', + total: '1000', + grand_total: '1000', + tax: '1000', + currency_code: 'USD', + credit: '1000', + fee: '1000', + discount: '1000', + credit_to_balance: '1000', + earnings: '1000', + subtotal: '1000', + }, + tax_rates_used: [ + { + tax_rate: '1000', + totals: { + subtotal: '900', + tax: '100', + total: '1000', + discount: '10', + }, + }, + ], + line_items: [ + { + price_id: 'pri_1234', + quantity: 10, + totals: { + subtotal: '900', + tax: '100', + total: '1000', + discount: '10', + }, + tax_rate: '10', + unit_totals: { + subtotal: '900', + tax: '100', + total: '1000', + discount: '10', + }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Ezekiel', + description: 'spargo crux videlicet fugit tyrannus curatio coma stillicidium esse bardus', + type: 'custom', + tax_category: 'digital-goods', + image_url: 'https://loremflickr.com/640/480?lock=7909378724200448', + custom_data: { customer_reference_id: 'abcd1234' }, + status: 'active', + created_at: '2024-10-12T07:20:50.52Z', + }, + }, + ], + }, +}; + +export const SubscriptionPreviewMock: ISubscriptionPreviewResponse = { + status: 'active', + customer_id: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + address_id: 'add_01gm302t81w94gyjpjpqypkzkf', + business_id: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + currency_code: 'USD', + created_at: '2024-10-12T07:20:50.52Z', + updated_at: '2024-10-13T07:20:50.52Z', + started_at: '2024-10-12T07:20:50.52Z', + first_billed_at: '2024-10-12T07:20:50.52Z', + next_billed_at: '2024-10-12T07:20:50.52Z', + paused_at: '2024-10-12T07:20:50.52Z', + canceled_at: '2024-10-12T07:20:50.52Z', + discount: { + id: 'dsc_01gv5kpg05xp104ek2fmgjwttf', + starts_at: '2024-10-12T07:20:50.52Z', + ends_at: '2024-10-12T07:20:50.52Z', + }, + collection_mode: 'automatic', + billing_details: { + enable_checkout: true, + purchase_order_number: 'NO_VALUE', + additional_information: 'NO_VALUE', + payment_terms: { interval: 'day', frequency: 10 }, + }, + current_billing_period: { starts_at: '2024-10-12T07:20:50.52Z', ends_at: '2024-10-12T07:20:50.52Z' }, + billing_cycle: { interval: 'day', frequency: 10 }, + scheduled_change: { action: 'cancel', effective_at: '2024-10-12T07:20:50.52Z', resume_at: '2024-10-12T07:20:50.52Z' }, + management_urls: { + update_payment_method: + 'https://buyer-portal.paddle.com/subscriptions/sub_01gtewvbsyeqyhtp2vtc2mctq8/update-payment-method?token=', + cancel: 'https://buyer-portal.paddle.com/subscriptions/sub_01gtewvbsyeqyhtp2vtc2mctq8/cancel?token=', + }, + items: [ + { + status: 'active', + quantity: 10, + recurring: true, + created_at: '2024-10-12T07:20:50.52Z', + updated_at: '2024-10-13T07:20:50.52Z', + previously_billed_at: '2024-10-12T07:20:50.52Z', + next_billed_at: '2024-10-12T07:20:50.52Z', + trial_dates: { starts_at: '2024-10-12T07:20:50.52Z', ends_at: '2024-10-12T07:20:50.52Z' }, + price: { + id: 'pri_01gsz8z1q1n00f12qt82y31smh', + product_id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + description: 'utor uredo varius tricesimus ago tricesimus adflicto certe assentator adulatio', + billing_cycle: { interval: 'day', frequency: 10 }, + trial_period: { interval: 'day', frequency: 10 }, + tax_mode: 'account_setting', + unit_price: { amount: '1000', currency_code: 'USD' }, + }, + }, + ], + custom_data: { customer_reference_id: 'abcd1234' }, + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, + immediate_transaction: { + adjustments: [ + { + items: [ + { + amount: '1000', + id: 'adj_1234', + item_id: '1234', + proration: { + billing_period: { + starts_at: '2024-10-12T07:20:50.52Z', + ends_at: '2024-11-12T07:20:50.52Z', + }, + rate: '10', + }, + totals: { + subtotal: '100', + total: '150', + tax: '50', + }, + type: 'full', + }, + ], + totals: { + currency_code: 'USD', + earnings: '1000', + tax: '100', + total: '100000', + fee: '200', + subtotal: '500', + }, + transaction_id: 'txn_1234', + }, + ], + billing_period: { + starts_at: '2024-10-12T07:20:50.52Z', + ends_at: '2024-11-12T07:20:50.52Z', + }, + details: { + totals: { + balance: '1000', + total: '1000', + grand_total: '1000', + tax: '1000', + currency_code: 'USD', + credit: '1000', + fee: '1000', + discount: '1000', + credit_to_balance: '1000', + earnings: '1000', + subtotal: '1000', + }, + tax_rates_used: [ + { + tax_rate: '1000', + totals: { + subtotal: '900', + tax: '100', + total: '1000', + discount: '10', + }, + }, + ], + line_items: [ + { + price_id: 'pri_1234', + quantity: 10, + totals: { + subtotal: '900', + tax: '100', + total: '1000', + discount: '10', + }, + tax_rate: '10', + unit_totals: { + subtotal: '900', + tax: '100', + total: '1000', + discount: '10', + }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Ezekiel', + description: 'spargo crux videlicet fugit tyrannus curatio coma stillicidium esse bardus', + type: 'custom', + tax_category: 'digital-goods', + image_url: 'https://loremflickr.com/640/480?lock=7909378724200448', + custom_data: { customer_reference_id: 'abcd1234' }, + status: 'active', + created_at: '2024-10-12T07:20:50.52Z', + }, + }, + ], + }, + }, + update_summary: { + charge: { + amount: '1000', + currency_code: 'USD', + }, + credit: { + amount: '0', + currency_code: 'USD', + }, + result: { + action: 'credit', + amount: '1000', + currency_code: 'USD', + }, + }, +}; + +export const SubscriptionMockResponse: Response = { + data: SubscriptionMock, + meta: { + request_id: '', + }, +}; + +export const SubscriptionPreviewMockResponse: Response = { + data: SubscriptionPreviewMock, + meta: { + request_id: '', + }, +}; + +export const ListSubscriptionMockResponse: ResponsePaginated = { + data: [SubscriptionMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/subscriptions?after=1', + per_page: 10, + }, + }, +}; diff --git a/src/__tests__/mocks/resources/transactions.mock.ts b/src/__tests__/mocks/resources/transactions.mock.ts new file mode 100644 index 0000000..156ef57 --- /dev/null +++ b/src/__tests__/mocks/resources/transactions.mock.ts @@ -0,0 +1,429 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { ITransactionPreviewResponse, ITransactionResponse } from '../../../types'; +import { Response, ResponsePaginated } from '../../../internal'; +import { + CreateTransactionRequestBody, + TransactionPreviewRequestBody, + UpdateTransactionRequestBody, +} from '../../../resources'; + +export const CreateTransactionMock: CreateTransactionRequestBody = { + status: 'draft', + customerId: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + addressId: 'add_01gm302t81w94gyjpjpqypkzkf', + businessId: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + customData: { customer_reference_id: 'abcd1234' }, + currencyCode: 'USD', + collectionMode: 'automatic', + discountId: 'dsc_01gv5kpg05xp104ek2fmgjwttf', + billingDetails: { + enableCheckout: true, + purchaseOrderNumber: 'NO_VALUE', + additionalInformation: 'NO_VALUE', + paymentTerms: { interval: 'day', frequency: 10 }, + }, + billingPeriod: { startsAt: '2024-10-12T07:20:50.52Z', endsAt: '2024-10-12T07:20:50.52Z' }, + items: [ + { + quantity: 10, + priceId: 'pri_01gsz8z1q1n00f12qt82y31smh', + }, + ], + checkout: { url: 'NO_VALUE' }, +}; + +export const UpdateTransactionMock: UpdateTransactionRequestBody = { + status: 'draft', + customerId: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + addressId: 'add_01gm302t81w94gyjpjpqypkzkf', + businessId: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + customData: { customer_reference_id: 'abcd1234' }, + currencyCode: 'USD', + collectionMode: 'automatic', + discountId: 'dsc_01gv5kpg05xp104ek2fmgjwttf', + billingDetails: { + enableCheckout: true, + purchaseOrderNumber: 'NO_VALUE', + additionalInformation: 'NO_VALUE', + paymentTerms: { interval: 'day', frequency: 10 }, + }, + billingPeriod: { startsAt: '2024-10-12T07:20:50.52Z', endsAt: '2024-10-12T07:20:50.52Z' }, + items: [ + { + quantity: 10, + priceId: 'pri_01gsz8z1q1n00f12qt82y31smh', + }, + ], + checkout: { url: 'NO_VALUE' }, +}; + +export const CreateTransactionExpectation = { + status: 'draft', + customer_id: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + address_id: 'add_01gm302t81w94gyjpjpqypkzkf', + business_id: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + custom_data: { customer_reference_id: 'abcd1234' }, + currency_code: 'USD', + collection_mode: 'automatic', + discount_id: 'dsc_01gv5kpg05xp104ek2fmgjwttf', + billing_details: { + enable_checkout: true, + purchase_order_number: 'NO_VALUE', + additional_information: 'NO_VALUE', + payment_terms: { interval: 'day', frequency: 10 }, + }, + billing_period: { starts_at: '2024-10-12T07:20:50.52Z', ends_at: '2024-10-12T07:20:50.52Z' }, + items: [ + { + quantity: 10, + price_id: 'pri_01gsz8z1q1n00f12qt82y31smh', + }, + ], + checkout: { url: 'NO_VALUE' }, +}; + +export const UpdateTransactionExpectation = { + status: 'draft', + customer_id: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + address_id: 'add_01gm302t81w94gyjpjpqypkzkf', + business_id: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + custom_data: { customer_reference_id: 'abcd1234' }, + currency_code: 'USD', + collection_mode: 'automatic', + discount_id: 'dsc_01gv5kpg05xp104ek2fmgjwttf', + billing_details: { + enable_checkout: true, + purchase_order_number: 'NO_VALUE', + additional_information: 'NO_VALUE', + payment_terms: { interval: 'day', frequency: 10 }, + }, + billing_period: { starts_at: '2024-10-12T07:20:50.52Z', ends_at: '2024-10-12T07:20:50.52Z' }, + items: [ + { + quantity: 10, + price_id: 'pri_01gsz8z1q1n00f12qt82y31smh', + }, + ], + checkout: { url: 'NO_VALUE' }, +}; + +export const PreviewTransactionMock: TransactionPreviewRequestBody = { + currencyCode: 'USD', + items: [ + { + includeInTotals: true, + priceId: 'pri_1234', + quantity: 10, + }, + ], +}; + +export const TransactionMock: ITransactionResponse = { + id: 'txn_01h04vsbhqc62t8hmd4z3b578c', + status: 'draft', + customer_id: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + address_id: 'add_01gm302t81w94gyjpjpqypkzkf', + business_id: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + custom_data: { customer_reference_id: 'abcd1234' }, + currency_code: 'USD', + origin: 'api', + subscription_id: 'sub_01h04vsc0qhwtsbsxh3422wjs4', + invoice_id: 'inv_01ghbk4xjn4qdsmstcwzgcgg35', + invoice_number: '123-45678', + collection_mode: 'automatic', + discount_id: 'dsc_01gv5kpg05xp104ek2fmgjwttf', + billing_details: { + enable_checkout: true, + purchase_order_number: 'NO_VALUE', + additional_information: 'NO_VALUE', + payment_terms: { interval: 'day', frequency: 10 }, + }, + billing_period: { starts_at: '2024-10-12T07:20:50.52Z', ends_at: '2024-10-12T07:20:50.52Z' }, + items: [ + { + price_id: 'pri_01gsz8z1q1n00f12qt82y31smh', + quantity: 10, + }, + ], + details: { + tax_rates_used: [ + { + tax_rate: '0.2', + totals: { + subtotal: '15000', + discount: '0', + tax: '1500', + total: '16500', + }, + }, + ], + totals: { + subtotal: '15000', + discount: '0', + tax: '1500', + total: '16500', + balance: '', + credit: '', + credit_to_balance: '', + currency_code: 'USD', + grand_total: '', + }, + adjusted_totals: { + subtotal: '15000', + tax: '1500', + total: '16500', + currency_code: 'USD', + grand_total: '', + }, + payout_totals: { + subtotal: '15000', + discount: '0', + tax: '1500', + total: '16500', + balance: '', + credit: '', + credit_to_balance: '', + currency_code: 'USD', + grand_total: '', + fee: '', + earnings: '', + }, + adjusted_payout_totals: { + subtotal: '15000', + tax: '1500', + total: '16500', + fee: '825', + chargeback_fee: { amount: '1680', original: { amount: '1500', currency_code: 'USD' } }, + earnings: '15675', + currency_code: 'AUD', + }, + line_items: [ + { + id: 'txnitm_01gm302t81w94gyjpjpqypkzkf', + price_id: 'pri_01gsz8z1q1n00f12qt82y31smh', + quantity: 10, + tax_rate: '0.2', + unit_totals: { + subtotal: '15000', + discount: '0', + tax: '1500', + total: '16500', + }, + totals: { + subtotal: '15000', + discount: '0', + tax: '1500', + total: '16500', + }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Ezekiel', + description: 'spargo crux videlicet fugit tyrannus curatio coma stillicidium esse bardus', + type: 'custom', + tax_category: 'digital-goods', + image_url: 'https://loremflickr.com/640/480?lock=7909378724200448', + custom_data: { customer_reference_id: 'abcd1234' }, + status: 'active', + created_at: '2024-10-12T07:20:50.52Z', + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, + }, + }, + ], + }, + payments: [ + { + payment_attempt_id: '497f776b-851d-4ebf-89ab-8ba0f75d2d6a', + stored_payment_method_id: '7636e781-3969-49f4-9c77-8226232e28a6', + amount: '1050', + status: 'authorized', + error_code: 'already_canceled', + method_details: { + type: 'card', + card: { + cardholder_name: '', + expiry_month: 0, + expiry_year: 0, + last4: '', + type: 'american_express', + }, + }, + created_at: '2024-10-12T07:20:50.52Z', + captured_at: '2024-10-12T07:20:50.52Z', + }, + ], + checkout: { url: 'NO_VALUE' }, + created_at: '2024-10-12T07:20:50.52Z', + updated_at: '2024-10-13T07:20:50.52Z', + billed_at: '2024-10-12T07:20:50.52Z', + adjustments: [ + { + action: 'credit', + created_at: '2024-10-12T07:20:50.52Z', + credit_applied_to_balance: true, + currency_code: 'USD', + customer_id: 'ctm_1234', + id: 'adj_1234', + items: [ + { + amount: '1000', + id: 'adj_1234', + item_id: '1234', + proration: { + billing_period: { + starts_at: '2024-10-12T07:20:50.52Z', + ends_at: '2024-11-12T07:20:50.52Z', + }, + rate: '10', + }, + totals: { + subtotal: '100', + total: '150', + tax: '50', + }, + type: 'full', + }, + ], + payout_totals: { + total: '1000', + tax: '1000', + currency_code: 'USD', + fee: '1000', + earnings: '1000', + subtotal: '1000', + }, + reason: 'Refund', + status: 'approved', + subscription_id: 'sub_1234', + totals: { + total: '1000', + tax: '1000', + currency_code: 'USD', + fee: '1000', + earnings: '1000', + subtotal: '1000', + }, + updated_at: '2024-10-12T07:20:50.52Z', + transaction_id: 'txn_1234', + }, + ], + adjustments_totals: { + breakdown: { + chargeback: '100', + credit: '100', + refund: '200', + }, + currency_code: 'USD', + earnings: '100', + fee: '10', + subtotal: '90', + tax: '10', + total: '110', + }, +}; + +export const TransactionPreviewMock: ITransactionPreviewResponse = { + customer_id: 'ctm_01grnn4zta5a1mf02jjze7y2ys', + address_id: 'add_01gm302t81w94gyjpjpqypkzkf', + business_id: 'biz_01grrebrzaee2qj2fqqhmcyzaj', + currency_code: 'USD', + discount_id: 'dsc_01gv5kpg05xp104ek2fmgjwttf', + items: [ + { + quantity: 10, + proration: { + billing_period: { + starts_at: '2024-10-12T07:20:50.52Z', + ends_at: '2024-10-12T07:20:50.52Z', + }, + rate: '10', + }, + }, + ], + details: { + tax_rates_used: [ + { + tax_rate: '0.2', + totals: { + subtotal: '15000', + discount: '0', + tax: '1500', + total: '16500', + }, + }, + ], + totals: { + subtotal: '15000', + discount: '0', + tax: '1500', + total: '16500', + balance: '', + credit: '', + credit_to_balance: '', + currency_code: 'USD', + grand_total: '', + }, + line_items: [ + { + price_id: 'pri_01gsz8z1q1n00f12qt82y31smh', + quantity: 10, + tax_rate: '0.2', + unit_totals: { + subtotal: '15000', + discount: '0', + tax: '1500', + total: '16500', + }, + totals: { + subtotal: '15000', + discount: '0', + tax: '1500', + total: '16500', + }, + product: { + id: 'pro_01gsz97mq9pa4fkyy0wqenepkz', + name: 'Ezekiel', + description: 'spargo crux videlicet fugit tyrannus curatio coma stillicidium esse bardus', + type: 'custom', + tax_category: 'digital-goods', + image_url: 'https://loremflickr.com/640/480?lock=7909378724200448', + custom_data: { customer_reference_id: 'abcd1234' }, + status: 'active', + created_at: '2024-10-12T07:20:50.52Z', + import_meta: { external_id: '9b95b0b8-e10f-441a-862e-1936a6d818ab', imported_from: 'billing_platform' }, + }, + }, + ], + }, +}; + +export const TransactionMockResponse: Response = { + data: TransactionMock, + meta: { + request_id: '', + }, +}; + +export const ListTransactionMockResponse: ResponsePaginated = { + data: [TransactionMock], + meta: { + request_id: '', + pagination: { + estimated_total: 10, + has_more: true, + next: '/transactions?after=1', + per_page: 10, + }, + }, +}; + +export const TransactionPreviewMockResponse: Response = { + data: TransactionPreviewMock, + meta: { + request_id: '', + }, +}; diff --git a/src/__tests__/notifications/notifications-parser.test.ts b/src/__tests__/notifications/notifications-parser.test.ts new file mode 100644 index 0000000..6941000 --- /dev/null +++ b/src/__tests__/notifications/notifications-parser.test.ts @@ -0,0 +1,147 @@ +import { AddressCreatedMock, AddressCreatedMockExpectation } from '../mocks/notifications/address-created.mock'; +import type { IEvents, IEventsResponse } from '../../types'; +import { Webhooks } from '../../notifications'; +import { AddressUpdatedMock, AddressUpdatedMockExpectation } from '../mocks/notifications/address-updated.mock'; +import { + AdjustmentCreatedMock, + AdjustmentCreatedMockExpectation, +} from '../mocks/notifications/adjustment-created.mock'; +import { + AdjustmentUpdatedMock, + AdjustmentUpdatedMockExpectation, +} from '../mocks/notifications/adjustment-updated.mock'; +import { BusinessCreatedMock, BusinessCreatedMockExpectation } from '../mocks/notifications/business-created.mock'; +import { BusinessUpdatedMock, BusinessUpdatedMockExpectation } from '../mocks/notifications/business-updated.mock'; +import { CustomerCreatedMock, CustomerCreatedMockExpectation } from '../mocks/notifications/customer-created.mock'; +import { CustomerUpdatedMock, CustomerUpdatedMockExpectation } from '../mocks/notifications/customer-updated.mock'; +import { DiscountCreatedMock, DiscountCreatedMockExpectation } from '../mocks/notifications/discount-created.mock'; +import { DiscountImportedMock, DiscountImportedMockExpectation } from '../mocks/notifications/discount-imported.mock'; +import { DiscountUpdatedMock, DiscountUpdatedMockExpectation } from '../mocks/notifications/discount-updated.mock'; +import { PayoutCreatedMock, PayoutCreatedMockExpectation } from '../mocks/notifications/payout-created.mock'; +import { PayoutPaidMock, PayoutPaidMockExpectation } from '../mocks/notifications/payout-paid.mock'; +import { PriceCreatedMock, PriceCreatedMockExpectation } from '../mocks/notifications/price-created.mock'; +import { PriceUpdatedMock, PriceUpdatedMockExpectation } from '../mocks/notifications/price-updated.mock'; +import { PriceImportedMock, PriceImportedMockExpectation } from '../mocks/notifications/price-imported.mock'; +import { ProductCreatedMock, ProductCreatedMockExpectation } from '../mocks/notifications/product-created.mock'; +import { ProductImportedMock, ProductImportedMockExpectation } from '../mocks/notifications/product-imported.mock'; +import { ProductUpdatedMock, ProductUpdatedMockExpectation } from '../mocks/notifications/product-updated.mock'; +import { ReportCreatedMock, ReportCreatedMockExpectation } from '../mocks/notifications/report-created.mock'; +import { ReportUpdatedMock, ReportUpdatedMockExpectation } from '../mocks/notifications/report-updated.mock'; +import { + SubscriptionActivatedMock, + SubscriptionActivatedMockExpectation, +} from '../mocks/notifications/subscription-activated.mock'; +import { + SubscriptionCanceledMock, + SubscriptionCanceledMockExpectation, +} from '../mocks/notifications/subscription-canceled.mock'; +import { + SubscriptionCreatedMock, + SubscriptionCreatedMockExpectation, +} from '../mocks/notifications/subscription-created.mock'; +import { + SubscriptionImportedMock, + SubscriptionImportedMockExpectation, +} from '../mocks/notifications/subscription-imported.mock'; +import { + SubscriptionPastDueMock, + SubscriptionPastDueMockExpectation, +} from '../mocks/notifications/subscription-past-due.mock'; +import { + SubscriptionPausedMock, + SubscriptionPausedMockExpectation, +} from '../mocks/notifications/subscription-paused.mock'; +import { + SubscriptionResumedMock, + SubscriptionResumedMockExpectation, +} from '../mocks/notifications/subscription-resumed.mock'; +import { + SubscriptionTrialingMock, + SubscriptionTrialingMockExpectation, +} from '../mocks/notifications/subscription-trialing.mock'; +import { + SubscriptionUpdatedMock, + SubscriptionUpdatedMockExpectation, +} from '../mocks/notifications/subscription-updated.mock'; +import { + TransactionBilledMock, + TransactionBilledMockExpectation, +} from '../mocks/notifications/transaction-billed.mock'; +import { + TransactionCanceledMock, + TransactionCanceledMockExpectation, +} from '../mocks/notifications/transaction-canceled.mock'; +import { + TransactionCompletedMock, + TransactionCompletedMockExpectation, +} from '../mocks/notifications/transaction-completed.mock'; +import { + TransactionCreatedMock, + TransactionCreatedMockExpectation, +} from '../mocks/notifications/transaction-created.mock'; +import { TransactionPaidMock, TransactionPaidMockExpectation } from '../mocks/notifications/transaction-paid.mock'; +import { + TransactionPastDueMock, + TransactionPastDueMockExpectation, +} from '../mocks/notifications/transaction-past-due.mock'; +import { + TransactionPaymentFailedMock, + TransactionPaymentFailedMockExpectation, +} from '../mocks/notifications/transaction-payment-failed.mock'; +import { TransactionReadyMock, TransactionReadyMockExpectation } from '../mocks/notifications/transaction-ready.mock'; +import { + TransactionUpdatedMock, + TransactionUpdatedMockExpectation, +} from '../mocks/notifications/transaction-updated.mock'; +import { AddressImportedMock, AddressImportedMockExpectation } from '../mocks/notifications/address-imported.mock'; +import { BusinessImportedMock, BusinessImportedMockExpectation } from '../mocks/notifications/business-imported.mock'; +import { CustomerImportedMock, CustomerImportedMockExpectation } from '../mocks/notifications/customer-imported.mock'; + +describe('Notifications Parser', () => { + test.each([ + [AddressCreatedMock.event_type, AddressCreatedMock, AddressCreatedMockExpectation], + [AddressUpdatedMock.event_type, AddressUpdatedMock, AddressUpdatedMockExpectation], + [AddressImportedMock.event_type, AddressImportedMock, AddressImportedMockExpectation], + [AdjustmentCreatedMock.event_type, AdjustmentCreatedMock, AdjustmentCreatedMockExpectation], + [AdjustmentUpdatedMock.event_type, AdjustmentUpdatedMock, AdjustmentUpdatedMockExpectation], + [BusinessCreatedMock.event_type, BusinessCreatedMock, BusinessCreatedMockExpectation], + [BusinessUpdatedMock.event_type, BusinessUpdatedMock, BusinessUpdatedMockExpectation], + [BusinessImportedMock.event_type, BusinessImportedMock, BusinessImportedMockExpectation], + [CustomerCreatedMock.event_type, CustomerCreatedMock, CustomerCreatedMockExpectation], + [CustomerUpdatedMock.event_type, CustomerUpdatedMock, CustomerUpdatedMockExpectation], + [CustomerImportedMock.event_type, CustomerImportedMock, CustomerImportedMockExpectation], + [DiscountCreatedMock.event_type, DiscountCreatedMock, DiscountCreatedMockExpectation], + [DiscountImportedMock.event_type, DiscountImportedMock, DiscountImportedMockExpectation], + [DiscountUpdatedMock.event_type, DiscountUpdatedMock, DiscountUpdatedMockExpectation], + [PayoutCreatedMock.event_type, PayoutCreatedMock, PayoutCreatedMockExpectation], + [PayoutPaidMock.event_type, PayoutPaidMock, PayoutPaidMockExpectation], + [PriceCreatedMock.event_type, PriceCreatedMock, PriceCreatedMockExpectation], + [PriceUpdatedMock.event_type, PriceUpdatedMock, PriceUpdatedMockExpectation], + [PriceImportedMock.event_type, PriceImportedMock, PriceImportedMockExpectation], + [ProductCreatedMock.event_type, ProductCreatedMock, ProductCreatedMockExpectation], + [ProductImportedMock.event_type, ProductImportedMock, ProductImportedMockExpectation], + [ProductUpdatedMock.event_type, ProductUpdatedMock, ProductUpdatedMockExpectation], + [ReportCreatedMock.event_type, ReportCreatedMock, ReportCreatedMockExpectation], + [ReportUpdatedMock.event_type, ReportUpdatedMock, ReportUpdatedMockExpectation], + [SubscriptionActivatedMock.event_type, SubscriptionActivatedMock, SubscriptionActivatedMockExpectation], + [SubscriptionCanceledMock.event_type, SubscriptionCanceledMock, SubscriptionCanceledMockExpectation], + [SubscriptionCreatedMock.event_type, SubscriptionCreatedMock, SubscriptionCreatedMockExpectation], + [SubscriptionImportedMock.event_type, SubscriptionImportedMock, SubscriptionImportedMockExpectation], + [SubscriptionPastDueMock.event_type, SubscriptionPastDueMock, SubscriptionPastDueMockExpectation], + [SubscriptionPausedMock.event_type, SubscriptionPausedMock, SubscriptionPausedMockExpectation], + [SubscriptionResumedMock.event_type, SubscriptionResumedMock, SubscriptionResumedMockExpectation], + [SubscriptionTrialingMock.event_type, SubscriptionTrialingMock, SubscriptionTrialingMockExpectation], + [SubscriptionUpdatedMock.event_type, SubscriptionUpdatedMock, SubscriptionUpdatedMockExpectation], + [TransactionBilledMock.event_type, TransactionBilledMock, TransactionBilledMockExpectation], + [TransactionCanceledMock.event_type, TransactionCanceledMock, TransactionCanceledMockExpectation], + [TransactionCompletedMock.event_type, TransactionCompletedMock, TransactionCompletedMockExpectation], + [TransactionCreatedMock.event_type, TransactionCreatedMock, TransactionCreatedMockExpectation], + [TransactionPaidMock.event_type, TransactionPaidMock, TransactionPaidMockExpectation], + [TransactionPastDueMock.event_type, TransactionPastDueMock, TransactionPastDueMockExpectation], + [TransactionPaymentFailedMock.event_type, TransactionPaymentFailedMock, TransactionPaymentFailedMockExpectation], + [TransactionReadyMock.event_type, TransactionReadyMock, TransactionReadyMockExpectation], + [TransactionUpdatedMock.event_type, TransactionUpdatedMock, TransactionUpdatedMockExpectation], + ])('validate %s ', (_eventType: string, eventMock: IEventsResponse, expectedValue: any = {}) => { + expect(Webhooks.fromJson(eventMock as IEvents)).toEqual(expectedValue); + }); +}); diff --git a/src/__tests__/notifications/webhooks-validator.test.ts b/src/__tests__/notifications/webhooks-validator.test.ts new file mode 100644 index 0000000..7f0d241 --- /dev/null +++ b/src/__tests__/notifications/webhooks-validator.test.ts @@ -0,0 +1,79 @@ +import { WebhooksValidator } from '../../notifications'; + +// This file does not contain any secret keys. All the hashes are generated using `VALID_SECRET` as key +describe('webhooks-validator', () => { + test.each([ + [ + 'Valid signature', + '{"data": ["1", "2"]}', + 'ts=1698796800;h1=a300428748dce5c70e4da19bffd60769591ea969c99dea3105d0ec9612cf43f9', + 'VALID_SECRET', + true, + ], + [ + 'Valid signature with multiple hashes', + '{"data": "value"}', + 'ts=1698796800;h1=28981e941fae76e53db32f3d2a83cb69db41476595e84e1970a1b5d98f62b261;h1=28981e941fae76e53db32f3d2a83cb69db41476595e84e1970a1b5d98f62b261;h2=RANDOM_HASH', + 'VALID_SECRET', + true, + ], + [ + 'Invalid secret', + '{"data": ["1", "2"]}', + 'ts=1698796800;h1=a300428748dce5c70e4da19bffd60769591ea969c99dea3105d0ec9612cf43f9', + 'INVALID_VALID_SECRET', + false, + ], + [ + 'InValid timestamp', + '{"data": ["1", "2"]}', + 'ts=9876;h1=a300428748dce5c70e4da19bffd60769591ea969c99dea3105d0ec9612cf43f9', + 'VALID_SECRET', + false, + ], + [ + 'Invalid data - has more space', + '{ "data": [ "1", "2" ]}', + 'ts=1698796800;h1=a300428748dce5c70e4da19bffd60769591ea969c99dea3105d0ec9612cf43f9', + 'VALID_SECRET', + false, + ], + ['Invalid signature', '{"data": ["1", "2"]}', 'ts=1234;h1=invalid_signature', 'VALID_SECRET', false], + ])('should validate %s', (_, requestBody, signature, secretKey, expected) => { + jest.useFakeTimers(); + jest.setSystemTime(new Date('11/01/2023')); + + expect(new WebhooksValidator().isValidSignature(requestBody, secretKey, signature)).toBe(expected); + + jest.useRealTimers(); + }); + test.each([ + ['Missing TS and H1', 'invalid_header'], + ['Missing TS', 'h1=invalid_header'], + ['Missing H1', 'ts=1234;h2=invalid_header'], + ])('validate header - %s', (_, header: string) => { + expect(() => new WebhooksValidator().isValidSignature('{"data": ["1", "2"]}', 'VALID_SECRET', header)).toThrowError( + '[Paddle] Invalid webhook signature', + ); + }); + + test.each([ + ['Validates signature with correct TS within 5 seconds', '11/01/2023 00:00:01', true], + ['Validates signature at max allowed time at 5 seconds', '11/01/2023 00:00:05', true], + ['Will reject if current time is more than 5seconds', '11/01/2023 00:00:06', false], + ['Will reject if current time is more than a few days', '11/05/2023 00:00:00', false], + ])('%s', (_: string, time: string, result: boolean) => { + jest.useFakeTimers(); + jest.setSystemTime(new Date(time)); + + expect( + new WebhooksValidator().isValidSignature( + '{"data": ["1", "2"]}', + 'VALID_SECRET', + 'ts=1698796800;h1=a300428748dce5c70e4da19bffd60769591ea969c99dea3105d0ec9612cf43f9', + ), + ).toBe(result); + + jest.useRealTimers(); + }); +}); diff --git a/src/__tests__/resources/addresses.test.ts b/src/__tests__/resources/addresses.test.ts new file mode 100644 index 0000000..8d12c01 --- /dev/null +++ b/src/__tests__/resources/addresses.test.ts @@ -0,0 +1,128 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + AddressesResource, + CreateAddressRequestBody, + ListAddressQueryParameters, + UpdateAddressRequestBody, +} from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + AddressMock, + AddressMockResponse, + CreateAddressExpectation, + CreateAddressMock, + ListAddressMockResponse, + UpdateAddressExpectation, + UpdateAddressMock, +} from '../mocks/resources/addresses.mock'; +import { convertToSnakeCase } from '../../internal'; + +describe('AddressesResource', () => { + test('should return a list of addresses', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListAddressMockResponse); + + const addressesResource = new AddressesResource(paddleInstance); + const addressCollection = addressesResource.list('ctm_1234'); + + let addresses = await addressCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/customers/ctm_1234/addresses?'); + expect(addresses.length).toBe(1); + + addresses = await addressCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/customers/ctm_1234/addresses?'); + expect(addresses.length).toBe(1); + }); + + test('should accept query params and return a list of addresses', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListAddressMockResponse); + const addressesResource = new AddressesResource(paddleInstance); + const queryParams: ListAddressQueryParameters = { + after: '2', + id: ['1234'], + }; + + const addressCollection = addressesResource.list('ctm_1234', queryParams); + let addresses = await addressCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/customers/ctm_1234/addresses?after=2&id=1234'); + expect(addresses.length).toBe(1); + }); + + test('should return a single address by ID', async () => { + const addressId = AddressMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(AddressMockResponse); + + const addressesResource = new AddressesResource(paddleInstance); + const address = await addressesResource.get('ctm_1234', addressId); + + expect(paddleInstance.get).toBeCalledWith(`/customers/ctm_1234/addresses/${addressId}`); + expect(address).toBeDefined(); + expect(address.id).toBe(addressId); + }); + + test('should accepts query params and return a single address by ID', async () => { + const addressId = AddressMock.id; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.get = jest.fn().mockResolvedValue(AddressMockResponse); + const addressesResource = new AddressesResource(paddleInstance); + + const address = await addressesResource.get('ctm_1234', addressId); + + expect(address).toBeDefined(); + expect(paddleInstance.get).toBeCalledWith(`/customers/ctm_1234/addresses/${addressId}`); + expect(address.id).toBe(addressId); + }); + + test('should create a new address', async () => { + const newAddress: CreateAddressRequestBody = CreateAddressMock; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.post = jest.fn().mockResolvedValue(AddressMockResponse); + const addressesResource = new AddressesResource(paddleInstance); + const createdAddress = await addressesResource.create('ctm_1234', newAddress); + + expect(paddleInstance.post).toBeCalledWith(`/customers/ctm_1234/addresses`, CreateAddressMock); + expect(createdAddress).toBeDefined(); + expect(createdAddress.id).toBeDefined(); + + expect(convertToSnakeCase(newAddress)).toEqual(CreateAddressExpectation); + }); + + test('should update an existing address', async () => { + const addressId = AddressMock.id; + const addressToBeUpdated: UpdateAddressRequestBody = UpdateAddressMock; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(AddressMockResponse); + + const addressesResource = new AddressesResource(paddleInstance); + const updatedAddress = await addressesResource.update('ctm_1234', addressId, addressToBeUpdated); + + expect(paddleInstance.patch).toBeCalledWith(`/customers/ctm_1234/addresses/${addressId}`, UpdateAddressMock); + expect(updatedAddress).toBeDefined(); + + expect(convertToSnakeCase(addressToBeUpdated)).toEqual(UpdateAddressExpectation); + }); + + test('should archive an existing address', async () => { + const addressId = AddressMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(AddressMockResponse); + + const addressesResource = new AddressesResource(paddleInstance); + const updatedAddress = await addressesResource.archive('ctm_1234', addressId); + + expect(paddleInstance.patch).toBeCalledWith(`/customers/ctm_1234/addresses/${addressId}`, { status: 'archived' }); + expect(updatedAddress).toBeDefined(); + }); +}); diff --git a/src/__tests__/resources/adjustments.test.ts b/src/__tests__/resources/adjustments.test.ts new file mode 100644 index 0000000..b39f4fc --- /dev/null +++ b/src/__tests__/resources/adjustments.test.ts @@ -0,0 +1,64 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { AdjustmentsResource, ListAdjustmentQueryParameters } from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + AdjustmentMockResponse, + CreateAdjustmentExpectation, + CreateAdjustmentMock, + ListAdjustmentMockResponse, +} from '../mocks/resources/adjustments.mock'; +import { convertToSnakeCase } from '../../internal'; + +describe('AdjustmentsResource', () => { + test('should return a list of adjustments', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListAdjustmentMockResponse); + + const adjustmentsResource = new AdjustmentsResource(paddleInstance); + const adjustmentCollection = adjustmentsResource.list(); + + let adjustments = await adjustmentCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/adjustments?'); + expect(adjustments.length).toBe(1); + + adjustments = await adjustmentCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/adjustments?after=1'); + expect(adjustments.length).toBe(1); + }); + + test('should accept query params and return a list of adjustments', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListAdjustmentMockResponse); + const adjustmentsResource = new AdjustmentsResource(paddleInstance); + const queryParams: ListAdjustmentQueryParameters = { + after: '2', + id: ['1234'], + }; + + const adjustmentCollection = adjustmentsResource.list(queryParams); + let adjustments = await adjustmentCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/adjustments?after=2&id=1234'); + expect(adjustments.length).toBe(1); + }); + + test('should create a new adjustment', async () => { + const newAdjustment = CreateAdjustmentMock; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.post = jest.fn().mockResolvedValue(AdjustmentMockResponse); + const adjustmentsResource = new AdjustmentsResource(paddleInstance); + const createdAdjustment = await adjustmentsResource.create(newAdjustment); + + expect(paddleInstance.post).toBeCalledWith(`/adjustments`, newAdjustment); + expect(createdAdjustment).toBeDefined(); + expect(createdAdjustment.id).toBeDefined(); + + expect(convertToSnakeCase(CreateAdjustmentMock)).toEqual(CreateAdjustmentExpectation); + }); +}); diff --git a/src/__tests__/resources/businesses.test.ts b/src/__tests__/resources/businesses.test.ts new file mode 100644 index 0000000..1770358 --- /dev/null +++ b/src/__tests__/resources/businesses.test.ts @@ -0,0 +1,127 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + BusinessesResource, + CreateBusinessRequestBody, + ListBusinessQueryParameters, + UpdateBusinessRequestBody, +} from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + BusinessMock, + BusinessMockResponse, + ListBusinessMockResponse, + UpdateBusinessExpectation, + UpdateBusinessMock, +} from '../mocks/resources/businesses.mock'; +import { convertToSnakeCase } from '../../internal'; + +describe('BusinessesResource', () => { + test('should return a list of businesses', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListBusinessMockResponse); + + const businessesResource = new BusinessesResource(paddleInstance); + const businessCollection = businessesResource.list('ctm_1234'); + + let businesses = await businessCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/customers/ctm_1234/businesses?'); + expect(businesses.length).toBe(1); + + businesses = await businessCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/customers/ctm_1234/businesses?'); + expect(businesses.length).toBe(1); + }); + + test('should accept query params and return a list of businesses', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListBusinessMockResponse); + const businessesResource = new BusinessesResource(paddleInstance); + const queryParams: ListBusinessQueryParameters = { + after: '2', + id: ['1234'], + }; + + const businessCollection = businessesResource.list('ctm_1234', queryParams); + let businesses = await businessCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/customers/ctm_1234/businesses?after=2&id=1234'); + expect(businesses.length).toBe(1); + }); + + test('should return a single business by ID', async () => { + const businessId = BusinessMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(BusinessMockResponse); + + const businessesResource = new BusinessesResource(paddleInstance); + const business = await businessesResource.get('ctm_1234', businessId); + + expect(paddleInstance.get).toBeCalledWith(`/customers/ctm_1234/businesses/${businessId}`); + expect(business).toBeDefined(); + expect(business.id).toBe(businessId); + }); + + test('should accepts query params and return a single business by ID', async () => { + const businessId = BusinessMock.id; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.get = jest.fn().mockResolvedValue(BusinessMockResponse); + const businessesResource = new BusinessesResource(paddleInstance); + + const business = await businessesResource.get('ctm_1234', businessId); + + expect(business).toBeDefined(); + expect(paddleInstance.get).toBeCalledWith(`/customers/ctm_1234/businesses/${businessId}`); + expect(business.id).toBe(businessId); + }); + + test('should create a new business', async () => { + const newBusiness: CreateBusinessRequestBody = BusinessMock; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.post = jest.fn().mockResolvedValue(BusinessMockResponse); + const businessesResource = new BusinessesResource(paddleInstance); + const createdBusiness = await businessesResource.create('ctm_1234', newBusiness); + + expect(paddleInstance.post).toBeCalledWith(`/customers/ctm_1234/businesses`, newBusiness); + expect(createdBusiness).toBeDefined(); + expect(createdBusiness.id).toBeDefined(); + expect(createdBusiness.name).toBe(newBusiness.name); + }); + + test('should update an existing business', async () => { + const businessId = BusinessMock.id; + const businessToBeUpdated: UpdateBusinessRequestBody = { + name: 'Updated Business', + }; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(BusinessMockResponse); + + const businessesResource = new BusinessesResource(paddleInstance); + const updatedBusiness = await businessesResource.update('ctm_1234', businessId, businessToBeUpdated); + + expect(paddleInstance.patch).toBeCalledWith(`/customers/ctm_1234/businesses/${businessId}`, businessToBeUpdated); + expect(updatedBusiness).toBeDefined(); + + expect(convertToSnakeCase(UpdateBusinessMock)).toEqual(UpdateBusinessExpectation); + }); + + test('should archive an existing business', async () => { + const businessId = BusinessMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(BusinessMockResponse); + + const businessesResource = new BusinessesResource(paddleInstance); + const updatedBusiness = await businessesResource.archive('ctm_1234', businessId); + + expect(paddleInstance.patch).toBeCalledWith(`/customers/ctm_1234/businesses/${businessId}`, { status: 'archived' }); + expect(updatedBusiness).toBeDefined(); + }); +}); diff --git a/src/__tests__/resources/customers.test.ts b/src/__tests__/resources/customers.test.ts new file mode 100644 index 0000000..21833ef --- /dev/null +++ b/src/__tests__/resources/customers.test.ts @@ -0,0 +1,142 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + CreateCustomerRequestBody, + CustomersResource, + ListCustomerQueryParameters, + UpdateCustomerRequestBody, +} from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + CustomerCreditBalanceMockResponse, + CustomerMock, + CustomerMockResponse, + ListCustomerMockResponse, + UpdateCustomerExpectation, + UpdateCustomerMock, +} from '../mocks/resources/customers.mock'; +import { convertToSnakeCase } from '../../internal'; + +describe('CustomersResource', () => { + test('should return a list of customers', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListCustomerMockResponse); + + const customersResource = new CustomersResource(paddleInstance); + const customerCollection = customersResource.list(); + + let customers = await customerCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/customers?'); + expect(customers.length).toBe(1); + + customers = await customerCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/customers?after=1'); + expect(customers.length).toBe(1); + }); + + test('should accept query params and return a list of customers', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListCustomerMockResponse); + const customersResource = new CustomersResource(paddleInstance); + const queryParams: ListCustomerQueryParameters = { + after: '2', + id: ['1234'], + }; + + const customerCollection = customersResource.list(queryParams); + let customers = await customerCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/customers?after=2&id=1234'); + expect(customers.length).toBe(1); + }); + + test('should return a single customer by ID', async () => { + const customerId = CustomerMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(CustomerMockResponse); + + const customersResource = new CustomersResource(paddleInstance); + const customer = await customersResource.get(customerId); + + expect(paddleInstance.get).toBeCalledWith(`/customers/${customerId}`); + expect(customer).toBeDefined(); + expect(customer.id).toBe(customerId); + }); + + test('should accepts query params and return a single customer by ID', async () => { + const customerId = CustomerMock.id; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.get = jest.fn().mockResolvedValue(CustomerMockResponse); + const customersResource = new CustomersResource(paddleInstance); + + const customer = await customersResource.get(customerId); + + expect(customer).toBeDefined(); + expect(paddleInstance.get).toBeCalledWith(`/customers/${customerId}`); + expect(customer.id).toBe(customerId); + }); + + test('should create a new customer', async () => { + const newCustomer: CreateCustomerRequestBody = CustomerMock; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.post = jest.fn().mockResolvedValue(CustomerMockResponse); + const customersResource = new CustomersResource(paddleInstance); + const createdCustomer = await customersResource.create(newCustomer); + + expect(paddleInstance.post).toBeCalledWith(`/customers`, newCustomer); + expect(createdCustomer).toBeDefined(); + expect(createdCustomer.id).toBeDefined(); + expect(createdCustomer.name).toBe(newCustomer.name); + }); + + test('should update an existing customer', async () => { + const customerId = CustomerMock.id; + const customerToBeUpdated: UpdateCustomerRequestBody = { + name: 'Updated Customer', + }; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(CustomerMockResponse); + + const customersResource = new CustomersResource(paddleInstance); + const updatedCustomer = await customersResource.update(customerId, customerToBeUpdated); + + expect(paddleInstance.patch).toBeCalledWith(`/customers/${customerId}`, customerToBeUpdated); + expect(updatedCustomer).toBeDefined(); + + expect(convertToSnakeCase(UpdateCustomerMock)).toEqual(UpdateCustomerExpectation); + }); + + test('should archive an existing customer', async () => { + const customerId = CustomerMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(CustomerMockResponse); + + const customersResource = new CustomersResource(paddleInstance); + const updatedCustomer = await customersResource.archive(customerId); + + expect(paddleInstance.patch).toBeCalledWith(`/customers/${customerId}`, { status: 'archived' }); + expect(updatedCustomer).toBeDefined(); + }); + + test('should return a credit balance for customer by ID', async () => { + const customerId = CustomerMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(CustomerCreditBalanceMockResponse); + + const customersResource = new CustomersResource(paddleInstance); + const customer = await customersResource.getCreditBalance(customerId); + + expect(paddleInstance.get).toBeCalledWith(`/customers/${customerId}/credit-balances`, { + queryParameters: undefined, + }); + expect(customer).toBeDefined(); + }); +}); diff --git a/src/__tests__/resources/discounts.test.ts b/src/__tests__/resources/discounts.test.ts new file mode 100644 index 0000000..477d265 --- /dev/null +++ b/src/__tests__/resources/discounts.test.ts @@ -0,0 +1,124 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { CreateDiscountRequestBody, DiscountsResource, ListDiscountQueryParameters } from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + CreateDiscountExpectation, + CreateDiscountMock, + DiscountMock, + DiscountMockResponse, + ListDiscountMockResponse, + UpdateDiscountExpectation, + UpdateDiscountMock, +} from '../mocks/resources/discounts.mock'; +import { convertToSnakeCase } from '../../internal'; + +describe('DiscountsResource', () => { + test('should return a list of discounts', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListDiscountMockResponse); + + const discountsResource = new DiscountsResource(paddleInstance); + const discountCollection = discountsResource.list(); + + let discounts = await discountCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/discounts?'); + expect(discounts.length).toBe(1); + + discounts = await discountCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/discounts?after=1'); + expect(discounts.length).toBe(1); + }); + + test('should accept query params and return a list of discounts', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListDiscountMockResponse); + const discountsResource = new DiscountsResource(paddleInstance); + const queryParams: ListDiscountQueryParameters = { + after: '2', + id: ['1234'], + }; + + const discountCollection = discountsResource.list(queryParams); + let discounts = await discountCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/discounts?after=2&id=1234'); + expect(discounts.length).toBe(1); + }); + + test('should return a single discount by ID', async () => { + const discountId = DiscountMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(DiscountMockResponse); + + const discountsResource = new DiscountsResource(paddleInstance); + const discount = await discountsResource.get(discountId); + + expect(paddleInstance.get).toBeCalledWith(`/discounts/${discountId}`); + expect(discount).toBeDefined(); + expect(discount.id).toBe(discountId); + }); + + test('should accepts query params and return a single discount by ID', async () => { + const discountId = DiscountMock.id; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.get = jest.fn().mockResolvedValue(DiscountMockResponse); + const discountsResource = new DiscountsResource(paddleInstance); + + const discount = await discountsResource.get(discountId); + + expect(discount).toBeDefined(); + expect(paddleInstance.get).toBeCalledWith(`/discounts/${discountId}`); + expect(discount.id).toBe(discountId); + }); + + test('should create a new discount', async () => { + const newDiscount: CreateDiscountRequestBody = DiscountMock; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.post = jest.fn().mockResolvedValue(DiscountMockResponse); + const discountsResource = new DiscountsResource(paddleInstance); + const createdDiscount = await discountsResource.create(newDiscount); + + expect(paddleInstance.post).toBeCalledWith(`/discounts`, newDiscount); + expect(createdDiscount).toBeDefined(); + expect(createdDiscount.id).toBeDefined(); + + expect(convertToSnakeCase(CreateDiscountMock)).toEqual(CreateDiscountExpectation); + }); + + test('should update an existing discount', async () => { + const discountId = DiscountMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(DiscountMockResponse); + + const discountsResource = new DiscountsResource(paddleInstance); + const updatedDiscount = await discountsResource.update(discountId, UpdateDiscountMock); + + expect(paddleInstance.patch).toBeCalledWith(`/discounts/${discountId}`, UpdateDiscountMock); + expect(updatedDiscount).toBeDefined(); + + expect(convertToSnakeCase(UpdateDiscountMock)).toEqual(UpdateDiscountExpectation); + }); + + test('should archive an existing discount', async () => { + const discountId = DiscountMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(DiscountMockResponse); + + const discountsResource = new DiscountsResource(paddleInstance); + const updatedDiscount = await discountsResource.archive(discountId); + + expect(paddleInstance.patch).toBeCalledWith(`/discounts/${discountId}`, { status: 'archived' }); + expect(updatedDiscount).toBeDefined(); + + expect(convertToSnakeCase(UpdateDiscountMock)).toEqual(UpdateDiscountExpectation); + }); +}); diff --git a/src/__tests__/resources/event-types.test.ts b/src/__tests__/resources/event-types.test.ts new file mode 100644 index 0000000..5a78e43 --- /dev/null +++ b/src/__tests__/resources/event-types.test.ts @@ -0,0 +1,22 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { getPaddleTestClient } from '../helpers/test-client'; +import { EventTypesResource } from '../../resources'; +import { ListEventTypeMockResponse } from '../mocks/resources/event-types.mock'; + +describe('EventTypesResource', () => { + test('should return a list of events', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListEventTypeMockResponse); + + const eventsResource = new EventTypesResource(paddleInstance); + const eventTypes = await eventsResource.list(); + + expect(paddleInstance.get).toBeCalledWith('/event-types'); + expect(eventTypes.length).toBe(31); + }); +}); diff --git a/src/__tests__/resources/events.test.ts b/src/__tests__/resources/events.test.ts new file mode 100644 index 0000000..427c524 --- /dev/null +++ b/src/__tests__/resources/events.test.ts @@ -0,0 +1,43 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { getPaddleTestClient } from '../helpers/test-client'; +import { ListEventMockResponse } from '../mocks/resources/events.mock'; +import { EventsResource, ListEventsQueryParameters } from '../../resources/events'; + +describe('EventsResource', () => { + test('should return a list of events', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListEventMockResponse); + + const eventsResource = new EventsResource(paddleInstance); + const eventCollection = eventsResource.list(); + + let events = await eventCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/events?'); + expect(events.length).toBe(1); + + events = await eventCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/events?after=1'); + expect(events.length).toBe(1); + }); + + test('should accept query params and return a list of events', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListEventMockResponse); + const eventsResource = new EventsResource(paddleInstance); + const queryParams: ListEventsQueryParameters = { + after: '2', + orderBy: 'id[ASC]', + }; + + const eventCollection = eventsResource.list(queryParams); + let events = await eventCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/events?after=2&order_by=id%5BASC%5D'); + expect(events.length).toBe(1); + }); +}); diff --git a/src/__tests__/resources/notification-settings.test.ts b/src/__tests__/resources/notification-settings.test.ts new file mode 100644 index 0000000..f98c747 --- /dev/null +++ b/src/__tests__/resources/notification-settings.test.ts @@ -0,0 +1,89 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { NotificationSettingsResource } from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { NotificationMock } from '../mocks/resources/notifications.mock'; +import { convertToSnakeCase } from '../../internal'; +import { + CreateNotificationSettingsExpectation, + CreateNotificationSettingsMock, + ListNotificationSettingsMockResponse, + NotificationSettingsMockResponse, + UpdateNotificationSettingsExpectation, + UpdateNotificationSettingsMock, +} from '../mocks/resources/notification-settings.mock'; + +describe('NotificationSettingsResource', () => { + test('should return a list of notification settings', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListNotificationSettingsMockResponse); + + const notificationsResource = new NotificationSettingsResource(paddleInstance); + const notifications = await notificationsResource.list(); + + expect(paddleInstance.get).toBeCalledWith('/notification-settings'); + expect(notifications.length).toBe(1); + }); + + test('should return a single notification settings by ID', async () => { + const notificationId = NotificationMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(NotificationSettingsMockResponse); + + const notificationsResource = new NotificationSettingsResource(paddleInstance); + const notification = await notificationsResource.get(notificationId); + + expect(paddleInstance.get).toBeCalledWith(`/notification-settings/${notificationId}`); + expect(notification).toBeDefined(); + }); + + test('should create a new notification settings', async () => { + const newNotificationSettings = CreateNotificationSettingsMock; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.post = jest.fn().mockResolvedValue(NotificationSettingsMockResponse); + const notificationsResource = new NotificationSettingsResource(paddleInstance); + const notificationSettings = await notificationsResource.create(newNotificationSettings); + + expect(paddleInstance.post).toBeCalledWith(`/notification-settings`, newNotificationSettings); + expect(notificationSettings).toBeDefined(); + expect(notificationSettings.id).toBeDefined(); + expect(convertToSnakeCase(CreateNotificationSettingsMock)).toEqual(CreateNotificationSettingsExpectation); + }); + + test('should update an existing notification settings', async () => { + const notificationSettingsId = 'ntfset_1234'; + const notificationSettingsBody = UpdateNotificationSettingsMock; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(NotificationSettingsMockResponse); + + const notificationsResource = new NotificationSettingsResource(paddleInstance); + const notificationSettings = await notificationsResource.update(notificationSettingsId, notificationSettingsBody); + + expect(paddleInstance.patch).toBeCalledWith( + `/notification-settings/${notificationSettingsId}`, + notificationSettingsBody, + ); + expect(notificationSettings).toBeDefined(); + + expect(convertToSnakeCase(UpdateNotificationSettingsMock)).toEqual(UpdateNotificationSettingsExpectation); + }); + + test('should delete an existing notification settings', async () => { + const notificationSettingsId = 'ntfset_1234'; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.delete = jest.fn().mockResolvedValue(NotificationSettingsMockResponse); + + const notificationsResource = new NotificationSettingsResource(paddleInstance); + const notificationSettings = await notificationsResource.delete(notificationSettingsId); + + expect(paddleInstance.delete).toBeCalledWith(`/notification-settings/${notificationSettingsId}`); + expect(notificationSettings).toBeUndefined(); + }); +}); diff --git a/src/__tests__/resources/notifications.test.ts b/src/__tests__/resources/notifications.test.ts new file mode 100644 index 0000000..0789030 --- /dev/null +++ b/src/__tests__/resources/notifications.test.ts @@ -0,0 +1,90 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { ListNotificationQueryParameters, NotificationsResource } from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + ListNotificationLogsMockResponse, + ListNotificationMockResponse, + NotificationMock, + NotificationMockResponse, + NotificationReplayMockResponse, +} from '../mocks/resources/notifications.mock'; + +describe('NotificationsResource', () => { + test('should return a list of notifications', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListNotificationMockResponse); + + const notificationsResource = new NotificationsResource(paddleInstance); + const notificationCollection = notificationsResource.list(); + + let notifications = await notificationCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/notifications?'); + expect(notifications.length).toBe(1); + + notifications = await notificationCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/notifications?after=1'); + expect(notifications.length).toBe(1); + }); + + test('should accept query params and return a list of notifications', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListNotificationMockResponse); + const notificationsResource = new NotificationsResource(paddleInstance); + const queryParams: ListNotificationQueryParameters = { + after: '2', + notificationSettingId: ['ntfset_1234'], + }; + + const notificationCollection = notificationsResource.list(queryParams); + let notifications = await notificationCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/notifications?after=2¬ification_setting_id=ntfset_1234'); + expect(notifications.length).toBe(1); + }); + + test('should return a single notification by ID', async () => { + const notificationId = NotificationMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(NotificationMockResponse); + + const notificationsResource = new NotificationsResource(paddleInstance); + const notification = await notificationsResource.get(notificationId); + + expect(paddleInstance.get).toBeCalledWith(`/notifications/${notificationId}`); + expect(notification).toBeDefined(); + expect(notification.id).toBe(notificationId); + }); + + test('should be able to replay a notification by ID', async () => { + const notificationId = NotificationMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.post = jest.fn().mockResolvedValue(NotificationReplayMockResponse); + + const notificationsResource = new NotificationsResource(paddleInstance); + const notification = await notificationsResource.replay(notificationId); + + expect(paddleInstance.post).toBeCalledWith(`/notifications/${notificationId}/replay`, undefined); + expect(notification).toBeDefined(); + }); + + test('should return logs for notifications', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListNotificationLogsMockResponse); + + const notificationsResource = new NotificationsResource(paddleInstance); + const notificationCollection = notificationsResource.getLogs('ntf_1234'); + + let notifications = await notificationCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/notifications/ntf_1234/logs?'); + expect(notifications.length).toBe(3); + + notifications = await notificationCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/notifications/ntf_1234/logs?after=1'); + expect(notifications.length).toBe(3); + }); +}); diff --git a/src/__tests__/resources/prices.test.ts b/src/__tests__/resources/prices.test.ts new file mode 100644 index 0000000..32ad9e2 --- /dev/null +++ b/src/__tests__/resources/prices.test.ts @@ -0,0 +1,120 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { ListPriceQueryParameters, PricesResource } from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + CreatePriceExpectation, + CreatePriceMock, + ListPriceMockResponse, + PriceMock, + PriceMockResponse, + UpdatePriceExpectation, + UpdatePriceMock, +} from '../mocks/resources/prices.mock'; +import { convertToSnakeCase } from '../../internal'; + +describe('PricesResource', () => { + test('should return a list of prices', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListPriceMockResponse); + + const pricesResource = new PricesResource(paddleInstance); + const priceCollection = pricesResource.list(); + + let prices = await priceCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/prices?'); + expect(prices.length).toBe(1); + + prices = await priceCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/prices?after=1'); + expect(prices.length).toBe(1); + }); + + test('should accept query params and return a list of prices', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListPriceMockResponse); + const pricesResource = new PricesResource(paddleInstance); + const queryParams: ListPriceQueryParameters = { + after: '2', + id: ['1234'], + }; + + const priceCollection = pricesResource.list(queryParams); + let prices = await priceCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/prices?after=2&id=1234'); + expect(prices.length).toBe(1); + }); + + test('should return a single price by ID', async () => { + const priceId = PriceMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(PriceMockResponse); + + const pricesResource = new PricesResource(paddleInstance); + const price = await pricesResource.get(priceId); + + expect(paddleInstance.get).toBeCalledWith(`/prices/${priceId}`, { queryParams: undefined }); + expect(price).toBeDefined(); + expect(price.id).toBe(priceId); + }); + + test('should accepts query params and return a single price by ID', async () => { + const priceId = PriceMock.id; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.get = jest.fn().mockResolvedValue(PriceMockResponse); + const pricesResource = new PricesResource(paddleInstance); + + const price = await pricesResource.get(priceId); + + expect(price).toBeDefined(); + expect(paddleInstance.get).toBeCalledWith(`/prices/${priceId}`, { queryParameters: undefined }); + expect(price.id).toBe(priceId); + }); + + test('should create a new price', async () => { + const newPrice = CreatePriceMock; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.post = jest.fn().mockResolvedValue(PriceMockResponse); + const pricesResource = new PricesResource(paddleInstance); + const createdPrice = await pricesResource.create(newPrice); + + expect(paddleInstance.post).toBeCalledWith(`/prices`, newPrice); + expect(createdPrice).toBeDefined(); + expect(createdPrice.id).toBeDefined(); + expect(convertToSnakeCase(CreatePriceMock)).toEqual(CreatePriceExpectation); + }); + + test('should update an existing price', async () => { + const priceId = PriceMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(PriceMockResponse); + + const pricesResource = new PricesResource(paddleInstance); + const updatedPrice = await pricesResource.update(priceId, UpdatePriceMock); + + expect(paddleInstance.patch).toBeCalledWith(`/prices/${priceId}`, UpdatePriceMock); + expect(updatedPrice).toBeDefined(); + expect(convertToSnakeCase(UpdatePriceMock)).toEqual(UpdatePriceExpectation); + }); + + test('should archive an existing price', async () => { + const priceId = PriceMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(PriceMockResponse); + + const pricesResource = new PricesResource(paddleInstance); + const updatedPrice = await pricesResource.archive(priceId); + + expect(paddleInstance.patch).toBeCalledWith(`/prices/${priceId}`, { status: 'archived' }); + expect(updatedPrice).toBeDefined(); + }); +}); diff --git a/src/__tests__/resources/pricing-preview.test.ts b/src/__tests__/resources/pricing-preview.test.ts new file mode 100644 index 0000000..7a038de --- /dev/null +++ b/src/__tests__/resources/pricing-preview.test.ts @@ -0,0 +1,22 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { PricingPreviewResource } from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { PricingPreviewMockResponse, PricingPreviewRequest } from '../mocks/resources/pricing-preview.mock'; + +describe('PricingPreviewResource', () => { + test('should return a preview of the price', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.post = jest.fn().mockResolvedValue(PricingPreviewMockResponse); + + const pricingPreviewResource = new PricingPreviewResource(paddleInstance); + const pricingPreview = await pricingPreviewResource.preview(PricingPreviewRequest); + + expect(paddleInstance.post).toBeCalledWith(`/pricing-preview`, PricingPreviewRequest); + expect(pricingPreview).toBeDefined(); + }); +}); diff --git a/src/__tests__/resources/products.test.ts b/src/__tests__/resources/products.test.ts new file mode 100644 index 0000000..ef0c190 --- /dev/null +++ b/src/__tests__/resources/products.test.ts @@ -0,0 +1,127 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + CreateProductRequestBody, + UpdateProductRequestBody, + ProductsResource, + ListProductQueryParameters, + GetProductQueryParameters, +} from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + ProductMockResponse, + ProductMock, + ListProductMockResponse, + CreateProductMock, + UpdateProductMock, +} from '../mocks/resources/products.mock'; +import { QueryParameters } from '../../internal/base'; + +describe('ProductsResource', () => { + test('should return a list of products', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListProductMockResponse); + + const productsResource = new ProductsResource(paddleInstance); + const productCollection = productsResource.list(); + + let products = await productCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/products?'); + expect(products.length).toBe(1); + + products = await productCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/products?after=1'); + expect(products.length).toBe(1); + }); + + test('should accept query params and return a list of products', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListProductMockResponse); + const productsResource = new ProductsResource(paddleInstance); + const queryParams: ListProductQueryParameters = { + after: '2', + id: ['1234'], + include: ['price'], + }; + + const productCollection = productsResource.list(queryParams); + let products = await productCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/products?after=2&id=1234&include=price'); + expect(products.length).toBe(1); + }); + + test('should return a single product by ID', async () => { + const productId = ProductMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ProductMockResponse); + + const productsResource = new ProductsResource(paddleInstance); + const product = await productsResource.get(productId); + + expect(paddleInstance.get).toBeCalledWith(`/products/${productId}`, { queryParams: undefined }); + expect(product).toBeDefined(); + expect(product.id).toBe(productId); + }); + + test('should accepts query params and return a single product by ID', async () => { + const productId = ProductMock.id; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.get = jest.fn().mockResolvedValue(ProductMockResponse); + const productsResource = new ProductsResource(paddleInstance); + + const queryParams: GetProductQueryParameters = { + include: ['price'], + }; + const product = await productsResource.get(productId, queryParams); + + expect(product).toBeDefined(); + expect(paddleInstance.get).toBeCalledWith(`/products/${productId}`, new QueryParameters(queryParams)); + expect(product.id).toBe(productId); + }); + + test('should create a new product', async () => { + const newProduct: CreateProductRequestBody = CreateProductMock; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.post = jest.fn().mockResolvedValue(ProductMockResponse); + const productsResource = new ProductsResource(paddleInstance); + const createdProduct = await productsResource.create(newProduct); + + expect(paddleInstance.post).toBeCalledWith(`/products`, newProduct); + expect(createdProduct).toBeDefined(); + expect(createdProduct.id).toBeDefined(); + }); + + test('should update an existing product', async () => { + const productId = ProductMock.id; + const productToBeUpdated: UpdateProductRequestBody = UpdateProductMock; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(ProductMockResponse); + + const productsResource = new ProductsResource(paddleInstance); + const updatedProduct = await productsResource.update(productId, productToBeUpdated); + + expect(paddleInstance.patch).toBeCalledWith(`/products/${productId}`, productToBeUpdated); + expect(updatedProduct).toBeDefined(); + }); + + test('should archive an existing product', async () => { + const productId = ProductMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(ProductMockResponse); + + const productsResource = new ProductsResource(paddleInstance); + const updatedProduct = await productsResource.archive(productId); + + expect(paddleInstance.patch).toBeCalledWith(`/products/${productId}`, { status: 'archived' }); + expect(updatedProduct).toBeDefined(); + }); +}); diff --git a/src/__tests__/resources/reports.test.ts b/src/__tests__/resources/reports.test.ts new file mode 100644 index 0000000..808cce7 --- /dev/null +++ b/src/__tests__/resources/reports.test.ts @@ -0,0 +1,98 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { CreateReportRequestBody, ListReportQueryParameters, ReportsResource } from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + ListReportMockResponse, + ReportCsvMockResponse, + ReportMock, + ReportMockResponse, +} from '../mocks/resources/reports.mock'; + +describe('ReportsResource', () => { + test('should return a list of reports', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListReportMockResponse); + + const reportsResource = new ReportsResource(paddleInstance); + const reportCollection = reportsResource.list(); + + let reports = await reportCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/reports?'); + expect(reports.length).toBe(1); + + reports = await reportCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/reports?after=1'); + expect(reports.length).toBe(1); + }); + + test('should accept query params and return a list of reports', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListReportMockResponse); + const reportsResource = new ReportsResource(paddleInstance); + const queryParams: ListReportQueryParameters = { + after: '2', + }; + + const reportCollection = reportsResource.list(queryParams); + let reports = await reportCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/reports?after=2'); + expect(reports.length).toBe(1); + }); + + test('should return a single report by ID', async () => { + const reportId = ReportMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ReportMockResponse); + + const reportsResource = new ReportsResource(paddleInstance); + const report = await reportsResource.get(reportId); + + expect(paddleInstance.get).toBeCalledWith(`/reports/${reportId}`); + expect(report).toBeDefined(); + expect(report.id).toBe(reportId); + }); + + test('should accepts query params and return a single report by ID', async () => { + const reportId = ReportMock.id; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.get = jest.fn().mockResolvedValue(ReportMockResponse); + const reportsResource = new ReportsResource(paddleInstance); + + const report = await reportsResource.get(reportId); + + expect(report).toBeDefined(); + expect(paddleInstance.get).toBeCalledWith(`/reports/${reportId}`); + expect(report.id).toBe(reportId); + }); + + test('should create a new report', async () => { + const newReport: CreateReportRequestBody = ReportMock; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.post = jest.fn().mockResolvedValue(ReportMockResponse); + const reportsResource = new ReportsResource(paddleInstance); + const createdReport = await reportsResource.create(newReport); + + expect(paddleInstance.post).toBeCalledWith(`/reports`, newReport); + expect(createdReport).toBeDefined(); + expect(createdReport.id).toBeDefined(); + }); + + test('should return a CSV link to download the report', async () => { + const paddleInstance = getPaddleTestClient(); + + paddleInstance.get = jest.fn().mockResolvedValue(ReportCsvMockResponse); + const reportsResource = new ReportsResource(paddleInstance); + const createdReport = await reportsResource.getReportCsv(ReportMock.id); + + expect(paddleInstance.get).toBeCalledWith(`/reports/${ReportMock.id}/download-url`); + expect(createdReport).toBeDefined(); + }); +}); diff --git a/src/__tests__/resources/subscriptions.test.ts b/src/__tests__/resources/subscriptions.test.ts new file mode 100644 index 0000000..59fd322 --- /dev/null +++ b/src/__tests__/resources/subscriptions.test.ts @@ -0,0 +1,223 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + CancelSubscription, + GetSubscriptionQueryParameters, + ListSubscriptionQueryParameters, + type PauseSubscription, + ResumeSubscription, + SubscriptionsResource, + UpdateSubscriptionRequestBody, +} from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + CreateSubscriptionExpectation, + CreateSubscriptionMock, + ListSubscriptionMockResponse, + SubscriptionMock, + SubscriptionMockResponse, + SubscriptionPreviewMockResponse, + UpdateSubscriptionExpectation, + UpdateSubscriptionMock, +} from '../mocks/resources/subscriptions.mock'; +import { QueryParameters } from '../../internal/base'; +import { convertToSnakeCase } from '../../internal'; +import { TransactionMockResponse } from '../mocks/resources/transactions.mock'; + +describe('SubscriptionsResource', () => { + test('should return a list of subscriptions', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListSubscriptionMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const subscriptionCollection = subscriptionsResource.list(); + + let subscriptions = await subscriptionCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/subscriptions?'); + expect(subscriptions.length).toBe(1); + + subscriptions = await subscriptionCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/subscriptions?after=1'); + expect(subscriptions.length).toBe(1); + }); + + test('should accept query params and return a list of subscriptions', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListSubscriptionMockResponse); + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const queryParams: ListSubscriptionQueryParameters = { + after: '2', + id: ['1234'], + }; + + const subscriptionCollection = subscriptionsResource.list(queryParams); + let subscriptions = await subscriptionCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/subscriptions?after=2&id=1234'); + expect(subscriptions.length).toBe(1); + }); + + test('should return a single subscription by ID', async () => { + const subscriptionId = SubscriptionMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(SubscriptionMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const subscription = await subscriptionsResource.get(subscriptionId); + + expect(paddleInstance.get).toBeCalledWith(`/subscriptions/${subscriptionId}`, { queryParams: undefined }); + expect(subscription).toBeDefined(); + expect(subscription.id).toBe(subscriptionId); + }); + + test('should accepts query params and return a single subscription by ID', async () => { + const subscriptionId = SubscriptionMock.id; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.get = jest.fn().mockResolvedValue(SubscriptionMockResponse); + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + + const queryParams: GetSubscriptionQueryParameters = { + include: ['recurring_transaction_details', 'next_transaction'], + }; + const subscription = await subscriptionsResource.get(subscriptionId, queryParams); + + expect(subscription).toBeDefined(); + expect(paddleInstance.get).toBeCalledWith(`/subscriptions/${subscriptionId}`, new QueryParameters(queryParams)); + expect(subscription.id).toBe(subscriptionId); + }); + + test('should update an existing subscription', async () => { + const subscriptionId = SubscriptionMock.id; + const subscriptionToBeUpdated: UpdateSubscriptionRequestBody = UpdateSubscriptionMock; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(SubscriptionMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const updatedSubscription = await subscriptionsResource.update(subscriptionId, subscriptionToBeUpdated); + + expect(paddleInstance.patch).toBeCalledWith(`/subscriptions/${subscriptionId}`, subscriptionToBeUpdated); + expect(updatedSubscription).toBeDefined(); + expect(convertToSnakeCase(UpdateSubscriptionMock)).toEqual(UpdateSubscriptionExpectation); + }); + + test('should preview update an existing subscription', async () => { + const subscriptionId = SubscriptionMock.id; + const subscriptionToBeUpdated: UpdateSubscriptionRequestBody = UpdateSubscriptionMock; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(SubscriptionMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const updatedSubscription = await subscriptionsResource.previewUpdate(subscriptionId, subscriptionToBeUpdated); + + expect(paddleInstance.patch).toBeCalledWith(`/subscriptions/${subscriptionId}/preview`, subscriptionToBeUpdated); + expect(updatedSubscription).toBeDefined(); + expect(convertToSnakeCase(UpdateSubscriptionMock)).toEqual(UpdateSubscriptionExpectation); + }); + + test('should activate an existing subscription', async () => { + const subscriptionId = SubscriptionMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.post = jest.fn().mockResolvedValue(SubscriptionMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const updatedSubscription = await subscriptionsResource.activate(subscriptionId); + + expect(paddleInstance.post).toBeCalledWith(`/subscriptions/${subscriptionId}/activate`, undefined); + expect(updatedSubscription).toBeDefined(); + }); + + test('should pause an existing subscription', async () => { + const subscriptionId = SubscriptionMock.id; + const subscriptionToBeUpdated: PauseSubscription = { effectiveFrom: 'next_billing_period' }; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.post = jest.fn().mockResolvedValue(SubscriptionMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const updatedSubscription = await subscriptionsResource.pause(subscriptionId, subscriptionToBeUpdated); + + expect(paddleInstance.post).toBeCalledWith(`/subscriptions/${subscriptionId}/pause`, subscriptionToBeUpdated); + expect(updatedSubscription).toBeDefined(); + }); + + test('should resume an existing subscription', async () => { + const subscriptionId = SubscriptionMock.id; + const subscriptionToBeUpdated: ResumeSubscription = { effectiveFrom: 'next_billing_period' }; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.post = jest.fn().mockResolvedValue(SubscriptionMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const updatedSubscription = await subscriptionsResource.resume(subscriptionId, subscriptionToBeUpdated); + + expect(paddleInstance.post).toBeCalledWith(`/subscriptions/${subscriptionId}/resume`, subscriptionToBeUpdated); + expect(updatedSubscription).toBeDefined(); + }); + + test('should cancel an existing subscription', async () => { + const subscriptionId = SubscriptionMock.id; + const subscriptionToBeUpdated: CancelSubscription = { effectiveFrom: 'next_billing_period' }; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.post = jest.fn().mockResolvedValue(SubscriptionMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const updatedSubscription = await subscriptionsResource.cancel(subscriptionId, subscriptionToBeUpdated); + + expect(paddleInstance.post).toBeCalledWith(`/subscriptions/${subscriptionId}/cancel`, subscriptionToBeUpdated); + expect(updatedSubscription).toBeDefined(); + }); + + test('should return a transaction to update payment method', async () => { + const subscriptionId = SubscriptionMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(TransactionMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const subscription = await subscriptionsResource.getPaymentMethodChangeTransaction(subscriptionId); + + expect(paddleInstance.get).toBeCalledWith(`/subscriptions/${subscriptionId}/update-payment-method-transaction`); + expect(subscription).toBeDefined(); + }); + + test('should preview create an one off charge for an existing subscription', async () => { + const subscriptionId = SubscriptionMock.id; + const subscriptionToBeUpdated = CreateSubscriptionMock; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.post = jest.fn().mockResolvedValue(SubscriptionPreviewMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const subscription = await subscriptionsResource.previewOneTimeCharge(subscriptionId, subscriptionToBeUpdated); + + expect(paddleInstance.post).toBeCalledWith( + `/subscriptions/${subscriptionId}/charge/preview`, + subscriptionToBeUpdated, + ); + expect(subscription).toBeDefined(); + }); + + test('should create an one off charge for an existing subscription', async () => { + const subscriptionId = SubscriptionMock.id; + const subscriptionToBeUpdated = CreateSubscriptionMock; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.post = jest.fn().mockResolvedValue(SubscriptionMockResponse); + + const subscriptionsResource = new SubscriptionsResource(paddleInstance); + const subscription = await subscriptionsResource.createOneTimeCharge(subscriptionId, subscriptionToBeUpdated); + + expect(paddleInstance.post).toBeCalledWith(`/subscriptions/${subscriptionId}/charge`, subscriptionToBeUpdated); + expect(subscription).toBeDefined(); + expect(convertToSnakeCase(CreateSubscriptionMock)).toEqual(CreateSubscriptionExpectation); + }); +}); diff --git a/src/__tests__/resources/transactions.test.ts b/src/__tests__/resources/transactions.test.ts new file mode 100644 index 0000000..05f48ef --- /dev/null +++ b/src/__tests__/resources/transactions.test.ts @@ -0,0 +1,144 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + CreateTransactionRequestBody, + GetTransactionQueryParameters, + ListTransactionQueryParameters, + TransactionsResource, + UpdateTransactionRequestBody, +} from '../../resources'; +import { getPaddleTestClient } from '../helpers/test-client'; +import { + CreateTransactionExpectation, + CreateTransactionMock, + ListTransactionMockResponse, + PreviewTransactionMock, + TransactionMock, + TransactionMockResponse, + TransactionPreviewMockResponse, + UpdateTransactionExpectation, + UpdateTransactionMock, +} from '../mocks/resources/transactions.mock'; +import { QueryParameters } from '../../internal/base'; +import { convertToSnakeCase } from '../../internal'; + +describe('TransactionsResource', () => { + test('should return a list of transactions', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListTransactionMockResponse); + + const transactionsResource = new TransactionsResource(paddleInstance); + const transactionCollection = transactionsResource.list(); + + let transactions = await transactionCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/transactions?'); + expect(transactions.length).toBe(1); + + transactions = await transactionCollection.next(); + expect(paddleInstance.get).toBeCalledWith('/transactions?after=1'); + expect(transactions.length).toBe(1); + }); + + test('should accept query params and return a list of transactions', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(ListTransactionMockResponse); + const transactionsResource = new TransactionsResource(paddleInstance); + const queryParams: ListTransactionQueryParameters = { + after: '2', + id: ['1234'], + }; + + const transactionCollection = transactionsResource.list(queryParams); + let transactions = await transactionCollection.next(); + + expect(paddleInstance.get).toBeCalledWith('/transactions?after=2&id=1234'); + expect(transactions.length).toBe(1); + }); + + test('should return a single transaction by ID', async () => { + const transactionId = TransactionMock.id; + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(TransactionMockResponse); + + const transactionsResource = new TransactionsResource(paddleInstance); + const transaction = await transactionsResource.get(transactionId); + + expect(paddleInstance.get).toBeCalledWith(`/transactions/${transactionId}`, { queryParams: undefined }); + expect(transaction).toBeDefined(); + expect(transaction.id).toBe(transactionId); + }); + + test('should accepts query params and return a single transaction by ID', async () => { + const transactionId = TransactionMock.id; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.get = jest.fn().mockResolvedValue(TransactionMockResponse); + const transactionsResource = new TransactionsResource(paddleInstance); + + const queryParams: GetTransactionQueryParameters = { + include: ['address', 'adjustment'], + }; + const transaction = await transactionsResource.get(transactionId, queryParams); + + expect(transaction).toBeDefined(); + expect(paddleInstance.get).toBeCalledWith(`/transactions/${transactionId}`, new QueryParameters(queryParams)); + expect(transaction.id).toBe(transactionId); + }); + + test('should create a new transaction', async () => { + const newTransaction: CreateTransactionRequestBody = CreateTransactionMock; + const paddleInstance = getPaddleTestClient(); + + paddleInstance.post = jest.fn().mockResolvedValue(TransactionMockResponse); + const transactionsResource = new TransactionsResource(paddleInstance); + const createdTransaction = await transactionsResource.create(newTransaction); + + expect(paddleInstance.post).toBeCalledWith(`/transactions?`, newTransaction); + expect(createdTransaction).toBeDefined(); + expect(createdTransaction.id).toBeDefined(); + expect(convertToSnakeCase(CreateTransactionMock)).toEqual(CreateTransactionExpectation); + }); + + test('should update an existing transaction', async () => { + const transactionId = TransactionMock.id; + const transactionToBeUpdated: UpdateTransactionRequestBody = UpdateTransactionMock; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.patch = jest.fn().mockResolvedValue(TransactionMockResponse); + + const transactionsResource = new TransactionsResource(paddleInstance); + const updatedTransaction = await transactionsResource.update(transactionId, transactionToBeUpdated); + + expect(paddleInstance.patch).toBeCalledWith(`/transactions/${transactionId}`, transactionToBeUpdated); + expect(updatedTransaction).toBeDefined(); + expect(convertToSnakeCase(UpdateTransactionMock)).toEqual(UpdateTransactionExpectation); + }); + + test('should get an link to download invoice PDF for an existing transaction', async () => { + const transactionId = TransactionMock.id; + + const paddleInstance = getPaddleTestClient(); + paddleInstance.get = jest.fn().mockResolvedValue(TransactionMockResponse); + + const transactionsResource = new TransactionsResource(paddleInstance); + const updatedTransaction = await transactionsResource.getInvoicePDF(transactionId); + + expect(paddleInstance.get).toBeCalledWith(`/transactions/${transactionId}/invoice`); + expect(updatedTransaction).toBeDefined(); + }); + + test('should be able to preview a transaction', async () => { + const paddleInstance = getPaddleTestClient(); + paddleInstance.post = jest.fn().mockResolvedValue(TransactionPreviewMockResponse); + + const transactionsResource = new TransactionsResource(paddleInstance); + const updatedTransaction = await transactionsResource.preview(PreviewTransactionMock); + + expect(paddleInstance.post).toBeCalledWith(`/transactions/preview`, PreviewTransactionMock); + expect(updatedTransaction).toBeDefined(); + }); +}); diff --git a/src/entities/address/address-collection.ts b/src/entities/address/address-collection.ts new file mode 100644 index 0000000..b4f55c3 --- /dev/null +++ b/src/entities/address/address-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Address } from './address'; +import { type IAddressResponse } from '../../types'; +import { Collection } from '../../internal/base'; + +export class AddressCollection extends Collection { + override fromJson(data: IAddressResponse): Address { + return new Address(data); + } +} diff --git a/src/entities/address/address.ts b/src/entities/address/address.ts new file mode 100644 index 0000000..58e4d7c --- /dev/null +++ b/src/entities/address/address.ts @@ -0,0 +1,41 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CustomData, ImportMeta } from '../index'; +import { type CountryCode, type Status } from '../../enums'; +import { type IAddressResponse } from '../../types'; + +export class Address { + public readonly id: string; + public readonly description: string | null; + public readonly firstLine: string | null; + public readonly secondLine: string | null; + public readonly city: string | null; + public readonly postalCode: string | null; + public readonly region: string | null; + public readonly countryCode: CountryCode; + public readonly customData: CustomData | null; + public readonly status: Status; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly importMeta: ImportMeta | null; + + constructor(address: IAddressResponse) { + this.id = address.id; + this.description = address.description ? address.description : null; + this.firstLine = address.first_line ? address.first_line : null; + this.secondLine = address.second_line ? address.second_line : null; + this.city = address.city ? address.city : null; + this.postalCode = address.postal_code ? address.postal_code : null; + this.region = address.region ? address.region : null; + this.countryCode = address.country_code; + this.customData = address.custom_data ? address.custom_data : null; + this.status = address.status; + this.createdAt = address.created_at; + this.updatedAt = address.updated_at; + this.importMeta = address.import_meta ? new ImportMeta(address.import_meta) : null; + } +} diff --git a/src/entities/address/index.ts b/src/entities/address/index.ts new file mode 100644 index 0000000..43f4e10 --- /dev/null +++ b/src/entities/address/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './address-collection'; +export * from './address'; diff --git a/src/entities/adjustment/adjustment-collection.ts b/src/entities/adjustment/adjustment-collection.ts new file mode 100644 index 0000000..a64f225 --- /dev/null +++ b/src/entities/adjustment/adjustment-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Adjustment } from './adjustment'; +import { type IAdjustmentResponse } from '../../types'; +import { Collection } from '../../internal/base'; + +export class AdjustmentCollection extends Collection { + override fromJson(data: IAdjustmentResponse): Adjustment { + return new Adjustment(data); + } +} diff --git a/src/entities/adjustment/adjustment-item-totals.ts b/src/entities/adjustment/adjustment-item-totals.ts new file mode 100644 index 0000000..4a78f61 --- /dev/null +++ b/src/entities/adjustment/adjustment-item-totals.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentItemTotals } from '../../types'; + +export class AdjustmentItemTotals { + public readonly subtotal: string; + public readonly tax: string; + public readonly total: string; + + constructor(adjustmentItemTotals: IAdjustmentItemTotals) { + this.subtotal = adjustmentItemTotals.subtotal; + this.tax = adjustmentItemTotals.tax; + this.total = adjustmentItemTotals.total; + } +} diff --git a/src/entities/adjustment/adjustment-item.ts b/src/entities/adjustment/adjustment-item.ts new file mode 100644 index 0000000..10bc5d3 --- /dev/null +++ b/src/entities/adjustment/adjustment-item.ts @@ -0,0 +1,27 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentItemResponse } from '../../types'; +import { AdjustmentItemTotals, AdjustmentProration } from '../index'; +import { type AdjustmentType } from '../../enums'; + +export class AdjustmentItem { + public readonly id: string; + public readonly itemId: string; + public readonly type: AdjustmentType; + public readonly amount: string | null; + public readonly proration: AdjustmentProration | null; + public readonly totals: AdjustmentItemTotals | null; + + constructor(adjustmentItem: IAdjustmentItemResponse) { + this.id = adjustmentItem.id; + this.itemId = adjustmentItem.item_id; + this.type = adjustmentItem.type; + this.amount = adjustmentItem.amount ? adjustmentItem.amount : null; + this.proration = adjustmentItem.proration ? new AdjustmentProration(adjustmentItem.proration) : null; + this.totals = adjustmentItem.totals ? new AdjustmentItemTotals(adjustmentItem.totals) : null; + } +} diff --git a/src/entities/adjustment/adjustment-proration.ts b/src/entities/adjustment/adjustment-proration.ts new file mode 100644 index 0000000..00d6b67 --- /dev/null +++ b/src/entities/adjustment/adjustment-proration.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentsProrationResponse } from '../../types'; +import { AdjustmentTimePeriod } from '../index'; + +export class AdjustmentProration { + public readonly rate: string; + public readonly billingPeriod: AdjustmentTimePeriod | null; + + constructor(adjustmentsProration: IAdjustmentsProrationResponse) { + this.rate = adjustmentsProration.rate; + this.billingPeriod = adjustmentsProration.billing_period + ? new AdjustmentTimePeriod(adjustmentsProration.billing_period) + : null; + } +} diff --git a/src/entities/adjustment/adjustment-time-period.ts b/src/entities/adjustment/adjustment-time-period.ts new file mode 100644 index 0000000..fb8ccde --- /dev/null +++ b/src/entities/adjustment/adjustment-time-period.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentsTimePeriodResponse } from '../../types'; + +export class AdjustmentTimePeriod { + public readonly startsAt: string; + public readonly endsAt: string; + + constructor(adjustmentsTimePeriod: IAdjustmentsTimePeriodResponse) { + this.startsAt = adjustmentsTimePeriod.starts_at; + this.endsAt = adjustmentsTimePeriod.ends_at; + } +} diff --git a/src/entities/adjustment/adjustment.ts b/src/entities/adjustment/adjustment.ts new file mode 100644 index 0000000..1efcfa9 --- /dev/null +++ b/src/entities/adjustment/adjustment.ts @@ -0,0 +1,43 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { AdjustmentItem, PayoutTotalsAdjustment, TotalAdjustments } from '../index'; +import { type AdjustmentAction, type AdjustmentStatus, type CurrencyCode } from '../../enums'; +import { type IAdjustmentResponse } from '../../types'; + +export class Adjustment { + public readonly id: string; + public readonly action: AdjustmentAction; + public readonly transactionId: string; + public readonly subscriptionId: string | null; + public readonly customerId: string; + public readonly reason: string; + public readonly creditAppliedToBalance: boolean; + public readonly currencyCode: CurrencyCode; + public readonly status: AdjustmentStatus; + public readonly items: AdjustmentItem[]; + public readonly totals: TotalAdjustments; + public readonly payoutTotals: PayoutTotalsAdjustment | null; + public readonly createdAt: string; + public readonly updatedAt: string; + + constructor(adjustment: IAdjustmentResponse) { + this.id = adjustment.id; + this.action = adjustment.action; + this.transactionId = adjustment.transaction_id; + this.subscriptionId = adjustment.subscription_id ? adjustment.subscription_id : null; + this.customerId = adjustment.customer_id; + this.reason = adjustment.reason; + this.creditAppliedToBalance = adjustment.credit_applied_to_balance; + this.currencyCode = adjustment.currency_code; + this.status = adjustment.status; + this.items = adjustment.items.map((item) => new AdjustmentItem(item)); + this.totals = new TotalAdjustments(adjustment.totals); + this.payoutTotals = adjustment.payout_totals ? new PayoutTotalsAdjustment(adjustment.payout_totals) : null; + this.createdAt = adjustment.created_at; + this.updatedAt = adjustment.updated_at; + } +} diff --git a/src/entities/adjustment/index.ts b/src/entities/adjustment/index.ts new file mode 100644 index 0000000..454c3b8 --- /dev/null +++ b/src/entities/adjustment/index.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './adjustment-time-period'; +export * from './adjustment-proration'; +export * from './adjustment-item'; +export * from './adjustment'; +export * from './adjustment-collection'; +export * from './adjustment-item-totals'; diff --git a/src/entities/business/business-collection.ts b/src/entities/business/business-collection.ts new file mode 100644 index 0000000..19bd793 --- /dev/null +++ b/src/entities/business/business-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Business } from './business'; +import { type IBusinessResponse } from '../../types'; +import { Collection } from '../../internal/base'; + +export class BusinessCollection extends Collection { + override fromJson(data: IBusinessResponse): Business { + return new Business(data); + } +} diff --git a/src/entities/business/business.ts b/src/entities/business/business.ts new file mode 100644 index 0000000..5d4d6af --- /dev/null +++ b/src/entities/business/business.ts @@ -0,0 +1,35 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Contacts, type CustomData, ImportMeta } from '../index'; +import { type Status } from '../../enums'; +import { type IBusinessResponse } from '../../types'; + +export class Business { + public readonly id: string; + public readonly name: string; + public readonly companyNumber: string | null; + public readonly taxIdentifier: string | null; + public readonly status: Status; + public readonly contacts: Contacts[] | null; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly customData: CustomData | null; + public readonly importMeta: ImportMeta | null; + + constructor(business: IBusinessResponse) { + this.id = business.id; + this.name = business.name; + this.companyNumber = business.company_number ? business.company_number : null; + this.taxIdentifier = business.tax_identifier ? business.tax_identifier : null; + this.status = business.status; + this.contacts = business.contacts ? business.contacts.map((contact) => new Contacts(contact)) : null; + this.createdAt = business.created_at; + this.updatedAt = business.updated_at; + this.customData = business.custom_data ? business.custom_data : null; + this.importMeta = business.import_meta ? new ImportMeta(business.import_meta) : null; + } +} diff --git a/src/entities/business/contacts.ts b/src/entities/business/contacts.ts new file mode 100644 index 0000000..e2164e8 --- /dev/null +++ b/src/entities/business/contacts.ts @@ -0,0 +1,16 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type IBusinessContacts } from '../../types'; + +export class Contacts { + public readonly name: string | null; + public readonly email: string; + + constructor(contacts: IBusinessContacts) { + this.name = contacts.name ? contacts.name : null; + this.email = contacts.email; + } +} diff --git a/src/entities/business/index.ts b/src/entities/business/index.ts new file mode 100644 index 0000000..98160f5 --- /dev/null +++ b/src/entities/business/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './business-collection'; +export * from './contacts'; +export * from './business'; diff --git a/src/entities/customer/credit-balance.ts b/src/entities/customer/credit-balance.ts new file mode 100644 index 0000000..9e97863 --- /dev/null +++ b/src/entities/customer/credit-balance.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICreditBalanceResponse } from '../../types'; +import { CustomerBalance } from '../index'; +import { type CurrencyCode } from '../../enums'; + +export class CreditBalance { + public readonly customerId: string | null; + public readonly currencyCode: CurrencyCode | null; + public readonly balance: CustomerBalance | null; + + constructor(creditBalance: ICreditBalanceResponse) { + this.customerId = creditBalance.customer_id ? creditBalance.customer_id : null; + this.currencyCode = creditBalance.currency_code ? creditBalance.currency_code : null; + this.balance = creditBalance.balance ? new CustomerBalance(creditBalance.balance) : null; + } +} diff --git a/src/entities/customer/customer-balance.ts b/src/entities/customer/customer-balance.ts new file mode 100644 index 0000000..48d536e --- /dev/null +++ b/src/entities/customer/customer-balance.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomerBalance } from '../../types'; + +export class CustomerBalance { + public readonly available: string; + public readonly reserved: string; + public readonly used: string; + + constructor(customerBalance: ICustomerBalance) { + this.available = customerBalance.available; + this.reserved = customerBalance.reserved; + this.used = customerBalance.used; + } +} diff --git a/src/entities/customer/customer-collection.ts b/src/entities/customer/customer-collection.ts new file mode 100644 index 0000000..42e6710 --- /dev/null +++ b/src/entities/customer/customer-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Customer } from './customer'; +import { type ICustomerResponse } from '../../types'; +import { Collection } from '../../internal/base'; + +export class CustomerCollection extends Collection { + override fromJson(data: ICustomerResponse): Customer { + return new Customer(data); + } +} diff --git a/src/entities/customer/customer.ts b/src/entities/customer/customer.ts new file mode 100644 index 0000000..f6d826a --- /dev/null +++ b/src/entities/customer/customer.ts @@ -0,0 +1,35 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CustomData, ImportMeta } from '../index'; +import { type Status } from '../../enums'; +import { type ICustomerResponse } from '../../types'; + +export class Customer { + public readonly id: string; + public readonly name: string | null; + public readonly email: string; + public readonly marketingConsent: boolean; + public readonly status: Status; + public readonly customData: CustomData | null; + public readonly locale: string; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly importMeta: ImportMeta | null; + + constructor(customer: ICustomerResponse) { + this.id = customer.id; + this.name = customer.name ? customer.name : null; + this.email = customer.email; + this.marketingConsent = customer.marketing_consent; + this.status = customer.status; + this.customData = customer.custom_data ? customer.custom_data : null; + this.locale = customer.locale; + this.createdAt = customer.created_at; + this.updatedAt = customer.updated_at; + this.importMeta = customer.import_meta ? new ImportMeta(customer.import_meta) : null; + } +} diff --git a/src/entities/customer/index.ts b/src/entities/customer/index.ts new file mode 100644 index 0000000..95fe3f3 --- /dev/null +++ b/src/entities/customer/index.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './customer-collection'; +export * from './customer'; +export * from './credit-balance'; +export * from './customer-balance'; diff --git a/src/entities/discount/discount-collection.ts b/src/entities/discount/discount-collection.ts new file mode 100644 index 0000000..0f554b7 --- /dev/null +++ b/src/entities/discount/discount-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Discount } from './discount'; +import { type IDiscountResponse } from '../../types'; +import { Collection } from '../../internal/base'; + +export class DiscountCollection extends Collection { + override fromJson(data: IDiscountResponse): Discount { + return new Discount(data); + } +} diff --git a/src/entities/discount/discount.ts b/src/entities/discount/discount.ts new file mode 100644 index 0000000..4d16f4b --- /dev/null +++ b/src/entities/discount/discount.ts @@ -0,0 +1,51 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode, type DiscountStatus, type DiscountType } from '../../enums'; +import { type IDiscountResponse } from '../../types'; +import { type CustomData, ImportMeta } from '../index'; + +export class Discount { + public readonly id: string; + public readonly status: DiscountStatus; + public readonly description: string; + public readonly enabledForCheckout: boolean; + public readonly code: string | null; + public readonly type: DiscountType; + public readonly amount: string; + public readonly currencyCode: CurrencyCode | null; + public readonly recur: boolean; + public readonly maximumRecurringIntervals: number | null; + public readonly usageLimit: number | null; + public readonly restrictTo: string[] | null; + public readonly expiresAt: string | null; + public readonly customData: CustomData | null; + public readonly timesUsed: number | null; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly importMeta: ImportMeta | null; + + constructor(discount: IDiscountResponse) { + this.id = discount.id; + this.status = discount.status; + this.description = discount.description; + this.enabledForCheckout = discount.enabled_for_checkout; + this.code = discount.code ? discount.code : null; + this.type = discount.type; + this.amount = discount.amount; + this.currencyCode = discount.currency_code ? discount.currency_code : null; + this.recur = discount.recur; + this.maximumRecurringIntervals = discount.maximum_recurring_intervals ? discount.maximum_recurring_intervals : null; + this.usageLimit = discount.usage_limit ? discount.usage_limit : null; + this.restrictTo = discount.restrict_to ? discount.restrict_to : null; + this.expiresAt = discount.expires_at ? discount.expires_at : null; + this.customData = discount.custom_data ? discount.custom_data : null; + this.timesUsed = discount.times_used ?? null; + this.createdAt = discount.created_at; + this.updatedAt = discount.updated_at; + this.importMeta = discount.import_meta ? new ImportMeta(discount.import_meta) : null; + } +} diff --git a/src/entities/discount/index.ts b/src/entities/discount/index.ts new file mode 100644 index 0000000..067ccb5 --- /dev/null +++ b/src/entities/discount/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './discount-collection'; +export * from './discount'; diff --git a/src/entities/event-types/event-type.ts b/src/entities/event-types/event-type.ts new file mode 100644 index 0000000..d624ab9 --- /dev/null +++ b/src/entities/event-types/event-type.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type IEventTypeResponse } from '../../types'; +import { type IEventName } from '../../notifications'; + +export class EventType { + public readonly name: IEventName; + public readonly description: string; + public readonly group: string; + public readonly availableVersions: number[]; + + constructor(eventType: IEventTypeResponse) { + this.name = eventType.name; + this.description = eventType.description; + this.group = eventType.group; + this.availableVersions = eventType.available_versions; + } +} diff --git a/src/entities/event-types/index.ts b/src/entities/event-types/index.ts new file mode 100644 index 0000000..18595b7 --- /dev/null +++ b/src/entities/event-types/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './event-type'; diff --git a/src/entities/events/event-collection.ts b/src/entities/events/event-collection.ts new file mode 100644 index 0000000..33e6ecf --- /dev/null +++ b/src/entities/events/event-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Collection } from '../../internal/base'; +import { type IEvents, type IEventsResponse } from '../../types'; +import { type EventEntity, Webhooks } from '../../notifications'; + +export class EventCollection extends Collection { + override fromJson(data: IEvents): EventEntity | null { + return Webhooks.fromJson(data); + } +} diff --git a/src/entities/events/event.ts b/src/entities/events/event.ts new file mode 100644 index 0000000..57264a4 --- /dev/null +++ b/src/entities/events/event.ts @@ -0,0 +1,23 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IEventsResponse } from '../../types'; + +export class Event { + public eventId: string; + public notificationId: string | null; + public eventType: string; + public occurredAt: string; + public data: object; + + constructor(eventData: IEventsResponse) { + this.eventId = eventData.event_id; + this.notificationId = eventData.notification_id ?? null; + this.eventType = eventData.event_type; + this.occurredAt = eventData.occurred_at; + this.data = eventData.data; + } +} diff --git a/src/entities/events/index.ts b/src/entities/events/index.ts new file mode 100644 index 0000000..0702380 --- /dev/null +++ b/src/entities/events/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './event-collection'; diff --git a/src/entities/index.ts b/src/entities/index.ts new file mode 100644 index 0000000..774a192 --- /dev/null +++ b/src/entities/index.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './shared'; +export * from './product'; +export * from './price'; +export * from './transaction'; +export * from './adjustment'; +export * from './customer'; +export * from './business'; +export * from './subscription'; +export * from './address'; +export * from './discount'; +export * from './events'; +export * from './payout'; +export * from './event-types'; +export * from './notification-settings'; +export * from './notifications'; +export * from './report'; + +export type CustomData = object; diff --git a/src/entities/notification-settings/index.ts b/src/entities/notification-settings/index.ts new file mode 100644 index 0000000..f46a874 --- /dev/null +++ b/src/entities/notification-settings/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './notification-settings'; diff --git a/src/entities/notification-settings/notification-settings.ts b/src/entities/notification-settings/notification-settings.ts new file mode 100644 index 0000000..a4ec274 --- /dev/null +++ b/src/entities/notification-settings/notification-settings.ts @@ -0,0 +1,34 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type NotificationSettingsType } from '../../enums'; +import { EventType } from '../event-types'; +import { type INotificationSettingsResponse } from '../../types/notification-settings'; + +export class NotificationSettings { + public readonly id: string; + public readonly description: string; + public readonly type: NotificationSettingsType; + public readonly destination: string; + public readonly active: boolean; + public readonly apiVersion: number; + public readonly includeSensitiveFields: boolean; + public readonly subscribedEvents: EventType[]; + public readonly endpointSecretKey: string; + + constructor(notificationSettings: INotificationSettingsResponse) { + this.id = notificationSettings.id; + this.description = notificationSettings.description; + this.type = notificationSettings.type; + this.destination = notificationSettings.destination; + this.active = notificationSettings.active; + this.apiVersion = notificationSettings.api_version; + this.includeSensitiveFields = notificationSettings.include_sensitive_fields; + this.subscribedEvents = notificationSettings.subscribed_events.map( + (subscribed_event) => new EventType(subscribed_event), + ); + this.endpointSecretKey = notificationSettings.endpoint_secret_key; + } +} diff --git a/src/entities/notifications/index.ts b/src/entities/notifications/index.ts new file mode 100644 index 0000000..ec88d59 --- /dev/null +++ b/src/entities/notifications/index.ts @@ -0,0 +1,11 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './notification'; +export * from './notification-log'; +export * from './notification-collection'; +export * from './replay-notification'; +export * from './notification-log-collection'; diff --git a/src/entities/notifications/notification-collection.ts b/src/entities/notifications/notification-collection.ts new file mode 100644 index 0000000..1d95097 --- /dev/null +++ b/src/entities/notifications/notification-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Collection } from '../../internal/base'; +import { Notification } from './notification'; +import { type INotificationResponse } from '../../types/notifications'; + +export class NotificationCollection extends Collection { + override fromJson(data: INotificationResponse): Notification { + return new Notification(data); + } +} diff --git a/src/entities/notifications/notification-log-collection.ts b/src/entities/notifications/notification-log-collection.ts new file mode 100644 index 0000000..bbd069d --- /dev/null +++ b/src/entities/notifications/notification-log-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Collection } from '../../internal/base'; +import { type INotificationLogResponse } from '../../types'; +import { NotificationLog } from './notification-log'; + +export class NotificationLogCollection extends Collection { + override fromJson(data: INotificationLogResponse): NotificationLog { + return new NotificationLog(data); + } +} diff --git a/src/entities/notifications/notification-log.ts b/src/entities/notifications/notification-log.ts new file mode 100644 index 0000000..ad74f91 --- /dev/null +++ b/src/entities/notifications/notification-log.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export class NotificationLog { + public readonly id: string; + public readonly responseCode: number; + public readonly responseContentType: string | null; + public readonly responseBody: string; + public readonly attemptedAt: string; + + constructor(notificationLogResponse: any) { + this.id = notificationLogResponse.id; + this.responseCode = notificationLogResponse.response_code; + this.responseContentType = notificationLogResponse.response_content_type ?? null; + this.responseBody = notificationLogResponse.response_body; + this.attemptedAt = notificationLogResponse.attempted_at; + } +} diff --git a/src/entities/notifications/notification.ts b/src/entities/notifications/notification.ts new file mode 100644 index 0000000..0c9acf3 --- /dev/null +++ b/src/entities/notifications/notification.ts @@ -0,0 +1,39 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type NotificationStatus, type Origin } from '../../enums'; +import { type EventEntity, type IEventName, Webhooks } from '../../notifications'; +import { type INotificationResponse } from '../../types'; + +export class Notification { + public readonly id: string; + public readonly type: IEventName; + public readonly status: NotificationStatus; + public readonly payload: EventEntity | null; + public readonly occurredAt: string; + public readonly deliveredAt: null | string; + public readonly replayedAt: null | string; + public readonly origin: Origin; + public readonly lastAttemptAt: null | string; + public readonly retryAt: null | string; + public readonly timesAttempted: number; + public readonly notificationSettingId: string; + + constructor(notificationResponse: INotificationResponse) { + this.id = notificationResponse.id; + this.type = notificationResponse.type; + this.status = notificationResponse.status; + this.payload = Webhooks.fromJson(notificationResponse.payload); + this.occurredAt = notificationResponse.occurred_at; + this.deliveredAt = notificationResponse.delivered_at ?? null; + this.replayedAt = notificationResponse.replayed_at ?? null; + this.origin = notificationResponse.origin; + this.lastAttemptAt = notificationResponse.last_attempt_at ?? null; + this.retryAt = notificationResponse.retry_at ?? null; + this.timesAttempted = notificationResponse.times_attempted; + this.notificationSettingId = notificationResponse.notification_setting_id; + } +} diff --git a/src/entities/notifications/replay-notification.ts b/src/entities/notifications/replay-notification.ts new file mode 100644 index 0000000..393dc49 --- /dev/null +++ b/src/entities/notifications/replay-notification.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IReplayNotificationResponse } from '../../types/notifications'; + +export class ReplayNotification { + public readonly notificationId: string; + + constructor(notificationResponse: IReplayNotificationResponse) { + this.notificationId = notificationResponse.notification_id; + } +} diff --git a/src/entities/payout/index.ts b/src/entities/payout/index.ts new file mode 100644 index 0000000..329c1de --- /dev/null +++ b/src/entities/payout/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './payout'; diff --git a/src/entities/payout/payout.ts b/src/entities/payout/payout.ts new file mode 100644 index 0000000..9c53b8c --- /dev/null +++ b/src/entities/payout/payout.ts @@ -0,0 +1,22 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IPayoutResponse } from '../../types'; +import { type CurrencyCode, type PayoutStatus } from '../../enums'; + +export class Payout { + public readonly id: string; + public readonly status: PayoutStatus; + public readonly amount: string; + public readonly currencyCode: CurrencyCode; + + constructor(payout: IPayoutResponse) { + this.id = payout.id; + this.status = payout.status; + this.amount = payout.amount; + this.currencyCode = payout.currency_code; + } +} diff --git a/src/entities/price/index.ts b/src/entities/price/index.ts new file mode 100644 index 0000000..360882c --- /dev/null +++ b/src/entities/price/index.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './price-with-includes'; +export * from './price-collection'; +export * from './price-quantity'; +export * from './price'; diff --git a/src/entities/price/price-collection.ts b/src/entities/price/price-collection.ts new file mode 100644 index 0000000..5247bd4 --- /dev/null +++ b/src/entities/price/price-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { PriceWithIncludes } from './price-with-includes'; +import { type IPriceResponse } from '../../types'; +import { Collection } from '../../internal/base'; + +export class PriceCollection extends Collection { + override fromJson(data: IPriceResponse): PriceWithIncludes { + return new PriceWithIncludes(data); + } +} diff --git a/src/entities/price/price-quantity.ts b/src/entities/price/price-quantity.ts new file mode 100644 index 0000000..28a9229 --- /dev/null +++ b/src/entities/price/price-quantity.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IPriceQuantity } from '../../types'; + +export class PriceQuantity { + public readonly minimum: number; + public readonly maximum: number; + + constructor(priceQuantity: IPriceQuantity) { + this.minimum = priceQuantity.minimum; + this.maximum = priceQuantity.maximum; + } +} diff --git a/src/entities/price/price-with-includes.ts b/src/entities/price/price-with-includes.ts new file mode 100644 index 0000000..c6e599d --- /dev/null +++ b/src/entities/price/price-with-includes.ts @@ -0,0 +1,47 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IPriceResponse } from '../../types'; +import { type CustomData, ImportMeta, Money, PriceQuantity, Product, TimePeriod, UnitPriceOverride } from '../index'; +import { type CatalogType, type Status, type TaxMode } from '../../enums'; + +export class PriceWithIncludes { + public readonly id: string; + public readonly productId: string; + public readonly description: string; + public readonly name: string | null; + public readonly type: CatalogType | null; + public readonly billingCycle: TimePeriod | null; + public readonly trialPeriod: TimePeriod | null; + public readonly taxMode: TaxMode; + public readonly unitPrice: Money; + public readonly unitPriceOverrides: UnitPriceOverride[]; + public readonly quantity: PriceQuantity; + public readonly status: Status; + public readonly customData: CustomData | null; + public readonly importMeta: ImportMeta | null; + public readonly product: Product | null; + + constructor(price: IPriceResponse) { + this.id = price.id; + this.productId = price.product_id; + this.description = price.description; + this.type = price.type ?? null; + this.name = price.name ? price.name : null; + this.billingCycle = price.billing_cycle ? new TimePeriod(price.billing_cycle) : null; + this.trialPeriod = price.trial_period ? new TimePeriod(price.trial_period) : null; + this.taxMode = price.tax_mode; + this.unitPrice = new Money(price.unit_price); + this.unitPriceOverrides = price.unit_price_overrides.map( + (unit_price_override) => new UnitPriceOverride(unit_price_override), + ); + this.quantity = new PriceQuantity(price.quantity); + this.status = price.status; + this.customData = price.custom_data ? price.custom_data : null; + this.importMeta = price.import_meta ? new ImportMeta(price.import_meta) : null; + this.product = price.product ? new Product(price.product) : null; + } +} diff --git a/src/entities/price/price.ts b/src/entities/price/price.ts new file mode 100644 index 0000000..8c1d173 --- /dev/null +++ b/src/entities/price/price.ts @@ -0,0 +1,45 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData, type ISharedPriceResponse } from '../../types'; +import { TimePeriod, Money, UnitPriceOverride, PriceQuantity, ImportMeta } from '../index'; +import { type TaxMode, type Status, type CatalogType } from '../../enums'; + +export class Price { + public readonly id: string; + public readonly productId: string; + public readonly description: string; + public readonly name: string | null; + public readonly type: CatalogType | null; + public readonly billingCycle: TimePeriod | null; + public readonly trialPeriod: TimePeriod | null; + public readonly taxMode: TaxMode; + public readonly unitPrice: Money | null; + public readonly unitPriceOverrides: UnitPriceOverride[] | null; + public readonly quantity: PriceQuantity | null; + public readonly status: Status; + public readonly customData: ICustomData | null; + public readonly importMeta: ImportMeta | null; + + constructor(price: ISharedPriceResponse) { + this.id = price.id; + this.productId = price.product_id; + this.description = price.description; + this.type = price.type ?? null; + this.name = price.name ? price.name : null; + this.billingCycle = price.billing_cycle ? new TimePeriod(price.billing_cycle) : null; + this.trialPeriod = price.trial_period ? new TimePeriod(price.trial_period) : null; + this.taxMode = price.tax_mode; + this.unitPrice = price.unit_price ? new Money(price.unit_price) : null; + this.unitPriceOverrides = price.unit_price_overrides + ? price.unit_price_overrides?.map((unit_price_override) => new UnitPriceOverride(unit_price_override)) + : null; + this.quantity = price.quantity ? new PriceQuantity(price.quantity) : null; + this.status = price.status; + this.customData = price.custom_data ? price.custom_data : null; + this.importMeta = price.import_meta ? new ImportMeta(price.import_meta) : null; + } +} diff --git a/src/entities/pricing-preview/index.ts b/src/entities/pricing-preview/index.ts new file mode 100644 index 0000000..b25bcec --- /dev/null +++ b/src/entities/pricing-preview/index.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './pricing-preview-discounts'; +export * from './pricing-preview-line-item'; +export * from './pricing-preview-details'; +export * from './pricing-preview'; diff --git a/src/entities/pricing-preview/pricing-preview-details.ts b/src/entities/pricing-preview/pricing-preview-details.ts new file mode 100644 index 0000000..f615ecd --- /dev/null +++ b/src/entities/pricing-preview/pricing-preview-details.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { PricingPreviewLineItem } from './pricing-preview-line-item'; +import { type IPricingPreviewDetailsResponse } from '../../types'; + +export class PricingPreviewDetails { + public readonly lineItems: PricingPreviewLineItem[]; + + constructor(details: IPricingPreviewDetailsResponse) { + this.lineItems = details.line_items.map((line_item) => new PricingPreviewLineItem(line_item)); + } +} diff --git a/src/entities/pricing-preview/pricing-preview-discounts.ts b/src/entities/pricing-preview/pricing-preview-discounts.ts new file mode 100644 index 0000000..c777193 --- /dev/null +++ b/src/entities/pricing-preview/pricing-preview-discounts.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IPricingPreviewDiscountsResponse } from '../../types'; +import { Discount } from '../index'; + +export class PricingPreviewDiscounts { + public readonly discount: Discount; + public readonly total: string; + public readonly formattedTotal: string; + + constructor(previewDiscount: IPricingPreviewDiscountsResponse) { + this.discount = new Discount(previewDiscount.discount); + this.total = previewDiscount.total; + this.formattedTotal = previewDiscount.formatted_total; + } +} diff --git a/src/entities/pricing-preview/pricing-preview-line-item.ts b/src/entities/pricing-preview/pricing-preview-line-item.ts new file mode 100644 index 0000000..93f2dc4 --- /dev/null +++ b/src/entities/pricing-preview/pricing-preview-line-item.ts @@ -0,0 +1,35 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Price } from '../price'; +import { Totals } from '../shared'; +import { Product } from '../product'; +import { PricingPreviewDiscounts } from './pricing-preview-discounts'; +import { type IPricingPreviewLineItemResponse } from '../../types'; + +export class PricingPreviewLineItem { + public readonly price: Price; + public readonly quantity: number; + public readonly taxRate: string; + public readonly unitTotals: Totals; + public readonly formattedUnitTotals: Totals; + public readonly totals: Totals; + public readonly formattedTotals: Totals; + public readonly product: Product; + public readonly discounts: PricingPreviewDiscounts[]; + + constructor(lineItem: IPricingPreviewLineItemResponse) { + this.price = new Price(lineItem.price); + this.quantity = lineItem.quantity; + this.taxRate = lineItem.tax_rate; + this.unitTotals = new Totals(lineItem.unit_totals); + this.formattedUnitTotals = new Totals(lineItem.formatted_unit_totals); + this.totals = new Totals(lineItem.totals); + this.formattedTotals = new Totals(lineItem.formatted_totals); + this.product = new Product(lineItem.product); + this.discounts = lineItem.discounts.map((discount) => new PricingPreviewDiscounts(discount)); + } +} diff --git a/src/entities/pricing-preview/pricing-preview.ts b/src/entities/pricing-preview/pricing-preview.ts new file mode 100644 index 0000000..6c906b8 --- /dev/null +++ b/src/entities/pricing-preview/pricing-preview.ts @@ -0,0 +1,35 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode } from '../../enums'; +import { type IPricingPreviewResponse } from '../../types'; +import { AddressPreview } from '../transaction'; +import { PricingPreviewDetails } from './pricing-preview-details'; +import { type AvailablePaymentMethod } from '../../enums/shared/available-payment-methods'; + +export class PricingPreview { + public readonly customerId: string | null; + public readonly addressId: string | null; + public readonly businessId: string | null; + public readonly currencyCode: CurrencyCode | null; + public readonly discountId: string | null; + public readonly address: AddressPreview | null; + public readonly customerIpAddress: string | null; + public readonly details: PricingPreviewDetails | null; + public readonly availablePaymentMethods: AvailablePaymentMethod | null; + + constructor(pricePreview: IPricingPreviewResponse) { + this.customerId = pricePreview.customer_id ?? null; + this.addressId = pricePreview.address_id ?? null; + this.businessId = pricePreview.business_id ?? null; + this.currencyCode = pricePreview.currency_code ?? null; + this.discountId = pricePreview.discount_id ?? null; + this.address = pricePreview.address ? new AddressPreview(pricePreview.address) : null; + this.customerIpAddress = pricePreview.customer_ip_address ?? null; + this.details = pricePreview.details ? new PricingPreviewDetails(pricePreview.details) : null; + this.availablePaymentMethods = pricePreview.available_payment_method ?? null; + } +} diff --git a/src/entities/product/index.ts b/src/entities/product/index.ts new file mode 100644 index 0000000..28505ee --- /dev/null +++ b/src/entities/product/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './product-with-includes'; +export * from './product-collection'; +export * from './product'; diff --git a/src/entities/product/product-collection.ts b/src/entities/product/product-collection.ts new file mode 100644 index 0000000..5f7bafe --- /dev/null +++ b/src/entities/product/product-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { ProductWithIncludes } from './product-with-includes'; +import { type IProductResponse } from '../../types'; +import { Collection } from '../../internal/base'; + +export class ProductCollection extends Collection { + override fromJson(data: IProductResponse): ProductWithIncludes { + return new ProductWithIncludes(data); + } +} diff --git a/src/entities/product/product-with-includes.ts b/src/entities/product/product-with-includes.ts new file mode 100644 index 0000000..10050b9 --- /dev/null +++ b/src/entities/product/product-with-includes.ts @@ -0,0 +1,37 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IProductResponse } from '../../types'; +import { type CustomData, ImportMeta, Price } from '../index'; +import { type CatalogType, type Status, type TaxCategory } from '../../enums'; + +export class ProductWithIncludes { + public readonly id: string; + public readonly name: string; + public readonly type: CatalogType | null; + public readonly description: string | null; + public readonly taxCategory: TaxCategory; + public readonly imageUrl: string | null; + public readonly customData: CustomData | null; + public readonly status: Status; + public readonly createdAt: string; + public readonly importMeta: ImportMeta | null; + public readonly prices: Price[] | null; + + constructor(product: IProductResponse) { + this.id = product.id; + this.name = product.name; + this.type = product.type ?? null; + this.description = product.description ? product.description : null; + this.taxCategory = product.tax_category; + this.imageUrl = product.image_url ? product.image_url : null; + this.customData = product.custom_data ? product.custom_data : null; + this.status = product.status; + this.createdAt = product.created_at; + this.importMeta = product.import_meta ? new ImportMeta(product.import_meta) : null; + this.prices = product.prices ? product.prices.map((price) => new Price(price)) : null; + } +} diff --git a/src/entities/product/product.ts b/src/entities/product/product.ts new file mode 100644 index 0000000..8fef2de --- /dev/null +++ b/src/entities/product/product.ts @@ -0,0 +1,35 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISharedProductResponse } from '../../types'; +import { type CustomData, ImportMeta } from '../index'; +import { type TaxCategory, type Status, type CatalogType } from '../../enums'; + +export class Product { + public readonly id: string; + public readonly name: string; + public readonly type: CatalogType | null; + public readonly description: string | null; + public readonly taxCategory: TaxCategory; + public readonly imageUrl: string | null; + public readonly customData: CustomData | null; + public readonly status: Status; + public readonly createdAt: string; + public readonly importMeta: ImportMeta | null; + + constructor(product: ISharedProductResponse) { + this.id = product.id; + this.name = product.name; + this.type = product.type ?? null; + this.description = product.description ? product.description : null; + this.taxCategory = product.tax_category; + this.imageUrl = product.image_url ? product.image_url : null; + this.customData = product.custom_data ? product.custom_data : null; + this.status = product.status; + this.createdAt = product.created_at; + this.importMeta = product.import_meta ? new ImportMeta(product.import_meta) : null; + } +} diff --git a/src/entities/report/index.ts b/src/entities/report/index.ts new file mode 100644 index 0000000..8ef34f4 --- /dev/null +++ b/src/entities/report/index.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './report-filters'; +export * from './report'; +export * from './report-csv'; +export * from './report-collection'; diff --git a/src/entities/report/report-collection.ts b/src/entities/report/report-collection.ts new file mode 100644 index 0000000..aa2a9d5 --- /dev/null +++ b/src/entities/report/report-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Report } from '../../entities'; +import { type IReportResponse } from '../../types'; +import { Collection } from '../../internal/base'; + +export class ReportCollection extends Collection { + override fromJson(data: IReportResponse): Report { + return new Report(data); + } +} diff --git a/src/entities/report/report-csv.ts b/src/entities/report/report-csv.ts new file mode 100644 index 0000000..d182a85 --- /dev/null +++ b/src/entities/report/report-csv.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IReportCsvResponse } from '../../types'; + +export class ReportCsv { + public readonly url: string; + + constructor(response: IReportCsvResponse) { + this.url = response.url; + } +} diff --git a/src/entities/report/report-filters.ts b/src/entities/report/report-filters.ts new file mode 100644 index 0000000..fb6d94c --- /dev/null +++ b/src/entities/report/report-filters.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IReportFilters } from '../../types'; +import { type ReportFilterName, type ReportFilterOperator } from '../../enums'; + +export class ReportFilters { + public readonly name: ReportFilterName; + public readonly operator: null | ReportFilterOperator; + public readonly value: string[] | string; + + constructor(reportFiltersResponse: IReportFilters) { + this.name = reportFiltersResponse.name; + this.operator = reportFiltersResponse.operator ?? null; + this.value = reportFiltersResponse.value; + } +} diff --git a/src/entities/report/report.ts b/src/entities/report/report.ts new file mode 100644 index 0000000..a273200 --- /dev/null +++ b/src/entities/report/report.ts @@ -0,0 +1,29 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IReportResponse } from '../../types'; +import { ReportFilters } from '../index'; +import { type ReportStatus, type ReportType } from '../../enums'; + +export class Report { + public readonly id: string; + public readonly status: ReportStatus; + public readonly rows: number | null; + public readonly type: ReportType; + public readonly filters: ReportFilters[]; + public readonly expiresAt: string | null; + public readonly createdAt: string; + + constructor(reportResponse: IReportResponse) { + this.id = reportResponse.id; + this.status = reportResponse.status; + this.rows = reportResponse.rows ?? null; + this.type = reportResponse.type; + this.filters = reportResponse.filters?.map((filter) => new ReportFilters(filter)); + this.expiresAt = reportResponse.expires_at ?? null; + this.createdAt = reportResponse.created_at; + } +} diff --git a/src/entities/shared/adjustment-original-amount.ts b/src/entities/shared/adjustment-original-amount.ts new file mode 100644 index 0000000..e24912a --- /dev/null +++ b/src/entities/shared/adjustment-original-amount.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentOriginalAmountResponse } from '../../types'; +import { type AdjustmentCurrencyCode } from '../../enums'; + +export class AdjustmentOriginalAmount { + public readonly amount: string; + public readonly currencyCode: AdjustmentCurrencyCode; + + constructor(originalAmount: IAdjustmentOriginalAmountResponse) { + this.amount = originalAmount.amount; + this.currencyCode = originalAmount.currency_code; + } +} diff --git a/src/entities/shared/billing-details.ts b/src/entities/shared/billing-details.ts new file mode 100644 index 0000000..c875c1c --- /dev/null +++ b/src/entities/shared/billing-details.ts @@ -0,0 +1,22 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IBillingDetailsResponse } from '../../types'; +import { TimePeriod } from '../index'; + +export class BillingDetails { + public readonly enableCheckout: boolean | null; + public readonly purchaseOrderNumber: string | null; + public readonly additionalInformation: string | null; + public readonly paymentTerms: TimePeriod; + + constructor(billingDetails: IBillingDetailsResponse) { + this.enableCheckout = billingDetails.enable_checkout ?? null; + this.purchaseOrderNumber = billingDetails.purchase_order_number ? billingDetails.purchase_order_number : null; + this.additionalInformation = billingDetails.additional_information ? billingDetails.additional_information : null; + this.paymentTerms = new TimePeriod(billingDetails.payment_terms); + } +} diff --git a/src/entities/shared/chargeback-fee.ts b/src/entities/shared/chargeback-fee.ts new file mode 100644 index 0000000..38ce516 --- /dev/null +++ b/src/entities/shared/chargeback-fee.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IChargebackFee } from '../../types'; +import { AdjustmentOriginalAmount } from '../index'; + +export class ChargebackFee { + public readonly amount: string; + public readonly original: AdjustmentOriginalAmount | null; + + constructor(chargebackFee: IChargebackFee) { + this.amount = chargebackFee.amount; + this.original = chargebackFee.original ? new AdjustmentOriginalAmount(chargebackFee.original) : null; + } +} diff --git a/src/entities/shared/import-meta.ts b/src/entities/shared/import-meta.ts new file mode 100644 index 0000000..5e9a6f9 --- /dev/null +++ b/src/entities/shared/import-meta.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IImportMetaResponse } from '../../types'; + +export class ImportMeta { + public readonly externalId: string | null; + public readonly importedFrom: string; + + constructor(importMeta: IImportMetaResponse) { + this.externalId = importMeta.external_id ? importMeta.external_id : null; + this.importedFrom = importMeta.imported_from; + } +} diff --git a/src/entities/shared/index.ts b/src/entities/shared/index.ts new file mode 100644 index 0000000..8e83ffa --- /dev/null +++ b/src/entities/shared/index.ts @@ -0,0 +1,26 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './time-period'; +export * from './money'; +export * from './unit-price-override'; +export * from './billing-details'; +export * from './totals'; +export * from './tax-rates-used'; +export * from './transaction-totals'; +export * from './transaction-totals-adjusted'; +export * from './transaction-payout-totals'; +export * from './adjustment-original-amount'; +export * from './chargeback-fee'; +export * from './transaction-payout-totals-adjusted'; +export * from './unit-totals'; +export * from './payment-card'; +export * from './payment-method-details'; +export * from './transaction-payment-attempt'; +export * from './transaction-checkout'; +export * from './total-adjustments'; +export * from './payout-totals-adjustment'; +export * from './import-meta'; diff --git a/src/entities/shared/money.ts b/src/entities/shared/money.ts new file mode 100644 index 0000000..fd139df --- /dev/null +++ b/src/entities/shared/money.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IMoneyResponse } from '../../types'; +import { type CurrencyCode } from '../../enums'; + +export class Money { + public readonly amount: string; + public readonly currencyCode: CurrencyCode; + + constructor(money: IMoneyResponse) { + this.amount = money.amount; + this.currencyCode = money.currency_code; + } +} diff --git a/src/entities/shared/payment-card.ts b/src/entities/shared/payment-card.ts new file mode 100644 index 0000000..cb8c64e --- /dev/null +++ b/src/entities/shared/payment-card.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IPaymentCardResponse } from '../../types'; +import { type PaymentCardType } from '../../enums'; + +export class PaymentCard { + public readonly type: PaymentCardType; + public readonly last4: string; + public readonly expiryMonth: number; + public readonly expiryYear: number; + public readonly cardholderName: string; + + constructor(paymentCard: IPaymentCardResponse) { + this.type = paymentCard.type; + this.last4 = paymentCard.last4; + this.expiryMonth = paymentCard.expiry_month; + this.expiryYear = paymentCard.expiry_year; + this.cardholderName = paymentCard.cardholder_name; + } +} diff --git a/src/entities/shared/payment-method-details.ts b/src/entities/shared/payment-method-details.ts new file mode 100644 index 0000000..86dee4f --- /dev/null +++ b/src/entities/shared/payment-method-details.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IPaymentMethodDetails } from '../../types'; +import { PaymentCard } from '../index'; +import { type PaymentType } from '../../enums'; + +export class PaymentMethodDetails { + public readonly type: PaymentType; + public readonly card: PaymentCard | null; + + constructor(paymentMethodDetails: IPaymentMethodDetails) { + this.type = paymentMethodDetails.type; + this.card = paymentMethodDetails.card ? new PaymentCard(paymentMethodDetails.card) : null; + } +} diff --git a/src/entities/shared/payout-totals-adjustment.ts b/src/entities/shared/payout-totals-adjustment.ts new file mode 100644 index 0000000..5504d77 --- /dev/null +++ b/src/entities/shared/payout-totals-adjustment.ts @@ -0,0 +1,31 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IPayoutTotalsAdjustmentResponse } from '../../types'; +import { ChargebackFee } from '../index'; +import { type PayoutCurrencyCode } from '../../enums'; + +export class PayoutTotalsAdjustment { + public readonly subtotal: string; + public readonly tax: string; + public readonly total: string; + public readonly fee: string; + public readonly chargebackFee: ChargebackFee | null; + public readonly earnings: string; + public readonly currencyCode: PayoutCurrencyCode; + + constructor(payoutTotalsAdjustment: IPayoutTotalsAdjustmentResponse) { + this.subtotal = payoutTotalsAdjustment.subtotal; + this.tax = payoutTotalsAdjustment.tax; + this.total = payoutTotalsAdjustment.total; + this.fee = payoutTotalsAdjustment.fee; + this.chargebackFee = payoutTotalsAdjustment.chargeback_fee + ? new ChargebackFee(payoutTotalsAdjustment.chargeback_fee) + : null; + this.earnings = payoutTotalsAdjustment.earnings; + this.currencyCode = payoutTotalsAdjustment.currency_code; + } +} diff --git a/src/entities/shared/tax-rates-used.ts b/src/entities/shared/tax-rates-used.ts new file mode 100644 index 0000000..1bb483c --- /dev/null +++ b/src/entities/shared/tax-rates-used.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITaxRatesUsedResponse } from '../../types'; +import { Totals } from '../index'; + +export class TaxRatesUsed { + public readonly taxRate: string; + public readonly totals: Totals | null; + + constructor(taxRatesUsed: ITaxRatesUsedResponse) { + this.taxRate = taxRatesUsed.tax_rate; + this.totals = taxRatesUsed.totals ? new Totals(taxRatesUsed.totals) : null; + } +} diff --git a/src/entities/shared/time-period.ts b/src/entities/shared/time-period.ts new file mode 100644 index 0000000..8370643 --- /dev/null +++ b/src/entities/shared/time-period.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITimePeriod } from '../../types'; +import { type Interval } from '../../enums'; + +export class TimePeriod { + public readonly interval: Interval; + public readonly frequency: number; + + constructor(timePeriod: ITimePeriod) { + this.interval = timePeriod.interval; + this.frequency = timePeriod.frequency; + } +} diff --git a/src/entities/shared/total-adjustments.ts b/src/entities/shared/total-adjustments.ts new file mode 100644 index 0000000..541e5f9 --- /dev/null +++ b/src/entities/shared/total-adjustments.ts @@ -0,0 +1,26 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITotalAdjustmentsResponse } from '../../types'; +import { type CurrencyCode } from '../../enums'; + +export class TotalAdjustments { + public readonly subtotal: string; + public readonly tax: string; + public readonly total: string; + public readonly fee: string; + public readonly earnings: string; + public readonly currencyCode: CurrencyCode; + + constructor(totalAdjustments: ITotalAdjustmentsResponse) { + this.subtotal = totalAdjustments.subtotal; + this.tax = totalAdjustments.tax; + this.total = totalAdjustments.total; + this.fee = totalAdjustments.fee; + this.earnings = totalAdjustments.earnings; + this.currencyCode = totalAdjustments.currency_code; + } +} diff --git a/src/entities/shared/totals.ts b/src/entities/shared/totals.ts new file mode 100644 index 0000000..8a2c7e3 --- /dev/null +++ b/src/entities/shared/totals.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITotals } from '../../types'; + +export class Totals { + public readonly subtotal: string; + public readonly discount: string; + public readonly tax: string; + public readonly total: string; + + constructor(totals: ITotals) { + this.subtotal = totals.subtotal; + this.discount = totals.discount; + this.tax = totals.tax; + this.total = totals.total; + } +} diff --git a/src/entities/shared/transaction-checkout.ts b/src/entities/shared/transaction-checkout.ts new file mode 100644 index 0000000..c78709f --- /dev/null +++ b/src/entities/shared/transaction-checkout.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionCheckout } from '../../types'; + +export class TransactionCheckout { + public readonly url: string | null; + + constructor(transactionCheckout: ITransactionCheckout) { + this.url = transactionCheckout.url ? transactionCheckout.url : null; + } +} diff --git a/src/entities/shared/transaction-payment-attempt.ts b/src/entities/shared/transaction-payment-attempt.ts new file mode 100644 index 0000000..39f313c --- /dev/null +++ b/src/entities/shared/transaction-payment-attempt.ts @@ -0,0 +1,33 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionPaymentAttemptResponse } from '../../types'; +import { PaymentMethodDetails } from '../index'; +import { type PaymentAttemptStatus, type ErrorCode } from '../../enums'; + +export class TransactionPaymentAttempt { + public readonly paymentAttemptId: string; + public readonly storedPaymentMethodId: string; + public readonly amount: string; + public readonly status: PaymentAttemptStatus; + public readonly errorCode: ErrorCode | null; + public readonly methodDetails: PaymentMethodDetails | null; + public readonly createdAt: string; + public readonly capturedAt: string | null; + + constructor(transactionPaymentAttempt: ITransactionPaymentAttemptResponse) { + this.paymentAttemptId = transactionPaymentAttempt.payment_attempt_id; + this.storedPaymentMethodId = transactionPaymentAttempt.stored_payment_method_id; + this.amount = transactionPaymentAttempt.amount; + this.status = transactionPaymentAttempt.status; + this.errorCode = transactionPaymentAttempt.error_code ? transactionPaymentAttempt.error_code : null; + this.methodDetails = transactionPaymentAttempt.method_details + ? new PaymentMethodDetails(transactionPaymentAttempt.method_details) + : null; + this.createdAt = transactionPaymentAttempt.created_at; + this.capturedAt = transactionPaymentAttempt.captured_at ? transactionPaymentAttempt.captured_at : null; + } +} diff --git a/src/entities/shared/transaction-payout-totals-adjusted.ts b/src/entities/shared/transaction-payout-totals-adjusted.ts new file mode 100644 index 0000000..4c2b87f --- /dev/null +++ b/src/entities/shared/transaction-payout-totals-adjusted.ts @@ -0,0 +1,31 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionPayoutTotalsAdjustedResponse } from '../../types'; +import { ChargebackFee } from '../index'; +import { type PayoutCurrencyCode } from '../../enums'; + +export class TransactionPayoutTotalsAdjusted { + public readonly subtotal: string; + public readonly tax: string; + public readonly total: string; + public readonly fee: string; + public readonly chargebackFee: ChargebackFee | null; + public readonly earnings: string; + public readonly currencyCode: PayoutCurrencyCode; + + constructor(transactionPayoutTotalsAdjusted: ITransactionPayoutTotalsAdjustedResponse) { + this.subtotal = transactionPayoutTotalsAdjusted.subtotal; + this.tax = transactionPayoutTotalsAdjusted.tax; + this.total = transactionPayoutTotalsAdjusted.total; + this.fee = transactionPayoutTotalsAdjusted.fee; + this.chargebackFee = transactionPayoutTotalsAdjusted.chargeback_fee + ? new ChargebackFee(transactionPayoutTotalsAdjusted.chargeback_fee) + : null; + this.earnings = transactionPayoutTotalsAdjusted.earnings; + this.currencyCode = transactionPayoutTotalsAdjusted.currency_code; + } +} diff --git a/src/entities/shared/transaction-payout-totals.ts b/src/entities/shared/transaction-payout-totals.ts new file mode 100644 index 0000000..8d9b060 --- /dev/null +++ b/src/entities/shared/transaction-payout-totals.ts @@ -0,0 +1,36 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionPayoutTotalsResponse } from '../../types'; +import { type PayoutCurrencyCode } from '../../enums'; + +export class TransactionPayoutTotals { + public readonly subtotal: string; + public readonly discount: string; + public readonly tax: string; + public readonly total: string; + public readonly credit: string; + public readonly creditToBalance: string; + public readonly balance: string; + public readonly grandTotal: string; + public readonly fee: string; + public readonly earnings: string; + public readonly currencyCode: PayoutCurrencyCode; + + constructor(transactionPayoutTotals: ITransactionPayoutTotalsResponse) { + this.subtotal = transactionPayoutTotals.subtotal; + this.discount = transactionPayoutTotals.discount; + this.tax = transactionPayoutTotals.tax; + this.total = transactionPayoutTotals.total; + this.credit = transactionPayoutTotals.credit; + this.creditToBalance = transactionPayoutTotals.credit_to_balance; + this.balance = transactionPayoutTotals.balance; + this.grandTotal = transactionPayoutTotals.grand_total; + this.fee = transactionPayoutTotals.fee; + this.earnings = transactionPayoutTotals.earnings; + this.currencyCode = transactionPayoutTotals.currency_code; + } +} diff --git a/src/entities/shared/transaction-totals-adjusted.ts b/src/entities/shared/transaction-totals-adjusted.ts new file mode 100644 index 0000000..451e9e3 --- /dev/null +++ b/src/entities/shared/transaction-totals-adjusted.ts @@ -0,0 +1,28 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionTotalsAdjustedResponse } from '../../types'; +import { type CurrencyCode } from '../../enums'; + +export class TransactionTotalsAdjusted { + public readonly subtotal: string; + public readonly tax: string; + public readonly total: string; + public readonly grandTotal: string; + public readonly fee: string | null; + public readonly earnings: string | null; + public readonly currencyCode: CurrencyCode; + + constructor(transactionTotalsAdjusted: ITransactionTotalsAdjustedResponse) { + this.subtotal = transactionTotalsAdjusted.subtotal; + this.tax = transactionTotalsAdjusted.tax; + this.total = transactionTotalsAdjusted.total; + this.grandTotal = transactionTotalsAdjusted.grand_total; + this.fee = transactionTotalsAdjusted.fee ? transactionTotalsAdjusted.fee : null; + this.earnings = transactionTotalsAdjusted.earnings ? transactionTotalsAdjusted.earnings : null; + this.currencyCode = transactionTotalsAdjusted.currency_code; + } +} diff --git a/src/entities/shared/transaction-totals.ts b/src/entities/shared/transaction-totals.ts new file mode 100644 index 0000000..57e056f --- /dev/null +++ b/src/entities/shared/transaction-totals.ts @@ -0,0 +1,36 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionTotalsResponse } from '../../types'; +import { type CurrencyCode } from '../../enums'; + +export class TransactionTotals { + public readonly subtotal: string; + public readonly discount: string; + public readonly tax: string; + public readonly total: string; + public readonly credit: string; + public readonly creditToBalance: string; + public readonly balance: string; + public readonly grandTotal: string; + public readonly fee: string | null; + public readonly earnings: string | null; + public readonly currencyCode: CurrencyCode; + + constructor(transactionTotals: ITransactionTotalsResponse) { + this.subtotal = transactionTotals.subtotal; + this.discount = transactionTotals.discount; + this.tax = transactionTotals.tax; + this.total = transactionTotals.total; + this.credit = transactionTotals.credit; + this.creditToBalance = transactionTotals.credit_to_balance; + this.balance = transactionTotals.balance; + this.grandTotal = transactionTotals.grand_total; + this.fee = transactionTotals.fee ? transactionTotals.fee : null; + this.earnings = transactionTotals.earnings ? transactionTotals.earnings : null; + this.currencyCode = transactionTotals.currency_code; + } +} diff --git a/src/entities/shared/unit-price-override.ts b/src/entities/shared/unit-price-override.ts new file mode 100644 index 0000000..7950775 --- /dev/null +++ b/src/entities/shared/unit-price-override.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IUnitPriceOverrideResponse } from '../../types'; +import { Money } from '../index'; +import { type CountryCode } from '../../enums'; + +export class UnitPriceOverride { + public readonly countryCodes: CountryCode[]; + public readonly unitPrice: Money; + + constructor(unitPriceOverride: IUnitPriceOverrideResponse) { + this.countryCodes = unitPriceOverride.country_codes; + this.unitPrice = new Money(unitPriceOverride.unit_price); + } +} diff --git a/src/entities/shared/unit-totals.ts b/src/entities/shared/unit-totals.ts new file mode 100644 index 0000000..2669a71 --- /dev/null +++ b/src/entities/shared/unit-totals.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IUnitTotals } from '../../types'; + +export class UnitTotals { + public readonly subtotal: string; + public readonly discount: string; + public readonly tax: string; + public readonly total: string; + + constructor(unitTotals: IUnitTotals) { + this.subtotal = unitTotals.subtotal; + this.discount = unitTotals.discount; + this.tax = unitTotals.tax; + this.total = unitTotals.total; + } +} diff --git a/src/entities/subscription/index.ts b/src/entities/subscription/index.ts new file mode 100644 index 0000000..433e551 --- /dev/null +++ b/src/entities/subscription/index.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './subscription-discount'; +export * from './subscription-time-period'; +export * from './subscription-scheduled-change'; +export * from './subscription-management'; +export * from './subscription-price'; +export * from './subscription-item'; +export * from './subscription'; +export * from './subscription-collection'; +export * from './subscription-includes'; +export * from './next-transaction'; +export * from './transaction-details-preview'; +export * from './transaction-line-item-preview'; +export * from './subscription-preview'; +export * from './subscription-preview-update-summary'; +export * from './subscription-preview-summary-result'; +export * from './next-transaction-adjustment-preview'; +export * from './next-transaction-adjustment-item'; +export * from './subscription-notification'; diff --git a/src/entities/subscription/next-transaction-adjustment-item.ts b/src/entities/subscription/next-transaction-adjustment-item.ts new file mode 100644 index 0000000..3d3ff61 --- /dev/null +++ b/src/entities/subscription/next-transaction-adjustment-item.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { AdjustmentItemTotals, AdjustmentProration } from '../adjustment'; +import { type AdjustmentType } from '../../enums'; +import { type IAdjustmentItemResponse } from '../../types'; + +export class NextTransactionAdjustmentItem { + public readonly itemId: string; + public readonly type: AdjustmentType; + public readonly amount: string | null; + public readonly proration: AdjustmentProration | null; + public readonly totals: AdjustmentItemTotals | null; + + constructor(adjustmentItem: IAdjustmentItemResponse) { + this.itemId = adjustmentItem.item_id; + this.type = adjustmentItem.type; + this.amount = adjustmentItem.amount ? adjustmentItem.amount : null; + this.proration = adjustmentItem.proration ? new AdjustmentProration(adjustmentItem.proration) : null; + this.totals = adjustmentItem.totals ? new AdjustmentItemTotals(adjustmentItem.totals) : null; + } +} diff --git a/src/entities/subscription/next-transaction-adjustment-preview.ts b/src/entities/subscription/next-transaction-adjustment-preview.ts new file mode 100644 index 0000000..f12e1cd --- /dev/null +++ b/src/entities/subscription/next-transaction-adjustment-preview.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { NextTransactionAdjustmentItem } from './next-transaction-adjustment-item'; +import { TotalAdjustments } from '../shared'; +import { type AdjustmentPreviewResponse } from '../../types'; + +export class NextTransactionAdjustmentPreview { + public readonly transactionId: string; + public readonly items: NextTransactionAdjustmentItem[]; + public readonly totals: TotalAdjustments | null; + + constructor(adjustmentPreview: AdjustmentPreviewResponse) { + this.transactionId = adjustmentPreview.transaction_id; + this.items = adjustmentPreview.items.map((item) => new NextTransactionAdjustmentItem(item)); + this.totals = adjustmentPreview.totals ? new TotalAdjustments(adjustmentPreview.totals) : null; + } +} diff --git a/src/entities/subscription/next-transaction.ts b/src/entities/subscription/next-transaction.ts new file mode 100644 index 0000000..1106c44 --- /dev/null +++ b/src/entities/subscription/next-transaction.ts @@ -0,0 +1,22 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type INextTransactionResponse } from '../../types'; +import { SubscriptionTimePeriod, TransactionDetailsPreview, NextTransactionAdjustmentPreview } from '../index'; + +export class NextTransaction { + public readonly billingPeriod: SubscriptionTimePeriod; + public readonly details: TransactionDetailsPreview; + public readonly adjustments: NextTransactionAdjustmentPreview[]; + + constructor(nextTransaction: INextTransactionResponse) { + this.billingPeriod = new SubscriptionTimePeriod(nextTransaction.billing_period); + this.details = new TransactionDetailsPreview(nextTransaction.details); + this.adjustments = nextTransaction.adjustments.map( + (adjustment) => new NextTransactionAdjustmentPreview(adjustment), + ); + } +} diff --git a/src/entities/subscription/subscription-collection.ts b/src/entities/subscription/subscription-collection.ts new file mode 100644 index 0000000..ba1e842 --- /dev/null +++ b/src/entities/subscription/subscription-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Subscription } from './subscription'; +import { type ISubscriptionResponse } from '../../types'; +import { Collection } from '../../internal/base'; + +export class SubscriptionCollection extends Collection { + override fromJson(data: ISubscriptionResponse): Subscription { + return new Subscription(data); + } +} diff --git a/src/entities/subscription/subscription-discount.ts b/src/entities/subscription/subscription-discount.ts new file mode 100644 index 0000000..d8655e8 --- /dev/null +++ b/src/entities/subscription/subscription-discount.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionDiscountResponse } from '../../types'; + +export class SubscriptionDiscount { + public readonly id: string; + public readonly startsAt: string; + public readonly endsAt: string | null; + + constructor(subscriptionDiscount: ISubscriptionDiscountResponse) { + this.id = subscriptionDiscount.id; + this.startsAt = subscriptionDiscount.starts_at; + this.endsAt = subscriptionDiscount.ends_at ?? null; + } +} diff --git a/src/entities/subscription/subscription-includes.ts b/src/entities/subscription/subscription-includes.ts new file mode 100644 index 0000000..356f150 --- /dev/null +++ b/src/entities/subscription/subscription-includes.ts @@ -0,0 +1,85 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + BillingDetails, + type CustomData, + ImportMeta, + NextTransaction, + SubscriptionDiscount, + SubscriptionItem, + SubscriptionManagement, + SubscriptionScheduledChange, + SubscriptionTimePeriod, + TimePeriod, + TransactionDetailsPreview, +} from '../index'; +import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../enums'; +import { type ISubscriptionResponse } from '../../types'; + +export class SubscriptionIncludes { + public readonly id: string; + public readonly status: SubscriptionStatus; + public readonly customerId: string; + public readonly addressId: string; + public readonly businessId: string | null; + public readonly currencyCode: CurrencyCode; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly startedAt: string | null; + public readonly firstBilledAt: string | null; + public readonly nextBilledAt: string | null; + public readonly pausedAt: string | null; + public readonly canceledAt: string | null; + public readonly discount: SubscriptionDiscount | null; + public readonly collectionMode: CollectionMode; + public readonly billingDetails: BillingDetails | null; + public readonly currentBillingPeriod: SubscriptionTimePeriod | null; + public readonly billingCycle: TimePeriod; + public readonly scheduledChange: SubscriptionScheduledChange | null; + public readonly managementUrls: SubscriptionManagement | null; + public readonly items: SubscriptionItem[]; + public readonly customData: CustomData | null; + public readonly importMeta: ImportMeta | null; + public readonly nextTransaction: NextTransaction | null; + public readonly recurringTransactionDetails: TransactionDetailsPreview | null; + + constructor(subscription: ISubscriptionResponse) { + this.id = subscription.id; + this.status = subscription.status; + this.customerId = subscription.customer_id; + this.addressId = subscription.address_id; + this.businessId = subscription.business_id ? subscription.business_id : null; + this.currencyCode = subscription.currency_code; + this.createdAt = subscription.created_at; + this.updatedAt = subscription.updated_at; + this.startedAt = subscription.started_at ? subscription.started_at : null; + this.firstBilledAt = subscription.first_billed_at ? subscription.first_billed_at : null; + this.nextBilledAt = subscription.next_billed_at ? subscription.next_billed_at : null; + this.pausedAt = subscription.paused_at ? subscription.paused_at : null; + this.canceledAt = subscription.canceled_at ? subscription.canceled_at : null; + this.discount = subscription.discount ? new SubscriptionDiscount(subscription.discount) : null; + this.collectionMode = subscription.collection_mode; + this.billingDetails = subscription.billing_details ? new BillingDetails(subscription.billing_details) : null; + this.currentBillingPeriod = subscription.current_billing_period + ? new SubscriptionTimePeriod(subscription.current_billing_period) + : null; + this.billingCycle = new TimePeriod(subscription.billing_cycle); + this.scheduledChange = subscription.scheduled_change + ? new SubscriptionScheduledChange(subscription.scheduled_change) + : null; + this.managementUrls = subscription.management_urls + ? new SubscriptionManagement(subscription.management_urls) + : null; + this.items = subscription.items.map((item) => new SubscriptionItem(item)); + this.customData = subscription.custom_data ? subscription.custom_data : null; + this.importMeta = subscription.import_meta ? new ImportMeta(subscription.import_meta) : null; + this.nextTransaction = subscription.next_transaction ? new NextTransaction(subscription.next_transaction) : null; + this.recurringTransactionDetails = subscription.recurring_transaction_details + ? new TransactionDetailsPreview(subscription.recurring_transaction_details) + : null; + } +} diff --git a/src/entities/subscription/subscription-item.ts b/src/entities/subscription/subscription-item.ts new file mode 100644 index 0000000..b7326ee --- /dev/null +++ b/src/entities/subscription/subscription-item.ts @@ -0,0 +1,33 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionItemResponse } from '../../types'; +import { SubscriptionPrice, SubscriptionTimePeriod } from '../index'; +import { type SubscriptionItemStatus } from '../../enums'; + +export class SubscriptionItem { + public readonly status: SubscriptionItemStatus; + public readonly quantity: number; + public readonly recurring: boolean; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly previouslyBilledAt: string | null; + public readonly nextBilledAt: string | null; + public readonly trialDates: SubscriptionTimePeriod | null; + public readonly price: SubscriptionPrice | null; + + constructor(subscriptionItem: ISubscriptionItemResponse) { + this.status = subscriptionItem.status; + this.quantity = subscriptionItem.quantity; + this.recurring = subscriptionItem.recurring; + this.createdAt = subscriptionItem.created_at; + this.updatedAt = subscriptionItem.updated_at; + this.previouslyBilledAt = subscriptionItem.previously_billed_at ? subscriptionItem.previously_billed_at : null; + this.nextBilledAt = subscriptionItem.next_billed_at ? subscriptionItem.next_billed_at : null; + this.trialDates = subscriptionItem.trial_dates ? new SubscriptionTimePeriod(subscriptionItem.trial_dates) : null; + this.price = subscriptionItem.price ? new SubscriptionPrice(subscriptionItem.price) : null; + } +} diff --git a/src/entities/subscription/subscription-management.ts b/src/entities/subscription/subscription-management.ts new file mode 100644 index 0000000..3b4469a --- /dev/null +++ b/src/entities/subscription/subscription-management.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionManagementResponse } from '../../types'; + +export class SubscriptionManagement { + public readonly updatePaymentMethod: string | null; + public readonly cancel: string; + + constructor(subscriptionManagement: ISubscriptionManagementResponse) { + this.updatePaymentMethod = subscriptionManagement.update_payment_method + ? subscriptionManagement.update_payment_method + : null; + this.cancel = subscriptionManagement.cancel; + } +} diff --git a/src/entities/subscription/subscription-notification.ts b/src/entities/subscription/subscription-notification.ts new file mode 100644 index 0000000..cef8d54 --- /dev/null +++ b/src/entities/subscription/subscription-notification.ts @@ -0,0 +1,71 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + BillingDetails, + type CustomData, + SubscriptionDiscount, + SubscriptionItem, + SubscriptionScheduledChange, + SubscriptionTimePeriod, + TimePeriod, +} from '../index'; +import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../enums'; +import { type ISubscriptionNotificationResponse } from '../../types'; + +export class SubscriptionNotification { + public readonly id: string; + public readonly status: SubscriptionStatus; + public readonly transactionId: string | null; + public readonly customerId: string; + public readonly addressId: string; + public readonly businessId: string | null; + public readonly currencyCode: CurrencyCode; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly startedAt: string | null; + public readonly firstBilledAt: string | null; + public readonly nextBilledAt: string | null; + public readonly pausedAt: string | null; + public readonly canceledAt: string | null; + public readonly discount: SubscriptionDiscount | null; + public readonly collectionMode: CollectionMode; + public readonly billingDetails: BillingDetails | null; + public readonly currentBillingPeriod: SubscriptionTimePeriod | null; + public readonly billingCycle: TimePeriod; + public readonly scheduledChange: SubscriptionScheduledChange | null; + public readonly items: SubscriptionItem[]; + public readonly customData: CustomData | null; + + constructor(subscription: ISubscriptionNotificationResponse) { + this.id = subscription.id; + this.status = subscription.status; + this.transactionId = subscription.transaction_id ? subscription.transaction_id : null; + this.customerId = subscription.customer_id; + this.addressId = subscription.address_id; + this.businessId = subscription.business_id ? subscription.business_id : null; + this.currencyCode = subscription.currency_code; + this.createdAt = subscription.created_at; + this.updatedAt = subscription.updated_at; + this.startedAt = subscription.started_at ? subscription.started_at : null; + this.firstBilledAt = subscription.first_billed_at ? subscription.first_billed_at : null; + this.nextBilledAt = subscription.next_billed_at ? subscription.next_billed_at : null; + this.pausedAt = subscription.paused_at ? subscription.paused_at : null; + this.canceledAt = subscription.canceled_at ? subscription.canceled_at : null; + this.discount = subscription.discount ? new SubscriptionDiscount(subscription.discount) : null; + this.collectionMode = subscription.collection_mode; + this.billingDetails = subscription.billing_details ? new BillingDetails(subscription.billing_details) : null; + this.currentBillingPeriod = subscription.current_billing_period + ? new SubscriptionTimePeriod(subscription.current_billing_period) + : null; + this.billingCycle = new TimePeriod(subscription.billing_cycle); + this.scheduledChange = subscription.scheduled_change + ? new SubscriptionScheduledChange(subscription.scheduled_change) + : null; + this.items = subscription.items.map((item) => new SubscriptionItem(item)); + this.customData = subscription.custom_data ? subscription.custom_data : null; + } +} diff --git a/src/entities/subscription/subscription-preview-summary-result.ts b/src/entities/subscription/subscription-preview-summary-result.ts new file mode 100644 index 0000000..76cde1d --- /dev/null +++ b/src/entities/subscription/subscription-preview-summary-result.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionResultResponse } from '../../types'; +import { type CurrencyCode } from '../../enums'; + +export class SubscriptionPreviewSummaryResult { + public readonly action: 'credit' | 'charge'; + public readonly amount: string; + public readonly currencyCode: CurrencyCode; + + constructor(resultResponse: ISubscriptionResultResponse) { + this.action = resultResponse.action; + this.amount = resultResponse.amount; + this.currencyCode = resultResponse.currency_code; + } +} diff --git a/src/entities/subscription/subscription-preview-update-summary.ts b/src/entities/subscription/subscription-preview-update-summary.ts new file mode 100644 index 0000000..3b21646 --- /dev/null +++ b/src/entities/subscription/subscription-preview-update-summary.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionPreviewUpdateSummary } from '../../types'; +import { Money, SubscriptionPreviewSummaryResult } from '../index'; + +export class SubscriptionPreviewUpdateSummary { + public readonly credit: Money; + public readonly charge: Money; + public readonly result: SubscriptionPreviewSummaryResult; + + constructor(previewUpdateSummary: ISubscriptionPreviewUpdateSummary) { + this.credit = new Money(previewUpdateSummary.credit); + this.charge = new Money(previewUpdateSummary.charge); + this.result = new SubscriptionPreviewSummaryResult(previewUpdateSummary.result); + } +} diff --git a/src/entities/subscription/subscription-preview.ts b/src/entities/subscription/subscription-preview.ts new file mode 100644 index 0000000..093e92d --- /dev/null +++ b/src/entities/subscription/subscription-preview.ts @@ -0,0 +1,96 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionItemResponse, type ISubscriptionPreviewResponse } from '../../types'; +import { + BillingDetails, + type CustomData, + ImportMeta, + NextTransaction, + SubscriptionDiscount, + SubscriptionItem, + SubscriptionManagement, + SubscriptionPreviewUpdateSummary, + SubscriptionScheduledChange, + SubscriptionTimePeriod, + TimePeriod, + TransactionDetailsPreview, +} from '../index'; +import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../enums'; + +export class SubscriptionPreview { + public readonly status: SubscriptionStatus; + public readonly customerId: string; + public readonly addressId: string; + public readonly businessId: string | null; + public readonly currencyCode: CurrencyCode; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly startedAt: string | null; + public readonly firstBilledAt: string | null; + public readonly nextBilledAt: string | null; + public readonly pausedAt: string | null; + public readonly canceledAt: string | null; + public readonly discount: SubscriptionDiscount | null; + public readonly collectionMode: CollectionMode; + public readonly billingDetails: BillingDetails | null; + public readonly currentBillingPeriod: SubscriptionTimePeriod | null; + public readonly billingCycle: TimePeriod | null; + public readonly scheduledChange: SubscriptionScheduledChange | null; + public readonly managementUrls: SubscriptionManagement | null; + public readonly items: SubscriptionItem[]; + public readonly customData: CustomData | null; + public readonly immediateTransaction: NextTransaction | null; + public readonly nextTransaction: NextTransaction | null; + public readonly recurringTransactionDetails: TransactionDetailsPreview | null; + public readonly updateSummary: SubscriptionPreviewUpdateSummary | null; + public readonly importMeta: ImportMeta | null; + + constructor(subscriptionPreview: ISubscriptionPreviewResponse) { + this.status = subscriptionPreview.status; + this.customerId = subscriptionPreview.customer_id; + this.addressId = subscriptionPreview.address_id; + this.businessId = subscriptionPreview.business_id ? subscriptionPreview.business_id : null; + this.currencyCode = subscriptionPreview.currency_code; + this.createdAt = subscriptionPreview.created_at; + this.updatedAt = subscriptionPreview.updated_at; + this.startedAt = subscriptionPreview.started_at ? subscriptionPreview.started_at : null; + this.firstBilledAt = subscriptionPreview.first_billed_at ? subscriptionPreview.first_billed_at : null; + this.nextBilledAt = subscriptionPreview.next_billed_at ? subscriptionPreview.next_billed_at : null; + this.pausedAt = subscriptionPreview.paused_at ? subscriptionPreview.paused_at : null; + this.canceledAt = subscriptionPreview.canceled_at ? subscriptionPreview.canceled_at : null; + this.discount = subscriptionPreview.discount ? new SubscriptionDiscount(subscriptionPreview.discount) : null; + this.collectionMode = subscriptionPreview.collection_mode; + this.billingDetails = subscriptionPreview.billing_details + ? new BillingDetails(subscriptionPreview.billing_details) + : null; + this.currentBillingPeriod = subscriptionPreview.current_billing_period + ? new SubscriptionTimePeriod(subscriptionPreview.current_billing_period) + : null; + this.billingCycle = subscriptionPreview.billing_cycle ? new TimePeriod(subscriptionPreview.billing_cycle) : null; + this.scheduledChange = subscriptionPreview.scheduled_change + ? new SubscriptionScheduledChange(subscriptionPreview.scheduled_change) + : null; + this.managementUrls = subscriptionPreview.management_urls + ? new SubscriptionManagement(subscriptionPreview.management_urls) + : null; + this.items = subscriptionPreview.items.map((item: ISubscriptionItemResponse) => new SubscriptionItem(item)); + this.customData = subscriptionPreview.custom_data ? subscriptionPreview.custom_data : null; + this.immediateTransaction = subscriptionPreview.immediate_transaction + ? new NextTransaction(subscriptionPreview.immediate_transaction) + : null; + this.nextTransaction = subscriptionPreview.next_transaction + ? new NextTransaction(subscriptionPreview.next_transaction) + : null; + this.recurringTransactionDetails = subscriptionPreview.recurring_transaction_details + ? new TransactionDetailsPreview(subscriptionPreview.recurring_transaction_details) + : null; + this.updateSummary = subscriptionPreview.update_summary + ? new SubscriptionPreviewUpdateSummary(subscriptionPreview.update_summary) + : null; + this.importMeta = subscriptionPreview.import_meta ? new ImportMeta(subscriptionPreview.import_meta) : null; + } +} diff --git a/src/entities/subscription/subscription-price.ts b/src/entities/subscription/subscription-price.ts new file mode 100644 index 0000000..9fad082 --- /dev/null +++ b/src/entities/subscription/subscription-price.ts @@ -0,0 +1,29 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionPriceResponse } from '../../types'; +import { TimePeriod, Money } from '../index'; +import { type TaxMode } from '../../enums'; + +export class SubscriptionPrice { + public readonly id: string; + public readonly description: string; + public readonly productId: string; + public readonly billingCycle: TimePeriod | null; + public readonly trialPeriod: TimePeriod | null; + public readonly taxMode: TaxMode; + public readonly unitPrice: Money; + + constructor(subscriptionPrice: ISubscriptionPriceResponse) { + this.id = subscriptionPrice.id; + this.description = subscriptionPrice.description; + this.productId = subscriptionPrice.product_id; + this.billingCycle = subscriptionPrice.billing_cycle ? new TimePeriod(subscriptionPrice.billing_cycle) : null; + this.trialPeriod = subscriptionPrice.trial_period ? new TimePeriod(subscriptionPrice.trial_period) : null; + this.taxMode = subscriptionPrice.tax_mode; + this.unitPrice = new Money(subscriptionPrice.unit_price); + } +} diff --git a/src/entities/subscription/subscription-scheduled-change.ts b/src/entities/subscription/subscription-scheduled-change.ts new file mode 100644 index 0000000..80eb4a9 --- /dev/null +++ b/src/entities/subscription/subscription-scheduled-change.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionScheduledChangeResponse } from '../../types'; +import { type ScheduledChangeAction } from '../../enums'; + +export class SubscriptionScheduledChange { + public readonly action: ScheduledChangeAction; + public readonly effectiveAt: string; + public readonly resumeAt: string | null; + + constructor(subscriptionScheduledChange: ISubscriptionScheduledChangeResponse) { + this.action = subscriptionScheduledChange.action; + this.effectiveAt = subscriptionScheduledChange.effective_at; + this.resumeAt = subscriptionScheduledChange.resume_at ? subscriptionScheduledChange.resume_at : null; + } +} diff --git a/src/entities/subscription/subscription-time-period.ts b/src/entities/subscription/subscription-time-period.ts new file mode 100644 index 0000000..9a0634b --- /dev/null +++ b/src/entities/subscription/subscription-time-period.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionTimePeriodResponse } from '../../types'; + +export class SubscriptionTimePeriod { + public readonly startsAt: string; + public readonly endsAt: string; + + constructor(subscriptionTimePeriod: ISubscriptionTimePeriodResponse) { + this.startsAt = subscriptionTimePeriod.starts_at; + this.endsAt = subscriptionTimePeriod.ends_at; + } +} diff --git a/src/entities/subscription/subscription.ts b/src/entities/subscription/subscription.ts new file mode 100644 index 0000000..8d87627 --- /dev/null +++ b/src/entities/subscription/subscription.ts @@ -0,0 +1,77 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + BillingDetails, + type CustomData, + ImportMeta, + SubscriptionDiscount, + SubscriptionItem, + SubscriptionManagement, + SubscriptionScheduledChange, + SubscriptionTimePeriod, + TimePeriod, +} from '../index'; +import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../enums'; +import { type ISubscriptionResponse } from '../../types'; + +export class Subscription { + public readonly id: string; + public readonly status: SubscriptionStatus; + public readonly customerId: string; + public readonly addressId: string; + public readonly businessId: string | null; + public readonly currencyCode: CurrencyCode; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly startedAt: string | null; + public readonly firstBilledAt: string | null; + public readonly nextBilledAt: string | null; + public readonly pausedAt: string | null; + public readonly canceledAt: string | null; + public readonly discount: SubscriptionDiscount | null; + public readonly collectionMode: CollectionMode; + public readonly billingDetails: BillingDetails | null; + public readonly currentBillingPeriod: SubscriptionTimePeriod | null; + public readonly billingCycle: TimePeriod; + public readonly scheduledChange: SubscriptionScheduledChange | null; + public readonly managementUrls: SubscriptionManagement | null; + public readonly items: SubscriptionItem[]; + public readonly customData: CustomData | null; + public readonly importMeta: ImportMeta | null; + + constructor(subscription: ISubscriptionResponse) { + this.id = subscription.id; + this.status = subscription.status; + this.customerId = subscription.customer_id; + this.addressId = subscription.address_id; + this.businessId = subscription.business_id ? subscription.business_id : null; + this.currencyCode = subscription.currency_code; + this.createdAt = subscription.created_at; + this.updatedAt = subscription.updated_at; + this.startedAt = subscription.started_at ? subscription.started_at : null; + this.firstBilledAt = subscription.first_billed_at ? subscription.first_billed_at : null; + this.nextBilledAt = subscription.next_billed_at ? subscription.next_billed_at : null; + this.pausedAt = subscription.paused_at ? subscription.paused_at : null; + this.canceledAt = subscription.canceled_at ? subscription.canceled_at : null; + this.discount = subscription.discount ? new SubscriptionDiscount(subscription.discount) : null; + this.collectionMode = subscription.collection_mode; + this.billingDetails = subscription.billing_details ? new BillingDetails(subscription.billing_details) : null; + this.currentBillingPeriod = subscription.current_billing_period + ? new SubscriptionTimePeriod(subscription.current_billing_period) + : null; + this.billingCycle = new TimePeriod(subscription.billing_cycle); + this.scheduledChange = subscription.scheduled_change + ? new SubscriptionScheduledChange(subscription.scheduled_change) + : null; + this.managementUrls = subscription.management_urls + ? new SubscriptionManagement(subscription.management_urls) + : null; + this.items = subscription.items.map((item) => new SubscriptionItem(item)); + this.customData = subscription.custom_data ? subscription.custom_data : null; + this.importMeta = subscription.import_meta ? new ImportMeta(subscription.import_meta) : null; + } +} diff --git a/src/entities/subscription/transaction-details-preview.ts b/src/entities/subscription/transaction-details-preview.ts new file mode 100644 index 0000000..76d1775 --- /dev/null +++ b/src/entities/subscription/transaction-details-preview.ts @@ -0,0 +1,22 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionDetailsPreviewResponse } from '../../types'; +import { TaxRatesUsed, TransactionTotals, TransactionLineItemPreview } from '../index'; + +export class TransactionDetailsPreview { + public readonly taxRatesUsed: TaxRatesUsed[]; + public readonly totals: TransactionTotals; + public readonly lineItems: TransactionLineItemPreview[]; + + constructor(transactionDetailsPreview: ITransactionDetailsPreviewResponse) { + this.taxRatesUsed = transactionDetailsPreview.tax_rates_used.map( + (tax_rates_used) => new TaxRatesUsed(tax_rates_used), + ); + this.totals = new TransactionTotals(transactionDetailsPreview.totals); + this.lineItems = transactionDetailsPreview.line_items.map((line_item) => new TransactionLineItemPreview(line_item)); + } +} diff --git a/src/entities/subscription/transaction-line-item-preview.ts b/src/entities/subscription/transaction-line-item-preview.ts new file mode 100644 index 0000000..3092159 --- /dev/null +++ b/src/entities/subscription/transaction-line-item-preview.ts @@ -0,0 +1,26 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionLineItemPreviewResponse } from '../../types'; +import { UnitTotals, Totals, Product } from '../index'; + +export class TransactionLineItemPreview { + public readonly priceId: string; + public readonly quantity: number; + public readonly taxRate: string; + public readonly unitTotals: UnitTotals; + public readonly totals: Totals; + public readonly product: Product; + + constructor(transactionLineItemPreview: ITransactionLineItemPreviewResponse) { + this.priceId = transactionLineItemPreview.price_id; + this.quantity = transactionLineItemPreview.quantity; + this.taxRate = transactionLineItemPreview.tax_rate; + this.unitTotals = new UnitTotals(transactionLineItemPreview.unit_totals); + this.totals = new Totals(transactionLineItemPreview.totals); + this.product = new Product(transactionLineItemPreview.product); + } +} diff --git a/src/entities/transaction/address-preview.ts b/src/entities/transaction/address-preview.ts new file mode 100644 index 0000000..a72fcfe --- /dev/null +++ b/src/entities/transaction/address-preview.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CountryCode } from '../../enums'; +import { type IAddressPreviewResponse } from '../../resources'; + +export class AddressPreview { + public readonly postalCode: string | null; + public readonly countryCode: CountryCode; + + constructor(address: IAddressPreviewResponse) { + this.postalCode = address.postal_code ? address.postal_code : null; + this.countryCode = address.country_code; + } +} diff --git a/src/entities/transaction/adjustment-totals-breakdown.ts b/src/entities/transaction/adjustment-totals-breakdown.ts new file mode 100644 index 0000000..1dfd24e --- /dev/null +++ b/src/entities/transaction/adjustment-totals-breakdown.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentTotalsBreakdown } from '../../types'; + +export class AdjustmentTotalsBreakdown { + public readonly credit: string; + public readonly refund: string; + public readonly chargeback: string; + + constructor(adjustmentTotalsBreakdown: IAdjustmentTotalsBreakdown) { + this.credit = adjustmentTotalsBreakdown.credit; + this.refund = adjustmentTotalsBreakdown.refund; + this.chargeback = adjustmentTotalsBreakdown.chargeback; + } +} diff --git a/src/entities/transaction/adjustment-totals.ts b/src/entities/transaction/adjustment-totals.ts new file mode 100644 index 0000000..8ba8ced --- /dev/null +++ b/src/entities/transaction/adjustment-totals.ts @@ -0,0 +1,29 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentTotalsResponse } from '../../types'; +import { AdjustmentTotalsBreakdown } from '../index'; +import { type CurrencyCode } from '../../enums'; + +export class AdjustmentTotals { + public readonly subtotal: string; + public readonly tax: string; + public readonly total: string; + public readonly fee: string; + public readonly earnings: string; + public readonly breakdown: AdjustmentTotalsBreakdown | null; + public readonly currencyCode: CurrencyCode; + + constructor(adjustmentTotals: IAdjustmentTotalsResponse) { + this.subtotal = adjustmentTotals.subtotal; + this.tax = adjustmentTotals.tax; + this.total = adjustmentTotals.total; + this.fee = adjustmentTotals.fee; + this.earnings = adjustmentTotals.earnings; + this.breakdown = adjustmentTotals.breakdown ? new AdjustmentTotalsBreakdown(adjustmentTotals.breakdown) : null; + this.currencyCode = adjustmentTotals.currency_code; + } +} diff --git a/src/entities/transaction/index.ts b/src/entities/transaction/index.ts new file mode 100644 index 0000000..e135c72 --- /dev/null +++ b/src/entities/transaction/index.ts @@ -0,0 +1,23 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './transactions-time-period'; +export * from './transaction-proration'; +export * from './transaction-item'; +export * from './transaction-line-item'; +export * from './transaction-details'; +export * from './transaction-adjustment-item'; +export * from './transaction-adjustment'; +export * from './adjustment-totals-breakdown'; +export * from './adjustment-totals'; +export * from './transaction-includes'; +export * from './transaction'; +export * from './transaction-collection'; +export * from './transaction-invoice-pdf'; +export * from './transaction-preview'; +export * from './transaction-item-preview'; +export * from './proration'; +export * from './address-preview'; diff --git a/src/entities/transaction/proration.ts b/src/entities/transaction/proration.ts new file mode 100644 index 0000000..3b9f576 --- /dev/null +++ b/src/entities/transaction/proration.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { TransactionsTimePeriod } from '../index'; +import { type IProrationResponse } from '../../types'; + +export class Proration { + public readonly rate: string; + public readonly billingPeriod: TransactionsTimePeriod; + + constructor(prorationResponse: IProrationResponse) { + this.rate = prorationResponse.rate; + this.billingPeriod = new TransactionsTimePeriod(prorationResponse.billing_period); + } +} diff --git a/src/entities/transaction/transaction-adjustment-item.ts b/src/entities/transaction/transaction-adjustment-item.ts new file mode 100644 index 0000000..2ff81ba --- /dev/null +++ b/src/entities/transaction/transaction-adjustment-item.ts @@ -0,0 +1,29 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionAdjustmentItemResponse } from '../../types'; +import { AdjustmentItemTotals, TransactionProration } from '../index'; +import { type AdjustmentType } from '../../enums'; + +export class TransactionAdjustmentItem { + public readonly id: string | null; + public readonly itemId: string; + public readonly type: AdjustmentType; + public readonly amount: string | null; + public readonly proration: TransactionProration | null; + public readonly totals: AdjustmentItemTotals | null; + + constructor(transactionAdjustmentItem: ITransactionAdjustmentItemResponse) { + this.id = transactionAdjustmentItem.id ? transactionAdjustmentItem.id : null; + this.itemId = transactionAdjustmentItem.item_id; + this.type = transactionAdjustmentItem.type; + this.amount = transactionAdjustmentItem.amount ? transactionAdjustmentItem.amount : null; + this.proration = transactionAdjustmentItem.proration + ? new TransactionProration(transactionAdjustmentItem.proration) + : null; + this.totals = transactionAdjustmentItem.totals ? new AdjustmentItemTotals(transactionAdjustmentItem.totals) : null; + } +} diff --git a/src/entities/transaction/transaction-adjustment.ts b/src/entities/transaction/transaction-adjustment.ts new file mode 100644 index 0000000..bcb1869 --- /dev/null +++ b/src/entities/transaction/transaction-adjustment.ts @@ -0,0 +1,43 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionAdjustmentResponse } from '../../types'; +import { TransactionAdjustmentItem, TotalAdjustments, PayoutTotalsAdjustment } from '../index'; +import { type AdjustmentAction, type CurrencyCode, type AdjustmentStatus } from '../../enums'; + +export class TransactionAdjustment { + public readonly id: string; + public readonly action: AdjustmentAction; + public readonly transactionId: string; + public readonly subscriptionId: string | null; + public readonly customerId: string; + public readonly reason: string; + public readonly creditAppliedToBalance: boolean; + public readonly currencyCode: CurrencyCode; + public readonly status: AdjustmentStatus; + public readonly items: TransactionAdjustmentItem[]; + public readonly totals: TotalAdjustments | null; + public readonly payoutTotals: PayoutTotalsAdjustment | null; + public readonly createdAt: string; + public readonly updatedAt: string; + + constructor(adjustment: ITransactionAdjustmentResponse) { + this.id = adjustment.id; + this.action = adjustment.action; + this.transactionId = adjustment.transaction_id; + this.subscriptionId = adjustment.subscription_id ? adjustment.subscription_id : null; + this.customerId = adjustment.customer_id; + this.reason = adjustment.reason; + this.creditAppliedToBalance = adjustment.credit_applied_to_balance; + this.currencyCode = adjustment.currency_code; + this.status = adjustment.status; + this.items = adjustment.items.map((item) => new TransactionAdjustmentItem(item)); + this.totals = adjustment.totals ? new TotalAdjustments(adjustment.totals) : null; + this.payoutTotals = adjustment.payout_totals ? new PayoutTotalsAdjustment(adjustment.payout_totals) : null; + this.createdAt = adjustment.created_at; + this.updatedAt = adjustment.updated_at; + } +} diff --git a/src/entities/transaction/transaction-collection.ts b/src/entities/transaction/transaction-collection.ts new file mode 100644 index 0000000..89dec5c --- /dev/null +++ b/src/entities/transaction/transaction-collection.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { TransactionIncludes } from './transaction-includes'; +import { type ITransactionResponse } from '../../types'; +import { Collection } from '../../internal/base'; + +export class TransactionCollection extends Collection { + override fromJson(data: ITransactionResponse): TransactionIncludes { + return new TransactionIncludes(data); + } +} diff --git a/src/entities/transaction/transaction-details.ts b/src/entities/transaction/transaction-details.ts new file mode 100644 index 0000000..199e139 --- /dev/null +++ b/src/entities/transaction/transaction-details.ts @@ -0,0 +1,39 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionDetailsResponse } from '../../types'; +import { + TaxRatesUsed, + TransactionTotals, + TransactionTotalsAdjusted, + TransactionPayoutTotals, + TransactionPayoutTotalsAdjusted, + TransactionLineItem, +} from '../index'; + +export class TransactionDetails { + public readonly taxRatesUsed: TaxRatesUsed[]; + public readonly totals: TransactionTotals | null; + public readonly adjustedTotals: TransactionTotalsAdjusted | null; + public readonly payoutTotals: TransactionPayoutTotals | null; + public readonly adjustedPayoutTotals: TransactionPayoutTotalsAdjusted | null; + public readonly lineItems: TransactionLineItem[]; + + constructor(transactionDetails: ITransactionDetailsResponse) { + this.taxRatesUsed = transactionDetails.tax_rates_used.map((tax_rates_used) => new TaxRatesUsed(tax_rates_used)); + this.totals = transactionDetails.totals ? new TransactionTotals(transactionDetails.totals) : null; + this.adjustedTotals = transactionDetails.adjusted_totals + ? new TransactionTotalsAdjusted(transactionDetails.adjusted_totals) + : null; + this.payoutTotals = transactionDetails.payout_totals + ? new TransactionPayoutTotals(transactionDetails.payout_totals) + : null; + this.adjustedPayoutTotals = transactionDetails.adjusted_payout_totals + ? new TransactionPayoutTotalsAdjusted(transactionDetails.adjusted_payout_totals) + : null; + this.lineItems = transactionDetails.line_items.map((line_item) => new TransactionLineItem(line_item)); + } +} diff --git a/src/entities/transaction/transaction-includes.ts b/src/entities/transaction/transaction-includes.ts new file mode 100644 index 0000000..250e58f --- /dev/null +++ b/src/entities/transaction/transaction-includes.ts @@ -0,0 +1,89 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionResponse } from '../../types'; +import { + Address, + TransactionAdjustment, + AdjustmentTotals, + BillingDetails, + Business, + TransactionCheckout, + type CustomData, + Customer, + TransactionDetails, + Discount, + TransactionItem, + TransactionPaymentAttempt, + TransactionsTimePeriod, +} from '../index'; +import { type CollectionMode, type CurrencyCode, type TransactionStatus, type TransactionOrigin } from '../../enums'; + +export class TransactionIncludes { + public readonly id: string; + public readonly status: TransactionStatus; + public readonly customerId: string | null; + public readonly addressId: string | null; + public readonly businessId: string | null; + public readonly customData: CustomData | null; + public readonly currencyCode: CurrencyCode; + public readonly origin: TransactionOrigin; + public readonly subscriptionId: string | null; + public readonly invoiceId: string | null; + public readonly invoiceNumber: string | null; + public readonly collectionMode: CollectionMode; + public readonly discountId: string | null; + public readonly billingDetails: BillingDetails | null; + public readonly billingPeriod: TransactionsTimePeriod | null; + public readonly items: TransactionItem[]; + public readonly details: TransactionDetails | null; + public readonly payments: TransactionPaymentAttempt[]; + public readonly checkout: TransactionCheckout | null; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly billedAt: string | null; + public readonly address: Address | null; + public readonly adjustments: TransactionAdjustment[] | null; + public readonly adjustmentsTotals: AdjustmentTotals | null; + public readonly business: Business | null; + public readonly customer: Customer | null; + public readonly discount: Discount | null; + + constructor(transaction: ITransactionResponse) { + this.id = transaction.id; + this.status = transaction.status; + this.customerId = transaction.customer_id ? transaction.customer_id : null; + this.addressId = transaction.address_id ? transaction.address_id : null; + this.businessId = transaction.business_id ? transaction.business_id : null; + this.customData = transaction.custom_data ? transaction.custom_data : null; + this.currencyCode = transaction.currency_code; + this.origin = transaction.origin; + this.subscriptionId = transaction.subscription_id ? transaction.subscription_id : null; + this.invoiceId = transaction.invoice_id ? transaction.invoice_id : null; + this.invoiceNumber = transaction.invoice_number ? transaction.invoice_number : null; + this.collectionMode = transaction.collection_mode; + this.discountId = transaction.discount_id ? transaction.discount_id : null; + this.billingDetails = transaction.billing_details ? new BillingDetails(transaction.billing_details) : null; + this.billingPeriod = transaction.billing_period ? new TransactionsTimePeriod(transaction.billing_period) : null; + this.items = transaction.items.map((item) => new TransactionItem(item)); + this.details = transaction.details ? new TransactionDetails(transaction.details) : null; + this.payments = transaction.payments.map((payment) => new TransactionPaymentAttempt(payment)); + this.checkout = transaction.checkout ? new TransactionCheckout(transaction.checkout) : null; + this.createdAt = transaction.created_at; + this.updatedAt = transaction.updated_at; + this.billedAt = transaction.billed_at ? transaction.billed_at : null; + this.address = transaction.address ? new Address(transaction.address) : null; + this.adjustments = transaction.adjustments + ? transaction.adjustments?.map((adjustment) => new TransactionAdjustment(adjustment)) + : null; + this.adjustmentsTotals = transaction.adjustments_totals + ? new AdjustmentTotals(transaction.adjustments_totals) + : null; + this.business = transaction.business ? new Business(transaction.business) : null; + this.customer = transaction.customer ? new Customer(transaction.customer) : null; + this.discount = transaction.discount ? new Discount(transaction.discount) : null; + } +} diff --git a/src/entities/transaction/transaction-invoice-pdf.ts b/src/entities/transaction/transaction-invoice-pdf.ts new file mode 100644 index 0000000..5c597fb --- /dev/null +++ b/src/entities/transaction/transaction-invoice-pdf.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionInvoicePDF } from '../../types'; + +export class TransactionInvoicePDF { + public readonly url: string; + + constructor(transaction: ITransactionInvoicePDF) { + this.url = transaction.url; + } +} diff --git a/src/entities/transaction/transaction-item-preview.ts b/src/entities/transaction/transaction-item-preview.ts new file mode 100644 index 0000000..ddc7e5a --- /dev/null +++ b/src/entities/transaction/transaction-item-preview.ts @@ -0,0 +1,22 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { PriceWithIncludes, Proration } from '../index'; +import { type ITransactionItemPreviewResponse } from '../../types'; + +export class TransactionItemPreview { + public readonly price: PriceWithIncludes | null; + public readonly quantity: number; + public readonly includeInTotals: boolean | null; + public readonly proration: Proration | null; + + constructor(transactionItem: ITransactionItemPreviewResponse) { + this.price = transactionItem.price ? new PriceWithIncludes(transactionItem.price) : null; + this.quantity = transactionItem.quantity; + this.includeInTotals = transactionItem.include_in_totals ?? null; + this.proration = transactionItem.proration ? new Proration(transactionItem.proration) : null; + } +} diff --git a/src/entities/transaction/transaction-item.ts b/src/entities/transaction/transaction-item.ts new file mode 100644 index 0000000..c98783b --- /dev/null +++ b/src/entities/transaction/transaction-item.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionItemResponse } from '../../types'; +import { Price, TransactionProration } from '../index'; + +export class TransactionItem { + public readonly price: Price | null; + public readonly quantity: number; + public readonly proration: TransactionProration | null; + + constructor(transactionItem: ITransactionItemResponse) { + this.price = transactionItem.price ? new Price(transactionItem.price) : null; + this.quantity = transactionItem.quantity; + this.proration = transactionItem.proration ? new TransactionProration(transactionItem.proration) : null; + } +} diff --git a/src/entities/transaction/transaction-line-item.ts b/src/entities/transaction/transaction-line-item.ts new file mode 100644 index 0000000..829c9bd --- /dev/null +++ b/src/entities/transaction/transaction-line-item.ts @@ -0,0 +1,30 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionLineItemResponse } from '../../types'; +import { TransactionProration, UnitTotals, Totals, Product } from '../index'; + +export class TransactionLineItem { + public readonly id: string; + public readonly priceId: string; + public readonly quantity: number; + public readonly proration: TransactionProration | null; + public readonly taxRate: string; + public readonly unitTotals: UnitTotals | null; + public readonly totals: Totals | null; + public readonly product: Product | null; + + constructor(transactionLineItem: ITransactionLineItemResponse) { + this.id = transactionLineItem.id; + this.priceId = transactionLineItem.price_id; + this.quantity = transactionLineItem.quantity; + this.proration = transactionLineItem.proration ? new TransactionProration(transactionLineItem.proration) : null; + this.taxRate = transactionLineItem.tax_rate; + this.unitTotals = transactionLineItem.unit_totals ? new UnitTotals(transactionLineItem.unit_totals) : null; + this.totals = transactionLineItem.totals ? new Totals(transactionLineItem.totals) : null; + this.product = transactionLineItem.product ? new Product(transactionLineItem.product) : null; + } +} diff --git a/src/entities/transaction/transaction-preview.ts b/src/entities/transaction/transaction-preview.ts new file mode 100644 index 0000000..e0a40b2 --- /dev/null +++ b/src/entities/transaction/transaction-preview.ts @@ -0,0 +1,38 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionPreviewResponse } from '../../types'; +import { AddressPreview, TransactionDetailsPreview, TransactionItemPreview } from '../index'; +import { type CurrencyCode } from '../../enums'; +import { type AvailablePaymentMethod } from '../../enums/shared/available-payment-methods'; + +export class TransactionPreview { + public readonly customerId: string | null; + public readonly addressId: string | null; + public readonly businessId: string | null; + public readonly currencyCode: CurrencyCode; + public readonly discountId: string | null; + public readonly customerIpAddress: string | null; + public readonly address: AddressPreview | null; + public readonly ignoreTrials: boolean | null; + public readonly items: TransactionItemPreview[]; + public readonly details: TransactionDetailsPreview; + public readonly availablePaymentMethods: AvailablePaymentMethod | null; + + constructor(transactionPreview: ITransactionPreviewResponse) { + this.customerId = transactionPreview.customer_id ? transactionPreview.customer_id : null; + this.addressId = transactionPreview.address_id ? transactionPreview.address_id : null; + this.businessId = transactionPreview.business_id ? transactionPreview.business_id : null; + this.currencyCode = transactionPreview.currency_code; + this.discountId = transactionPreview.discount_id ? transactionPreview.discount_id : null; + this.customerIpAddress = transactionPreview.customer_ip_address ? transactionPreview.customer_ip_address : null; + this.address = transactionPreview.address ? new AddressPreview(transactionPreview.address) : null; + this.ignoreTrials = transactionPreview.ignore_trials ? transactionPreview.ignore_trials : null; + this.items = transactionPreview.items.map((item) => new TransactionItemPreview(item)); + this.details = new TransactionDetailsPreview(transactionPreview.details); + this.availablePaymentMethods = transactionPreview.available_payment_method ?? null; + } +} diff --git a/src/entities/transaction/transaction-proration.ts b/src/entities/transaction/transaction-proration.ts new file mode 100644 index 0000000..d6c143d --- /dev/null +++ b/src/entities/transaction/transaction-proration.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionProrationResponse } from '../../types'; +import { TransactionsTimePeriod } from '../index'; + +export class TransactionProration { + public readonly rate: string; + public readonly billingPeriod: TransactionsTimePeriod | null; + + constructor(transactionProration: ITransactionProrationResponse) { + this.rate = transactionProration.rate; + this.billingPeriod = transactionProration.billing_period + ? new TransactionsTimePeriod(transactionProration.billing_period) + : null; + } +} diff --git a/src/entities/transaction/transaction.ts b/src/entities/transaction/transaction.ts new file mode 100644 index 0000000..18b03ce --- /dev/null +++ b/src/entities/transaction/transaction.ts @@ -0,0 +1,67 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type CustomData, + BillingDetails, + TransactionsTimePeriod, + TransactionItem, + TransactionDetails, + TransactionPaymentAttempt, + TransactionCheckout, +} from '../index'; +import { type TransactionStatus, type CurrencyCode, type TransactionOrigin, type CollectionMode } from '../../enums'; +import { type ITransactionResponse } from '../../types'; + +export class Transaction { + public readonly id: string; + public readonly status: TransactionStatus; + public readonly customerId: string | null; + public readonly addressId: string | null; + public readonly businessId: string | null; + public readonly customData: CustomData | null; + public readonly currencyCode: CurrencyCode; + public readonly origin: TransactionOrigin; + public readonly subscriptionId: string | null; + public readonly invoiceId: string | null; + public readonly invoiceNumber: string | null; + public readonly collectionMode: CollectionMode; + public readonly discountId: string | null; + public readonly billingDetails: BillingDetails | null; + public readonly billingPeriod: TransactionsTimePeriod | null; + public readonly items: TransactionItem[]; + public readonly details: TransactionDetails | null; + public readonly payments: TransactionPaymentAttempt[]; + public readonly checkout: TransactionCheckout | null; + public readonly createdAt: string; + public readonly updatedAt: string; + public readonly billedAt: string | null; + + constructor(transaction: ITransactionResponse) { + this.id = transaction.id; + this.status = transaction.status; + this.customerId = transaction.customer_id ? transaction.customer_id : null; + this.addressId = transaction.address_id ? transaction.address_id : null; + this.businessId = transaction.business_id ? transaction.business_id : null; + this.customData = transaction.custom_data ? transaction.custom_data : null; + this.currencyCode = transaction.currency_code; + this.origin = transaction.origin; + this.subscriptionId = transaction.subscription_id ? transaction.subscription_id : null; + this.invoiceId = transaction.invoice_id ? transaction.invoice_id : null; + this.invoiceNumber = transaction.invoice_number ? transaction.invoice_number : null; + this.collectionMode = transaction.collection_mode; + this.discountId = transaction.discount_id ? transaction.discount_id : null; + this.billingDetails = transaction.billing_details ? new BillingDetails(transaction.billing_details) : null; + this.billingPeriod = transaction.billing_period ? new TransactionsTimePeriod(transaction.billing_period) : null; + this.items = transaction.items.map((item) => new TransactionItem(item)); + this.details = transaction.details ? new TransactionDetails(transaction.details) : null; + this.payments = transaction.payments.map((payment) => new TransactionPaymentAttempt(payment)); + this.checkout = transaction.checkout ? new TransactionCheckout(transaction.checkout) : null; + this.createdAt = transaction.created_at; + this.updatedAt = transaction.updated_at; + this.billedAt = transaction.billed_at ? transaction.billed_at : null; + } +} diff --git a/src/entities/transaction/transactions-time-period.ts b/src/entities/transaction/transactions-time-period.ts new file mode 100644 index 0000000..b434034 --- /dev/null +++ b/src/entities/transaction/transactions-time-period.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionsTimePeriodResponse } from '../../types'; + +export class TransactionsTimePeriod { + public readonly startsAt: string; + public readonly endsAt: string; + + constructor(transactionsTimePeriod: ITransactionsTimePeriodResponse) { + this.startsAt = transactionsTimePeriod.starts_at; + this.endsAt = transactionsTimePeriod.ends_at; + } +} diff --git a/src/enums/adjustment/adjustment-action.ts b/src/enums/adjustment/adjustment-action.ts new file mode 100644 index 0000000..325f5f4 --- /dev/null +++ b/src/enums/adjustment/adjustment-action.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type AdjustmentAction = + | 'credit' + | 'credit_reverse' + | 'refund' + | 'chargeback' + | 'chargeback_reverse' + | 'chargeback_warning'; diff --git a/src/enums/adjustment/adjustment-currency-code.ts b/src/enums/adjustment/adjustment-currency-code.ts new file mode 100644 index 0000000..9e4bd79 --- /dev/null +++ b/src/enums/adjustment/adjustment-currency-code.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type AdjustmentCurrencyCode = 'EUR' | 'GBP' | 'USD'; diff --git a/src/enums/adjustment/adjustment-status.ts b/src/enums/adjustment/adjustment-status.ts new file mode 100644 index 0000000..5a04207 --- /dev/null +++ b/src/enums/adjustment/adjustment-status.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type AdjustmentStatus = 'pending_approval' | 'approved' | 'rejected' | 'reversed'; diff --git a/src/enums/adjustment/adjustment-type.ts b/src/enums/adjustment/adjustment-type.ts new file mode 100644 index 0000000..bf33b68 --- /dev/null +++ b/src/enums/adjustment/adjustment-type.ts @@ -0,0 +1 @@ +export type AdjustmentType = 'full' | 'partial' | 'tax' | 'proration'; diff --git a/src/enums/adjustment/index.ts b/src/enums/adjustment/index.ts new file mode 100644 index 0000000..4095002 --- /dev/null +++ b/src/enums/adjustment/index.ts @@ -0,0 +1,4 @@ +export * from './adjustment-type'; +export * from './adjustment-currency-code'; +export * from './adjustment-action'; +export * from './adjustment-status'; diff --git a/src/enums/discount/discount-status.ts b/src/enums/discount/discount-status.ts new file mode 100644 index 0000000..eb6b6b2 --- /dev/null +++ b/src/enums/discount/discount-status.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type DiscountStatus = 'active' | 'archived' | 'expired' | 'used'; diff --git a/src/enums/discount/discount-type.ts b/src/enums/discount/discount-type.ts new file mode 100644 index 0000000..63a2fba --- /dev/null +++ b/src/enums/discount/discount-type.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type DiscountType = 'flat' | 'flat_per_seat' | 'percentage'; diff --git a/src/enums/discount/index.ts b/src/enums/discount/index.ts new file mode 100644 index 0000000..ffe4247 --- /dev/null +++ b/src/enums/discount/index.ts @@ -0,0 +1,2 @@ +export * from './discount-status'; +export * from './discount-type'; diff --git a/src/enums/index.ts b/src/enums/index.ts new file mode 100644 index 0000000..44a51ef --- /dev/null +++ b/src/enums/index.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './shared'; +export * from './subscription'; +export * from './discount'; +export * from './adjustment'; +export * from './transaction'; +export * from './payout'; +export * from './notification-settings'; +export * from './notification'; +export * from './report'; diff --git a/src/enums/notification-settings/index.ts b/src/enums/notification-settings/index.ts new file mode 100644 index 0000000..98b9213 --- /dev/null +++ b/src/enums/notification-settings/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './notification-settings-type'; diff --git a/src/enums/notification-settings/notification-settings-type.ts b/src/enums/notification-settings/notification-settings-type.ts new file mode 100644 index 0000000..dfcb3c7 --- /dev/null +++ b/src/enums/notification-settings/notification-settings-type.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type NotificationSettingsType = 'email' | 'url'; diff --git a/src/enums/notification/index.ts b/src/enums/notification/index.ts new file mode 100644 index 0000000..f8696c2 --- /dev/null +++ b/src/enums/notification/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './notification-status'; +export * from './origin'; diff --git a/src/enums/notification/notification-status.ts b/src/enums/notification/notification-status.ts new file mode 100644 index 0000000..4602c0d --- /dev/null +++ b/src/enums/notification/notification-status.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type NotificationStatus = 'not_attempted' | 'needs_retry' | 'delivered' | 'failed'; diff --git a/src/enums/notification/origin.ts b/src/enums/notification/origin.ts new file mode 100644 index 0000000..28fc7e7 --- /dev/null +++ b/src/enums/notification/origin.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type Origin = 'event' | 'replay'; diff --git a/src/enums/payout/index.ts b/src/enums/payout/index.ts new file mode 100644 index 0000000..b48596d --- /dev/null +++ b/src/enums/payout/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './payout-status'; diff --git a/src/enums/payout/payout-status.ts b/src/enums/payout/payout-status.ts new file mode 100644 index 0000000..baf0834 --- /dev/null +++ b/src/enums/payout/payout-status.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type PayoutStatus = 'paid' | 'unpaid'; diff --git a/src/enums/report/index.ts b/src/enums/report/index.ts new file mode 100644 index 0000000..444f757 --- /dev/null +++ b/src/enums/report/index.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './report-status'; +export * from './report-type'; +export * from './report-filter-name'; +export * from './report-filter-operator'; diff --git a/src/enums/report/report-filter-name.ts b/src/enums/report/report-filter-name.ts new file mode 100644 index 0000000..fac20c3 --- /dev/null +++ b/src/enums/report/report-filter-name.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type ReportFilterName = 'action' | 'collection_mode' | 'currency_code' | 'origin' | 'status' | 'updated_at'; diff --git a/src/enums/report/report-filter-operator.ts b/src/enums/report/report-filter-operator.ts new file mode 100644 index 0000000..ae0d647 --- /dev/null +++ b/src/enums/report/report-filter-operator.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type ReportFilterOperator = 'lt' | 'gte'; diff --git a/src/enums/report/report-status.ts b/src/enums/report/report-status.ts new file mode 100644 index 0000000..fb620bd --- /dev/null +++ b/src/enums/report/report-status.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type ReportStatus = 'pending' | 'ready' | 'failed' | 'expired'; diff --git a/src/enums/report/report-type.ts b/src/enums/report/report-type.ts new file mode 100644 index 0000000..2c8cbed --- /dev/null +++ b/src/enums/report/report-type.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type ReportType = 'adjustments' | 'adjustment_line_items' | 'transactions' | 'transaction_line_items'; diff --git a/src/enums/shared/available-payment-methods.ts b/src/enums/shared/available-payment-methods.ts new file mode 100644 index 0000000..bb82052 --- /dev/null +++ b/src/enums/shared/available-payment-methods.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type AvailablePaymentMethod = 'alipay' | 'apple_pay' | 'bancontact' | 'card' | 'google_pay' | 'ideal' | 'paypal'; diff --git a/src/enums/shared/catalog-type.ts b/src/enums/shared/catalog-type.ts new file mode 100644 index 0000000..13b0847 --- /dev/null +++ b/src/enums/shared/catalog-type.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type CatalogType = 'standard' | 'custom'; diff --git a/src/enums/shared/collection-mode.ts b/src/enums/shared/collection-mode.ts new file mode 100644 index 0000000..2a5ee30 --- /dev/null +++ b/src/enums/shared/collection-mode.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type CollectionMode = 'automatic' | 'manual'; diff --git a/src/enums/shared/country-code.ts b/src/enums/shared/country-code.ts new file mode 100644 index 0000000..7dac844 --- /dev/null +++ b/src/enums/shared/country-code.ts @@ -0,0 +1,236 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type CountryCode = + | 'AD' + | 'AE' + | 'AG' + | 'AI' + | 'AL' + | 'AM' + | 'AO' + | 'AR' + | 'AS' + | 'AT' + | 'AU' + | 'AW' + | 'AX' + | 'AZ' + | 'BA' + | 'BB' + | 'BD' + | 'BE' + | 'BF' + | 'BG' + | 'BH' + | 'BI' + | 'BJ' + | 'BL' + | 'BM' + | 'BN' + | 'BO' + | 'BQ' + | 'BR' + | 'BS' + | 'BT' + | 'BV' + | 'BW' + | 'BZ' + | 'CA' + | 'CC' + | 'CG' + | 'CH' + | 'CI' + | 'CK' + | 'CL' + | 'CM' + | 'CN' + | 'CO' + | 'CR' + | 'CV' + | 'CW' + | 'CX' + | 'CY' + | 'CZ' + | 'DE' + | 'DJ' + | 'DK' + | 'DM' + | 'DO' + | 'DZ' + | 'EC' + | 'EE' + | 'EG' + | 'EH' + | 'ER' + | 'ES' + | 'ET' + | 'FI' + | 'FJ' + | 'FK' + | 'FM' + | 'FO' + | 'FR' + | 'GA' + | 'GB' + | 'GD' + | 'GE' + | 'GF' + | 'GG' + | 'GH' + | 'GI' + | 'GL' + | 'GM' + | 'GN' + | 'GP' + | 'GQ' + | 'GR' + | 'GS' + | 'GT' + | 'GU' + | 'GW' + | 'GY' + | 'HK' + | 'HM' + | 'HN' + | 'HR' + | 'HU' + | 'ID' + | 'IE' + | 'IL' + | 'IM' + | 'IN' + | 'IO' + | 'IQ' + | 'IS' + | 'IT' + | 'JE' + | 'JM' + | 'JO' + | 'JP' + | 'KE' + | 'KG' + | 'KH' + | 'KI' + | 'KM' + | 'KN' + | 'KR' + | 'KW' + | 'KY' + | 'KZ' + | 'LA' + | 'LB' + | 'LC' + | 'LI' + | 'LK' + | 'LR' + | 'LS' + | 'LT' + | 'LU' + | 'LV' + | 'MA' + | 'MC' + | 'MD' + | 'ME' + | 'MF' + | 'MG' + | 'MH' + | 'MK' + | 'MN' + | 'MO' + | 'MP' + | 'MQ' + | 'MR' + | 'MS' + | 'MT' + | 'MU' + | 'MV' + | 'MW' + | 'MX' + | 'MY' + | 'MZ' + | 'NA' + | 'NC' + | 'NE' + | 'NF' + | 'NG' + | 'NL' + | 'NO' + | 'NP' + | 'NR' + | 'NU' + | 'NZ' + | 'OM' + | 'PA' + | 'PE' + | 'PF' + | 'PG' + | 'PH' + | 'PK' + | 'PL' + | 'PM' + | 'PN' + | 'PR' + | 'PS' + | 'PT' + | 'PW' + | 'PY' + | 'QA' + | 'RE' + | 'RO' + | 'RS' + | 'RW' + | 'SA' + | 'SB' + | 'SC' + | 'SE' + | 'SG' + | 'SH' + | 'SI' + | 'SJ' + | 'SK' + | 'SL' + | 'SM' + | 'SN' + | 'SR' + | 'ST' + | 'SV' + | 'SX' + | 'SZ' + | 'TC' + | 'TD' + | 'TF' + | 'TG' + | 'TH' + | 'TJ' + | 'TK' + | 'TL' + | 'TM' + | 'TN' + | 'TO' + | 'TR' + | 'TT' + | 'TV' + | 'TW' + | 'TZ' + | 'UA' + | 'UG' + | 'UM' + | 'US' + | 'UY' + | 'UZ' + | 'VA' + | 'VC' + | 'VG' + | 'VI' + | 'VN' + | 'VU' + | 'WF' + | 'WS' + | 'XK' + | 'YT' + | 'ZA' + | 'ZM'; diff --git a/src/enums/shared/currency-code.ts b/src/enums/shared/currency-code.ts new file mode 100644 index 0000000..f5584d9 --- /dev/null +++ b/src/enums/shared/currency-code.ts @@ -0,0 +1,36 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +export type CurrencyCode = + | 'USD' + | 'EUR' + | 'GBP' + | 'JPY' + | 'AUD' + | 'CAD' + | 'CHF' + | 'HKD' + | 'SGD' + | 'SEK' + | 'ARS' + | 'BRL' + | 'CNY' + | 'COP' + | 'CZK' + | 'DKK' + | 'HUF' + | 'ILS' + | 'INR' + | 'KRW' + | 'MXN' + | 'NOK' + | 'NZD' + | 'PLN' + | 'RUB' + | 'THB' + | 'TRY' + | 'TWD' + | 'UAH' + | 'ZAR'; diff --git a/src/enums/shared/error-code.ts b/src/enums/shared/error-code.ts new file mode 100644 index 0000000..0e577cf --- /dev/null +++ b/src/enums/shared/error-code.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type ErrorCode = + | 'already_canceled' + | 'already_refunded' + | 'authentication_failed' + | 'blocked_card' + | 'canceled' + | 'declined' + | 'expired_card' + | 'fraud' + | 'invalid_amount' + | 'invalid_payment_details' + | 'issuer_unavailable' + | 'not_enough_balance' + | 'psp_error' + | 'redacted_payment_method' + | 'system_error' + | 'transaction_not_permitted' + | 'unknown'; diff --git a/src/enums/shared/index.ts b/src/enums/shared/index.ts new file mode 100644 index 0000000..151dcb7 --- /dev/null +++ b/src/enums/shared/index.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './tax-category'; +export * from './status'; +export * from './interval'; +export * from './tax-mode'; +export * from './currency-code'; +export * from './country-code'; +export * from './collection-mode'; +export * from './transaction-status'; +export * from './transaction-origin'; +export * from './payout-currency-code'; +export * from './payment-attempt-status'; +export * from './error-code'; +export * from './payment-type'; +export * from './catalog-type'; diff --git a/src/enums/shared/interval.ts b/src/enums/shared/interval.ts new file mode 100644 index 0000000..f76577f --- /dev/null +++ b/src/enums/shared/interval.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type Interval = 'day' | 'week' | 'month' | 'year'; diff --git a/src/enums/shared/payment-attempt-status.ts b/src/enums/shared/payment-attempt-status.ts new file mode 100644 index 0000000..d834e9f --- /dev/null +++ b/src/enums/shared/payment-attempt-status.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type PaymentAttemptStatus = + | 'authorized' + | 'authorized_flagged' + | 'canceled' + | 'captured' + | 'error' + | 'action_required' + | 'pending_no_action_required' + | 'created' + | 'unknown' + | 'dropped'; diff --git a/src/enums/shared/payment-type.ts b/src/enums/shared/payment-type.ts new file mode 100644 index 0000000..61cb690 --- /dev/null +++ b/src/enums/shared/payment-type.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type PaymentType = + | 'alipay' + | 'apple_pay' + | 'bancontact' + | 'card' + | 'google_pay' + | 'ideal' + | 'offline' + | 'paypal' + | 'unknown' + | 'wire_transfer'; diff --git a/src/enums/shared/payout-currency-code.ts b/src/enums/shared/payout-currency-code.ts new file mode 100644 index 0000000..b621b93 --- /dev/null +++ b/src/enums/shared/payout-currency-code.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type PayoutCurrencyCode = + | 'AUD' + | 'CAD' + | 'CHF' + | 'CNY' + | 'CZK' + | 'DKK' + | 'EUR' + | 'GBP' + | 'HUF' + | 'PLN' + | 'SEK' + | 'USD' + | 'ZAR'; diff --git a/src/enums/shared/status.ts b/src/enums/shared/status.ts new file mode 100644 index 0000000..8ac37e4 --- /dev/null +++ b/src/enums/shared/status.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type Status = 'active' | 'archived'; diff --git a/src/enums/shared/tax-category.ts b/src/enums/shared/tax-category.ts new file mode 100644 index 0000000..5a0a964 --- /dev/null +++ b/src/enums/shared/tax-category.ts @@ -0,0 +1,16 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type TaxCategory = + | 'digital-goods' + | 'ebooks' + | 'implementation-services' + | 'professional-services' + | 'saas' + | 'software-programming-services' + | 'standard' + | 'training-services' + | 'website-hosting'; diff --git a/src/enums/shared/tax-mode.ts b/src/enums/shared/tax-mode.ts new file mode 100644 index 0000000..e32382c --- /dev/null +++ b/src/enums/shared/tax-mode.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type TaxMode = 'account_setting' | 'external' | 'internal'; diff --git a/src/enums/shared/transaction-origin.ts b/src/enums/shared/transaction-origin.ts new file mode 100644 index 0000000..c6b6344 --- /dev/null +++ b/src/enums/shared/transaction-origin.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type TransactionOrigin = + | 'api' + | 'subscription_charge' + | 'subscription_payment_method_change' + | 'subscription_recurring' + | 'subscription_update' + | 'web'; diff --git a/src/enums/shared/transaction-status.ts b/src/enums/shared/transaction-status.ts new file mode 100644 index 0000000..4fb1739 --- /dev/null +++ b/src/enums/shared/transaction-status.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type TransactionStatus = 'draft' | 'ready' | 'billed' | 'paid' | 'completed' | 'canceled' | 'past_due'; diff --git a/src/enums/subscription/index.ts b/src/enums/subscription/index.ts new file mode 100644 index 0000000..357859e --- /dev/null +++ b/src/enums/subscription/index.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './subscription-effective-from'; +export * from './proration-billing-mode'; +export * from './scheduled-change-action'; +export * from './subscription-status'; +export * from './subscription-item-status'; +export * from './subscription-on-payment-failure'; diff --git a/src/enums/subscription/proration-billing-mode.ts b/src/enums/subscription/proration-billing-mode.ts new file mode 100644 index 0000000..b811ac1 --- /dev/null +++ b/src/enums/subscription/proration-billing-mode.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type ProrationBillingMode = + | 'prorated_immediately' + | 'prorated_next_billing_period' + | 'full_immediately' + | 'full_next_billing_period' + | 'do_not_bill'; diff --git a/src/enums/subscription/scheduled-change-action.ts b/src/enums/subscription/scheduled-change-action.ts new file mode 100644 index 0000000..18f906a --- /dev/null +++ b/src/enums/subscription/scheduled-change-action.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type ScheduledChangeAction = 'cancel' | 'pause' | 'resume'; diff --git a/src/enums/subscription/subscription-effective-from.ts b/src/enums/subscription/subscription-effective-from.ts new file mode 100644 index 0000000..3f42232 --- /dev/null +++ b/src/enums/subscription/subscription-effective-from.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type SubscriptionEffectiveFrom = 'next_billing_period' | 'immediately'; diff --git a/src/enums/subscription/subscription-item-status.ts b/src/enums/subscription/subscription-item-status.ts new file mode 100644 index 0000000..6857e90 --- /dev/null +++ b/src/enums/subscription/subscription-item-status.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type SubscriptionItemStatus = 'active' | 'inactive' | 'trialing'; diff --git a/src/enums/subscription/subscription-on-payment-failure.ts b/src/enums/subscription/subscription-on-payment-failure.ts new file mode 100644 index 0000000..a98e897 --- /dev/null +++ b/src/enums/subscription/subscription-on-payment-failure.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type SubscriptionOnPaymentFailure = 'prevent_change' | 'apply_change'; diff --git a/src/enums/subscription/subscription-status.ts b/src/enums/subscription/subscription-status.ts new file mode 100644 index 0000000..a784ca1 --- /dev/null +++ b/src/enums/subscription/subscription-status.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type SubscriptionStatus = 'active' | 'canceled' | 'past_due' | 'paused' | 'trialing'; diff --git a/src/enums/transaction/index.ts b/src/enums/transaction/index.ts new file mode 100644 index 0000000..29d8b51 --- /dev/null +++ b/src/enums/transaction/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './payment-card-type'; diff --git a/src/enums/transaction/payment-card-type.ts b/src/enums/transaction/payment-card-type.ts new file mode 100644 index 0000000..5641949 --- /dev/null +++ b/src/enums/transaction/payment-card-type.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export type PaymentCardType = + | 'american_express' + | 'diners_club' + | 'discover' + | 'jcb' + | 'mada' + | 'maestro' + | 'mastercard' + | 'union_pay' + | 'unknown' + | 'visa'; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..cffc670 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export { Environment } from './internal'; +export { SDK_VERSION } from './version'; + +export { Paddle } from './paddle'; +export * from './entities'; +export * from './enums'; +export * from './notifications'; +export * from './resources'; +export * from './types'; diff --git a/src/internal/api/case-helpers.ts b/src/internal/api/case-helpers.ts new file mode 100644 index 0000000..688e3c4 --- /dev/null +++ b/src/internal/api/case-helpers.ts @@ -0,0 +1,54 @@ +import { isArray, isBoolean, isDate, isFunction, isObject, isRegExp, snakeCase } from 'lodash'; + +interface CustomData { + customData: unknown; +} + +interface ObjectWithData { + data: Record; +} + +function isTopLevelCustomDataCamel(input: any): input is CustomData { + return 'customData' in input; +} + +function decamelizeKeys(obj: any): ObjectWithData { + if (!isObject(obj) || isDate(obj) || isRegExp(obj) || isBoolean(obj) || isFunction(obj)) { + return obj; + } + + let output: any; + let i = 0; + let l = 0; + + if (isArray(obj)) { + output = []; + for (l = obj.length; i < l; i++) { + output.push(decamelizeKeys(obj[i])); + } + } else { + output = {}; + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + output[snakeCase(key)] = decamelizeKeys((obj as any)[key]); + } + } + } + return output; +} + +export function convertToSnakeCase(input: unknown) { + if (!input || !isObject(input)) { + return input; + } + + if (isTopLevelCustomDataCamel(input)) { + // top level customData + const { customData, ...rest } = input; + const result = decamelizeKeys(rest); + return { ...result, custom_data: customData }; + } else { + // phew + return decamelizeKeys(input); + } +} diff --git a/src/internal/api/client.ts b/src/internal/api/client.ts new file mode 100644 index 0000000..e4acfb2 --- /dev/null +++ b/src/internal/api/client.ts @@ -0,0 +1,106 @@ +import { API_ENVIRONMENT_TO_BASE_URL_MAP } from './constants'; +import { type QueryParameters } from '../base'; +import fetch from 'node-fetch'; +import { SDK_VERSION } from '../../version'; +import { type PaddleOptions } from '../types/config'; +import { Environment } from './environment'; +import { randomUUID } from 'crypto'; +import { Logger } from '../base/logger'; +import { convertToSnakeCase } from './case-helpers'; +import { type ErrorResponse } from '../types/response'; + +export class Client { + private readonly baseUrl: string; + + constructor( + private readonly apiKey: string, + private readonly options: PaddleOptions, + ) { + this.baseUrl = this.getBaseUrl(this.options.environment); + } + + private getBaseUrl(environment?: Environment): string { + const urlBasedOnEnv = API_ENVIRONMENT_TO_BASE_URL_MAP[environment ?? Environment.production]; + return urlBasedOnEnv || (environment as string); + } + + private getHeaders() { + const uuid = randomUUID(); + + return { + Authorization: `bearer ${this.apiKey}`, + 'Content-Type': 'application/json', + 'user-agent': `PaddleSDK/node ${SDK_VERSION}`, + 'X-Transaction-ID': uuid, + }; + } + + public async get(url: string, queryParams?: QueryParameters): Promise { + let finalUrl = url.includes(this.baseUrl) ? url : `${this.baseUrl}${url}`; + + if (!finalUrl.includes('?') && queryParams) { + finalUrl += queryParams.toQueryString(); + } + + const logUrl = finalUrl.split('?')[0]; + const headers = this.getHeaders(); + + Logger.logRequest('GET', logUrl, headers); + + const rawResponse = await fetch(finalUrl, { + headers, + }); + + Logger.logResponse('GET', logUrl, headers, rawResponse); + + return rawResponse.json() as R; + } + + public async post(url: string, requestBody: B): Promise { + const logUrl = url.split('?')[0]; + const headers = this.getHeaders(); + + Logger.logRequest('POST', logUrl, headers); + + const rawResponse = await fetch(`${this.baseUrl}${url}`, { + method: 'POST', + body: JSON.stringify(convertToSnakeCase(requestBody)), + headers, + }); + Logger.logResponse('POST', logUrl, headers, rawResponse); + + return rawResponse.json() as R; + } + + public async patch(url: string, requestBody: B): Promise { + const logUrl = url.split('?')[0]; + const headers = this.getHeaders(); + + Logger.logRequest('PATCH', logUrl, headers); + + const rawResponse = await fetch(`${this.baseUrl}${url}`, { + method: 'PATCH', + body: JSON.stringify(convertToSnakeCase(requestBody)), + headers, + }); + + Logger.logResponse('PATCH', logUrl, headers, rawResponse); + return rawResponse.json() as R; + } + + public async delete(url: string): Promise { + const logUrl = url.split('?')[0]; + const headers = this.getHeaders(); + + Logger.logRequest('DELETE', logUrl, headers); + + const rawResponse = await fetch(`${this.baseUrl}${url}`, { + method: 'DELETE', + headers, + }); + + Logger.logResponse('DELETE', logUrl, headers, rawResponse); + + return rawResponse as unknown as ErrorResponse | undefined; + } +} diff --git a/src/internal/api/constants.ts b/src/internal/api/constants.ts new file mode 100644 index 0000000..6923871 --- /dev/null +++ b/src/internal/api/constants.ts @@ -0,0 +1,6 @@ +import { Environment } from './environment'; + +export const API_ENVIRONMENT_TO_BASE_URL_MAP: Record = { + [Environment.production]: 'https://api.paddle.com', + [Environment.sandbox]: 'https://sandbox-api.paddle.com', +} as const; diff --git a/src/internal/api/environment.ts b/src/internal/api/environment.ts new file mode 100644 index 0000000..4a900f4 --- /dev/null +++ b/src/internal/api/environment.ts @@ -0,0 +1,4 @@ +export enum Environment { + sandbox = 'sandbox', + production = 'production', +} diff --git a/src/internal/api/index.ts b/src/internal/api/index.ts new file mode 100644 index 0000000..10f4e9c --- /dev/null +++ b/src/internal/api/index.ts @@ -0,0 +1,2 @@ +export { Environment } from './environment'; +export { convertToSnakeCase } from './case-helpers'; diff --git a/src/internal/base/base-resource.ts b/src/internal/base/base-resource.ts new file mode 100644 index 0000000..ce0545b --- /dev/null +++ b/src/internal/base/base-resource.ts @@ -0,0 +1,22 @@ +import { type Client } from '../api/client'; +import { ApiError } from '../errors/generic'; +import { type ErrorResponse, type Response } from '../types/response'; + +export class BaseResource { + constructor(protected readonly client: Client) {} + + protected handleError(error: ErrorResponse): void { + if (error.error) { + throw new ApiError(error.error); + } + } + + protected handleResponse(response: Response | ErrorResponse): T { + const entityResponse = response as Response; + const error = response as ErrorResponse; + + this.handleError(error); + + return entityResponse.data; + } +} diff --git a/src/internal/base/collection.ts b/src/internal/base/collection.ts new file mode 100644 index 0000000..06843f2 --- /dev/null +++ b/src/internal/base/collection.ts @@ -0,0 +1,53 @@ +import { type Client } from '../api/client'; +import { ApiError } from '../errors/generic'; +import { type ErrorResponse, type ResponsePaginated } from '../types/response'; + +export abstract class Collection implements AsyncIterable { + private hasMore: boolean = true; + private nextLink: string; + private data: C[] = []; + + constructor( + private readonly client: Client, + initialUri: string, + ) { + this.nextLink = initialUri; + } + + async next(): Promise { + const response = await this.client.get | ErrorResponse>(this.nextLink); + + const handledResponse = this.handlePaginatedResponse(response); + + this.hasMore = handledResponse.meta.pagination.has_more ?? false; + this.nextLink = handledResponse.meta.pagination.next; + this.data = handledResponse.data.map((data) => this.fromJson(data)); + + return this.data.length > 0 ? this.data : []; + } + + protected handlePaginatedResponse(response: ResponsePaginated | ErrorResponse): ResponsePaginated { + const entityResponse = response as ResponsePaginated; + const error = response as ErrorResponse; + + if (error.error) { + throw new ApiError(error.error); + } + + return entityResponse; + } + + abstract fromJson(data: any): C; + + async *[Symbol.asyncIterator](): AsyncIterator { + while (this.hasMore) { + await this.next(); + + for (let index = 0; index < this.data.length; index++) { + if (this.data[index]) { + yield this.data[index] as C; + } + } + } + } +} diff --git a/src/internal/base/index.ts b/src/internal/base/index.ts new file mode 100644 index 0000000..22bec3c --- /dev/null +++ b/src/internal/base/index.ts @@ -0,0 +1,4 @@ +export * from './base-resource'; +export * from './query-parameters'; +export * from './path-parameters'; +export * from './collection'; diff --git a/src/internal/base/logger.ts b/src/internal/base/logger.ts new file mode 100644 index 0000000..8c3f2d8 --- /dev/null +++ b/src/internal/base/logger.ts @@ -0,0 +1,34 @@ +import { type Response } from 'node-fetch'; + +type LogInputProps = Array; + +export class Logger { + static log(...args: LogInputProps) { + console.log('[Paddle] [LOG]', ...args); + } + + static warn(...args: LogInputProps) { + console.warn('[Paddle] [WARN]', ...args); + } + + static error(...args: LogInputProps) { + console.error('[Paddle] [ERROR]', ...args); + } + + static logRequest(method: string, url: string | undefined, headers: Record) { + Logger.log('[Request]', method, url, 'Transaction ID:', headers['X-Transaction-ID']); + } + + static logResponse(method: string, url: string | undefined, headers: Record, promise: Response) { + Logger.log( + '[Response]', + method, + url, + promise.status.toString(), + 'Transaction ID:', + headers['X-Transaction-ID'], + 'Request ID:', + promise.headers.get('Request-Id'), + ); + } +} diff --git a/src/internal/base/path-parameters.ts b/src/internal/base/path-parameters.ts new file mode 100644 index 0000000..5ad6e5a --- /dev/null +++ b/src/internal/base/path-parameters.ts @@ -0,0 +1,17 @@ +export class PathParameters { + constructor( + private readonly url: string, + private readonly pathParameters: Record, + ) {} + + public deriveUrl() { + let updatedUrl = this.url; + for (const key in this.pathParameters) { + const value = this.pathParameters[key]; + if (key && value) { + updatedUrl = updatedUrl.split(`{${key}}`).join(value.toString()); + } + } + return updatedUrl; + } +} diff --git a/src/internal/base/query-parameters.ts b/src/internal/base/query-parameters.ts new file mode 100644 index 0000000..8d446e0 --- /dev/null +++ b/src/internal/base/query-parameters.ts @@ -0,0 +1,15 @@ +import snakeCase from 'lodash/snakeCase'; + +export class QueryParameters { + constructor(private readonly queryParameters: T) {} + public toQueryString(): string { + const urlSearchParam = new URLSearchParams(); + for (const key in this.queryParameters) { + const value = this.queryParameters[key]; + if (key && value) { + urlSearchParam.append(snakeCase(key), `${value}`); + } + } + return '?' + urlSearchParam.toString(); + } +} diff --git a/src/internal/errors/generic.ts b/src/internal/errors/generic.ts new file mode 100644 index 0000000..dd48b3e --- /dev/null +++ b/src/internal/errors/generic.ts @@ -0,0 +1,19 @@ +import { type ErrorDetail, type ErrorField } from '../../internal'; + +export class ApiError extends Error { + public readonly type: string; + public readonly code: string; + public readonly detail: string; + public readonly documentationUrl: string; + public readonly errors: ErrorField[] | null; + + constructor(errorDetail: ErrorDetail) { + super(errorDetail.detail); + + this.type = errorDetail.type; + this.code = errorDetail.code; + this.detail = errorDetail.detail; + this.documentationUrl = errorDetail.documentation_url; + this.errors = errorDetail.errors ? errorDetail.errors : null; + } +} diff --git a/src/internal/index.ts b/src/internal/index.ts new file mode 100644 index 0000000..8097345 --- /dev/null +++ b/src/internal/index.ts @@ -0,0 +1,3 @@ +export type { ErrorResponse, ResponsePaginated, Response, ErrorDetail, ErrorField } from './types/response'; +export type { PaddleOptions } from './types/config'; +export * from './api'; diff --git a/src/internal/types/config.ts b/src/internal/types/config.ts new file mode 100644 index 0000000..922a2b6 --- /dev/null +++ b/src/internal/types/config.ts @@ -0,0 +1,5 @@ +import { type Environment } from '../api/environment'; + +export interface PaddleOptions { + environment?: Environment; +} diff --git a/src/internal/types/response.ts b/src/internal/types/response.ts new file mode 100644 index 0000000..8f2dd5b --- /dev/null +++ b/src/internal/types/response.ts @@ -0,0 +1,43 @@ +export interface Pagination { + per_page: number; + next: string; + has_more: boolean; + estimated_total: number; +} + +export interface Meta { + request_id: string; +} + +export interface MetaPaginated { + request_id: string; + pagination: Pagination; +} + +export interface Response { + data: T; + meta: Meta; +} + +export interface ResponsePaginated { + data: T[]; + meta: MetaPaginated; +} + +export interface ErrorField { + field: string; + message: string; +} + +export interface ErrorDetail { + type: string; + code: string; + detail: string; + documentation_url: string; + errors?: ErrorField[] | undefined; +} + +export interface ErrorResponse { + error: ErrorDetail; + meta: Meta; +} diff --git a/src/notifications/events/address/address-created-event.ts b/src/notifications/events/address/address-created-event.ts new file mode 100644 index 0000000..f1daa0d --- /dev/null +++ b/src/notifications/events/address/address-created-event.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { Address } from '../../../entities'; +import { type IAddressResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; +import { Event } from '../../../entities/events/event'; + +export class AddressCreatedEvent extends Event { + public override readonly eventType = EventName.AddressCreated; + public override readonly data: Address; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Address(response.data); + } +} diff --git a/src/notifications/events/address/address-imported-event.ts b/src/notifications/events/address/address-imported-event.ts new file mode 100644 index 0000000..2df5734 --- /dev/null +++ b/src/notifications/events/address/address-imported-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Address } from '../../../entities'; +import { type IAddressResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class AddressImportedEvent extends Event { + public override readonly eventType = EventName.AddressImported; + public override readonly data: Address; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Address(response.data); + } +} diff --git a/src/notifications/events/address/address-updated-event.ts b/src/notifications/events/address/address-updated-event.ts new file mode 100644 index 0000000..7abc8b6 --- /dev/null +++ b/src/notifications/events/address/address-updated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Address } from '../../../entities'; +import { type IAddressResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class AddressUpdatedEvent extends Event { + public override readonly eventType = EventName.AddressUpdated; + public override readonly data: Address; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Address(response.data); + } +} diff --git a/src/notifications/events/address/index.ts b/src/notifications/events/address/index.ts new file mode 100644 index 0000000..d3cc3d8 --- /dev/null +++ b/src/notifications/events/address/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './address-created-event'; +export * from './address-updated-event'; +export * from './address-imported-event'; diff --git a/src/notifications/events/adjustment/adjustment-created-event.ts b/src/notifications/events/adjustment/adjustment-created-event.ts new file mode 100644 index 0000000..b96a7b4 --- /dev/null +++ b/src/notifications/events/adjustment/adjustment-created-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Adjustment } from '../../../entities'; +import { type IAdjustmentResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class AdjustmentCreatedEvent extends Event { + public override readonly eventType = EventName.AdjustmentCreated; + public override readonly data: Adjustment; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Adjustment(response.data); + } +} diff --git a/src/notifications/events/adjustment/adjustment-updated-event.ts b/src/notifications/events/adjustment/adjustment-updated-event.ts new file mode 100644 index 0000000..1da3a43 --- /dev/null +++ b/src/notifications/events/adjustment/adjustment-updated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Adjustment } from '../../../entities'; +import { type IAdjustmentResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class AdjustmentUpdatedEvent extends Event { + public override readonly eventType = EventName.AdjustmentUpdated; + public override readonly data: Adjustment; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Adjustment(response.data); + } +} diff --git a/src/notifications/events/adjustment/index.ts b/src/notifications/events/adjustment/index.ts new file mode 100644 index 0000000..b51dc8d --- /dev/null +++ b/src/notifications/events/adjustment/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './adjustment-created-event'; +export * from './adjustment-updated-event'; diff --git a/src/notifications/events/business/business-created-event.ts b/src/notifications/events/business/business-created-event.ts new file mode 100644 index 0000000..0fbc15d --- /dev/null +++ b/src/notifications/events/business/business-created-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Business } from '../../../entities'; +import { type IBusinessResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class BusinessCreatedEvent extends Event { + public override readonly eventType = EventName.BusinessCreated; + public override readonly data: Business; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Business(response.data); + } +} diff --git a/src/notifications/events/business/business-imported-event.ts b/src/notifications/events/business/business-imported-event.ts new file mode 100644 index 0000000..1da1790 --- /dev/null +++ b/src/notifications/events/business/business-imported-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Business } from '../../../entities'; +import { type IBusinessResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class BusinessImportedEvent extends Event { + public override readonly eventType = EventName.BusinessImported; + public override readonly data: Business; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Business(response.data); + } +} diff --git a/src/notifications/events/business/business-updated-event.ts b/src/notifications/events/business/business-updated-event.ts new file mode 100644 index 0000000..60b76ee --- /dev/null +++ b/src/notifications/events/business/business-updated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Business } from '../../../entities'; +import { type IBusinessResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class BusinessUpdatedEvent extends Event { + public override readonly eventType = EventName.BusinessUpdated; + public override readonly data: Business; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Business(response.data); + } +} diff --git a/src/notifications/events/business/index.ts b/src/notifications/events/business/index.ts new file mode 100644 index 0000000..f7efad2 --- /dev/null +++ b/src/notifications/events/business/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './business-created-event'; +export * from './business-updated-event'; +export * from './business-imported-event'; diff --git a/src/notifications/events/customer/customer-created-event.ts b/src/notifications/events/customer/customer-created-event.ts new file mode 100644 index 0000000..be81099 --- /dev/null +++ b/src/notifications/events/customer/customer-created-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Customer } from '../../../entities'; +import { type ICustomerResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class CustomerCreatedEvent extends Event { + public override readonly eventType = EventName.CustomerCreated; + public override readonly data: Customer; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Customer(response.data); + } +} diff --git a/src/notifications/events/customer/customer-imported-event.ts b/src/notifications/events/customer/customer-imported-event.ts new file mode 100644 index 0000000..0b1a680 --- /dev/null +++ b/src/notifications/events/customer/customer-imported-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Customer } from '../../../entities'; +import { type ICustomerResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class CustomerImportedEvent extends Event { + public override readonly eventType = EventName.CustomerImported; + public override readonly data: Customer; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Customer(response.data); + } +} diff --git a/src/notifications/events/customer/customer-updated-event.ts b/src/notifications/events/customer/customer-updated-event.ts new file mode 100644 index 0000000..67daca0 --- /dev/null +++ b/src/notifications/events/customer/customer-updated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Customer } from '../../../entities'; +import { type ICustomerResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class CustomerUpdatedEvent extends Event { + public override readonly eventType = EventName.CustomerUpdated; + public override readonly data: Customer; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Customer(response.data); + } +} diff --git a/src/notifications/events/customer/index.ts b/src/notifications/events/customer/index.ts new file mode 100644 index 0000000..f967c0d --- /dev/null +++ b/src/notifications/events/customer/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './customer-created-event'; +export * from './customer-updated-event'; +export * from './customer-imported-event'; diff --git a/src/notifications/events/discount/discount-created-event.ts b/src/notifications/events/discount/discount-created-event.ts new file mode 100644 index 0000000..adaef6c --- /dev/null +++ b/src/notifications/events/discount/discount-created-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Discount } from '../../../entities'; +import { type IDiscountResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class DiscountCreatedEvent extends Event { + public override readonly eventType = EventName.DiscountCreated; + public override readonly data: Discount; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Discount(response.data); + } +} diff --git a/src/notifications/events/discount/discount-imported-event.ts b/src/notifications/events/discount/discount-imported-event.ts new file mode 100644 index 0000000..f4a3210 --- /dev/null +++ b/src/notifications/events/discount/discount-imported-event.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { Event } from '../../../entities/events/event'; +import { Discount } from '../../../entities'; +import { type IDiscountResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class DiscountImportedEvent extends Event { + public override readonly eventType = EventName.DiscountImported; + public override readonly data: Discount; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Discount(response.data); + } +} diff --git a/src/notifications/events/discount/discount-updated-event.ts b/src/notifications/events/discount/discount-updated-event.ts new file mode 100644 index 0000000..f5f66ee --- /dev/null +++ b/src/notifications/events/discount/discount-updated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Discount } from '../../../entities'; +import { type IDiscountResponse, type IEventsResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class DiscountUpdatedEvent extends Event { + public override readonly eventType = EventName.DiscountUpdated; + public override readonly data: Discount; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Discount(response.data); + } +} diff --git a/src/notifications/events/discount/index.ts b/src/notifications/events/discount/index.ts new file mode 100644 index 0000000..f9abf0b --- /dev/null +++ b/src/notifications/events/discount/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './discount-created-event'; +export * from './discount-updated-event'; +export * from './discount-imported-event'; diff --git a/src/notifications/events/index.ts b/src/notifications/events/index.ts new file mode 100644 index 0000000..40705d3 --- /dev/null +++ b/src/notifications/events/index.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './address'; +export * from './adjustment'; +export * from './business'; +export * from './customer'; +export * from './discount'; +export * from './payout'; +export * from './price'; +export * from './product'; +export * from './subscription'; +export * from './transaction'; +export * from './report'; diff --git a/src/notifications/events/payout/index.ts b/src/notifications/events/payout/index.ts new file mode 100644 index 0000000..43404ae --- /dev/null +++ b/src/notifications/events/payout/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './payout-created-event'; +export * from './payout-paid-event'; diff --git a/src/notifications/events/payout/payout-created-event.ts b/src/notifications/events/payout/payout-created-event.ts new file mode 100644 index 0000000..d498183 --- /dev/null +++ b/src/notifications/events/payout/payout-created-event.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { Event } from '../../../entities/events/event'; +import { Payout } from '../../../entities'; +import { type IEventsResponse, type IPayoutResponse } from '../../../types'; +import { EventName } from '../../helpers'; + +export class PayoutCreatedEvent extends Event { + public override readonly eventType = EventName.PayoutCreated; + public override readonly data: Payout; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Payout(response.data); + } +} diff --git a/src/notifications/events/payout/payout-paid-event.ts b/src/notifications/events/payout/payout-paid-event.ts new file mode 100644 index 0000000..226a914 --- /dev/null +++ b/src/notifications/events/payout/payout-paid-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Payout } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type IPayoutResponse } from '../../../types'; + +export class PayoutPaidEvent extends Event { + public override readonly eventType = EventName.PayoutPaid; + public override readonly data: Payout; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Payout(response.data); + } +} diff --git a/src/notifications/events/price/index.ts b/src/notifications/events/price/index.ts new file mode 100644 index 0000000..422317c --- /dev/null +++ b/src/notifications/events/price/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './price-created-event'; +export * from './price-updated-event'; +export * from './price-imported-event'; diff --git a/src/notifications/events/price/price-created-event.ts b/src/notifications/events/price/price-created-event.ts new file mode 100644 index 0000000..e36a454 --- /dev/null +++ b/src/notifications/events/price/price-created-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Price } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type IPriceResponse } from '../../../types'; + +export class PriceCreatedEvent extends Event { + public override readonly eventType = EventName.PriceCreated; + public override readonly data: Price; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Price(response.data); + } +} diff --git a/src/notifications/events/price/price-imported-event.ts b/src/notifications/events/price/price-imported-event.ts new file mode 100644 index 0000000..77ebf6d --- /dev/null +++ b/src/notifications/events/price/price-imported-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Price } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type IPriceResponse } from '../../../types'; + +export class PriceImportedEvent extends Event { + public override readonly eventType = EventName.PriceImported; + public override readonly data: Price; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Price(response.data); + } +} diff --git a/src/notifications/events/price/price-updated-event.ts b/src/notifications/events/price/price-updated-event.ts new file mode 100644 index 0000000..35833f0 --- /dev/null +++ b/src/notifications/events/price/price-updated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Price } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type IPriceResponse } from '../../../types'; + +export class PriceUpdatedEvent extends Event { + public override readonly eventType = EventName.PriceUpdated; + public override readonly data: Price; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Price(response.data); + } +} diff --git a/src/notifications/events/product/index.ts b/src/notifications/events/product/index.ts new file mode 100644 index 0000000..eb660ae --- /dev/null +++ b/src/notifications/events/product/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './product-created-event'; +export * from './product-updated-event'; +export * from './product-imported-event'; diff --git a/src/notifications/events/product/product-created-event.ts b/src/notifications/events/product/product-created-event.ts new file mode 100644 index 0000000..f1ac9a0 --- /dev/null +++ b/src/notifications/events/product/product-created-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Product } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type IProductResponse } from '../../../types'; + +export class ProductCreatedEvent extends Event { + public override readonly eventType = EventName.ProductCreated; + public override readonly data: Product; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Product(response.data); + } +} diff --git a/src/notifications/events/product/product-imported-event.ts b/src/notifications/events/product/product-imported-event.ts new file mode 100644 index 0000000..27937b1 --- /dev/null +++ b/src/notifications/events/product/product-imported-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Product } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type IProductResponse } from '../../../types'; + +export class ProductImportedEvent extends Event { + public override readonly eventType = EventName.ProductImported; + public override readonly data: Product; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Product(response.data); + } +} diff --git a/src/notifications/events/product/product-updated-event.ts b/src/notifications/events/product/product-updated-event.ts new file mode 100644 index 0000000..d87f9d7 --- /dev/null +++ b/src/notifications/events/product/product-updated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Product } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type IProductResponse } from '../../../types'; + +export class ProductUpdatedEvent extends Event { + public override readonly eventType = EventName.ProductUpdated; + public override readonly data: Product; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Product(response.data); + } +} diff --git a/src/notifications/events/report/index.ts b/src/notifications/events/report/index.ts new file mode 100644 index 0000000..f9a5198 --- /dev/null +++ b/src/notifications/events/report/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './report-created-event'; +export * from './report-updated-event'; diff --git a/src/notifications/events/report/report-created-event.ts b/src/notifications/events/report/report-created-event.ts new file mode 100644 index 0000000..5399d93 --- /dev/null +++ b/src/notifications/events/report/report-created-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Report } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type IReportResponse } from '../../../types'; + +export class ReportCreatedEvent extends Event { + public override readonly eventType = EventName.ReportCreated; + public override readonly data: Report; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Report(response.data); + } +} diff --git a/src/notifications/events/report/report-updated-event.ts b/src/notifications/events/report/report-updated-event.ts new file mode 100644 index 0000000..d6fe911 --- /dev/null +++ b/src/notifications/events/report/report-updated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Report } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type IReportResponse } from '../../../types'; + +export class ReportUpdatedEvent extends Event { + public override readonly eventType = EventName.ReportUpdated; + public override readonly data: Report; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Report(response.data); + } +} diff --git a/src/notifications/events/subscription/index.ts b/src/notifications/events/subscription/index.ts new file mode 100644 index 0000000..956f42d --- /dev/null +++ b/src/notifications/events/subscription/index.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './subscription-activated-event'; +export * from './subscription-canceled-event'; +export * from './subscription-created-event'; +export * from './subscription-imported-event'; +export * from './subscription-past-due-event'; +export * from './subscription-paused-event'; +export * from './subscription-resumed-event'; +export * from './subscription-trialing-event'; +export * from './subscription-updated-event'; diff --git a/src/notifications/events/subscription/subscription-activated-event.ts b/src/notifications/events/subscription/subscription-activated-event.ts new file mode 100644 index 0000000..95a6e0c --- /dev/null +++ b/src/notifications/events/subscription/subscription-activated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { SubscriptionNotification } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export class SubscriptionActivatedEvent extends Event { + public override readonly eventType = EventName.SubscriptionActivated; + public override readonly data: Omit; + + constructor(response: IEventsResponse) { + super(response); + this.data = new SubscriptionNotification(response.data); + } +} diff --git a/src/notifications/events/subscription/subscription-canceled-event.ts b/src/notifications/events/subscription/subscription-canceled-event.ts new file mode 100644 index 0000000..2cce641 --- /dev/null +++ b/src/notifications/events/subscription/subscription-canceled-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { SubscriptionNotification } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export class SubscriptionCanceledEvent extends Event { + public override readonly eventType = EventName.SubscriptionCanceled; + public override readonly data: Omit; + + constructor(response: IEventsResponse) { + super(response); + this.data = new SubscriptionNotification(response.data); + } +} diff --git a/src/notifications/events/subscription/subscription-created-event.ts b/src/notifications/events/subscription/subscription-created-event.ts new file mode 100644 index 0000000..03ebf3d --- /dev/null +++ b/src/notifications/events/subscription/subscription-created-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { SubscriptionNotification } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export class SubscriptionCreatedEvent extends Event { + public override readonly eventType = EventName.SubscriptionCreated; + public override readonly data: SubscriptionNotification; + + constructor(response: IEventsResponse) { + super(response); + this.data = new SubscriptionNotification(response.data); + } +} diff --git a/src/notifications/events/subscription/subscription-imported-event.ts b/src/notifications/events/subscription/subscription-imported-event.ts new file mode 100644 index 0000000..192c9c4 --- /dev/null +++ b/src/notifications/events/subscription/subscription-imported-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { SubscriptionNotification } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export class SubscriptionImportedEvent extends Event { + public override readonly eventType = EventName.SubscriptionImported; + public override readonly data: Omit; + + constructor(response: IEventsResponse) { + super(response); + this.data = new SubscriptionNotification(response.data); + } +} diff --git a/src/notifications/events/subscription/subscription-past-due-event.ts b/src/notifications/events/subscription/subscription-past-due-event.ts new file mode 100644 index 0000000..7e75c4c --- /dev/null +++ b/src/notifications/events/subscription/subscription-past-due-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { SubscriptionNotification } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export class SubscriptionPastDueEvent extends Event { + public override readonly eventType = EventName.SubscriptionPastDue; + public override readonly data: Omit; + + constructor(response: IEventsResponse) { + super(response); + this.data = new SubscriptionNotification(response.data); + } +} diff --git a/src/notifications/events/subscription/subscription-paused-event.ts b/src/notifications/events/subscription/subscription-paused-event.ts new file mode 100644 index 0000000..d07b4b8 --- /dev/null +++ b/src/notifications/events/subscription/subscription-paused-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { SubscriptionNotification } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export class SubscriptionPausedEvent extends Event { + public override readonly eventType = EventName.SubscriptionPaused; + public override readonly data: Omit; + + constructor(response: IEventsResponse) { + super(response); + this.data = new SubscriptionNotification(response.data); + } +} diff --git a/src/notifications/events/subscription/subscription-resumed-event.ts b/src/notifications/events/subscription/subscription-resumed-event.ts new file mode 100644 index 0000000..1ee067d --- /dev/null +++ b/src/notifications/events/subscription/subscription-resumed-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { SubscriptionNotification } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export class SubscriptionResumedEvent extends Event { + public override readonly eventType = EventName.SubscriptionResumed; + public override readonly data: Omit; + + constructor(response: IEventsResponse) { + super(response); + this.data = new SubscriptionNotification(response.data); + } +} diff --git a/src/notifications/events/subscription/subscription-trialing-event.ts b/src/notifications/events/subscription/subscription-trialing-event.ts new file mode 100644 index 0000000..b48b984 --- /dev/null +++ b/src/notifications/events/subscription/subscription-trialing-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { SubscriptionNotification } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export class SubscriptionTrialingEvent extends Event { + public override readonly eventType = EventName.SubscriptionTrialing; + public override readonly data: Omit; + + constructor(response: IEventsResponse) { + super(response); + this.data = new SubscriptionNotification(response.data); + } +} diff --git a/src/notifications/events/subscription/subscription-updated-event.ts b/src/notifications/events/subscription/subscription-updated-event.ts new file mode 100644 index 0000000..45ef38a --- /dev/null +++ b/src/notifications/events/subscription/subscription-updated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { SubscriptionNotification } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ISubscriptionNotificationResponse } from '../../../types'; + +export class SubscriptionUpdatedEvent extends Event { + public override readonly eventType = EventName.SubscriptionUpdated; + public override readonly data: Omit; + + constructor(response: IEventsResponse) { + super(response); + this.data = new SubscriptionNotification(response.data); + } +} diff --git a/src/notifications/events/transaction/index.ts b/src/notifications/events/transaction/index.ts new file mode 100644 index 0000000..432aefe --- /dev/null +++ b/src/notifications/events/transaction/index.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './transaction-billed-event'; +export * from './transaction-canceled-event'; +export * from './transaction-created-event'; +export * from './transaction-completed-event'; +export * from './transaction-paid-event'; +export * from './transaction-past-due-event'; +export * from './transaction-payment-failed-event'; +export * from './transaction-ready-event'; +export * from './transaction-updated-event'; diff --git a/src/notifications/events/transaction/transaction-billed-event.ts b/src/notifications/events/transaction/transaction-billed-event.ts new file mode 100644 index 0000000..1448797 --- /dev/null +++ b/src/notifications/events/transaction/transaction-billed-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Transaction } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export class TransactionBilledEvent extends Event { + public override readonly eventType = EventName.TransactionBilled; + public override readonly data: Transaction; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Transaction(response.data); + } +} diff --git a/src/notifications/events/transaction/transaction-canceled-event.ts b/src/notifications/events/transaction/transaction-canceled-event.ts new file mode 100644 index 0000000..c88a88e --- /dev/null +++ b/src/notifications/events/transaction/transaction-canceled-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Transaction } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export class TransactionCanceledEvent extends Event { + public override readonly eventType = EventName.TransactionCanceled; + public override readonly data: Transaction; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Transaction(response.data); + } +} diff --git a/src/notifications/events/transaction/transaction-completed-event.ts b/src/notifications/events/transaction/transaction-completed-event.ts new file mode 100644 index 0000000..7eab3fb --- /dev/null +++ b/src/notifications/events/transaction/transaction-completed-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Transaction } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export class TransactionCompletedEvent extends Event { + public override readonly eventType = EventName.TransactionCompleted; + public override readonly data: Transaction; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Transaction(response.data); + } +} diff --git a/src/notifications/events/transaction/transaction-created-event.ts b/src/notifications/events/transaction/transaction-created-event.ts new file mode 100644 index 0000000..8102d6b --- /dev/null +++ b/src/notifications/events/transaction/transaction-created-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Transaction } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export class TransactionCreatedEvent extends Event { + public override readonly eventType = EventName.TransactionCreated; + public override readonly data: Transaction; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Transaction(response.data); + } +} diff --git a/src/notifications/events/transaction/transaction-paid-event.ts b/src/notifications/events/transaction/transaction-paid-event.ts new file mode 100644 index 0000000..2006615 --- /dev/null +++ b/src/notifications/events/transaction/transaction-paid-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Transaction } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export class TransactionPaidEvent extends Event { + public override readonly eventType = EventName.TransactionPaid; + public override readonly data: Transaction; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Transaction(response.data); + } +} diff --git a/src/notifications/events/transaction/transaction-past-due-event.ts b/src/notifications/events/transaction/transaction-past-due-event.ts new file mode 100644 index 0000000..69acfce --- /dev/null +++ b/src/notifications/events/transaction/transaction-past-due-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Transaction } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export class TransactionPastDueEvent extends Event { + public override readonly eventType = EventName.TransactionPastDue; + public override readonly data: Transaction; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Transaction(response.data); + } +} diff --git a/src/notifications/events/transaction/transaction-payment-failed-event.ts b/src/notifications/events/transaction/transaction-payment-failed-event.ts new file mode 100644 index 0000000..ee4059b --- /dev/null +++ b/src/notifications/events/transaction/transaction-payment-failed-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Transaction } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export class TransactionPaymentFailedEvent extends Event { + public override readonly eventType = EventName.TransactionPaymentFailed; + public override readonly data: Transaction; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Transaction(response.data); + } +} diff --git a/src/notifications/events/transaction/transaction-ready-event.ts b/src/notifications/events/transaction/transaction-ready-event.ts new file mode 100644 index 0000000..474e9ab --- /dev/null +++ b/src/notifications/events/transaction/transaction-ready-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Transaction } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export class TransactionReadyEvent extends Event { + public override readonly eventType = EventName.TransactionReady; + public override readonly data: Transaction; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Transaction(response.data); + } +} diff --git a/src/notifications/events/transaction/transaction-updated-event.ts b/src/notifications/events/transaction/transaction-updated-event.ts new file mode 100644 index 0000000..d6bc879 --- /dev/null +++ b/src/notifications/events/transaction/transaction-updated-event.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Event } from '../../../entities/events/event'; +import { Transaction } from '../../../entities'; +import { EventName } from '../../helpers'; +import { type IEventsResponse, type ITransactionResponse } from '../../../types'; + +export class TransactionUpdatedEvent extends Event { + public override readonly eventType = EventName.TransactionUpdated; + public override readonly data: Transaction; + + constructor(response: IEventsResponse) { + super(response); + this.data = new Transaction(response.data); + } +} diff --git a/src/notifications/helpers/index.ts b/src/notifications/helpers/index.ts new file mode 100644 index 0000000..484ba39 --- /dev/null +++ b/src/notifications/helpers/index.ts @@ -0,0 +1,3 @@ +export * from './types'; +export * from './webhooks'; +export * from './webhooks-validator'; diff --git a/src/notifications/helpers/types.ts b/src/notifications/helpers/types.ts new file mode 100644 index 0000000..bb6e55b --- /dev/null +++ b/src/notifications/helpers/types.ts @@ -0,0 +1,175 @@ +import { + type AddressCreatedEvent, + type AddressUpdatedEvent, + type AddressImportedEvent, + type BusinessCreatedEvent, + type AdjustmentCreatedEvent, + type AdjustmentUpdatedEvent, + type BusinessUpdatedEvent, + type CustomerCreatedEvent, + type CustomerUpdatedEvent, + type DiscountCreatedEvent, + type DiscountImportedEvent, + type DiscountUpdatedEvent, + type PayoutCreatedEvent, + type PayoutPaidEvent, + type PriceCreatedEvent, + type PriceUpdatedEvent, + type ProductCreatedEvent, + type ProductUpdatedEvent, + type SubscriptionCreatedEvent, + type SubscriptionActivatedEvent, + type SubscriptionCanceledEvent, + type SubscriptionImportedEvent, + type SubscriptionPausedEvent, + type SubscriptionResumedEvent, + type SubscriptionTrialingEvent, + type SubscriptionUpdatedEvent, + type TransactionCanceledEvent, + type TransactionBilledEvent, + type TransactionCompletedEvent, + type TransactionCreatedEvent, + type TransactionPaidEvent, + type SubscriptionPastDueEvent, + type TransactionPastDueEvent, + type TransactionPaymentFailedEvent, + type TransactionReadyEvent, + type TransactionUpdatedEvent, + type ReportUpdatedEvent, + type ReportCreatedEvent, + type BusinessImportedEvent, + type CustomerImportedEvent, + type PriceImportedEvent, + type ProductImportedEvent, +} from '../events'; + +export type EventEntity = + | AddressCreatedEvent + | AddressUpdatedEvent + | AddressImportedEvent + | AdjustmentUpdatedEvent + | AdjustmentCreatedEvent + | BusinessCreatedEvent + | BusinessUpdatedEvent + | BusinessImportedEvent + | CustomerCreatedEvent + | CustomerUpdatedEvent + | CustomerImportedEvent + | DiscountCreatedEvent + | DiscountUpdatedEvent + | DiscountImportedEvent + | PayoutCreatedEvent + | PayoutPaidEvent + | PriceCreatedEvent + | PriceUpdatedEvent + | PriceImportedEvent + | ProductCreatedEvent + | ProductUpdatedEvent + | ProductImportedEvent + | SubscriptionActivatedEvent + | SubscriptionCanceledEvent + | SubscriptionCreatedEvent + | SubscriptionImportedEvent + | SubscriptionPastDueEvent + | SubscriptionPausedEvent + | SubscriptionResumedEvent + | SubscriptionTrialingEvent + | SubscriptionUpdatedEvent + | TransactionBilledEvent + | TransactionCanceledEvent + | TransactionCompletedEvent + | TransactionCreatedEvent + | TransactionPaidEvent + | TransactionPastDueEvent + | TransactionPaymentFailedEvent + | TransactionReadyEvent + | TransactionUpdatedEvent + | ReportUpdatedEvent + | ReportCreatedEvent; + +export enum EventName { + AddressCreated = 'address.created', + AddressUpdated = 'address.updated', + AddressImported = 'address.imported', + AdjustmentCreated = 'adjustment.created', + AdjustmentUpdated = 'adjustment.updated', + BusinessCreated = 'business.created', + BusinessImported = 'business.imported', + BusinessUpdated = 'business.updated', + CustomerCreated = 'customer.created', + CustomerUpdated = 'customer.updated', + CustomerImported = 'customer.imported', + DiscountCreated = 'discount.created', + DiscountUpdated = 'discount.updated', + DiscountImported = 'discount.imported', + PayoutCreated = 'payout.created', + PayoutPaid = 'payout.paid', + PriceCreated = 'price.created', + PriceUpdated = 'price.updated', + PriceImported = 'price.imported', + ProductCreated = 'product.created', + ProductUpdated = 'product.updated', + ProductImported = 'product.imported', + SubscriptionActivated = 'subscription.activated', + SubscriptionCanceled = 'subscription.canceled', + SubscriptionImported = 'subscription.imported', + SubscriptionCreated = 'subscription.created', + SubscriptionPastDue = 'subscription.past_due', + SubscriptionPaused = 'subscription.paused', + SubscriptionResumed = 'subscription.resumed', + SubscriptionTrialing = 'subscription.trialing', + SubscriptionUpdated = 'subscription.updated', + TransactionBilled = 'transaction.billed', + TransactionCanceled = 'transaction.canceled', + TransactionCompleted = 'transaction.completed', + TransactionPaid = 'transaction.paid', + TransactionCreated = 'transaction.created', + TransactionPastDue = 'transaction.past_due', + TransactionPaymentFailed = 'transaction.payment_failed', + TransactionReady = 'transaction.ready', + TransactionUpdated = 'transaction.updated', + ReportCreated = 'report.created', + ReportUpdated = 'report.updated', +} +export type IEventName = + | 'address.created' + | 'address.updated' + | 'address.imported' + | 'adjustment.created' + | 'adjustment.updated' + | 'business.created' + | 'business.updated' + | 'business.imported' + | 'customer.created' + | 'customer.updated' + | 'discount.created' + | 'discount.updated' + | 'discount.imported' + | 'payout.updated' + | 'payout.paid' + | 'price.updated' + | 'price.created' + | 'price.imported' + | 'product.updated' + | 'product.created' + | 'product.imported' + | 'subscription.activated' + | 'subscription.canceled' + | 'subscription.imported' + | 'subscription.created' + | 'subscription.past_due' + | 'subscription.paused' + | 'subscription.resumed' + | 'subscription.trialing' + | 'subscription.updated' + | 'transaction.billed' + | 'transaction.canceled' + | 'transaction.completed' + | 'transaction.paid' + | 'transaction.created' + | 'transaction.past_due' + | 'transaction.payment_failed' + | 'transaction.ready' + | 'transaction.updated' + | 'report.created' + | 'report.updated'; diff --git a/src/notifications/helpers/webhooks-validator.ts b/src/notifications/helpers/webhooks-validator.ts new file mode 100644 index 0000000..3877a39 --- /dev/null +++ b/src/notifications/helpers/webhooks-validator.ts @@ -0,0 +1,44 @@ +import { createHmac } from 'crypto'; + +interface ParsedHeaders { + ts: number; + h1: string; +} +export class WebhooksValidator { + private static readonly MAX_VALID_TIME_DIFFERENCE = 5; + private extractHeader(header: string): ParsedHeaders { + const parts = header.split(';'); + let ts = ''; + let h1 = ''; + for (const part of parts) { + const [key, value] = part.split('='); + if (value) { + if (key === 'ts') { + ts = value; + } else if (key === 'h1') { + h1 = value; + } + } + } + if (ts && h1) { + return { ts: parseInt(ts), h1 }; + } else { + throw new Error('[Paddle] Invalid webhook signature'); + } + } + + public isValidSignature(requestBody: string, secretKey: string, signature: string) { + const headers = this.extractHeader(signature); + const payloadWithTime = `${headers.ts}:${requestBody}`; + + if (new Date().getTime() > new Date((headers.ts + WebhooksValidator.MAX_VALID_TIME_DIFFERENCE) * 1000).getTime()) { + return false; + } + + const hmac = createHmac('sha256', secretKey); + hmac.update(payloadWithTime); + + const computedHash = hmac.digest('hex'); + return computedHash === headers.h1; + } +} diff --git a/src/notifications/helpers/webhooks.ts b/src/notifications/helpers/webhooks.ts new file mode 100644 index 0000000..b3c1e1e --- /dev/null +++ b/src/notifications/helpers/webhooks.ts @@ -0,0 +1,158 @@ +import { type IEvents } from '../../types'; +import { + AddressCreatedEvent, + AddressUpdatedEvent, + AddressImportedEvent, + AdjustmentCreatedEvent, + AdjustmentUpdatedEvent, + BusinessCreatedEvent, + BusinessUpdatedEvent, + CustomerCreatedEvent, + CustomerUpdatedEvent, + DiscountCreatedEvent, + DiscountImportedEvent, + DiscountUpdatedEvent, + PayoutCreatedEvent, + PayoutPaidEvent, + PriceCreatedEvent, + PriceUpdatedEvent, + ProductCreatedEvent, + ProductUpdatedEvent, + ReportCreatedEvent, + ReportUpdatedEvent, + SubscriptionActivatedEvent, + SubscriptionCanceledEvent, + SubscriptionCreatedEvent, + SubscriptionImportedEvent, + SubscriptionPastDueEvent, + SubscriptionPausedEvent, + SubscriptionResumedEvent, + SubscriptionTrialingEvent, + SubscriptionUpdatedEvent, + TransactionBilledEvent, + TransactionCanceledEvent, + TransactionCompletedEvent, + TransactionCreatedEvent, + TransactionPaidEvent, + TransactionPastDueEvent, + TransactionPaymentFailedEvent, + TransactionReadyEvent, + TransactionUpdatedEvent, + BusinessImportedEvent, + CustomerImportedEvent, + PriceImportedEvent, + ProductImportedEvent, +} from '../events'; +import { type EventEntity, EventName } from './types'; +import { WebhooksValidator } from './webhooks-validator'; +import { Logger } from '../../internal/base/logger'; + +export class Webhooks { + unmarshal(requestBody: string, secretKey: string, signature: string) { + const isSignatureValid = new WebhooksValidator().isValidSignature(requestBody, secretKey, signature); + + if (isSignatureValid) { + const parsedRequest = JSON.parse(requestBody); + return Webhooks.fromJson(parsedRequest); + } else { + throw new Error('[Paddle] Webhook signature verification failed'); + } + } + + isSignatureValid(requestBody: string, secretKey: string, signature: string) { + return new WebhooksValidator().isValidSignature(requestBody, secretKey, signature); + } + + static fromJson(data: IEvents): EventEntity | null { + switch (data.event_type) { + case EventName.AddressCreated: + return new AddressCreatedEvent(data); + case EventName.AddressUpdated: + return new AddressUpdatedEvent(data); + case EventName.AddressImported: + return new AddressImportedEvent(data); + case EventName.AdjustmentCreated: + return new AdjustmentCreatedEvent(data); + case EventName.AdjustmentUpdated: + return new AdjustmentUpdatedEvent(data); + case EventName.BusinessCreated: + return new BusinessCreatedEvent(data); + case EventName.BusinessUpdated: + return new BusinessUpdatedEvent(data); + case EventName.BusinessImported: + return new BusinessImportedEvent(data); + case EventName.CustomerCreated: + return new CustomerCreatedEvent(data); + case EventName.CustomerUpdated: + return new CustomerUpdatedEvent(data); + case EventName.CustomerImported: + return new CustomerImportedEvent(data); + case EventName.DiscountCreated: + return new DiscountCreatedEvent(data); + case EventName.DiscountImported: + return new DiscountImportedEvent(data); + case EventName.DiscountUpdated: + return new DiscountUpdatedEvent(data); + case EventName.PayoutCreated: + return new PayoutCreatedEvent(data); + case EventName.PayoutPaid: + return new PayoutPaidEvent(data); + case EventName.PriceCreated: + return new PriceCreatedEvent(data); + case EventName.PriceUpdated: + return new PriceUpdatedEvent(data); + case EventName.PriceImported: + return new PriceImportedEvent(data); + case EventName.ProductCreated: + return new ProductCreatedEvent(data); + case EventName.ProductUpdated: + return new ProductUpdatedEvent(data); + case EventName.ProductImported: + return new ProductImportedEvent(data); + case EventName.SubscriptionActivated: + return new SubscriptionActivatedEvent(data); + case EventName.SubscriptionCanceled: + return new SubscriptionCanceledEvent(data); + case EventName.SubscriptionCreated: + return new SubscriptionCreatedEvent(data); + case EventName.SubscriptionImported: + return new SubscriptionImportedEvent(data); + case EventName.SubscriptionPastDue: + return new SubscriptionPastDueEvent(data); + case EventName.SubscriptionPaused: + return new SubscriptionPausedEvent(data); + case EventName.SubscriptionResumed: + return new SubscriptionResumedEvent(data); + case EventName.SubscriptionTrialing: + return new SubscriptionTrialingEvent(data); + case EventName.SubscriptionUpdated: + return new SubscriptionUpdatedEvent(data); + case EventName.TransactionBilled: + return new TransactionBilledEvent(data); + case EventName.TransactionCanceled: + return new TransactionCanceledEvent(data); + case EventName.TransactionCompleted: + return new TransactionCompletedEvent(data); + case EventName.TransactionCreated: + return new TransactionCreatedEvent(data); + case EventName.TransactionPaid: + return new TransactionPaidEvent(data); + case EventName.TransactionPastDue: + return new TransactionPastDueEvent(data); + case EventName.TransactionPaymentFailed: + return new TransactionPaymentFailedEvent(data); + case EventName.TransactionReady: + return new TransactionReadyEvent(data); + case EventName.TransactionUpdated: + return new TransactionUpdatedEvent(data); + case EventName.ReportCreated: + return new ReportCreatedEvent(data); + case EventName.ReportUpdated: + return new ReportUpdatedEvent(data); + default: + // @ts-expect-error event_type did not match any handled events + Logger.log(`Unknown event_type ${data.event_type}`); + return null; + } + } +} diff --git a/src/notifications/index.ts b/src/notifications/index.ts new file mode 100644 index 0000000..035d37c --- /dev/null +++ b/src/notifications/index.ts @@ -0,0 +1,2 @@ +export * from './helpers'; +export * from './events'; diff --git a/src/paddle.ts b/src/paddle.ts new file mode 100644 index 0000000..70cab01 --- /dev/null +++ b/src/paddle.ts @@ -0,0 +1,68 @@ +import { Client } from './internal/api/client'; +import { + AddressesResource, + AdjustmentsResource, + BusinessesResource, + CustomersResource, + DiscountsResource, + EventTypesResource, + NotificationSettingsResource, + NotificationsResource, + PricesResource, + PricingPreviewResource, + ProductsResource, + ReportsResource, + SubscriptionsResource, + TransactionsResource, +} from './resources'; +import { Environment, type PaddleOptions } from './internal'; +import { EventsResource } from './resources/events'; +import { Webhooks } from './notifications'; + +export class Paddle { + private readonly client: Client; + private readonly defaultPaddleOptions: Partial = { + environment: Environment.production, + }; + + public products: ProductsResource; + public prices: PricesResource; + public transactions: TransactionsResource; + public adjustments: AdjustmentsResource; + public customers: CustomersResource; + public addresses: AddressesResource; + public businesses: BusinessesResource; + public discounts: DiscountsResource; + public subscriptions: SubscriptionsResource; + public pricingPreview: PricingPreviewResource; + public events: EventsResource; + public webhooks: Webhooks; + public eventTypes: EventTypesResource; + public notificationSettings: NotificationSettingsResource; + public notifications: NotificationsResource; + public reports: ReportsResource; + + constructor(apiKey: string, options?: PaddleOptions) { + this.client = new Client( + apiKey, + options ? { ...this.defaultPaddleOptions, ...options } : { ...this.defaultPaddleOptions }, + ); + + this.products = new ProductsResource(this.client); + this.prices = new PricesResource(this.client); + this.transactions = new TransactionsResource(this.client); + this.adjustments = new AdjustmentsResource(this.client); + this.customers = new CustomersResource(this.client); + this.addresses = new AddressesResource(this.client); + this.businesses = new BusinessesResource(this.client); + this.discounts = new DiscountsResource(this.client); + this.subscriptions = new SubscriptionsResource(this.client); + this.pricingPreview = new PricingPreviewResource(this.client); + this.events = new EventsResource(this.client); + this.webhooks = new Webhooks(); + this.eventTypes = new EventTypesResource(this.client); + this.notificationSettings = new NotificationSettingsResource(this.client); + this.notifications = new NotificationsResource(this.client); + this.reports = new ReportsResource(this.client); + } +} diff --git a/src/resources/addresses/index.ts b/src/resources/addresses/index.ts new file mode 100644 index 0000000..553dbb2 --- /dev/null +++ b/src/resources/addresses/index.ts @@ -0,0 +1,87 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Address, AddressCollection } from '../../entities'; +import { type ErrorResponse, type Response } from '../../internal'; +import { BaseResource, PathParameters, QueryParameters } from '../../internal/base'; +import { + type ListAddressQueryParameters, + type CreateAddressRequestBody, + type UpdateAddressRequestBody, +} from './operations'; +import { type IAddressResponse } from '../../types'; + +const AddressPaths = { + list: '/customers/{customer_id}/addresses', + create: '/customers/{customer_id}/addresses', + get: '/customers/{customer_id}/addresses/{address_id}', + update: '/customers/{customer_id}/addresses/{address_id}', +} as const; + +export * from './operations'; + +export class AddressesResource extends BaseResource { + public list(customerId: string, queryParams?: ListAddressQueryParameters): AddressCollection { + const queryParameters = new QueryParameters(queryParams); + + const urlWithPathParams = new PathParameters(AddressPaths.list, { + customer_id: customerId, + }).deriveUrl(); + + return new AddressCollection(this.client, urlWithPathParams + queryParameters.toQueryString()); + } + + public async create(customerId: string, createAddressParameters: CreateAddressRequestBody): Promise
{ + const urlWithPathParams = new PathParameters(AddressPaths.create, { + customer_id: customerId, + }).deriveUrl(); + + const response = await this.client.post | ErrorResponse>( + urlWithPathParams, + createAddressParameters, + ); + const data = this.handleResponse(response); + + return new Address(data); + } + + public async get(customerId: string, addressId: string): Promise
{ + const urlWithPathParams = new PathParameters(AddressPaths.get, { + customer_id: customerId, + address_id: addressId, + }).deriveUrl(); + + const response = await this.client.get | ErrorResponse>(urlWithPathParams); + + const data = this.handleResponse(response); + + return new Address(data); + } + + public async update( + customerId: string, + addressId: string, + updateAddress: UpdateAddressRequestBody, + ): Promise
{ + const urlWithPathParams = new PathParameters(AddressPaths.update, { + customer_id: customerId, + address_id: addressId, + }).deriveUrl(); + + const response = await this.client.patch | ErrorResponse>( + urlWithPathParams, + updateAddress, + ); + + const data = this.handleResponse(response); + + return new Address(data); + } + + public async archive(customerId: string, addressId: string) { + return await this.update(customerId, addressId, { status: 'archived' }); + } +} diff --git a/src/resources/addresses/operations/create-address-request-body.ts b/src/resources/addresses/operations/create-address-request-body.ts new file mode 100644 index 0000000..4cce719 --- /dev/null +++ b/src/resources/addresses/operations/create-address-request-body.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData } from '../../../types'; +import { type CountryCode } from '../../../enums'; + +export interface CreateAddressRequestBody { + countryCode: CountryCode; + description?: string | null; + firstLine?: string | null; + secondLine?: string | null; + city?: string | null; + postalCode?: string | null; + region?: string | null; + customData?: ICustomData | null; +} diff --git a/src/resources/addresses/operations/index.ts b/src/resources/addresses/operations/index.ts new file mode 100644 index 0000000..0b9808d --- /dev/null +++ b/src/resources/addresses/operations/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-address-query-parameters'; +export * from './create-address-request-body'; +export * from './update-address-request-body'; diff --git a/src/resources/addresses/operations/list-address-query-parameters.ts b/src/resources/addresses/operations/list-address-query-parameters.ts new file mode 100644 index 0000000..a2c3b3b --- /dev/null +++ b/src/resources/addresses/operations/list-address-query-parameters.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type Status } from '../../../enums'; + +export interface ListAddressQueryParameters { + after?: string; + id?: string[]; + orderBy?: string; + perPage?: number; + search?: string; + status?: Status[]; +} diff --git a/src/resources/addresses/operations/update-address-request-body.ts b/src/resources/addresses/operations/update-address-request-body.ts new file mode 100644 index 0000000..5a29903 --- /dev/null +++ b/src/resources/addresses/operations/update-address-request-body.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData } from '../../../types'; +import { type CountryCode, type Status } from '../../../enums'; + +export interface UpdateAddressRequestBody { + description?: string | null; + firstLine?: string | null; + secondLine?: string | null; + city?: string | null; + postalCode?: string | null; + region?: string | null; + countryCode?: CountryCode; + customData?: ICustomData | null; + status?: Status; +} diff --git a/src/resources/adjustments/index.ts b/src/resources/adjustments/index.ts new file mode 100644 index 0000000..90fb6e6 --- /dev/null +++ b/src/resources/adjustments/index.ts @@ -0,0 +1,36 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { AdjustmentCollection, Adjustment } from '../../entities'; +import { type ErrorResponse, type Response } from '../../internal'; +import { BaseResource, QueryParameters } from '../../internal/base'; +import { type CreateAdjustmentRequestBody, type ListAdjustmentQueryParameters } from './operations'; +import { type IAdjustmentResponse } from '../../types'; + +const AdjustmentPaths = { + list: '/adjustments', + create: '/adjustments', +} as const; + +export * from './operations'; + +export class AdjustmentsResource extends BaseResource { + public list(queryParams?: ListAdjustmentQueryParameters): AdjustmentCollection { + const queryParameters = new QueryParameters(queryParams); + return new AdjustmentCollection(this.client, AdjustmentPaths.list + queryParameters.toQueryString()); + } + + public async create(createAdjustmentParameters: CreateAdjustmentRequestBody): Promise { + const response = await this.client.post | ErrorResponse>( + AdjustmentPaths.create, + createAdjustmentParameters, + ); + + const data = this.handleResponse(response); + + return new Adjustment(data); + } +} diff --git a/src/resources/adjustments/operations/create-adjustment-request-body.ts b/src/resources/adjustments/operations/create-adjustment-request-body.ts new file mode 100644 index 0000000..4d3fa41 --- /dev/null +++ b/src/resources/adjustments/operations/create-adjustment-request-body.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type AdjustmentAction, type AdjustmentType } from '../../../enums'; + +export interface CreateAdjustmentLineItem { + amount: string | null; + itemId: string; + type: AdjustmentType; +} + +export interface CreateAdjustmentRequestBody { + action: AdjustmentAction; + items: CreateAdjustmentLineItem[]; + reason: string; + transactionId: string; +} diff --git a/src/resources/adjustments/operations/index.ts b/src/resources/adjustments/operations/index.ts new file mode 100644 index 0000000..1c4848f --- /dev/null +++ b/src/resources/adjustments/operations/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-adjustment-query-parameters'; +export * from './create-adjustment-request-body'; diff --git a/src/resources/adjustments/operations/list-adjustment-query-parameters.ts b/src/resources/adjustments/operations/list-adjustment-query-parameters.ts new file mode 100644 index 0000000..59e7e72 --- /dev/null +++ b/src/resources/adjustments/operations/list-adjustment-query-parameters.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type AdjustmentAction, type AdjustmentStatus } from '../../../enums'; + +export interface ListAdjustmentQueryParameters { + action?: AdjustmentAction; + after?: string; + customerId?: string[]; + orderBy?: string; + perPage?: number; + status?: AdjustmentStatus[]; + subscriptionId?: string[]; + transactionId?: string[]; + id?: string[]; +} diff --git a/src/resources/businesses/index.ts b/src/resources/businesses/index.ts new file mode 100644 index 0000000..719ec5b --- /dev/null +++ b/src/resources/businesses/index.ts @@ -0,0 +1,86 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Business, BusinessCollection } from '../../entities'; +import { type ErrorResponse, type Response } from '../../internal'; +import { BaseResource, PathParameters, QueryParameters } from '../../internal/base'; +import { + type CreateBusinessRequestBody, + type ListBusinessQueryParameters, + type UpdateBusinessRequestBody, +} from './operations'; +import { type IBusinessResponse } from '../../types'; + +const BusinessPaths = { + list: '/customers/{customer_id}/businesses', + create: '/customers/{customer_id}/businesses', + get: '/customers/{customer_id}/businesses/{business_id}', + update: '/customers/{customer_id}/businesses/{business_id}', +} as const; + +export * from './operations'; + +export class BusinessesResource extends BaseResource { + public list(customerId: string, queryParams?: ListBusinessQueryParameters): BusinessCollection { + const queryParameters = new QueryParameters(queryParams); + const urlWithPathParams = new PathParameters(BusinessPaths.list, { + customer_id: customerId, + }).deriveUrl(); + + return new BusinessCollection(this.client, urlWithPathParams + queryParameters.toQueryString()); + } + + public async create(customerId: string, createBusinessParameters: CreateBusinessRequestBody): Promise { + const urlWithPathParams = new PathParameters(BusinessPaths.create, { + customer_id: customerId, + }).deriveUrl(); + const response = await this.client.post | ErrorResponse>( + urlWithPathParams, + createBusinessParameters, + ); + + const data = this.handleResponse(response); + + return new Business(data); + } + + public async get(customerId: string, businessId: string): Promise { + const urlWithPathParams = new PathParameters(BusinessPaths.get, { + customer_id: customerId, + business_id: businessId, + }).deriveUrl(); + + const response = await this.client.get | ErrorResponse>(urlWithPathParams); + + const data = this.handleResponse(response); + + return new Business(data); + } + + public async update( + customerId: string, + businessId: string, + updateBusiness: UpdateBusinessRequestBody, + ): Promise { + const urlWithPathParams = new PathParameters(BusinessPaths.update, { + customer_id: customerId, + business_id: businessId, + }).deriveUrl(); + + const response = await this.client.patch | ErrorResponse>( + urlWithPathParams, + updateBusiness, + ); + + const data = this.handleResponse(response); + + return new Business(data); + } + + public async archive(customerId: string, addressId: string) { + return await this.update(customerId, addressId, { status: 'archived' }); + } +} diff --git a/src/resources/businesses/operations/create-business-request-body.ts b/src/resources/businesses/operations/create-business-request-body.ts new file mode 100644 index 0000000..53b0720 --- /dev/null +++ b/src/resources/businesses/operations/create-business-request-body.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IBusinessContacts, type ICustomData } from '../../../types'; + +export interface CreateBusinessRequestBody { + name: string; + companyNumber?: string | null; + taxIdentifier?: string | null; + contacts?: IBusinessContacts[] | null; + customData?: ICustomData | null; +} diff --git a/src/resources/businesses/operations/index.ts b/src/resources/businesses/operations/index.ts new file mode 100644 index 0000000..f9b425b --- /dev/null +++ b/src/resources/businesses/operations/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-business-query-parameters'; +export * from './create-business-request-body'; +export * from './update-business-request-body'; diff --git a/src/resources/businesses/operations/list-business-query-parameters.ts b/src/resources/businesses/operations/list-business-query-parameters.ts new file mode 100644 index 0000000..a1219c5 --- /dev/null +++ b/src/resources/businesses/operations/list-business-query-parameters.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type Status } from '../../../enums'; + +export interface ListBusinessQueryParameters { + after?: string; + id?: string[]; + orderBy?: string; + perPage?: number; + search?: string; + status?: Status[]; +} diff --git a/src/resources/businesses/operations/update-business-request-body.ts b/src/resources/businesses/operations/update-business-request-body.ts new file mode 100644 index 0000000..5ccaff9 --- /dev/null +++ b/src/resources/businesses/operations/update-business-request-body.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IBusinessContacts, type ICustomData } from '../../../types'; +import { type Status } from '../../../enums'; + +export interface UpdateBusinessRequestBody { + name?: string; + companyNumber?: string | null; + taxIdentifier?: string | null; + status?: Status; + contacts?: IBusinessContacts[] | null; + customData?: ICustomData | null; +} diff --git a/src/resources/customers/index.ts b/src/resources/customers/index.ts new file mode 100644 index 0000000..c67322c --- /dev/null +++ b/src/resources/customers/index.ts @@ -0,0 +1,94 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { CreditBalance, Customer, CustomerCollection } from '../../entities'; +import { type ErrorResponse, type Response } from '../../internal'; +import { BaseResource, PathParameters, QueryParameters } from '../../internal/base'; +import { + type CreateCustomerRequestBody, + type GetCreditBalanceQueryParameters, + type ListCustomerQueryParameters, + type UpdateCustomerRequestBody, +} from './operations'; +import { type ICreditBalanceResponse, type ICustomerResponse } from '../../types'; + +const CustomerPaths = { + list: '/customers', + create: '/customers', + get: '/customers/{customer_id}', + update: '/customers/{customer_id}', + getCustomerBalance: '/customers/{customer_id}/credit-balances', +} as const; + +export * from './operations'; + +export class CustomersResource extends BaseResource { + public list(queryParams?: ListCustomerQueryParameters): CustomerCollection { + const queryParameters = new QueryParameters(queryParams); + return new CustomerCollection(this.client, CustomerPaths.list + queryParameters.toQueryString()); + } + + public async create(createCustomerParameters: CreateCustomerRequestBody): Promise { + const response = await this.client.post | ErrorResponse>( + CustomerPaths.create, + createCustomerParameters, + ); + + const data = this.handleResponse(response); + + return new Customer(data); + } + + public async get(customerId: string): Promise { + const urlWithPathParams = new PathParameters(CustomerPaths.get, { + customer_id: customerId, + }).deriveUrl(); + + const response = await this.client.get | ErrorResponse>(urlWithPathParams); + + const data = this.handleResponse(response); + + return new Customer(data); + } + + public async update(customerId: string, updateCustomer: UpdateCustomerRequestBody): Promise { + const urlWithPathParams = new PathParameters(CustomerPaths.update, { + customer_id: customerId, + }).deriveUrl(); + + const response = await this.client.patch | ErrorResponse>( + urlWithPathParams, + updateCustomer, + ); + + const data = this.handleResponse(response); + + return new Customer(data); + } + + public async getCreditBalance( + customerId: string, + queryParams?: GetCreditBalanceQueryParameters, + ): Promise { + const urlWithPathParams = new PathParameters(CustomerPaths.getCustomerBalance, { + customer_id: customerId, + }).deriveUrl(); + const queryParameters = new QueryParameters(queryParams); + + const response = await this.client.get< + GetCreditBalanceQueryParameters | undefined, + Response | ErrorResponse + >(urlWithPathParams, queryParameters); + + const data = this.handleResponse(response); + + return data.map((balance) => new CreditBalance(balance)); + } + + public async archive(customerId: string) { + return await this.update(customerId, { status: 'archived' }); + } +} diff --git a/src/resources/customers/operations/create-customer-request-body.ts b/src/resources/customers/operations/create-customer-request-body.ts new file mode 100644 index 0000000..f53bc6b --- /dev/null +++ b/src/resources/customers/operations/create-customer-request-body.ts @@ -0,0 +1,14 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData } from '../../../types'; + +export interface CreateCustomerRequestBody { + email: string; + name?: string | null; + customData?: ICustomData | null; + locale?: string; +} diff --git a/src/resources/customers/operations/get-credit-balance-query-parameters.ts b/src/resources/customers/operations/get-credit-balance-query-parameters.ts new file mode 100644 index 0000000..e902289 --- /dev/null +++ b/src/resources/customers/operations/get-credit-balance-query-parameters.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type CurrencyCode } from '../../../enums'; + +export interface GetCreditBalanceQueryParameters { + currencyCode?: CurrencyCode[]; +} diff --git a/src/resources/customers/operations/index.ts b/src/resources/customers/operations/index.ts new file mode 100644 index 0000000..469260b --- /dev/null +++ b/src/resources/customers/operations/index.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-customer-query-parameters'; +export * from './create-customer-request-body'; +export * from './update-customer-request-body'; +export * from './get-credit-balance-query-parameters'; diff --git a/src/resources/customers/operations/list-customer-query-parameters.ts b/src/resources/customers/operations/list-customer-query-parameters.ts new file mode 100644 index 0000000..98a71eb --- /dev/null +++ b/src/resources/customers/operations/list-customer-query-parameters.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type Status } from '../../../enums'; + +export interface ListCustomerQueryParameters { + after?: string; + id?: string[]; + orderBy?: string; + perPage?: number; + search?: string; + status?: Status[]; +} diff --git a/src/resources/customers/operations/update-customer-request-body.ts b/src/resources/customers/operations/update-customer-request-body.ts new file mode 100644 index 0000000..f04393e --- /dev/null +++ b/src/resources/customers/operations/update-customer-request-body.ts @@ -0,0 +1,16 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData } from '../../../types'; +import { type Status } from '../../../enums'; + +export interface UpdateCustomerRequestBody { + name?: string | null; + email?: string; + status?: Status; + customData?: ICustomData | null; + locale?: string; +} diff --git a/src/resources/discounts/index.ts b/src/resources/discounts/index.ts new file mode 100644 index 0000000..e15ab7e --- /dev/null +++ b/src/resources/discounts/index.ts @@ -0,0 +1,73 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Discount, DiscountCollection } from '../../entities'; +import { type ErrorResponse, type Response } from '../../internal'; +import { BaseResource, PathParameters, QueryParameters } from '../../internal/base'; +import { + type CreateDiscountRequestBody, + type ListDiscountQueryParameters, + type UpdateDiscountRequestBody, +} from './operations'; +import { type IDiscountResponse } from '../../types'; + +const DiscountPaths = { + list: '/discounts', + create: '/discounts', + get: '/discounts/{discount_id}', + update: '/discounts/{discount_id}', +} as const; + +export * from './operations'; + +export class DiscountsResource extends BaseResource { + public list(queryParams?: ListDiscountQueryParameters): DiscountCollection { + const queryParameters = new QueryParameters(queryParams); + return new DiscountCollection(this.client, DiscountPaths.list + queryParameters.toQueryString()); + } + + public async create(createDiscountParameters: CreateDiscountRequestBody): Promise { + const response = await this.client.post | ErrorResponse>( + DiscountPaths.create, + createDiscountParameters, + ); + + const data = this.handleResponse(response); + + return new Discount(data); + } + + public async get(discountId: string): Promise { + const urlWithPathParams = new PathParameters(DiscountPaths.get, { + discount_id: discountId, + }).deriveUrl(); + + const response = await this.client.get | ErrorResponse>(urlWithPathParams); + + const data = this.handleResponse(response); + + return new Discount(data); + } + + public async update(discountId: string, updateDiscount: UpdateDiscountRequestBody): Promise { + const urlWithPathParams = new PathParameters(DiscountPaths.update, { + discount_id: discountId, + }).deriveUrl(); + + const response = await this.client.patch | ErrorResponse>( + urlWithPathParams, + updateDiscount, + ); + + const data = this.handleResponse(response); + + return new Discount(data); + } + + public async archive(discountId: string) { + return await this.update(discountId, { status: 'archived' }); + } +} diff --git a/src/resources/discounts/operations/create-discount-request-body.ts b/src/resources/discounts/operations/create-discount-request-body.ts new file mode 100644 index 0000000..74901e9 --- /dev/null +++ b/src/resources/discounts/operations/create-discount-request-body.ts @@ -0,0 +1,23 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode, type DiscountType } from '../../../enums'; +import { type ICustomData } from '../../../types'; + +export interface CreateDiscountRequestBody { + amount: string; + description: string; + type: DiscountType; + enabledForCheckout?: boolean; + code?: string | null; + currencyCode?: CurrencyCode | null; + recur?: boolean; + maximumRecurringIntervals?: number | null; + usageLimit?: number | null; + restrictTo?: string[] | null; + expiresAt?: string | null; + customData?: ICustomData | null; +} diff --git a/src/resources/discounts/operations/index.ts b/src/resources/discounts/operations/index.ts new file mode 100644 index 0000000..2433506 --- /dev/null +++ b/src/resources/discounts/operations/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-discount-query-parameters'; +export * from './create-discount-request-body'; +export * from './update-discount-request-body'; diff --git a/src/resources/discounts/operations/list-discount-query-parameters.ts b/src/resources/discounts/operations/list-discount-query-parameters.ts new file mode 100644 index 0000000..9b483be --- /dev/null +++ b/src/resources/discounts/operations/list-discount-query-parameters.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type DiscountStatus } from '../../../enums'; + +export interface ListDiscountQueryParameters { + after?: string; + code?: string[]; + id?: string[]; + orderBy?: string; + perPage?: number; + status?: DiscountStatus[]; +} diff --git a/src/resources/discounts/operations/update-discount-request-body.ts b/src/resources/discounts/operations/update-discount-request-body.ts new file mode 100644 index 0000000..f68291d --- /dev/null +++ b/src/resources/discounts/operations/update-discount-request-body.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode, type DiscountType, type Status } from '../../../enums'; +import { type ICustomData } from '../../../types'; + +export interface UpdateDiscountRequestBody { + status?: Status; + description?: string; + enabledForCheckout?: boolean; + code?: string | null; + type?: DiscountType; + amount?: string; + currencyCode?: CurrencyCode | null; + recur?: boolean; + maximumRecurringIntervals?: number | null; + usageLimit?: number | null; + restrictTo?: string[] | null; + expiresAt?: string | null; + customData?: ICustomData | null; +} diff --git a/src/resources/event-types/index.ts b/src/resources/event-types/index.ts new file mode 100644 index 0000000..33145cf --- /dev/null +++ b/src/resources/event-types/index.ts @@ -0,0 +1,26 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { BaseResource } from '../../internal/base'; +import { type ErrorResponse, type Response } from '../../internal'; +import { type IEventTypeResponse } from '../../types'; +import { EventType } from '../../entities'; + +const EventTypesPaths = { + list: '/event-types', +} as const; + +export class EventTypesResource extends BaseResource { + public async list(): Promise { + const response = await this.client.get | ErrorResponse>( + EventTypesPaths.list, + ); + + const data = this.handleResponse(response); + + return data.map((eventType) => new EventType(eventType)); + } +} diff --git a/src/resources/events/index.ts b/src/resources/events/index.ts new file mode 100644 index 0000000..3211526 --- /dev/null +++ b/src/resources/events/index.ts @@ -0,0 +1,22 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { BaseResource, QueryParameters } from '../../internal/base'; +import { type ListEventsQueryParameters } from './operations'; +import { EventCollection } from '../../entities'; + +const EventPaths = { + list: '/events', +} as const; + +export * from './operations'; + +export class EventsResource extends BaseResource { + public list(queryParams?: ListEventsQueryParameters): EventCollection { + const queryParameters = new QueryParameters(queryParams); + return new EventCollection(this.client, EventPaths.list + queryParameters.toQueryString()); + } +} diff --git a/src/resources/events/operations/index.ts b/src/resources/events/operations/index.ts new file mode 100644 index 0000000..3557e1f --- /dev/null +++ b/src/resources/events/operations/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-events-query-parameters'; diff --git a/src/resources/events/operations/list-events-query-parameters.ts b/src/resources/events/operations/list-events-query-parameters.ts new file mode 100644 index 0000000..9d7a3e8 --- /dev/null +++ b/src/resources/events/operations/list-events-query-parameters.ts @@ -0,0 +1,11 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ListEventsQueryParameters { + after?: string; + orderBy?: string; + perPage?: number; +} diff --git a/src/resources/index.ts b/src/resources/index.ts new file mode 100644 index 0000000..a85060e --- /dev/null +++ b/src/resources/index.ts @@ -0,0 +1,14 @@ +export * from './addresses'; +export * from './adjustments'; +export * from './businesses'; +export * from './customers'; +export * from './discounts'; +export * from './prices'; +export * from './products'; +export * from './subscriptions'; +export * from './transactions'; +export * from './pricing-preview'; +export * from './event-types'; +export * from './notification-settings'; +export * from './notifications'; +export * from './reports'; diff --git a/src/resources/notification-settings/index.ts b/src/resources/notification-settings/index.ts new file mode 100644 index 0000000..86f10b4 --- /dev/null +++ b/src/resources/notification-settings/index.ts @@ -0,0 +1,90 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { BaseResource, PathParameters } from '../../internal/base'; +import { type ErrorResponse, type Response } from '../../internal'; +import { NotificationSettings } from '../../entities'; +import { type INotificationSettingsResponse } from '../../types'; +import { type CreateNotificationSettingsRequestBody, type UpdateNotificationSettingsRequestBody } from './operations'; + +const NotificationSettingsPaths = { + list: '/notification-settings', + create: '/notification-settings', + get: '/notification-settings/{notification_setting_id}', + update: '/notification-settings/{notification_setting_id}', + delete: '/notification-settings/{notification_setting_id}', +} as const; + +export * from './operations'; + +export class NotificationSettingsResource extends BaseResource { + public async list(): Promise { + const response = await this.client.get | ErrorResponse>( + NotificationSettingsPaths.list, + ); + + const data = this.handleResponse(response); + + return data.map((notificationSetting) => new NotificationSettings(notificationSetting)); + } + + public async create( + createNotificationSettings: CreateNotificationSettingsRequestBody, + ): Promise { + const response = await this.client.post< + CreateNotificationSettingsRequestBody, + Response | ErrorResponse + >(NotificationSettingsPaths.create, createNotificationSettings); + + const data = this.handleResponse(response); + + return new NotificationSettings(data); + } + + public async get(notificationId: string): Promise { + const urlWithPathParams = new PathParameters(NotificationSettingsPaths.get, { + notification_setting_id: notificationId, + }).deriveUrl(); + + const response = await this.client.get | ErrorResponse>( + urlWithPathParams, + ); + + const data = this.handleResponse(response); + + return new NotificationSettings(data); + } + + public async update( + notificationId: string, + updateNotificationSettings: UpdateNotificationSettingsRequestBody, + ): Promise { + const urlWithPathParams = new PathParameters(NotificationSettingsPaths.update, { + notification_setting_id: notificationId, + }).deriveUrl(); + + const response = await this.client.patch< + UpdateNotificationSettingsRequestBody, + Response | ErrorResponse + >(urlWithPathParams, updateNotificationSettings); + + const data = this.handleResponse(response); + + return new NotificationSettings(data); + } + + public async delete(notificationId: string): Promise { + const urlWithPathParams = new PathParameters(NotificationSettingsPaths.update, { + notification_setting_id: notificationId, + }).deriveUrl(); + + const response = await this.client.delete(urlWithPathParams); + + if (response) { + this.handleResponse(response); + } + } +} diff --git a/src/resources/notification-settings/operations/create-notification-settings-request-body.ts b/src/resources/notification-settings/operations/create-notification-settings-request-body.ts new file mode 100644 index 0000000..a270e78 --- /dev/null +++ b/src/resources/notification-settings/operations/create-notification-settings-request-body.ts @@ -0,0 +1,16 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type NotificationSettingsType } from '../../../enums'; +import { type IEventName } from '../../../notifications'; + +export interface CreateNotificationSettingsRequestBody { + description: string; + destination: string; + subscribedEvents: IEventName[]; + type: NotificationSettingsType; + apiVersion?: number | null; + includeSensitiveFields?: boolean | null; +} diff --git a/src/resources/notification-settings/operations/index.ts b/src/resources/notification-settings/operations/index.ts new file mode 100644 index 0000000..c82cdea --- /dev/null +++ b/src/resources/notification-settings/operations/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './create-notification-settings-request-body'; +export * from './update-notification-settings-request-body'; diff --git a/src/resources/notification-settings/operations/update-notification-settings-request-body.ts b/src/resources/notification-settings/operations/update-notification-settings-request-body.ts new file mode 100644 index 0000000..55a753c --- /dev/null +++ b/src/resources/notification-settings/operations/update-notification-settings-request-body.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type IEventName } from '../../../notifications'; + +export interface UpdateNotificationSettingsRequestBody { + description?: string; + destination?: string; + active?: boolean; + apiVersion?: number; + includeSensitiveFields?: boolean; + subscribedEvents?: IEventName[]; +} diff --git a/src/resources/notifications/index.ts b/src/resources/notifications/index.ts new file mode 100644 index 0000000..904806a --- /dev/null +++ b/src/resources/notifications/index.ts @@ -0,0 +1,65 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { BaseResource, PathParameters, QueryParameters } from '../../internal/base'; +import { Notification, NotificationCollection, NotificationLogCollection, ReplayNotification } from '../../entities'; +import { type ListNotificationLogQueryParameters, type ListNotificationQueryParameters } from './operations'; +import { type ErrorResponse, type Response } from '../../internal'; +import { type INotificationResponse, type IReplayNotificationResponse } from '../../types'; + +const NotificationPaths = { + list: '/notifications', + get: '/notifications/{notification_id}', + getLogs: '/notifications/{notification_id}/logs', + replay: '/notifications/{notification_id}/replay', +} as const; + +export * from './operations'; + +export class NotificationsResource extends BaseResource { + public list(queryParams?: ListNotificationQueryParameters): NotificationCollection { + const queryParameters = new QueryParameters(queryParams); + return new NotificationCollection(this.client, NotificationPaths.list + queryParameters.toQueryString()); + } + + public async get(notificationId: string): Promise { + const urlWithPathParams = new PathParameters(NotificationPaths.get, { + notification_id: notificationId, + }).deriveUrl(); + + const response = await this.client.get | ErrorResponse>( + urlWithPathParams, + ); + + const data = this.handleResponse(response); + + return new Notification(data); + } + + public async replay(notificationId: string): Promise { + const urlWithPathParams = new PathParameters(NotificationPaths.replay, { + notification_id: notificationId, + }).deriveUrl(); + + const response = await this.client.post | ErrorResponse>( + urlWithPathParams, + undefined, + ); + + const data = this.handleResponse(response); + + return new ReplayNotification(data); + } + + public getLogs(notificationId: string, queryParams?: ListNotificationLogQueryParameters): NotificationLogCollection { + const queryParameters = new QueryParameters(queryParams); + const urlWithPathParams = new PathParameters(NotificationPaths.getLogs, { + notification_id: notificationId, + }).deriveUrl(); + + return new NotificationLogCollection(this.client, urlWithPathParams + queryParameters.toQueryString()); + } +} diff --git a/src/resources/notifications/operations/index.ts b/src/resources/notifications/operations/index.ts new file mode 100644 index 0000000..b546d87 --- /dev/null +++ b/src/resources/notifications/operations/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-notification-query-parameters'; +export * from './list-notification-log-query-parameters'; diff --git a/src/resources/notifications/operations/list-notification-log-query-parameters.ts b/src/resources/notifications/operations/list-notification-log-query-parameters.ts new file mode 100644 index 0000000..063b4ef --- /dev/null +++ b/src/resources/notifications/operations/list-notification-log-query-parameters.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ListNotificationLogQueryParameters { + after: string; + perPage: number; +} diff --git a/src/resources/notifications/operations/list-notification-query-parameters.ts b/src/resources/notifications/operations/list-notification-query-parameters.ts new file mode 100644 index 0000000..236c5db --- /dev/null +++ b/src/resources/notifications/operations/list-notification-query-parameters.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type NotificationStatus } from '../../../enums'; + +export interface ListNotificationQueryParameters { + after?: string; + notificationSettingId?: string[]; + orderBy?: string; + perPage?: number; + search?: string; + status?: NotificationStatus[]; + filter?: string; + to?: string; + from?: string; +} diff --git a/src/resources/prices/index.ts b/src/resources/prices/index.ts new file mode 100644 index 0000000..7fabc44 --- /dev/null +++ b/src/resources/prices/index.ts @@ -0,0 +1,79 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Price, PriceCollection, PriceWithIncludes } from '../../entities'; +import { type ErrorResponse, type Response } from '../../internal'; +import { BaseResource, PathParameters, QueryParameters } from '../../internal/base'; +import { + type CreatePriceRequestBody, + type GetPriceQueryParameters, + type ListPriceQueryParameters, + type UpdatePriceRequestBody, +} from './operations'; +import { type IPriceResponse } from '../../types'; + +const PricePaths = { + list: '/prices', + create: '/prices', + get: '/prices/{price_id}', + update: '/prices/{price_id}', +} as const; + +export * from './operations'; + +export class PricesResource extends BaseResource { + public list(queryParams?: ListPriceQueryParameters): PriceCollection { + const queryParameters = new QueryParameters(queryParams); + return new PriceCollection(this.client, PricePaths.list + queryParameters.toQueryString()); + } + + public async create(createPriceParameters: CreatePriceRequestBody): Promise { + const response = await this.client.post | ErrorResponse>( + PricePaths.create, + createPriceParameters, + ); + + const data = this.handleResponse(response); + + return new Price(data); + } + + public async get(priceId: string, queryParams?: GetPriceQueryParameters): Promise { + const queryParameters = new QueryParameters(queryParams); + + const urlWithPathParams = new PathParameters(PricePaths.get, { + price_id: priceId, + }).deriveUrl(); + + const response = await this.client.get< + GetPriceQueryParameters | undefined, + Response | ErrorResponse + >(urlWithPathParams, queryParameters); + + const data = this.handleResponse(response); + + return new PriceWithIncludes(data); + } + + public async update(priceId: string, updatePrice: UpdatePriceRequestBody): Promise { + const urlWithPathParams = new PathParameters(PricePaths.update, { + price_id: priceId, + }).deriveUrl(); + + const response = await this.client.patch | ErrorResponse>( + urlWithPathParams, + updatePrice, + ); + + const data = this.handleResponse(response); + + return new Price(data); + } + + public async archive(priceId: string) { + return await this.update(priceId, { status: 'archived' }); + } +} diff --git a/src/resources/prices/operations/create-price-request-body.ts b/src/resources/prices/operations/create-price-request-body.ts new file mode 100644 index 0000000..ed748f5 --- /dev/null +++ b/src/resources/prices/operations/create-price-request-body.ts @@ -0,0 +1,28 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type ICustomData, + type IMoney, + type IPriceQuantity, + type ITimePeriod, + type IUnitPriceOverride, +} from '../../../types'; +import { type CatalogType, type TaxMode } from '../../../enums'; + +export interface CreatePriceRequestBody { + name?: string | null; + description: string; + type?: CatalogType | null; + productId: string; + unitPrice: IMoney; + billingCycle?: ITimePeriod | null; + trialPeriod?: ITimePeriod | null; + taxMode?: TaxMode; + unitPriceOverrides?: IUnitPriceOverride[]; + quantity?: IPriceQuantity; + customData?: ICustomData | null; +} diff --git a/src/resources/prices/operations/get-price-query-parameters.ts b/src/resources/prices/operations/get-price-query-parameters.ts new file mode 100644 index 0000000..0474387 --- /dev/null +++ b/src/resources/prices/operations/get-price-query-parameters.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface GetPriceQueryParameters { + include?: string[]; +} diff --git a/src/resources/prices/operations/index.ts b/src/resources/prices/operations/index.ts new file mode 100644 index 0000000..ab783bb --- /dev/null +++ b/src/resources/prices/operations/index.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-price-query-parameters'; +export * from './create-price-request-body'; +export * from './get-price-query-parameters'; +export * from './update-price-request-body'; diff --git a/src/resources/prices/operations/list-price-query-parameters.ts b/src/resources/prices/operations/list-price-query-parameters.ts new file mode 100644 index 0000000..0218278 --- /dev/null +++ b/src/resources/prices/operations/list-price-query-parameters.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type CatalogType, type Status } from '../../../enums'; + +export interface ListPriceQueryParameters { + after?: string; + id?: string[]; + type?: CatalogType[]; + include?: string[]; + orderBy?: string; + perPage?: number; + productId?: string[]; + status?: Status[]; + recurring?: boolean; +} diff --git a/src/resources/prices/operations/update-price-request-body.ts b/src/resources/prices/operations/update-price-request-body.ts new file mode 100644 index 0000000..33c6ce0 --- /dev/null +++ b/src/resources/prices/operations/update-price-request-body.ts @@ -0,0 +1,28 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type ICustomData, + type IMoney, + type IPriceQuantity, + type ITimePeriod, + type IUnitPriceOverride, +} from '../../../types'; +import { type CatalogType, type Status, type TaxMode } from '../../../enums'; + +export interface UpdatePriceRequestBody { + description?: string; + name?: string | null; + type?: CatalogType | null; + billingCycle?: ITimePeriod | null; + trialPeriod?: ITimePeriod | null; + taxMode?: TaxMode; + unitPrice?: IMoney; + unitPriceOverrides?: IUnitPriceOverride[]; + quantity?: IPriceQuantity; + status?: Status; + customData?: ICustomData | null; +} diff --git a/src/resources/pricing-preview/index.ts b/src/resources/pricing-preview/index.ts new file mode 100644 index 0000000..b85d70c --- /dev/null +++ b/src/resources/pricing-preview/index.ts @@ -0,0 +1,30 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { BaseResource } from '../../internal/base'; +import { type ErrorResponse, type Response } from '../../internal'; +import { type IPricingPreviewResponse } from '../../types'; +import { type PricingPreviewRequestBody } from './operations'; +import { PricingPreview } from '../../entities/pricing-preview'; + +const PricingPreviewPaths = { + preview: '/pricing-preview', +} as const; + +export * from './operations'; + +export class PricingPreviewResource extends BaseResource { + public async preview(pricePreviewParameter: PricingPreviewRequestBody): Promise { + const response = await this.client.post< + PricingPreviewRequestBody, + Response | ErrorResponse + >(PricingPreviewPaths.preview, pricePreviewParameter); + + const data = this.handleResponse(response); + + return new PricingPreview(data); + } +} diff --git a/src/resources/pricing-preview/operations/index.ts b/src/resources/pricing-preview/operations/index.ts new file mode 100644 index 0000000..1eff43a --- /dev/null +++ b/src/resources/pricing-preview/operations/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './pricing-preview-request-body'; diff --git a/src/resources/pricing-preview/operations/pricing-preview-request-body.ts b/src/resources/pricing-preview/operations/pricing-preview-request-body.ts new file mode 100644 index 0000000..63c2169 --- /dev/null +++ b/src/resources/pricing-preview/operations/pricing-preview-request-body.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode } from '../../../enums'; +import { type IAddressPreview } from '../../transactions'; + +interface IPricePreviewItem { + priceId: string; + quantity: number; +} + +export interface PricingPreviewRequestBody { + items: IPricePreviewItem[]; + customerId?: string | null; + addressId?: string | null; + businessId?: string | null; + currencyCode?: CurrencyCode; + discountId?: string | null; + address?: IAddressPreview | null; + customerIpAddress?: string | null; +} diff --git a/src/resources/products/index.ts b/src/resources/products/index.ts new file mode 100644 index 0000000..c8f7592 --- /dev/null +++ b/src/resources/products/index.ts @@ -0,0 +1,79 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Product, ProductCollection, ProductWithIncludes } from '../../entities'; +import { type ErrorResponse, type Response } from '../../internal'; +import { BaseResource, PathParameters, QueryParameters } from '../../internal/base'; +import { + type CreateProductRequestBody, + type GetProductQueryParameters, + type ListProductQueryParameters, + type UpdateProductRequestBody, +} from './operations'; +import { type IProductResponse } from '../../types'; + +const ProductPaths = { + list: '/products', + create: '/products', + get: '/products/{product_id}', + update: '/products/{product_id}', +} as const; + +export * from './operations'; + +export class ProductsResource extends BaseResource { + public list(queryParams?: ListProductQueryParameters): ProductCollection { + const queryParameters = new QueryParameters(queryParams); + return new ProductCollection(this.client, ProductPaths.list + queryParameters.toQueryString()); + } + + public async create(createProductParameters: CreateProductRequestBody): Promise { + const response = await this.client.post | ErrorResponse>( + ProductPaths.create, + createProductParameters, + ); + + const data = this.handleResponse(response); + + return new Product(data); + } + + public async get(productId: string, queryParams?: GetProductQueryParameters): Promise { + const queryParameters = new QueryParameters(queryParams); + + const urlWithPathParams = new PathParameters(ProductPaths.get, { + product_id: productId, + }).deriveUrl(); + + const response = await this.client.get< + GetProductQueryParameters | undefined, + Response | ErrorResponse + >(urlWithPathParams, queryParameters); + + const data = this.handleResponse(response); + + return new ProductWithIncludes(data); + } + + public async update(productId: string, updateProduct: UpdateProductRequestBody): Promise { + const urlWithPathParams = new PathParameters(ProductPaths.update, { + product_id: productId, + }).deriveUrl(); + + const response = await this.client.patch | ErrorResponse>( + urlWithPathParams, + updateProduct, + ); + + const data = this.handleResponse(response); + + return new Product(data); + } + + public async archive(productId: string) { + return await this.update(productId, { status: 'archived' }); + } +} diff --git a/src/resources/products/operations/create-product-request-body.ts b/src/resources/products/operations/create-product-request-body.ts new file mode 100644 index 0000000..b82c039 --- /dev/null +++ b/src/resources/products/operations/create-product-request-body.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData } from '../../../types'; +import { type CatalogType, type TaxCategory } from '../../../enums'; + +export interface CreateProductRequestBody { + name: string; + taxCategory: TaxCategory; + type?: CatalogType | null; + description?: string | null; + imageUrl?: string | null; + customData?: ICustomData | null; +} diff --git a/src/resources/products/operations/get-product-query-parameters.ts b/src/resources/products/operations/get-product-query-parameters.ts new file mode 100644 index 0000000..2d700f7 --- /dev/null +++ b/src/resources/products/operations/get-product-query-parameters.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface GetProductQueryParameters { + include?: string[]; +} diff --git a/src/resources/products/operations/index.ts b/src/resources/products/operations/index.ts new file mode 100644 index 0000000..76dac48 --- /dev/null +++ b/src/resources/products/operations/index.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-product-query-parameters'; +export * from './create-product-request-body'; +export * from './get-product-query-parameters'; +export * from './update-product-request-body'; diff --git a/src/resources/products/operations/list-product-query-parameters.ts b/src/resources/products/operations/list-product-query-parameters.ts new file mode 100644 index 0000000..173f383 --- /dev/null +++ b/src/resources/products/operations/list-product-query-parameters.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type CatalogType, type Status, type TaxCategory } from '../../../enums'; + +export interface ListProductQueryParameters { + after?: string; + type?: CatalogType[]; + id?: string[]; + include?: string[]; + orderBy?: string; + perPage?: number; + status?: Status[]; + taxCategory?: TaxCategory[]; +} diff --git a/src/resources/products/operations/update-product-request-body.ts b/src/resources/products/operations/update-product-request-body.ts new file mode 100644 index 0000000..8c97d63 --- /dev/null +++ b/src/resources/products/operations/update-product-request-body.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData } from '../../../types'; +import { type TaxCategory, type Status, type CatalogType } from '../../../enums'; + +export interface UpdateProductRequestBody { + name?: string; + description?: string | null; + type?: CatalogType | null; + taxCategory?: TaxCategory; + imageUrl?: string | null; + customData?: ICustomData | null; + status?: Status; +} diff --git a/src/resources/reports/index.ts b/src/resources/reports/index.ts new file mode 100644 index 0000000..c691f01 --- /dev/null +++ b/src/resources/reports/index.ts @@ -0,0 +1,62 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { Report, ReportCollection, ReportCsv } from '../../entities'; +import { type IReportResponse, type IReportCsvResponse } from '../../types'; +import { type ErrorResponse, type Response } from '../../internal'; +import { BaseResource, PathParameters, QueryParameters } from '../../internal/base'; +import { type CreateReportRequestBody, type ListReportQueryParameters } from './operations'; + +const ReportPaths = { + list: '/reports', + create: '/reports', + get: '/reports/{report_id}', + getReportCsv: '/reports/{report_id}/download-url', +} as const; + +export * from './operations'; + +export class ReportsResource extends BaseResource { + public list(queryParams?: ListReportQueryParameters): ReportCollection { + const queryParameters = new QueryParameters(queryParams); + return new ReportCollection(this.client, ReportPaths.list + queryParameters.toQueryString()); + } + + public async create(createReportParameters: CreateReportRequestBody): Promise { + const response = await this.client.post | ErrorResponse>( + ReportPaths.create, + createReportParameters, + ); + + const data = this.handleResponse(response); + + return new Report(data); + } + + public async get(reportId: string): Promise { + const urlWithPathParams = new PathParameters(ReportPaths.get, { + report_id: reportId, + }).deriveUrl(); + + const response = await this.client.get | ErrorResponse>(urlWithPathParams); + + const data = this.handleResponse(response); + + return new Report(data); + } + + public async getReportCsv(reportId: string): Promise { + const urlWithPathParams = new PathParameters(ReportPaths.getReportCsv, { + report_id: reportId, + }).deriveUrl(); + + const response = await this.client.get | ErrorResponse>(urlWithPathParams); + + const data = this.handleResponse(response); + + return new ReportCsv(data); + } +} diff --git a/src/resources/reports/operations/create-report-request-object.ts b/src/resources/reports/operations/create-report-request-object.ts new file mode 100644 index 0000000..be7fcc9 --- /dev/null +++ b/src/resources/reports/operations/create-report-request-object.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IReportFilters } from '../../../types'; +import { type ReportType } from '../../../enums'; + +export interface CreateReportRequestBody { + type: ReportType; + filters?: IReportFilters[] | null; +} diff --git a/src/resources/reports/operations/index.ts b/src/resources/reports/operations/index.ts new file mode 100644 index 0000000..42c144f --- /dev/null +++ b/src/resources/reports/operations/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-report-query-parameters'; +export * from './create-report-request-object'; diff --git a/src/resources/reports/operations/list-report-query-parameters.ts b/src/resources/reports/operations/list-report-query-parameters.ts new file mode 100644 index 0000000..9642ef2 --- /dev/null +++ b/src/resources/reports/operations/list-report-query-parameters.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type ReportStatus } from '../../../enums'; + +export interface ListReportQueryParameters { + after?: string; + orderBy?: string; + perPage?: number; + status?: ReportStatus[]; +} diff --git a/src/resources/subscriptions/index.ts b/src/resources/subscriptions/index.ts new file mode 100644 index 0000000..a39797a --- /dev/null +++ b/src/resources/subscriptions/index.ts @@ -0,0 +1,215 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + Subscription, + SubscriptionCollection, + SubscriptionIncludes, + SubscriptionPreview, + TransactionIncludes, +} from '../../entities'; +import { type ErrorResponse, type Response } from '../../internal'; +import { BaseResource, PathParameters, QueryParameters } from '../../internal/base'; +import { + type CancelSubscription, + type CreateSubscriptionCharge, + type GetSubscriptionQueryParameters, + type ListSubscriptionQueryParameters, + type PauseSubscription, + type ResumeSubscription, + type UpdateSubscriptionRequestBody, +} from './operations'; +import { type ISubscriptionResponse, type ISubscriptionPreviewResponse, type ITransactionResponse } from '../../types'; + +const SubscriptionPaths = { + get: '/subscriptions/{subscription_id}', + update: '/subscriptions/{subscription_id}', + updatePreview: '/subscriptions/{subscription_id}/preview', + list: '/subscriptions', + cancel: '/subscriptions/{subscription_id}/cancel', + pause: '/subscriptions/{subscription_id}/pause', + resume: '/subscriptions/{subscription_id}/resume', + activate: '/subscriptions/{subscription_id}/activate', + createOneTimeCharge: '/subscriptions/{subscription_id}/charge', + previewOneTimeCharge: '/subscriptions/{subscription_id}/charge/preview', + getTransactionToUpdatePaymentMethod: '/subscriptions/{subscription_id}/update-payment-method-transaction', +} as const; + +export * from './operations'; + +export class SubscriptionsResource extends BaseResource { + public async previewUpdate( + subscriptionId: string, + updateSubscription: UpdateSubscriptionRequestBody, + ): Promise { + const urlWithPathParams = new PathParameters(SubscriptionPaths.updatePreview, { + subscription_id: subscriptionId, + }).deriveUrl(); + + const response = await this.client.patch< + UpdateSubscriptionRequestBody, + Response | ErrorResponse + >(urlWithPathParams, updateSubscription); + + const data = this.handleResponse(response); + + return new SubscriptionPreview(data); + } + + public async update( + subscriptionId: string, + updateSubscription: UpdateSubscriptionRequestBody, + ): Promise { + const urlWithPathParams = new PathParameters(SubscriptionPaths.update, { + subscription_id: subscriptionId, + }).deriveUrl(); + + const response = await this.client.patch< + UpdateSubscriptionRequestBody, + Response | ErrorResponse + >(urlWithPathParams, updateSubscription); + + const data = this.handleResponse(response); + + return new Subscription(data); + } + + public list(queryParams?: ListSubscriptionQueryParameters): SubscriptionCollection { + const queryParameters = new QueryParameters(queryParams); + return new SubscriptionCollection(this.client, SubscriptionPaths.list + queryParameters.toQueryString()); + } + + public async get( + subscriptionId: string, + queryParams?: GetSubscriptionQueryParameters, + ): Promise { + const queryParameters = new QueryParameters(queryParams); + + const urlWithPathParams = new PathParameters(SubscriptionPaths.get, { + subscription_id: subscriptionId, + }).deriveUrl(); + + const response = await this.client.get< + GetSubscriptionQueryParameters | undefined, + Response | ErrorResponse + >(urlWithPathParams, queryParameters); + + const data = this.handleResponse(response); + + return new SubscriptionIncludes(data); + } + + public async activate(subscriptionId: string): Promise { + const urlWithPathParams = new PathParameters(SubscriptionPaths.activate, { + subscription_id: subscriptionId, + }).deriveUrl(); + + const response = await this.client.post | ErrorResponse>( + urlWithPathParams, + undefined, + ); + + const data = this.handleResponse(response); + + return new Subscription(data); + } + + public async pause(subscriptionId: string, requestBody: PauseSubscription): Promise { + const urlWithPathParams = new PathParameters(SubscriptionPaths.pause, { + subscription_id: subscriptionId, + }).deriveUrl(); + + const response = await this.client.post | ErrorResponse>( + urlWithPathParams, + requestBody, + ); + + const data = this.handleResponse(response); + + return new Subscription(data); + } + + public async resume(subscriptionId: string, requestBody: ResumeSubscription): Promise { + const urlWithPathParams = new PathParameters(SubscriptionPaths.resume, { + subscription_id: subscriptionId, + }).deriveUrl(); + + const response = await this.client.post | ErrorResponse>( + urlWithPathParams, + requestBody, + ); + + const data = this.handleResponse(response); + + return new Subscription(data); + } + + public async cancel(subscriptionId: string, requestBody: CancelSubscription): Promise { + const urlWithPathParams = new PathParameters(SubscriptionPaths.cancel, { + subscription_id: subscriptionId, + }).deriveUrl(); + + const response = await this.client.post | ErrorResponse>( + urlWithPathParams, + requestBody, + ); + + const data = this.handleResponse(response); + + return new Subscription(data); + } + + public async createOneTimeCharge( + subscriptionId: string, + requestBody: CreateSubscriptionCharge, + ): Promise { + const urlWithPathParams = new PathParameters(SubscriptionPaths.createOneTimeCharge, { + subscription_id: subscriptionId, + }).deriveUrl(); + + const response = await this.client.post | ErrorResponse>( + urlWithPathParams, + requestBody, + ); + + const data = this.handleResponse(response); + + return new Subscription(data); + } + + public async previewOneTimeCharge( + subscriptionId: string, + requestBody: CreateSubscriptionCharge, + ): Promise { + const urlWithPathParams = new PathParameters(SubscriptionPaths.previewOneTimeCharge, { + subscription_id: subscriptionId, + }).deriveUrl(); + + const response = await this.client.post< + CreateSubscriptionCharge, + Response | ErrorResponse + >(urlWithPathParams, requestBody); + + const data = this.handleResponse(response); + + return new SubscriptionPreview(data); + } + + public async getPaymentMethodChangeTransaction(subscriptionId: string): Promise { + const urlWithPathParams = new PathParameters(SubscriptionPaths.getTransactionToUpdatePaymentMethod, { + subscription_id: subscriptionId, + }).deriveUrl(); + + const response = await this.client.get< + GetSubscriptionQueryParameters | undefined, + Response | ErrorResponse + >(urlWithPathParams); + + const data = this.handleResponse(response); + + return new TransactionIncludes(data); + } +} diff --git a/src/resources/subscriptions/operations/cancel-subscription-request-object.ts b/src/resources/subscriptions/operations/cancel-subscription-request-object.ts new file mode 100644 index 0000000..d417131 --- /dev/null +++ b/src/resources/subscriptions/operations/cancel-subscription-request-object.ts @@ -0,0 +1,11 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type SubscriptionEffectiveFrom } from '../../../enums'; + +export interface CancelSubscription { + effectiveFrom?: SubscriptionEffectiveFrom | null; +} diff --git a/src/resources/subscriptions/operations/create-subscription-charge-request-object.ts b/src/resources/subscriptions/operations/create-subscription-charge-request-object.ts new file mode 100644 index 0000000..ac0f026 --- /dev/null +++ b/src/resources/subscriptions/operations/create-subscription-charge-request-object.ts @@ -0,0 +1,30 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type SubscriptionEffectiveFrom, type SubscriptionOnPaymentFailure } from '../../../enums'; +import { type ISubscriptionNonCatalogPriceRequest } from '../../../types'; + +interface ITransactionItemBase { + quantity: number; +} + +interface ITransactionItemWithPriceId extends ITransactionItemBase { + priceId: string; + price?: never; +} + +interface ITransactionItemWithPrice extends ITransactionItemBase { + priceId?: never; + price: ISubscriptionNonCatalogPriceRequest; +} + +type ITransactionItem = ITransactionItemWithPriceId | ITransactionItemWithPrice; + +export interface CreateSubscriptionCharge { + effectiveFrom: SubscriptionEffectiveFrom; + items: ITransactionItem[]; + onPaymentFailure?: SubscriptionOnPaymentFailure; +} diff --git a/src/resources/subscriptions/operations/get-subscription-query-parameters.ts b/src/resources/subscriptions/operations/get-subscription-query-parameters.ts new file mode 100644 index 0000000..793674d --- /dev/null +++ b/src/resources/subscriptions/operations/get-subscription-query-parameters.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface GetSubscriptionQueryParameters { + include?: Array<'next_transaction' | 'recurring_transaction_details'>; +} diff --git a/src/resources/subscriptions/operations/index.ts b/src/resources/subscriptions/operations/index.ts new file mode 100644 index 0000000..5909b65 --- /dev/null +++ b/src/resources/subscriptions/operations/index.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './get-subscription-query-parameters'; +export * from './update-subscription-request-body'; +export * from './list-subscription-query-parameters'; +export * from './pause-subscription-request-object'; +export * from './resume-subscription-request-object'; +export * from './cancel-subscription-request-object'; +export * from './create-subscription-charge-request-object'; diff --git a/src/resources/subscriptions/operations/list-subscription-query-parameters.ts b/src/resources/subscriptions/operations/list-subscription-query-parameters.ts new file mode 100644 index 0000000..38c306c --- /dev/null +++ b/src/resources/subscriptions/operations/list-subscription-query-parameters.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CollectionMode, type ScheduledChangeAction, type SubscriptionStatus } from '../../../enums'; + +export interface ListSubscriptionQueryParameters { + addressId?: string[]; + after?: string; + collectionMode?: CollectionMode; + customerId?: string[]; + id?: string[]; + orderBy?: string; + perPage?: number; + priceId?: string[]; + scheduledChangeAction?: ScheduledChangeAction[]; + status?: SubscriptionStatus[]; +} diff --git a/src/resources/subscriptions/operations/pause-subscription-request-object.ts b/src/resources/subscriptions/operations/pause-subscription-request-object.ts new file mode 100644 index 0000000..8ddc6c9 --- /dev/null +++ b/src/resources/subscriptions/operations/pause-subscription-request-object.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type SubscriptionEffectiveFrom } from '../../../enums'; + +export interface PauseSubscription { + effectiveFrom?: SubscriptionEffectiveFrom | null; + resumeAt?: null | string; +} diff --git a/src/resources/subscriptions/operations/resume-subscription-request-object.ts b/src/resources/subscriptions/operations/resume-subscription-request-object.ts new file mode 100644 index 0000000..ea7c7ea --- /dev/null +++ b/src/resources/subscriptions/operations/resume-subscription-request-object.ts @@ -0,0 +1,11 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type SubscriptionEffectiveFrom } from '../../../enums'; + +export interface ResumeSubscription { + effectiveFrom: SubscriptionEffectiveFrom | string; +} diff --git a/src/resources/subscriptions/operations/update-subscription-request-body.ts b/src/resources/subscriptions/operations/update-subscription-request-body.ts new file mode 100644 index 0000000..7914ce1 --- /dev/null +++ b/src/resources/subscriptions/operations/update-subscription-request-body.ts @@ -0,0 +1,41 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IBillingDetailsUpdate, type ICustomData, type ISubscriptionUpdateItem } from '../../../types'; +import { + type CollectionMode, + type CurrencyCode, + type ProrationBillingMode, + type SubscriptionEffectiveFrom, + type SubscriptionOnPaymentFailure, +} from '../../../enums'; + +export interface UpdateSubscriptionDiscount { + id: string; + effectiveFrom: SubscriptionEffectiveFrom; +} + +export interface UpdateSubscriptionScheduledChange { + action: 'cancel' | 'pause' | 'resume'; + effectiveAt: string; + resumeAt?: string | null; +} + +export interface UpdateSubscriptionRequestBody { + customerId?: string; + addressId?: string; + businessId?: string | null; + currencyCode?: CurrencyCode; + nextBilledAt?: string; + discount?: UpdateSubscriptionDiscount | null; + collectionMode?: CollectionMode; + billingDetails?: IBillingDetailsUpdate | null; + scheduledChange?: UpdateSubscriptionScheduledChange | null; + items?: ISubscriptionUpdateItem[]; + customData?: ICustomData | null; + prorationBillingMode?: ProrationBillingMode; + onPaymentFailure?: SubscriptionOnPaymentFailure; +} diff --git a/src/resources/transactions/index.ts b/src/resources/transactions/index.ts new file mode 100644 index 0000000..f546d82 --- /dev/null +++ b/src/resources/transactions/index.ts @@ -0,0 +1,114 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + Transaction, + TransactionCollection, + TransactionIncludes, + TransactionInvoicePDF, + TransactionPreview, +} from '../../entities'; +import { type ErrorResponse, type Response } from '../../internal'; +import { BaseResource, PathParameters, QueryParameters } from '../../internal/base'; +import { + type CreateTransactionQueryParameters, + type CreateTransactionRequestBody, + type GetTransactionQueryParameters, + type ListTransactionQueryParameters, + type UpdateTransactionRequestBody, + type TransactionPreviewRequestBody, +} from './operations'; +import { type ITransactionResponse, type ITransactionInvoicePDF, type ITransactionPreviewResponse } from '../../types'; + +const TransactionPaths = { + list: '/transactions', + create: '/transactions', + get: '/transactions/{transaction_id}', + update: '/transactions/{transaction_id}', + getInvoicePDF: '/transactions/{transaction_id}/invoice', + preview: '/transactions/preview', +} as const; + +export * from './operations'; + +export class TransactionsResource extends BaseResource { + public list(queryParams?: ListTransactionQueryParameters): TransactionCollection { + const queryParameters = new QueryParameters(queryParams); + return new TransactionCollection(this.client, TransactionPaths.list + queryParameters.toQueryString()); + } + + public async create( + createTransactionParameters: CreateTransactionRequestBody, + queryParams?: CreateTransactionQueryParameters, + ): Promise { + const queryParameters = new QueryParameters(queryParams); + const response = await this.client.post< + CreateTransactionRequestBody, + Response | ErrorResponse + >(TransactionPaths.create + queryParameters.toQueryString(), createTransactionParameters); + + const data = this.handleResponse(response); + + return new TransactionIncludes(data); + } + + public async update(transactionId: string, updateTransaction: UpdateTransactionRequestBody): Promise { + const urlWithPathParams = new PathParameters(TransactionPaths.update, { + transaction_id: transactionId, + }).deriveUrl(); + + const response = await this.client.patch< + UpdateTransactionRequestBody, + Response | ErrorResponse + >(urlWithPathParams, updateTransaction); + + const data = this.handleResponse(response); + + return new Transaction(data); + } + + public async get(transactionId: string, queryParams?: GetTransactionQueryParameters): Promise { + const queryParameters = new QueryParameters(queryParams); + + const urlWithPathParams = new PathParameters(TransactionPaths.get, { + transaction_id: transactionId, + }).deriveUrl(); + + const response = await this.client.get< + GetTransactionQueryParameters | undefined, + Response | ErrorResponse + >(urlWithPathParams, queryParameters); + + const data = this.handleResponse(response); + + return new TransactionIncludes(data); + } + + public async getInvoicePDF(transactionId: string): Promise { + const urlWithPathParams = new PathParameters(TransactionPaths.getInvoicePDF, { + transaction_id: transactionId, + }).deriveUrl(); + + const response = await this.client.get | ErrorResponse>( + urlWithPathParams, + ); + + const data = this.handleResponse(response); + + return new TransactionInvoicePDF(data); + } + + public async preview(previewTransactionParameters: TransactionPreviewRequestBody): Promise { + const response = await this.client.post< + TransactionPreviewRequestBody, + Response | ErrorResponse + >(TransactionPaths.preview, previewTransactionParameters); + + const data = this.handleResponse(response); + + return new TransactionPreview(data); + } +} diff --git a/src/resources/transactions/operations/create-transaction-query-parameters.ts b/src/resources/transactions/operations/create-transaction-query-parameters.ts new file mode 100644 index 0000000..c24cae0 --- /dev/null +++ b/src/resources/transactions/operations/create-transaction-query-parameters.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface CreateTransactionQueryParameters { + include?: Array<'address' | 'adjustment' | 'adjustments_totals' | 'business' | 'customer' | 'discount'>; +} diff --git a/src/resources/transactions/operations/create-transaction-request-body.ts b/src/resources/transactions/operations/create-transaction-request-body.ts new file mode 100644 index 0000000..5f67046 --- /dev/null +++ b/src/resources/transactions/operations/create-transaction-request-body.ts @@ -0,0 +1,29 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type IBillingDetailsCreate, + type ICustomData, + type ITransactionCheckout, + type ITransactionItemWithNonCatalogPrice, + type ITransactionsTimePeriod, +} from '../../../types'; +import { type CollectionMode, type CurrencyCode, type TransactionStatus } from '../../../enums'; + +export interface CreateTransactionRequestBody { + items: ITransactionItemWithNonCatalogPrice[]; + status?: TransactionStatus; + customerId?: string | null; + addressId?: string | null; + businessId?: string | null; + customData?: ICustomData | null; + currencyCode?: CurrencyCode; + collectionMode?: CollectionMode; + discountId?: string | null; + billingDetails?: IBillingDetailsCreate | null; + billingPeriod?: ITransactionsTimePeriod | null; + checkout?: ITransactionCheckout; +} diff --git a/src/resources/transactions/operations/get-transaction-query-parameters.ts b/src/resources/transactions/operations/get-transaction-query-parameters.ts new file mode 100644 index 0000000..c5e9bbd --- /dev/null +++ b/src/resources/transactions/operations/get-transaction-query-parameters.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface GetTransactionQueryParameters { + include?: Array<'address' | 'adjustment' | 'adjustments_totals' | 'business' | 'customer' | 'discount'>; +} diff --git a/src/resources/transactions/operations/index.ts b/src/resources/transactions/operations/index.ts new file mode 100644 index 0000000..56c91be --- /dev/null +++ b/src/resources/transactions/operations/index.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './list-transaction-query-parameters'; +export * from './create-transaction-query-parameters'; +export * from './create-transaction-request-body'; +export * from './get-transaction-query-parameters'; +export * from './update-transaction-request-body'; +export * from './transaction-preview-request-body'; diff --git a/src/resources/transactions/operations/list-transaction-query-parameters.ts b/src/resources/transactions/operations/list-transaction-query-parameters.ts new file mode 100644 index 0000000..e54c86c --- /dev/null +++ b/src/resources/transactions/operations/list-transaction-query-parameters.ts @@ -0,0 +1,36 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CollectionMode, type TransactionStatus, type TransactionOrigin } from '../../../enums'; + +export interface ListTransactionQueryParameters { + after?: string; + billedAt?: string; + 'billedAt[LT]'?: string; + 'billedAt[GT]'?: string; + 'billedAt[LTE]'?: string; + 'billedAt[GTE]'?: string; + collectionMode?: CollectionMode; + createdAt?: string; + 'createdAt[LT]'?: string; + 'createdAt[GT]'?: string; + 'createdAt[LTE]'?: string; + 'createdAt[GTE]'?: string; + customerId?: string[]; + id?: string[]; + include?: Array<'address' | 'adjustment' | 'adjustments_totals' | 'business' | 'customer' | 'discount'>; + invoiceNumber?: string[]; + orderBy?: string; + status?: TransactionStatus[]; + subscriptionId?: string[]; + perPage?: number; + updatedAt?: string; + 'updatedAt[LT]'?: string; + 'updatedAt[GT]'?: string; + 'updatedAt[LTE]'?: string; + 'updatedAt[GTE]'?: string; + origin?: TransactionOrigin[]; +} diff --git a/src/resources/transactions/operations/transaction-preview-request-body.ts b/src/resources/transactions/operations/transaction-preview-request-body.ts new file mode 100644 index 0000000..4ce9e55 --- /dev/null +++ b/src/resources/transactions/operations/transaction-preview-request-body.ts @@ -0,0 +1,30 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CountryCode, type CurrencyCode } from '../../../enums'; +import { type ITransactionItemPreviewRequest } from '../../../types'; + +export interface IAddressPreviewResponse { + postal_code?: string | null; + country_code: CountryCode; +} + +export interface IAddressPreview { + postalCode?: string | null; + countryCode: CountryCode; +} + +export interface TransactionPreviewRequestBody { + items: ITransactionItemPreviewRequest[]; + customerId?: string | null; + addressId?: string | null; + businessId?: string | null; + currencyCode?: CurrencyCode | null; + discountId?: string | null; + customerIpAddress?: string | null; + address?: IAddressPreview | null; + ignoreTrials?: boolean | null; +} diff --git a/src/resources/transactions/operations/update-transaction-request-body.ts b/src/resources/transactions/operations/update-transaction-request-body.ts new file mode 100644 index 0000000..8ec450e --- /dev/null +++ b/src/resources/transactions/operations/update-transaction-request-body.ts @@ -0,0 +1,29 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type IBillingDetailsUpdate, + type ICustomData, + type ITransactionCheckout, + type ITransactionItemWithNonCatalogPrice, + type ITransactionsTimePeriod, +} from '../../../types'; +import { type CollectionMode, type CurrencyCode, type TransactionStatus } from '../../../enums'; + +export interface UpdateTransactionRequestBody { + status?: TransactionStatus; + customerId?: string | null; + addressId?: string | null; + businessId?: string | null; + customData?: ICustomData | null; + currencyCode?: CurrencyCode; + collectionMode?: CollectionMode; + discountId?: string | null; + billingDetails?: IBillingDetailsUpdate | null; + billingPeriod?: ITransactionsTimePeriod | null; + items?: ITransactionItemWithNonCatalogPrice[]; + checkout?: ITransactionCheckout | null; +} diff --git a/src/types/address/address-response.ts b/src/types/address/address-response.ts new file mode 100644 index 0000000..120ce74 --- /dev/null +++ b/src/types/address/address-response.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData, type IImportMetaResponse } from '../index'; +import { type CountryCode, type Status } from '../../enums'; + +export interface IAddressResponse { + id: string; + description?: string | null; + first_line?: string | null; + second_line?: string | null; + city?: string | null; + postal_code?: string | null; + region?: string | null; + country_code: CountryCode; + custom_data?: ICustomData | null; + status: Status; + created_at: string; + updated_at: string; + import_meta?: IImportMetaResponse | null; +} diff --git a/src/types/address/index.ts b/src/types/address/index.ts new file mode 100644 index 0000000..f7d657f --- /dev/null +++ b/src/types/address/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './address-response'; diff --git a/src/types/adjustment/adjustment-item-response.ts b/src/types/adjustment/adjustment-item-response.ts new file mode 100644 index 0000000..7555026 --- /dev/null +++ b/src/types/adjustment/adjustment-item-response.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentItemTotals, type IAdjustmentsProrationResponse } from '../index'; +import { type AdjustmentType } from '../../enums'; + +export interface IAdjustmentItemResponse { + id: string; + item_id: string; + type: AdjustmentType; + amount?: string | null; + proration?: IAdjustmentsProrationResponse | null; + totals?: IAdjustmentItemTotals | null; +} diff --git a/src/types/adjustment/adjustment-response.ts b/src/types/adjustment/adjustment-response.ts new file mode 100644 index 0000000..f050761 --- /dev/null +++ b/src/types/adjustment/adjustment-response.ts @@ -0,0 +1,29 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type IAdjustmentItemResponse, + type ITotalAdjustmentsResponse, + type IPayoutTotalsAdjustmentResponse, +} from '../index'; +import { type AdjustmentAction, type CurrencyCode, type AdjustmentStatus } from '../../enums'; + +export interface IAdjustmentResponse { + id: string; + action: AdjustmentAction; + transaction_id: string; + subscription_id?: string | null; + customer_id: string; + reason: string; + credit_applied_to_balance: boolean; + currency_code: CurrencyCode; + status: AdjustmentStatus; + items: IAdjustmentItemResponse[]; + totals: ITotalAdjustmentsResponse; + payout_totals?: IPayoutTotalsAdjustmentResponse | null; + created_at: string; + updated_at: string; +} diff --git a/src/types/adjustment/adjustments-proration-response.ts b/src/types/adjustment/adjustments-proration-response.ts new file mode 100644 index 0000000..09502b1 --- /dev/null +++ b/src/types/adjustment/adjustments-proration-response.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentsTimePeriodResponse } from '../index'; + +export interface IAdjustmentsProrationResponse { + rate: string; + billing_period?: IAdjustmentsTimePeriodResponse | null; +} diff --git a/src/types/adjustment/adjustments-time-period-response.ts b/src/types/adjustment/adjustments-time-period-response.ts new file mode 100644 index 0000000..1c761d7 --- /dev/null +++ b/src/types/adjustment/adjustments-time-period-response.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface IAdjustmentsTimePeriodResponse { + starts_at: string; + ends_at: string; +} diff --git a/src/types/adjustment/index.ts b/src/types/adjustment/index.ts new file mode 100644 index 0000000..0ad8c92 --- /dev/null +++ b/src/types/adjustment/index.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './adjustments-time-period-response'; +export * from './adjustments-proration-response'; +export * from './adjustment-item-response'; +export * from './adjustment-response'; diff --git a/src/types/business/business-response.ts b/src/types/business/business-response.ts new file mode 100644 index 0000000..a7d30ae --- /dev/null +++ b/src/types/business/business-response.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IBusinessContacts, type ICustomData, type IImportMetaResponse } from '../index'; +import { type Status } from '../../enums'; + +export interface IBusinessResponse { + id: string; + name: string; + company_number?: string | null; + tax_identifier?: string | null; + status: Status; + contacts?: IBusinessContacts[] | null; + created_at: string; + updated_at: string; + custom_data?: ICustomData | null; + import_meta?: IImportMetaResponse | null; +} diff --git a/src/types/business/businesses-contacts.ts b/src/types/business/businesses-contacts.ts new file mode 100644 index 0000000..fe0b9e6 --- /dev/null +++ b/src/types/business/businesses-contacts.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface IBusinessContacts { + name?: string | null; + email: string; +} diff --git a/src/types/business/index.ts b/src/types/business/index.ts new file mode 100644 index 0000000..4c75d56 --- /dev/null +++ b/src/types/business/index.ts @@ -0,0 +1,8 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './businesses-contacts'; +export * from './business-response'; diff --git a/src/types/customer/credit-balance-response.ts b/src/types/customer/credit-balance-response.ts new file mode 100644 index 0000000..96e4107 --- /dev/null +++ b/src/types/customer/credit-balance-response.ts @@ -0,0 +1,14 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomerBalance } from '../index'; +import { type CurrencyCode } from '../../enums'; + +export interface ICreditBalanceResponse { + customer_id?: string | null; + currency_code?: CurrencyCode | null; + balance?: ICustomerBalance | null; +} diff --git a/src/types/customer/customer-balance.ts b/src/types/customer/customer-balance.ts new file mode 100644 index 0000000..b266436 --- /dev/null +++ b/src/types/customer/customer-balance.ts @@ -0,0 +1,11 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ICustomerBalance { + available: string; + reserved: string; + used: string; +} diff --git a/src/types/customer/customer-response.ts b/src/types/customer/customer-response.ts new file mode 100644 index 0000000..88bd35b --- /dev/null +++ b/src/types/customer/customer-response.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData, type IImportMetaResponse } from '../index'; +import { type Status } from '../../enums'; + +export interface ICustomerResponse { + id: string; + name?: string | null; + email: string; + marketing_consent: boolean; + status: Status; + custom_data?: ICustomData | null; + locale: string; + created_at: string; + updated_at: string; + import_meta?: IImportMetaResponse | null; +} diff --git a/src/types/customer/index.ts b/src/types/customer/index.ts new file mode 100644 index 0000000..fb0d38b --- /dev/null +++ b/src/types/customer/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './customer-response'; +export * from './credit-balance-response'; +export * from './customer-balance'; diff --git a/src/types/discount/discount-response.ts b/src/types/discount/discount-response.ts new file mode 100644 index 0000000..5032a18 --- /dev/null +++ b/src/types/discount/discount-response.ts @@ -0,0 +1,29 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode, type DiscountStatus, type DiscountType } from '../../enums'; +import { type ICustomData, type IImportMetaResponse } from '../shared'; + +export interface IDiscountResponse { + id: string; + status: DiscountStatus; + description: string; + enabled_for_checkout: boolean; + code?: string | null; + type: DiscountType; + amount: string; + currency_code?: CurrencyCode | null; + recur: boolean; + maximum_recurring_intervals?: number | null; + usage_limit?: number | null; + restrict_to?: string[] | null; + expires_at?: string | null; + custom_data?: ICustomData | null; + times_used: number; + created_at: string; + updated_at: string; + import_meta?: IImportMetaResponse | null; +} diff --git a/src/types/discount/index.ts b/src/types/discount/index.ts new file mode 100644 index 0000000..b03c85c --- /dev/null +++ b/src/types/discount/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './discount-response'; diff --git a/src/types/event-types/event-type-response.ts b/src/types/event-types/event-type-response.ts new file mode 100644 index 0000000..b11de00 --- /dev/null +++ b/src/types/event-types/event-type-response.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type IEventName } from '../../notifications'; + +export interface IEventTypeResponse { + name: IEventName; + description: string; + group: string; + available_versions: number[]; +} diff --git a/src/types/event-types/index.ts b/src/types/event-types/index.ts new file mode 100644 index 0000000..dffbf9a --- /dev/null +++ b/src/types/event-types/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './event-type-response'; diff --git a/src/types/events/events-response.ts b/src/types/events/events-response.ts new file mode 100644 index 0000000..f9478b9 --- /dev/null +++ b/src/types/events/events-response.ts @@ -0,0 +1,238 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAddressResponse } from '../address'; +import { type IBusinessResponse } from '../business'; +import { type EventName } from '../../notifications'; +import { type IAdjustmentResponse } from '../adjustment'; +import { type ICustomerResponse } from '../customer'; +import { type IDiscountResponse } from '../discount'; +import { type IPriceResponse } from '../price'; +import { type IProductResponse } from '../product'; +import { type ISubscriptionNotificationResponse } from '../subscription'; +import { type ITransactionResponse } from '../transaction'; +import { type IPayoutResponse } from '../payout'; +import { type IReportResponse } from '../report'; + +export interface IEventsResponse { + event_id: string; + notification_id: string; + event_type: string; + occurred_at: string; + data: T; +} + +interface IAddressCreated extends IEventsResponse { + event_type: EventName.AddressCreated; +} + +interface IAddressUpdated extends IEventsResponse { + event_type: EventName.AddressUpdated; +} + +interface IAddressImported extends IEventsResponse { + event_type: EventName.AddressImported; +} + +interface IAdjustmentCreated extends IEventsResponse { + event_type: EventName.AdjustmentCreated; +} + +interface IAdjustmentUpdated extends IEventsResponse { + event_type: EventName.AdjustmentUpdated; +} + +interface IBusinessCreated extends IEventsResponse { + event_type: EventName.BusinessCreated; +} + +interface IBusinessUpdated extends IEventsResponse { + event_type: EventName.BusinessUpdated; +} + +interface IBusinessImported extends IEventsResponse { + event_type: EventName.BusinessImported; +} + +interface ICustomerCreated extends IEventsResponse { + event_type: EventName.CustomerCreated; +} + +interface ICustomerUpdated extends IEventsResponse { + event_type: EventName.CustomerUpdated; +} + +interface ICustomerImported extends IEventsResponse { + event_type: EventName.CustomerImported; +} + +interface IDiscountCreated extends IEventsResponse { + event_type: EventName.DiscountCreated; +} + +interface IDiscountUpdated extends IEventsResponse { + event_type: EventName.DiscountUpdated; +} + +interface IDiscountImported extends IEventsResponse { + event_type: EventName.DiscountImported; +} + +interface IPayoutCreated extends IEventsResponse { + event_type: EventName.PayoutCreated; +} + +interface IPayoutPaid extends IEventsResponse { + event_type: EventName.PayoutPaid; +} + +interface IPriceCreated extends IEventsResponse { + event_type: EventName.PriceCreated; +} + +interface IPriceUpdated extends IEventsResponse { + event_type: EventName.PriceUpdated; +} + +interface IPriceImported extends IEventsResponse { + event_type: EventName.PriceImported; +} + +interface IProductCreated extends IEventsResponse { + event_type: EventName.ProductCreated; +} + +interface IProductUpdated extends IEventsResponse { + event_type: EventName.ProductUpdated; +} + +interface IProductImported extends IEventsResponse { + event_type: EventName.ProductImported; +} + +interface ISubscriptionActivated extends IEventsResponse { + event_type: EventName.SubscriptionActivated; +} + +interface ISubscriptionCanceled extends IEventsResponse { + event_type: EventName.SubscriptionCanceled; +} + +interface ISubscriptionCreated extends IEventsResponse { + event_type: EventName.SubscriptionCreated; +} + +interface ISubscriptionImported extends IEventsResponse { + event_type: EventName.SubscriptionImported; +} + +interface ISubscriptionPastDue extends IEventsResponse { + event_type: EventName.SubscriptionPastDue; +} + +interface ISubscriptionPaused extends IEventsResponse { + event_type: EventName.SubscriptionPaused; +} + +interface ISubscriptionResumed extends IEventsResponse { + event_type: EventName.SubscriptionResumed; +} + +interface ISubscriptionTrialing extends IEventsResponse { + event_type: EventName.SubscriptionTrialing; +} + +interface ISubscriptionUpdated extends IEventsResponse { + event_type: EventName.SubscriptionUpdated; +} + +interface ITransactionBilled extends IEventsResponse { + event_type: EventName.TransactionBilled; +} + +interface ITransactionCanceled extends IEventsResponse { + event_type: EventName.TransactionCanceled; +} + +interface ITransactionCompleted extends IEventsResponse { + event_type: EventName.TransactionCompleted; +} + +interface ITransactionCreated extends IEventsResponse { + event_type: EventName.TransactionCreated; +} + +interface ITransactionPaid extends IEventsResponse { + event_type: EventName.TransactionPaid; +} + +interface ITransactionPastDue extends IEventsResponse { + event_type: EventName.TransactionPastDue; +} + +interface ITransactionPaymentFailed extends IEventsResponse { + event_type: EventName.TransactionPaymentFailed; +} + +interface ITransactionReady extends IEventsResponse { + event_type: EventName.TransactionReady; +} + +interface ITransactionUpdated extends IEventsResponse { + event_type: EventName.TransactionUpdated; +} + +interface IReportCreated extends IEventsResponse { + event_type: EventName.ReportCreated; +} + +interface IReportUpdated extends IEventsResponse { + event_type: EventName.ReportUpdated; +} + +export type IEvents = + | IAddressCreated + | IAddressUpdated + | IAddressImported + | IAdjustmentCreated + | IAdjustmentUpdated + | IBusinessCreated + | IBusinessUpdated + | IBusinessImported + | ICustomerCreated + | ICustomerUpdated + | ICustomerImported + | IDiscountCreated + | IDiscountUpdated + | IDiscountImported + | IPayoutCreated + | IPayoutPaid + | IPriceCreated + | IPriceUpdated + | IPriceImported + | IProductCreated + | IProductUpdated + | IProductImported + | ISubscriptionActivated + | ISubscriptionCanceled + | ISubscriptionCreated + | ISubscriptionImported + | ISubscriptionPastDue + | ISubscriptionPaused + | ISubscriptionResumed + | ISubscriptionTrialing + | ISubscriptionUpdated + | ITransactionBilled + | ITransactionCanceled + | ITransactionCompleted + | ITransactionCreated + | ITransactionPaid + | ITransactionPastDue + | ITransactionPaymentFailed + | ITransactionReady + | ITransactionUpdated + | IReportCreated + | IReportUpdated; diff --git a/src/types/events/index.ts b/src/types/events/index.ts new file mode 100644 index 0000000..d0afe5e --- /dev/null +++ b/src/types/events/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './events-response'; diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..ed5837f --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,23 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './shared'; +export * from './product'; +export * from './price'; +export * from './transaction'; +export * from './adjustment'; +export * from './customer'; +export * from './business'; +export * from './subscription'; +export * from './address'; +export * from './discount'; +export * from './pricing-preview'; +export * from './events'; +export * from './payout'; +export * from './event-types'; +export * from './notification-settings'; +export * from './notifications'; +export * from './report'; diff --git a/src/types/notification-settings/index.ts b/src/types/notification-settings/index.ts new file mode 100644 index 0000000..3e5e044 --- /dev/null +++ b/src/types/notification-settings/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './notification-settings-response'; diff --git a/src/types/notification-settings/notification-settings-response.ts b/src/types/notification-settings/notification-settings-response.ts new file mode 100644 index 0000000..b1d8f38 --- /dev/null +++ b/src/types/notification-settings/notification-settings-response.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type NotificationSettingsType } from '../../enums'; +import { type IEventTypeResponse } from '../event-types'; + +export interface INotificationSettingsResponse { + id: string; + description: string; + type: NotificationSettingsType; + destination: string; + active: boolean; + api_version: number; + include_sensitive_fields: boolean; + subscribed_events: IEventTypeResponse[]; + endpoint_secret_key: string; +} diff --git a/src/types/notifications/index.ts b/src/types/notifications/index.ts new file mode 100644 index 0000000..7584ade --- /dev/null +++ b/src/types/notifications/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './notification'; +export * from './notification-log'; +export * from './replay-notification'; diff --git a/src/types/notifications/notification-log.ts b/src/types/notifications/notification-log.ts new file mode 100644 index 0000000..455264d --- /dev/null +++ b/src/types/notifications/notification-log.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface INotificationLogResponse { + id: string; + response_code: number; + response_content_type?: string | null; + response_body: string; + attempted_at: string; +} diff --git a/src/types/notifications/notification.ts b/src/types/notifications/notification.ts new file mode 100644 index 0000000..355241e --- /dev/null +++ b/src/types/notifications/notification.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type NotificationStatus, type Origin } from '../../enums'; +import type { IEvents } from '../events'; +import { type IEventName } from '../../notifications'; + +export interface INotificationResponse { + id: string; + type: IEventName; + status: NotificationStatus; + payload: IEvents; + occurred_at: string; + delivered_at?: null | string; + replayed_at?: null | string; + origin: Origin; + last_attempt_at?: null | string; + retry_at?: null | string; + times_attempted: number; + notification_setting_id: string; +} diff --git a/src/types/notifications/replay-notification.ts b/src/types/notifications/replay-notification.ts new file mode 100644 index 0000000..d60bffe --- /dev/null +++ b/src/types/notifications/replay-notification.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface IReplayNotificationResponse { + notification_id: string; +} diff --git a/src/types/payout/index.ts b/src/types/payout/index.ts new file mode 100644 index 0000000..d2b601d --- /dev/null +++ b/src/types/payout/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './payout-response'; diff --git a/src/types/payout/payout-response.ts b/src/types/payout/payout-response.ts new file mode 100644 index 0000000..22936a2 --- /dev/null +++ b/src/types/payout/payout-response.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type CurrencyCode, type PayoutStatus } from '../../enums'; + +export interface IPayoutResponse { + id: string; + status: PayoutStatus; + amount: string; + currency_code: CurrencyCode; +} diff --git a/src/types/price/index.ts b/src/types/price/index.ts new file mode 100644 index 0000000..bae79e6 --- /dev/null +++ b/src/types/price/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './price-response'; +export * from './subscription-non-catalog-price-request'; +export * from './non-catalog-price-request'; diff --git a/src/types/price/non-catalog-price-request.ts b/src/types/price/non-catalog-price-request.ts new file mode 100644 index 0000000..93d0f9f --- /dev/null +++ b/src/types/price/non-catalog-price-request.ts @@ -0,0 +1,29 @@ +import type { ICustomData, IMoney, IPriceQuantity, ITimePeriod, IUnitPriceOverride } from '../shared'; +import type { TaxMode } from '../../enums'; +import type { CreateProductRequestBody } from '../../resources'; + +interface INonCatalogBasePriceRequestBody { + name?: string | null; + description: string; + unitPrice: IMoney; + billingCycle?: ITimePeriod | null; + trialPeriod?: ITimePeriod | null; + taxMode?: TaxMode; + unitPriceOverrides?: IUnitPriceOverride[]; + quantity?: IPriceQuantity; + customData?: ICustomData | null; +} + +interface INonCatalogBasePriceRequestBodyWithProductId extends INonCatalogBasePriceRequestBody { + productId: string; + product?: never; +} + +interface INonCatalogBasePriceRequestBodyWithProduct extends INonCatalogBasePriceRequestBody { + productId?: never; + product: Omit; +} + +export type INonCatalogPriceRequestBody = + | INonCatalogBasePriceRequestBodyWithProductId + | INonCatalogBasePriceRequestBodyWithProduct; diff --git a/src/types/price/price-response.ts b/src/types/price/price-response.ts new file mode 100644 index 0000000..aa3bac1 --- /dev/null +++ b/src/types/price/price-response.ts @@ -0,0 +1,34 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type ITimePeriod, + type IMoneyResponse, + type IUnitPriceOverrideResponse, + type IPriceQuantity, + type ICustomData, + type ISharedProductResponse, + type IImportMetaResponse, +} from '../index'; +import { type TaxMode, type Status, type CatalogType } from '../../enums'; + +export interface IPriceResponse { + id: string; + product_id: string; + description: string; + type?: CatalogType | null; + name?: string | null; + billing_cycle?: ITimePeriod | null; + trial_period?: ITimePeriod | null; + tax_mode: TaxMode; + unit_price: IMoneyResponse; + unit_price_overrides: IUnitPriceOverrideResponse[]; + quantity: IPriceQuantity; + status: Status; + custom_data?: ICustomData | null; + import_meta?: IImportMetaResponse | null; + product?: ISharedProductResponse | null; +} diff --git a/src/types/price/subscription-non-catalog-price-request.ts b/src/types/price/subscription-non-catalog-price-request.ts new file mode 100644 index 0000000..d100ab3 --- /dev/null +++ b/src/types/price/subscription-non-catalog-price-request.ts @@ -0,0 +1,27 @@ +import type { TaxMode } from '../../enums'; +import type { ICustomData, IMoney, IPriceQuantity, IUnitPriceOverride } from '../shared'; +import { type CreateProductRequestBody } from '../../resources'; + +interface INonCatalogBasePriceRequest { + name?: string | null; + description: string; + unitPrice: IMoney; + taxMode?: TaxMode; + unitPriceOverrides?: IUnitPriceOverride[]; + quantity?: IPriceQuantity; + customData?: ICustomData | null; +} + +interface INonCatalogPriceRequestWithProductId extends INonCatalogBasePriceRequest { + productId: string; + product?: never; +} + +interface INonCatalogPriceRequestWithProduct extends INonCatalogBasePriceRequest { + productId?: never; + product: Omit; +} + +export type ISubscriptionNonCatalogPriceRequest = + | INonCatalogPriceRequestWithProductId + | INonCatalogPriceRequestWithProduct; diff --git a/src/types/pricing-preview/index.ts b/src/types/pricing-preview/index.ts new file mode 100644 index 0000000..4e557f0 --- /dev/null +++ b/src/types/pricing-preview/index.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +export * from './pricing-preview-response'; +export * from './pricing-preview-details-response'; +export * from './pricing-preview-discounts-response'; +export * from './pricing-preview-item-response'; +export * from './pricing-preview-line-item-response'; diff --git a/src/types/pricing-preview/pricing-preview-details-response.ts b/src/types/pricing-preview/pricing-preview-details-response.ts new file mode 100644 index 0000000..9046654 --- /dev/null +++ b/src/types/pricing-preview/pricing-preview-details-response.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type IPricingPreviewLineItemResponse } from './pricing-preview-line-item-response'; + +export interface IPricingPreviewDetailsResponse { + line_items: IPricingPreviewLineItemResponse[]; +} diff --git a/src/types/pricing-preview/pricing-preview-discounts-response.ts b/src/types/pricing-preview/pricing-preview-discounts-response.ts new file mode 100644 index 0000000..faf80e4 --- /dev/null +++ b/src/types/pricing-preview/pricing-preview-discounts-response.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IDiscountResponse } from '../discount'; + +export interface IPricingPreviewDiscountsResponse { + discount: IDiscountResponse; + total: string; + formatted_total: string; +} diff --git a/src/types/pricing-preview/pricing-preview-item-response.ts b/src/types/pricing-preview/pricing-preview-item-response.ts new file mode 100644 index 0000000..66700f5 --- /dev/null +++ b/src/types/pricing-preview/pricing-preview-item-response.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface IPricingPreviewItemResponse { + price_id?: string | null; + quantity: number; +} diff --git a/src/types/pricing-preview/pricing-preview-line-item-response.ts b/src/types/pricing-preview/pricing-preview-line-item-response.ts new file mode 100644 index 0000000..c0e13e0 --- /dev/null +++ b/src/types/pricing-preview/pricing-preview-line-item-response.ts @@ -0,0 +1,22 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IPriceResponse } from '../price'; +import { type ITotals, type IUnitTotals } from '../shared'; +import { type IProductResponse } from '../product'; +import { type IPricingPreviewDiscountsResponse } from './pricing-preview-discounts-response'; + +export interface IPricingPreviewLineItemResponse { + price: IPriceResponse; + quantity: number; + tax_rate: string; + unit_totals: IUnitTotals; + formatted_unit_totals: IUnitTotals; + totals: ITotals; + formatted_totals: ITotals; + product: IProductResponse; + discounts: IPricingPreviewDiscountsResponse[]; +} diff --git a/src/types/pricing-preview/pricing-preview-response.ts b/src/types/pricing-preview/pricing-preview-response.ts new file mode 100644 index 0000000..3a77b84 --- /dev/null +++ b/src/types/pricing-preview/pricing-preview-response.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode } from '../../enums'; +import { type IAddressPreviewResponse } from '../../resources'; +import { type IPricingPreviewItemResponse } from './pricing-preview-item-response'; +import { type IPricingPreviewDetailsResponse } from './pricing-preview-details-response'; +import { type AvailablePaymentMethod } from '../../enums/shared/available-payment-methods'; + +export interface IPricingPreviewResponse { + customer_id?: string | null; + address_id?: string | null; + business_id?: string | null; + currency_code?: CurrencyCode | null; + discount_id?: string | null; + address?: IAddressPreviewResponse | null; + customer_ip_address?: string | null; + items: IPricingPreviewItemResponse[]; + details?: IPricingPreviewDetailsResponse | null; + available_payment_method?: AvailablePaymentMethod | null; +} diff --git a/src/types/product/index.ts b/src/types/product/index.ts new file mode 100644 index 0000000..16e7826 --- /dev/null +++ b/src/types/product/index.ts @@ -0,0 +1,7 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './product-response'; diff --git a/src/types/product/product-response.ts b/src/types/product/product-response.ts new file mode 100644 index 0000000..17f61b7 --- /dev/null +++ b/src/types/product/product-response.ts @@ -0,0 +1,22 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData, type IImportMetaResponse, type ISharedPriceResponse } from '../index'; +import { type TaxCategory, type Status, type CatalogType } from '../../enums'; + +export interface IProductResponse { + id: string; + name: string; + type?: CatalogType | null; + description?: string | null; + tax_category: TaxCategory; + image_url?: string | null; + custom_data?: ICustomData | null; + status: Status; + created_at: string; + import_meta?: IImportMetaResponse | null; + prices?: ISharedPriceResponse[] | null; +} diff --git a/src/types/report/index.ts b/src/types/report/index.ts new file mode 100644 index 0000000..2619a99 --- /dev/null +++ b/src/types/report/index.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './report-filters'; +export * from './report'; +export * from './reports-csv'; diff --git a/src/types/report/report-filters.ts b/src/types/report/report-filters.ts new file mode 100644 index 0000000..fe9b3dd --- /dev/null +++ b/src/types/report/report-filters.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ReportFilterName, type ReportFilterOperator } from '../../enums'; + +export interface IReportFilters { + name: ReportFilterName; + operator?: null | ReportFilterOperator; + value: string[] | string; +} diff --git a/src/types/report/report.ts b/src/types/report/report.ts new file mode 100644 index 0000000..bb4ef6f --- /dev/null +++ b/src/types/report/report.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IReportFilters } from '../index'; +import { type ReportType, type ReportStatus } from '../../enums'; + +export interface IReportResponse { + id: string; + status: ReportStatus; + rows?: number | null; + type: ReportType; + filters: IReportFilters[]; + expires_at?: string | null; + created_at: string; +} diff --git a/src/types/report/reports-csv.ts b/src/types/report/reports-csv.ts new file mode 100644 index 0000000..293f70e --- /dev/null +++ b/src/types/report/reports-csv.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface IReportCsvResponse { + url: string; +} diff --git a/src/types/shared/adjustment-item-totals.ts b/src/types/shared/adjustment-item-totals.ts new file mode 100644 index 0000000..adf4e76 --- /dev/null +++ b/src/types/shared/adjustment-item-totals.ts @@ -0,0 +1,11 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface IAdjustmentItemTotals { + subtotal: string; + tax: string; + total: string; +} diff --git a/src/types/shared/adjustment-original-amount-response.ts b/src/types/shared/adjustment-original-amount-response.ts new file mode 100644 index 0000000..07e4577 --- /dev/null +++ b/src/types/shared/adjustment-original-amount-response.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type AdjustmentCurrencyCode } from '../../enums'; + +export interface IAdjustmentOriginalAmountResponse { + amount: string; + currency_code: AdjustmentCurrencyCode; +} diff --git a/src/types/shared/billing-details-create.ts b/src/types/shared/billing-details-create.ts new file mode 100644 index 0000000..e361a3e --- /dev/null +++ b/src/types/shared/billing-details-create.ts @@ -0,0 +1,14 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITimePeriod } from '../index'; + +export interface IBillingDetailsCreate { + enableCheckout?: boolean; + purchaseOrderNumber?: string; + additionalInformation?: string | null; + paymentTerms: ITimePeriod; +} diff --git a/src/types/shared/billing-details-response.ts b/src/types/shared/billing-details-response.ts new file mode 100644 index 0000000..0b3b320 --- /dev/null +++ b/src/types/shared/billing-details-response.ts @@ -0,0 +1,14 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITimePeriod } from '../index'; + +export interface IBillingDetailsResponse { + enable_checkout?: boolean | null; + purchase_order_number?: string | null; + additional_information?: string | null; + payment_terms: ITimePeriod; +} diff --git a/src/types/shared/billing-details-update.ts b/src/types/shared/billing-details-update.ts new file mode 100644 index 0000000..63cf279 --- /dev/null +++ b/src/types/shared/billing-details-update.ts @@ -0,0 +1,14 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITimePeriod } from '../index'; + +export interface IBillingDetailsUpdate { + enableCheckout: boolean; + purchaseOrderNumber: string; + additionalInformation: string; + paymentTerms: ITimePeriod; +} diff --git a/src/types/shared/chargeback-fee.ts b/src/types/shared/chargeback-fee.ts new file mode 100644 index 0000000..7880dbf --- /dev/null +++ b/src/types/shared/chargeback-fee.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentOriginalAmountResponse } from '../index'; + +export interface IChargebackFee { + amount: string; + original?: IAdjustmentOriginalAmountResponse | null; +} diff --git a/src/types/shared/custom-data.ts b/src/types/shared/custom-data.ts new file mode 100644 index 0000000..bef7305 --- /dev/null +++ b/src/types/shared/custom-data.ts @@ -0,0 +1 @@ +export type ICustomData = object; diff --git a/src/types/shared/import-meta-response.ts b/src/types/shared/import-meta-response.ts new file mode 100644 index 0000000..d3324c8 --- /dev/null +++ b/src/types/shared/import-meta-response.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface IImportMetaResponse { + external_id?: string | null; + imported_from: string; +} diff --git a/src/types/shared/index.ts b/src/types/shared/index.ts new file mode 100644 index 0000000..37808f2 --- /dev/null +++ b/src/types/shared/index.ts @@ -0,0 +1,37 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './time-period'; +export * from './money'; +export * from './money-response'; +export * from './unit-price-override'; +export * from './unit-price-override-response'; +export * from './price-quantity'; +export * from './shared-price-response'; +export * from './shared-product-response'; +export * from './billing-details-response'; +export * from './totals'; +export * from './tax-rates-used-response'; +export * from './transaction-totals-response'; +export * from './transaction-totals-adjusted-response'; +export * from './transaction-payout-totals-response'; +export * from './adjustment-original-amount-response'; +export * from './chargeback-fee'; +export * from './transaction-payout-totals-adjusted-response'; +export * from './unit-totals'; +export * from './payment-card-response'; +export * from './payment-method-details'; +export * from './transaction-payment-attempt-response'; +export * from './transaction-checkout'; +export * from './adjustment-item-totals'; +export * from './total-adjustments-response'; +export * from './payout-totals-adjustment-response'; +export * from './transaction-line-item-preview-response'; +export * from './transaction-details-preview-response'; +export * from './billing-details-create'; +export * from './billing-details-update'; +export * from './custom-data'; +export * from './import-meta-response'; diff --git a/src/types/shared/money-response.ts b/src/types/shared/money-response.ts new file mode 100644 index 0000000..e0ecc5a --- /dev/null +++ b/src/types/shared/money-response.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode } from '../../enums'; + +export interface IMoneyResponse { + amount: string; + currency_code: CurrencyCode; +} diff --git a/src/types/shared/money.ts b/src/types/shared/money.ts new file mode 100644 index 0000000..604ac85 --- /dev/null +++ b/src/types/shared/money.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode } from '../../enums'; + +export interface IMoney { + amount: string; + currencyCode: CurrencyCode; +} diff --git a/src/types/shared/payment-card-response.ts b/src/types/shared/payment-card-response.ts new file mode 100644 index 0000000..b919027 --- /dev/null +++ b/src/types/shared/payment-card-response.ts @@ -0,0 +1,15 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type PaymentCardType } from '../../enums'; + +export interface IPaymentCardResponse { + type: PaymentCardType; + last4: string; + expiry_month: number; + expiry_year: number; + cardholder_name: string; +} diff --git a/src/types/shared/payment-method-details.ts b/src/types/shared/payment-method-details.ts new file mode 100644 index 0000000..ea44c28 --- /dev/null +++ b/src/types/shared/payment-method-details.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IPaymentCardResponse } from '../index'; +import { type PaymentType } from '../../enums'; + +export interface IPaymentMethodDetails { + type: PaymentType; + card?: IPaymentCardResponse | null; +} diff --git a/src/types/shared/payout-totals-adjustment-response.ts b/src/types/shared/payout-totals-adjustment-response.ts new file mode 100644 index 0000000..134a8de --- /dev/null +++ b/src/types/shared/payout-totals-adjustment-response.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IChargebackFee } from '../index'; +import { type PayoutCurrencyCode } from '../../enums'; + +export interface IPayoutTotalsAdjustmentResponse { + subtotal: string; + tax: string; + total: string; + fee: string; + chargeback_fee?: IChargebackFee | null; + earnings: string; + currency_code: PayoutCurrencyCode; +} diff --git a/src/types/shared/price-quantity.ts b/src/types/shared/price-quantity.ts new file mode 100644 index 0000000..f7dae07 --- /dev/null +++ b/src/types/shared/price-quantity.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface IPriceQuantity { + minimum: number; + maximum: number; +} diff --git a/src/types/shared/shared-price-response.ts b/src/types/shared/shared-price-response.ts new file mode 100644 index 0000000..2aa35e6 --- /dev/null +++ b/src/types/shared/shared-price-response.ts @@ -0,0 +1,32 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type ITimePeriod, + type IMoneyResponse, + type IUnitPriceOverrideResponse, + type IPriceQuantity, + type ICustomData, + type IImportMetaResponse, +} from '../index'; +import { type TaxMode, type Status, type CatalogType } from '../../enums'; + +export interface ISharedPriceResponse { + id: string; + product_id: string; + description: string; + type?: CatalogType | null; + name?: string | null; + billing_cycle?: ITimePeriod | null; + trial_period?: ITimePeriod | null; + tax_mode: TaxMode; + unit_price?: IMoneyResponse | null; + unit_price_overrides?: IUnitPriceOverrideResponse[] | null; + quantity?: IPriceQuantity | null; + status: Status; + custom_data?: ICustomData | null; + import_meta?: IImportMetaResponse | null; +} diff --git a/src/types/shared/shared-product-response.ts b/src/types/shared/shared-product-response.ts new file mode 100644 index 0000000..ddce81f --- /dev/null +++ b/src/types/shared/shared-product-response.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ICustomData, type IImportMetaResponse } from '../index'; +import { type TaxCategory, type Status, type CatalogType } from '../../enums'; + +export interface ISharedProductResponse { + id: string; + name: string; + type?: CatalogType | null; + description?: string | null; + tax_category: TaxCategory; + image_url?: string | null; + custom_data?: ICustomData | null; + status: Status; + created_at: string; + import_meta?: IImportMetaResponse | null; +} diff --git a/src/types/shared/tax-rates-used-response.ts b/src/types/shared/tax-rates-used-response.ts new file mode 100644 index 0000000..bb3bf66 --- /dev/null +++ b/src/types/shared/tax-rates-used-response.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITotals } from '../index'; + +export interface ITaxRatesUsedResponse { + tax_rate: string; + totals?: ITotals | null; +} diff --git a/src/types/shared/time-period.ts b/src/types/shared/time-period.ts new file mode 100644 index 0000000..84e3ee8 --- /dev/null +++ b/src/types/shared/time-period.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type Interval } from '../../enums'; + +export interface ITimePeriod { + interval: Interval; + frequency: number; +} diff --git a/src/types/shared/total-adjustments-response.ts b/src/types/shared/total-adjustments-response.ts new file mode 100644 index 0000000..f637ed1 --- /dev/null +++ b/src/types/shared/total-adjustments-response.ts @@ -0,0 +1,16 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode } from '../../enums'; + +export interface ITotalAdjustmentsResponse { + subtotal: string; + tax: string; + total: string; + fee: string; + earnings: string; + currency_code: CurrencyCode; +} diff --git a/src/types/shared/totals.ts b/src/types/shared/totals.ts new file mode 100644 index 0000000..bd165ab --- /dev/null +++ b/src/types/shared/totals.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ITotals { + subtotal: string; + discount: string; + tax: string; + total: string; +} diff --git a/src/types/shared/transaction-checkout.ts b/src/types/shared/transaction-checkout.ts new file mode 100644 index 0000000..41f1fad --- /dev/null +++ b/src/types/shared/transaction-checkout.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ITransactionCheckout { + url?: string | null; +} diff --git a/src/types/shared/transaction-details-preview-response.ts b/src/types/shared/transaction-details-preview-response.ts new file mode 100644 index 0000000..1ca83d1 --- /dev/null +++ b/src/types/shared/transaction-details-preview-response.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type ITaxRatesUsedResponse, + type ITransactionTotalsResponse, + type ITransactionLineItemPreviewResponse, +} from '../index'; + +export interface ITransactionDetailsPreviewResponse { + tax_rates_used: ITaxRatesUsedResponse[]; + totals: ITransactionTotalsResponse; + line_items: ITransactionLineItemPreviewResponse[]; +} diff --git a/src/types/shared/transaction-line-item-preview-response.ts b/src/types/shared/transaction-line-item-preview-response.ts new file mode 100644 index 0000000..d041dd7 --- /dev/null +++ b/src/types/shared/transaction-line-item-preview-response.ts @@ -0,0 +1,16 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IUnitTotals, type ITotals, type ISharedProductResponse } from '../index'; + +export interface ITransactionLineItemPreviewResponse { + price_id: string; + quantity: number; + tax_rate: string; + unit_totals: IUnitTotals; + totals: ITotals; + product: ISharedProductResponse; +} diff --git a/src/types/shared/transaction-payment-attempt-response.ts b/src/types/shared/transaction-payment-attempt-response.ts new file mode 100644 index 0000000..87dd2e2 --- /dev/null +++ b/src/types/shared/transaction-payment-attempt-response.ts @@ -0,0 +1,19 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IPaymentMethodDetails } from '../index'; +import { type PaymentAttemptStatus, type ErrorCode } from '../../enums'; + +export interface ITransactionPaymentAttemptResponse { + payment_attempt_id: string; + stored_payment_method_id: string; + amount: string; + status: PaymentAttemptStatus; + error_code?: ErrorCode | null; + method_details?: IPaymentMethodDetails | null; + created_at: string; + captured_at?: string | null; +} diff --git a/src/types/shared/transaction-payout-totals-adjusted-response.ts b/src/types/shared/transaction-payout-totals-adjusted-response.ts new file mode 100644 index 0000000..58ad35a --- /dev/null +++ b/src/types/shared/transaction-payout-totals-adjusted-response.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IChargebackFee } from '../index'; +import { type PayoutCurrencyCode } from '../../enums'; + +export interface ITransactionPayoutTotalsAdjustedResponse { + subtotal: string; + tax: string; + total: string; + fee: string; + chargeback_fee?: IChargebackFee | null; + earnings: string; + currency_code: PayoutCurrencyCode; +} diff --git a/src/types/shared/transaction-payout-totals-response.ts b/src/types/shared/transaction-payout-totals-response.ts new file mode 100644 index 0000000..df8e0d4 --- /dev/null +++ b/src/types/shared/transaction-payout-totals-response.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type PayoutCurrencyCode } from '../../enums'; + +export interface ITransactionPayoutTotalsResponse { + subtotal: string; + discount: string; + tax: string; + total: string; + credit: string; + balance: string; + grand_total: string; + credit_to_balance: string; + fee: string; + earnings: string; + currency_code: PayoutCurrencyCode; +} diff --git a/src/types/shared/transaction-totals-adjusted-response.ts b/src/types/shared/transaction-totals-adjusted-response.ts new file mode 100644 index 0000000..7a02095 --- /dev/null +++ b/src/types/shared/transaction-totals-adjusted-response.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode } from '../../enums'; + +export interface ITransactionTotalsAdjustedResponse { + subtotal: string; + tax: string; + total: string; + grand_total: string; + fee?: string | null; + earnings?: string | null; + currency_code: CurrencyCode; +} diff --git a/src/types/shared/transaction-totals-response.ts b/src/types/shared/transaction-totals-response.ts new file mode 100644 index 0000000..0183e31 --- /dev/null +++ b/src/types/shared/transaction-totals-response.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode } from '../../enums'; + +export interface ITransactionTotalsResponse { + subtotal: string; + discount: string; + tax: string; + total: string; + credit: string; + credit_to_balance: string; + balance: string; + grand_total: string; + fee?: string | null; + earnings?: string | null; + currency_code: CurrencyCode; +} diff --git a/src/types/shared/unit-price-override-response.ts b/src/types/shared/unit-price-override-response.ts new file mode 100644 index 0000000..f0f1685 --- /dev/null +++ b/src/types/shared/unit-price-override-response.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IMoneyResponse } from '../index'; +import { type CountryCode } from '../../enums'; + +export interface IUnitPriceOverrideResponse { + country_codes: CountryCode[]; + unit_price: IMoneyResponse; +} diff --git a/src/types/shared/unit-price-override.ts b/src/types/shared/unit-price-override.ts new file mode 100644 index 0000000..dacea75 --- /dev/null +++ b/src/types/shared/unit-price-override.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IMoney } from '../index'; +import { type CountryCode } from '../../enums'; + +export interface IUnitPriceOverride { + countryCodes: CountryCode[]; + unitPrice: IMoney; +} diff --git a/src/types/shared/unit-totals.ts b/src/types/shared/unit-totals.ts new file mode 100644 index 0000000..32e1269 --- /dev/null +++ b/src/types/shared/unit-totals.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface IUnitTotals { + subtotal: string; + discount: string; + tax: string; + total: string; +} diff --git a/src/types/subscription/index.ts b/src/types/subscription/index.ts new file mode 100644 index 0000000..9d6fbfa --- /dev/null +++ b/src/types/subscription/index.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './subscription-discount-response'; +export * from './subscription-time-period-response'; +export * from './subscription-scheduled-change-response'; +export * from './subscription-management-response'; +export * from './subscription-price-response'; +export * from './subscription-item-response'; +export * from './next-transaction-response'; +export * from './subscription-discount-response'; +export * from './subscription-update-item'; +export * from './subscription-response'; +export * from './subscription-preview-response'; +export * from './subscription-preview-update-summary'; +export * from './subscription-result-response'; +export * from './subscription-notification-response'; diff --git a/src/types/subscription/next-transaction-response.ts b/src/types/subscription/next-transaction-response.ts new file mode 100644 index 0000000..e8991fc --- /dev/null +++ b/src/types/subscription/next-transaction-response.ts @@ -0,0 +1,24 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type IAdjustmentItemResponse, + type ISubscriptionTimePeriodResponse, + type ITotalAdjustmentsResponse, + type ITransactionDetailsPreviewResponse, +} from '../index'; + +export interface AdjustmentPreviewResponse { + transaction_id: string; + items: IAdjustmentItemResponse[]; + totals?: ITotalAdjustmentsResponse | null; +} + +export interface INextTransactionResponse { + billing_period: ISubscriptionTimePeriodResponse; + details: ITransactionDetailsPreviewResponse; + adjustments: AdjustmentPreviewResponse[]; +} diff --git a/src/types/subscription/subscription-discount-response.ts b/src/types/subscription/subscription-discount-response.ts new file mode 100644 index 0000000..7bf27b6 --- /dev/null +++ b/src/types/subscription/subscription-discount-response.ts @@ -0,0 +1,11 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ISubscriptionDiscountResponse { + id: string; + starts_at: string; + ends_at?: string | null; +} diff --git a/src/types/subscription/subscription-item-response.ts b/src/types/subscription/subscription-item-response.ts new file mode 100644 index 0000000..03f29c1 --- /dev/null +++ b/src/types/subscription/subscription-item-response.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISubscriptionPriceResponse, type ISubscriptionTimePeriodResponse } from '../index'; +import { type SubscriptionItemStatus } from '../../enums'; + +export interface ISubscriptionItemResponse { + status: SubscriptionItemStatus; + quantity: number; + recurring: boolean; + created_at: string; + updated_at: string; + previously_billed_at?: string | null; + next_billed_at?: string | null; + trial_dates?: ISubscriptionTimePeriodResponse | null; + price?: ISubscriptionPriceResponse | null; +} diff --git a/src/types/subscription/subscription-management-response.ts b/src/types/subscription/subscription-management-response.ts new file mode 100644 index 0000000..e474a54 --- /dev/null +++ b/src/types/subscription/subscription-management-response.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ISubscriptionManagementResponse { + update_payment_method?: string | null; + cancel: string; +} diff --git a/src/types/subscription/subscription-notification-response.ts b/src/types/subscription/subscription-notification-response.ts new file mode 100644 index 0000000..6293274 --- /dev/null +++ b/src/types/subscription/subscription-notification-response.ts @@ -0,0 +1,45 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type IBillingDetailsResponse, + type ICustomData, + type INextTransactionResponse, + type ISubscriptionDiscountResponse, + type ISubscriptionItemResponse, + type ISubscriptionScheduledChangeResponse, + type ISubscriptionTimePeriodResponse, + type ITimePeriod, + type ITransactionDetailsPreviewResponse, +} from '../index'; +import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../enums'; + +export interface ISubscriptionNotificationResponse { + id: string; + status: SubscriptionStatus; + transaction_id: string; + customer_id: string; + address_id: string; + business_id?: string | null; + currency_code: CurrencyCode; + created_at: string; + updated_at: string; + started_at?: string | null; + first_billed_at?: string | null; + next_billed_at?: string | null; + paused_at?: string | null; + canceled_at?: string | null; + discount?: ISubscriptionDiscountResponse | null; + collection_mode: CollectionMode; + billing_details?: IBillingDetailsResponse | null; + current_billing_period?: ISubscriptionTimePeriodResponse | null; + billing_cycle: ITimePeriod; + scheduled_change?: ISubscriptionScheduledChangeResponse | null; + items: ISubscriptionItemResponse[]; + custom_data?: ICustomData | null; + next_transaction?: INextTransactionResponse | null; + recurring_transaction_details?: ITransactionDetailsPreviewResponse | null; +} diff --git a/src/types/subscription/subscription-preview-response.ts b/src/types/subscription/subscription-preview-response.ts new file mode 100644 index 0000000..991650f --- /dev/null +++ b/src/types/subscription/subscription-preview-response.ts @@ -0,0 +1,50 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type ISubscriptionDiscountResponse, + type IBillingDetailsResponse, + type ITimePeriod, + type ISubscriptionScheduledChangeResponse, + type ISubscriptionItemResponse, + type ICustomData, + type INextTransactionResponse, + type ITransactionDetailsPreviewResponse, + type ISubscriptionTimePeriodResponse, + type ISubscriptionManagementResponse, + type ISubscriptionPreviewUpdateSummary, + type IImportMetaResponse, +} from '../index'; +import { type CurrencyCode, type CollectionMode, type SubscriptionStatus } from '../../enums'; + +export interface ISubscriptionPreviewResponse { + status: SubscriptionStatus; + customer_id: string; + address_id: string; + business_id?: string | null; + currency_code: CurrencyCode; + created_at: string; + updated_at: string; + started_at?: string | null; + first_billed_at?: string | null; + next_billed_at?: string | null; + paused_at?: string | null; + canceled_at?: string | null; + discount?: ISubscriptionDiscountResponse | null; + collection_mode: CollectionMode; + billing_details?: IBillingDetailsResponse | null; + current_billing_period?: ISubscriptionTimePeriodResponse | null; + billing_cycle?: ITimePeriod | null; + scheduled_change?: ISubscriptionScheduledChangeResponse | null; + management_urls?: ISubscriptionManagementResponse | null; + items: ISubscriptionItemResponse[]; + custom_data?: ICustomData | null; + immediate_transaction?: INextTransactionResponse | null; + next_transaction?: INextTransactionResponse | null; + recurring_transaction_details?: ITransactionDetailsPreviewResponse | null; + update_summary?: ISubscriptionPreviewUpdateSummary | null; + import_meta?: IImportMetaResponse | null; +} diff --git a/src/types/subscription/subscription-preview-update-summary.ts b/src/types/subscription/subscription-preview-update-summary.ts new file mode 100644 index 0000000..5de131e --- /dev/null +++ b/src/types/subscription/subscription-preview-update-summary.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IMoneyResponse, type ISubscriptionResultResponse } from '../index'; + +export interface ISubscriptionPreviewUpdateSummary { + credit: IMoneyResponse; + charge: IMoneyResponse; + result: ISubscriptionResultResponse; +} diff --git a/src/types/subscription/subscription-price-response.ts b/src/types/subscription/subscription-price-response.ts new file mode 100644 index 0000000..5b659f9 --- /dev/null +++ b/src/types/subscription/subscription-price-response.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITimePeriod, type IMoneyResponse } from '../index'; +import { type TaxMode } from '../../enums'; + +export interface ISubscriptionPriceResponse { + id: string; + description: string; + product_id: string; + billing_cycle?: ITimePeriod | null; + trial_period?: ITimePeriod | null; + tax_mode: TaxMode; + unit_price: IMoneyResponse; +} diff --git a/src/types/subscription/subscription-response.ts b/src/types/subscription/subscription-response.ts new file mode 100644 index 0000000..7091a5b --- /dev/null +++ b/src/types/subscription/subscription-response.ts @@ -0,0 +1,48 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type IBillingDetailsResponse, + type ICustomData, + type IImportMetaResponse, + type INextTransactionResponse, + type ISubscriptionDiscountResponse, + type ISubscriptionItemResponse, + type ISubscriptionManagementResponse, + type ISubscriptionScheduledChangeResponse, + type ISubscriptionTimePeriodResponse, + type ITimePeriod, + type ITransactionDetailsPreviewResponse, +} from '../index'; +import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../enums'; + +export interface ISubscriptionResponse { + id: string; + status: SubscriptionStatus; + customer_id: string; + address_id: string; + business_id?: string | null; + currency_code: CurrencyCode; + created_at: string; + updated_at: string; + started_at?: string | null; + first_billed_at?: string | null; + next_billed_at?: string | null; + paused_at?: string | null; + canceled_at?: string | null; + discount?: ISubscriptionDiscountResponse | null; + collection_mode: CollectionMode; + billing_details?: IBillingDetailsResponse | null; + current_billing_period?: ISubscriptionTimePeriodResponse | null; + billing_cycle: ITimePeriod; + scheduled_change?: ISubscriptionScheduledChangeResponse | null; + management_urls: ISubscriptionManagementResponse | null; + items: ISubscriptionItemResponse[]; + custom_data?: ICustomData | null; + next_transaction?: INextTransactionResponse | null; + recurring_transaction_details?: ITransactionDetailsPreviewResponse | null; + import_meta?: IImportMetaResponse | null; +} diff --git a/src/types/subscription/subscription-result-response.ts b/src/types/subscription/subscription-result-response.ts new file mode 100644 index 0000000..112916a --- /dev/null +++ b/src/types/subscription/subscription-result-response.ts @@ -0,0 +1,11 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IMoneyResponse } from '../shared'; + +export interface ISubscriptionResultResponse extends IMoneyResponse { + action: 'credit' | 'charge'; +} diff --git a/src/types/subscription/subscription-scheduled-change-response.ts b/src/types/subscription/subscription-scheduled-change-response.ts new file mode 100644 index 0000000..f303be2 --- /dev/null +++ b/src/types/subscription/subscription-scheduled-change-response.ts @@ -0,0 +1,13 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ScheduledChangeAction } from '../../enums'; + +export interface ISubscriptionScheduledChangeResponse { + action: ScheduledChangeAction; + effective_at: string; + resume_at?: string | null; +} diff --git a/src/types/subscription/subscription-time-period-response.ts b/src/types/subscription/subscription-time-period-response.ts new file mode 100644 index 0000000..fe82bf4 --- /dev/null +++ b/src/types/subscription/subscription-time-period-response.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ISubscriptionTimePeriodResponse { + starts_at: string; + ends_at: string; +} diff --git a/src/types/subscription/subscription-update-item.ts b/src/types/subscription/subscription-update-item.ts new file mode 100644 index 0000000..abdc74a --- /dev/null +++ b/src/types/subscription/subscription-update-item.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ISubscriptionUpdateItem { + priceId: string; + quantity?: number | null; +} diff --git a/src/types/transaction/adjustment-totals-breakdown.ts b/src/types/transaction/adjustment-totals-breakdown.ts new file mode 100644 index 0000000..d651238 --- /dev/null +++ b/src/types/transaction/adjustment-totals-breakdown.ts @@ -0,0 +1,11 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface IAdjustmentTotalsBreakdown { + credit: string; + refund: string; + chargeback: string; +} diff --git a/src/types/transaction/adjustment-totals-response.ts b/src/types/transaction/adjustment-totals-response.ts new file mode 100644 index 0000000..984768f --- /dev/null +++ b/src/types/transaction/adjustment-totals-response.ts @@ -0,0 +1,18 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentTotalsBreakdown } from '../index'; +import { type CurrencyCode } from '../../enums'; + +export interface IAdjustmentTotalsResponse { + subtotal: string; + tax: string; + total: string; + fee: string; + earnings: string; + breakdown?: IAdjustmentTotalsBreakdown | null; + currency_code: CurrencyCode; +} diff --git a/src/types/transaction/index.ts b/src/types/transaction/index.ts new file mode 100644 index 0000000..837f755 --- /dev/null +++ b/src/types/transaction/index.ts @@ -0,0 +1,21 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export * from './transactions-time-period'; +export * from './transactions-time-period-response'; +export * from './transaction-proration-response'; +export * from './transaction-item'; +export * from './transaction-item-response'; +export * from './transaction-line-item-response'; +export * from './transaction-details-response'; +export * from './transaction-adjustment-item-response'; +export * from './transaction-adjustment-response'; +export * from './adjustment-totals-breakdown'; +export * from './adjustment-totals-response'; +export * from './transaction-response'; +export * from './transaction-invoice-pdf'; +export * from './transaction-preview-item'; +export * from './transaction-preview-response'; diff --git a/src/types/transaction/transaction-adjustment-item-response.ts b/src/types/transaction/transaction-adjustment-item-response.ts new file mode 100644 index 0000000..bfb745f --- /dev/null +++ b/src/types/transaction/transaction-adjustment-item-response.ts @@ -0,0 +1,17 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type IAdjustmentItemTotals, type ITransactionProrationResponse } from '../index'; +import { type AdjustmentType } from '../../enums'; + +export interface ITransactionAdjustmentItemResponse { + id?: string | null; + item_id: string; + type: AdjustmentType; + amount?: string | null; + proration?: ITransactionProrationResponse | null; + totals?: IAdjustmentItemTotals | null; +} diff --git a/src/types/transaction/transaction-adjustment-response.ts b/src/types/transaction/transaction-adjustment-response.ts new file mode 100644 index 0000000..64e9d2f --- /dev/null +++ b/src/types/transaction/transaction-adjustment-response.ts @@ -0,0 +1,29 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type ITransactionAdjustmentItemResponse, + type ITotalAdjustmentsResponse, + type IPayoutTotalsAdjustmentResponse, +} from '../index'; +import { type AdjustmentAction, type CurrencyCode, type AdjustmentStatus } from '../../enums'; + +export interface ITransactionAdjustmentResponse { + id: string; + action: AdjustmentAction; + transaction_id: string; + subscription_id?: string | null; + customer_id: string; + reason: string; + credit_applied_to_balance: boolean; + currency_code: CurrencyCode; + status: AdjustmentStatus; + items: ITransactionAdjustmentItemResponse[]; + totals?: ITotalAdjustmentsResponse | null; + payout_totals?: IPayoutTotalsAdjustmentResponse | null; + created_at: string; + updated_at: string; +} diff --git a/src/types/transaction/transaction-details-response.ts b/src/types/transaction/transaction-details-response.ts new file mode 100644 index 0000000..e34a089 --- /dev/null +++ b/src/types/transaction/transaction-details-response.ts @@ -0,0 +1,23 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type ITaxRatesUsedResponse, + type ITransactionTotalsResponse, + type ITransactionTotalsAdjustedResponse, + type ITransactionPayoutTotalsResponse, + type ITransactionPayoutTotalsAdjustedResponse, + type ITransactionLineItemResponse, +} from '../index'; + +export interface ITransactionDetailsResponse { + tax_rates_used: ITaxRatesUsedResponse[]; + totals?: ITransactionTotalsResponse | null; + adjusted_totals?: ITransactionTotalsAdjustedResponse | null; + payout_totals?: ITransactionPayoutTotalsResponse | null; + adjusted_payout_totals?: ITransactionPayoutTotalsAdjustedResponse | null; + line_items: ITransactionLineItemResponse[]; +} diff --git a/src/types/transaction/transaction-invoice-pdf.ts b/src/types/transaction/transaction-invoice-pdf.ts new file mode 100644 index 0000000..90b114f --- /dev/null +++ b/src/types/transaction/transaction-invoice-pdf.ts @@ -0,0 +1,9 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ITransactionInvoicePDF { + url: string; +} diff --git a/src/types/transaction/transaction-item-response.ts b/src/types/transaction/transaction-item-response.ts new file mode 100644 index 0000000..58b0ca1 --- /dev/null +++ b/src/types/transaction/transaction-item-response.ts @@ -0,0 +1,14 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ISharedPriceResponse, type ITransactionProrationResponse } from '../index'; + +export interface ITransactionItemResponse { + price_id?: string | null; + price?: ISharedPriceResponse | null; + quantity: number; + proration?: ITransactionProrationResponse | null; +} diff --git a/src/types/transaction/transaction-item.ts b/src/types/transaction/transaction-item.ts new file mode 100644 index 0000000..76ce77d --- /dev/null +++ b/src/types/transaction/transaction-item.ts @@ -0,0 +1,20 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type INonCatalogPriceRequestBody } from '../price'; + +export interface ITransactionItemWithPriceId { + priceId: string; + price?: never; + quantity: number; +} + +export interface ITransactionItemWithPrice { + priceId?: never; + price: INonCatalogPriceRequestBody; + quantity: number; +} + +export type ITransactionItemWithNonCatalogPrice = ITransactionItemWithPriceId | ITransactionItemWithPrice; diff --git a/src/types/transaction/transaction-line-item-response.ts b/src/types/transaction/transaction-line-item-response.ts new file mode 100644 index 0000000..2c78b7e --- /dev/null +++ b/src/types/transaction/transaction-line-item-response.ts @@ -0,0 +1,23 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type ITransactionProrationResponse, + type IUnitTotals, + type ITotals, + type ISharedProductResponse, +} from '../index'; + +export interface ITransactionLineItemResponse { + id: string; + price_id: string; + quantity: number; + proration?: ITransactionProrationResponse | null; + tax_rate: string; + unit_totals?: IUnitTotals | null; + totals?: ITotals | null; + product?: ISharedProductResponse | null; +} diff --git a/src/types/transaction/transaction-preview-item.ts b/src/types/transaction/transaction-preview-item.ts new file mode 100644 index 0000000..922df56 --- /dev/null +++ b/src/types/transaction/transaction-preview-item.ts @@ -0,0 +1,23 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ +import { type INonCatalogPriceRequestBody } from '../price'; + +interface IBaseTransactionItemPreview { + quantity: number; + includeInTotals?: boolean | null; +} + +interface ITransactionItemWithPriceId extends IBaseTransactionItemPreview { + priceId: string; + price?: never; +} + +interface ITransactionItemWithPrice extends IBaseTransactionItemPreview { + priceId?: never; + price: INonCatalogPriceRequestBody; +} + +export type ITransactionItemPreviewRequest = ITransactionItemWithPriceId | ITransactionItemWithPrice; diff --git a/src/types/transaction/transaction-preview-response.ts b/src/types/transaction/transaction-preview-response.ts new file mode 100644 index 0000000..0665da3 --- /dev/null +++ b/src/types/transaction/transaction-preview-response.ts @@ -0,0 +1,38 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type CurrencyCode } from '../../enums'; +import { type IAddressPreviewResponse } from '../../resources'; +import { type ITransactionDetailsPreviewResponse } from '../shared'; +import { type IPriceResponse } from '../price'; +import { type ITransactionsTimePeriodResponse } from './transactions-time-period-response'; +import { type AvailablePaymentMethod } from '../../enums/shared/available-payment-methods'; + +export interface IProrationResponse { + rate: string; + billing_period: ITransactionsTimePeriodResponse; +} + +export interface ITransactionItemPreviewResponse { + price?: IPriceResponse | null; + quantity: number; + include_in_totals?: boolean | null; + proration?: IProrationResponse | null; +} + +export interface ITransactionPreviewResponse { + customer_id?: string | null; + address_id?: string | null; + business_id?: string | null; + currency_code: CurrencyCode; + discount_id?: string | null; + customer_ip_address?: string | null; + address?: IAddressPreviewResponse | null; + ignore_trials?: boolean | null; + items: ITransactionItemPreviewResponse[]; + details: ITransactionDetailsPreviewResponse; + available_payment_method?: AvailablePaymentMethod | null; +} diff --git a/src/types/transaction/transaction-proration-response.ts b/src/types/transaction/transaction-proration-response.ts new file mode 100644 index 0000000..e0a3d64 --- /dev/null +++ b/src/types/transaction/transaction-proration-response.ts @@ -0,0 +1,12 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { type ITransactionsTimePeriodResponse } from '../index'; + +export interface ITransactionProrationResponse { + rate: string; + billing_period?: ITransactionsTimePeriodResponse | null; +} diff --git a/src/types/transaction/transaction-response.ts b/src/types/transaction/transaction-response.ts new file mode 100644 index 0000000..1dd1382 --- /dev/null +++ b/src/types/transaction/transaction-response.ts @@ -0,0 +1,53 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +import { + type ICustomData, + type IBillingDetailsResponse, + type ITransactionsTimePeriodResponse, + type ITransactionItemResponse, + type ITransactionDetailsResponse, + type ITransactionPaymentAttemptResponse, + type ITransactionCheckout, + type IAddressResponse, + type ITransactionAdjustmentResponse, + type IAdjustmentTotalsResponse, + type IBusinessResponse, + type ICustomerResponse, + type IDiscountResponse, +} from '../index'; +import { type TransactionStatus, type CurrencyCode, type TransactionOrigin, type CollectionMode } from '../../enums'; + +export interface ITransactionResponse { + id: string; + status: TransactionStatus; + customer_id?: string | null; + address_id?: string | null; + business_id?: string | null; + custom_data?: ICustomData | null; + currency_code: CurrencyCode; + origin: TransactionOrigin; + subscription_id?: string | null; + invoice_id?: string | null; + invoice_number?: string | null; + collection_mode: CollectionMode; + discount_id?: string | null; + billing_details?: IBillingDetailsResponse | null; + billing_period?: ITransactionsTimePeriodResponse | null; + items: ITransactionItemResponse[]; + details?: ITransactionDetailsResponse | null; + payments: ITransactionPaymentAttemptResponse[]; + checkout?: ITransactionCheckout | null; + created_at: string; + updated_at: string; + billed_at?: string | null; + address?: IAddressResponse | null; + adjustments?: ITransactionAdjustmentResponse[] | null; + adjustments_totals?: IAdjustmentTotalsResponse | null; + business?: IBusinessResponse | null; + customer?: ICustomerResponse | null; + discount?: IDiscountResponse | null; +} diff --git a/src/types/transaction/transactions-time-period-response.ts b/src/types/transaction/transactions-time-period-response.ts new file mode 100644 index 0000000..ae3c847 --- /dev/null +++ b/src/types/transaction/transactions-time-period-response.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ITransactionsTimePeriodResponse { + starts_at: string; + ends_at: string; +} diff --git a/src/types/transaction/transactions-time-period.ts b/src/types/transaction/transactions-time-period.ts new file mode 100644 index 0000000..a24bef6 --- /dev/null +++ b/src/types/transaction/transactions-time-period.ts @@ -0,0 +1,10 @@ +/** + * ! Autogenerated code ! + * Do not make changes to this file. + * Changes may be overwritten as part of auto-generation. + */ + +export interface ITransactionsTimePeriod { + startsAt: string; + endsAt: string; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..eb4b1ea --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "target": "es2016", + "lib": ["ESNext"], + "module": "NodeNext", + "rootDir": "./src", + "moduleResolution": "nodenext", + "baseUrl": "./src", + "declaration": true, + "outDir": "./dist", + "removeComments": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "strictBindCallApply": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "useUnknownInCatchVariables": true, + "alwaysStrict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "exactOptionalPropertyTypes": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "skipLibCheck": true + }, + "include": ["./src"], + "exclude": ["**/__tests__/**"] +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..abe437a --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4377 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@aashutoshrathi/word-wrap@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" + integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== + +"@ampproject/remapping@^2.2.0": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" + integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.13": + version "7.22.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" + integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== + dependencies: + "@babel/highlight" "^7.22.13" + chalk "^2.4.2" + +"@babel/code-frame@^7.23.5": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" + integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== + dependencies: + "@babel/highlight" "^7.23.4" + chalk "^2.4.2" + +"@babel/compat-data@^7.22.20", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.20.tgz#8df6e96661209623f1975d66c35ffca66f3306d0" + integrity sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw== + +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.0.tgz#f8259ae0e52a123eb40f552551e647b506a94d83" + integrity sha512-97z/ju/Jy1rZmDxybphrBuI+jtJjFVoz7Mr9yUQVVVi+DNZE333uFQeMOqcCIy1x3WYBIbWftUSLmbNXNT7qFQ== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.23.0" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-module-transforms" "^7.23.0" + "@babel/helpers" "^7.23.0" + "@babel/parser" "^7.23.0" + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.0" + "@babel/types" "^7.23.0" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/generator@^7.23.0", "@babel/generator@^7.7.2": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420" + integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g== + dependencies: + "@babel/types" "^7.23.0" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + +"@babel/generator@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" + integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== + dependencies: + "@babel/types" "^7.23.6" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + +"@babel/helper-annotate-as-pure@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" + integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-builder-binary-assignment-operator-visitor@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz#5426b109cf3ad47b91120f8328d8ab1be8b0b956" + integrity sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw== + dependencies: + "@babel/types" "^7.22.15" + +"@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.5", "@babel/helper-compilation-targets@^7.22.6": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz#0698fc44551a26cf29f18d4662d5bf545a6cfc52" + integrity sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw== + dependencies: + "@babel/compat-data" "^7.22.9" + "@babel/helper-validator-option" "^7.22.15" + browserslist "^4.21.9" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-create-class-features-plugin@^7.22.11", "@babel/helper-create-class-features-plugin@^7.22.15", "@babel/helper-create-class-features-plugin@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz#97a61b385e57fe458496fad19f8e63b63c867de4" + integrity sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.15" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + semver "^6.3.1" + +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz#5ee90093914ea09639b01c711db0d6775e558be1" + integrity sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + regexpu-core "^5.3.1" + semver "^6.3.1" + +"@babel/helper-define-polyfill-provider@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.3.tgz#a71c10f7146d809f4a256c373f462d9bba8cf6ba" + integrity sha512-WBrLmuPP47n7PNwsZ57pqam6G/RGo1vw/87b0Blc53tZNGZ4x7YvZ6HgQe2vo1W/FR20OgjeZuGXzudPiXHFug== + dependencies: + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-plugin-utils" "^7.22.5" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + +"@babel/helper-environment-visitor@^7.22.20", "@babel/helper-environment-visitor@^7.22.5": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== + +"@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== + dependencies: + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" + +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-member-expression-to-functions@^7.22.15": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" + integrity sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA== + dependencies: + "@babel/types" "^7.23.0" + +"@babel/helper-module-imports@^7.22.15", "@babel/helper-module-imports@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" + integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== + dependencies: + "@babel/types" "^7.22.15" + +"@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz#3ec246457f6c842c0aee62a01f60739906f7047e" + integrity sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/helper-validator-identifier" "^7.22.20" + +"@babel/helper-optimise-call-expression@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" + integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== + +"@babel/helper-remap-async-to-generator@^7.22.5", "@babel/helper-remap-async-to-generator@^7.22.9": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz#7b68e1cb4fa964d2996fd063723fb48eca8498e0" + integrity sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-wrap-function" "^7.22.20" + +"@babel/helper-replace-supers@^7.22.5", "@babel/helper-replace-supers@^7.22.9": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz#e37d367123ca98fe455a9887734ed2e16eb7a793" + integrity sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-member-expression-to-functions" "^7.22.15" + "@babel/helper-optimise-call-expression" "^7.22.5" + +"@babel/helper-simple-access@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" + integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-skip-transparent-expression-wrappers@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" + integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + +"@babel/helper-string-parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" + integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== + +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + +"@babel/helper-validator-option@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" + integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== + +"@babel/helper-wrap-function@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz#15352b0b9bfb10fc9c76f79f6342c00e3411a569" + integrity sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw== + dependencies: + "@babel/helper-function-name" "^7.22.5" + "@babel/template" "^7.22.15" + "@babel/types" "^7.22.19" + +"@babel/helpers@^7.23.0": + version "7.23.1" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.1.tgz#44e981e8ce2b9e99f8f0b703f3326a4636c16d15" + integrity sha512-chNpneuK18yW5Oxsr+t553UZzzAs3aZnFm4bxhebsNTeshrC95yA7l5yl7GBAG+JG1rF0F7zzD2EixK9mWSDoA== + dependencies: + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.0" + "@babel/types" "^7.23.0" + +"@babel/highlight@^7.22.13": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" + integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + +"@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" + integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== + +"@babel/parser@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" + integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.15.tgz#02dc8a03f613ed5fdc29fb2f728397c78146c962" + integrity sha512-FB9iYlz7rURmRJyXRKEnalYPPdn87H5no108cyuQQyMwlpJ2SJtpIUBI27kdTin956pz+LPypkPVPUTlxOmrsg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.15.tgz#2aeb91d337d4e1a1e7ce85b76a37f5301781200f" + integrity sha512-Hyph9LseGvAeeXzikV88bczhsrLrIZqDPxO+sSmAunMPaGrBGhfMWzCPYTtiW9t+HzSE2wtV8e5cc5P6r1xMDQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-transform-optional-chaining" "^7.22.15" + +"@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": + version "7.21.0-placeholder-for-preset-env.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" + integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== + +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-bigint@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" + integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.12.13", "@babel/plugin-syntax-class-properties@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-dynamic-import@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" + integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-export-namespace-from@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" + integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + +"@babel/plugin-syntax-import-assertions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz#07d252e2aa0bc6125567f742cd58619cb14dce98" + integrity sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-import-attributes@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz#ab840248d834410b829f569f5262b9e517555ecb" + integrity sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-import-meta@^7.10.4", "@babel/plugin-syntax-import-meta@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" + integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-jsx@^7.22.5", "@babel/plugin-syntax-jsx@^7.7.2": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" + integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-numeric-separator@^7.10.4", "@babel/plugin-syntax-numeric-separator@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5", "@babel/plugin-syntax-top-level-await@^7.8.3": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-typescript@^7.22.5", "@babel/plugin-syntax-typescript@^7.7.2": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" + integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-unicode-sets-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" + integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-arrow-functions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz#e5ba566d0c58a5b2ba2a8b795450641950b71958" + integrity sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-async-generator-functions@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.15.tgz#3b153af4a6b779f340d5b80d3f634f55820aefa3" + integrity sha512-jBm1Es25Y+tVoTi5rfd5t1KLmL8ogLKpXszboWOTTtGFGz2RKnQe2yn7HbZ+kb/B8N0FVSGQo874NSlOU1T4+w== + dependencies: + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.9" + "@babel/plugin-syntax-async-generators" "^7.8.4" + +"@babel/plugin-transform-async-to-generator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz#c7a85f44e46f8952f6d27fe57c2ed3cc084c3775" + integrity sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ== + dependencies: + "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.5" + +"@babel/plugin-transform-block-scoped-functions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz#27978075bfaeb9fa586d3cb63a3d30c1de580024" + integrity sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-block-scoping@^7.22.15": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.0.tgz#8744d02c6c264d82e1a4bc5d2d501fd8aff6f022" + integrity sha512-cOsrbmIOXmf+5YbL99/S49Y3j46k/T16b9ml8bm9lP6N9US5iQ2yBK7gpui1pg0V/WMcXdkfKbTb7HXq9u+v4g== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-class-properties@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz#97a56e31ad8c9dc06a0b3710ce7803d5a48cca77" + integrity sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-class-static-block@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.11.tgz#dc8cc6e498f55692ac6b4b89e56d87cec766c974" + integrity sha512-GMM8gGmqI7guS/llMFk1bJDkKfn3v3C4KHK9Yg1ey5qcHcOlKb0QvcMrgzvxo+T03/4szNh5lghY+fEC98Kq9g== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.11" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + +"@babel/plugin-transform-classes@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.15.tgz#aaf4753aee262a232bbc95451b4bdf9599c65a0b" + integrity sha512-VbbC3PGjBdE0wAWDdHM9G8Gm977pnYI0XpqMd6LrKISj8/DJXEsWqgRuTYaNE9Bv0JGhTZUzHDlMk18IpOuoqw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.9" + "@babel/helper-split-export-declaration" "^7.22.6" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz#cd1e994bf9f316bd1c2dafcd02063ec261bb3869" + integrity sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/template" "^7.22.5" + +"@babel/plugin-transform-destructuring@^7.22.15": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.0.tgz#6447aa686be48b32eaf65a73e0e2c0bd010a266c" + integrity sha512-vaMdgNXFkYrB+8lbgniSYWHsgqK5gjaMNcc84bMIOMRLH0L9AqYq3hwMdvnyqj1OPqea8UtjPEuS/DCenah1wg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-dotall-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz#dbb4f0e45766eb544e193fb00e65a1dd3b2a4165" + integrity sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-duplicate-keys@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz#b6e6428d9416f5f0bba19c70d1e6e7e0b88ab285" + integrity sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-dynamic-import@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.11.tgz#2c7722d2a5c01839eaf31518c6ff96d408e447aa" + integrity sha512-g/21plo58sfteWjaO0ZNVb+uEOkJNjAaHhbejrnBmu011l/eNDScmkbjCC3l4FKb10ViaGU4aOkFznSu2zRHgA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + +"@babel/plugin-transform-exponentiation-operator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz#402432ad544a1f9a480da865fda26be653e48f6a" + integrity sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g== + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-export-namespace-from@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.11.tgz#b3c84c8f19880b6c7440108f8929caf6056db26c" + integrity sha512-xa7aad7q7OiT8oNZ1mU7NrISjlSkVdMbNxn9IuLZyL9AJEhs1Apba3I+u5riX1dIkdptP5EKDG5XDPByWxtehw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + +"@babel/plugin-transform-for-of@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.15.tgz#f64b4ccc3a4f131a996388fae7680b472b306b29" + integrity sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-function-name@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz#935189af68b01898e0d6d99658db6b164205c143" + integrity sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg== + dependencies: + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-json-strings@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.11.tgz#689a34e1eed1928a40954e37f74509f48af67835" + integrity sha512-CxT5tCqpA9/jXFlme9xIBCc5RPtdDq3JpkkhgHQqtDdiTnTI0jtZ0QzXhr5DILeYifDPp2wvY2ad+7+hLMW5Pw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-json-strings" "^7.8.3" + +"@babel/plugin-transform-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz#e9341f4b5a167952576e23db8d435849b1dd7920" + integrity sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-logical-assignment-operators@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.11.tgz#24c522a61688bde045b7d9bc3c2597a4d948fc9c" + integrity sha512-qQwRTP4+6xFCDV5k7gZBF3C31K34ut0tbEcTKxlX/0KXxm9GLcO14p570aWxFvVzx6QAfPgq7gaeIHXJC8LswQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + +"@babel/plugin-transform-member-expression-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz#4fcc9050eded981a468347dd374539ed3e058def" + integrity sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-modules-amd@^7.22.5": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.0.tgz#05b2bc43373faa6d30ca89214731f76f966f3b88" + integrity sha512-xWT5gefv2HGSm4QHtgc1sYPbseOyf+FFDo2JbpE25GWl5BqTGO9IMwTYJRoIdjsF85GE+VegHxSCUt5EvoYTAw== + dependencies: + "@babel/helper-module-transforms" "^7.23.0" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-modules-commonjs@^7.22.15", "@babel/plugin-transform-modules-commonjs@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.0.tgz#b3dba4757133b2762c00f4f94590cf6d52602481" + integrity sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ== + dependencies: + "@babel/helper-module-transforms" "^7.23.0" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-simple-access" "^7.22.5" + +"@babel/plugin-transform-modules-systemjs@^7.22.11": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.0.tgz#77591e126f3ff4132a40595a6cccd00a6b60d160" + integrity sha512-qBej6ctXZD2f+DhlOC9yO47yEYgUh5CZNz/aBoH4j/3NOlRfJXJbY7xDQCqQVf9KbrqGzIWER1f23doHGrIHFg== + dependencies: + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-module-transforms" "^7.23.0" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" + +"@babel/plugin-transform-modules-umd@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz#4694ae40a87b1745e3775b6a7fe96400315d4f98" + integrity sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ== + dependencies: + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz#67fe18ee8ce02d57c855185e27e3dc959b2e991f" + integrity sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-new-target@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz#1b248acea54ce44ea06dfd37247ba089fcf9758d" + integrity sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-nullish-coalescing-operator@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.11.tgz#debef6c8ba795f5ac67cd861a81b744c5d38d9fc" + integrity sha512-YZWOw4HxXrotb5xsjMJUDlLgcDXSfO9eCmdl1bgW4+/lAGdkjaEvOnQ4p5WKKdUgSzO39dgPl0pTnfxm0OAXcg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + +"@babel/plugin-transform-numeric-separator@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.11.tgz#498d77dc45a6c6db74bb829c02a01c1d719cbfbd" + integrity sha512-3dzU4QGPsILdJbASKhF/V2TVP+gJya1PsueQCxIPCEcerqF21oEcrob4mzjsp2Py/1nLfF5m+xYNMDpmA8vffg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + +"@babel/plugin-transform-object-rest-spread@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz#21a95db166be59b91cde48775310c0df6e1da56f" + integrity sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q== + dependencies: + "@babel/compat-data" "^7.22.9" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.22.15" + +"@babel/plugin-transform-object-super@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz#794a8d2fcb5d0835af722173c1a9d704f44e218c" + integrity sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.5" + +"@babel/plugin-transform-optional-catch-binding@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.11.tgz#461cc4f578a127bb055527b3e77404cad38c08e0" + integrity sha512-rli0WxesXUeCJnMYhzAglEjLWVDF6ahb45HuprcmQuLidBJFWjNnOzssk2kuc6e33FlLaiZhG/kUIzUMWdBKaQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + +"@babel/plugin-transform-optional-chaining@^7.22.15": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.0.tgz#73ff5fc1cf98f542f09f29c0631647d8ad0be158" + integrity sha512-sBBGXbLJjxTzLBF5rFWaikMnOGOk/BmK6vVByIdEggZ7Vn6CvWXZyRkkLFK6WE0IF8jSliyOkUN6SScFgzCM0g== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + +"@babel/plugin-transform-parameters@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz#719ca82a01d177af358df64a514d64c2e3edb114" + integrity sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-private-methods@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz#21c8af791f76674420a147ae62e9935d790f8722" + integrity sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-private-property-in-object@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.11.tgz#ad45c4fc440e9cb84c718ed0906d96cf40f9a4e1" + integrity sha512-sSCbqZDBKHetvjSwpyWzhuHkmW5RummxJBVbYLkGkaiTOWGxml7SXt0iWa03bzxFIx7wOj3g/ILRd0RcJKBeSQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.11" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + +"@babel/plugin-transform-property-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz#b5ddabd73a4f7f26cd0e20f5db48290b88732766" + integrity sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-regenerator@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.10.tgz#8ceef3bd7375c4db7652878b0241b2be5d0c3cca" + integrity sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + regenerator-transform "^0.15.2" + +"@babel/plugin-transform-reserved-words@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz#832cd35b81c287c4bcd09ce03e22199641f964fb" + integrity sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-shorthand-properties@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz#6e277654be82b5559fc4b9f58088507c24f0c624" + integrity sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-spread@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz#6487fd29f229c95e284ba6c98d65eafb893fea6b" + integrity sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + +"@babel/plugin-transform-sticky-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz#295aba1595bfc8197abd02eae5fc288c0deb26aa" + integrity sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-template-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz#8f38cf291e5f7a8e60e9f733193f0bcc10909bff" + integrity sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-typeof-symbol@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz#5e2ba478da4b603af8673ff7c54f75a97b716b34" + integrity sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-typescript@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.15.tgz#15adef906451d86349eb4b8764865c960eb54127" + integrity sha512-1uirS0TnijxvQLnlv5wQBwOX3E1wCFX7ITv+9pBV2wKEk4K+M5tqDaoNXnTH8tjEIYHLO98MwiTWO04Ggz4XuA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-typescript" "^7.22.5" + +"@babel/plugin-transform-unicode-escapes@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.10.tgz#c723f380f40a2b2f57a62df24c9005834c8616d9" + integrity sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-property-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz#098898f74d5c1e86660dc112057b2d11227f1c81" + integrity sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz#ce7e7bb3ef208c4ff67e02a22816656256d7a183" + integrity sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-sets-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz#77788060e511b708ffc7d42fdfbc5b37c3004e91" + integrity sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/preset-env@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.22.20.tgz#de9e9b57e1127ce0a2f580831717f7fb677ceedb" + integrity sha512-11MY04gGC4kSzlPHRfvVkNAZhUxOvm7DCJ37hPDnUENwe06npjIRAfInEMTGSb4LZK5ZgDFkv5hw0lGebHeTyg== + dependencies: + "@babel/compat-data" "^7.22.20" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-option" "^7.22.15" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.22.15" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.22.15" + "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + "@babel/plugin-syntax-import-assertions" "^7.22.5" + "@babel/plugin-syntax-import-attributes" "^7.22.5" + "@babel/plugin-syntax-import-meta" "^7.10.4" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" + "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" + "@babel/plugin-transform-arrow-functions" "^7.22.5" + "@babel/plugin-transform-async-generator-functions" "^7.22.15" + "@babel/plugin-transform-async-to-generator" "^7.22.5" + "@babel/plugin-transform-block-scoped-functions" "^7.22.5" + "@babel/plugin-transform-block-scoping" "^7.22.15" + "@babel/plugin-transform-class-properties" "^7.22.5" + "@babel/plugin-transform-class-static-block" "^7.22.11" + "@babel/plugin-transform-classes" "^7.22.15" + "@babel/plugin-transform-computed-properties" "^7.22.5" + "@babel/plugin-transform-destructuring" "^7.22.15" + "@babel/plugin-transform-dotall-regex" "^7.22.5" + "@babel/plugin-transform-duplicate-keys" "^7.22.5" + "@babel/plugin-transform-dynamic-import" "^7.22.11" + "@babel/plugin-transform-exponentiation-operator" "^7.22.5" + "@babel/plugin-transform-export-namespace-from" "^7.22.11" + "@babel/plugin-transform-for-of" "^7.22.15" + "@babel/plugin-transform-function-name" "^7.22.5" + "@babel/plugin-transform-json-strings" "^7.22.11" + "@babel/plugin-transform-literals" "^7.22.5" + "@babel/plugin-transform-logical-assignment-operators" "^7.22.11" + "@babel/plugin-transform-member-expression-literals" "^7.22.5" + "@babel/plugin-transform-modules-amd" "^7.22.5" + "@babel/plugin-transform-modules-commonjs" "^7.22.15" + "@babel/plugin-transform-modules-systemjs" "^7.22.11" + "@babel/plugin-transform-modules-umd" "^7.22.5" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" + "@babel/plugin-transform-new-target" "^7.22.5" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.22.11" + "@babel/plugin-transform-numeric-separator" "^7.22.11" + "@babel/plugin-transform-object-rest-spread" "^7.22.15" + "@babel/plugin-transform-object-super" "^7.22.5" + "@babel/plugin-transform-optional-catch-binding" "^7.22.11" + "@babel/plugin-transform-optional-chaining" "^7.22.15" + "@babel/plugin-transform-parameters" "^7.22.15" + "@babel/plugin-transform-private-methods" "^7.22.5" + "@babel/plugin-transform-private-property-in-object" "^7.22.11" + "@babel/plugin-transform-property-literals" "^7.22.5" + "@babel/plugin-transform-regenerator" "^7.22.10" + "@babel/plugin-transform-reserved-words" "^7.22.5" + "@babel/plugin-transform-shorthand-properties" "^7.22.5" + "@babel/plugin-transform-spread" "^7.22.5" + "@babel/plugin-transform-sticky-regex" "^7.22.5" + "@babel/plugin-transform-template-literals" "^7.22.5" + "@babel/plugin-transform-typeof-symbol" "^7.22.5" + "@babel/plugin-transform-unicode-escapes" "^7.22.10" + "@babel/plugin-transform-unicode-property-regex" "^7.22.5" + "@babel/plugin-transform-unicode-regex" "^7.22.5" + "@babel/plugin-transform-unicode-sets-regex" "^7.22.5" + "@babel/preset-modules" "0.1.6-no-external-plugins" + "@babel/types" "^7.22.19" + babel-plugin-polyfill-corejs2 "^0.4.5" + babel-plugin-polyfill-corejs3 "^0.8.3" + babel-plugin-polyfill-regenerator "^0.5.2" + core-js-compat "^3.31.0" + semver "^6.3.1" + +"@babel/preset-modules@0.1.6-no-external-plugins": + version "0.1.6-no-external-plugins" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" + integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/types" "^7.4.4" + esutils "^2.0.2" + +"@babel/preset-typescript@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.23.0.tgz#cc6602d13e7e5b2087c811912b87cf937a9129d9" + integrity sha512-6P6VVa/NM/VlAYj5s2Aq/gdVg8FSENCg3wlZ6Qau9AcPaoF5LbN1nyGlR9DTRIw9PpxI94e+ReydsJHcjwAweg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-option" "^7.22.15" + "@babel/plugin-syntax-jsx" "^7.22.5" + "@babel/plugin-transform-modules-commonjs" "^7.23.0" + "@babel/plugin-transform-typescript" "^7.22.15" + +"@babel/regjsgen@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" + integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== + +"@babel/runtime@^7.8.4": + version "7.23.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.1.tgz#72741dc4d413338a91dcb044a86f3c0bc402646d" + integrity sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g== + dependencies: + regenerator-runtime "^0.14.0" + +"@babel/template@^7.22.15", "@babel/template@^7.22.5", "@babel/template@^7.3.3": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== + dependencies: + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" + +"@babel/traverse@^7.23.0": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" + integrity sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/generator" "^7.23.6" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.6" + "@babel/types" "^7.23.6" + debug "^4.3.1" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" + integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + +"@babel/types@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" + integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== + dependencies: + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + +"@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== + +"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.0", "@eslint-community/regexpp@^4.6.1": + version "4.9.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.9.1.tgz#449dfa81a57a1d755b09aa58d826c1262e4283b4" + integrity sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA== + +"@eslint/eslintrc@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.2.tgz#c6936b4b328c64496692f76944e755738be62396" + integrity sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.6.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@eslint/js@8.51.0": + version "8.51.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.51.0.tgz#6d419c240cfb2b66da37df230f7e7eef801c32fa" + integrity sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg== + +"@humanwhocodes/config-array@^0.11.11": + version "0.11.11" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.11.tgz#88a04c570dbbc7dd943e4712429c3df09bc32844" + integrity sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + +"@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== + dependencies: + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + ci-info "^3.2.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== + dependencies: + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== + dependencies: + jest-get-type "^29.6.3" + +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== + dependencies: + expect "^29.7.0" + jest-snapshot "^29.7.0" + +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== + dependencies: + "@jest/types" "^29.6.3" + "@sinonjs/fake-timers" "^10.0.2" + "@types/node" "*" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" + +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/types" "^29.6.3" + jest-mock "^29.7.0" + +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + "@types/node" "*" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^6.0.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.1.3" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" + slash "^3.0.0" + string-length "^4.0.1" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.1" + +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== + dependencies: + "@sinclair/typebox" "^0.27.8" + +"@jest/source-map@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.18" + callsites "^3.0.0" + graceful-fs "^4.2.9" + +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== + dependencies: + "@jest/console" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== + dependencies: + "@jest/test-result" "^29.7.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + slash "^3.0.0" + +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.2" + +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== + dependencies: + "@jest/schemas" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + +"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.19" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" + integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + +"@sinonjs/commons@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.0.tgz#beb434fe875d965265e04722ccfc21df7f755d72" + integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^10.0.2": + version "10.3.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== + dependencies: + "@sinonjs/commons" "^3.0.0" + +"@types/babel__core@^7.1.14": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.2.tgz#215db4f4a35d710256579784a548907237728756" + integrity sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA== + dependencies: + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.6.5" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.5.tgz#281f4764bcbbbc51fdded0f25aa587b4ce14da95" + integrity sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.4.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.2.tgz#843e9f1f47c957553b0c374481dc4772921d6a6b" + integrity sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.2.tgz#4ddf99d95cfdd946ff35d2b65c978d9c9bf2645d" + integrity sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw== + dependencies: + "@babel/types" "^7.20.7" + +"@types/graceful-fs@^4.1.3": + version "4.1.7" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.7.tgz#30443a2e64fd51113bc3e2ba0914d47109695e2a" + integrity sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw== + dependencies: + "@types/node" "*" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" + integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== + +"@types/istanbul-lib-report@*": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#412e0725ef41cde73bfa03e0e833eaff41e0fd63" + integrity sha512-gPQuzaPR5h/djlAv2apEG1HVOyj1IUs7GpfMZixU0/0KXT3pm64ylHuMUI1/Akh+sq/iikxg6Z2j+fcMDXaaTQ== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.2.tgz#edc8e421991a3b4df875036d381fc0a5a982f549" + integrity sha512-kv43F9eb3Lhj+lr/Hn6OcLCs/sSM8bt+fIaP11rCYngfV6NVjzWXJ17owQtDQTL9tQ8WSLUrGsSJ6rJz0F1w1A== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/jest@^29.5.6": + version "29.5.6" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.6.tgz#f4cf7ef1b5b0bfc1aa744e41b24d9cc52533130b" + integrity sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w== + dependencies: + expect "^29.0.0" + pretty-format "^29.0.0" + +"@types/json-schema@^7.0.12": + version "7.0.13" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.13.tgz#02c24f4363176d2d18fc8b70b9f3c54aba178a85" + integrity sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ== + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + +"@types/lodash@^4.14.202": + version "4.14.202" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.202.tgz#f09dbd2fb082d507178b2f2a5c7e74bd72ff98f8" + integrity sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ== + +"@types/node-fetch@^2.6.6": + version "2.6.6" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.6.tgz#b72f3f4bc0c0afee1c0bc9cff68e041d01e3e779" + integrity sha512-95X8guJYhfqiuVVhRFxVQcf4hW/2bCuoPwDasMf/531STFoNoWTT7YDnWdXHEZKqAGUigmpG31r2FE70LwnzJw== + dependencies: + "@types/node" "*" + form-data "^4.0.0" + +"@types/node@*": + version "20.8.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.4.tgz#0e9ebb2ff29d5c3302fc84477d066fa7c6b441aa" + integrity sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A== + dependencies: + undici-types "~5.25.1" + +"@types/node@^20.6.0": + version "20.6.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.0.tgz#9d7daa855d33d4efec8aea88cd66db1c2f0ebe16" + integrity sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg== + +"@types/semver@^7.5.0": + version "7.5.3" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.3.tgz#9a726e116beb26c24f1ccd6850201e1246122e04" + integrity sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw== + +"@types/stack-utils@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" + integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== + +"@types/yargs-parser@*": + version "21.0.1" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.1.tgz#07773d7160494d56aa882d7531aac7319ea67c3b" + integrity sha512-axdPBuLuEJt0c4yI5OZssC19K2Mq1uKdrfZBzuxLvaztgqUtFYZUNw7lETExPYJR9jdEoIg4mb7RQKRQzOkeGQ== + +"@types/yargs@^17.0.8": + version "17.0.28" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.28.tgz#d106e4301fbacde3d1796ab27374dd16588ec851" + integrity sha512-N3e3fkS86hNhtk6BEnc0rj3zcehaxx8QWhCROJkqpl5Zaoi7nAic3jH8q94jVD3zu5LGk+PUB6KAiDmimYOEQw== + dependencies: + "@types/yargs-parser" "*" + +"@typescript-eslint/eslint-plugin@^6.4.0": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.5.tgz#f4024b9f63593d0c2b5bd6e4ca027e6f30934d4f" + integrity sha512-JhtAwTRhOUcP96D0Y6KYnwig/MRQbOoLGXTON2+LlyB/N35SP9j1boai2zzwXb7ypKELXMx3DVk9UTaEq1vHEw== + dependencies: + "@eslint-community/regexpp" "^4.5.1" + "@typescript-eslint/scope-manager" "6.7.5" + "@typescript-eslint/type-utils" "6.7.5" + "@typescript-eslint/utils" "6.7.5" + "@typescript-eslint/visitor-keys" "6.7.5" + debug "^4.3.4" + graphemer "^1.4.0" + ignore "^5.2.4" + natural-compare "^1.4.0" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/parser@^6.4.0": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.5.tgz#8d7ca3d1fbd9d5a58cc4d30b2aa797a760137886" + integrity sha512-bIZVSGx2UME/lmhLcjdVc7ePBwn7CLqKarUBL4me1C5feOd663liTGjMBGVcGr+BhnSLeP4SgwdvNnnkbIdkCw== + dependencies: + "@typescript-eslint/scope-manager" "6.7.5" + "@typescript-eslint/types" "6.7.5" + "@typescript-eslint/typescript-estree" "6.7.5" + "@typescript-eslint/visitor-keys" "6.7.5" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.5.tgz#1cf33b991043886cd67f4f3600b8e122fc14e711" + integrity sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A== + dependencies: + "@typescript-eslint/types" "6.7.5" + "@typescript-eslint/visitor-keys" "6.7.5" + +"@typescript-eslint/type-utils@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.5.tgz#0a65949ec16588d8956f6d967f7d9c84ddb2d72a" + integrity sha512-Gs0qos5wqxnQrvpYv+pf3XfcRXW6jiAn9zE/K+DlmYf6FcpxeNYN0AIETaPR7rHO4K2UY+D0CIbDP9Ut0U4m1g== + dependencies: + "@typescript-eslint/typescript-estree" "6.7.5" + "@typescript-eslint/utils" "6.7.5" + debug "^4.3.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/types@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.5.tgz#4571320fb9cf669de9a95d9849f922c3af809790" + integrity sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ== + +"@typescript-eslint/typescript-estree@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.5.tgz#4578de1a26e9f24950f029a4f00d1bfe41f15a39" + integrity sha512-NhJiJ4KdtwBIxrKl0BqG1Ur+uw7FiOnOThcYx9DpOGJ/Abc9z2xNzLeirCG02Ig3vkvrc2qFLmYSSsaITbKjlg== + dependencies: + "@typescript-eslint/types" "6.7.5" + "@typescript-eslint/visitor-keys" "6.7.5" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/utils@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.5.tgz#ab847b53d6b65e029314b8247c2336843dba81ab" + integrity sha512-pfRRrH20thJbzPPlPc4j0UNGvH1PjPlhlCMq4Yx7EGjV7lvEeGX0U6MJYe8+SyFutWgSHsdbJ3BXzZccYggezA== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@types/json-schema" "^7.0.12" + "@types/semver" "^7.5.0" + "@typescript-eslint/scope-manager" "6.7.5" + "@typescript-eslint/types" "6.7.5" + "@typescript-eslint/typescript-estree" "6.7.5" + semver "^7.5.4" + +"@typescript-eslint/visitor-keys@6.7.5": + version "6.7.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.5.tgz#84c68d6ceb5b12d5246b918b84f2b79affd6c2f1" + integrity sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg== + dependencies: + "@typescript-eslint/types" "6.7.5" + eslint-visitor-keys "^3.4.1" + +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.9.0: + version "8.10.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + +ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^4.2.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + +anymatch@^3.0.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + +array-includes@^3.1.6: + version "3.1.7" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.7.tgz#8cd2e01b26f7a3086cbc87271593fe921c62abda" + integrity sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + is-string "^1.0.7" + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +array.prototype.findlastindex@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz#b37598438f97b579166940814e2c0493a4f50207" + integrity sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + get-intrinsic "^1.2.1" + +array.prototype.flat@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz#1476217df8cff17d72ee8f3ba06738db5b387d18" + integrity sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + +array.prototype.flatmap@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz#c9a7c6831db8e719d6ce639190146c24bbd3e527" + integrity sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + +arraybuffer.prototype.slice@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz#98bd561953e3e74bb34938e77647179dfe6e9f12" + integrity sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + +babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== + dependencies: + "@jest/transform" "^29.7.0" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.1.1" + babel-preset-jest "^29.6.3" + chalk "^4.0.0" + graceful-fs "^4.2.9" + slash "^3.0.0" + +babel-plugin-istanbul@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^5.0.4" + test-exclude "^6.0.0" + +babel-plugin-jest-hoist@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" + integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.1.14" + "@types/babel__traverse" "^7.0.6" + +babel-plugin-polyfill-corejs2@^0.4.5: + version "0.4.6" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.6.tgz#b2df0251d8e99f229a8e60fc4efa9a68b41c8313" + integrity sha512-jhHiWVZIlnPbEUKSSNb9YoWcQGdlTLq7z1GHL4AjFxaoOUMuuEVJ+Y4pAaQUGOGk93YsVCKPbqbfw3m0SM6H8Q== + dependencies: + "@babel/compat-data" "^7.22.6" + "@babel/helper-define-polyfill-provider" "^0.4.3" + semver "^6.3.1" + +babel-plugin-polyfill-corejs3@^0.8.3: + version "0.8.5" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.5.tgz#a75fa1b0c3fc5bd6837f9ec465c0f48031b8cab1" + integrity sha512-Q6CdATeAvbScWPNLB8lzSO7fgUVBkQt6zLgNlfyeCr/EQaEQR+bWiBYYPYAFyE528BMjRhL+1QBMOI4jc/c5TA== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.4.3" + core-js-compat "^3.32.2" + +babel-plugin-polyfill-regenerator@^0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.3.tgz#d4c49e4b44614607c13fb769bcd85c72bb26a4a5" + integrity sha512-8sHeDOmXC8csczMrYEOf0UTNa4yE2SxV5JGeT/LP1n0OYVDUUFPxG9vdk2AlDlIit4t+Kf0xCtpgXPBwnn/9pw== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.4.3" + +babel-preset-current-node-syntax@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" + integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== + dependencies: + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-bigint" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.8.3" + "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-top-level-await" "^7.8.3" + +babel-preset-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" + integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== + dependencies: + babel-plugin-jest-hoist "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browserslist@^4.21.9, browserslist@^4.22.1: + version "4.22.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.1.tgz#ba91958d1a59b87dab6fed8dfbcb3da5e2e9c619" + integrity sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ== + dependencies: + caniuse-lite "^1.0.30001541" + electron-to-chromium "^1.4.535" + node-releases "^2.0.13" + update-browserslist-db "^1.0.13" + +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +builtins@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-5.0.1.tgz#87f6db9ab0458be728564fa81d876d8d74552fa9" + integrity sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ== + dependencies: + semver "^7.0.0" + +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +caniuse-lite@^1.0.30001541: + version "1.0.30001547" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001547.tgz#d4f92efc488aab3c7f92c738d3977c2a3180472b" + integrity sha512-W7CrtIModMAxobGhz8iXmDfuJiiKg1WADMO/9x7/CLNin5cpSbuBjooyoIUVB5eyCc36QuTVlkVa1iB2S5+/eA== + +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== + +ci-info@^3.2.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== + +cjs-module-lexer@^1.0.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" + integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== + +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== + +collect-v8-coverage@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" + integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + +core-js-compat@^3.31.0, core-js-compat@^3.32.2: + version "3.33.0" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.33.0.tgz#24aa230b228406450b2277b7c8bfebae932df966" + integrity sha512-0w4LcLXsVEuNkIqwjjf9rjCoPhK8uqA4tMRh4Ge26vfLtUutshn+aRJU21I9LCJlh2QQHfisNToLjw1XEJLTWw== + dependencies: + browserslist "^4.22.1" + +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" + +cross-spawn@^7.0.2, cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +dedent@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" + integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== + +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + +define-data-property@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.0.tgz#0db13540704e1d8d479a0656cf781267531b9451" + integrity sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + +define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +detect-newline@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== + +diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +dotenv@^16.3.1: + version "16.3.1" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" + integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== + +electron-to-chromium@^1.4.535: + version "1.4.549" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.549.tgz#ab223f5d85c55a9def358db163bc8cacba72df69" + integrity sha512-gpXfJslSi4hYDkA0mTLEpYKRv9siAgSUgZ+UWyk+J5Cttpd1ThCVwdclzIwQSclz3hYn049+M2fgrP1WpvF8xg== + +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.22.1: + version "1.22.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.2.tgz#90f7282d91d0ad577f505e423e52d4c1d93c1b8a" + integrity sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA== + dependencies: + array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.2" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.6" + get-intrinsic "^1.2.1" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.12" + is-weakref "^1.0.2" + object-inspect "^1.12.3" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.1" + safe-array-concat "^1.0.1" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.8" + string.prototype.trimend "^1.0.7" + string.prototype.trimstart "^1.0.7" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.11" + +es-set-tostringtag@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" + +es-shim-unscopables@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" + integrity sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w== + dependencies: + has "^1.0.3" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-standard-with-typescript@^39.1.1: + version "39.1.1" + resolved "https://registry.yarnpkg.com/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-39.1.1.tgz#d682bd1fc8f1ee996940f85c9b0a833d7cfa5fee" + integrity sha512-t6B5Ep8E4I18uuoYeYxINyqcXb2UbC0SOOTxRtBSt2JUs+EzeXbfe2oaiPs71AIdnoWhXDO2fYOHz8df3kV84A== + dependencies: + "@typescript-eslint/parser" "^6.4.0" + eslint-config-standard "17.1.0" + +eslint-config-standard@17.1.0: + version "17.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz#40ffb8595d47a6b242e07cbfd49dc211ed128975" + integrity sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q== + +eslint-import-resolver-node@^0.3.7: + version "0.3.9" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" + integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== + dependencies: + debug "^3.2.7" + is-core-module "^2.13.0" + resolve "^1.22.4" + +eslint-module-utils@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz#e439fee65fc33f6bba630ff621efc38ec0375c49" + integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== + dependencies: + debug "^3.2.7" + +eslint-plugin-es-x@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-es-x/-/eslint-plugin-es-x-7.2.0.tgz#5779d742ad31f8fd780b9481331481e142b72311" + integrity sha512-9dvv5CcvNjSJPqnS5uZkqb3xmbeqRLnvXKK7iI5+oK/yTusyc46zbBZKENGsOfojm/mKfszyZb+wNqNPAPeGXA== + dependencies: + "@eslint-community/eslint-utils" "^4.1.2" + "@eslint-community/regexpp" "^4.6.0" + +eslint-plugin-import@^2.25.2: + version "2.28.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz#63b8b5b3c409bfc75ebaf8fb206b07ab435482c4" + integrity sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A== + dependencies: + array-includes "^3.1.6" + array.prototype.findlastindex "^1.2.2" + array.prototype.flat "^1.3.1" + array.prototype.flatmap "^1.3.1" + debug "^3.2.7" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.7" + eslint-module-utils "^2.8.0" + has "^1.0.3" + is-core-module "^2.13.0" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.fromentries "^2.0.6" + object.groupby "^1.0.0" + object.values "^1.1.6" + semver "^6.3.1" + tsconfig-paths "^3.14.2" + +"eslint-plugin-n@^16.0.0 ": + version "16.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-16.2.0.tgz#3f98ca9fadd9f7bdaaf60068533118ecb685bfb5" + integrity sha512-AQER2jEyQOt1LG6JkGJCCIFotzmlcCZFur2wdKrp1JX2cNotC7Ae0BcD/4lLv3lUAArM9uNS8z/fsvXTd0L71g== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + builtins "^5.0.1" + eslint-plugin-es-x "^7.1.0" + get-tsconfig "^4.7.0" + ignore "^5.2.4" + is-core-module "^2.12.1" + minimatch "^3.1.2" + resolve "^1.22.2" + semver "^7.5.3" + +eslint-plugin-promise@^6.0.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz#269a3e2772f62875661220631bd4dafcb4083816" + integrity sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig== + +eslint-scope@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== + +eslint@^8.0.1: + version "8.51.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.51.0.tgz#4a82dae60d209ac89a5cff1604fea978ba4950f3" + integrity sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.2" + "@eslint/js" "8.51.0" + "@humanwhocodes/config-array" "^0.11.11" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.12.4" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" + esquery "^1.4.2" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + graphemer "^1.4.0" + ignore "^5.2.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.3" + strip-ansi "^6.0.1" + text-table "^0.2.0" + +espree@^9.6.0, espree@^9.6.1: + version "9.6.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== + dependencies: + acorn "^8.9.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.4.1" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== + +expect@^29.0.0, expect@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== + dependencies: + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-glob@^3.2.9: + version "3.3.1" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" + integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastq@^1.6.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + dependencies: + reusify "^1.0.4" + +fb-watchman@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== + dependencies: + bser "2.1.1" + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@^4.0.0, find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat-cache@^3.0.4: + version "3.1.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.1.1.tgz#a02a15fdec25a8f844ff7cc658f03dd99eb4609b" + integrity sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q== + dependencies: + flatted "^3.2.9" + keyv "^4.5.3" + rimraf "^3.0.2" + +flatted@^3.2.9: + version "3.2.9" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" + integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== + +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@^2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +function.prototype.name@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" + +functions-have-names@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-proto "^1.0.1" + has-symbols "^1.0.3" + +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +get-tsconfig@^4.7.0: + version "4.7.2" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.2.tgz#0dcd6fb330391d46332f4c6c1bf89a6514c2ddce" + integrity sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A== + dependencies: + resolve-pkg-maps "^1.0.0" + +glob-parent@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob@^7.1.3, glob@^7.1.4: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globals@^13.19.0: + version "13.23.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.23.0.tgz#ef31673c926a0976e1f61dab4dca57e0c0a8af02" + integrity sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA== + dependencies: + type-fest "^0.20.2" + +globalthis@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + +graceful-fs@^4.2.9: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + +has-bigints@^1.0.1, has-bigints@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + +has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + +has@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.4.tgz#2eb2860e000011dae4f1406a86fe80e530fb2ec6" + integrity sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ== + +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +ignore@^5.2.0, ignore@^5.2.4: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + +import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +import-local@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" + integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +internal-slot@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" + integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== + dependencies: + get-intrinsic "^1.2.0" + has "^1.0.3" + side-channel "^1.0.4" + +is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + +is-core-module@^2.12.1, is-core-module@^2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" + integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== + +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" + +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-typed-array@^1.1.10, is-typed-array@^1.1.12, is-typed-array@^1.1.9: + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + dependencies: + which-typed-array "^1.1.11" + +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" + integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + +istanbul-lib-instrument@^5.0.4: + version "5.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + +istanbul-lib-instrument@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz#71e87707e8041428732518c6fb5211761753fbdf" + integrity sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + +istanbul-lib-report@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^4.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.1.3: + version "3.1.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== + dependencies: + execa "^5.0.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^1.0.0" + is-generator-fn "^2.0.0" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + pretty-format "^29.7.0" + pure-rand "^6.0.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-cli@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== + dependencies: + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + chalk "^4.0.0" + create-jest "^29.7.0" + exit "^0.1.2" + import-local "^3.0.2" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + yargs "^17.3.1" + +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== + dependencies: + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.7.0" + "@jest/types" "^29.6.3" + babel-jest "^29.7.0" + chalk "^4.0.0" + ci-info "^3.2.0" + deepmerge "^4.2.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-json-comments "^3.1.1" + +jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== + dependencies: + detect-newline "^3.0.0" + +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + jest-get-type "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" + +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + jest-util "^29.7.0" + +jest-get-type@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" + integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== + +jest-haste-map@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" + integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== + dependencies: + "@jest/types" "^29.6.3" + "@types/graceful-fs" "^4.1.3" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + jest-worker "^29.7.0" + micromatch "^4.0.4" + walker "^1.0.8" + optionalDependencies: + fsevents "^2.3.2" + +jest-leak-detector@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== + dependencies: + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== + dependencies: + chalk "^4.0.0" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.6.3" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-util "^29.7.0" + +jest-pnp-resolver@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== + +jest-regex-util@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" + integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== + +jest-resolve-dependencies@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== + dependencies: + jest-regex-util "^29.6.3" + jest-snapshot "^29.7.0" + +jest-resolve@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== + dependencies: + chalk "^4.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-pnp-resolver "^1.2.2" + jest-util "^29.7.0" + jest-validate "^29.7.0" + resolve "^1.20.0" + resolve.exports "^2.0.0" + slash "^3.0.0" + +jest-runner@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== + dependencies: + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.13.1" + graceful-fs "^4.2.9" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" + p-limit "^3.1.0" + source-map-support "0.5.13" + +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + strip-bom "^4.0.0" + +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== + dependencies: + "@babel/core" "^7.11.6" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^29.7.0" + graceful-fs "^4.2.9" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + natural-compare "^1.4.0" + pretty-format "^29.7.0" + semver "^7.5.3" + +jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== + dependencies: + "@jest/types" "^29.6.3" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^29.6.3" + leven "^3.1.0" + pretty-format "^29.7.0" + +jest-watcher@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== + dependencies: + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.13.1" + jest-util "^29.7.0" + string-length "^4.0.1" + +jest-worker@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== + dependencies: + "@types/node" "*" + jest-util "^29.7.0" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== + dependencies: + "@jest/core" "^29.7.0" + "@jest/types" "^29.6.3" + import-local "^3.0.2" + jest-cli "^29.7.0" + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + +json5@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== + dependencies: + minimist "^1.2.0" + +json5@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + +keyv@^4.5.3: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + +kleur@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== + dependencies: + tmpl "1.0.5" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, minimist@^1.2.6: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +node-fetch@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== + +node-releases@^2.0.13: + version "2.0.13" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" + integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +object-inspect@^1.12.3, object-inspect@^1.9.0: + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" + object-keys "^1.1.1" + +object.fromentries@^2.0.6: + version "2.0.7" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.7.tgz#71e95f441e9a0ea6baf682ecaaf37fa2a8d7e616" + integrity sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + +object.groupby@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.1.tgz#d41d9f3c8d6c778d9cbac86b4ee9f5af103152ee" + integrity sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + +object.values@^1.1.6: + version "1.1.7" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.7.tgz#617ed13272e7e1071b43973aa1655d9291b8442a" + integrity sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +optionator@^0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" + integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== + dependencies: + "@aashutoshrathi/word-wrap" "^1.2.3" + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2, p-limit@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-json@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pirates@^4.0.4: + version "4.0.6" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== + +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prettier@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" + integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== + +pretty-format@^29.0.0, pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + +prompts@^2.0.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.5" + +punycode@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" + integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + +pure-rand@^6.0.0: + version "6.0.4" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7" + integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +react-is@^18.0.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== + +regenerate-unicode-properties@^10.1.0: + version "10.1.1" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz#6b0e05489d9076b04c436f318d9b067bba459480" + integrity sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q== + dependencies: + regenerate "^1.4.2" + +regenerate@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" + integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== + +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + +regenerator-transform@^0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" + integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== + dependencies: + "@babel/runtime" "^7.8.4" + +regexp.prototype.flags@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + set-function-name "^2.0.0" + +regexpu-core@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" + integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== + dependencies: + "@babel/regjsgen" "^0.8.0" + regenerate "^1.4.2" + regenerate-unicode-properties "^10.1.0" + regjsparser "^0.9.1" + unicode-match-property-ecmascript "^2.0.0" + unicode-match-property-value-ecmascript "^2.1.0" + +regjsparser@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" + integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== + dependencies: + jsesc "~0.5.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve-pkg-maps@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" + integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== + +resolve.exports@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" + integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== + +resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.2, resolve@^1.22.4: + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +safe-array-concat@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c" + integrity sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + has-symbols "^1.0.3" + isarray "^2.0.5" + +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" + +semver@^6.3.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.0.0, semver@^7.5.3, semver@^7.5.4: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + +set-function-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +signal-exit@^3.0.3, signal-exit@^3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +sisteransi@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + +stack-utils@^2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== + dependencies: + escape-string-regexp "^2.0.0" + +string-length@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" + integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== + dependencies: + char-regex "^1.0.2" + strip-ansi "^6.0.0" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string.prototype.trim@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + +string.prototype.trimend@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz#1bb3afc5008661d73e2dc015cd4853732d6c471e" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + +string.prototype.trimstart@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz#d4cdb44b83a4737ffbac2d406e405d43d0184298" + integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + +tmpl@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +ts-api-utils@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" + integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== + +tsconfig-paths@^3.14.2: + version "3.14.2" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" + integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" + integrity sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" + +typescript@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" + integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== + +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== + dependencies: + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" + +undici-types@~5.25.1: + version "5.25.3" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.25.3.tgz#e044115914c85f0bcbb229f346ab739f064998c3" + integrity sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA== + +unicode-canonical-property-names-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" + integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== + +unicode-match-property-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" + integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== + dependencies: + unicode-canonical-property-names-ecmascript "^2.0.0" + unicode-property-aliases-ecmascript "^2.0.0" + +unicode-match-property-value-ecmascript@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" + integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== + +unicode-property-aliases-ecmascript@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" + integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== + +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +v8-to-istanbul@^9.0.1: + version "9.1.3" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz#ea456604101cd18005ac2cae3cdd1aa058a6306b" + integrity sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg== + dependencies: + "@jridgewell/trace-mapping" "^0.3.12" + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^2.0.0" + +walker@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== + dependencies: + makeerror "1.0.12" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-typed-array@^1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" + integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +write-file-atomic@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + +yargs@^17.3.1: + version "17.7.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==