diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b90b2e..e7e01ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,15 +21,15 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/postgrid-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' - name: Set up pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 with: version: '10.30.1' @@ -48,15 +48,15 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' - name: Set up pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 with: version: '10.30.1' @@ -71,7 +71,7 @@ jobs: github.repository == 'stainless-sdks/postgrid-typescript' && !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -90,15 +90,15 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/postgrid-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' - name: Set up pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 with: version: '10.30.1' diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 9ec5152..c756ef3 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -14,15 +14,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1 with: node-version: '20' - name: Set up pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index eb5d784..f5dbb6f 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,11 +12,10 @@ jobs: if: github.repository == 'postgrid/postgrid-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | bash ./bin/check-release-environment env: NPM_TOKEN: ${{ secrets.POSTGRID_NPM_TOKEN || secrets.NPM_TOKEN }} - diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 258342d..bcd0522 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.2" + ".": "0.6.0" } diff --git a/.stats.yml b/.stats.yml index a7354cb..3a2bf15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 87 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/postgrid%2Fpostgrid-be6a47768faf3612d1dc9c8a108edb10a6c5a4e52b78cc7f4768e1d497e11e08.yml -openapi_spec_hash: a3ed2b74031c834a724b67db9ab6b23d -config_hash: 3e6912e5fb40d06f5dc19a10e7b4e703 +configured_endpoints: 119 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/postgrid/postgrid-f236b45c85d9a03ce8a4aa4c457928e4e3d71a1f73a7dda26ec1a3f90b4881f3.yml +openapi_spec_hash: 3562a11137635f5a513f3c1ae8421fda +config_hash: 4429a41bb9161a59679a1a95b1ec7053 diff --git a/CHANGELOG.md b/CHANGELOG.md index 386d943..334fec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 0.6.0 (2026-05-13) + +Full Changelog: [v0.5.2...v0.6.0](https://github.com/postgrid/postgrid-node/compare/v0.5.2...v0.6.0) + +### Features + +* **api:** Generate OpenAPI spec from master, Complete AV endpoints, Deprecate order profiles ([67bb8b7](https://github.com/postgrid/postgrid-node/commit/67bb8b7333288443ffbf34c6de27d086affde747)) +* **api:** sheikh's updates ([1fc2ef8](https://github.com/postgrid/postgrid-node/commit/1fc2ef827f76271263dacb177f3decaae8952f65)) +* support setting headers via env ([4db92ef](https://github.com/postgrid/postgrid-node/commit/4db92ef57767c45c53cef4550eea6677e36b4bf7)) +* Testing new GHA workflow ([08e8358](https://github.com/postgrid/postgrid-node/commit/08e8358dcd5e65f39d0f6d7271351af5211bd23f)) + + +### Chores + +* **format:** run eslint and prettier separately ([cdad39f](https://github.com/postgrid/postgrid-node/commit/cdad39f28d68b35eabe04d8c0b5a6a186aa1e3b4)) +* **formatter:** run prettier and eslint separately ([0e9df35](https://github.com/postgrid/postgrid-node/commit/0e9df3511c18468aa53b59d868a24f7d541a09d1)) +* **internal:** codegen related update ([7fe5def](https://github.com/postgrid/postgrid-node/commit/7fe5def69f1a20ca7a915e4b489ae315d3816478)) +* **internal:** more robust bootstrap script ([c8c6500](https://github.com/postgrid/postgrid-node/commit/c8c6500182176ce3706350b3d10ea47dd0c75f5d)) +* redact api-key headers in debug logs ([0db98d1](https://github.com/postgrid/postgrid-node/commit/0db98d1fb30abbecca2a22afee2a44c397837f32)) + ## 0.5.2 (2026-04-08) Full Changelog: [v0.5.1...v0.5.2](https://github.com/postgrid/postgrid-node/compare/v0.5.1...v0.5.2) diff --git a/api.md b/api.md index bc61056..58089d7 100644 --- a/api.md +++ b/api.md @@ -4,28 +4,137 @@ Types: - Errors - Status +- AddressVerificationAutocompleteResponse +- AddressVerificationBatchVerificationResponse +- AddressVerificationGetAutocompletePreviewsResponse +- AddressVerificationGetLookupInfoResponse +- AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse +- AddressVerificationLookupZipCodeFromCityOrStateResponse +- AddressVerificationParseAnAddressResponse +- AddressVerificationSuggestAddressesResponse - AddressVerificationVerifyResponse Methods: +- client.addressVerification.autocomplete({ ...params }) -> AddressVerificationAutocompleteResponse +- client.addressVerification.batchVerification({ ...params }) -> AddressVerificationBatchVerificationResponse +- client.addressVerification.getAutocompletePreviews({ ...params }) -> AddressVerificationGetAutocompletePreviewsResponse +- client.addressVerification.getLookupInfo() -> AddressVerificationGetLookupInfoResponse +- client.addressVerification.lookupCityOrStateFromPostalOrZipCode({ ...params }) -> AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse +- client.addressVerification.lookupZipCodeFromCityOrState({ ...params }) -> AddressVerificationLookupZipCodeFromCityOrStateResponse +- client.addressVerification.parseAnAddress({ ...params }) -> AddressVerificationParseAnAddressResponse +- client.addressVerification.suggestAddresses({ ...params }) -> AddressVerificationSuggestAddressesResponse - client.addressVerification.verify({ ...params }) -> AddressVerificationVerifyResponse # IntlAddressVerification Types: +- IntlAddressVerificationAutocompleteResponse +- IntlAddressVerificationBatchVerificationResponse +- IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse +- IntlAddressVerificationGetAutocompletePreviewsResponse - IntlAddressVerificationVerifyResponse Methods: +- client.intlAddressVerification.autocomplete({ ...params }) -> IntlAddressVerificationAutocompleteResponse +- client.intlAddressVerification.batchVerification({ ...params }) -> IntlAddressVerificationBatchVerificationResponse +- client.intlAddressVerification.getAutocompleteAdvancedPreviews({ ...params }) -> IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse +- client.intlAddressVerification.getAutocompletePreviews({ ...params }) -> IntlAddressVerificationGetAutocompletePreviewsResponse - client.intlAddressVerification.verify({ ...params }) -> IntlAddressVerificationVerifyResponse # PrintMail +## Contacts + +Types: + +- Contact +- ContactCreate +- ContactCreateWithCompanyName +- ContactCreateWithFirstName +- ContactDeleteResponse + +Methods: + +- client.printMail.contacts.create({ ...params }) -> Contact +- client.printMail.contacts.retrieve(id) -> Contact +- client.printMail.contacts.list({ ...params }) -> ContactsSkipLimit +- client.printMail.contacts.delete(id) -> ContactDeleteResponse + +## Templates + +Types: + +- Template +- TemplateDeleteResponse + +Methods: + +- client.printMail.templates.create({ ...params }) -> Template +- client.printMail.templates.retrieve(id) -> Template +- client.printMail.templates.update(id, { ...params }) -> Template +- client.printMail.templates.list({ ...params }) -> TemplatesSkipLimit +- client.printMail.templates.delete(id) -> TemplateDeleteResponse + +## Trackers + +Types: + +- TrackerCreateResponse +- TrackerRetrieveResponse +- TrackerUpdateResponse +- TrackerListResponse +- TrackerDeleteResponse +- TrackerRetrieveVisitsResponse + +Methods: + +- client.printMail.trackers.create({ ...params }) -> TrackerCreateResponse +- client.printMail.trackers.retrieve(id) -> TrackerRetrieveResponse +- client.printMail.trackers.update(id, { ...params }) -> TrackerUpdateResponse +- client.printMail.trackers.list({ ...params }) -> TrackerListResponsesSkipLimit +- client.printMail.trackers.delete(id) -> TrackerDeleteResponse +- client.printMail.trackers.retrieveVisits(id, { ...params }) -> TrackerRetrieveVisitsResponsesSkipLimit + +## Letters + +Types: + +- AddressPlacement +- AttachedPdf +- Letter +- LetterSize +- PlasticCard +- LetterRetrieveURLResponse + +Methods: + +- client.printMail.letters.create({ ...params }) -> Letter +- client.printMail.letters.retrieve(id) -> Letter +- client.printMail.letters.list({ ...params }) -> LettersSkipLimit +- client.printMail.letters.delete(id) -> Letter +- client.printMail.letters.cancel(id, { ...params }) -> Letter +- client.printMail.letters.progress(id) -> Letter +- client.printMail.letters.retrieveURL(id) -> LetterRetrieveURLResponse + +## Postcards + Types: -- ContactCreateWithCompanyName -- ContactCreateWithFirstName +- Postcard +- PostcardRetrieveURLResponse + +Methods: + +- client.printMail.postcards.create({ ...params }) -> Postcard +- client.printMail.postcards.retrieve(id) -> Postcard +- client.printMail.postcards.list({ ...params }) -> PostcardsSkipLimit +- client.printMail.postcards.delete(id) -> Postcard +- client.printMail.postcards.cancel(id, { ...params }) -> Postcard +- client.printMail.postcards.progress(id) -> Postcard +- client.printMail.postcards.retrieveURL(id) -> PostcardRetrieveURLResponse ## BankAccounts @@ -42,22 +151,6 @@ Methods: - client.printMail.bankAccounts.list({ ...params }) -> BankAccountsSkipLimit - client.printMail.bankAccounts.delete(id) -> BankAccountDeleteResponse -## Campaigns - -Types: - -- Campaign -- CampaignDeleteResponse - -Methods: - -- client.printMail.campaigns.create({ ...params }) -> Campaign -- client.printMail.campaigns.retrieve(id) -> Campaign -- client.printMail.campaigns.update(id, { ...params }) -> Campaign -- client.printMail.campaigns.list({ ...params }) -> CampaignsSkipLimit -- client.printMail.campaigns.delete(id) -> CampaignDeleteResponse -- client.printMail.campaigns.send(id, { ...params }) -> Campaign - ## Cheques Types: @@ -73,42 +166,42 @@ Methods: - client.printMail.cheques.retrieve(id) -> Cheque - client.printMail.cheques.list({ ...params }) -> ChequesSkipLimit - client.printMail.cheques.delete(id) -> Cheque +- client.printMail.cheques.cancel(id, { ...params }) -> Cheque +- client.printMail.cheques.progress(id) -> Cheque - client.printMail.cheques.retrieveURL(id) -> ChequeRetrieveURLResponse - client.printMail.cheques.retrieveWithDepositReadyPdf(id) -> Cheque -## Contacts +## SelfMailers Types: -- Contact -- ContactCreate -- ContactDeleteResponse +- SelfMailer +- SelfMailerRetrieveURLResponse Methods: -- client.printMail.contacts.create({ ...params }) -> Contact -- client.printMail.contacts.retrieve(id) -> Contact -- client.printMail.contacts.list({ ...params }) -> ContactsSkipLimit -- client.printMail.contacts.delete(id) -> ContactDeleteResponse +- client.printMail.selfMailers.create({ ...params }) -> SelfMailer +- client.printMail.selfMailers.retrieve(id) -> SelfMailer +- client.printMail.selfMailers.list({ ...params }) -> SelfMailersSkipLimit +- client.printMail.selfMailers.delete(id) -> SelfMailer +- client.printMail.selfMailers.progress(id) -> SelfMailer +- client.printMail.selfMailers.retrieveURL(id) -> SelfMailerRetrieveURLResponse -## Letters +## Campaigns Types: -- AddressPlacement -- AttachedPdf -- Letter -- LetterSize -- PlasticCard -- LetterRetrieveURLResponse +- Campaign +- CampaignDeleteResponse Methods: -- client.printMail.letters.create({ ...params }) -> Letter -- client.printMail.letters.retrieve(id) -> Letter -- client.printMail.letters.list({ ...params }) -> LettersSkipLimit -- client.printMail.letters.delete(id) -> Letter -- client.printMail.letters.retrieveURL(id) -> LetterRetrieveURLResponse +- client.printMail.campaigns.create({ ...params }) -> Campaign +- client.printMail.campaigns.retrieve(id) -> Campaign +- client.printMail.campaigns.update(id, { ...params }) -> Campaign +- client.printMail.campaigns.list({ ...params }) -> CampaignsSkipLimit +- client.printMail.campaigns.delete(id) -> CampaignDeleteResponse +- client.printMail.campaigns.send(id, { ...params }) -> Campaign ## MailingListImports @@ -144,168 +237,169 @@ Methods: - client.printMail.mailingLists.delete(id) -> MailingListDeleteResponse - client.printMail.mailingLists.jobs(id, { ...params }) -> MailingList -## OrderProfiles - -### Cheques +## Reports Types: -- ChequeProfile -- CurrencyCode -- ChequeListResponse -- ChequeDeleteResponse +- DeletedResponse +- Report Methods: -- client.printMail.orderProfiles.cheques.create({ ...params }) -> ChequeProfile -- client.printMail.orderProfiles.cheques.retrieve(id, { ...params }) -> ChequeProfile -- client.printMail.orderProfiles.cheques.update(id, { ...params }) -> ChequeProfile -- client.printMail.orderProfiles.cheques.list({ ...params }) -> ChequeListResponsesSkipLimit -- client.printMail.orderProfiles.cheques.delete(id) -> ChequeDeleteResponse +- client.printMail.reports.create({ ...params }) -> Report +- client.printMail.reports.retrieve(id) -> Report +- client.printMail.reports.update(id, { ...params }) -> Report +- client.printMail.reports.list({ ...params }) -> ReportsSkipLimit +- client.printMail.reports.delete(id) -> DeletedResponse +- client.printMail.reports.sample({ ...params }) -> ReportSample -### Letters +### Samples Types: -- LetterProfile -- LetterDeleteResponse +- ReportSample +- ReportSampleCreateBase Methods: -- client.printMail.orderProfiles.letters.create({ ...params }) -> LetterProfile -- client.printMail.orderProfiles.letters.retrieve(id, { ...params }) -> LetterProfile -- client.printMail.orderProfiles.letters.update(id, { ...params }) -> LetterProfile -- client.printMail.orderProfiles.letters.list({ ...params }) -> LetterProfilesSkipLimit -- client.printMail.orderProfiles.letters.delete(id) -> LetterDeleteResponse +- client.printMail.reports.samples.create(id, { ...params }) -> ReportSample -### Postcards +### Exports Types: -- PostcardProfile -- PostcardSize -- PostcardDeleteResponse +- ReportExport Methods: -- client.printMail.orderProfiles.postcards.create({ ...params }) -> PostcardProfile -- client.printMail.orderProfiles.postcards.retrieve(id, { ...params }) -> PostcardProfile -- client.printMail.orderProfiles.postcards.update(id, { ...params }) -> PostcardProfile -- client.printMail.orderProfiles.postcards.list({ ...params }) -> PostcardProfilesSkipLimit -- client.printMail.orderProfiles.postcards.delete(id) -> PostcardDeleteResponse +- client.printMail.reports.exports.create(reportID, { ...params }) -> ReportExport +- client.printMail.reports.exports.retrieve(exportID, { ...params }) -> ReportExport +- client.printMail.reports.exports.delete(exportID, { ...params }) -> DeletedResponse -### SelfMailers +## SubOrganizations Types: -- SelfMailerProfile -- SelfMailerSize -- SelfMailerDeleteResponse +- EmailPreferences +- SubOrganization +- SubOrganizationCreateResponse +- SubOrganizationRetrieveUsersResponse Methods: -- client.printMail.orderProfiles.selfMailers.create({ ...params }) -> SelfMailerProfile -- client.printMail.orderProfiles.selfMailers.retrieve(id, { ...params }) -> SelfMailerProfile -- client.printMail.orderProfiles.selfMailers.update(id, { ...params }) -> SelfMailerProfile -- client.printMail.orderProfiles.selfMailers.list({ ...params }) -> SelfMailerProfilesSkipLimit -- client.printMail.orderProfiles.selfMailers.delete(id) -> SelfMailerDeleteResponse +- client.printMail.subOrganizations.create({ ...params }) -> SubOrganizationCreateResponse +- client.printMail.subOrganizations.retrieve(id) -> SubOrganization +- client.printMail.subOrganizations.list({ ...params }) -> SubOrganizationsSkipLimit +- client.printMail.subOrganizations.retrieveUsers(id, { ...params }) -> SubOrganizationRetrieveUsersResponse -## Postcards +## Boxes Types: -- Postcard -- PostcardRetrieveURLResponse +- BoxCreateResponse +- BoxRetrieveResponse +- BoxListResponse +- BoxDeleteResponse +- BoxProgressionsResponse Methods: -- client.printMail.postcards.create({ ...params }) -> Postcard -- client.printMail.postcards.retrieve(id) -> Postcard -- client.printMail.postcards.list({ ...params }) -> PostcardsSkipLimit -- client.printMail.postcards.delete(id) -> Postcard -- client.printMail.postcards.retrieveURL(id) -> PostcardRetrieveURLResponse +- client.printMail.boxes.create({ ...params }) -> BoxCreateResponse +- client.printMail.boxes.retrieve(id) -> BoxRetrieveResponse +- client.printMail.boxes.list({ ...params }) -> BoxListResponsesSkipLimit +- client.printMail.boxes.delete(id) -> BoxDeleteResponse +- client.printMail.boxes.progressions(id) -> BoxProgressionsResponse -## Reports +## SnapPacks Types: -- DeletedResponse -- Report +- SnapPackCreateResponse +- SnapPackRetrieveResponse +- SnapPackListResponse +- SnapPackDeleteResponse +- SnapPackProgressionsResponse +- SnapPackRetrieveCapabilitiesResponse Methods: -- client.printMail.reports.create({ ...params }) -> Report -- client.printMail.reports.retrieve(id) -> Report -- client.printMail.reports.update(id, { ...params }) -> Report -- client.printMail.reports.list({ ...params }) -> ReportsSkipLimit -- client.printMail.reports.delete(id) -> DeletedResponse -- client.printMail.reports.sample({ ...params }) -> ReportSample +- client.printMail.snapPacks.create({ ...params }) -> SnapPackCreateResponse +- client.printMail.snapPacks.retrieve(id) -> SnapPackRetrieveResponse +- client.printMail.snapPacks.list({ ...params }) -> SnapPackListResponsesSkipLimit +- client.printMail.snapPacks.delete(id) -> SnapPackDeleteResponse +- client.printMail.snapPacks.progressions(id) -> SnapPackProgressionsResponse +- client.printMail.snapPacks.retrieveCapabilities({ ...params }) -> SnapPackRetrieveCapabilitiesResponse -### Samples +## TargetedListBuilds Types: -- ReportSample -- ReportSampleCreateBase +- TargetedListBuildCreateResponse +- TargetedListBuildRetrieveResponse +- TargetedListBuildUpdateResponse +- TargetedListBuildListResponse +- TargetedListBuildDeleteResponse +- TargetedListBuildConfirmResponse Methods: -- client.printMail.reports.samples.create(id, { ...params }) -> ReportSample +- client.printMail.targetedListBuilds.create({ ...params }) -> TargetedListBuildCreateResponse +- client.printMail.targetedListBuilds.retrieve(id) -> TargetedListBuildRetrieveResponse +- client.printMail.targetedListBuilds.update(id, { ...params }) -> TargetedListBuildUpdateResponse +- client.printMail.targetedListBuilds.list({ ...params }) -> TargetedListBuildListResponsesSkipLimit +- client.printMail.targetedListBuilds.delete(id) -> TargetedListBuildDeleteResponse +- client.printMail.targetedListBuilds.confirm(id) -> TargetedListBuildConfirmResponse -### Exports +### Filters Types: -- ReportExport +- FilterAutocompleteResponse Methods: -- client.printMail.reports.exports.create(reportID, { ...params }) -> ReportExport -- client.printMail.reports.exports.retrieve(exportID, { ...params }) -> ReportExport -- client.printMail.reports.exports.delete(exportID, { ...params }) -> DeletedResponse +- client.printMail.targetedListBuilds.filters.autocomplete({ ...params }) -> FilterAutocompleteResponse -## SelfMailers +## TemplateEditorSessions Types: -- SelfMailer -- SelfMailerRetrieveURLResponse +- TemplateEditorSessionCreateResponse +- TemplateEditorSessionListResponse +- TemplateEditorSessionDeleteResponse Methods: -- client.printMail.selfMailers.create({ ...params }) -> SelfMailer -- client.printMail.selfMailers.retrieve(id) -> SelfMailer -- client.printMail.selfMailers.list({ ...params }) -> SelfMailersSkipLimit -- client.printMail.selfMailers.delete(id) -> SelfMailer -- client.printMail.selfMailers.retrieveURL(id) -> SelfMailerRetrieveURLResponse +- client.printMail.templateEditorSessions.create({ ...params }) -> TemplateEditorSessionCreateResponse +- client.printMail.templateEditorSessions.list({ ...params }) -> TemplateEditorSessionListResponsesSkipLimit +- client.printMail.templateEditorSessions.delete(id) -> TemplateEditorSessionDeleteResponse -## SubOrganizations +## VirtualMailboxes Types: -- EmailPreferences -- SubOrganization -- SubOrganizationUpdateResponse -- SubOrganizationRetrieveUsersResponse +- VirtualMailboxCreateResponse +- VirtualMailboxRetrieveResponse +- VirtualMailboxListResponse +- VirtualMailboxRetrieveAddressResponse Methods: -- client.printMail.subOrganizations.retrieve(id) -> SubOrganization -- client.printMail.subOrganizations.update({ ...params }) -> SubOrganizationUpdateResponse -- client.printMail.subOrganizations.list({ ...params }) -> SubOrganizationsSkipLimit -- client.printMail.subOrganizations.retrieveUsers(id, { ...params }) -> SubOrganizationRetrieveUsersResponse +- client.printMail.virtualMailboxes.create({ ...params }) -> VirtualMailboxCreateResponse +- client.printMail.virtualMailboxes.retrieve(id) -> VirtualMailboxRetrieveResponse +- client.printMail.virtualMailboxes.list({ ...params }) -> VirtualMailboxListResponsesSkipLimit +- client.printMail.virtualMailboxes.retrieveAddress(id) -> VirtualMailboxRetrieveAddressResponse -## Templates +### Items Types: -- Template -- TemplateDeleteResponse +- ItemCreateResponse +- ItemRetrieveResponse +- ItemListResponse Methods: -- client.printMail.templates.create({ ...params }) -> Template -- client.printMail.templates.retrieve(id) -> Template -- client.printMail.templates.update(id, { ...params }) -> Template -- client.printMail.templates.list({ ...params }) -> TemplatesSkipLimit -- client.printMail.templates.delete(id) -> TemplateDeleteResponse +- client.printMail.virtualMailboxes.items.create(id, { ...params }) -> ItemCreateResponse +- client.printMail.virtualMailboxes.items.retrieve(itemID, { ...params }) -> ItemRetrieveResponse +- client.printMail.virtualMailboxes.items.list(id, { ...params }) -> ItemListResponsesSkipLimit diff --git a/eslint.config.mjs b/eslint.config.mjs index 47bba68..a8cadf1 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,7 +1,6 @@ // @ts-check import tseslint from 'typescript-eslint'; import unusedImports from 'eslint-plugin-unused-imports'; -import prettier from 'eslint-plugin-prettier'; export default tseslint.config( { @@ -14,11 +13,9 @@ export default tseslint.config( plugins: { '@typescript-eslint': tseslint.plugin, 'unused-imports': unusedImports, - prettier, }, rules: { 'no-unused-vars': 'off', - 'prettier/prettier': 'error', 'unused-imports/no-unused-imports': 'error', 'no-restricted-imports': [ 'error', diff --git a/package.json b/package.json index 4a2d3e2..285d693 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postgrid-node", - "version": "0.5.2", + "version": "0.6.0", "description": "The official TypeScript library for the PostGrid API", "author": "PostGrid ", "types": "dist/index.d.ts", @@ -36,7 +36,6 @@ "@typescript-eslint/eslint-plugin": "8.31.1", "@typescript-eslint/parser": "8.31.1", "eslint": "^9.39.1", - "eslint-plugin-prettier": "^5.4.1", "eslint-plugin-unused-imports": "^4.1.4", "iconv-lite": "^0.6.3", "jest": "^29.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c2b6b50..0540538 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,7 +8,6 @@ overrides: minimatch: ^9.0.5 importers: - .: devDependencies: '@arethetypeswrong/cli': @@ -35,9 +34,6 @@ importers: eslint: specifier: ^9.39.1 version: 9.39.1 - eslint-plugin-prettier: - specifier: ^5.4.1 - version: 5.4.1(eslint@9.39.1)(prettier@3.1.1) eslint-plugin-unused-imports: specifier: ^4.1.4 version: 4.1.4(@typescript-eslint/eslint-plugin@8.31.1(@typescript-eslint/parser@8.31.1(eslint@9.39.1)(typescript@5.8.3))(eslint@9.39.1)(typescript@5.8.3))(eslint@9.39.1) @@ -76,275 +72,454 @@ importers: version: 8.31.1(eslint@9.39.1)(typescript@5.8.3) packages: - '@andrewbranch/untar.js@1.0.3': - resolution: {integrity: sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw==} + resolution: + { + integrity: sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw==, + } '@arethetypeswrong/cli@0.17.0': - resolution: {integrity: sha512-xSMW7bfzVWpYw5JFgZqBXqr6PdR0/REmn3DkxCES5N0JTcB0CVgbIynJCvKBFmXaPc3hzmmTrb7+yPDRoOSZdA==} - engines: {node: '>=18'} + resolution: + { + integrity: sha512-xSMW7bfzVWpYw5JFgZqBXqr6PdR0/REmn3DkxCES5N0JTcB0CVgbIynJCvKBFmXaPc3hzmmTrb7+yPDRoOSZdA==, + } + engines: { node: '>=18' } hasBin: true '@arethetypeswrong/core@0.17.0': - resolution: {integrity: sha512-FHyhFizXNetigTVsIhqXKGYLpazPS5YNojEPpZEUcBPt9wVvoEbNIvG+hybuBR+pjlRcbyuqhukHZm1fr+bDgA==} - engines: {node: '>=18'} + resolution: + { + integrity: sha512-FHyhFizXNetigTVsIhqXKGYLpazPS5YNojEPpZEUcBPt9wVvoEbNIvG+hybuBR+pjlRcbyuqhukHZm1fr+bDgA==, + } + engines: { node: '>=18' } '@babel/code-frame@7.28.6': - resolution: {integrity: sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q==, + } + engines: { node: '>=6.9.0' } '@babel/compat-data@7.28.6': - resolution: {integrity: sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg==, + } + engines: { node: '>=6.9.0' } '@babel/core@7.28.6': - resolution: {integrity: sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw==, + } + engines: { node: '>=6.9.0' } '@babel/generator@7.28.6': - resolution: {integrity: sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw==, + } + engines: { node: '>=6.9.0' } '@babel/helper-compilation-targets@7.28.6': - resolution: {integrity: sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==, + } + engines: { node: '>=6.9.0' } '@babel/helper-globals@7.28.0': - resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==, + } + engines: { node: '>=6.9.0' } '@babel/helper-module-imports@7.28.6': - resolution: {integrity: sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==, + } + engines: { node: '>=6.9.0' } '@babel/helper-module-transforms@7.28.6': - resolution: {integrity: sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==, + } + engines: { node: '>=6.9.0' } peerDependencies: '@babel/core': ^7.0.0 '@babel/helper-plugin-utils@7.28.6': - resolution: {integrity: sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==, + } + engines: { node: '>=6.9.0' } '@babel/helper-string-parser@7.27.1': - resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==, + } + engines: { node: '>=6.9.0' } '@babel/helper-validator-identifier@7.28.5': - resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==, + } + engines: { node: '>=6.9.0' } '@babel/helper-validator-option@7.27.1': - resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==, + } + engines: { node: '>=6.9.0' } '@babel/helpers@7.28.6': - resolution: {integrity: sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==, + } + engines: { node: '>=6.9.0' } '@babel/parser@7.28.6': - resolution: {integrity: sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==} - engines: {node: '>=6.0.0'} + resolution: + { + integrity: sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==, + } + engines: { node: '>=6.0.0' } hasBin: true '@babel/plugin-syntax-async-generators@7.8.4': - resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + resolution: + { + integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-bigint@7.8.3': - resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + resolution: + { + integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-class-properties@7.12.13': - resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + resolution: + { + integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-class-static-block@7.14.5': - resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==, + } + engines: { node: '>=6.9.0' } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-import-attributes@7.28.6': - resolution: {integrity: sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==, + } + engines: { node: '>=6.9.0' } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-import-meta@7.10.4': - resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + resolution: + { + integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-json-strings@7.8.3': - resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + resolution: + { + integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-jsx@7.28.6': - resolution: {integrity: sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==, + } + engines: { node: '>=6.9.0' } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-logical-assignment-operators@7.10.4': - resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + resolution: + { + integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': - resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + resolution: + { + integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-numeric-separator@7.10.4': - resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + resolution: + { + integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-object-rest-spread@7.8.3': - resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + resolution: + { + integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-optional-catch-binding@7.8.3': - resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + resolution: + { + integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-optional-chaining@7.8.3': - resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + resolution: + { + integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==, + } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-private-property-in-object@7.14.5': - resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==, + } + engines: { node: '>=6.9.0' } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-top-level-await@7.14.5': - resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==, + } + engines: { node: '>=6.9.0' } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-syntax-typescript@7.28.6': - resolution: {integrity: sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==, + } + engines: { node: '>=6.9.0' } peerDependencies: '@babel/core': ^7.0.0-0 '@babel/template@7.28.6': - resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==, + } + engines: { node: '>=6.9.0' } '@babel/traverse@7.28.6': - resolution: {integrity: sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg==, + } + engines: { node: '>=6.9.0' } '@babel/types@7.28.6': - resolution: {integrity: sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==, + } + engines: { node: '>=6.9.0' } '@bcoe/v8-coverage@0.2.3': - resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + resolution: + { + integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==, + } '@colors/colors@1.5.0': - resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} - engines: {node: '>=0.1.90'} + resolution: + { + integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==, + } + engines: { node: '>=0.1.90' } '@cspotcode/source-map-consumer@0.8.0': - resolution: {integrity: sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==} - engines: {node: '>= 12'} + resolution: + { + integrity: sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==, + } + engines: { node: '>= 12' } '@cspotcode/source-map-support@0.7.0': - resolution: {integrity: sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==} - engines: {node: '>=12'} + resolution: + { + integrity: sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==, + } + engines: { node: '>=12' } '@eslint-community/eslint-utils@4.4.0': - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + resolution: + { + integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 '@eslint-community/eslint-utils@4.9.0': - resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + resolution: + { + integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 '@eslint-community/regexpp@4.12.1': - resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + resolution: + { + integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==, + } + engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 } '@eslint-community/regexpp@4.12.2': - resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + resolution: + { + integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==, + } + engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 } '@eslint/config-array@0.21.1': - resolution: {integrity: sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } '@eslint/config-helpers@0.4.2': - resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } '@eslint/core@0.17.0': - resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } '@eslint/eslintrc@3.3.3': - resolution: {integrity: sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } '@eslint/js@9.39.1': - resolution: {integrity: sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } '@eslint/object-schema@2.1.7': - resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } '@eslint/plugin-kit@0.4.1': - resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } '@humanfs/core@0.19.1': - resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} - engines: {node: '>=18.18.0'} + resolution: + { + integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==, + } + engines: { node: '>=18.18.0' } '@humanfs/node@0.16.7': - resolution: {integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==} - engines: {node: '>=18.18.0'} + resolution: + { + integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==, + } + engines: { node: '>=18.18.0' } '@humanwhocodes/module-importer@1.0.1': - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} + resolution: + { + integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==, + } + engines: { node: '>=12.22' } '@humanwhocodes/retry@0.4.3': - resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} - engines: {node: '>=18.18'} + resolution: + { + integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==, + } + engines: { node: '>=18.18' } '@istanbuljs/load-nyc-config@1.1.0': - resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==, + } + engines: { node: '>=8' } '@istanbuljs/schema@0.1.3': - resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==, + } + engines: { node: '>=8' } '@jest/console@29.7.0': - resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/core@29.7.0': - resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 peerDependenciesMeta: @@ -352,32 +527,53 @@ packages: optional: true '@jest/create-cache-key-function@29.7.0': - resolution: {integrity: sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/environment@29.7.0': - resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/expect-utils@29.7.0': - resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/expect@29.7.0': - resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/fake-timers@29.7.0': - resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/globals@29.7.0': - resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/reporters@29.7.0': - resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 peerDependenciesMeta: @@ -385,147 +581,236 @@ packages: optional: true '@jest/schemas@29.6.3': - resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/source-map@29.6.3': - resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/test-result@29.7.0': - resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/test-sequencer@29.7.0': - resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/transform@29.7.0': - resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jest/types@29.6.3': - resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } '@jridgewell/gen-mapping@0.3.13': - resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + resolution: + { + integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==, + } '@jridgewell/remapping@2.3.5': - resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + resolution: + { + integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==, + } '@jridgewell/resolve-uri@3.1.1': - resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} - engines: {node: '>=6.0.0'} + resolution: + { + integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==, + } + engines: { node: '>=6.0.0' } '@jridgewell/sourcemap-codec@1.4.15': - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + resolution: + { + integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==, + } '@jridgewell/sourcemap-codec@1.5.5': - resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + resolution: + { + integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==, + } '@jridgewell/trace-mapping@0.3.20': - resolution: {integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==} + resolution: + { + integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==, + } '@jridgewell/trace-mapping@0.3.31': - resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + resolution: + { + integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==, + } '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} + resolution: + { + integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==, + } + engines: { node: '>= 8' } '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} + resolution: + { + integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==, + } + engines: { node: '>= 8' } '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@pkgr/core@0.2.4': - resolution: {integrity: sha512-ROFF39F6ZrnzSUEmQQZUar0Jt4xVoP9WnDRdWwF4NNcXs3xBTLgBUDoOwW141y1jP+S8nahIbdxbFC7IShw9Iw==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + resolution: + { + integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==, + } + engines: { node: '>= 8' } '@sinclair/typebox@0.27.8': - resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + resolution: + { + integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==, + } '@sindresorhus/is@4.6.0': - resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==, + } + engines: { node: '>=10' } '@sinonjs/commons@3.0.0': - resolution: {integrity: sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==} + resolution: + { + integrity: sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==, + } '@sinonjs/fake-timers@10.3.0': - resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + resolution: + { + integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==, + } '@swc/core-darwin-arm64@1.4.16': - resolution: {integrity: sha512-UOCcH1GvjRnnM/LWT6VCGpIk0OhHRq6v1U6QXuPt5wVsgXnXQwnf5k3sG5Cm56hQHDvhRPY6HCsHi/p0oek8oQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-UOCcH1GvjRnnM/LWT6VCGpIk0OhHRq6v1U6QXuPt5wVsgXnXQwnf5k3sG5Cm56hQHDvhRPY6HCsHi/p0oek8oQ==, + } + engines: { node: '>=10' } cpu: [arm64] os: [darwin] '@swc/core-darwin-x64@1.4.16': - resolution: {integrity: sha512-t3bgqFoYLWvyVtVL6KkFNCINEoOrIlyggT/kJRgi1y0aXSr0oVgcrQ4ezJpdeahZZ4N+Q6vT3ffM30yIunELNA==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-t3bgqFoYLWvyVtVL6KkFNCINEoOrIlyggT/kJRgi1y0aXSr0oVgcrQ4ezJpdeahZZ4N+Q6vT3ffM30yIunELNA==, + } + engines: { node: '>=10' } cpu: [x64] os: [darwin] '@swc/core-linux-arm-gnueabihf@1.4.16': - resolution: {integrity: sha512-DvHuwvEF86YvSd0lwnzVcjOTZ0jcxewIbsN0vc/0fqm9qBdMMjr9ox6VCam1n3yYeRtj4VFgrjeNFksqbUejdQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-DvHuwvEF86YvSd0lwnzVcjOTZ0jcxewIbsN0vc/0fqm9qBdMMjr9ox6VCam1n3yYeRtj4VFgrjeNFksqbUejdQ==, + } + engines: { node: '>=10' } cpu: [arm] os: [linux] '@swc/core-linux-arm64-gnu@1.4.16': - resolution: {integrity: sha512-9Uu5YlPbyCvbidjKtYEsPpyZlu16roOZ5c2tP1vHfnU9bgf5Tz5q5VovSduNxPHx+ed2iC1b1URODHvDzbbDuQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-9Uu5YlPbyCvbidjKtYEsPpyZlu16roOZ5c2tP1vHfnU9bgf5Tz5q5VovSduNxPHx+ed2iC1b1URODHvDzbbDuQ==, + } + engines: { node: '>=10' } cpu: [arm64] os: [linux] libc: [glibc] '@swc/core-linux-arm64-musl@1.4.16': - resolution: {integrity: sha512-/YZq/qB1CHpeoL0eMzyqK5/tYZn/rzKoCYDviFU4uduSUIJsDJQuQA/skdqUzqbheOXKAd4mnJ1hT04RbJ8FPQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-/YZq/qB1CHpeoL0eMzyqK5/tYZn/rzKoCYDviFU4uduSUIJsDJQuQA/skdqUzqbheOXKAd4mnJ1hT04RbJ8FPQ==, + } + engines: { node: '>=10' } cpu: [arm64] os: [linux] libc: [musl] '@swc/core-linux-x64-gnu@1.4.16': - resolution: {integrity: sha512-UUjaW5VTngZYDcA8yQlrFmqs1tLi1TxbKlnaJwoNhel9zRQ0yG1YEVGrzTvv4YApSuIiDK18t+Ip927bwucuVQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-UUjaW5VTngZYDcA8yQlrFmqs1tLi1TxbKlnaJwoNhel9zRQ0yG1YEVGrzTvv4YApSuIiDK18t+Ip927bwucuVQ==, + } + engines: { node: '>=10' } cpu: [x64] os: [linux] libc: [glibc] '@swc/core-linux-x64-musl@1.4.16': - resolution: {integrity: sha512-aFhxPifevDTwEDKPi4eRYWzC0p/WYJeiFkkpNU5Uc7a7M5iMWPAbPFUbHesdlb9Jfqs5c07oyz86u+/HySBNPQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-aFhxPifevDTwEDKPi4eRYWzC0p/WYJeiFkkpNU5Uc7a7M5iMWPAbPFUbHesdlb9Jfqs5c07oyz86u+/HySBNPQ==, + } + engines: { node: '>=10' } cpu: [x64] os: [linux] libc: [musl] '@swc/core-win32-arm64-msvc@1.4.16': - resolution: {integrity: sha512-bTD43MbhIHL2s5QgCwyleaGwl96Gk/scF2TaVKdUe4QlJCDV/YK9h5oIBAp63ckHtE8GHlH4c8dZNBiAXn4Org==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-bTD43MbhIHL2s5QgCwyleaGwl96Gk/scF2TaVKdUe4QlJCDV/YK9h5oIBAp63ckHtE8GHlH4c8dZNBiAXn4Org==, + } + engines: { node: '>=10' } cpu: [arm64] os: [win32] '@swc/core-win32-ia32-msvc@1.4.16': - resolution: {integrity: sha512-/lmZeAN/qV5XbK2SEvi8e2RkIg8FQNYiSA8y2/Zb4gTUMKVO5JMLH0BSWMiIKMstKDPDSxMWgwJaQHF8UMyPmQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-/lmZeAN/qV5XbK2SEvi8e2RkIg8FQNYiSA8y2/Zb4gTUMKVO5JMLH0BSWMiIKMstKDPDSxMWgwJaQHF8UMyPmQ==, + } + engines: { node: '>=10' } cpu: [ia32] os: [win32] '@swc/core-win32-x64-msvc@1.4.16': - resolution: {integrity: sha512-BPAfFfODWXtUu6SwaTTftDHvcbDyWBSI/oanUeRbQR5vVWkXoQ3cxLTsDluc3H74IqXS5z1Uyoe0vNo2hB1opA==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-BPAfFfODWXtUu6SwaTTftDHvcbDyWBSI/oanUeRbQR5vVWkXoQ3cxLTsDluc3H74IqXS5z1Uyoe0vNo2hB1opA==, + } + engines: { node: '>=10' } cpu: [x64] os: [win32] '@swc/core@1.4.16': - resolution: {integrity: sha512-Xaf+UBvW6JNuV131uvSNyMXHn+bh6LyKN4tbv7tOUFQpXyz/t9YWRE04emtlUW9Y0qrm/GKFCbY8n3z6BpZbTA==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-Xaf+UBvW6JNuV131uvSNyMXHn+bh6LyKN4tbv7tOUFQpXyz/t9YWRE04emtlUW9Y0qrm/GKFCbY8n3z6BpZbTA==, + } + engines: { node: '>=10' } peerDependencies: '@swc/helpers': ^0.5.0 peerDependenciesMeta: @@ -533,331 +818,583 @@ packages: optional: true '@swc/counter@0.1.3': - resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} + resolution: + { + integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==, + } '@swc/jest@0.2.36': - resolution: {integrity: sha512-8X80dp81ugxs4a11z1ka43FPhP+/e+mJNXJSxiNYk8gIX/jPBtY4gQTrKu/KIoco8bzKuPI5lUxjfLiGsfvnlw==} - engines: {npm: '>= 7.0.0'} + resolution: + { + integrity: sha512-8X80dp81ugxs4a11z1ka43FPhP+/e+mJNXJSxiNYk8gIX/jPBtY4gQTrKu/KIoco8bzKuPI5lUxjfLiGsfvnlw==, + } + engines: { npm: '>= 7.0.0' } peerDependencies: '@swc/core': '*' '@swc/types@0.1.6': - resolution: {integrity: sha512-/JLo/l2JsT/LRd80C3HfbmVpxOAJ11FO2RCEslFrgzLltoP9j8XIbsyDcfCt2WWyX+CM96rBoNM+IToAkFOugg==} + resolution: + { + integrity: sha512-/JLo/l2JsT/LRd80C3HfbmVpxOAJ11FO2RCEslFrgzLltoP9j8XIbsyDcfCt2WWyX+CM96rBoNM+IToAkFOugg==, + } '@tsconfig/node10@1.0.8': - resolution: {integrity: sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==} + resolution: + { + integrity: sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==, + } '@tsconfig/node12@1.0.9': - resolution: {integrity: sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==} + resolution: + { + integrity: sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==, + } '@tsconfig/node14@1.0.1': - resolution: {integrity: sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==} + resolution: + { + integrity: sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==, + } '@tsconfig/node16@1.0.2': - resolution: {integrity: sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==} + resolution: + { + integrity: sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==, + } '@types/babel__core@7.20.5': - resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + resolution: + { + integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==, + } '@types/babel__generator@7.6.8': - resolution: {integrity: sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==} + resolution: + { + integrity: sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==, + } '@types/babel__template@7.4.4': - resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + resolution: + { + integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==, + } '@types/babel__traverse@7.20.4': - resolution: {integrity: sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==} + resolution: + { + integrity: sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==, + } '@types/estree@1.0.8': - resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + resolution: + { + integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==, + } '@types/graceful-fs@4.1.9': - resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + resolution: + { + integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==, + } '@types/istanbul-lib-coverage@2.0.6': - resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + resolution: + { + integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==, + } '@types/istanbul-lib-report@3.0.3': - resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + resolution: + { + integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==, + } '@types/istanbul-reports@3.0.4': - resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + resolution: + { + integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==, + } '@types/jest@29.5.11': - resolution: {integrity: sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==} + resolution: + { + integrity: sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==, + } '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + resolution: + { + integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==, + } '@types/node@20.19.11': - resolution: {integrity: sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow==} + resolution: + { + integrity: sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow==, + } '@types/stack-utils@2.0.3': - resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + resolution: + { + integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==, + } '@types/yargs-parser@21.0.3': - resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + resolution: + { + integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==, + } '@types/yargs@17.0.32': - resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} + resolution: + { + integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==, + } '@typescript-eslint/eslint-plugin@8.31.1': - resolution: {integrity: sha512-oUlH4h1ABavI4F0Xnl8/fOtML/eu8nI2A1nYd+f+55XI0BLu+RIqKoCiZKNo6DtqZBEQm5aNKA20G3Z5w3R6GQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-oUlH4h1ABavI4F0Xnl8/fOtML/eu8nI2A1nYd+f+55XI0BLu+RIqKoCiZKNo6DtqZBEQm5aNKA20G3Z5w3R6GQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' '@typescript-eslint/parser@8.31.1': - resolution: {integrity: sha512-oU/OtYVydhXnumd0BobL9rkJg7wFJ9bFFPmSmB/bf/XWN85hlViji59ko6bSKBXyseT9V8l+CN1nwmlbiN0G7Q==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-oU/OtYVydhXnumd0BobL9rkJg7wFJ9bFFPmSmB/bf/XWN85hlViji59ko6bSKBXyseT9V8l+CN1nwmlbiN0G7Q==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' '@typescript-eslint/scope-manager@8.31.1': - resolution: {integrity: sha512-BMNLOElPxrtNQMIsFHE+3P0Yf1z0dJqV9zLdDxN/xLlWMlXK/ApEsVEKzpizg9oal8bAT5Sc7+ocal7AC1HCVw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-BMNLOElPxrtNQMIsFHE+3P0Yf1z0dJqV9zLdDxN/xLlWMlXK/ApEsVEKzpizg9oal8bAT5Sc7+ocal7AC1HCVw==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } '@typescript-eslint/type-utils@8.31.1': - resolution: {integrity: sha512-fNaT/m9n0+dpSp8G/iOQ05GoHYXbxw81x+yvr7TArTuZuCA6VVKbqWYVZrV5dVagpDTtj/O8k5HBEE/p/HM5LA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-fNaT/m9n0+dpSp8G/iOQ05GoHYXbxw81x+yvr7TArTuZuCA6VVKbqWYVZrV5dVagpDTtj/O8k5HBEE/p/HM5LA==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' '@typescript-eslint/types@8.31.1': - resolution: {integrity: sha512-SfepaEFUDQYRoA70DD9GtytljBePSj17qPxFHA/h3eg6lPTqGJ5mWOtbXCk1YrVU1cTJRd14nhaXWFu0l2troQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-SfepaEFUDQYRoA70DD9GtytljBePSj17qPxFHA/h3eg6lPTqGJ5mWOtbXCk1YrVU1cTJRd14nhaXWFu0l2troQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } '@typescript-eslint/typescript-estree@8.31.1': - resolution: {integrity: sha512-kaA0ueLe2v7KunYOyWYtlf/QhhZb7+qh4Yw6Ni5kgukMIG+iP773tjgBiLWIXYumWCwEq3nLW+TUywEp8uEeag==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-kaA0ueLe2v7KunYOyWYtlf/QhhZb7+qh4Yw6Ni5kgukMIG+iP773tjgBiLWIXYumWCwEq3nLW+TUywEp8uEeag==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } peerDependencies: typescript: '>=4.8.4 <5.9.0' '@typescript-eslint/utils@8.31.1': - resolution: {integrity: sha512-2DSI4SNfF5T4oRveQ4nUrSjUqjMND0nLq9rEkz0gfGr3tg0S5KB6DhwR+WZPCjzkZl3cH+4x2ce3EsL50FubjQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-2DSI4SNfF5T4oRveQ4nUrSjUqjMND0nLq9rEkz0gfGr3tg0S5KB6DhwR+WZPCjzkZl3cH+4x2ce3EsL50FubjQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' '@typescript-eslint/visitor-keys@8.31.1': - resolution: {integrity: sha512-I+/rgqOVBn6f0o7NDTmAPWWC6NuqhV174lfYvAm9fUaWeiefLdux9/YI3/nLugEn9L8fcSi0XmpKi/r5u0nmpw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-I+/rgqOVBn6f0o7NDTmAPWWC6NuqhV174lfYvAm9fUaWeiefLdux9/YI3/nLugEn9L8fcSi0XmpKi/r5u0nmpw==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } acorn-jsx@5.3.2: - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + resolution: + { + integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==, + } peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 acorn-walk@8.2.0: - resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} - engines: {node: '>=0.4.0'} + resolution: + { + integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==, + } + engines: { node: '>=0.4.0' } acorn@8.14.0: - resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} - engines: {node: '>=0.4.0'} + resolution: + { + integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==, + } + engines: { node: '>=0.4.0' } hasBin: true acorn@8.15.0: - resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} - engines: {node: '>=0.4.0'} + resolution: + { + integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==, + } + engines: { node: '>=0.4.0' } hasBin: true aggregate-error@3.1.0: - resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==, + } + engines: { node: '>=8' } ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + resolution: + { + integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==, + } ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==, + } + engines: { node: '>=8' } ansi-escapes@7.0.0: - resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} - engines: {node: '>=18'} + resolution: + { + integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==, + } + engines: { node: '>=18' } ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==, + } + engines: { node: '>=8' } ansi-regex@6.1.0: - resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} - engines: {node: '>=12'} + resolution: + { + integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==, + } + engines: { node: '>=12' } ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==, + } + engines: { node: '>=8' } ansi-styles@5.2.0: - resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==, + } + engines: { node: '>=10' } any-promise@1.3.0: - resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + resolution: + { + integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==, + } anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} + resolution: + { + integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==, + } + engines: { node: '>= 8' } arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + resolution: + { + integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==, + } argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + resolution: + { + integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==, + } argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + resolution: + { + integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==, + } babel-jest@29.7.0: - resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } peerDependencies: '@babel/core': ^7.8.0 babel-plugin-istanbul@6.1.1: - resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==, + } + engines: { node: '>=8' } babel-plugin-jest-hoist@29.6.3: - resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } babel-preset-current-node-syntax@1.2.0: - resolution: {integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==} + resolution: + { + integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==, + } peerDependencies: '@babel/core': ^7.0.0 || ^8.0.0-0 babel-preset-jest@29.6.3: - resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } peerDependencies: '@babel/core': ^7.0.0 balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + resolution: + { + integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==, + } baseline-browser-mapping@2.9.14: - resolution: {integrity: sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==} + resolution: + { + integrity: sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==, + } hasBin: true brace-expansion@2.0.2: - resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} + resolution: + { + integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==, + } braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==, + } + engines: { node: '>=8' } browserslist@4.28.1: - resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + resolution: + { + integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==, + } + engines: { node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7 } hasBin: true bs-logger@0.2.6: - resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} - engines: {node: '>= 6'} + resolution: + { + integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==, + } + engines: { node: '>= 6' } bser@2.1.1: - resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + resolution: + { + integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==, + } buffer-from@1.1.2: - resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + resolution: + { + integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==, + } callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==, + } + engines: { node: '>=6' } camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==, + } + engines: { node: '>=6' } camelcase@6.3.0: - resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==, + } + engines: { node: '>=10' } caniuse-lite@1.0.30001764: - resolution: {integrity: sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g==} + resolution: + { + integrity: sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g==, + } chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==, + } + engines: { node: '>=10' } chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + resolution: + { + integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==, + } + engines: { node: ^12.17.0 || ^14.13 || >=16.0.0 } char-regex@1.0.2: - resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==, + } + engines: { node: '>=10' } ci-info@3.9.0: - resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==, + } + engines: { node: '>=8' } cjs-module-lexer@1.4.1: - resolution: {integrity: sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==} + resolution: + { + integrity: sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==, + } clean-stack@2.2.0: - resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==, + } + engines: { node: '>=6' } cli-highlight@2.1.11: - resolution: {integrity: sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==} - engines: {node: '>=8.0.0', npm: '>=5.0.0'} + resolution: + { + integrity: sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==, + } + engines: { node: '>=8.0.0', npm: '>=5.0.0' } hasBin: true cli-table3@0.6.5: - resolution: {integrity: sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==} - engines: {node: 10.* || >= 12.*} + resolution: + { + integrity: sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==, + } + engines: { node: 10.* || >= 12.* } cliui@7.0.4: - resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + resolution: + { + integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==, + } cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} + resolution: + { + integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==, + } + engines: { node: '>=12' } co@4.6.0: - resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} - engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + resolution: + { + integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==, + } + engines: { iojs: '>= 1.0.0', node: '>= 0.12.0' } collect-v8-coverage@1.0.2: - resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} + resolution: + { + integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==, + } color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} + resolution: + { + integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==, + } + engines: { node: '>=7.0.0' } color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + resolution: + { + integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==, + } commander@10.0.1: - resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} - engines: {node: '>=14'} + resolution: + { + integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==, + } + engines: { node: '>=14' } convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + resolution: + { + integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==, + } create-jest@29.7.0: - resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } hasBin: true create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + resolution: + { + integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==, + } cross-spawn@7.0.6: - resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} - engines: {node: '>= 8'} + resolution: + { + integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==, + } + engines: { node: '>= 8' } debug@4.4.1: - resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} - engines: {node: '>=6.0'} + resolution: + { + integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==, + } + engines: { node: '>=6.0' } peerDependencies: supports-color: '*' peerDependenciesMeta: @@ -865,8 +1402,11 @@ packages: optional: true debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} - engines: {node: '>=6.0'} + resolution: + { + integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==, + } + engines: { node: '>=6.0' } peerDependencies: supports-color: '*' peerDependenciesMeta: @@ -874,7 +1414,10 @@ packages: optional: true dedent@1.5.1: - resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} + resolution: + { + integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==, + } peerDependencies: babel-plugin-macros: ^3.1.0 peerDependenciesMeta: @@ -882,76 +1425,110 @@ packages: optional: true deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + resolution: + { + integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==, + } deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==, + } + engines: { node: '>=0.10.0' } detect-newline@3.1.0: - resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==, + } + engines: { node: '>=8' } diff-sequences@29.6.3: - resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } diff@4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} + resolution: + { + integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==, + } + engines: { node: '>=0.3.1' } electron-to-chromium@1.5.267: - resolution: {integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==} + resolution: + { + integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==, + } emittery@0.13.1: - resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} - engines: {node: '>=12'} + resolution: + { + integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==, + } + engines: { node: '>=12' } emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + resolution: + { + integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==, + } emojilib@2.4.0: - resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + resolution: + { + integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==, + } environment@1.1.0: - resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} - engines: {node: '>=18'} + resolution: + { + integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==, + } + engines: { node: '>=18' } error-ex@1.3.2: - resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + resolution: + { + integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==, + } escalade@3.1.1: - resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==, + } + engines: { node: '>=6' } escalade@3.2.0: - resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==, + } + engines: { node: '>=6' } escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==, + } + engines: { node: '>=8' } escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} - engines: {node: '>=10'} - - eslint-plugin-prettier@5.4.1: - resolution: {integrity: sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - '@types/eslint': '>=8.0.0' - eslint: '>=8.0.0' - eslint-config-prettier: '>= 7.0.0 <10.0.0 || >=10.1.0' - prettier: '>=3.0.0' - peerDependenciesMeta: - '@types/eslint': - optional: true - eslint-config-prettier: - optional: true + resolution: + { + integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==, + } + engines: { node: '>=10' } eslint-plugin-unused-imports@4.1.4: - resolution: {integrity: sha512-YptD6IzQjDardkl0POxnnRBhU1OEePMV0nd6siHaRBbd+lyh6NAhFEobiznKU7kTsSsDeSD62Pe7kAM1b7dAZQ==} + resolution: + { + integrity: sha512-YptD6IzQjDardkl0POxnnRBhU1OEePMV0nd6siHaRBbd+lyh6NAhFEobiznKU7kTsSsDeSD62Pe7kAM1b7dAZQ==, + } peerDependencies: '@typescript-eslint/eslint-plugin': ^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0 eslint: ^9.0.0 || ^8.0.0 @@ -960,24 +1537,39 @@ packages: optional: true eslint-scope@8.4.0: - resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + resolution: + { + integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } eslint-visitor-keys@4.2.0: - resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } eslint-visitor-keys@4.2.1: - resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } eslint@9.39.1: - resolution: {integrity: sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } hasBin: true peerDependencies: jiti: '*' @@ -986,275 +1578,482 @@ packages: optional: true espree@10.4.0: - resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} + resolution: + { + integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==, + } + engines: { node: '>=4' } hasBin: true esquery@1.6.0: - resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} - engines: {node: '>=0.10'} + resolution: + { + integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==, + } + engines: { node: '>=0.10' } esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} + resolution: + { + integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==, + } + engines: { node: '>=4.0' } estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} + resolution: + { + integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==, + } + engines: { node: '>=4.0' } esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==, + } + engines: { node: '>=0.10.0' } execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==, + } + engines: { node: '>=10' } exit@0.1.2: - resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} - engines: {node: '>= 0.8.0'} + resolution: + { + integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==, + } + engines: { node: '>= 0.8.0' } expect@29.7.0: - resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} + resolution: + { + integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==, + } fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} + resolution: + { + integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==, + } + engines: { node: '>=8.6.0' } fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + resolution: + { + integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==, + } fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + resolution: + { + integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==, + } fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + resolution: + { + integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==, + } fb-watchman@2.0.2: - resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + resolution: + { + integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==, + } fflate@0.8.2: - resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==} + resolution: + { + integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==, + } file-entry-cache@8.0.0: - resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} - engines: {node: '>=16.0.0'} + resolution: + { + integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==, + } + engines: { node: '>=16.0.0' } fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==, + } + engines: { node: '>=8' } find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==, + } + engines: { node: '>=8' } find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==, + } + engines: { node: '>=10' } flat-cache@4.0.1: - resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} - engines: {node: '>=16'} + resolution: + { + integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==, + } + engines: { node: '>=16' } flatted@3.3.3: - resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} + resolution: + { + integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==, + } fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + resolution: + { + integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==, + } fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + resolution: + { + integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==, + } + engines: { node: ^8.16.0 || ^10.6.0 || >=11.0.0 } os: [darwin] function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + resolution: + { + integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==, + } gensync@1.0.0-beta.2: - resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} - engines: {node: '>=6.9.0'} + resolution: + { + integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==, + } + engines: { node: '>=6.9.0' } get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} + resolution: + { + integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==, + } + engines: { node: 6.* || 8.* || >= 10.* } get-package-type@0.1.0: - resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} - engines: {node: '>=8.0.0'} + resolution: + { + integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==, + } + engines: { node: '>=8.0.0' } get-stdin@8.0.0: - resolution: {integrity: sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==, + } + engines: { node: '>=10' } get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==, + } + engines: { node: '>=10' } glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} + resolution: + { + integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==, + } + engines: { node: '>= 6' } glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} + resolution: + { + integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==, + } + engines: { node: '>=10.13.0' } glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + resolution: + { + integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==, + } deprecated: Glob versions prior to v9 are no longer supported glob@8.1.0: - resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} - engines: {node: '>=12'} + resolution: + { + integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==, + } + engines: { node: '>=12' } deprecated: Glob versions prior to v9 are no longer supported globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} - engines: {node: '>=18'} + resolution: + { + integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==, + } + engines: { node: '>=18' } graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + resolution: + { + integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==, + } graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + resolution: + { + integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==, + } handlebars@4.7.8: - resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} - engines: {node: '>=0.4.7'} + resolution: + { + integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==, + } + engines: { node: '>=0.4.7' } hasBin: true has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==, + } + engines: { node: '>=8' } hasown@2.0.0: - resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} - engines: {node: '>= 0.4'} + resolution: + { + integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==, + } + engines: { node: '>= 0.4' } highlight.js@10.7.3: - resolution: {integrity: sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==} + resolution: + { + integrity: sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==, + } html-escaper@2.0.2: - resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + resolution: + { + integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==, + } human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} + resolution: + { + integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==, + } + engines: { node: '>=10.17.0' } iconv-lite@0.6.3: - resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==, + } + engines: { node: '>=0.10.0' } ignore-walk@5.0.1: - resolution: {integrity: sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + resolution: + { + integrity: sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==, + } + engines: { node: ^12.13.0 || ^14.15.0 || >=16.0.0 } ignore@5.3.2: - resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} - engines: {node: '>= 4'} + resolution: + { + integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==, + } + engines: { node: '>= 4' } import-fresh@3.3.1: - resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==, + } + engines: { node: '>=6' } import-local@3.1.0: - resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==, + } + engines: { node: '>=8' } hasBin: true imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} + resolution: + { + integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==, + } + engines: { node: '>=0.8.19' } indent-string@4.0.0: - resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==, + } + engines: { node: '>=8' } inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + resolution: + { + integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==, + } deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + resolution: + { + integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==, + } is-arrayish@0.2.1: - resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + resolution: + { + integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==, + } is-core-module@2.13.1: - resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + resolution: + { + integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==, + } is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==, + } + engines: { node: '>=0.10.0' } is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==, + } + engines: { node: '>=8' } is-generator-fn@2.1.0: - resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==, + } + engines: { node: '>=6' } is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==, + } + engines: { node: '>=0.10.0' } is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} + resolution: + { + integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==, + } + engines: { node: '>=0.12.0' } is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==, + } + engines: { node: '>=8' } isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + resolution: + { + integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==, + } istanbul-lib-coverage@3.2.2: - resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==, + } + engines: { node: '>=8' } istanbul-lib-instrument@5.2.1: - resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==, + } + engines: { node: '>=8' } istanbul-lib-instrument@6.0.3: - resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==, + } + engines: { node: '>=10' } istanbul-lib-report@3.0.1: - resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==, + } + engines: { node: '>=10' } istanbul-lib-source-maps@4.0.1: - resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==, + } + engines: { node: '>=10' } istanbul-reports@3.1.6: - resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==, + } + engines: { node: '>=8' } jest-changed-files@29.7.0: - resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-circus@29.7.0: - resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-cli@29.7.0: - resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } hasBin: true peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -1263,8 +2062,11 @@ packages: optional: true jest-config@29.7.0: - resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } peerDependencies: '@types/node': '*' ts-node: '>=9.0.0' @@ -1275,48 +2077,81 @@ packages: optional: true jest-diff@29.7.0: - resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-docblock@29.7.0: - resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-each@29.7.0: - resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-environment-node@29.7.0: - resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-get-type@29.6.3: - resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-haste-map@29.7.0: - resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-leak-detector@29.7.0: - resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-matcher-utils@29.7.0: - resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-message-util@29.7.0: - resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-mock@29.7.0: - resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-pnp-resolver@1.2.3: - resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==, + } + engines: { node: '>=6' } peerDependencies: jest-resolve: '*' peerDependenciesMeta: @@ -1324,48 +2159,81 @@ packages: optional: true jest-regex-util@29.6.3: - resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-resolve-dependencies@29.7.0: - resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-resolve@29.7.0: - resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-runner@29.7.0: - resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-runtime@29.7.0: - resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-snapshot@29.7.0: - resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-util@29.7.0: - resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-validate@29.7.0: - resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-watcher@29.7.0: - resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest-worker@29.7.0: - resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } jest@29.7.0: - resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } hasBin: true peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -1374,478 +2242,842 @@ packages: optional: true js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + resolution: + { + integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==, + } js-yaml@3.14.2: - resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} + resolution: + { + integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==, + } hasBin: true js-yaml@4.1.1: - resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} + resolution: + { + integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==, + } hasBin: true jsesc@3.1.0: - resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==, + } + engines: { node: '>=6' } hasBin: true json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + resolution: + { + integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==, + } json-parse-even-better-errors@2.3.1: - resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + resolution: + { + integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==, + } json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + resolution: + { + integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==, + } json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + resolution: + { + integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==, + } json5@2.2.3: - resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==, + } + engines: { node: '>=6' } hasBin: true jsonc-parser@3.2.1: - resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} + resolution: + { + integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==, + } keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + resolution: + { + integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==, + } kleur@3.0.3: - resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==, + } + engines: { node: '>=6' } leven@3.1.0: - resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==, + } + engines: { node: '>=6' } levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} + resolution: + { + integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==, + } + engines: { node: '>= 0.8.0' } lines-and-columns@1.2.4: - resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + resolution: + { + integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==, + } locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==, + } + engines: { node: '>=8' } locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==, + } + engines: { node: '>=10' } lodash.memoize@4.1.2: - resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + resolution: + { + integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==, + } lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + resolution: + { + integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==, + } lru-cache@10.4.3: - resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + resolution: + { + integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==, + } lru-cache@5.1.1: - resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + resolution: + { + integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==, + } make-dir@4.0.0: - resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==, + } + engines: { node: '>=10' } make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + resolution: + { + integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==, + } makeerror@1.0.12: - resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + resolution: + { + integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==, + } marked-terminal@7.2.1: - resolution: {integrity: sha512-rQ1MoMFXZICWNsKMiiHwP/Z+92PLKskTPXj+e7uwXmuMPkNn7iTqC+IvDekVm1MPeC9wYQeLxeFaOvudRR/XbQ==} - engines: {node: '>=16.0.0'} + resolution: + { + integrity: sha512-rQ1MoMFXZICWNsKMiiHwP/Z+92PLKskTPXj+e7uwXmuMPkNn7iTqC+IvDekVm1MPeC9wYQeLxeFaOvudRR/XbQ==, + } + engines: { node: '>=16.0.0' } peerDependencies: marked: '>=1 <15' marked@9.1.6: - resolution: {integrity: sha512-jcByLnIFkd5gSXZmjNvS1TlmRhCXZjIzHYlaGkPlLIekG55JDR2Z4va9tZwCiP+/RDERiNhMOFu01xd6O5ct1Q==} - engines: {node: '>= 16'} + resolution: + { + integrity: sha512-jcByLnIFkd5gSXZmjNvS1TlmRhCXZjIzHYlaGkPlLIekG55JDR2Z4va9tZwCiP+/RDERiNhMOFu01xd6O5ct1Q==, + } + engines: { node: '>= 16' } hasBin: true merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + resolution: + { + integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==, + } merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} + resolution: + { + integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==, + } + engines: { node: '>= 8' } micromatch@4.0.8: - resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} - engines: {node: '>=8.6'} + resolution: + { + integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==, + } + engines: { node: '>=8.6' } mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==, + } + engines: { node: '>=6' } minimatch@9.0.5: - resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} - engines: {node: '>=16 || 14 >=14.17'} + resolution: + { + integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==, + } + engines: { node: '>=16 || 14 >=14.17' } minimist@1.2.6: - resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==} + resolution: + { + integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==, + } mri@1.2.0: - resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} - engines: {node: '>=4'} + resolution: + { + integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==, + } + engines: { node: '>=4' } ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + resolution: + { + integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==, + } mz@2.7.0: - resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + resolution: + { + integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==, + } natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + resolution: + { + integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==, + } neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + resolution: + { + integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==, + } node-emoji@2.1.3: - resolution: {integrity: sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==} - engines: {node: '>=18'} + resolution: + { + integrity: sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==, + } + engines: { node: '>=18' } node-int64@0.4.0: - resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + resolution: + { + integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==, + } node-releases@2.0.27: - resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} + resolution: + { + integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==, + } normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==, + } + engines: { node: '>=0.10.0' } npm-bundled@2.0.1: - resolution: {integrity: sha512-gZLxXdjEzE/+mOstGDqR6b0EkhJ+kM6fxM6vUuckuctuVPh80Q6pw/rSZj9s4Gex9GxWtIicO1pc8DB9KZWudw==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + resolution: + { + integrity: sha512-gZLxXdjEzE/+mOstGDqR6b0EkhJ+kM6fxM6vUuckuctuVPh80Q6pw/rSZj9s4Gex9GxWtIicO1pc8DB9KZWudw==, + } + engines: { node: ^12.13.0 || ^14.15.0 || >=16.0.0 } npm-normalize-package-bin@2.0.0: - resolution: {integrity: sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + resolution: + { + integrity: sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==, + } + engines: { node: ^12.13.0 || ^14.15.0 || >=16.0.0 } npm-packlist@5.1.3: - resolution: {integrity: sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + resolution: + { + integrity: sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg==, + } + engines: { node: ^12.13.0 || ^14.15.0 || >=16.0.0 } hasBin: true npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==, + } + engines: { node: '>=8' } object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==, + } + engines: { node: '>=0.10.0' } once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + resolution: + { + integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==, + } onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==, + } + engines: { node: '>=6' } optionator@0.9.4: - resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} - engines: {node: '>= 0.8.0'} + resolution: + { + integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==, + } + engines: { node: '>= 0.8.0' } p-all@3.0.0: - resolution: {integrity: sha512-qUZbvbBFVXm6uJ7U/WDiO0fv6waBMbjlCm4E66oZdRR+egswICarIdHyVSZZHudH8T5SF8x/JG0q0duFzPnlBw==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-qUZbvbBFVXm6uJ7U/WDiO0fv6waBMbjlCm4E66oZdRR+egswICarIdHyVSZZHudH8T5SF8x/JG0q0duFzPnlBw==, + } + engines: { node: '>=10' } p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==, + } + engines: { node: '>=6' } p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==, + } + engines: { node: '>=10' } p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==, + } + engines: { node: '>=8' } p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==, + } + engines: { node: '>=10' } p-map@4.0.0: - resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==, + } + engines: { node: '>=10' } p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==, + } + engines: { node: '>=6' } parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==, + } + engines: { node: '>=6' } parse-json@5.2.0: - resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==, + } + engines: { node: '>=8' } parse5-htmlparser2-tree-adapter@6.0.1: - resolution: {integrity: sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==} + resolution: + { + integrity: sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==, + } parse5@5.1.1: - resolution: {integrity: sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==} + resolution: + { + integrity: sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==, + } parse5@6.0.1: - resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} + resolution: + { + integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==, + } path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==, + } + engines: { node: '>=8' } path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==, + } + engines: { node: '>=0.10.0' } path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==, + } + engines: { node: '>=8' } path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + resolution: + { + integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==, + } picocolors@1.1.1: - resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + resolution: + { + integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==, + } picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} + resolution: + { + integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==, + } + engines: { node: '>=8.6' } pirates@4.0.6: - resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} - engines: {node: '>= 6'} + resolution: + { + integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==, + } + engines: { node: '>= 6' } pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==, + } + engines: { node: '>=8' } prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - - prettier-linter-helpers@1.0.0: - resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} - engines: {node: '>=6.0.0'} + resolution: + { + integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==, + } + engines: { node: '>= 0.8.0' } prettier@3.1.1: - resolution: {integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==} - engines: {node: '>=14'} + resolution: + { + integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==, + } + engines: { node: '>=14' } hasBin: true pretty-format@29.7.0: - resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + resolution: + { + integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==, + } + engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } prompts@2.4.2: - resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} - engines: {node: '>= 6'} + resolution: + { + integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==, + } + engines: { node: '>= 6' } publint@0.2.12: - resolution: {integrity: sha512-YNeUtCVeM4j9nDiTT2OPczmlyzOkIXNtdDZnSuajAxS/nZ6j3t7Vs9SUB4euQNddiltIwu7Tdd3s+hr08fAsMw==} - engines: {node: '>=16'} + resolution: + { + integrity: sha512-YNeUtCVeM4j9nDiTT2OPczmlyzOkIXNtdDZnSuajAxS/nZ6j3t7Vs9SUB4euQNddiltIwu7Tdd3s+hr08fAsMw==, + } + engines: { node: '>=16' } hasBin: true punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==, + } + engines: { node: '>=6' } pure-rand@6.0.4: - resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} + resolution: + { + integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==, + } queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + resolution: + { + integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==, + } react-is@18.2.0: - resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + resolution: + { + integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==, + } readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} + resolution: + { + integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==, + } + engines: { node: '>= 6' } require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==, + } + engines: { node: '>=0.10.0' } resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==, + } + engines: { node: '>=8' } resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} + resolution: + { + integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==, + } + engines: { node: '>=4' } resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==, + } + engines: { node: '>=8' } resolve.exports@2.0.2: - resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==, + } + engines: { node: '>=10' } resolve@1.22.8: - resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + resolution: + { + integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==, + } hasBin: true reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + resolution: + { + integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==, + } + engines: { iojs: '>=1.0.0', node: '>=0.10.0' } run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + resolution: + { + integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==, + } sade@1.8.1: - resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==, + } + engines: { node: '>=6' } safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + resolution: + { + integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==, + } safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + resolution: + { + integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==, + } semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + resolution: + { + integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==, + } hasBin: true semver@7.7.1: - resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==, + } + engines: { node: '>=10' } hasBin: true semver@7.7.3: - resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==, + } + engines: { node: '>=10' } hasBin: true shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==, + } + engines: { node: '>=8' } shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==, + } + engines: { node: '>=8' } signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + resolution: + { + integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==, + } sisteransi@1.0.5: - resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + resolution: + { + integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==, + } skin-tone@2.0.0: - resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==, + } + engines: { node: '>=8' } slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==, + } + engines: { node: '>=8' } source-map-support@0.5.13: - resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + resolution: + { + integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==, + } source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, + } + engines: { node: '>=0.10.0' } sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + resolution: + { + integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==, + } stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==, + } + engines: { node: '>=10' } string-length@4.0.2: - resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==, + } + engines: { node: '>=10' } string-to-stream@3.0.1: - resolution: {integrity: sha512-Hl092MV3USJuUCC6mfl9sPzGloA3K5VwdIeJjYIkXY/8K+mUvaeEabWJgArp+xXrsWxCajeT2pc4axbVhIZJyg==} + resolution: + { + integrity: sha512-Hl092MV3USJuUCC6mfl9sPzGloA3K5VwdIeJjYIkXY/8K+mUvaeEabWJgArp+xXrsWxCajeT2pc4axbVhIZJyg==, + } string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==, + } + engines: { node: '>=8' } string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + resolution: + { + integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==, + } strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==, + } + engines: { node: '>=8' } strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} + resolution: + { + integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==, + } + engines: { node: '>=4' } strip-bom@4.0.0: - resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==, + } + engines: { node: '>=8' } strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==, + } + engines: { node: '>=6' } strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==, + } + engines: { node: '>=8' } superstruct@1.0.4: - resolution: {integrity: sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==} - engines: {node: '>=14.0.0'} + resolution: + { + integrity: sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==, + } + engines: { node: '>=14.0.0' } supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==, + } + engines: { node: '>=8' } supports-color@8.1.1: - resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==, + } + engines: { node: '>=10' } supports-hyperlinks@3.1.0: - resolution: {integrity: sha512-2rn0BZ+/f7puLOHZm1HOJfwBggfaHXUpPUSSG/SWM4TWp5KCfmNYwnC3hruy2rZlMnmWZ+QAGpZfchu3f3695A==} - engines: {node: '>=14.18'} + resolution: + { + integrity: sha512-2rn0BZ+/f7puLOHZm1HOJfwBggfaHXUpPUSSG/SWM4TWp5KCfmNYwnC3hruy2rZlMnmWZ+QAGpZfchu3f3695A==, + } + engines: { node: '>=14.18' } supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - - synckit@0.11.8: - resolution: {integrity: sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A==} - engines: {node: ^14.18.0 || >=16.0.0} + resolution: + { + integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==, + } + engines: { node: '>= 0.4' } test-exclude@6.0.0: - resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} - engines: {node: '>=8'} + resolution: + { + integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==, + } + engines: { node: '>=8' } thenify-all@1.6.0: - resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} - engines: {node: '>=0.8'} + resolution: + { + integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==, + } + engines: { node: '>=0.8' } thenify@3.3.1: - resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + resolution: + { + integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==, + } tmpl@1.0.5: - resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + resolution: + { + integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==, + } to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} + resolution: + { + integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==, + } + engines: { node: '>=8.0' } ts-api-utils@2.0.1: - resolution: {integrity: sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==} - engines: {node: '>=18.12'} + resolution: + { + integrity: sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==, + } + engines: { node: '>=18.12' } peerDependencies: typescript: '>=4.8.4' ts-jest@29.4.6: - resolution: {integrity: sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==} - engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} + resolution: + { + integrity: sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==, + } + engines: { node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0 } hasBin: true peerDependencies: '@babel/core': '>=7.0.0-beta.0 <8' @@ -1871,7 +3103,10 @@ packages: optional: true ts-node@10.7.0: - resolution: {integrity: sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==} + resolution: + { + integrity: sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==, + } hasBin: true peerDependencies: '@swc/core': '>=1.2.50' @@ -1885,147 +3120,249 @@ packages: optional: true tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz: - resolution: {integrity: sha512-tWyCXnx0WqCkVlo5s+4KMj7HC0/0YrCZY0PustUwX9F2lNwd8Kp07q/Q56uGvV9q80XaSDrhy0YqBmrX5TDNpQ==, tarball: https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz} + resolution: + { + integrity: sha512-tWyCXnx0WqCkVlo5s+4KMj7HC0/0YrCZY0PustUwX9F2lNwd8Kp07q/Q56uGvV9q80XaSDrhy0YqBmrX5TDNpQ==, + tarball: https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz, + } version: 1.1.9 - engines: {node: '>=14'} + engines: { node: '>=14' } hasBin: true peerDependencies: typescript: '>=4.3.0' tsconfig-paths@4.2.0: - resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==, + } + engines: { node: '>=6' } tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + resolution: + { + integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==, + } type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} + resolution: + { + integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==, + } + engines: { node: '>= 0.8.0' } type-detect@4.0.8: - resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} - engines: {node: '>=4'} + resolution: + { + integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==, + } + engines: { node: '>=4' } type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==, + } + engines: { node: '>=10' } type-fest@4.41.0: - resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} - engines: {node: '>=16'} + resolution: + { + integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==, + } + engines: { node: '>=16' } typescript-eslint@8.31.1: - resolution: {integrity: sha512-j6DsEotD/fH39qKzXTQRwYYWlt7D+0HmfpOK+DVhwJOFLcdmn92hq3mBb7HlKJHbjjI/gTOqEcc9d6JfpFf/VA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + resolution: + { + integrity: sha512-j6DsEotD/fH39qKzXTQRwYYWlt7D+0HmfpOK+DVhwJOFLcdmn92hq3mBb7HlKJHbjjI/gTOqEcc9d6JfpFf/VA==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' typescript@5.6.1-rc: - resolution: {integrity: sha512-E3b2+1zEFu84jB0YQi9BORDjz9+jGbwwy1Zi3G0LUNw7a7cePUrHMRNy8aPh53nXpkFGVHSxIZo5vKTfYaFiBQ==} - engines: {node: '>=14.17'} + resolution: + { + integrity: sha512-E3b2+1zEFu84jB0YQi9BORDjz9+jGbwwy1Zi3G0LUNw7a7cePUrHMRNy8aPh53nXpkFGVHSxIZo5vKTfYaFiBQ==, + } + engines: { node: '>=14.17' } hasBin: true typescript@5.8.3: - resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} - engines: {node: '>=14.17'} + resolution: + { + integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==, + } + engines: { node: '>=14.17' } hasBin: true uglify-js@3.19.3: - resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} - engines: {node: '>=0.8.0'} + resolution: + { + integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==, + } + engines: { node: '>=0.8.0' } hasBin: true undici-types@6.21.0: - resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + resolution: + { + integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==, + } unicode-emoji-modifier-base@1.0.0: - resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} - engines: {node: '>=4'} + resolution: + { + integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==, + } + engines: { node: '>=4' } update-browserslist-db@1.2.3: - resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + resolution: + { + integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==, + } hasBin: true peerDependencies: browserslist: '>= 4.21.0' uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + resolution: + { + integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==, + } util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + resolution: + { + integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==, + } v8-compile-cache-lib@3.0.0: - resolution: {integrity: sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==} + resolution: + { + integrity: sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==, + } v8-to-istanbul@9.2.0: - resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} - engines: {node: '>=10.12.0'} + resolution: + { + integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==, + } + engines: { node: '>=10.12.0' } validate-npm-package-name@5.0.1: - resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + resolution: + { + integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==, + } + engines: { node: ^14.17.0 || ^16.13.0 || >=18.0.0 } walker@1.0.8: - resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + resolution: + { + integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==, + } which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} + resolution: + { + integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==, + } + engines: { node: '>= 8' } hasBin: true word-wrap@1.2.5: - resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} - engines: {node: '>=0.10.0'} + resolution: + { + integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==, + } + engines: { node: '>=0.10.0' } wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + resolution: + { + integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==, + } wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==, + } + engines: { node: '>=10' } wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + resolution: + { + integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==, + } write-file-atomic@4.0.2: - resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + resolution: + { + integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==, + } + engines: { node: ^12.13.0 || ^14.15.0 || >=16.0.0 } y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==, + } + engines: { node: '>=10' } yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + resolution: + { + integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==, + } yargs-parser@20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==, + } + engines: { node: '>=10' } yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} + resolution: + { + integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==, + } + engines: { node: '>=12' } yargs@16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==, + } + engines: { node: '>=10' } yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} + resolution: + { + integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==, + } + engines: { node: '>=12' } yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} + resolution: + { + integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==, + } + engines: { node: '>=6' } yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} + resolution: + { + integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==, + } + engines: { node: '>=10' } snapshots: - '@andrewbranch/untar.js@1.0.3': {} '@arethetypeswrong/cli@0.17.0': @@ -2524,8 +3861,6 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@pkgr/core@0.2.4': {} - '@sinclair/typebox@0.27.8': {} '@sindresorhus/is@4.6.0': {} @@ -3007,13 +4342,6 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-plugin-prettier@5.4.1(eslint@9.39.1)(prettier@3.1.1): - dependencies: - eslint: 9.39.1 - prettier: 3.1.1 - prettier-linter-helpers: 1.0.0 - synckit: 0.11.8 - eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@8.31.1(@typescript-eslint/parser@8.31.1(eslint@9.39.1)(typescript@5.8.3))(eslint@9.39.1)(typescript@5.8.3))(eslint@9.39.1): dependencies: eslint: 9.39.1 @@ -3114,8 +4442,6 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-diff@1.3.0: {} - fast-glob@3.3.2: dependencies: '@nodelib/fs.stat': 2.0.5 @@ -3861,10 +5187,6 @@ snapshots: prelude-ls@1.2.1: {} - prettier-linter-helpers@1.0.0: - dependencies: - fast-diff: 1.3.0 - prettier@3.1.1: {} pretty-format@29.7.0: @@ -4013,10 +5335,6 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - synckit@0.11.8: - dependencies: - '@pkgr/core': 0.2.4 - test-exclude@6.0.0: dependencies: '@istanbuljs/schema': 0.1.3 diff --git a/scripts/bootstrap b/scripts/bootstrap index 2bb3c94..3a8293a 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response diff --git a/scripts/fast-format b/scripts/fast-format index 53721ac..f1873ae 100755 --- a/scripts/fast-format +++ b/scripts/fast-format @@ -31,10 +31,7 @@ if ! [ -z "$ESLINT_FILES" ]; then fi echo "==> Running prettier --write" -# format things eslint didn't -PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)" -if ! [ -z "$PRETTIER_FILES" ]; then - echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \ - --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \ - '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +if ! [ -z "$FILE_LIST" ]; then + cat "$FILE_LIST" | xargs ./node_modules/.bin/prettier \ + --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern --ignore-unknown fi diff --git a/scripts/format b/scripts/format index 7a75640..b1b2c17 100755 --- a/scripts/format +++ b/scripts/format @@ -8,5 +8,4 @@ echo "==> Running eslint --fix" ./node_modules/.bin/eslint --fix . echo "==> Running prettier --write" -# format things eslint didn't -./node_modules/.bin/prettier --write --cache --cache-strategy metadata . '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +./node_modules/.bin/prettier --write --cache --cache-strategy metadata . diff --git a/scripts/lint b/scripts/lint index 3ffb78a..1f53254 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,6 +4,9 @@ set -e cd "$(dirname "$0")/.." +echo "==> Running prettier --check" +./node_modules/.bin/prettier --check . + echo "==> Running eslint" ./node_modules/.bin/eslint . diff --git a/scripts/utils/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs index deae575..a8cdeb7 100644 --- a/scripts/utils/postprocess-files.cjs +++ b/scripts/utils/postprocess-files.cjs @@ -23,12 +23,19 @@ async function postprocess() { // strip out lib="dom", types="node", and types="react" references; these // are needed at build time, but would pollute the user's TS environment - const transformed = code.replace( + let transformed = code.replace( /^ *\/\/\/ * ' '.repeat(match.length - 1) + '\n', ); + // TypeScript's declaration emitter collapses /** @ts-ignore */ onto the same + // line as the type declaration, which doesn't work. So we convert to // @ts-ignore + // on its own line to properly suppresses errors. + if (file.endsWith('.d.ts') || file.endsWith('.d.mts') || file.endsWith('.d.cts')) { + transformed = transformed.replace(/\/\*\* @ts-ignore\b[^*]*\*\/ /gm, '// @ts-ignore\n'); + } + if (transformed !== code) { console.error(`wrote ${path.relative(process.cwd(), file)}`); await fs.promises.writeFile(file, transformed, 'utf8'); diff --git a/src/client.ts b/src/client.ts index becfa4d..17d4dc2 100644 --- a/src/client.ts +++ b/src/client.ts @@ -21,6 +21,21 @@ import * as API from './resources/index'; import { APIPromise } from './core/api-promise'; import { AddressVerification, + AddressVerificationAutocompleteParams, + AddressVerificationAutocompleteResponse, + AddressVerificationBatchVerificationParams, + AddressVerificationBatchVerificationResponse, + AddressVerificationGetAutocompletePreviewsParams, + AddressVerificationGetAutocompletePreviewsResponse, + AddressVerificationGetLookupInfoResponse, + AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams, + AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse, + AddressVerificationLookupZipCodeFromCityOrStateParams, + AddressVerificationLookupZipCodeFromCityOrStateResponse, + AddressVerificationParseAnAddressParams, + AddressVerificationParseAnAddressResponse, + AddressVerificationSuggestAddressesParams, + AddressVerificationSuggestAddressesResponse, AddressVerificationVerifyParams, AddressVerificationVerifyResponse, Errors as AddressVerificationAPIErrors, @@ -28,14 +43,18 @@ import { } from './resources/address-verification'; import { IntlAddressVerification, + IntlAddressVerificationAutocompleteParams, + IntlAddressVerificationAutocompleteResponse, + IntlAddressVerificationBatchVerificationParams, + IntlAddressVerificationBatchVerificationResponse, + IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams, + IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse, + IntlAddressVerificationGetAutocompletePreviewsParams, + IntlAddressVerificationGetAutocompletePreviewsResponse, IntlAddressVerificationVerifyParams, IntlAddressVerificationVerifyResponse, } from './resources/intl-address-verification'; -import { - ContactCreateWithCompanyName, - ContactCreateWithFirstName, - PrintMail, -} from './resources/print-mail/print-mail'; +import { PrintMail } from './resources/print-mail/print-mail'; import { type Fetch } from './internal/builtin-types'; import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers'; import { FinalRequestOptions, RequestOptions } from './internal/request-options'; @@ -189,6 +208,18 @@ export class PostGrid { this.fetch = options.fetch ?? Shims.getDefaultFetch(); this.#encoder = Opts.FallbackEncoder; + const customHeadersEnv = readEnv('POSTGRID_CUSTOM_HEADERS'); + if (customHeadersEnv) { + const parsed: Record = {}; + for (const line of customHeadersEnv.split('\n')) { + const colon = line.indexOf(':'); + if (colon >= 0) { + parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); + } + } + options.defaultHeaders = { ...parsed, ...options.defaultHeaders }; + } + this._options = options; this.addressVerificationAPIKey = addressVerificationAPIKey; @@ -269,6 +300,9 @@ export class PostGrid { return buildHeaders([{ 'X-API-Key': this.printMailAPIKey }]); } + /** + * Basic re-implementation of `qs.stringify` for primitive types. + */ protected stringifyQuery(query: object | Record): string { return stringifyQuery(query); } @@ -844,19 +878,38 @@ export declare namespace PostGrid { AddressVerification as AddressVerification, type AddressVerificationAPIErrors as Errors, type Status as Status, + type AddressVerificationAutocompleteResponse as AddressVerificationAutocompleteResponse, + type AddressVerificationBatchVerificationResponse as AddressVerificationBatchVerificationResponse, + type AddressVerificationGetAutocompletePreviewsResponse as AddressVerificationGetAutocompletePreviewsResponse, + type AddressVerificationGetLookupInfoResponse as AddressVerificationGetLookupInfoResponse, + type AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse as AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse, + type AddressVerificationLookupZipCodeFromCityOrStateResponse as AddressVerificationLookupZipCodeFromCityOrStateResponse, + type AddressVerificationParseAnAddressResponse as AddressVerificationParseAnAddressResponse, + type AddressVerificationSuggestAddressesResponse as AddressVerificationSuggestAddressesResponse, type AddressVerificationVerifyResponse as AddressVerificationVerifyResponse, + type AddressVerificationAutocompleteParams as AddressVerificationAutocompleteParams, + type AddressVerificationBatchVerificationParams as AddressVerificationBatchVerificationParams, + type AddressVerificationGetAutocompletePreviewsParams as AddressVerificationGetAutocompletePreviewsParams, + type AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams as AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams, + type AddressVerificationLookupZipCodeFromCityOrStateParams as AddressVerificationLookupZipCodeFromCityOrStateParams, + type AddressVerificationParseAnAddressParams as AddressVerificationParseAnAddressParams, + type AddressVerificationSuggestAddressesParams as AddressVerificationSuggestAddressesParams, type AddressVerificationVerifyParams as AddressVerificationVerifyParams, }; export { IntlAddressVerification as IntlAddressVerification, + type IntlAddressVerificationAutocompleteResponse as IntlAddressVerificationAutocompleteResponse, + type IntlAddressVerificationBatchVerificationResponse as IntlAddressVerificationBatchVerificationResponse, + type IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse as IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse, + type IntlAddressVerificationGetAutocompletePreviewsResponse as IntlAddressVerificationGetAutocompletePreviewsResponse, type IntlAddressVerificationVerifyResponse as IntlAddressVerificationVerifyResponse, + type IntlAddressVerificationAutocompleteParams as IntlAddressVerificationAutocompleteParams, + type IntlAddressVerificationBatchVerificationParams as IntlAddressVerificationBatchVerificationParams, + type IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams as IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams, + type IntlAddressVerificationGetAutocompletePreviewsParams as IntlAddressVerificationGetAutocompletePreviewsParams, type IntlAddressVerificationVerifyParams as IntlAddressVerificationVerifyParams, }; - export { - PrintMail as PrintMail, - type ContactCreateWithCompanyName as ContactCreateWithCompanyName, - type ContactCreateWithFirstName as ContactCreateWithFirstName, - }; + export { PrintMail as PrintMail }; } diff --git a/src/internal/qs/LICENSE.md b/src/internal/qs/LICENSE.md deleted file mode 100644 index 3fda157..0000000 --- a/src/internal/qs/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/internal/qs/README.md b/src/internal/qs/README.md deleted file mode 100644 index 67ae04e..0000000 --- a/src/internal/qs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# qs - -This is a vendored version of [neoqs](https://github.com/PuruVJ/neoqs) which is a TypeScript rewrite of [qs](https://github.com/ljharb/qs), a query string library. diff --git a/src/internal/qs/formats.ts b/src/internal/qs/formats.ts deleted file mode 100644 index e76a742..0000000 --- a/src/internal/qs/formats.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Format } from './types'; - -export const default_format: Format = 'RFC3986'; -export const default_formatter = (v: PropertyKey) => String(v); -export const formatters: Record string> = { - RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'), - RFC3986: default_formatter, -}; -export const RFC1738 = 'RFC1738'; -export const RFC3986 = 'RFC3986'; diff --git a/src/internal/qs/index.ts b/src/internal/qs/index.ts deleted file mode 100644 index c3a3620..0000000 --- a/src/internal/qs/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { default_format, formatters, RFC1738, RFC3986 } from './formats'; - -const formats = { - formatters, - RFC1738, - RFC3986, - default: default_format, -}; - -export { stringify } from './stringify'; -export { formats }; - -export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types'; diff --git a/src/internal/qs/stringify.ts b/src/internal/qs/stringify.ts deleted file mode 100644 index 7e71387..0000000 --- a/src/internal/qs/stringify.ts +++ /dev/null @@ -1,385 +0,0 @@ -import { encode, is_buffer, maybe_map, has } from './utils'; -import { default_format, default_formatter, formatters } from './formats'; -import type { NonNullableProperties, StringifyOptions } from './types'; -import { isArray } from '../utils/values'; - -const array_prefix_generators = { - brackets(prefix: PropertyKey) { - return String(prefix) + '[]'; - }, - comma: 'comma', - indices(prefix: PropertyKey, key: string) { - return String(prefix) + '[' + key + ']'; - }, - repeat(prefix: PropertyKey) { - return String(prefix); - }, -}; - -const push_to_array = function (arr: any[], value_or_array: any) { - Array.prototype.push.apply(arr, isArray(value_or_array) ? value_or_array : [value_or_array]); -}; - -let toISOString; - -const defaults = { - addQueryPrefix: false, - allowDots: false, - allowEmptyArrays: false, - arrayFormat: 'indices', - charset: 'utf-8', - charsetSentinel: false, - delimiter: '&', - encode: true, - encodeDotInKeys: false, - encoder: encode, - encodeValuesOnly: false, - format: default_format, - formatter: default_formatter, - /** @deprecated */ - indices: false, - serializeDate(date) { - return (toISOString ??= Function.prototype.call.bind(Date.prototype.toISOString))(date); - }, - skipNulls: false, - strictNullHandling: false, -} as NonNullableProperties; - -function is_non_nullish_primitive(v: unknown): v is string | number | boolean | symbol | bigint { - return ( - typeof v === 'string' || - typeof v === 'number' || - typeof v === 'boolean' || - typeof v === 'symbol' || - typeof v === 'bigint' - ); -} - -const sentinel = {}; - -function inner_stringify( - object: any, - prefix: PropertyKey, - generateArrayPrefix: StringifyOptions['arrayFormat'] | ((prefix: string, key: string) => string), - commaRoundTrip: boolean, - allowEmptyArrays: boolean, - strictNullHandling: boolean, - skipNulls: boolean, - encodeDotInKeys: boolean, - encoder: StringifyOptions['encoder'], - filter: StringifyOptions['filter'], - sort: StringifyOptions['sort'], - allowDots: StringifyOptions['allowDots'], - serializeDate: StringifyOptions['serializeDate'], - format: StringifyOptions['format'], - formatter: StringifyOptions['formatter'], - encodeValuesOnly: boolean, - charset: StringifyOptions['charset'], - sideChannel: WeakMap, -) { - let obj = object; - - let tmp_sc = sideChannel; - let step = 0; - let find_flag = false; - while ((tmp_sc = tmp_sc.get(sentinel)) !== void undefined && !find_flag) { - // Where object last appeared in the ref tree - const pos = tmp_sc.get(object); - step += 1; - if (typeof pos !== 'undefined') { - if (pos === step) { - throw new RangeError('Cyclic object value'); - } else { - find_flag = true; // Break while - } - } - if (typeof tmp_sc.get(sentinel) === 'undefined') { - step = 0; - } - } - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate?.(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = maybe_map(obj, function (value) { - if (value instanceof Date) { - return serializeDate?.(value); - } - return value; - }); - } - - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly ? - // @ts-expect-error - encoder(prefix, defaults.encoder, charset, 'key', format) - : prefix; - } - - obj = ''; - } - - if (is_non_nullish_primitive(obj) || is_buffer(obj)) { - if (encoder) { - const key_value = - encodeValuesOnly ? prefix - // @ts-expect-error - : encoder(prefix, defaults.encoder, charset, 'key', format); - return [ - formatter?.(key_value) + - '=' + - // @ts-expect-error - formatter?.(encoder(obj, defaults.encoder, charset, 'value', format)), - ]; - } - return [formatter?.(prefix) + '=' + formatter?.(String(obj))]; - } - - const values: string[] = []; - - if (typeof obj === 'undefined') { - return values; - } - - let obj_keys; - if (generateArrayPrefix === 'comma' && isArray(obj)) { - // we need to join elements in - if (encodeValuesOnly && encoder) { - // @ts-expect-error values only - obj = maybe_map(obj, encoder); - } - obj_keys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; - } else if (isArray(filter)) { - obj_keys = filter; - } else { - const keys = Object.keys(obj); - obj_keys = sort ? keys.sort(sort) : keys; - } - - const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); - - const adjusted_prefix = - commaRoundTrip && isArray(obj) && obj.length === 1 ? encoded_prefix + '[]' : encoded_prefix; - - if (allowEmptyArrays && isArray(obj) && obj.length === 0) { - return adjusted_prefix + '[]'; - } - - for (let j = 0; j < obj_keys.length; ++j) { - const key = obj_keys[j]; - const value = - // @ts-ignore - typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key as any]; - - if (skipNulls && value === null) { - continue; - } - - // @ts-ignore - const encoded_key = allowDots && encodeDotInKeys ? (key as any).replace(/\./g, '%2E') : key; - const key_prefix = - isArray(obj) ? - typeof generateArrayPrefix === 'function' ? - generateArrayPrefix(adjusted_prefix, encoded_key) - : adjusted_prefix - : adjusted_prefix + (allowDots ? '.' + encoded_key : '[' + encoded_key + ']'); - - sideChannel.set(object, step); - const valueSideChannel = new WeakMap(); - valueSideChannel.set(sentinel, sideChannel); - push_to_array( - values, - inner_stringify( - value, - key_prefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - // @ts-ignore - generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel, - ), - ); - } - - return values; -} - -function normalize_stringify_options( - opts: StringifyOptions = defaults, -): NonNullableProperties> & { indices?: boolean } { - if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { - throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); - } - - if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { - throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); - } - - if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - const charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - let format = default_format; - if (typeof opts.format !== 'undefined') { - if (!has(formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - const formatter = formatters[format]; - - let filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - let arrayFormat: StringifyOptions['arrayFormat']; - if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) { - arrayFormat = opts.arrayFormat; - } else if ('indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = defaults.arrayFormat; - } - - if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { - throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); - } - - const allowDots = - typeof opts.allowDots === 'undefined' ? - !!opts.encodeDotInKeys === true ? - true - : defaults.allowDots - : !!opts.allowDots; - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - // @ts-ignore - allowDots: allowDots, - allowEmptyArrays: - typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, - arrayFormat: arrayFormat, - charset: charset, - charsetSentinel: - typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - commaRoundTrip: !!opts.commaRoundTrip, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encodeDotInKeys: - typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: - typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - format: format, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - // @ts-ignore - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: - typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, - }; -} - -export function stringify(object: any, opts: StringifyOptions = {}) { - let obj = object; - const options = normalize_stringify_options(opts); - - let obj_keys: PropertyKey[] | undefined; - let filter; - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (isArray(options.filter)) { - filter = options.filter; - obj_keys = filter; - } - - const keys: string[] = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - const generateArrayPrefix = array_prefix_generators[options.arrayFormat]; - const commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; - - if (!obj_keys) { - obj_keys = Object.keys(obj); - } - - if (options.sort) { - obj_keys.sort(options.sort); - } - - const sideChannel = new WeakMap(); - for (let i = 0; i < obj_keys.length; ++i) { - const key = obj_keys[i]!; - - if (options.skipNulls && obj[key] === null) { - continue; - } - push_to_array( - keys, - inner_stringify( - obj[key], - key, - // @ts-expect-error - generateArrayPrefix, - commaRoundTrip, - options.allowEmptyArrays, - options.strictNullHandling, - options.skipNulls, - options.encodeDotInKeys, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel, - ), - ); - } - - const joined = keys.join(options.delimiter); - let prefix = options.addQueryPrefix === true ? '?' : ''; - - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - - return joined.length > 0 ? prefix + joined : ''; -} diff --git a/src/internal/qs/types.ts b/src/internal/qs/types.ts deleted file mode 100644 index 7c28dbb..0000000 --- a/src/internal/qs/types.ts +++ /dev/null @@ -1,71 +0,0 @@ -export type Format = 'RFC1738' | 'RFC3986'; - -export type DefaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string; -export type DefaultDecoder = (str: string, decoder?: any, charset?: string) => string; - -export type BooleanOptional = boolean | undefined; - -export type StringifyBaseOptions = { - delimiter?: string; - allowDots?: boolean; - encodeDotInKeys?: boolean; - strictNullHandling?: boolean; - skipNulls?: boolean; - encode?: boolean; - encoder?: ( - str: any, - defaultEncoder: DefaultEncoder, - charset: string, - type: 'key' | 'value', - format?: Format, - ) => string; - filter?: Array | ((prefix: PropertyKey, value: any) => any); - arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma'; - indices?: boolean; - sort?: ((a: PropertyKey, b: PropertyKey) => number) | null; - serializeDate?: (d: Date) => string; - format?: 'RFC1738' | 'RFC3986'; - formatter?: (str: PropertyKey) => string; - encodeValuesOnly?: boolean; - addQueryPrefix?: boolean; - charset?: 'utf-8' | 'iso-8859-1'; - charsetSentinel?: boolean; - allowEmptyArrays?: boolean; - commaRoundTrip?: boolean; -}; - -export type StringifyOptions = StringifyBaseOptions; - -export type ParseBaseOptions = { - comma?: boolean; - delimiter?: string | RegExp; - depth?: number | false; - decoder?: (str: string, defaultDecoder: DefaultDecoder, charset: string, type: 'key' | 'value') => any; - arrayLimit?: number; - parseArrays?: boolean; - plainObjects?: boolean; - allowPrototypes?: boolean; - allowSparse?: boolean; - parameterLimit?: number; - strictDepth?: boolean; - strictNullHandling?: boolean; - ignoreQueryPrefix?: boolean; - charset?: 'utf-8' | 'iso-8859-1'; - charsetSentinel?: boolean; - interpretNumericEntities?: boolean; - allowEmptyArrays?: boolean; - duplicates?: 'combine' | 'first' | 'last'; - allowDots?: boolean; - decodeDotInKeys?: boolean; -}; - -export type ParseOptions = ParseBaseOptions; - -export type ParsedQs = { - [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[]; -}; - -// Type to remove null or undefined union from each property -export type NonNullableProperties = { - [K in keyof T]-?: Exclude; -}; diff --git a/src/internal/qs/utils.ts b/src/internal/qs/utils.ts deleted file mode 100644 index 4cd5657..0000000 --- a/src/internal/qs/utils.ts +++ /dev/null @@ -1,265 +0,0 @@ -import { RFC1738 } from './formats'; -import type { DefaultEncoder, Format } from './types'; -import { isArray } from '../utils/values'; - -export let has = (obj: object, key: PropertyKey): boolean => ( - (has = (Object as any).hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty)), - has(obj, key) -); - -const hex_table = /* @__PURE__ */ (() => { - const array = []; - for (let i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -})(); - -function compact_queue>(queue: Array<{ obj: T; prop: string }>) { - while (queue.length > 1) { - const item = queue.pop(); - if (!item) continue; - - const obj = item.obj[item.prop]; - - if (isArray(obj)) { - const compacted: unknown[] = []; - - for (let j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - // @ts-ignore - item.obj[item.prop] = compacted; - } - } -} - -function array_to_object(source: any[], options: { plainObjects: boolean }) { - const obj = options && options.plainObjects ? Object.create(null) : {}; - for (let i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -} - -export function merge( - target: any, - source: any, - options: { plainObjects?: boolean; allowPrototypes?: boolean } = {}, -) { - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (isArray(target)) { - target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (!target || typeof target !== 'object') { - return [target].concat(source); - } - - let mergeTarget = target; - if (isArray(target) && !isArray(source)) { - // @ts-ignore - mergeTarget = array_to_object(target, options); - } - - if (isArray(target) && isArray(source)) { - source.forEach(function (item, i) { - if (has(target, i)) { - const targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - const value = source[key]; - - if (has(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -} - -export function assign_single_source(target: any, source: any) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -} - -export function decode(str: string, _: any, charset: string) { - const strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; - } -} - -const limit = 1024; - -export const encode: ( - str: any, - defaultEncoder: DefaultEncoder, - charset: string, - type: 'key' | 'value', - format: Format, -) => string = (str, _defaultEncoder, charset, _kind, format: Format) => { - // This code was originally written by Brian White for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - let string = str; - if (typeof str === 'symbol') { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== 'string') { - string = String(str); - } - - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; - }); - } - - let out = ''; - for (let j = 0; j < string.length; j += limit) { - const segment = string.length >= limit ? string.slice(j, j + limit) : string; - const arr = []; - - for (let i = 0; i < segment.length; ++i) { - let c = segment.charCodeAt(i); - if ( - c === 0x2d || // - - c === 0x2e || // . - c === 0x5f || // _ - c === 0x7e || // ~ - (c >= 0x30 && c <= 0x39) || // 0-9 - (c >= 0x41 && c <= 0x5a) || // a-z - (c >= 0x61 && c <= 0x7a) || // A-Z - (format === RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - arr[arr.length] = segment.charAt(i); - continue; - } - - if (c < 0x80) { - arr[arr.length] = hex_table[c]; - continue; - } - - if (c < 0x800) { - arr[arr.length] = hex_table[0xc0 | (c >> 6)]! + hex_table[0x80 | (c & 0x3f)]; - continue; - } - - if (c < 0xd800 || c >= 0xe000) { - arr[arr.length] = - hex_table[0xe0 | (c >> 12)]! + hex_table[0x80 | ((c >> 6) & 0x3f)] + hex_table[0x80 | (c & 0x3f)]; - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3ff) << 10) | (segment.charCodeAt(i) & 0x3ff)); - - arr[arr.length] = - hex_table[0xf0 | (c >> 18)]! + - hex_table[0x80 | ((c >> 12) & 0x3f)] + - hex_table[0x80 | ((c >> 6) & 0x3f)] + - hex_table[0x80 | (c & 0x3f)]; - } - - out += arr.join(''); - } - - return out; -}; - -export function compact(value: any) { - const queue = [{ obj: { o: value }, prop: 'o' }]; - const refs = []; - - for (let i = 0; i < queue.length; ++i) { - const item = queue[i]; - // @ts-ignore - const obj = item.obj[item.prop]; - - const keys = Object.keys(obj); - for (let j = 0; j < keys.length; ++j) { - const key = keys[j]!; - const val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - compact_queue(queue); - - return value; -} - -export function is_regexp(obj: any) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -} - -export function is_buffer(obj: any) { - if (!obj || typeof obj !== 'object') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -} - -export function combine(a: any, b: any) { - return [].concat(a, b); -} - -export function maybe_map(val: T[], fn: (v: T) => T) { - if (isArray(val)) { - const mapped = []; - for (let i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i]!)); - } - return mapped; - } - return fn(val); -} diff --git a/src/internal/types.ts b/src/internal/types.ts index b668dfc..a050513 100644 --- a/src/internal/types.ts +++ b/src/internal/types.ts @@ -40,7 +40,6 @@ type OverloadedParameters = : T extends (...args: infer A) => unknown ? A : never; -/* eslint-disable */ /** * These imports attempt to get types from a parent package's dependencies. * Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which @@ -63,19 +62,18 @@ type OverloadedParameters = * * [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition */ -/** @ts-ignore For users with \@types/node */ +/** @ts-ignore For users with \@types/node */ /* prettier-ignore */ type UndiciTypesRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users with undici */ +/** @ts-ignore For users with undici */ /* prettier-ignore */ type UndiciRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users with \@types/bun */ +/** @ts-ignore For users with \@types/bun */ /* prettier-ignore */ type BunRequestInit = globalThis.FetchRequestInit; -/** @ts-ignore For users with node-fetch@2 */ +/** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */ type NodeFetch2RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ +/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */ type NodeFetch3RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users who use Deno */ +/** @ts-ignore For users who use Deno */ /* prettier-ignore */ type FetchRequestInit = NonNullable[1]>; -/* eslint-enable */ type RequestInits = | NotAny diff --git a/src/internal/utils/log.ts b/src/internal/utils/log.ts index bb04026..0695ded 100644 --- a/src/internal/utils/log.ts +++ b/src/internal/utils/log.ts @@ -106,8 +106,9 @@ export const formatRequestDetails = (details: { ([name, value]) => [ name, ( - name.toLowerCase() === 'x-api-key' || name.toLowerCase() === 'authorization' || + name.toLowerCase() === 'api-key' || + name.toLowerCase() === 'x-api-key' || name.toLowerCase() === 'cookie' || name.toLowerCase() === 'set-cookie' ) ? diff --git a/src/internal/utils/query.ts b/src/internal/utils/query.ts index 0139cac..3003d8a 100644 --- a/src/internal/utils/query.ts +++ b/src/internal/utils/query.ts @@ -1,7 +1,23 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as qs from '../qs/stringify'; +import { PostGridError } from '../../core/error'; +/** + * Basic re-implementation of `qs.stringify` for primitive types. + */ export function stringifyQuery(query: object | Record) { - return qs.stringify(query, { arrayFormat: 'comma' }); + return Object.entries(query) + .filter(([_, value]) => typeof value !== 'undefined') + .map(([key, value]) => { + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { + return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; + } + if (value === null) { + return `${encodeURIComponent(key)}=`; + } + throw new PostGridError( + `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`, + ); + }) + .join('&'); } diff --git a/src/resources/address-verification.ts b/src/resources/address-verification.ts index 054782f..0b0f5be 100644 --- a/src/resources/address-verification.ts +++ b/src/resources/address-verification.ts @@ -14,6 +14,237 @@ import { RequestOptions } from '../internal/request-options'; * Note that this uses a different set of lookups than our international API. */ export class AddressVerification extends APIResource { + /** + * Resolves a partial street address into a list of full address candidates, + * optionally selecting a specific candidate by index and verifying it. + * + * **Basic usage** — omit `index`: returns an array of `CompletedAddressItem` + * results for the given `partialStreet`. + * + * **With `index`** — specify `index` to resolve a single candidate. Returns a + * single `CompletedAddressItem`. + * + * **With `index` + `verify=true`** — additionally runs the selected address + * through the USPS/Canada Post verifier and returns a `StandardVerifiedAddress`. + * + * - Uses 1 lookup per call (plus 1 more if geocoding a result). + * + * @example + * ```ts + * const response = + * await client.addressVerification.autocomplete({ + * partialStreet: 'partialStreet', + * }); + * ``` + */ + autocomplete( + params: AddressVerificationAutocompleteParams, + options?: RequestOptions, + ): APIPromise { + const { + filterExact, + geocode, + includeDetails, + index, + limit, + properCase, + query_verifiedOnly, + verify, + ...body + } = params; + return this._client.post('/v1/addver/completions', { + query: { + filterExact, + geocode, + includeDetails, + index, + limit, + properCase, + verifiedOnly: query_verifiedOnly, + verify, + }, + body, + ...options, + }); + } + + /** + * Verify a batch of US or Canadian addresses in a single request. Each address can + * be freeform or structured, matching the same input formats accepted by the + * single verification endpoint. + * + * - Uses 1 lookup per address (plus 1 more per address if geocoding). + * - Requires a secret API key. + * - Returns results in the same order as the input addresses. + * - If an individual address fails, its result will contain an `error` field + * rather than a `verifiedAddress`. + * + * @example + * ```ts + * const response = + * await client.addressVerification.batchVerification({ + * addresses: [{ address: 'address' }], + * }); + * ``` + */ + batchVerification( + params: AddressVerificationBatchVerificationParams, + options?: RequestOptions, + ): APIPromise { + const { geocode, includeDetails, properCase, ...body } = params; + return this._client.post('/v1/addver/verifications/batch', { + query: { geocode, includeDetails, properCase }, + body, + ...options, + }); + } + + /** + * Returns address completion previews for a partial street address, suitable for + * populating an autocomplete dropdown without consuming a lookup per keystroke. + * + * Each result contains a partial address preview (street, city, and — for non-US + * addresses — only the first 3 digits of the postal code, to avoid revealing the + * full code before a lookup is charged). + * + * - Does not consume a lookup. + * - Use `POST /completions` to resolve a full address once the user selects a + * result. + * + * @example + * ```ts + * const response = + * await client.addressVerification.getAutocompletePreviews({ + * partialStreet: 'partialStreet', + * }); + * ``` + */ + getAutocompletePreviews( + query: AddressVerificationGetAutocompletePreviewsParams, + options?: RequestOptions, + ): APIPromise { + return this._client.get('/v1/addver/completions', { query, ...options }); + } + + /** + * Returns your organization's current lookup usage and plan information. Useful + * for checking how many lookups you have consumed and whether you are on a paid + * plan. + * + * @example + * ```ts + * const response = + * await client.addressVerification.getLookupInfo(); + * ``` + */ + getLookupInfo(options?: RequestOptions): APIPromise { + return this._client.get('/v1/addver/', options); + } + + /** + * Looks up city, county, and other location metadata for a given US or Canadian + * postal code or ZIP code. + * + * A single postal code may map to multiple cities (e.g. a ZIP that spans several + * towns), so the response is an array. + * + * - Uses 1 lookup. + * + * @example + * ```ts + * const response = + * await client.addressVerification.lookupCityOrStateFromPostalOrZipCode( + * { postalOrZip: 'postalOrZip' }, + * ); + * ``` + */ + lookupCityOrStateFromPostalOrZipCode( + body: AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/v1/addver/city_states', { body, ...options }); + } + + /** + * Looks up all ZIP codes that correspond to a given US city and state. + * + * - Currently only supported for US addresses (`countryCode: "US"`). + * - Uses 1 lookup. + * + * @example + * ```ts + * const response = + * await client.addressVerification.lookupZipCodeFromCityOrState( + * { + * city: 'city', + * countryCode: 'countryCode', + * state: 'state', + * }, + * ); + * ``` + */ + lookupZipCodeFromCityOrState( + body: AddressVerificationLookupZipCodeFromCityOrStateParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/v1/addver/zip_codes', { body, ...options }); + } + + /** + * Parses a freeform address string into its individual components (house number, + * street name, city, state, postal code, etc.). + * + * Useful for extracting structured data from a single-line address without running + * a full verification. + * + * - Uses 1 lookup. + * + * @example + * ```ts + * const response = + * await client.addressVerification.parseAnAddress({ + * address: 'address', + * }); + * ``` + */ + parseAnAddress( + body: AddressVerificationParseAnAddressParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/v1/addver/parses', { body, ...options }); + } + + /** + * Returns up to 3 verified address suggestions for a given input address. + * + * Useful as a fallback when `POST /verifications` returns a `failed` status — + * suggestions represent the closest matches found and may help the user identify + * the correct address. + * + * Accepts the same freeform or structured input formats as `POST /verifications`. + * + * - Uses 1 lookup per call (plus 1 more if geocoding). + * + * @example + * ```ts + * const response = + * await client.addressVerification.suggestAddresses({ + * address: '1234 Elm St, Los Angeles, CA 90001, US', + * }); + * ``` + */ + suggestAddresses( + params: AddressVerificationSuggestAddressesParams, + options?: RequestOptions, + ): APIPromise { + const { geocode, includeDetails, properCase, ...body } = params; + return this._client.post('/v1/addver/suggestions', { + query: { geocode, includeDetails, properCase }, + body, + ...options, + }); + } + /** * 1. **Structured Address** — Verify and standardize a structured address (e.g., * with `line1`, `city`, etc.). @@ -65,21 +296,1628 @@ export interface Errors { */ line1?: Array; - /** - * Errors related to the second address line. - */ - line2?: Array; + /** + * Errors related to the second address line. + */ + line2?: Array; + + /** + * Errors related to the postal or ZIP code. + */ + postalOrZip?: Array; + + /** + * Errors related to the province or state. + */ + provinceOrState?: Array; +} + +/** + * The verification status of an address. + */ +export type Status = 'verified' | 'corrected' | 'failed'; + +export interface AddressVerificationAutocompleteResponse { + data: + | AddressVerificationAutocompleteResponse.CompletedAddressItem + | Array + | AddressVerificationAutocompleteResponse.StandardVerifiedAddress; + + message: string; + + status: 'success' | 'error'; +} + +export namespace AddressVerificationAutocompleteResponse { + export interface CompletedAddressItem { + /** + * The resolved address components. + */ + address: CompletedAddressItem.Address; + + /** + * Errors encountered during address verification. + */ + errors?: AddressVerificationAPI.Errors; + + /** + * Geocoding result. Only present when `geocode=true` is supplied and an `index` is + * specified. + */ + geocodeResult?: CompletedAddressItem.GeocodeResult; + } + + export namespace CompletedAddressItem { + /** + * The resolved address components. + */ + export interface Address { + /** + * The first line of the address. + */ + address: string; + + /** + * The second line of the address. + */ + address2?: string; + + /** + * The city. + */ + city?: string; + + /** + * The ISO 2-letter country code. + */ + country?: string; + + /** + * The postal code. + */ + pc?: string; + + /** + * The province or state abbreviation. + */ + prov?: string; + } + + /** + * Geocoding result. Only present when `geocode=true` is supplied and an `index` is + * specified. + */ + export interface GeocodeResult { + /** + * A real number from 0.00 to 1.00 which represents an + * [accuracy score](https://avdocs.postgrid.com/#accuracy-score) + */ + accuracy: number; + + /** + * A string representing the + * [accuracy type](https://avdocs.postgrid.com/#accuracy-type) + */ + accuracyType: + | 'rooftop' + | 'point' + | 'range_interpolation' + | 'nearest_rooftop_match' + | 'intersection' + | 'street_center' + | 'place' + | 'state'; + + /** + * Object that contains `lat`, `lng` properties with number values + */ + location: GeocodeResult.Location; + } + + export namespace GeocodeResult { + /** + * Object that contains `lat`, `lng` properties with number values + */ + export interface Location { + lat: number; + + lng: number; + } + } + } + + export interface UnionMember1 { + /** + * The resolved address components. + */ + address: UnionMember1.Address; + + /** + * Errors encountered during address verification. + */ + errors?: AddressVerificationAPI.Errors; + + /** + * Geocoding result. Only present when `geocode=true` is supplied and an `index` is + * specified. + */ + geocodeResult?: UnionMember1.GeocodeResult; + } + + export namespace UnionMember1 { + /** + * The resolved address components. + */ + export interface Address { + /** + * The first line of the address. + */ + address: string; + + /** + * The second line of the address. + */ + address2?: string; + + /** + * The city. + */ + city?: string; + + /** + * The ISO 2-letter country code. + */ + country?: string; + + /** + * The postal code. + */ + pc?: string; + + /** + * The province or state abbreviation. + */ + prov?: string; + } + + /** + * Geocoding result. Only present when `geocode=true` is supplied and an `index` is + * specified. + */ + export interface GeocodeResult { + /** + * A real number from 0.00 to 1.00 which represents an + * [accuracy score](https://avdocs.postgrid.com/#accuracy-score) + */ + accuracy: number; + + /** + * A string representing the + * [accuracy type](https://avdocs.postgrid.com/#accuracy-type) + */ + accuracyType: + | 'rooftop' + | 'point' + | 'range_interpolation' + | 'nearest_rooftop_match' + | 'intersection' + | 'street_center' + | 'place' + | 'state'; + + /** + * Object that contains `lat`, `lng` properties with number values + */ + location: GeocodeResult.Location; + } + + export namespace GeocodeResult { + /** + * Object that contains `lat`, `lng` properties with number values + */ + export interface Location { + lat: number; + + lng: number; + } + } + } + + export interface StandardVerifiedAddress { + /** + * The city name of the address. + */ + city: string; + + /** + * The country code of the address. + */ + country: string; + + /** + * The first line of the address. + */ + line1: string; + + /** + * The postal code or ZIP code of the address. + */ + postalOrZip: string; + + /** + * The province or state of the address. + */ + provinceOrState: string; + + /** + * The country name of the address. + */ + countryName?: string; + + /** + * If you supply `includeDetails=true` as a query parameter, we will also populate + * an additional `details` field that follows the + * [Address Details](https://avdocs.postgrid.com/#address-details) schema. + */ + details?: StandardVerifiedAddress.Details; + + /** + * Errors encountered during address verification. + */ + errors?: AddressVerificationAPI.Errors; + + /** + * The firm name of the address. + */ + firmName?: string; + + /** + * If the `geocode=true` query parameter is supplied, the response will include a + * geocodeResult which follows the + * [Geocoding](https://avdocs.postgrid.com/#geocoding) schema. You can request this + * feature be enabled by emailing `support@postgrid.com`. This includes our + * verification, batch verification, suggestions, and POST /completions endpoint. + * Note that you must supply country when geocoding to get the result successfully. + */ + geocodeResult?: StandardVerifiedAddress.GeocodeResult; + + /** + * The second line of the address. + */ + line2?: string; + + /** + * The full name of the province or state. + */ + provinceOrStateName?: string; + + /** + * The verification status of an address. + */ + status?: AddressVerificationAPI.Status; + + /** + * The zip plus 4 code of the address. + */ + zipPlus4?: string; + } + + export namespace StandardVerifiedAddress { + /** + * If you supply `includeDetails=true` as a query parameter, we will also populate + * an additional `details` field that follows the + * [Address Details](https://avdocs.postgrid.com/#address-details) schema. + */ + export interface Details { + /** + * PO Box ID + */ + boxID?: string; + + /** + * County in the United States (US address only) + */ + county?: string; + + /** + * FIPS code for county (US address only) + */ + countyNum?: string; + + /** + * Delivery installation area name + */ + deliveryInstallationAreaName?: string; + + /** + * Delivery installation qualifier + */ + deliveryInstallationQualifier?: string; + + /** + * Delivery installation type + */ + deliveryInstallationType?: string; + + /** + * Any extra information relevant to the address + */ + extraInfo?: string; + + /** + * The post-direction of the street (after the street name, US addresses only) + */ + postDirection?: string; + + /** + * The pre-direction of the street (before the street name, US addresses only) + */ + preDirection?: string; + + /** + * Indicates that the address is residential (US address only) + */ + residential?: boolean; + + /** + * Rural route number + */ + ruralRouteNumber?: string; + + /** + * Rural route type + */ + ruralRouteType?: string; + + /** + * The direction of the street (N, S, E, W, etc) + */ + streetDirection?: string; + + /** + * Name of the street where the address is located + */ + streetName?: string; + + /** + * Street number (e.g. the 20 in 20 Bay St) + */ + streetNumber?: string; + + /** + * Type of the street (DR, ST, BLVD, etc) + */ + streetType?: string; + + /** + * The unit number/name + */ + suiteID?: string; + + /** + * The suite key + */ + suiteKey?: string; + + /** + * US Census block number + */ + usCensusBlockNumber?: string; + + /** + * US Census consolidated metropolitan statistical area + */ + usCensusCMSA?: string; + + /** + * US Census FIPS code (US address only) + */ + usCensusFIPS?: string; + + /** + * US Census metropolitan area + */ + usCensusMA?: string; + + /** + * US Census metropolitan statistical area + */ + usCensusMSA?: string; + + /** + * US Census primary metropolitan statistical area + */ + usCensusPMSA?: string; + + /** + * US Census tract number + */ + usCensusTractNumber?: string; + + /** + * US congressional district number + */ + usCongressionalDistrictNumber?: string; + + /** + * True if address location recognizes DST + */ + usHasDaylightSavings?: boolean; + + /** + * PostNet barcode digit + */ + usMailingCheckDigit?: string; + + /** + * 4-character code assigned to mail delivery route within a 5 digit zip code + */ + usMailingsCarrierRoute?: string; + + /** + * True if US address matches a high-rise default or rural route default in the + * USPS data + */ + usMailingsDefaultFlag?: boolean; + + /** + * Unique USPS identifier for the delivery point + */ + usMailingsDeliveryPoint?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvConfirmationIndicator?: string; + + /** + * Y if this is a commercial mail receiving agency, N otherwise + */ + usMailingsDpvCrmaIndicator?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvFootnote1?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvFootnote2?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvFootnote3?: string; + + /** + * A for ascending, D for descending + */ + usMailingsElotAscDesc?: string; + + /** + * eLOT sequence number + */ + usMailingsElotSequenceNumber?: string; + + /** + * Y if address is in early warning system database + */ + usMailingsEWSFlag?: string; + + /** + * Y if address converted by LACS + */ + usMailingsLACSFlag?: string; + + /** + * Corresponds to USPS LACSLink return code + */ + usMailingsLACSReturnCode?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsRecordTypeCode?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsSuiteLinkReturnCode?: string; + + /** + * PostNet barcode for the address (US address only) + */ + usPostnetBarcode?: string; + + /** + * Lower legislative district for the US address + */ + usStateLegislativeLower?: string; + + /** + * Upper legislative district for the US address + */ + usStateLegislativeUpper?: string; + + /** + * Time zone for the US address area + */ + usTimeZone?: string; + + /** + * Indicates that the address is vacant according to the USPS (US address only) + */ + vacant?: boolean; + } + + /** + * If the `geocode=true` query parameter is supplied, the response will include a + * geocodeResult which follows the + * [Geocoding](https://avdocs.postgrid.com/#geocoding) schema. You can request this + * feature be enabled by emailing `support@postgrid.com`. This includes our + * verification, batch verification, suggestions, and POST /completions endpoint. + * Note that you must supply country when geocoding to get the result successfully. + */ + export interface GeocodeResult { + /** + * A real number from 0.00 to 1.00 which represents an + * [accuracy score](https://avdocs.postgrid.com/#accuracy-score) + */ + accuracy: number; + + /** + * A string representing the + * [accuracy type](https://avdocs.postgrid.com/#accuracy-type) + */ + accuracyType: + | 'rooftop' + | 'point' + | 'range_interpolation' + | 'nearest_rooftop_match' + | 'intersection' + | 'street_center' + | 'place' + | 'state'; + + /** + * Object that contains `lat`, `lng` properties with number values + */ + location: GeocodeResult.Location; + } + + export namespace GeocodeResult { + /** + * Object that contains `lat`, `lng` properties with number values + */ + export interface Location { + lat: number; + + lng: number; + } + } + } +} + +export interface AddressVerificationBatchVerificationResponse { + data: AddressVerificationBatchVerificationResponse.Data; + + message: string; + + status: 'success' | 'error'; +} + +export namespace AddressVerificationBatchVerificationResponse { + export interface Data { + results: Array; + } + + export namespace Data { + export interface Result { + /** + * An error message for this address. Present when verification failed. + */ + error?: string; + + /** + * The verified address result. Present when verification succeeded. + */ + verifiedAddress?: Result.VerifiedAddress; + } + + export namespace Result { + /** + * The verified address result. Present when verification succeeded. + */ + export interface VerifiedAddress { + /** + * The city name of the address. + */ + city: string; + + /** + * The country code of the address. + */ + country: string; + + /** + * The first line of the address. + */ + line1: string; + + /** + * The postal code or ZIP code of the address. + */ + postalOrZip: string; + + /** + * The province or state of the address. + */ + provinceOrState: string; + + /** + * The country name of the address. + */ + countryName?: string; + + /** + * If you supply `includeDetails=true` as a query parameter, we will also populate + * an additional `details` field that follows the + * [Address Details](https://avdocs.postgrid.com/#address-details) schema. + */ + details?: VerifiedAddress.Details; + + /** + * Errors encountered during address verification. + */ + errors?: AddressVerificationAPI.Errors; + + /** + * The firm name of the address. + */ + firmName?: string; + + /** + * If the `geocode=true` query parameter is supplied, the response will include a + * geocodeResult which follows the + * [Geocoding](https://avdocs.postgrid.com/#geocoding) schema. You can request this + * feature be enabled by emailing `support@postgrid.com`. This includes our + * verification, batch verification, suggestions, and POST /completions endpoint. + * Note that you must supply country when geocoding to get the result successfully. + */ + geocodeResult?: VerifiedAddress.GeocodeResult; + + /** + * The second line of the address. + */ + line2?: string; + + /** + * The full name of the province or state. + */ + provinceOrStateName?: string; + + /** + * The verification status of an address. + */ + status?: AddressVerificationAPI.Status; + + /** + * The zip plus 4 code of the address. + */ + zipPlus4?: string; + } + + export namespace VerifiedAddress { + /** + * If you supply `includeDetails=true` as a query parameter, we will also populate + * an additional `details` field that follows the + * [Address Details](https://avdocs.postgrid.com/#address-details) schema. + */ + export interface Details { + /** + * PO Box ID + */ + boxID?: string; + + /** + * County in the United States (US address only) + */ + county?: string; + + /** + * FIPS code for county (US address only) + */ + countyNum?: string; + + /** + * Delivery installation area name + */ + deliveryInstallationAreaName?: string; + + /** + * Delivery installation qualifier + */ + deliveryInstallationQualifier?: string; + + /** + * Delivery installation type + */ + deliveryInstallationType?: string; + + /** + * Any extra information relevant to the address + */ + extraInfo?: string; + + /** + * The post-direction of the street (after the street name, US addresses only) + */ + postDirection?: string; + + /** + * The pre-direction of the street (before the street name, US addresses only) + */ + preDirection?: string; + + /** + * Indicates that the address is residential (US address only) + */ + residential?: boolean; + + /** + * Rural route number + */ + ruralRouteNumber?: string; + + /** + * Rural route type + */ + ruralRouteType?: string; + + /** + * The direction of the street (N, S, E, W, etc) + */ + streetDirection?: string; + + /** + * Name of the street where the address is located + */ + streetName?: string; + + /** + * Street number (e.g. the 20 in 20 Bay St) + */ + streetNumber?: string; + + /** + * Type of the street (DR, ST, BLVD, etc) + */ + streetType?: string; + + /** + * The unit number/name + */ + suiteID?: string; + + /** + * The suite key + */ + suiteKey?: string; + + /** + * US Census block number + */ + usCensusBlockNumber?: string; + + /** + * US Census consolidated metropolitan statistical area + */ + usCensusCMSA?: string; + + /** + * US Census FIPS code (US address only) + */ + usCensusFIPS?: string; + + /** + * US Census metropolitan area + */ + usCensusMA?: string; + + /** + * US Census metropolitan statistical area + */ + usCensusMSA?: string; + + /** + * US Census primary metropolitan statistical area + */ + usCensusPMSA?: string; + + /** + * US Census tract number + */ + usCensusTractNumber?: string; + + /** + * US congressional district number + */ + usCongressionalDistrictNumber?: string; + + /** + * True if address location recognizes DST + */ + usHasDaylightSavings?: boolean; + + /** + * PostNet barcode digit + */ + usMailingCheckDigit?: string; + + /** + * 4-character code assigned to mail delivery route within a 5 digit zip code + */ + usMailingsCarrierRoute?: string; + + /** + * True if US address matches a high-rise default or rural route default in the + * USPS data + */ + usMailingsDefaultFlag?: boolean; + + /** + * Unique USPS identifier for the delivery point + */ + usMailingsDeliveryPoint?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvConfirmationIndicator?: string; + + /** + * Y if this is a commercial mail receiving agency, N otherwise + */ + usMailingsDpvCrmaIndicator?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvFootnote1?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvFootnote2?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvFootnote3?: string; + + /** + * A for ascending, D for descending + */ + usMailingsElotAscDesc?: string; + + /** + * eLOT sequence number + */ + usMailingsElotSequenceNumber?: string; + + /** + * Y if address is in early warning system database + */ + usMailingsEWSFlag?: string; + + /** + * Y if address converted by LACS + */ + usMailingsLACSFlag?: string; + + /** + * Corresponds to USPS LACSLink return code + */ + usMailingsLACSReturnCode?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsRecordTypeCode?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsSuiteLinkReturnCode?: string; + + /** + * PostNet barcode for the address (US address only) + */ + usPostnetBarcode?: string; + + /** + * Lower legislative district for the US address + */ + usStateLegislativeLower?: string; + + /** + * Upper legislative district for the US address + */ + usStateLegislativeUpper?: string; + + /** + * Time zone for the US address area + */ + usTimeZone?: string; + + /** + * Indicates that the address is vacant according to the USPS (US address only) + */ + vacant?: boolean; + } + + /** + * If the `geocode=true` query parameter is supplied, the response will include a + * geocodeResult which follows the + * [Geocoding](https://avdocs.postgrid.com/#geocoding) schema. You can request this + * feature be enabled by emailing `support@postgrid.com`. This includes our + * verification, batch verification, suggestions, and POST /completions endpoint. + * Note that you must supply country when geocoding to get the result successfully. + */ + export interface GeocodeResult { + /** + * A real number from 0.00 to 1.00 which represents an + * [accuracy score](https://avdocs.postgrid.com/#accuracy-score) + */ + accuracy: number; + + /** + * A string representing the + * [accuracy type](https://avdocs.postgrid.com/#accuracy-type) + */ + accuracyType: + | 'rooftop' + | 'point' + | 'range_interpolation' + | 'nearest_rooftop_match' + | 'intersection' + | 'street_center' + | 'place' + | 'state'; + + /** + * Object that contains `lat`, `lng` properties with number values + */ + location: GeocodeResult.Location; + } + + export namespace GeocodeResult { + /** + * Object that contains `lat`, `lng` properties with number values + */ + export interface Location { + lat: number; + + lng: number; + } + } + } + } + } +} + +export interface AddressVerificationGetAutocompletePreviewsResponse { + data: Array; + + message: string; + + status: 'success' | 'error'; +} + +export namespace AddressVerificationGetAutocompletePreviewsResponse { + export interface Data { + /** + * A partial view of the address, suitable for display in an autocomplete dropdown. + */ + preview: Data.Preview; + } + + export namespace Data { + /** + * A partial view of the address, suitable for display in an autocomplete dropdown. + */ + export interface Preview { + /** + * The street address line. + */ + address: string; + + /** + * The city. + */ + city?: string; + + /** + * For US addresses, the full postal code. For non-US addresses, only the first 3 + * digits are returned to avoid consuming a lookup. + */ + pc?: string; + + /** + * The province or state abbreviation. Returned instead of `pc` when + * `provInsteadOfPC=true`. + */ + prov?: string; + } + } +} + +export interface AddressVerificationGetLookupInfoResponse { + data: AddressVerificationGetLookupInfoResponse.Data; + + message: string; + + status: 'success' | 'error'; +} + +export namespace AddressVerificationGetLookupInfoResponse { + export interface Data { + /** + * The maximum number of lookups allowed in the current billing period. `null` + * indicates an unlimited plan. + */ + freeLimit: number | null; + + /** + * The number of lookups consumed in the current billing period. + */ + used: number; + } +} + +export interface AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse { + data: Array; + + message: string; + + status: 'success' | 'error'; +} + +export namespace AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse { + export interface Data { + /** + * The city name. + */ + city: string; + + /** + * The ISO 2-letter country code. + */ + country: string; + + /** + * The province or state abbreviation. + */ + provinceOrState: string; + + /** + * The county name (US addresses only). + */ + county?: string; + + /** + * The FIPS code for the county (US addresses only). + */ + countyFIPS?: string; + + /** + * Whether the location is mailable. + */ + mailable?: boolean; + + /** + * The USPS preferred city name for this postal code. + */ + preferredCity?: string; + + /** + * The USPS ZIP code class (e.g. `S` for standard, `P` for PO Box only). + */ + zipClass?: string; + } +} + +export interface AddressVerificationLookupZipCodeFromCityOrStateResponse { + data: AddressVerificationLookupZipCodeFromCityOrStateResponse.Data; + + message: string; + + status: 'success' | 'error'; +} + +export namespace AddressVerificationLookupZipCodeFromCityOrStateResponse { + export interface Data { + zipCodes: Array; + } +} + +export interface AddressVerificationParseAnAddressResponse { + data: AddressVerificationParseAnAddressResponse.Data; + + message: string; + + status: 'success' | 'error'; +} + +export namespace AddressVerificationParseAnAddressResponse { + export interface Data { + /** + * The category of the location (e.g. restaurant). + */ + category?: string; + + /** + * The city name. + */ + city?: string; + + /** + * The borough within a city. + */ + cityDistrict?: string; + + /** + * The country. + */ + country?: string; + + /** + * The name of the location. + */ + house?: string; + + /** + * The house or street number. + */ + houseNumber?: string; + + /** + * The name of the island. + */ + island?: string; + + /** + * The floor. + */ + level?: string; + + /** + * Populated if the input query contains a near/in qualifier. + */ + near?: string; + + /** + * The postal office box. + */ + poBox?: string; + + /** + * The postal or ZIP code. + */ + postcode?: string; + + /** + * The street name. + */ + road?: string; + + /** + * The state or province. + */ + state?: string; + + /** + * The county. + */ + stateDistrict?: string; + + /** + * The unofficial neighborhood name. + */ + suburb?: string; + + /** + * The apartment, unit, office, lot, or other secondary unit designator. + */ + unit?: string; + } +} + +export interface AddressVerificationSuggestAddressesResponse { + data: Array; + + message: string; + + status: 'success' | 'error'; +} + +export namespace AddressVerificationSuggestAddressesResponse { + export interface Data { + /** + * The city name of the address. + */ + city: string; + + /** + * The country code of the address. + */ + country: string; + + /** + * The first line of the address. + */ + line1: string; + + /** + * The postal code or ZIP code of the address. + */ + postalOrZip: string; + + /** + * The province or state of the address. + */ + provinceOrState: string; + + /** + * The country name of the address. + */ + countryName?: string; + + /** + * If you supply `includeDetails=true` as a query parameter, we will also populate + * an additional `details` field that follows the + * [Address Details](https://avdocs.postgrid.com/#address-details) schema. + */ + details?: Data.Details; + + /** + * Errors encountered during address verification. + */ + errors?: AddressVerificationAPI.Errors; + + /** + * The firm name of the address. + */ + firmName?: string; + + /** + * If the `geocode=true` query parameter is supplied, the response will include a + * geocodeResult which follows the + * [Geocoding](https://avdocs.postgrid.com/#geocoding) schema. You can request this + * feature be enabled by emailing `support@postgrid.com`. This includes our + * verification, batch verification, suggestions, and POST /completions endpoint. + * Note that you must supply country when geocoding to get the result successfully. + */ + geocodeResult?: Data.GeocodeResult; + + /** + * The second line of the address. + */ + line2?: string; + + /** + * The full name of the province or state. + */ + provinceOrStateName?: string; + + /** + * The verification status of an address. + */ + status?: AddressVerificationAPI.Status; + + /** + * The zip plus 4 code of the address. + */ + zipPlus4?: string; + } + + export namespace Data { + /** + * If you supply `includeDetails=true` as a query parameter, we will also populate + * an additional `details` field that follows the + * [Address Details](https://avdocs.postgrid.com/#address-details) schema. + */ + export interface Details { + /** + * PO Box ID + */ + boxID?: string; + + /** + * County in the United States (US address only) + */ + county?: string; + + /** + * FIPS code for county (US address only) + */ + countyNum?: string; + + /** + * Delivery installation area name + */ + deliveryInstallationAreaName?: string; + + /** + * Delivery installation qualifier + */ + deliveryInstallationQualifier?: string; + + /** + * Delivery installation type + */ + deliveryInstallationType?: string; + + /** + * Any extra information relevant to the address + */ + extraInfo?: string; + + /** + * The post-direction of the street (after the street name, US addresses only) + */ + postDirection?: string; + + /** + * The pre-direction of the street (before the street name, US addresses only) + */ + preDirection?: string; + + /** + * Indicates that the address is residential (US address only) + */ + residential?: boolean; + + /** + * Rural route number + */ + ruralRouteNumber?: string; + + /** + * Rural route type + */ + ruralRouteType?: string; + + /** + * The direction of the street (N, S, E, W, etc) + */ + streetDirection?: string; + + /** + * Name of the street where the address is located + */ + streetName?: string; + + /** + * Street number (e.g. the 20 in 20 Bay St) + */ + streetNumber?: string; + + /** + * Type of the street (DR, ST, BLVD, etc) + */ + streetType?: string; + + /** + * The unit number/name + */ + suiteID?: string; + + /** + * The suite key + */ + suiteKey?: string; + + /** + * US Census block number + */ + usCensusBlockNumber?: string; + + /** + * US Census consolidated metropolitan statistical area + */ + usCensusCMSA?: string; + + /** + * US Census FIPS code (US address only) + */ + usCensusFIPS?: string; + + /** + * US Census metropolitan area + */ + usCensusMA?: string; + + /** + * US Census metropolitan statistical area + */ + usCensusMSA?: string; + + /** + * US Census primary metropolitan statistical area + */ + usCensusPMSA?: string; + + /** + * US Census tract number + */ + usCensusTractNumber?: string; + + /** + * US congressional district number + */ + usCongressionalDistrictNumber?: string; + + /** + * True if address location recognizes DST + */ + usHasDaylightSavings?: boolean; + + /** + * PostNet barcode digit + */ + usMailingCheckDigit?: string; + + /** + * 4-character code assigned to mail delivery route within a 5 digit zip code + */ + usMailingsCarrierRoute?: string; + + /** + * True if US address matches a high-rise default or rural route default in the + * USPS data + */ + usMailingsDefaultFlag?: boolean; + + /** + * Unique USPS identifier for the delivery point + */ + usMailingsDeliveryPoint?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvConfirmationIndicator?: string; + + /** + * Y if this is a commercial mail receiving agency, N otherwise + */ + usMailingsDpvCrmaIndicator?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvFootnote1?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvFootnote2?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsDpvFootnote3?: string; + + /** + * A for ascending, D for descending + */ + usMailingsElotAscDesc?: string; + + /** + * eLOT sequence number + */ + usMailingsElotSequenceNumber?: string; + + /** + * Y if address is in early warning system database + */ + usMailingsEWSFlag?: string; + + /** + * Y if address converted by LACS + */ + usMailingsLACSFlag?: string; + + /** + * Corresponds to USPS LACSLink return code + */ + usMailingsLACSReturnCode?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsRecordTypeCode?: string; + + /** + * See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv) + */ + usMailingsSuiteLinkReturnCode?: string; + + /** + * PostNet barcode for the address (US address only) + */ + usPostnetBarcode?: string; + + /** + * Lower legislative district for the US address + */ + usStateLegislativeLower?: string; + + /** + * Upper legislative district for the US address + */ + usStateLegislativeUpper?: string; + + /** + * Time zone for the US address area + */ + usTimeZone?: string; + + /** + * Indicates that the address is vacant according to the USPS (US address only) + */ + vacant?: boolean; + } + + /** + * If the `geocode=true` query parameter is supplied, the response will include a + * geocodeResult which follows the + * [Geocoding](https://avdocs.postgrid.com/#geocoding) schema. You can request this + * feature be enabled by emailing `support@postgrid.com`. This includes our + * verification, batch verification, suggestions, and POST /completions endpoint. + * Note that you must supply country when geocoding to get the result successfully. + */ + export interface GeocodeResult { + /** + * A real number from 0.00 to 1.00 which represents an + * [accuracy score](https://avdocs.postgrid.com/#accuracy-score) + */ + accuracy: number; + + /** + * A string representing the + * [accuracy type](https://avdocs.postgrid.com/#accuracy-type) + */ + accuracyType: + | 'rooftop' + | 'point' + | 'range_interpolation' + | 'nearest_rooftop_match' + | 'intersection' + | 'street_center' + | 'place' + | 'state'; + + /** + * Object that contains `lat`, `lng` properties with number values + */ + location: GeocodeResult.Location; + } - /** - * Errors related to the province or state. - */ - provinceOrState?: Array; -} + export namespace GeocodeResult { + /** + * Object that contains `lat`, `lng` properties with number values + */ + export interface Location { + lat: number; -/** - * The verification status of an address. - */ -export type Status = 'verified' | 'corrected' | 'failed'; + lng: number; + } + } + } +} export interface AddressVerificationVerifyResponse { data: AddressVerificationVerifyResponse.Data; @@ -153,6 +1991,11 @@ export namespace AddressVerificationVerifyResponse { */ line2?: string; + /** + * The full name of the province or state. + */ + provinceOrStateName?: string; + /** * The verification status of an address. */ @@ -271,6 +2114,11 @@ export namespace AddressVerificationVerifyResponse { */ usCensusCMSA?: string; + /** + * US Census FIPS code (US address only) + */ + usCensusFIPS?: string; + /** * US Census metropolitan area */ @@ -382,6 +2230,11 @@ export namespace AddressVerificationVerifyResponse { */ usMailingsSuiteLinkReturnCode?: string; + /** + * PostNet barcode for the address (US address only) + */ + usPostnetBarcode?: string; + /** * Lower legislative district for the US address */ @@ -451,6 +2304,296 @@ export namespace AddressVerificationVerifyResponse { } } +export interface AddressVerificationAutocompleteParams { + /** + * Body param: The partial street address to complete (e.g. `"22 Bay"`). + */ + partialStreet: string; + + /** + * Query param + */ + filterExact?: boolean; + + /** + * Query param + */ + geocode?: boolean; + + /** + * Query param + */ + includeDetails?: boolean; + + /** + * Query param + */ + index?: number; + + /** + * Query param + */ + limit?: number; + + /** + * Query param + */ + properCase?: boolean; + + /** + * Query param + */ + query_verifiedOnly?: boolean; + + /** + * Query param + */ + verify?: boolean; + + /** + * Body param: Filter results to a specific city. + */ + cityFilter?: string; + + /** + * Body param: Filter results to a specific country code. + */ + countryFilter?: string; + + /** + * Body param: Filter results to a specific postal code prefix. + */ + pcFilter?: string; + + /** + * Body param: Filter results to a specific state or province abbreviation. + */ + stateFilter?: string; + + /** + * Body param: If true, only return addresses that passed USPS/Canada Post + * verification. + */ + body_verifiedOnly?: boolean; +} + +export interface AddressVerificationBatchVerificationParams { + /** + * Body param: Array of addresses to verify. Each item can be a freeform string or + * structured address object. + */ + addresses: Array< + | AddressVerificationBatchVerificationParams.StandardFreeformAddressInput + | AddressVerificationBatchVerificationParams.StandardStructuredAddressInput + >; + + /** + * Query param + */ + geocode?: boolean; + + /** + * Query param + */ + includeDetails?: boolean; + + /** + * Query param + */ + properCase?: boolean; +} + +export namespace AddressVerificationBatchVerificationParams { + export interface StandardFreeformAddressInput { + /** + * The address you want to verify, written on a single line. + */ + address: string; + } + + export interface StandardStructuredAddressInput { + address: StandardStructuredAddressInput.Address; + } + + export namespace StandardStructuredAddressInput { + export interface Address { + /** + * The city of the address. + */ + city: string; + + /** + * The country of your address, one of `ca` or `us`. + */ + country: 'ca' | 'us'; + + /** + * The first line of the address. + */ + line1: string; + + /** + * The postal code or ZIP code of the address. + */ + postalOrZip: string; + + /** + * The province or state of the address. + */ + provinceOrState: string; + + /** + * The second line of the address. + */ + line2?: string; + + /** + * The optional firm/recipient name. + */ + recipient?: string; + } + } +} + +export interface AddressVerificationGetAutocompletePreviewsParams { + partialStreet: string; + + cityFilter?: string; + + countryFilter?: string; + + filterExact?: boolean; + + limit?: number; + + pcFilter?: string; + + properCase?: boolean; + + provInsteadOfPC?: boolean; + + stateFilter?: string; + + verifiedOnly?: boolean; +} + +export interface AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams { + postalOrZip: string; +} + +export interface AddressVerificationLookupZipCodeFromCityOrStateParams { + /** + * The city name. + */ + city: string; + + /** + * The country code. Currently only `US` is supported. + */ + countryCode: string; + + /** + * The state abbreviation (e.g. `NY`). + */ + state: string; +} + +export interface AddressVerificationParseAnAddressParams { + /** + * The address you want to verify, written on a single line. + */ + address: string; +} + +export type AddressVerificationSuggestAddressesParams = + | AddressVerificationSuggestAddressesParams.StandardFreeformAddressInput + | AddressVerificationSuggestAddressesParams.StandardStructuredAddressInput; + +export declare namespace AddressVerificationSuggestAddressesParams { + export interface StandardFreeformAddressInput { + /** + * Body param: The address you want to verify, written on a single line. + */ + address: string; + + /** + * Query param + */ + geocode?: boolean; + + /** + * Query param + */ + includeDetails?: boolean; + + /** + * Query param + */ + properCase?: boolean; + } + + export interface StandardStructuredAddressInput { + /** + * Body param + */ + address: StandardStructuredAddressInput.Address; + + /** + * Query param + */ + geocode?: boolean; + + /** + * Query param + */ + includeDetails?: boolean; + + /** + * Query param + */ + properCase?: boolean; + } + + export namespace StandardStructuredAddressInput { + export interface Address { + /** + * The city of the address. + */ + city: string; + + /** + * The country of your address, one of `ca` or `us`. + */ + country: 'ca' | 'us'; + + /** + * The first line of the address. + */ + line1: string; + + /** + * The postal code or ZIP code of the address. + */ + postalOrZip: string; + + /** + * The province or state of the address. + */ + provinceOrState: string; + + /** + * The second line of the address. + */ + line2?: string; + + /** + * The optional firm/recipient name. + */ + recipient?: string; + } + } +} + export type AddressVerificationVerifyParams = | AddressVerificationVerifyParams.StandardFreeformAddressInput | AddressVerificationVerifyParams.StandardStructuredAddressInput; @@ -544,7 +2687,22 @@ export declare namespace AddressVerification { export { type Errors as Errors, type Status as Status, + type AddressVerificationAutocompleteResponse as AddressVerificationAutocompleteResponse, + type AddressVerificationBatchVerificationResponse as AddressVerificationBatchVerificationResponse, + type AddressVerificationGetAutocompletePreviewsResponse as AddressVerificationGetAutocompletePreviewsResponse, + type AddressVerificationGetLookupInfoResponse as AddressVerificationGetLookupInfoResponse, + type AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse as AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse, + type AddressVerificationLookupZipCodeFromCityOrStateResponse as AddressVerificationLookupZipCodeFromCityOrStateResponse, + type AddressVerificationParseAnAddressResponse as AddressVerificationParseAnAddressResponse, + type AddressVerificationSuggestAddressesResponse as AddressVerificationSuggestAddressesResponse, type AddressVerificationVerifyResponse as AddressVerificationVerifyResponse, + type AddressVerificationAutocompleteParams as AddressVerificationAutocompleteParams, + type AddressVerificationBatchVerificationParams as AddressVerificationBatchVerificationParams, + type AddressVerificationGetAutocompletePreviewsParams as AddressVerificationGetAutocompletePreviewsParams, + type AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams as AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams, + type AddressVerificationLookupZipCodeFromCityOrStateParams as AddressVerificationLookupZipCodeFromCityOrStateParams, + type AddressVerificationParseAnAddressParams as AddressVerificationParseAnAddressParams, + type AddressVerificationSuggestAddressesParams as AddressVerificationSuggestAddressesParams, type AddressVerificationVerifyParams as AddressVerificationVerifyParams, }; } diff --git a/src/resources/index.ts b/src/resources/index.ts index 505e682..35e765a 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -4,16 +4,35 @@ export { AddressVerification, type Errors, type Status, + type AddressVerificationAutocompleteResponse, + type AddressVerificationBatchVerificationResponse, + type AddressVerificationGetAutocompletePreviewsResponse, + type AddressVerificationGetLookupInfoResponse, + type AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse, + type AddressVerificationLookupZipCodeFromCityOrStateResponse, + type AddressVerificationParseAnAddressResponse, + type AddressVerificationSuggestAddressesResponse, type AddressVerificationVerifyResponse, + type AddressVerificationAutocompleteParams, + type AddressVerificationBatchVerificationParams, + type AddressVerificationGetAutocompletePreviewsParams, + type AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams, + type AddressVerificationLookupZipCodeFromCityOrStateParams, + type AddressVerificationParseAnAddressParams, + type AddressVerificationSuggestAddressesParams, type AddressVerificationVerifyParams, } from './address-verification'; export { IntlAddressVerification, + type IntlAddressVerificationAutocompleteResponse, + type IntlAddressVerificationBatchVerificationResponse, + type IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse, + type IntlAddressVerificationGetAutocompletePreviewsResponse, type IntlAddressVerificationVerifyResponse, + type IntlAddressVerificationAutocompleteParams, + type IntlAddressVerificationBatchVerificationParams, + type IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams, + type IntlAddressVerificationGetAutocompletePreviewsParams, type IntlAddressVerificationVerifyParams, } from './intl-address-verification'; -export { - PrintMail, - type ContactCreateWithCompanyName, - type ContactCreateWithFirstName, -} from './print-mail/print-mail'; +export { PrintMail } from './print-mail/print-mail'; diff --git a/src/resources/intl-address-verification.ts b/src/resources/intl-address-verification.ts index b97fd1e..72c0376 100644 --- a/src/resources/intl-address-verification.ts +++ b/src/resources/intl-address-verification.ts @@ -12,6 +12,136 @@ import { RequestOptions } from '../internal/request-options'; * supporting both structured and freeform inputs. */ export class IntlAddressVerification extends APIResource { + /** + * Resolves an address preview `id` (from `GET /completions`) into a full address. + * + * Optionally verifies the resolved address through the standard US/CA verifier + * when `verify=true` is supplied and the address is in the US or Canada. + * + * - Uses 1 lookup per call. + * - When `verify=true` resolves a US or CA address, the response will be a + * `VerifiedAddress` instead of an `IntlAddressCompletion`. + * + * @example + * ```ts + * const response = + * await client.intlAddressVerification.autocomplete({ + * id: 'id', + * }); + * ``` + */ + autocomplete( + params: IntlAddressVerificationAutocompleteParams, + options?: RequestOptions, + ): APIPromise { + const { includeDetails, properCase, useEnhancedChinaDataset, verify, ...body } = params; + return this._client.post('/v1/intl_addver/completions', { + query: { includeDetails, properCase, useEnhancedChinaDataset, verify }, + body, + ...options, + }); + } + + /** + * Verify a batch of international addresses in a single request. Each address can + * be freeform or structured, matching the same input formats accepted by the + * single verification endpoint. + * + * - Uses 1 lookup per address. + * - Requires a secret API key. + * - Returns results in the same order as the input addresses. + * - If an individual address fails, its result will contain an `error` field + * rather than a `verifiedAddress`. + * + * @example + * ```ts + * const response = + * await client.intlAddressVerification.batchVerification({ + * addresses: [ + * { + * address: { + * country: 'country', + * line1: 'line1', + * postalOrZip: 'postalOrZip', + * provinceOrState: 'provinceOrState', + * }, + * }, + * ], + * }); + * ``` + */ + batchVerification( + params: IntlAddressVerificationBatchVerificationParams, + options?: RequestOptions, + ): APIPromise { + const { geoData, includeDetails, properCase, useEnhancedChinaDataset, ...body } = params; + return this._client.post('/v1/intl_addver/verifications/batch', { + query: { geoData, includeDetails, properCase, useEnhancedChinaDataset }, + body, + ...options, + }); + } + + /** + * Returns address completion previews for a partial address string, suitable for + * populating an autocomplete dropdown. + * + * **Regular mode** — supply `partialStreet` to search by partial street address. + * Results may include `Address` types (resolvable directly) and `Container` types + * (buildings/complexes that require a follow-up call). + * + * **Advanced mode** — supply `advanced=true` and a `container` ID (from a previous + * regular call) to drill into a building or complex and retrieve individual unit + * addresses. + * + * Results with `type: "Address"` can be fully resolved by passing their `id` to + * `POST /completions`. + * + * - Does not consume a lookup. + * + * @example + * ```ts + * const response = + * await client.intlAddressVerification.getAutocompleteAdvancedPreviews(); + * ``` + */ + getAutocompleteAdvancedPreviews( + query: IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { + return this._client.get('/v1/intl_addver/completions', { query, ...options }); + } + + /** + * Returns address completion previews for a partial address string, suitable for + * populating an autocomplete dropdown. + * + * **Regular mode** — supply `partialStreet` to search by partial street address. + * Results may include `Address` types (resolvable directly) and `Container` types + * (buildings/complexes that require a follow-up call). + * + * **Advanced mode** — supply `advanced=true` and a `container` ID (from a previous + * regular call) to drill into a building or complex and retrieve individual unit + * addresses. + * + * Results with `type: "Address"` can be fully resolved by passing their `id` to + * `POST /completions`. + * + * - Does not consume a lookup. + * + * @example + * ```ts + * const response = + * await client.intlAddressVerification.getAutocompletePreviews(); + * ``` + */ + getAutocompletePreviews( + query: IntlAddressVerificationGetAutocompletePreviewsParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { + return this._client.get('/v1/intl_addver/completions', { query, ...options }); + } + /** * Verify and standardize an international address. * @@ -41,22 +171,104 @@ export class IntlAddressVerification extends APIResource { } } -export interface IntlAddressVerificationVerifyResponse { +export interface IntlAddressVerificationAutocompleteResponse { /** - * The result of a verified international address. + * A fully resolved international address returned by `POST /completions`. */ - data: IntlAddressVerificationVerifyResponse.Data; + data: + | IntlAddressVerificationAutocompleteResponse.IntlAddressCompletion + | IntlAddressVerificationAutocompleteResponse.VerifiedAddress; message: string; status: 'success' | 'error'; } -export namespace IntlAddressVerificationVerifyResponse { +export namespace IntlAddressVerificationAutocompleteResponse { + /** + * A fully resolved international address returned by `POST /completions`. + */ + export interface IntlAddressCompletion { + /** + * The building name, if applicable. + */ + building?: string; + + /** + * The city or locality. + */ + city?: string; + + /** + * The company or organization name, if applicable. + */ + company?: string; + + /** + * The country name. + */ + country?: string; + + /** + * The ISO 2-letter country code. + */ + countryCode?: string; + + /** + * The department or floor, if applicable. + */ + department?: string; + + /** + * An error message if resolution failed. + */ + error?: string; + + /** + * The full formatted address string. + */ + formattedAddress?: string; + + /** + * The first address line. + */ + line1?: string; + + /** + * The second address line. + */ + line2?: string; + + /** + * The third address line. + */ + line3?: string; + + /** + * The fourth address line. + */ + line4?: string; + + /** + * The postal or ZIP code. + */ + postalOrZip?: string; + + /** + * The province or state code. + */ + provinceCode?: string; + + /** + * The province or state name. + */ + provinceOrState?: string; + } + /** * The result of a verified international address. */ - export interface Data { + export interface VerifiedAddress { /** * The city or locality. */ @@ -91,7 +303,7 @@ export namespace IntlAddressVerificationVerifyResponse { * Additional details about the verified address, such as premise, thoroughfare, * and locality. */ - details?: Data.Details; + details?: VerifiedAddress.Details; /** * Errors encountered during address verification. @@ -111,7 +323,7 @@ export namespace IntlAddressVerificationVerifyResponse { /** * Geocoding result for the verified address. */ - geoData?: Data.GeoData; + geoData?: VerifiedAddress.GeoData; /** * The second address line. @@ -131,7 +343,7 @@ export namespace IntlAddressVerificationVerifyResponse { /** * A summary of the verification process and match levels. */ - summary?: Data.Summary; + summary?: VerifiedAddress.Summary; /** * The ZIP+4 code (for US addresses). @@ -139,7 +351,7 @@ export namespace IntlAddressVerificationVerifyResponse { zipPlus4?: string; } - export namespace Data { + export namespace VerifiedAddress { /** * Additional details about the verified address, such as premise, thoroughfare, * and locality. @@ -383,6 +595,982 @@ export namespace IntlAddressVerificationVerifyResponse { } } +export interface IntlAddressVerificationBatchVerificationResponse { + data: IntlAddressVerificationBatchVerificationResponse.Data; + + message: string; + + status: 'success' | 'error'; +} + +export namespace IntlAddressVerificationBatchVerificationResponse { + export interface Data { + results: Array; + } + + export namespace Data { + export interface Result { + /** + * An error message for this address. Present when verification failed. + */ + error?: string; + + /** + * The result of a verified international address. + */ + verifiedAddress?: Result.VerifiedAddress; + } + + export namespace Result { + /** + * The result of a verified international address. + */ + export interface VerifiedAddress { + /** + * The city or locality. + */ + city: string; + + /** + * The country code (ISO 3166-1 alpha-2). + */ + country: string; + + /** + * The first address line. + */ + line1: string; + + /** + * The postal or ZIP code. + */ + postalOrZip: string; + + /** + * The province or state. + */ + provinceOrState: string; + + /** + * The full country name. + */ + countryName?: string; + + /** + * Additional details about the verified address, such as premise, thoroughfare, + * and locality. + */ + details?: VerifiedAddress.Details; + + /** + * Errors encountered during address verification. + */ + errors?: AddressVerificationAPI.Errors; + + /** + * The firm or company name, if available. + */ + firmName?: string; + + /** + * The formatted address string. + */ + formattedAddress?: string; + + /** + * Geocoding result for the verified address. + */ + geoData?: VerifiedAddress.GeoData; + + /** + * The second address line. + */ + line2?: string; + + /** + * The third address line, if available. + */ + line3?: string; + + /** + * The verification status of an address. + */ + status?: AddressVerificationAPI.Status; + + /** + * A summary of the verification process and match levels. + */ + summary?: VerifiedAddress.Summary; + + /** + * The ZIP+4 code (for US addresses). + */ + zipPlus4?: string; + } + + export namespace VerifiedAddress { + /** + * Additional details about the verified address, such as premise, thoroughfare, + * and locality. + */ + export interface Details { + /** + * The building name or number. + */ + building?: string; + + /** + * The type of building (e.g., apartment, office). + */ + buildingType?: string; + + /** + * The full city name. + */ + cityName?: string; + + /** + * Secondary city information. + */ + citySecondary?: string; + + /** + * The type of city (e.g., city, town, village). + */ + cityType?: string; + + /** + * The full delivery address. + */ + deliveryAddress?: string; + + /** + * The dependent locality (UK addresses). + */ + dependentLocality?: string; + + /** + * The double dependent locality (UK addresses). + */ + doubleDependentLocality?: string; + + /** + * The organization or company name. + */ + organization?: string; + + /** + * The primary part of the postal or ZIP code. + */ + postalOrZipPrimary?: string; + + /** + * The secondary part of the postal or ZIP code. + */ + postalOrZipSecondary?: string; + + /** + * The post box number. + */ + postBox?: string; + + /** + * The premise name or number. + */ + premise?: string; + + /** + * The premise number. + */ + premiseNumber?: string; + + /** + * Secondary premise information. + */ + premiseSecondary?: string; + + /** + * The type of premise (e.g., house, flat). + */ + premiseType?: string; + + /** + * The full name of the province or state. + */ + provinceOrStateName?: string; + + /** + * The type of province or state (e.g., province, state, region). + */ + provinceOrStateType?: string; + + /** + * The street name. + */ + street?: string; + + /** + * The directional suffix for the street (e.g., N, S, E, W). + */ + streetPostDirection?: string; + + /** + * The directional prefix for the street (e.g., N, S, E, W). + */ + streetPreDirection?: string; + + /** + * The type of street (e.g., St, Ave, Blvd). + */ + streetType?: string; + + /** + * The sub-administrative area. + */ + subAdministrativeArea?: string; + + /** + * The sub-building name or number (e.g., unit, suite). + */ + subBuilding?: string; + + /** + * The floor of the sub-building. + */ + SubBuildingFloor?: string; + + /** + * The sub-building number. + */ + subBuildingNumber?: string; + + /** + * The type of sub-building (e.g., floor, wing). + */ + subBuildingType?: string; + + /** + * The sub-street name. + */ + subStreet?: string; + + /** + * The directional suffix for the sub-street. + */ + subStreetPostDirection?: string; + + /** + * The directional prefix for the sub-street. + */ + subStreetPreDirection?: string; + + /** + * The type of sub-street. + */ + subStreetType?: string; + + /** + * The super-administrative area. + */ + superAdministrativeArea?: string; + + /** + * The telephone number associated with the address. + */ + telephone?: string; + } + + /** + * Geocoding result for the verified address. + */ + export interface GeoData { + /** + * The geocode accuracy. + */ + geoAccuracy?: string; + + /** + * The latitude of the address. + */ + latitude?: string; + + /** + * The longitude of the address. + */ + longitude?: string; + } + + /** + * A summary of the verification process and match levels. + */ + export interface Summary { + /** + * Context identification match level. + */ + contextIdentificationMatchLevel?: string; + + /** + * Lexicon identification match level. + */ + lexiconIdentificationMatchLevel?: string; + + /** + * The match score (0-100). + */ + matchScore?: number; + + /** + * Additional message about the verification. + */ + message?: string; + + /** + * The parsing status of the address. + */ + parsingStatus?: string; + + /** + * The status of the postal code. + */ + postCodeStatus?: string; + + /** + * The match level after post-processing. + */ + postProcessedVerificationMatchLevel?: string; + + /** + * The match level before post-processing. + */ + preProcessedVerificationMatchLevel?: string; + + /** + * The overall verification status. + */ + verificationStatus?: string; + } + } + } + } +} + +export interface IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse { + data: Array; + + message: string; + + status: 'success' | 'error'; +} + +export namespace IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse { + /** + * A single address suggestion returned by `GET /completions`. Use the `id` field + * to retrieve the full address via `POST /completions`. + */ + export interface Data { + /** + * The unique identifier for this result. Pass this to `POST /completions` to + * retrieve the full address. If the `type` is `Container`, pass it as the + * `container` parameter to `GET /completions` to drill down further. + */ + id?: string; + + /** + * A secondary description of the result (e.g. city and country). + */ + description?: string; + + /** + * An error message if the lookup failed for this result. + */ + error?: string; + + /** + * Character ranges within `text` that match the search input, for bolding in UI. + */ + highlight?: string; + + /** + * The human-readable address suggestion text. + */ + text?: string; + + /** + * The type of result. `Address` means this can be resolved directly via + * `POST /completions`. `Container` means the result represents a building or + * complex — perform another `GET /completions` with this `id` as `container` to + * get individual unit addresses. + */ + type?: string; + } +} + +export interface IntlAddressVerificationGetAutocompletePreviewsResponse { + data: Array; + + message: string; + + status: 'success' | 'error'; +} + +export namespace IntlAddressVerificationGetAutocompletePreviewsResponse { + /** + * A single address suggestion returned by `GET /completions`. Use the `id` field + * to retrieve the full address via `POST /completions`. + */ + export interface Data { + /** + * The unique identifier for this result. Pass this to `POST /completions` to + * retrieve the full address. If the `type` is `Container`, pass it as the + * `container` parameter to `GET /completions` to drill down further. + */ + id?: string; + + /** + * A secondary description of the result (e.g. city and country). + */ + description?: string; + + /** + * An error message if the lookup failed for this result. + */ + error?: string; + + /** + * Character ranges within `text` that match the search input, for bolding in UI. + */ + highlight?: string; + + /** + * The human-readable address suggestion text. + */ + text?: string; + + /** + * The type of result. `Address` means this can be resolved directly via + * `POST /completions`. `Container` means the result represents a building or + * complex — perform another `GET /completions` with this `id` as `container` to + * get individual unit addresses. + */ + type?: string; + } +} + +export interface IntlAddressVerificationVerifyResponse { + /** + * The result of a verified international address. + */ + data: IntlAddressVerificationVerifyResponse.Data; + + message: string; + + status: 'success' | 'error'; +} + +export namespace IntlAddressVerificationVerifyResponse { + /** + * The result of a verified international address. + */ + export interface Data { + /** + * The city or locality. + */ + city: string; + + /** + * The country code (ISO 3166-1 alpha-2). + */ + country: string; + + /** + * The first address line. + */ + line1: string; + + /** + * The postal or ZIP code. + */ + postalOrZip: string; + + /** + * The province or state. + */ + provinceOrState: string; + + /** + * The full country name. + */ + countryName?: string; + + /** + * Additional details about the verified address, such as premise, thoroughfare, + * and locality. + */ + details?: Data.Details; + + /** + * Errors encountered during address verification. + */ + errors?: AddressVerificationAPI.Errors; + + /** + * The firm or company name, if available. + */ + firmName?: string; + + /** + * The formatted address string. + */ + formattedAddress?: string; + + /** + * Geocoding result for the verified address. + */ + geoData?: Data.GeoData; + + /** + * The second address line. + */ + line2?: string; + + /** + * The third address line, if available. + */ + line3?: string; + + /** + * The verification status of an address. + */ + status?: AddressVerificationAPI.Status; + + /** + * A summary of the verification process and match levels. + */ + summary?: Data.Summary; + + /** + * The ZIP+4 code (for US addresses). + */ + zipPlus4?: string; + } + + export namespace Data { + /** + * Additional details about the verified address, such as premise, thoroughfare, + * and locality. + */ + export interface Details { + /** + * The building name or number. + */ + building?: string; + + /** + * The type of building (e.g., apartment, office). + */ + buildingType?: string; + + /** + * The full city name. + */ + cityName?: string; + + /** + * Secondary city information. + */ + citySecondary?: string; + + /** + * The type of city (e.g., city, town, village). + */ + cityType?: string; + + /** + * The full delivery address. + */ + deliveryAddress?: string; + + /** + * The dependent locality (UK addresses). + */ + dependentLocality?: string; + + /** + * The double dependent locality (UK addresses). + */ + doubleDependentLocality?: string; + + /** + * The organization or company name. + */ + organization?: string; + + /** + * The primary part of the postal or ZIP code. + */ + postalOrZipPrimary?: string; + + /** + * The secondary part of the postal or ZIP code. + */ + postalOrZipSecondary?: string; + + /** + * The post box number. + */ + postBox?: string; + + /** + * The premise name or number. + */ + premise?: string; + + /** + * The premise number. + */ + premiseNumber?: string; + + /** + * Secondary premise information. + */ + premiseSecondary?: string; + + /** + * The type of premise (e.g., house, flat). + */ + premiseType?: string; + + /** + * The full name of the province or state. + */ + provinceOrStateName?: string; + + /** + * The type of province or state (e.g., province, state, region). + */ + provinceOrStateType?: string; + + /** + * The street name. + */ + street?: string; + + /** + * The directional suffix for the street (e.g., N, S, E, W). + */ + streetPostDirection?: string; + + /** + * The directional prefix for the street (e.g., N, S, E, W). + */ + streetPreDirection?: string; + + /** + * The type of street (e.g., St, Ave, Blvd). + */ + streetType?: string; + + /** + * The sub-administrative area. + */ + subAdministrativeArea?: string; + + /** + * The sub-building name or number (e.g., unit, suite). + */ + subBuilding?: string; + + /** + * The floor of the sub-building. + */ + SubBuildingFloor?: string; + + /** + * The sub-building number. + */ + subBuildingNumber?: string; + + /** + * The type of sub-building (e.g., floor, wing). + */ + subBuildingType?: string; + + /** + * The sub-street name. + */ + subStreet?: string; + + /** + * The directional suffix for the sub-street. + */ + subStreetPostDirection?: string; + + /** + * The directional prefix for the sub-street. + */ + subStreetPreDirection?: string; + + /** + * The type of sub-street. + */ + subStreetType?: string; + + /** + * The super-administrative area. + */ + superAdministrativeArea?: string; + + /** + * The telephone number associated with the address. + */ + telephone?: string; + } + + /** + * Geocoding result for the verified address. + */ + export interface GeoData { + /** + * The geocode accuracy. + */ + geoAccuracy?: string; + + /** + * The latitude of the address. + */ + latitude?: string; + + /** + * The longitude of the address. + */ + longitude?: string; + } + + /** + * A summary of the verification process and match levels. + */ + export interface Summary { + /** + * Context identification match level. + */ + contextIdentificationMatchLevel?: string; + + /** + * Lexicon identification match level. + */ + lexiconIdentificationMatchLevel?: string; + + /** + * The match score (0-100). + */ + matchScore?: number; + + /** + * Additional message about the verification. + */ + message?: string; + + /** + * The parsing status of the address. + */ + parsingStatus?: string; + + /** + * The status of the postal code. + */ + postCodeStatus?: string; + + /** + * The match level after post-processing. + */ + postProcessedVerificationMatchLevel?: string; + + /** + * The match level before post-processing. + */ + preProcessedVerificationMatchLevel?: string; + + /** + * The overall verification status. + */ + verificationStatus?: string; + } + } +} + +export interface IntlAddressVerificationAutocompleteParams { + /** + * Body param + */ + id: string; + + /** + * Query param + */ + includeDetails?: boolean; + + /** + * Query param + */ + properCase?: boolean; + + /** + * Query param + */ + useEnhancedChinaDataset?: boolean; + + /** + * Query param + */ + verify?: boolean; +} + +export interface IntlAddressVerificationBatchVerificationParams { + /** + * Body param: Array of addresses to verify. Each item can be a freeform string or + * a structured address object. + */ + addresses: Array< + | IntlAddressVerificationBatchVerificationParams.StructuredAddressInput + | IntlAddressVerificationBatchVerificationParams.FreeformAddressInput + >; + + /** + * Query param + */ + geoData?: boolean; + + /** + * Query param + */ + includeDetails?: boolean; + + /** + * Query param + */ + properCase?: boolean; + + /** + * Query param + */ + useEnhancedChinaDataset?: boolean; +} + +export namespace IntlAddressVerificationBatchVerificationParams { + /** + * Input model for structured international address verification. + */ + export interface StructuredAddressInput { + address: StructuredAddressInput.Address; + } + + export namespace StructuredAddressInput { + export interface Address { + /** + * The country code (ISO 3166-1 alpha-2 or alpha-3). + */ + country: string; + + /** + * The first line of the address (e.g., street address, building, etc.). + */ + line1: string; + + /** + * The postal or ZIP code. + */ + postalOrZip: string; + + /** + * The administrative area (e.g., state, province, region). + */ + provinceOrState: string; + + /** + * The city, town, or locality of the address. + */ + city?: string; + + /** + * The second line of the address (e.g., apartment, suite, etc.). + */ + line2?: string; + + /** + * The third line of the address (e.g., additional locality or delivery info). + */ + line3?: string; + + /** + * The fourth line of the address (e.g., further address details). + */ + line4?: string; + } + } + + /** + * Input model for freeform international address verification. + */ + export interface FreeformAddressInput { + /** + * The full address as a single string. + */ + address: string; + } +} + +export interface IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams { + advanced?: boolean; + + cityFilter?: string; + + container?: string; + + countriesFilter?: string; + + disableIPBiasing?: boolean; + + language?: string; + + limit?: number; + + partialStreet?: string; + + postalOrZipFilter?: string; + + standardFallback?: boolean; + + streetFilter?: string; + + useEnhancedChinaDataset?: boolean; +} + +export interface IntlAddressVerificationGetAutocompletePreviewsParams { + advanced?: boolean; + + cityFilter?: string; + + container?: string; + + countriesFilter?: string; + + disableIPBiasing?: boolean; + + language?: string; + + limit?: number; + + partialStreet?: string; + + postalOrZipFilter?: string; + + standardFallback?: boolean; + + streetFilter?: string; + + useEnhancedChinaDataset?: boolean; +} + export type IntlAddressVerificationVerifyParams = | IntlAddressVerificationVerifyParams.StructuredAddressInput | IntlAddressVerificationVerifyParams.FreeformAddressInput; @@ -479,7 +1667,15 @@ export declare namespace IntlAddressVerificationVerifyParams { export declare namespace IntlAddressVerification { export { + type IntlAddressVerificationAutocompleteResponse as IntlAddressVerificationAutocompleteResponse, + type IntlAddressVerificationBatchVerificationResponse as IntlAddressVerificationBatchVerificationResponse, + type IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse as IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse, + type IntlAddressVerificationGetAutocompletePreviewsResponse as IntlAddressVerificationGetAutocompletePreviewsResponse, type IntlAddressVerificationVerifyResponse as IntlAddressVerificationVerifyResponse, + type IntlAddressVerificationAutocompleteParams as IntlAddressVerificationAutocompleteParams, + type IntlAddressVerificationBatchVerificationParams as IntlAddressVerificationBatchVerificationParams, + type IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams as IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams, + type IntlAddressVerificationGetAutocompletePreviewsParams as IntlAddressVerificationGetAutocompletePreviewsParams, type IntlAddressVerificationVerifyParams as IntlAddressVerificationVerifyParams, }; } diff --git a/src/resources/print-mail/boxes.ts b/src/resources/print-mail/boxes.ts new file mode 100644 index 0000000..a1e40f2 --- /dev/null +++ b/src/resources/print-mail/boxes.ts @@ -0,0 +1,1324 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import * as ContactsAPI from './contacts'; +import { APIPromise } from '../../core/api-promise'; +import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination'; +import { RequestOptions } from '../../internal/request-options'; +import { path } from '../../internal/utils/path'; + +export class Boxes extends APIResource { + /** + * This endpoint allows you to create a box containing up to 100 cheques. A Box is + * mailed to a single destination. + * + * To create a box. You must specify: + * + * - `to`: The recipient (contact or contact ID) + * - `from`: The sender (contact or contact ID) + * - `cheques`: An array of cheques to go in the box + * + * For each cheque You must specify: + * + * - `to`: The recipient (contact or contact ID) + * - `from`: The sender (contact or contact ID) + * - `bankAccount`: The bank account ID + * - `amount`: The amount to be sent + * - `number`: The cheque number + * + * @example + * ```ts + * const box = await client.printMail.boxes.create({ + * cheques: [ + * { + * from: 'contact_456', + * to: 'contact_123', + * bankAccount: 'bank_abc', + * amount: 5000, + * number: 1042, + * }, + * ], + * from: 'contact_456', + * to: 'contact_123', + * }); + * ``` + */ + create(body: BoxCreateParams, options?: RequestOptions): APIPromise { + return this._client.post('/print-mail/v1/boxes', { body, ...options }); + } + + /** + * Retrieve a box by ID. + * + * @example + * ```ts + * const box = await client.printMail.boxes.retrieve('id'); + * ``` + */ + retrieve(id: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/print-mail/v1/boxes/${id}`, options); + } + + /** + * List all boxes. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const boxListResponse of client.printMail.boxes.list()) { + * // ... + * } + * ``` + */ + list( + query: BoxListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList('/print-mail/v1/boxes', SkipLimit, { query, ...options }); + } + + /** + * Cancel a box by ID (cannot be undone). + * + * @example + * ```ts + * const box = await client.printMail.boxes.delete('id'); + * ``` + */ + delete(id: string, options?: RequestOptions): APIPromise { + return this._client.delete(path`/print-mail/v1/boxes/${id}`, options); + } + + /** + * Progresses a box's `status` to the next stage. This is only available in test + * mode and can be used to simulate how a live order would progress through the + * different statuses. + * + * Note: this will fail with an `invalid_progression_error` if the status is one of + * `completed` or `cancelled`. + * + * @example + * ```ts + * const response = await client.printMail.boxes.progressions( + * 'id', + * ); + * ``` + */ + progressions(id: string, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/boxes/${id}/progressions`, options); + } +} + +export type BoxListResponsesSkipLimit = SkipLimit; + +export interface BoxCreateResponse { + /** + * A unique ID prefixed with box\_ + */ + id: string; + + /** + * The cheques inside this box (in read mode). + */ + cheques: Array; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * The contact of the 'from' field in read mode should be a fully expanded Contact. + */ + from: ContactsAPI.Contact; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The mailing class of this order. This determines the speed and cost of delivery. + * See `OrderMailingClass` for more details. + */ + mailingClass: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Always "box". + */ + object: 'box'; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. For example, if this is a date on Tuesday, the order will transition to + * `printing` on Wednesday at midnight eastern time. + */ + sendDate: string; + + /** + * See `OrderStatus` for more details on the status of this order. + */ + status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled'; + + /** + * The recipient of this order. This will be provided even if you delete the + * underlying contact. + */ + to: ContactsAPI.Contact; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + cancellation?: BoxCreateResponse.Cancellation; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The last date that the IMB status was updated. See `imbStatus` for more details. + */ + imbDate?: string; + + /** + * The Intelligent Mail Barcode (IMB) status of this order. Only populated for + * US-printed and US-destined orders. This is the most detailed way to track + * non-express/certified orders. + */ + imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender'; + + /** + * The most recent ZIP code of the USPS facility that the order has been processed + * through. Only populated when an `imbStatus` is present. + */ + imbZIPCode?: string; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * The tracking number of this order. Populated after an express/certified order + * has been processed for delivery. + */ + trackingNumber?: string; + + /** + * PostGrid renders a PDF preview for all orders. This should be inspected to + * ensure that the order is correct before it is sent out because it shows what + * will be printed and mailed to the recipient. Once the PDF preview is generated, + * this field will be returned by all `GET` endpoints which produce this order. + * + * This URL is a signed link to the PDF preview. It will expire after a short + * period of time. If you need to access this URL after it has expired, you can + * regenerate it by calling the `GET` endpoint again. + */ + url?: string; +} + +export namespace BoxCreateResponse { + export interface Cheque { + /** + * The amount on the cheque. + */ + amount: number; + + /** + * The bank account (ID or reference) from which the cheque amount is drawn. + */ + bankAccount: string; + + from: ContactsAPI.Contact; + + /** + * The cheque number. + */ + number: number; + + to: ContactsAPI.Contact; + + /** + * A URL to a logo for the cheque (optional). + */ + logoURL?: string; + + /** + * The memo text on the cheque (optional). + */ + memo?: string; + + /** + * A set of dynamic merge variables for customizing the cheque or accompanying + * documents (optional). + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * An optional message template to be printed on or with the cheque. + */ + messageTemplate?: string; + } + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + export interface Cancellation { + /** + * The reason for the cancellation. + */ + reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class'; + + /** + * The user ID who cancelled the order. + */ + cancelledByUser?: string; + + /** + * An optional note provided by the user who cancelled the order. + */ + note?: string; + } +} + +export interface BoxRetrieveResponse { + /** + * A unique ID prefixed with box\_ + */ + id: string; + + /** + * The cheques inside this box (in read mode). + */ + cheques: Array; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * The contact of the 'from' field in read mode should be a fully expanded Contact. + */ + from: ContactsAPI.Contact; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The mailing class of this order. This determines the speed and cost of delivery. + * See `OrderMailingClass` for more details. + */ + mailingClass: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Always "box". + */ + object: 'box'; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. For example, if this is a date on Tuesday, the order will transition to + * `printing` on Wednesday at midnight eastern time. + */ + sendDate: string; + + /** + * See `OrderStatus` for more details on the status of this order. + */ + status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled'; + + /** + * The recipient of this order. This will be provided even if you delete the + * underlying contact. + */ + to: ContactsAPI.Contact; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + cancellation?: BoxRetrieveResponse.Cancellation; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The last date that the IMB status was updated. See `imbStatus` for more details. + */ + imbDate?: string; + + /** + * The Intelligent Mail Barcode (IMB) status of this order. Only populated for + * US-printed and US-destined orders. This is the most detailed way to track + * non-express/certified orders. + */ + imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender'; + + /** + * The most recent ZIP code of the USPS facility that the order has been processed + * through. Only populated when an `imbStatus` is present. + */ + imbZIPCode?: string; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * The tracking number of this order. Populated after an express/certified order + * has been processed for delivery. + */ + trackingNumber?: string; + + /** + * PostGrid renders a PDF preview for all orders. This should be inspected to + * ensure that the order is correct before it is sent out because it shows what + * will be printed and mailed to the recipient. Once the PDF preview is generated, + * this field will be returned by all `GET` endpoints which produce this order. + * + * This URL is a signed link to the PDF preview. It will expire after a short + * period of time. If you need to access this URL after it has expired, you can + * regenerate it by calling the `GET` endpoint again. + */ + url?: string; +} + +export namespace BoxRetrieveResponse { + export interface Cheque { + /** + * The amount on the cheque. + */ + amount: number; + + /** + * The bank account (ID or reference) from which the cheque amount is drawn. + */ + bankAccount: string; + + from: ContactsAPI.Contact; + + /** + * The cheque number. + */ + number: number; + + to: ContactsAPI.Contact; + + /** + * A URL to a logo for the cheque (optional). + */ + logoURL?: string; + + /** + * The memo text on the cheque (optional). + */ + memo?: string; + + /** + * A set of dynamic merge variables for customizing the cheque or accompanying + * documents (optional). + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * An optional message template to be printed on or with the cheque. + */ + messageTemplate?: string; + } + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + export interface Cancellation { + /** + * The reason for the cancellation. + */ + reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class'; + + /** + * The user ID who cancelled the order. + */ + cancelledByUser?: string; + + /** + * An optional note provided by the user who cancelled the order. + */ + note?: string; + } +} + +export interface BoxListResponse { + /** + * A unique ID prefixed with box\_ + */ + id: string; + + /** + * The cheques inside this box (in read mode). + */ + cheques: Array; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * The contact of the 'from' field in read mode should be a fully expanded Contact. + */ + from: ContactsAPI.Contact; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The mailing class of this order. This determines the speed and cost of delivery. + * See `OrderMailingClass` for more details. + */ + mailingClass: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Always "box". + */ + object: 'box'; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. For example, if this is a date on Tuesday, the order will transition to + * `printing` on Wednesday at midnight eastern time. + */ + sendDate: string; + + /** + * See `OrderStatus` for more details on the status of this order. + */ + status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled'; + + /** + * The recipient of this order. This will be provided even if you delete the + * underlying contact. + */ + to: ContactsAPI.Contact; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + cancellation?: BoxListResponse.Cancellation; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The last date that the IMB status was updated. See `imbStatus` for more details. + */ + imbDate?: string; + + /** + * The Intelligent Mail Barcode (IMB) status of this order. Only populated for + * US-printed and US-destined orders. This is the most detailed way to track + * non-express/certified orders. + */ + imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender'; + + /** + * The most recent ZIP code of the USPS facility that the order has been processed + * through. Only populated when an `imbStatus` is present. + */ + imbZIPCode?: string; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * The tracking number of this order. Populated after an express/certified order + * has been processed for delivery. + */ + trackingNumber?: string; + + /** + * PostGrid renders a PDF preview for all orders. This should be inspected to + * ensure that the order is correct before it is sent out because it shows what + * will be printed and mailed to the recipient. Once the PDF preview is generated, + * this field will be returned by all `GET` endpoints which produce this order. + * + * This URL is a signed link to the PDF preview. It will expire after a short + * period of time. If you need to access this URL after it has expired, you can + * regenerate it by calling the `GET` endpoint again. + */ + url?: string; +} + +export namespace BoxListResponse { + export interface Cheque { + /** + * The amount on the cheque. + */ + amount: number; + + /** + * The bank account (ID or reference) from which the cheque amount is drawn. + */ + bankAccount: string; + + from: ContactsAPI.Contact; + + /** + * The cheque number. + */ + number: number; + + to: ContactsAPI.Contact; + + /** + * A URL to a logo for the cheque (optional). + */ + logoURL?: string; + + /** + * The memo text on the cheque (optional). + */ + memo?: string; + + /** + * A set of dynamic merge variables for customizing the cheque or accompanying + * documents (optional). + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * An optional message template to be printed on or with the cheque. + */ + messageTemplate?: string; + } + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + export interface Cancellation { + /** + * The reason for the cancellation. + */ + reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class'; + + /** + * The user ID who cancelled the order. + */ + cancelledByUser?: string; + + /** + * An optional note provided by the user who cancelled the order. + */ + note?: string; + } +} + +export interface BoxDeleteResponse { + /** + * A unique ID prefixed with box\_ + */ + id: string; + + /** + * The cheques inside this box (in read mode). + */ + cheques: Array; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * The contact of the 'from' field in read mode should be a fully expanded Contact. + */ + from: ContactsAPI.Contact; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The mailing class of this order. This determines the speed and cost of delivery. + * See `OrderMailingClass` for more details. + */ + mailingClass: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Always "box". + */ + object: 'box'; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. For example, if this is a date on Tuesday, the order will transition to + * `printing` on Wednesday at midnight eastern time. + */ + sendDate: string; + + /** + * See `OrderStatus` for more details on the status of this order. + */ + status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled'; + + /** + * The recipient of this order. This will be provided even if you delete the + * underlying contact. + */ + to: ContactsAPI.Contact; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + cancellation?: BoxDeleteResponse.Cancellation; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The last date that the IMB status was updated. See `imbStatus` for more details. + */ + imbDate?: string; + + /** + * The Intelligent Mail Barcode (IMB) status of this order. Only populated for + * US-printed and US-destined orders. This is the most detailed way to track + * non-express/certified orders. + */ + imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender'; + + /** + * The most recent ZIP code of the USPS facility that the order has been processed + * through. Only populated when an `imbStatus` is present. + */ + imbZIPCode?: string; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * The tracking number of this order. Populated after an express/certified order + * has been processed for delivery. + */ + trackingNumber?: string; + + /** + * PostGrid renders a PDF preview for all orders. This should be inspected to + * ensure that the order is correct before it is sent out because it shows what + * will be printed and mailed to the recipient. Once the PDF preview is generated, + * this field will be returned by all `GET` endpoints which produce this order. + * + * This URL is a signed link to the PDF preview. It will expire after a short + * period of time. If you need to access this URL after it has expired, you can + * regenerate it by calling the `GET` endpoint again. + */ + url?: string; +} + +export namespace BoxDeleteResponse { + export interface Cheque { + /** + * The amount on the cheque. + */ + amount: number; + + /** + * The bank account (ID or reference) from which the cheque amount is drawn. + */ + bankAccount: string; + + from: ContactsAPI.Contact; + + /** + * The cheque number. + */ + number: number; + + to: ContactsAPI.Contact; + + /** + * A URL to a logo for the cheque (optional). + */ + logoURL?: string; + + /** + * The memo text on the cheque (optional). + */ + memo?: string; + + /** + * A set of dynamic merge variables for customizing the cheque or accompanying + * documents (optional). + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * An optional message template to be printed on or with the cheque. + */ + messageTemplate?: string; + } + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + export interface Cancellation { + /** + * The reason for the cancellation. + */ + reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class'; + + /** + * The user ID who cancelled the order. + */ + cancelledByUser?: string; + + /** + * An optional note provided by the user who cancelled the order. + */ + note?: string; + } +} + +export interface BoxProgressionsResponse { + /** + * A unique ID prefixed with box\_ + */ + id: string; + + /** + * The cheques inside this box (in read mode). + */ + cheques: Array; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * The contact of the 'from' field in read mode should be a fully expanded Contact. + */ + from: ContactsAPI.Contact; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The mailing class of this order. This determines the speed and cost of delivery. + * See `OrderMailingClass` for more details. + */ + mailingClass: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Always "box". + */ + object: 'box'; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. For example, if this is a date on Tuesday, the order will transition to + * `printing` on Wednesday at midnight eastern time. + */ + sendDate: string; + + /** + * See `OrderStatus` for more details on the status of this order. + */ + status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled'; + + /** + * The recipient of this order. This will be provided even if you delete the + * underlying contact. + */ + to: ContactsAPI.Contact; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + cancellation?: BoxProgressionsResponse.Cancellation; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The last date that the IMB status was updated. See `imbStatus` for more details. + */ + imbDate?: string; + + /** + * The Intelligent Mail Barcode (IMB) status of this order. Only populated for + * US-printed and US-destined orders. This is the most detailed way to track + * non-express/certified orders. + */ + imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender'; + + /** + * The most recent ZIP code of the USPS facility that the order has been processed + * through. Only populated when an `imbStatus` is present. + */ + imbZIPCode?: string; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * The tracking number of this order. Populated after an express/certified order + * has been processed for delivery. + */ + trackingNumber?: string; + + /** + * PostGrid renders a PDF preview for all orders. This should be inspected to + * ensure that the order is correct before it is sent out because it shows what + * will be printed and mailed to the recipient. Once the PDF preview is generated, + * this field will be returned by all `GET` endpoints which produce this order. + * + * This URL is a signed link to the PDF preview. It will expire after a short + * period of time. If you need to access this URL after it has expired, you can + * regenerate it by calling the `GET` endpoint again. + */ + url?: string; +} + +export namespace BoxProgressionsResponse { + export interface Cheque { + /** + * The amount on the cheque. + */ + amount: number; + + /** + * The bank account (ID or reference) from which the cheque amount is drawn. + */ + bankAccount: string; + + from: ContactsAPI.Contact; + + /** + * The cheque number. + */ + number: number; + + to: ContactsAPI.Contact; + + /** + * A URL to a logo for the cheque (optional). + */ + logoURL?: string; + + /** + * The memo text on the cheque (optional). + */ + memo?: string; + + /** + * A set of dynamic merge variables for customizing the cheque or accompanying + * documents (optional). + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * An optional message template to be printed on or with the cheque. + */ + messageTemplate?: string; + } + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + export interface Cancellation { + /** + * The reason for the cancellation. + */ + reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class'; + + /** + * The user ID who cancelled the order. + */ + cancelledByUser?: string; + + /** + * An optional note provided by the user who cancelled the order. + */ + note?: string; + } +} + +export interface BoxCreateParams { + /** + * The cheques to be mailed in the box. Only 100 cheques can be included in a box + * at a time. + */ + cheques: Array; + + /** + * The 'from' (sender) of the entire box. Accepts inline ContactCreate or a + * contactID. + */ + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; + + /** + * The recipient of this order. You can either supply the contact information + * inline here or provide a contact ID. PostGrid will automatically deduplicate + * contacts regardless of whether you provide the information inline here or call + * the contact creation endpoint. + */ + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The mailing class of this order. If not provided, automatically set to + * `first_class`. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. You can use this parameter to schedule orders for a future date. + */ + sendDate?: string; +} + +export namespace BoxCreateParams { + export interface Cheque { + /** + * The amount on the cheque. + */ + amount: number; + + /** + * The bank account (ID or reference) from which the cheque amount is drawn. + */ + bankAccount: string; + + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; + + /** + * The cheque number. + */ + number: number; + + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; + + /** + * A URL to a logo for the cheque (optional). + */ + logoURL?: string; + + /** + * The memo text on the cheque (optional). + */ + memo?: string; + + /** + * A set of dynamic merge variables for customizing the cheque or accompanying + * documents (optional). + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * An optional message template to be printed on or with the cheque. + */ + messageTemplate?: string; + } +} + +export interface BoxListParams extends SkipLimitParams { + /** + * You can supply any string to help narrow down the list of resources. For + * example, if you pass `"New York"` (quoted), it will return resources that have + * that string present somewhere in their response. Alternatively, you can supply a + * structured search query. See the documentation on `StructuredSearchQuery` for + * more details. + */ + search?: string; +} + +export declare namespace Boxes { + export { + type BoxCreateResponse as BoxCreateResponse, + type BoxRetrieveResponse as BoxRetrieveResponse, + type BoxListResponse as BoxListResponse, + type BoxDeleteResponse as BoxDeleteResponse, + type BoxProgressionsResponse as BoxProgressionsResponse, + type BoxListResponsesSkipLimit as BoxListResponsesSkipLimit, + type BoxCreateParams as BoxCreateParams, + type BoxListParams as BoxListParams, + }; +} diff --git a/src/resources/print-mail/campaigns.ts b/src/resources/print-mail/campaigns.ts index 09ed25e..533eb62 100644 --- a/src/resources/print-mail/campaigns.ts +++ b/src/resources/print-mail/campaigns.ts @@ -1,6 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; +import * as ChequesAPI from './cheques'; +import * as LettersAPI from './letters'; import { APIPromise } from '../../core/api-promise'; import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination'; import { buildHeaders } from '../../internal/headers'; @@ -15,9 +17,12 @@ export class Campaigns extends APIResource { /** * Create a new campaign. * - * A campaign links a mailing list with a specific mail piece profile (letter, - * postcard, cheque, or self-mailer) to send bulk mail. Upon creation, the campaign - * enters the `drafting` status while assets are validated. + * A campaign links a mailing list with a specific mail piece configuration + * (letter, postcard, cheque, self-mailer, or snap pack) to send bulk mail. Only + * one collateral type can be set per campaign. + * + * Upon creation, the campaign enters the `drafting` status while assets are + * validated. * * @example * ```ts @@ -177,9 +182,10 @@ export interface Campaign { updatedAt: string; /** - * The ID of the cheque profile used for this campaign, if applicable. + * Inline cheque configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. */ - chequeProfile?: string; + cheque?: Campaign.Cheque; /** * The ID of the default sender contact to use for orders if not specified per @@ -200,9 +206,10 @@ export interface Campaign { errors?: Array; /** - * The ID of the letter profile used for this campaign, if applicable. + * Inline letter configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. */ - letterProfile?: string; + letter?: Campaign.Letter; /** * See the section on Metadata. @@ -216,9 +223,10 @@ export interface Campaign { orderPreviewURL?: string; /** - * The ID of the postcard profile used for this campaign, if applicable. + * Inline postcard configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. */ - postcardProfile?: string; + postcard?: Campaign.Postcard; /** * A temporary URL to download the processing report, available once the campaign @@ -227,17 +235,144 @@ export interface Campaign { reportURL?: string; /** - * The ID of the self-mailer profile used for this campaign, if applicable. + * Inline self-mailer configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. */ - selfMailerProfile?: string; + selfMailer?: Campaign.SelfMailer; /** * The scheduled date and time for the campaign to be sent. */ sendDate?: string; + + /** + * Inline snap pack configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + snapPack?: Campaign.SnapPack; } export namespace Campaign { + /** + * Inline cheque configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface Cheque { + /** + * ID of the bank account to use for the cheque. + */ + bankAccount?: string; + + /** + * Enum representing the supported currency codes. + */ + currencyCode?: 'CAD' | 'USD'; + + /** + * An optional description. + */ + description?: string; + + /** + * The custom envelope ID or `"standard"`. + */ + envelope?: string; + + /** + * Settings for the attached letter (e.g., color printing). + */ + letterSettings?: Cheque.LetterSettings; + + /** + * ID of a template for an optional attached letter. Cannot be used with + * `letterPDF`. + */ + letterTemplate?: string; + + /** + * A signed URL to the attached letter PDF, if any. + */ + letterUploadedPDF?: string; + + /** + * A publicly accessible URL for the logo to print on the cheque. + */ + logo?: string; + + /** + * Mailing class for the cheque. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Memo line text for the cheque. + */ + memo?: string; + + /** + * Default merge variables for the cheque. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Message included on the cheque stub. + */ + message?: string; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * ID of a return envelope to include. + */ + returnEnvelope?: string; + + /** + * Enum representing the supported cheque sizes. + */ + size?: ChequesAPI.ChequeSize; + } + + export namespace Cheque { + /** + * Settings for the attached letter (e.g., color printing). + */ + export interface LetterSettings { + /** + * Whether to print the attached letter in color. + */ + color?: boolean; + } + } + /** * Details of a specific error encountered during campaign processing. */ @@ -252,6 +387,335 @@ export namespace Campaign { */ type: 'processing_error' | 'internal_error'; } + + /** + * Inline letter configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface Letter { + /** + * Enum representing the placement of the address on the letter. + */ + addressPlacement?: LettersAPI.AddressPlacement; + + /** + * Model representing an attached PDF. + */ + attachedPDF?: LettersAPI.AttachedPdf; + + /** + * Whether to print in color. + */ + color?: boolean; + + /** + * An optional description. + */ + description?: string; + + /** + * Whether to print on both sides of the paper. + */ + doubleSided?: boolean; + + /** + * The custom envelope ID or `"standard"`. + */ + envelope?: string; + + /** + * The type of envelope used for the letter. + */ + envelopeType?: 'standard_double_window' | 'flat'; + + /** + * Mailing class for the letter. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the letter. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * Which page number should be perforated (if any). + */ + perforatedPage?: 1; + + /** + * ID of a return envelope to include. + */ + returnEnvelope?: string; + + /** + * Enum representing the supported letter sizes. + */ + size?: LettersAPI.LetterSize; + + /** + * ID of a template for the letter content. Cannot be used with `pdf`. + */ + template?: string; + + /** + * A signed URL to the uploaded PDF, if any. + */ + uploadedPDF?: string; + } + + /** + * Inline postcard configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface Postcard { + /** + * ID of the template for the back side. Cannot be used with `pdf`. + */ + backTemplate?: string; + + /** + * An optional description. + */ + description?: string; + + /** + * ID of the template for the front side. Cannot be used with `pdf`. + */ + frontTemplate?: string; + + /** + * Mailing class for the postcard. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the postcard. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * Premium paper identifier. Use "standard" for regular stock or a premium*paper*\* + * ID. + */ + paper?: string; + + /** + * Enum representing the supported postcard sizes. + */ + size?: '6x4' | '9x6' | '11x6'; + + /** + * A signed URL to the uploaded PDF, if any. + */ + uploadedPDF?: string; + } + + /** + * Inline self-mailer configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface SelfMailer { + /** + * An optional description. + */ + description?: string; + + /** + * ID of the template for the inside. Cannot be used with `pdf`. + */ + insideTemplate?: string; + + /** + * Mailing class for the self-mailer. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the self-mailer. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * ID of the template for the outside. Cannot be used with `pdf`. + */ + outsideTemplate?: string; + + /** + * Enum representing the supported self-mailer sizes. + */ + size?: '8.5x11_bifold' | '8.5x11_trifold' | '9.5x16_trifold'; + + /** + * A signed URL to the uploaded PDF, if any. + */ + uploadedPDF?: string; + } + + /** + * Inline snap pack configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface SnapPack { + /** + * An optional description. + */ + description?: string; + + /** + * ID of the template for the inside. Cannot be used with `pdf`. + */ + insideTemplate?: string; + + /** + * Mailing class for the snap pack. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the snap pack. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * ID of the template for the outside. Cannot be used with `pdf`. + */ + outsideTemplate?: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size?: '8.5x11_bifold_v'; + + /** + * A signed URL to the uploaded PDF, if any. + */ + uploadedPDF?: string; + } } export interface CampaignDeleteResponse { @@ -270,9 +734,10 @@ export interface CampaignCreateParams { mailingList: string; /** - * Body param: The ID of the cheque profile used for this campaign, if applicable. + * Body param: Inline cheque configuration for a campaign. All fields are optional + * since campaigns may be in a partial state during drafting. */ - chequeProfile?: string; + cheque?: CampaignCreateParams.Cheque; /** * Body param: The ID of the default sender contact to use for orders if not @@ -287,9 +752,10 @@ export interface CampaignCreateParams { description?: string; /** - * Body param: The ID of the letter profile used for this campaign, if applicable. + * Body param: Inline letter configuration for a campaign. All fields are optional + * since campaigns may be in a partial state during drafting. */ - letterProfile?: string; + letter?: CampaignCreateParams.Letter; /** * Body param: See the section on Metadata. @@ -297,74 +763,994 @@ export interface CampaignCreateParams { metadata?: { [key: string]: unknown }; /** - * Body param: The ID of the postcard profile used for this campaign, if - * applicable. + * Body param: Inline postcard configuration for a campaign. All fields are + * optional since campaigns may be in a partial state during drafting. */ - postcardProfile?: string; + postcard?: CampaignCreateParams.Postcard; /** - * Body param: The ID of the self-mailer profile used for this campaign, if - * applicable. + * Body param: Inline self-mailer configuration for a campaign. All fields are + * optional since campaigns may be in a partial state during drafting. */ - selfMailerProfile?: string; + selfMailer?: CampaignCreateParams.SelfMailer; /** * Body param: The scheduled date and time for the campaign to be sent. */ sendDate?: string; + /** + * Body param: Inline snap pack configuration for a campaign. All fields are + * optional since campaigns may be in a partial state during drafting. + */ + snapPack?: CampaignCreateParams.SnapPack; + /** * Header param */ 'idempotency-key'?: string; } -export interface CampaignUpdateParams { +export namespace CampaignCreateParams { /** - * The ID of the cheque profile to use. Setting this will remove other profile - * types. Set to `null` to remove. + * Inline cheque configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. */ - chequeProfile?: string | null; + export interface Cheque { + /** + * ID of the bank account to use for the cheque. + */ + bankAccount?: string; - /** - * The ID of the default sender contact. Set to `null` to remove. - */ - defaultSenderContact?: string | null; + /** + * Enum representing the supported currency codes. + */ + currencyCode?: 'CAD' | 'USD'; - /** - * An optional description for the campaign. Set to `null` to remove the existing - * description. - */ - description?: string | null; + /** + * An optional description. + */ + description?: string; - /** - * The ID of the letter profile to use. Setting this will remove other profile - * types. Set to `null` to remove. - */ - letterProfile?: string | null; + /** + * The custom envelope ID or `"standard"`. + */ + envelope?: string; - /** - * The ID of the mailing list to associate with this campaign. - */ - mailingList?: string; + /** + * PDF file for an optional attached letter. Cannot be used with `letterTemplate`. + */ + letterPDF?: string; - /** - * Optional key-value data associated with the campaign. Set to `null` to remove - * existing metadata. - */ - metadata?: { [key: string]: string } | null; + /** + * Settings for the attached letter (e.g., color printing). + */ + letterSettings?: Cheque.LetterSettings; + + /** + * ID of a template for an optional attached letter. Cannot be used with + * `letterPDF`. + */ + letterTemplate?: string; + + /** + * A publicly accessible URL for the logo to print on the cheque. + */ + logo?: string; + + /** + * Mailing class for the cheque. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Memo line text for the cheque. + */ + memo?: string; + + /** + * Default merge variables for the cheque. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Message included on the cheque stub. + */ + message?: string; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * ID of a return envelope to include. + */ + returnEnvelope?: string; + + /** + * Enum representing the supported cheque sizes. + */ + size?: ChequesAPI.ChequeSize; + } + + export namespace Cheque { + /** + * Settings for the attached letter (e.g., color printing). + */ + export interface LetterSettings { + /** + * Whether to print the attached letter in color. + */ + color?: boolean; + } + } /** - * The ID of the postcard profile to use. Setting this will remove other profile - * types. Set to `null` to remove. + * Inline letter configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. */ - postcardProfile?: string | null; + export interface Letter { + /** + * Enum representing the placement of the address on the letter. + */ + addressPlacement?: LettersAPI.AddressPlacement; + + /** + * Model representing an attached PDF. + */ + attachedPDF?: LettersAPI.AttachedPdf; + + /** + * Whether to print in color. + */ + color?: boolean; + + /** + * An optional description. + */ + description?: string; + + /** + * Whether to print on both sides of the paper. + */ + doubleSided?: boolean; + + /** + * The custom envelope ID or `"standard"`. + */ + envelope?: string; + + /** + * The type of envelope used for the letter. + */ + envelopeType?: 'standard_double_window' | 'flat'; + + /** + * Mailing class for the letter. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the letter. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * A PDF file or URL for the letter content. Cannot be used with `template`. + */ + pdf?: string; + + /** + * Which page number should be perforated (if any). + */ + perforatedPage?: 1; + + /** + * ID of a return envelope to include. + */ + returnEnvelope?: string; + + /** + * Enum representing the supported letter sizes. + */ + size?: LettersAPI.LetterSize; + + /** + * ID of a template for the letter content. Cannot be used with `pdf`. + */ + template?: string; + } + + /** + * Inline postcard configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface Postcard { + /** + * ID of the template for the back side. Cannot be used with `pdf`. + */ + backTemplate?: string; + + /** + * An optional description. + */ + description?: string; + + /** + * ID of the template for the front side. Cannot be used with `pdf`. + */ + frontTemplate?: string; + + /** + * Mailing class for the postcard. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the postcard. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * Premium paper identifier. Use "standard" for regular stock or a premium*paper*\* + * ID. + */ + paper?: string; + + /** + * A 2-page PDF file for the postcard content (front and back). Cannot be used with + * `frontTemplate`/`backTemplate`. + */ + pdf?: string; + + /** + * Enum representing the supported postcard sizes. + */ + size?: '6x4' | '9x6' | '11x6'; + } + + /** + * Inline self-mailer configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface SelfMailer { + /** + * An optional description. + */ + description?: string; + + /** + * ID of the template for the inside. Cannot be used with `pdf`. + */ + insideTemplate?: string; + + /** + * Mailing class for the self-mailer. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the self-mailer. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * ID of the template for the outside. Cannot be used with `pdf`. + */ + outsideTemplate?: string; + + /** + * A 2-page PDF file for the self-mailer content. Cannot be used with + * `insideTemplate`/`outsideTemplate`. + */ + pdf?: string; + + /** + * Enum representing the supported self-mailer sizes. + */ + size?: '8.5x11_bifold' | '8.5x11_trifold' | '9.5x16_trifold'; + } + + /** + * Inline snap pack configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface SnapPack { + /** + * An optional description. + */ + description?: string; + + /** + * ID of the template for the inside. Cannot be used with `pdf`. + */ + insideTemplate?: string; + + /** + * Mailing class for the snap pack. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the snap pack. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * ID of the template for the outside. Cannot be used with `pdf`. + */ + outsideTemplate?: string; + + /** + * A 2-page PDF file for the snap pack content. Cannot be used with + * `insideTemplate`/`outsideTemplate`. + */ + pdf?: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size?: '8.5x11_bifold_v'; + } +} + +export interface CampaignUpdateParams { + /** + * Inline cheque configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + cheque?: CampaignUpdateParams.Cheque | null; + + /** + * The ID of the default sender contact. Set to `null` to remove. + */ + defaultSenderContact?: string | null; + + /** + * An optional description for the campaign. Set to `null` to remove the existing + * description. + */ + description?: string | null; + + /** + * Inline letter configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + letter?: CampaignUpdateParams.Letter | null; + + /** + * The ID of the mailing list to associate with this campaign. + */ + mailingList?: string; + + /** + * Optional key-value data associated with the campaign. Set to `null` to remove + * existing metadata. + */ + metadata?: { [key: string]: string } | null; + + /** + * Inline postcard configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + postcard?: CampaignUpdateParams.Postcard | null; + + /** + * Inline self-mailer configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + selfMailer?: CampaignUpdateParams.SelfMailer | null; + + /** + * Inline snap pack configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + snapPack?: CampaignUpdateParams.SnapPack | null; +} + +export namespace CampaignUpdateParams { + /** + * Inline cheque configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface Cheque { + /** + * ID of the bank account to use for the cheque. + */ + bankAccount?: string; + + /** + * Enum representing the supported currency codes. + */ + currencyCode?: 'CAD' | 'USD'; + + /** + * An optional description. + */ + description?: string; + + /** + * The custom envelope ID or `"standard"`. + */ + envelope?: string; + + /** + * PDF file for an optional attached letter. Cannot be used with `letterTemplate`. + */ + letterPDF?: string; + + /** + * Settings for the attached letter (e.g., color printing). + */ + letterSettings?: Cheque.LetterSettings; + + /** + * ID of a template for an optional attached letter. Cannot be used with + * `letterPDF`. + */ + letterTemplate?: string; + + /** + * A publicly accessible URL for the logo to print on the cheque. + */ + logo?: string; + + /** + * Mailing class for the cheque. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Memo line text for the cheque. + */ + memo?: string; + + /** + * Default merge variables for the cheque. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Message included on the cheque stub. + */ + message?: string; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * ID of a return envelope to include. + */ + returnEnvelope?: string; + + /** + * Enum representing the supported cheque sizes. + */ + size?: ChequesAPI.ChequeSize; + } + + export namespace Cheque { + /** + * Settings for the attached letter (e.g., color printing). + */ + export interface LetterSettings { + /** + * Whether to print the attached letter in color. + */ + color?: boolean; + } + } /** - * The ID of the self-mailer profile to use. Setting this will remove other profile - * types. Set to `null` to remove. + * Inline letter configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. */ - selfMailerProfile?: string | null; + export interface Letter { + /** + * Enum representing the placement of the address on the letter. + */ + addressPlacement?: LettersAPI.AddressPlacement; + + /** + * Model representing an attached PDF. + */ + attachedPDF?: LettersAPI.AttachedPdf; + + /** + * Whether to print in color. + */ + color?: boolean; + + /** + * An optional description. + */ + description?: string; + + /** + * Whether to print on both sides of the paper. + */ + doubleSided?: boolean; + + /** + * The custom envelope ID or `"standard"`. + */ + envelope?: string; + + /** + * The type of envelope used for the letter. + */ + envelopeType?: 'standard_double_window' | 'flat'; + + /** + * Mailing class for the letter. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the letter. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * A PDF file or URL for the letter content. Cannot be used with `template`. + */ + pdf?: string; + + /** + * Which page number should be perforated (if any). + */ + perforatedPage?: 1; + + /** + * ID of a return envelope to include. + */ + returnEnvelope?: string; + + /** + * Enum representing the supported letter sizes. + */ + size?: LettersAPI.LetterSize; + + /** + * ID of a template for the letter content. Cannot be used with `pdf`. + */ + template?: string; + } + + /** + * Inline postcard configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface Postcard { + /** + * ID of the template for the back side. Cannot be used with `pdf`. + */ + backTemplate?: string; + + /** + * An optional description. + */ + description?: string; + + /** + * ID of the template for the front side. Cannot be used with `pdf`. + */ + frontTemplate?: string; + + /** + * Mailing class for the postcard. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the postcard. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * Premium paper identifier. Use "standard" for regular stock or a premium*paper*\* + * ID. + */ + paper?: string; + + /** + * A 2-page PDF file for the postcard content (front and back). Cannot be used with + * `frontTemplate`/`backTemplate`. + */ + pdf?: string; + + /** + * Enum representing the supported postcard sizes. + */ + size?: '6x4' | '9x6' | '11x6'; + } + + /** + * Inline self-mailer configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface SelfMailer { + /** + * An optional description. + */ + description?: string; + + /** + * ID of the template for the inside. Cannot be used with `pdf`. + */ + insideTemplate?: string; + + /** + * Mailing class for the self-mailer. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the self-mailer. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * ID of the template for the outside. Cannot be used with `pdf`. + */ + outsideTemplate?: string; + + /** + * A 2-page PDF file for the self-mailer content. Cannot be used with + * `insideTemplate`/`outsideTemplate`. + */ + pdf?: string; + + /** + * Enum representing the supported self-mailer sizes. + */ + size?: '8.5x11_bifold' | '8.5x11_trifold' | '9.5x16_trifold'; + } + + /** + * Inline snap pack configuration for a campaign. All fields are optional since + * campaigns may be in a partial state during drafting. + */ + export interface SnapPack { + /** + * An optional description. + */ + description?: string; + + /** + * ID of the template for the inside. Cannot be used with `pdf`. + */ + insideTemplate?: string; + + /** + * Mailing class for the snap pack. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Default merge variables for the snap pack. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * Optional key-value metadata. + */ + metadata?: { [key: string]: string }; + + /** + * ID of the template for the outside. Cannot be used with `pdf`. + */ + outsideTemplate?: string; + + /** + * A 2-page PDF file for the snap pack content. Cannot be used with + * `insideTemplate`/`outsideTemplate`. + */ + pdf?: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size?: '8.5x11_bifold_v'; + } } export interface CampaignListParams extends SkipLimitParams { diff --git a/src/resources/print-mail/cheques.ts b/src/resources/print-mail/cheques.ts index ea88c38..225272d 100644 --- a/src/resources/print-mail/cheques.ts +++ b/src/resources/print-mail/cheques.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../core/resource'; import * as ContactsAPI from './contacts'; -import * as PrintMailAPI from './print-mail'; import { APIPromise } from '../../core/api-promise'; import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination'; import { RequestOptions } from '../../internal/request-options'; @@ -95,6 +94,40 @@ export class Cheques extends APIResource { return this._client.delete(path`/print-mail/v1/cheques/${id}`, options); } + /** + * Cancel a cheque by ID with a note. Note that this operation cannot be undone and + * that only cheques with a status of `ready` can be cancelled. + * + * @example + * ```ts + * const cheque = await client.printMail.cheques.cancel('id', { + * note: 'Cancelling this cheque', + * }); + * ``` + */ + cancel(id: string, body: ChequeCancelParams, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/cheques/${id}/cancellation`, { body, ...options }); + } + + /** + * Progresses a cheque's `status` to the next stage. This is only available in test + * mode and can be used to simulate how a live order would progress through the + * different statuses. + * + * Note: this will fail with an `invalid_progression_error` if the status is one of + * `completed` or `cancelled`. + * + * @example + * ```ts + * const cheque = await client.printMail.cheques.progress( + * 'id', + * ); + * ``` + */ + progress(id: string, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/cheques/${id}/progressions`, options); + } + /** * Retrieve a cheque preview URL. * @@ -407,7 +440,7 @@ export interface ChequeCreateParams { * The contact information of the sender. You can pass contact information inline * here just like you can for the `to`. */ - from: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * The recipient of this order. You can either supply the contact information @@ -415,7 +448,7 @@ export interface ChequeCreateParams { * contacts regardless of whether you provide the information inline here or call * the contact creation endpoint. */ - to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * The currency code of the cheque. This will be set to the default currency of the @@ -519,7 +552,7 @@ export interface ChequeCreateParams { * mail it forward to the final recipient yourself. One use case for this is * signing cheques at your office before mailing them out yourself. */ - redirectTo?: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + redirectTo?: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * This order will transition from `ready` to `printing` on the day after this @@ -544,6 +577,10 @@ export interface ChequeListParams extends SkipLimitParams { search?: string; } +export interface ChequeCancelParams { + note: string; +} + export declare namespace Cheques { export { type Cheque as Cheque, @@ -553,5 +590,6 @@ export declare namespace Cheques { type ChequesSkipLimit as ChequesSkipLimit, type ChequeCreateParams as ChequeCreateParams, type ChequeListParams as ChequeListParams, + type ChequeCancelParams as ChequeCancelParams, }; } diff --git a/src/resources/print-mail/contacts.ts b/src/resources/print-mail/contacts.ts index 4989b47..fc060be 100644 --- a/src/resources/print-mail/contacts.ts +++ b/src/resources/print-mail/contacts.ts @@ -1,7 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; -import * as PrintMailAPI from './print-mail'; import { APIPromise } from '../../core/api-promise'; import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination'; import { RequestOptions } from '../../internal/request-options'; @@ -208,9 +207,171 @@ export interface Contact { skipVerification?: boolean; } -export type ContactCreate = - | PrintMailAPI.ContactCreateWithFirstName - | PrintMailAPI.ContactCreateWithCompanyName; +export type ContactCreate = ContactCreateWithFirstName | ContactCreateWithCompanyName; + +export interface ContactCreateWithCompanyName { + /** + * The first line of the contact's address. + */ + addressLine1: string; + + companyName: string; + + /** + * The ISO 3611-1 country code of the contact's address. + */ + countryCode: string; + + /** + * Second line of the contact's address, if applicable. + */ + addressLine2?: string; + + /** + * The city of the contact's address. + */ + city?: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * Email of the contact. + */ + email?: string; + + /** + * First name of the contact. + */ + firstName?: string; + + /** + * If `true`, PostGrid will force this contact to have an `addressStatus` of + * `verified` even if our address verification system says otherwise. + */ + forceVerifiedStatus?: boolean; + + /** + * Job title of the contact. + */ + jobTitle?: string; + + /** + * Last name of the contact. + */ + lastName?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * Phone number of the contact. + */ + phoneNumber?: string; + + /** + * The postal or ZIP code of the contact's address. + */ + postalOrZip?: string; + + /** + * Province or state of the contact's address. + */ + provinceOrState?: string; + + /** + * If `true`, PostGrid will skip running this contact's address through our address + * verification system. + */ + skipVerification?: boolean; +} + +export interface ContactCreateWithFirstName { + /** + * The first line of the contact's address. + */ + addressLine1: string; + + /** + * The ISO 3611-1 country code of the contact's address. + */ + countryCode: string; + + firstName: string; + + /** + * Second line of the contact's address, if applicable. + */ + addressLine2?: string; + + /** + * The city of the contact's address. + */ + city?: string; + + /** + * Company name of the contact. + */ + companyName?: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * Email of the contact. + */ + email?: string; + + /** + * If `true`, PostGrid will force this contact to have an `addressStatus` of + * `verified` even if our address verification system says otherwise. + */ + forceVerifiedStatus?: boolean; + + /** + * Job title of the contact. + */ + jobTitle?: string; + + /** + * Last name of the contact. + */ + lastName?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * Phone number of the contact. + */ + phoneNumber?: string; + + /** + * The postal or ZIP code of the contact's address. + */ + postalOrZip?: string; + + /** + * Province or state of the contact's address. + */ + provinceOrState?: string; + + /** + * If `true`, PostGrid will skip running this contact's address through our address + * verification system. + */ + skipVerification?: boolean; +} export interface ContactDeleteResponse { /** @@ -411,6 +572,8 @@ export declare namespace Contacts { export { type Contact as Contact, type ContactCreate as ContactCreate, + type ContactCreateWithCompanyName as ContactCreateWithCompanyName, + type ContactCreateWithFirstName as ContactCreateWithFirstName, type ContactDeleteResponse as ContactDeleteResponse, type ContactsSkipLimit as ContactsSkipLimit, type ContactCreateParams as ContactCreateParams, diff --git a/src/resources/print-mail/index.ts b/src/resources/print-mail/index.ts index 851c26b..4a40b58 100644 --- a/src/resources/print-mail/index.ts +++ b/src/resources/print-mail/index.ts @@ -9,6 +9,17 @@ export { type BankAccountListParams, type BankAccountsSkipLimit, } from './bank-accounts'; +export { + Boxes, + type BoxCreateResponse, + type BoxRetrieveResponse, + type BoxListResponse, + type BoxDeleteResponse, + type BoxProgressionsResponse, + type BoxCreateParams, + type BoxListParams, + type BoxListResponsesSkipLimit, +} from './boxes'; export { Campaigns, type Campaign, @@ -27,12 +38,15 @@ export { type ChequeRetrieveURLResponse, type ChequeCreateParams, type ChequeListParams, + type ChequeCancelParams, type ChequesSkipLimit, } from './cheques'; export { Contacts, type Contact, type ContactCreate, + type ContactCreateWithCompanyName, + type ContactCreateWithFirstName, type ContactDeleteResponse, type ContactCreateParams, type ContactListParams, @@ -48,6 +62,7 @@ export { type LetterRetrieveURLResponse, type LetterCreateParams, type LetterListParams, + type LetterCancelParams, type LettersSkipLimit, } from './letters'; export { @@ -72,16 +87,16 @@ export { type MailingListJobsParams, type MailingListsSkipLimit, } from './mailing-lists'; -export { OrderProfiles } from './order-profiles/index'; export { Postcards, type Postcard, type PostcardRetrieveURLResponse, type PostcardCreateParams, type PostcardListParams, + type PostcardCancelParams, type PostcardsSkipLimit, } from './postcards'; -export { PrintMail, type ContactCreateWithCompanyName, type ContactCreateWithFirstName } from './print-mail'; +export { PrintMail } from './print-mail'; export { Reports, type DeletedResponse, @@ -100,17 +115,52 @@ export { type SelfMailerListParams, type SelfMailersSkipLimit, } from './self-mailers'; +export { + SnapPacks, + type SnapPackCreateResponse, + type SnapPackRetrieveResponse, + type SnapPackListResponse, + type SnapPackDeleteResponse, + type SnapPackProgressionsResponse, + type SnapPackRetrieveCapabilitiesResponse, + type SnapPackCreateParams, + type SnapPackListParams, + type SnapPackRetrieveCapabilitiesParams, + type SnapPackListResponsesSkipLimit, +} from './snap-packs'; export { SubOrganizations, type EmailPreferences, type SubOrganization, - type SubOrganizationUpdateResponse, + type SubOrganizationCreateResponse, type SubOrganizationRetrieveUsersResponse, - type SubOrganizationUpdateParams, + type SubOrganizationCreateParams, type SubOrganizationListParams, type SubOrganizationRetrieveUsersParams, type SubOrganizationsSkipLimit, } from './sub-organizations'; +export { + TargetedListBuilds, + type TargetedListBuildCreateResponse, + type TargetedListBuildRetrieveResponse, + type TargetedListBuildUpdateResponse, + type TargetedListBuildListResponse, + type TargetedListBuildDeleteResponse, + type TargetedListBuildConfirmResponse, + type TargetedListBuildCreateParams, + type TargetedListBuildUpdateParams, + type TargetedListBuildListParams, + type TargetedListBuildListResponsesSkipLimit, +} from './targeted-list-builds/index'; +export { + TemplateEditorSessions, + type TemplateEditorSessionCreateResponse, + type TemplateEditorSessionListResponse, + type TemplateEditorSessionDeleteResponse, + type TemplateEditorSessionCreateParams, + type TemplateEditorSessionListParams, + type TemplateEditorSessionListResponsesSkipLimit, +} from './template-editor-sessions'; export { Templates, type Template, @@ -120,3 +170,28 @@ export { type TemplateListParams, type TemplatesSkipLimit, } from './templates'; +export { + Trackers, + type TrackerCreateResponse, + type TrackerRetrieveResponse, + type TrackerUpdateResponse, + type TrackerListResponse, + type TrackerDeleteResponse, + type TrackerRetrieveVisitsResponse, + type TrackerCreateParams, + type TrackerUpdateParams, + type TrackerListParams, + type TrackerRetrieveVisitsParams, + type TrackerListResponsesSkipLimit, + type TrackerRetrieveVisitsResponsesSkipLimit, +} from './trackers'; +export { + VirtualMailboxes, + type VirtualMailboxCreateResponse, + type VirtualMailboxRetrieveResponse, + type VirtualMailboxListResponse, + type VirtualMailboxRetrieveAddressResponse, + type VirtualMailboxCreateParams, + type VirtualMailboxListParams, + type VirtualMailboxListResponsesSkipLimit, +} from './virtual-mailboxes/index'; diff --git a/src/resources/print-mail/letters.ts b/src/resources/print-mail/letters.ts index 9fc64c0..fc596c4 100644 --- a/src/resources/print-mail/letters.ts +++ b/src/resources/print-mail/letters.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../core/resource'; import * as ContactsAPI from './contacts'; -import * as PrintMailAPI from './print-mail'; import { APIPromise } from '../../core/api-promise'; import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination'; import { RequestOptions } from '../../internal/request-options'; @@ -74,6 +73,40 @@ export class Letters extends APIResource { return this._client.delete(path`/print-mail/v1/letters/${id}`, options); } + /** + * Cancel a letter by ID with a note. Note that this operation cannot be undone and + * that only letters with a status of `ready` can be cancelled. + * + * @example + * ```ts + * const letter = await client.printMail.letters.cancel('id', { + * note: 'Cancelling this letter', + * }); + * ``` + */ + cancel(id: string, body: LetterCancelParams, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/letters/${id}/cancellation`, { body, ...options }); + } + + /** + * Progresses a letter's `status` to the next stage. This is only available in test + * mode and can be used to simulate how a live order would progress through the + * different statuses. + * + * Note: this will fail with an `invalid_progression_error` if the status is one of + * `completed` or `cancelled`. + * + * @example + * ```ts + * const letter = await client.printMail.letters.progress( + * 'id', + * ); + * ``` + */ + progress(id: string, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/letters/${id}/progressions`, options); + } + /** * Retrieve a letter preview URL. * @@ -457,7 +490,7 @@ export declare namespace LetterCreateParams { * The contact information of the sender. You can pass contact information inline * here just like you can for the `to`. */ - from: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * The HTML content for the letter. You can supply _either_ this or `template` but @@ -471,7 +504,7 @@ export declare namespace LetterCreateParams { * contacts regardless of whether you provide the information inline here or call * the contact creation endpoint. */ - to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * Enum representing the placement of the address on the letter. @@ -591,7 +624,7 @@ export declare namespace LetterCreateParams { * The contact information of the sender. You can pass contact information inline * here just like you can for the `to`. */ - from: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * A URL pointing to a PDF file for the letter or the PDF file itself. @@ -604,7 +637,7 @@ export declare namespace LetterCreateParams { * contacts regardless of whether you provide the information inline here or call * the contact creation endpoint. */ - to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * Enum representing the placement of the address on the letter. @@ -723,6 +756,10 @@ export interface LetterListParams extends SkipLimitParams { search?: string; } +export interface LetterCancelParams { + note: string; +} + export declare namespace Letters { export { type AddressPlacement as AddressPlacement, @@ -734,5 +771,6 @@ export declare namespace Letters { type LettersSkipLimit as LettersSkipLimit, type LetterCreateParams as LetterCreateParams, type LetterListParams as LetterListParams, + type LetterCancelParams as LetterCancelParams, }; } diff --git a/src/resources/print-mail/mailing-lists.ts b/src/resources/print-mail/mailing-lists.ts index a2bc516..5df1d16 100644 --- a/src/resources/print-mail/mailing-lists.ts +++ b/src/resources/print-mail/mailing-lists.ts @@ -7,6 +7,10 @@ import { buildHeaders } from '../../internal/headers'; import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; +/** + * The mailing lists API enables you to manage collections of contacts + * that can be used for bulk mail campaigns. + */ export class MailingLists extends APIResource { /** * Create a new mailing list. diff --git a/src/resources/print-mail/order-profiles/cheques.ts b/src/resources/print-mail/order-profiles/cheques.ts deleted file mode 100644 index 29c1003..0000000 --- a/src/resources/print-mail/order-profiles/cheques.ts +++ /dev/null @@ -1,596 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../core/resource'; -import * as ChequesAPI from '../cheques'; -import { APIPromise } from '../../../core/api-promise'; -import { PagePromise, SkipLimit, type SkipLimitParams } from '../../../core/pagination'; -import { RequestOptions } from '../../../internal/request-options'; -import { path } from '../../../internal/utils/path'; - -/** - * Order Profiles are reusable blueprints for creating print and mail orders (Letters, Postcards, Cheques, Self-Mailers). - * They define common properties like size, content (via templates or uploaded PDFs), mailing class, and metadata. - * Using profiles simplifies order creation, especially for recurring mailings or campaigns, by pre-filling many parameters. - * - * Profiles are environment-specific (live vs. test). - */ -export class Cheques extends APIResource { - /** - * Creates a new Cheque Profile. Requires a `bankAccount` ID. Can optionally - * include an attached letter via `letterHTML`, `letterTemplate`, or `letterPDF`. - * If providing `letterPDF` or `logo` (if logo needs upload, though schema suggests - * URL), use `multipart/form-data`. - * - * @example - * ```ts - * const chequeProfile = - * await client.printMail.orderProfiles.cheques.create({ - * bankAccount: 'bankAccount', - * size: 'us_letter', - * }); - * ``` - */ - create(params: ChequeCreateParams, options?: RequestOptions): APIPromise { - const { expand, ...body } = params; - return this._client.post('/print-mail/v1/order_profiles/cheques', { - query: { expand }, - body, - ...options, - }); - } - - /** - * Retrieves the details of a specific Cheque Profile. - * - * @example - * ```ts - * const chequeProfile = - * await client.printMail.orderProfiles.cheques.retrieve( - * 'id', - * ); - * ``` - */ - retrieve( - id: string, - query: ChequeRetrieveParams | null | undefined = {}, - options?: RequestOptions, - ): APIPromise { - return this._client.get(path`/print-mail/v1/order_profiles/cheques/${id}`, { query, ...options }); - } - - /** - * Updates specific fields of an existing Cheque Profile. If providing `letterPDF` - * or `logo`, use `multipart/form-data`. - * - * @example - * ```ts - * const chequeProfile = - * await client.printMail.orderProfiles.cheques.update( - * 'id', - * { bankAccount: 'bankAccount', size: 'us_letter' }, - * ); - * ``` - */ - update(id: string, params: ChequeUpdateParams, options?: RequestOptions): APIPromise { - const { expand, ...body } = params; - return this._client.post(path`/print-mail/v1/order_profiles/cheques/${id}`, { - query: { expand }, - body, - ...options, - }); - } - - /** - * Retrieves a list of Cheque Profiles. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const chequeListResponse of client.printMail.orderProfiles.cheques.list()) { - * // ... - * } - * ``` - */ - list( - query: ChequeListParams | null | undefined = {}, - options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList('/print-mail/v1/order_profiles/cheques', SkipLimit, { - query, - ...options, - }); - } - - /** - * Deletes a Cheque Profile. - * - * @example - * ```ts - * const cheque = - * await client.printMail.orderProfiles.cheques.delete('id'); - * ``` - */ - delete(id: string, options?: RequestOptions): APIPromise { - return this._client.delete(path`/print-mail/v1/order_profiles/cheques/${id}`, options); - } -} - -export type ChequeListResponsesSkipLimit = SkipLimit; - -export interface ChequeProfile { - /** - * Unique identifier for the order profile. - */ - id: string; - - /** - * ID of the bank account to use for the cheque. Required for creation. - */ - bankAccount: string; - - /** - * Timestamp when the profile was created. - */ - createdAt: string; - - /** - * Enum representing the supported currency codes. - */ - currencyCode: CurrencyCode; - - /** - * Indicates if the profile is associated with the live or test environment. - */ - live: boolean; - - /** - * Always `cheque_profile`. - */ - object: 'cheque_profile'; - - /** - * Enum representing the supported cheque sizes. - */ - size: ChequesAPI.ChequeSize; - - /** - * Timestamp when the profile was last updated. - */ - updatedAt: string; - - /** - * An optional description for the profile. Set to `null` to remove during update. - */ - description?: string | null; - - /** - * ID of a template for an optional attached letter. Cannot be used with - * `letterHTML` or `letterPDF`. - */ - letterTemplate?: string; - - /** - * A temporary, signed URL to view the attached letter PDF, if any. Output only. - */ - letterUploadedPDF?: string; - - /** - * A publicly accessible URL for the logo to print on the cheque. Set to `null` to - * remove during update. - */ - logo?: string | null; - - /** - * Mailing class. Generally must be first class (or equivalent for destination - * country) for cheques. - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Memo line text for the cheque. Set to `null` to remove during update. - */ - memo?: string | null; - - /** - * Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Message included on the cheque stub. Set to `null` to remove during update. - */ - message?: string | null; - - /** - * Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; -} - -/** - * Enum representing the supported currency codes. - */ -export type CurrencyCode = 'CAD' | 'USD'; - -export interface ChequeListResponse { - /** - * Unique identifier for the order profile. - */ - id: string; - - /** - * ID of the bank account to use for the cheque. Required for creation. - */ - bankAccount: string; - - /** - * Timestamp when the profile was created. - */ - createdAt: string; - - /** - * Indicates if the profile is associated with the live or test environment. - */ - live: boolean; - - /** - * Always `cheque_profile`. - */ - object: 'cheque_profile'; - - /** - * Enum representing the supported cheque sizes. - */ - size: ChequesAPI.ChequeSize; - - /** - * Timestamp when the profile was last updated. - */ - updatedAt: string; - - /** - * An optional description for the profile. Set to `null` to remove during update. - */ - description?: string | null; - - /** - * ID of a template for an optional attached letter. Cannot be used with - * `letterHTML` or `letterPDF`. - */ - letterTemplate?: string; - - /** - * A temporary, signed URL to view the attached letter PDF, if any. Output only. - */ - letterUploadedPDF?: string; - - /** - * A publicly accessible URL for the logo to print on the cheque. Set to `null` to - * remove during update. - */ - logo?: string | null; - - /** - * Mailing class. Generally must be first class (or equivalent for destination - * country) for cheques. - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Memo line text for the cheque. Set to `null` to remove during update. - */ - memo?: string | null; - - /** - * Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Message included on the cheque stub. Set to `null` to remove during update. - */ - message?: string | null; - - /** - * Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; -} - -export interface ChequeDeleteResponse { - /** - * Unique identifier for the order profile. - */ - id: string; - - deleted: true; - - /** - * Always `cheque_profile`. - */ - object: 'cheque_profile'; -} - -export interface ChequeCreateParams { - /** - * Body param: ID of the bank account to use for the cheque. Required for creation. - */ - bankAccount: string; - - /** - * Body param: Enum representing the supported cheque sizes. - */ - size: ChequesAPI.ChequeSize; - - /** - * Query param: Optional list of related resources to expand in the response. - */ - expand?: Array; - - /** - * Body param: Enum representing the supported currency codes. - */ - currencyCode?: CurrencyCode; - - /** - * Body param: An optional description for the profile. Set to `null` to remove - * during update. - */ - description?: string | null; - - /** - * Body param: PDF file for an optional attached letter. Cannot be used with - * `letterHTML` or `letterTemplate`. Input only. - */ - letterPDF?: string; - - /** - * Body param: ID of a template for an optional attached letter. Cannot be used - * with `letterHTML` or `letterPDF`. - */ - letterTemplate?: string; - - /** - * Body param: A publicly accessible URL for the logo to print on the cheque. Set - * to `null` to remove during update. - */ - logo?: string | null; - - /** - * Body param: Mailing class. Generally must be first class (or equivalent for - * destination country) for cheques. - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Body param: Memo line text for the cheque. Set to `null` to remove during - * update. - */ - memo?: string | null; - - /** - * Body param: Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Body param: Message included on the cheque stub. Set to `null` to remove during - * update. - */ - message?: string | null; - - /** - * Body param: Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; -} - -export interface ChequeRetrieveParams { - /** - * Optional list of related resources to expand in the response. - */ - expand?: Array; -} - -export interface ChequeUpdateParams { - /** - * Body param: ID of the bank account to use for the cheque. Required for creation. - */ - bankAccount: string; - - /** - * Body param: Enum representing the supported cheque sizes. - */ - size: ChequesAPI.ChequeSize; - - /** - * Query param: Optional list of related resources to expand in the response. - */ - expand?: Array; - - /** - * Body param: Enum representing the supported currency codes. - */ - currencyCode?: CurrencyCode; - - /** - * Body param: An optional description for the profile. Set to `null` to remove - * during update. - */ - description?: string | null; - - /** - * Body param: PDF file for an optional attached letter. Cannot be used with - * `letterHTML` or `letterTemplate`. Input only. - */ - letterPDF?: string; - - /** - * Body param: ID of a template for an optional attached letter. Cannot be used - * with `letterHTML` or `letterPDF`. - */ - letterTemplate?: string; - - /** - * Body param: A publicly accessible URL for the logo to print on the cheque. Set - * to `null` to remove during update. - */ - logo?: string | null; - - /** - * Body param: Mailing class. Generally must be first class (or equivalent for - * destination country) for cheques. - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Body param: Memo line text for the cheque. Set to `null` to remove during - * update. - */ - memo?: string | null; - - /** - * Body param: Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Body param: Message included on the cheque stub. Set to `null` to remove during - * update. - */ - message?: string | null; - - /** - * Body param: Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; -} - -export interface ChequeListParams extends SkipLimitParams { - /** - * You can supply any string to help narrow down the list of resources. For - * example, if you pass `"New York"` (quoted), it will return resources that have - * that string present somewhere in their response. Alternatively, you can supply a - * structured search query. See the documentation on `StructuredSearchQuery` for - * more details. - */ - search?: string; -} - -export declare namespace Cheques { - export { - type ChequeProfile as ChequeProfile, - type CurrencyCode as CurrencyCode, - type ChequeListResponse as ChequeListResponse, - type ChequeDeleteResponse as ChequeDeleteResponse, - type ChequeListResponsesSkipLimit as ChequeListResponsesSkipLimit, - type ChequeCreateParams as ChequeCreateParams, - type ChequeRetrieveParams as ChequeRetrieveParams, - type ChequeUpdateParams as ChequeUpdateParams, - type ChequeListParams as ChequeListParams, - }; -} diff --git a/src/resources/print-mail/order-profiles/index.ts b/src/resources/print-mail/order-profiles/index.ts deleted file mode 100644 index 13d31b8..0000000 --- a/src/resources/print-mail/order-profiles/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { - Cheques, - type ChequeProfile, - type CurrencyCode, - type ChequeListResponse, - type ChequeDeleteResponse, - type ChequeCreateParams, - type ChequeRetrieveParams, - type ChequeUpdateParams, - type ChequeListParams, - type ChequeListResponsesSkipLimit, -} from './cheques'; -export { - Letters, - type LetterProfile, - type LetterDeleteResponse, - type LetterCreateParams, - type LetterRetrieveParams, - type LetterUpdateParams, - type LetterListParams, - type LetterProfilesSkipLimit, -} from './letters'; -export { OrderProfiles } from './order-profiles'; -export { - Postcards, - type PostcardProfile, - type PostcardSize, - type PostcardDeleteResponse, - type PostcardCreateParams, - type PostcardRetrieveParams, - type PostcardUpdateParams, - type PostcardListParams, - type PostcardProfilesSkipLimit, -} from './postcards'; -export { - SelfMailers, - type SelfMailerProfile, - type SelfMailerSize, - type SelfMailerDeleteResponse, - type SelfMailerCreateParams, - type SelfMailerRetrieveParams, - type SelfMailerUpdateParams, - type SelfMailerListParams, - type SelfMailerProfilesSkipLimit, -} from './self-mailers'; diff --git a/src/resources/print-mail/order-profiles/letters.ts b/src/resources/print-mail/order-profiles/letters.ts deleted file mode 100644 index b4838a0..0000000 --- a/src/resources/print-mail/order-profiles/letters.ts +++ /dev/null @@ -1,496 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../core/resource'; -import * as LettersAPI from '../letters'; -import { APIPromise } from '../../../core/api-promise'; -import { PagePromise, SkipLimit, type SkipLimitParams } from '../../../core/pagination'; -import { RequestOptions } from '../../../internal/request-options'; -import { path } from '../../../internal/utils/path'; - -/** - * Order Profiles are reusable blueprints for creating print and mail orders (Letters, Postcards, Cheques, Self-Mailers). - * They define common properties like size, content (via templates or uploaded PDFs), mailing class, and metadata. - * Using profiles simplifies order creation, especially for recurring mailings or campaigns, by pre-filling many parameters. - * - * Profiles are environment-specific (live vs. test). - */ -export class Letters extends APIResource { - /** - * Creates a new Letter Profile. You must provide either a `template` ID or upload - * a `pdf` file for the content. If providing PDF files (`pdf` or - * `attachedPDFFile`), the request `Content-Type` must be `multipart/form-data`. - * - * @example - * ```ts - * const letterProfile = - * await client.printMail.orderProfiles.letters.create({ - * size: 'us_letter', - * color: true, - * description: 'Monthly Newsletter Profile', - * mailingClass: 'first_class', - * mergeVariables: { salutation: 'Valued Customer' }, - * metadata: { campaign: 'Q1 Newsletter' }, - * template: 'template_abc', - * }); - * ``` - */ - create(params: LetterCreateParams, options?: RequestOptions): APIPromise { - const { expand, ...body } = params; - return this._client.post('/print-mail/v1/order_profiles/letters', { - query: { expand }, - body, - ...options, - }); - } - - /** - * Retrieves the details of a specific Letter Profile by its ID. - * - * @example - * ```ts - * const letterProfile = - * await client.printMail.orderProfiles.letters.retrieve( - * 'id', - * ); - * ``` - */ - retrieve( - id: string, - query: LetterRetrieveParams | null | undefined = {}, - options?: RequestOptions, - ): APIPromise { - return this._client.get(path`/print-mail/v1/order_profiles/letters/${id}`, { query, ...options }); - } - - /** - * Updates specific fields of an existing Letter Profile. Only the fields provided - * in the request body will be updated. If providing PDF files (`pdf` or - * `attachedPDFFile`), the request `Content-Type` must be `multipart/form-data`. - * - * @example - * ```ts - * const letterProfile = - * await client.printMail.orderProfiles.letters.update( - * 'id', - * { description: 'Updated Newsletter Profile' }, - * ); - * ``` - */ - update(id: string, params: LetterUpdateParams, options?: RequestOptions): APIPromise { - const { expand, ...body } = params; - return this._client.post(path`/print-mail/v1/order_profiles/letters/${id}`, { - query: { expand }, - body, - ...options, - }); - } - - /** - * Retrieves a list of Letter Profiles. The profiles are returned sorted by - * creation date, with the most recent appearing first. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const letterProfile of client.printMail.orderProfiles.letters.list()) { - * // ... - * } - * ``` - */ - list( - query: LetterListParams | null | undefined = {}, - options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList('/print-mail/v1/order_profiles/letters', SkipLimit, { - query, - ...options, - }); - } - - /** - * Deletes a Letter Profile. This action cannot be undone. Orders previously - * created using this profile are not affected. - * - * @example - * ```ts - * const letter = - * await client.printMail.orderProfiles.letters.delete('id'); - * ``` - */ - delete(id: string, options?: RequestOptions): APIPromise { - return this._client.delete(path`/print-mail/v1/order_profiles/letters/${id}`, options); - } -} - -export type LetterProfilesSkipLimit = SkipLimit; - -export interface LetterProfile { - /** - * Unique identifier for the order profile. - */ - id: string; - - /** - * Timestamp when the profile was created. - */ - createdAt: string; - - /** - * Indicates if the profile is associated with the live or test environment. - */ - live: boolean; - - /** - * Always `letter_profile`. - */ - object: 'letter_profile'; - - /** - * Enum representing the supported letter sizes. - */ - size: LettersAPI.LetterSize; - - /** - * Timestamp when the profile was last updated. - */ - updatedAt: string; - - /** - * Enum representing the placement of the address on the letter. - */ - addressPlacement?: LettersAPI.AddressPlacement; - - /** - * Model representing an attached PDF. - */ - attachedPDF?: LettersAPI.AttachedPdf; - - /** - * Specifies whether to print in color (true) or black and white (false). - */ - color?: boolean; - - /** - * An optional description for the profile. Set to `null` to remove during update. - */ - description?: string | null; - - /** - * Specifies whether to print on both sides of the paper. - */ - doubleSided?: boolean; - - /** - * ID of a custom envelope to use. - */ - envelope?: string; - - /** - * Mailing class. - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; - - /** - * Specifies which page number should be perforated (if any). - */ - perforatedPage?: 1; - - /** - * ID of a template to use for the letter content. Cannot be used with `pdf`. - */ - template?: string; - - /** - * A temporary, signed URL to view the uploaded PDF, if any. - */ - uploadedPDF?: string; -} - -export interface LetterDeleteResponse { - /** - * Unique identifier for the order profile. - */ - id: string; - - deleted: true; - - /** - * Always `letter_profile`. - */ - object: 'letter_profile'; -} - -export interface LetterCreateParams { - /** - * Body param: Enum representing the supported letter sizes. - */ - size: LettersAPI.LetterSize; - - /** - * Query param: Optional list of related resources to expand in the response. - */ - expand?: Array; - - /** - * Body param: Enum representing the placement of the address on the letter. - */ - addressPlacement?: LettersAPI.AddressPlacement; - - /** - * Body param: Model representing an attached PDF. - */ - attachedPDF?: LettersAPI.AttachedPdf; - - /** - * Body param: Specifies whether to print in color (true) or black and white - * (false). - */ - color?: boolean; - - /** - * Body param: An optional description for the profile. Set to `null` to remove - * during update. - */ - description?: string | null; - - /** - * Body param: Specifies whether to print on both sides of the paper. - */ - doubleSided?: boolean; - - /** - * Body param: ID of a custom envelope to use. - */ - envelope?: string; - - /** - * Body param: Mailing class. - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Body param: Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Body param: Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; - - /** - * Body param: A PDF file containing the letter content. Cannot be used with - * `template`. - */ - pdf?: string; - - /** - * Body param: Specifies which page number should be perforated (if any). - */ - perforatedPage?: 1; - - /** - * Body param: ID of a return envelope to include. - */ - returnEnvelope?: string; - - /** - * Body param: ID of a template to use for the letter content. Cannot be used with - * `pdf`. - */ - template?: string; -} - -export interface LetterRetrieveParams { - /** - * Optional list of related resources to expand in the response. - */ - expand?: Array; -} - -export interface LetterUpdateParams { - /** - * Query param: Optional list of related resources to expand in the response. - */ - expand?: Array; - - /** - * Body param: Enum representing the placement of the address on the letter. - */ - addressPlacement?: LettersAPI.AddressPlacement; - - /** - * Body param: Model representing an attached PDF. - */ - attachedPDF?: LettersAPI.AttachedPdf; - - /** - * Body param: Specifies whether to print in color (true) or black and white - * (false). - */ - color?: boolean; - - /** - * Body param: An optional description for the profile. Set to `null` to remove - * during update. - */ - description?: string | null; - - /** - * Body param: Specifies whether to print on both sides of the paper. - */ - doubleSided?: boolean; - - /** - * Body param: ID of a custom envelope to use. - */ - envelope?: string; - - /** - * Body param: Mailing class. - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Body param: Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Body param: Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; - - /** - * Body param: A PDF file containing the letter content. Cannot be used with - * `template`. - */ - pdf?: string; - - /** - * Body param: Specifies which page number should be perforated (if any). - */ - perforatedPage?: 1; - - /** - * Body param: ID of a return envelope to include. - */ - returnEnvelope?: string; - - /** - * Body param: ID of a template to use for the letter content. Cannot be used with - * `pdf`. - */ - template?: string; -} - -export interface LetterListParams extends SkipLimitParams { - /** - * You can supply any string to help narrow down the list of resources. For - * example, if you pass `"New York"` (quoted), it will return resources that have - * that string present somewhere in their response. Alternatively, you can supply a - * structured search query. See the documentation on `StructuredSearchQuery` for - * more details. - */ - search?: string; -} - -export declare namespace Letters { - export { - type LetterProfile as LetterProfile, - type LetterDeleteResponse as LetterDeleteResponse, - type LetterProfilesSkipLimit as LetterProfilesSkipLimit, - type LetterCreateParams as LetterCreateParams, - type LetterRetrieveParams as LetterRetrieveParams, - type LetterUpdateParams as LetterUpdateParams, - type LetterListParams as LetterListParams, - }; -} diff --git a/src/resources/print-mail/order-profiles/order-profiles.ts b/src/resources/print-mail/order-profiles/order-profiles.ts deleted file mode 100644 index d26b600..0000000 --- a/src/resources/print-mail/order-profiles/order-profiles.ts +++ /dev/null @@ -1,113 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../core/resource'; -import * as ChequesAPI from './cheques'; -import { - ChequeCreateParams, - ChequeDeleteResponse, - ChequeListParams, - ChequeListResponse, - ChequeListResponsesSkipLimit, - ChequeProfile, - ChequeRetrieveParams, - ChequeUpdateParams, - Cheques, - CurrencyCode, -} from './cheques'; -import * as LettersAPI from './letters'; -import { - LetterCreateParams, - LetterDeleteResponse, - LetterListParams, - LetterProfile, - LetterProfilesSkipLimit, - LetterRetrieveParams, - LetterUpdateParams, - Letters, -} from './letters'; -import * as PostcardsAPI from './postcards'; -import { - PostcardCreateParams, - PostcardDeleteResponse, - PostcardListParams, - PostcardProfile, - PostcardProfilesSkipLimit, - PostcardRetrieveParams, - PostcardSize, - PostcardUpdateParams, - Postcards, -} from './postcards'; -import * as SelfMailersAPI from './self-mailers'; -import { - SelfMailerCreateParams, - SelfMailerDeleteResponse, - SelfMailerListParams, - SelfMailerProfile, - SelfMailerProfilesSkipLimit, - SelfMailerRetrieveParams, - SelfMailerSize, - SelfMailerUpdateParams, - SelfMailers, -} from './self-mailers'; - -export class OrderProfiles extends APIResource { - cheques: ChequesAPI.Cheques = new ChequesAPI.Cheques(this._client); - letters: LettersAPI.Letters = new LettersAPI.Letters(this._client); - postcards: PostcardsAPI.Postcards = new PostcardsAPI.Postcards(this._client); - selfMailers: SelfMailersAPI.SelfMailers = new SelfMailersAPI.SelfMailers(this._client); -} - -OrderProfiles.Cheques = Cheques; -OrderProfiles.Letters = Letters; -OrderProfiles.Postcards = Postcards; -OrderProfiles.SelfMailers = SelfMailers; - -export declare namespace OrderProfiles { - export { - Cheques as Cheques, - type ChequeProfile as ChequeProfile, - type CurrencyCode as CurrencyCode, - type ChequeListResponse as ChequeListResponse, - type ChequeDeleteResponse as ChequeDeleteResponse, - type ChequeListResponsesSkipLimit as ChequeListResponsesSkipLimit, - type ChequeCreateParams as ChequeCreateParams, - type ChequeRetrieveParams as ChequeRetrieveParams, - type ChequeUpdateParams as ChequeUpdateParams, - type ChequeListParams as ChequeListParams, - }; - - export { - Letters as Letters, - type LetterProfile as LetterProfile, - type LetterDeleteResponse as LetterDeleteResponse, - type LetterProfilesSkipLimit as LetterProfilesSkipLimit, - type LetterCreateParams as LetterCreateParams, - type LetterRetrieveParams as LetterRetrieveParams, - type LetterUpdateParams as LetterUpdateParams, - type LetterListParams as LetterListParams, - }; - - export { - Postcards as Postcards, - type PostcardProfile as PostcardProfile, - type PostcardSize as PostcardSize, - type PostcardDeleteResponse as PostcardDeleteResponse, - type PostcardProfilesSkipLimit as PostcardProfilesSkipLimit, - type PostcardCreateParams as PostcardCreateParams, - type PostcardRetrieveParams as PostcardRetrieveParams, - type PostcardUpdateParams as PostcardUpdateParams, - type PostcardListParams as PostcardListParams, - }; - - export { - SelfMailers as SelfMailers, - type SelfMailerProfile as SelfMailerProfile, - type SelfMailerSize as SelfMailerSize, - type SelfMailerDeleteResponse as SelfMailerDeleteResponse, - type SelfMailerProfilesSkipLimit as SelfMailerProfilesSkipLimit, - type SelfMailerCreateParams as SelfMailerCreateParams, - type SelfMailerRetrieveParams as SelfMailerRetrieveParams, - type SelfMailerUpdateParams as SelfMailerUpdateParams, - type SelfMailerListParams as SelfMailerListParams, - }; -} diff --git a/src/resources/print-mail/order-profiles/postcards.ts b/src/resources/print-mail/order-profiles/postcards.ts deleted file mode 100644 index 0c46d93..0000000 --- a/src/resources/print-mail/order-profiles/postcards.ts +++ /dev/null @@ -1,411 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../core/resource'; -import { APIPromise } from '../../../core/api-promise'; -import { PagePromise, SkipLimit, type SkipLimitParams } from '../../../core/pagination'; -import { RequestOptions } from '../../../internal/request-options'; -import { path } from '../../../internal/utils/path'; - -/** - * Order Profiles are reusable blueprints for creating print and mail orders (Letters, Postcards, Cheques, Self-Mailers). - * They define common properties like size, content (via templates or uploaded PDFs), mailing class, and metadata. - * Using profiles simplifies order creation, especially for recurring mailings or campaigns, by pre-filling many parameters. - * - * Profiles are environment-specific (live vs. test). - */ -export class Postcards extends APIResource { - /** - * Creates a new Postcard Profile. Provide either `frontTemplate` and - * `backTemplate` IDs, or upload a 2-page `pdf`. If providing a `pdf`, the request - * `Content-Type` must be `multipart/form-data`. - * - * @example - * ```ts - * const postcardProfile = - * await client.printMail.orderProfiles.postcards.create({ - * size: '6x4', - * }); - * ``` - */ - create(params: PostcardCreateParams, options?: RequestOptions): APIPromise { - const { expand, ...body } = params; - return this._client.post('/print-mail/v1/order_profiles/postcards', { - query: { expand }, - body, - ...options, - }); - } - - /** - * Retrieves the details of a specific Postcard Profile. - * - * @example - * ```ts - * const postcardProfile = - * await client.printMail.orderProfiles.postcards.retrieve( - * 'id', - * ); - * ``` - */ - retrieve( - id: string, - query: PostcardRetrieveParams | null | undefined = {}, - options?: RequestOptions, - ): APIPromise { - return this._client.get(path`/print-mail/v1/order_profiles/postcards/${id}`, { query, ...options }); - } - - /** - * Updates specific fields of an existing Postcard Profile. If providing a `pdf`, - * the request `Content-Type` must be `multipart/form-data`. - * - * @example - * ```ts - * const postcardProfile = - * await client.printMail.orderProfiles.postcards.update( - * 'id', - * ); - * ``` - */ - update(id: string, params: PostcardUpdateParams, options?: RequestOptions): APIPromise { - const { expand, ...body } = params; - return this._client.post(path`/print-mail/v1/order_profiles/postcards/${id}`, { - query: { expand }, - body, - ...options, - }); - } - - /** - * Retrieves a list of Postcard Profiles. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const postcardProfile of client.printMail.orderProfiles.postcards.list()) { - * // ... - * } - * ``` - */ - list( - query: PostcardListParams | null | undefined = {}, - options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList('/print-mail/v1/order_profiles/postcards', SkipLimit, { - query, - ...options, - }); - } - - /** - * Deletes a Postcard Profile. - * - * @example - * ```ts - * const postcard = - * await client.printMail.orderProfiles.postcards.delete( - * 'id', - * ); - * ``` - */ - delete(id: string, options?: RequestOptions): APIPromise { - return this._client.delete(path`/print-mail/v1/order_profiles/postcards/${id}`, options); - } -} - -export type PostcardProfilesSkipLimit = SkipLimit; - -export interface PostcardProfile { - /** - * Unique identifier for the order profile. - */ - id: string; - - /** - * Timestamp when the profile was created. - */ - createdAt: string; - - /** - * Indicates if the profile is associated with the live or test environment. - */ - live: boolean; - - /** - * Always `postcard_profile`. - */ - object: 'postcard_profile'; - - /** - * Enum representing the supported postcard sizes. - */ - size: PostcardSize; - - /** - * Timestamp when the profile was last updated. - */ - updatedAt: string; - - /** - * ID of the template for the back side. Required unless `pdf` is provided. - */ - backTemplate?: string; - - /** - * An optional description for the profile. Set to `null` to remove during update. - */ - description?: string | null; - - /** - * ID of the template for the front side. Required unless `pdf` is provided. - */ - frontTemplate?: string; - - /** - * Mailing class (cannot include extra services like `certified` or `registered` - * for postcards, though). - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; - - /** - * A temporary, signed URL to view the uploaded PDF content, if any. - */ - uploadedPDF?: string; -} - -/** - * Enum representing the supported postcard sizes. - */ -export type PostcardSize = '6x4' | '9x6' | '11x6'; - -export interface PostcardDeleteResponse { - /** - * Unique identifier for the order profile. - */ - id: string; - - deleted: true; - - /** - * Always `postcard_profile`. - */ - object: 'postcard_profile'; -} - -export interface PostcardCreateParams { - /** - * Body param: Enum representing the supported postcard sizes. - */ - size: PostcardSize; - - /** - * Query param: Optional list of related resources to expand in the response. - */ - expand?: Array; - - /** - * Body param: ID of the template for the back side. Required unless `pdf` is - * provided. - */ - backTemplate?: string; - - /** - * Body param: An optional description for the profile. Set to `null` to remove - * during update. - */ - description?: string | null; - - /** - * Body param: ID of the template for the front side. Required unless `pdf` is - * provided. - */ - frontTemplate?: string; - - /** - * Body param: Mailing class (cannot include extra services like `certified` or - * `registered` for postcards, though). - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Body param: Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Body param: Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; - - /** - * Body param: A 2-page PDF file containing the postcard content (front and back). - * Cannot be used with `frontTemplate`/`backTemplate`. - */ - pdf?: string; -} - -export interface PostcardRetrieveParams { - /** - * Optional list of related resources to expand in the response. - */ - expand?: Array; -} - -export interface PostcardUpdateParams { - /** - * Query param: Optional list of related resources to expand in the response. - */ - expand?: Array; - - /** - * Body param: ID of the template for the back side. Required unless `pdf` is - * provided. - */ - backTemplate?: string; - - /** - * Body param: An optional description for the profile. Set to `null` to remove - * during update. - */ - description?: string | null; - - /** - * Body param: ID of the template for the front side. Required unless `pdf` is - * provided. - */ - frontTemplate?: string; - - /** - * Body param: Mailing class (cannot include extra services like `certified` or - * `registered` for postcards, though). - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Body param: Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Body param: Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; - - /** - * Body param: A 2-page PDF file containing the postcard content (front and back). - * Cannot be used with `frontTemplate`/`backTemplate`. - */ - pdf?: string; -} - -export interface PostcardListParams extends SkipLimitParams { - /** - * You can supply any string to help narrow down the list of resources. For - * example, if you pass `"New York"` (quoted), it will return resources that have - * that string present somewhere in their response. Alternatively, you can supply a - * structured search query. See the documentation on `StructuredSearchQuery` for - * more details. - */ - search?: string; -} - -export declare namespace Postcards { - export { - type PostcardProfile as PostcardProfile, - type PostcardSize as PostcardSize, - type PostcardDeleteResponse as PostcardDeleteResponse, - type PostcardProfilesSkipLimit as PostcardProfilesSkipLimit, - type PostcardCreateParams as PostcardCreateParams, - type PostcardRetrieveParams as PostcardRetrieveParams, - type PostcardUpdateParams as PostcardUpdateParams, - type PostcardListParams as PostcardListParams, - }; -} diff --git a/src/resources/print-mail/order-profiles/self-mailers.ts b/src/resources/print-mail/order-profiles/self-mailers.ts deleted file mode 100644 index 1a787bb..0000000 --- a/src/resources/print-mail/order-profiles/self-mailers.ts +++ /dev/null @@ -1,422 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../core/resource'; -import { APIPromise } from '../../../core/api-promise'; -import { PagePromise, SkipLimit, type SkipLimitParams } from '../../../core/pagination'; -import { RequestOptions } from '../../../internal/request-options'; -import { path } from '../../../internal/utils/path'; - -/** - * Order Profiles are reusable blueprints for creating print and mail orders (Letters, Postcards, Cheques, Self-Mailers). - * They define common properties like size, content (via templates or uploaded PDFs), mailing class, and metadata. - * Using profiles simplifies order creation, especially for recurring mailings or campaigns, by pre-filling many parameters. - * - * Profiles are environment-specific (live vs. test). - */ -export class SelfMailers extends APIResource { - /** - * Creates a new Self-Mailer Profile. Provide either `insideTemplate` and - * `outsideTemplate` IDs, or upload a 2-page `pdf`. If providing a `pdf`, the - * request `Content-Type` must be `multipart/form-data`. - * - * @example - * ```ts - * const selfMailerProfile = - * await client.printMail.orderProfiles.selfMailers.create({ - * size: '8.5x11_bifold', - * }); - * ``` - */ - create(params: SelfMailerCreateParams, options?: RequestOptions): APIPromise { - const { expand, ...body } = params; - return this._client.post('/print-mail/v1/order_profiles/self_mailers', { - query: { expand }, - body, - ...options, - }); - } - - /** - * Retrieves the details of a specific Self-Mailer Profile. - * - * @example - * ```ts - * const selfMailerProfile = - * await client.printMail.orderProfiles.selfMailers.retrieve( - * 'id', - * ); - * ``` - */ - retrieve( - id: string, - query: SelfMailerRetrieveParams | null | undefined = {}, - options?: RequestOptions, - ): APIPromise { - return this._client.get(path`/print-mail/v1/order_profiles/self_mailers/${id}`, { query, ...options }); - } - - /** - * Updates specific fields of an existing Self-Mailer Profile. If providing a - * `pdf`, the request `Content-Type` must be `multipart/form-data`. - * - * @example - * ```ts - * const selfMailerProfile = - * await client.printMail.orderProfiles.selfMailers.update( - * 'id', - * { size: '8.5x11_bifold' }, - * ); - * ``` - */ - update( - id: string, - params: SelfMailerUpdateParams, - options?: RequestOptions, - ): APIPromise { - const { expand, ...body } = params; - return this._client.post(path`/print-mail/v1/order_profiles/self_mailers/${id}`, { - query: { expand }, - body, - ...options, - }); - } - - /** - * Retrieves a list of Self-Mailer Profiles. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const selfMailerProfile of client.printMail.orderProfiles.selfMailers.list()) { - * // ... - * } - * ``` - */ - list( - query: SelfMailerListParams | null | undefined = {}, - options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList( - '/print-mail/v1/order_profiles/self_mailers', - SkipLimit, - { query, ...options }, - ); - } - - /** - * Deletes a Self-Mailer Profile. - * - * @example - * ```ts - * const selfMailer = - * await client.printMail.orderProfiles.selfMailers.delete( - * 'id', - * ); - * ``` - */ - delete(id: string, options?: RequestOptions): APIPromise { - return this._client.delete(path`/print-mail/v1/order_profiles/self_mailers/${id}`, options); - } -} - -export type SelfMailerProfilesSkipLimit = SkipLimit; - -/** - * Represents a Self-Mailer Profile resource. - */ -export interface SelfMailerProfile { - /** - * Unique identifier for the order profile. - */ - id: string; - - /** - * Timestamp when the profile was created. - */ - createdAt: string; - - /** - * Indicates if the profile is associated with the live or test environment. - */ - live: boolean; - - /** - * Always `self_mailer_profile`. - */ - object: 'self_mailer_profile'; - - /** - * Enum representing the supported self-mailer sizes. - */ - size: SelfMailerSize; - - /** - * Timestamp when the profile was last updated. - */ - updatedAt: string; - - /** - * An optional description for the profile. Set to `null` to remove during update. - */ - description?: string | null; - - /** - * ID of the template for the inside. Required unless `pdf` is provided. - */ - insideTemplate?: string; - - /** - * Mailing class (cannot include extra services for self-mailers). - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; - - /** - * ID of the template for the outside. Required unless `pdf` is provided. - */ - outsideTemplate?: string; - - /** - * A temporary, signed URL to view the uploaded PDF, if any. - */ - uploadedPDF?: string; -} - -/** - * Enum representing the supported self-mailer sizes. - */ -export type SelfMailerSize = '8.5x11_bifold' | '8.5x11_trifold' | '9.5x16_trifold'; - -export interface SelfMailerDeleteResponse { - /** - * Unique identifier for the order profile. - */ - id: string; - - deleted: true; - - /** - * Always `self_mailer_profile`. - */ - object: 'self_mailer_profile'; -} - -export interface SelfMailerCreateParams { - /** - * Body param: Enum representing the supported self-mailer sizes. - */ - size: SelfMailerSize; - - /** - * Query param: Optional list of related resources to expand in the response. - */ - expand?: Array; - - /** - * Body param: An optional description for the profile. Set to `null` to remove - * during update. - */ - description?: string | null; - - /** - * Body param: ID of the template for the inside. Required unless `pdf` is - * provided. - */ - insideTemplate?: string; - - /** - * Body param: Mailing class (cannot include extra services for self-mailers). - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Body param: Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Body param: Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; - - /** - * Body param: ID of the template for the outside. Required unless `pdf` is - * provided. - */ - outsideTemplate?: string; - - /** - * Body param: A 2-page PDF file containing the self-mailer content (inside and - * outside). Cannot be used with `insideTemplate`/`outsideTemplate`. - */ - pdf?: string; -} - -export interface SelfMailerRetrieveParams { - /** - * Optional list of related resources to expand in the response. - */ - expand?: Array; -} - -export interface SelfMailerUpdateParams { - /** - * Body param: Enum representing the supported self-mailer sizes. - */ - size: SelfMailerSize; - - /** - * Query param: Optional list of related resources to expand in the response. - */ - expand?: Array; - - /** - * Body param: An optional description for the profile. Set to `null` to remove - * during update. - */ - description?: string | null; - - /** - * Body param: ID of the template for the inside. Required unless `pdf` is - * provided. - */ - insideTemplate?: string; - - /** - * Body param: Mailing class (cannot include extra services for self-mailers). - */ - mailingClass?: - | 'first_class' - | 'standard_class' - | 'express' - | 'certified' - | 'certified_return_receipt' - | 'registered' - | 'usps_first_class' - | 'usps_standard_class' - | 'usps_eddm' - | 'usps_express_2_day' - | 'usps_express_3_day' - | 'usps_first_class_certified' - | 'usps_first_class_certified_return_receipt' - | 'usps_first_class_registered' - | 'usps_express_3_day_signature_confirmation' - | 'usps_express_3_day_certified' - | 'usps_express_3_day_certified_return_receipt' - | 'ca_post_lettermail' - | 'ca_post_personalized' - | 'ca_post_neighbourhood_mail' - | 'ups_express_overnight' - | 'ups_express_2_day' - | 'ups_express_3_day' - | 'royal_mail_first_class' - | 'royal_mail_second_class' - | 'au_post_second_class'; - - /** - * Body param: Default merge variables for orders created using this profile. - */ - mergeVariables?: { [key: string]: unknown } | null; - - /** - * Body param: Optional key-value metadata. - */ - metadata?: { [key: string]: string } | null; - - /** - * Body param: ID of the template for the outside. Required unless `pdf` is - * provided. - */ - outsideTemplate?: string; - - /** - * Body param: A 2-page PDF file containing the self-mailer content (inside and - * outside). Cannot be used with `insideTemplate`/`outsideTemplate`. - */ - pdf?: string; -} - -export interface SelfMailerListParams extends SkipLimitParams { - /** - * You can supply any string to help narrow down the list of resources. For - * example, if you pass `"New York"` (quoted), it will return resources that have - * that string present somewhere in their response. Alternatively, you can supply a - * structured search query. See the documentation on `StructuredSearchQuery` for - * more details. - */ - search?: string; -} - -export declare namespace SelfMailers { - export { - type SelfMailerProfile as SelfMailerProfile, - type SelfMailerSize as SelfMailerSize, - type SelfMailerDeleteResponse as SelfMailerDeleteResponse, - type SelfMailerProfilesSkipLimit as SelfMailerProfilesSkipLimit, - type SelfMailerCreateParams as SelfMailerCreateParams, - type SelfMailerRetrieveParams as SelfMailerRetrieveParams, - type SelfMailerUpdateParams as SelfMailerUpdateParams, - type SelfMailerListParams as SelfMailerListParams, - }; -} diff --git a/src/resources/print-mail/postcards.ts b/src/resources/print-mail/postcards.ts index 64ea80a..f8ecc0d 100644 --- a/src/resources/print-mail/postcards.ts +++ b/src/resources/print-mail/postcards.ts @@ -2,8 +2,6 @@ import { APIResource } from '../../core/resource'; import * as ContactsAPI from './contacts'; -import * as PrintMailAPI from './print-mail'; -import * as OrderProfilesPostcardsAPI from './order-profiles/postcards'; import { APIPromise } from '../../core/api-promise'; import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination'; import { RequestOptions } from '../../internal/request-options'; @@ -80,6 +78,41 @@ export class Postcards extends APIResource { return this._client.delete(path`/print-mail/v1/postcards/${id}`, options); } + /** + * Cancel a postcard by ID with a note. Note that this operation cannot be undone + * and that only postcards with a status of `ready` can be cancelled. + * + * @example + * ```ts + * const postcard = await client.printMail.postcards.cancel( + * 'id', + * { note: 'Cancelling this postcard' }, + * ); + * ``` + */ + cancel(id: string, body: PostcardCancelParams, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/postcards/${id}/cancellation`, { body, ...options }); + } + + /** + * Progresses a postcard's `status` to the next stage. This is only available in + * test mode and can be used to simulate how a live order would progress through + * the different statuses. + * + * Note: this will fail with an `invalid_progression_error` if the status is one of + * `completed` or `cancelled`. + * + * @example + * ```ts + * const postcard = await client.printMail.postcards.progress( + * 'id', + * ); + * ``` + */ + progress(id: string, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/postcards/${id}/progressions`, options); + } + /** * Retrieve a postcard preview URL. * @@ -164,7 +197,7 @@ export interface Postcard { /** * Enum representing the supported postcard sizes. */ - size: OrderProfilesPostcardsAPI.PostcardSize; + size: '6x4' | '9x6' | '11x6'; /** * See `OrderStatus` for more details on the status of this order. @@ -230,6 +263,12 @@ export interface Postcard { */ metadata?: { [key: string]: unknown }; + /** + * Premium paper identifier. Use "standard" for regular stock or a premium*paper*\* + * ID. + */ + paper?: string; + /** * The tracking number of this order. Populated after an express/certified order * has been processed for delivery. @@ -310,7 +349,7 @@ export declare namespace PostcardCreateParams { /** * Enum representing the supported postcard sizes. */ - size: OrderProfilesPostcardsAPI.PostcardSize; + size: '6x4' | '9x6' | '11x6'; /** * The recipient of this order. You can either supply the contact information @@ -318,7 +357,7 @@ export declare namespace PostcardCreateParams { * contacts regardless of whether you provide the information inline here or call * the contact creation endpoint. */ - to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * An optional string describing this resource. Will be visible in the API and the @@ -331,7 +370,7 @@ export declare namespace PostcardCreateParams { * here just like you can for the `to`. Unlike other order types, the sender * address is optional for postcards. */ - from?: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + from?: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * The mailing class of this order. If not provided, automatically set to @@ -378,6 +417,12 @@ export declare namespace PostcardCreateParams { */ metadata?: { [key: string]: unknown }; + /** + * Premium paper identifier. Use "standard" for regular stock or a premium*paper*\* + * ID. + */ + paper?: string; + /** * This order will transition from `ready` to `printing` on the day after this * date. You can use this parameter to schedule orders for a future date. @@ -409,7 +454,7 @@ export declare namespace PostcardCreateParams { /** * Enum representing the supported postcard sizes. */ - size: OrderProfilesPostcardsAPI.PostcardSize; + size: '6x4' | '9x6' | '11x6'; /** * The recipient of this order. You can either supply the contact information @@ -417,7 +462,7 @@ export declare namespace PostcardCreateParams { * contacts regardless of whether you provide the information inline here or call * the contact creation endpoint. */ - to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * An optional string describing this resource. Will be visible in the API and the @@ -430,7 +475,7 @@ export declare namespace PostcardCreateParams { * here just like you can for the `to`. Unlike other order types, the sender * address is optional for postcards. */ - from?: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + from?: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * The mailing class of this order. If not provided, automatically set to @@ -477,6 +522,12 @@ export declare namespace PostcardCreateParams { */ metadata?: { [key: string]: unknown }; + /** + * Premium paper identifier. Use "standard" for regular stock or a premium*paper*\* + * ID. + */ + paper?: string; + /** * This order will transition from `ready` to `printing` on the day after this * date. You can use this parameter to schedule orders for a future date. @@ -494,7 +545,7 @@ export declare namespace PostcardCreateParams { /** * Enum representing the supported postcard sizes. */ - size: OrderProfilesPostcardsAPI.PostcardSize; + size: '6x4' | '9x6' | '11x6'; /** * The recipient of this order. You can either supply the contact information @@ -502,7 +553,7 @@ export declare namespace PostcardCreateParams { * contacts regardless of whether you provide the information inline here or call * the contact creation endpoint. */ - to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * An optional string describing this resource. Will be visible in the API and the @@ -515,7 +566,7 @@ export declare namespace PostcardCreateParams { * here just like you can for the `to`. Unlike other order types, the sender * address is optional for postcards. */ - from?: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + from?: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * The mailing class of this order. If not provided, automatically set to @@ -562,6 +613,12 @@ export declare namespace PostcardCreateParams { */ metadata?: { [key: string]: unknown }; + /** + * Premium paper identifier. Use "standard" for regular stock or a premium*paper*\* + * ID. + */ + paper?: string; + /** * This order will transition from `ready` to `printing` on the day after this * date. You can use this parameter to schedule orders for a future date. @@ -581,6 +638,10 @@ export interface PostcardListParams extends SkipLimitParams { search?: string; } +export interface PostcardCancelParams { + note: string; +} + export declare namespace Postcards { export { type Postcard as Postcard, @@ -588,5 +649,6 @@ export declare namespace Postcards { type PostcardsSkipLimit as PostcardsSkipLimit, type PostcardCreateParams as PostcardCreateParams, type PostcardListParams as PostcardListParams, + type PostcardCancelParams as PostcardCancelParams, }; } diff --git a/src/resources/print-mail/print-mail.ts b/src/resources/print-mail/print-mail.ts index 7f60ffd..c707dfd 100644 --- a/src/resources/print-mail/print-mail.ts +++ b/src/resources/print-mail/print-mail.ts @@ -11,6 +11,18 @@ import { BankAccounts, BankAccountsSkipLimit, } from './bank-accounts'; +import * as BoxesAPI from './boxes'; +import { + BoxCreateParams, + BoxCreateResponse, + BoxDeleteResponse, + BoxListParams, + BoxListResponse, + BoxListResponsesSkipLimit, + BoxProgressionsResponse, + BoxRetrieveResponse, + Boxes, +} from './boxes'; import * as CampaignsAPI from './campaigns'; import { Campaign, @@ -25,6 +37,7 @@ import { import * as ChequesAPI from './cheques'; import { Cheque, + ChequeCancelParams, ChequeCreateParams, ChequeListParams, ChequeRetrieveURLResponse, @@ -38,6 +51,8 @@ import { Contact, ContactCreate, ContactCreateParams, + ContactCreateWithCompanyName, + ContactCreateWithFirstName, ContactDeleteResponse, ContactListParams, Contacts, @@ -48,6 +63,7 @@ import { AddressPlacement, AttachedPdf, Letter, + LetterCancelParams, LetterCreateParams, LetterListParams, LetterRetrieveURLResponse, @@ -83,6 +99,7 @@ import { import * as PostcardsAPI from './postcards'; import { Postcard, + PostcardCancelParams, PostcardCreateParams, PostcardListParams, PostcardRetrieveURLResponse, @@ -98,18 +115,42 @@ import { SelfMailers, SelfMailersSkipLimit, } from './self-mailers'; +import * as SnapPacksAPI from './snap-packs'; +import { + SnapPackCreateParams, + SnapPackCreateResponse, + SnapPackDeleteResponse, + SnapPackListParams, + SnapPackListResponse, + SnapPackListResponsesSkipLimit, + SnapPackProgressionsResponse, + SnapPackRetrieveCapabilitiesParams, + SnapPackRetrieveCapabilitiesResponse, + SnapPackRetrieveResponse, + SnapPacks, +} from './snap-packs'; import * as SubOrganizationsAPI from './sub-organizations'; import { EmailPreferences, SubOrganization, + SubOrganizationCreateParams, + SubOrganizationCreateResponse, SubOrganizationListParams, SubOrganizationRetrieveUsersParams, SubOrganizationRetrieveUsersResponse, - SubOrganizationUpdateParams, - SubOrganizationUpdateResponse, SubOrganizations, SubOrganizationsSkipLimit, } from './sub-organizations'; +import * as TemplateEditorSessionsAPI from './template-editor-sessions'; +import { + TemplateEditorSessionCreateParams, + TemplateEditorSessionCreateResponse, + TemplateEditorSessionDeleteResponse, + TemplateEditorSessionListParams, + TemplateEditorSessionListResponse, + TemplateEditorSessionListResponsesSkipLimit, + TemplateEditorSessions, +} from './template-editor-sessions'; import * as TemplatesAPI from './templates'; import { Template, @@ -120,8 +161,22 @@ import { Templates, TemplatesSkipLimit, } from './templates'; -import * as OrderProfilesAPI from './order-profiles/order-profiles'; -import { OrderProfiles } from './order-profiles/order-profiles'; +import * as TrackersAPI from './trackers'; +import { + TrackerCreateParams, + TrackerCreateResponse, + TrackerDeleteResponse, + TrackerListParams, + TrackerListResponse, + TrackerListResponsesSkipLimit, + TrackerRetrieveResponse, + TrackerRetrieveVisitsParams, + TrackerRetrieveVisitsResponse, + TrackerRetrieveVisitsResponsesSkipLimit, + TrackerUpdateParams, + TrackerUpdateResponse, + Trackers, +} from './trackers'; import * as ReportsAPI from './reports/reports'; import { DeletedResponse, @@ -133,209 +188,142 @@ import { Reports, ReportsSkipLimit, } from './reports/reports'; +import * as TargetedListBuildsAPI from './targeted-list-builds/targeted-list-builds'; +import { + TargetedListBuildConfirmResponse, + TargetedListBuildCreateParams, + TargetedListBuildCreateResponse, + TargetedListBuildDeleteResponse, + TargetedListBuildListParams, + TargetedListBuildListResponse, + TargetedListBuildListResponsesSkipLimit, + TargetedListBuildRetrieveResponse, + TargetedListBuildUpdateParams, + TargetedListBuildUpdateResponse, + TargetedListBuilds, +} from './targeted-list-builds/targeted-list-builds'; +import * as VirtualMailboxesAPI from './virtual-mailboxes/virtual-mailboxes'; +import { + VirtualMailboxCreateParams, + VirtualMailboxCreateResponse, + VirtualMailboxListParams, + VirtualMailboxListResponse, + VirtualMailboxListResponsesSkipLimit, + VirtualMailboxRetrieveAddressResponse, + VirtualMailboxRetrieveResponse, + VirtualMailboxes, +} from './virtual-mailboxes/virtual-mailboxes'; export class PrintMail extends APIResource { - bankAccounts: BankAccountsAPI.BankAccounts = new BankAccountsAPI.BankAccounts(this._client); - campaigns: CampaignsAPI.Campaigns = new CampaignsAPI.Campaigns(this._client); - cheques: ChequesAPI.Cheques = new ChequesAPI.Cheques(this._client); contacts: ContactsAPI.Contacts = new ContactsAPI.Contacts(this._client); + templates: TemplatesAPI.Templates = new TemplatesAPI.Templates(this._client); + trackers: TrackersAPI.Trackers = new TrackersAPI.Trackers(this._client); letters: LettersAPI.Letters = new LettersAPI.Letters(this._client); + postcards: PostcardsAPI.Postcards = new PostcardsAPI.Postcards(this._client); + bankAccounts: BankAccountsAPI.BankAccounts = new BankAccountsAPI.BankAccounts(this._client); + cheques: ChequesAPI.Cheques = new ChequesAPI.Cheques(this._client); + selfMailers: SelfMailersAPI.SelfMailers = new SelfMailersAPI.SelfMailers(this._client); + campaigns: CampaignsAPI.Campaigns = new CampaignsAPI.Campaigns(this._client); mailingListImports: MailingListImportsAPI.MailingListImports = new MailingListImportsAPI.MailingListImports( this._client, ); mailingLists: MailingListsAPI.MailingLists = new MailingListsAPI.MailingLists(this._client); - orderProfiles: OrderProfilesAPI.OrderProfiles = new OrderProfilesAPI.OrderProfiles(this._client); - postcards: PostcardsAPI.Postcards = new PostcardsAPI.Postcards(this._client); reports: ReportsAPI.Reports = new ReportsAPI.Reports(this._client); - selfMailers: SelfMailersAPI.SelfMailers = new SelfMailersAPI.SelfMailers(this._client); subOrganizations: SubOrganizationsAPI.SubOrganizations = new SubOrganizationsAPI.SubOrganizations( this._client, ); - templates: TemplatesAPI.Templates = new TemplatesAPI.Templates(this._client); -} - -export interface ContactCreateWithCompanyName { - /** - * The first line of the contact's address. - */ - addressLine1: string; - - companyName: string; - - /** - * The ISO 3611-1 country code of the contact's address. - */ - countryCode: string; - - /** - * Second line of the contact's address, if applicable. - */ - addressLine2?: string; - - /** - * The city of the contact's address. - */ - city?: string; - - /** - * An optional string describing this resource. Will be visible in the API and the - * dashboard. - */ - description?: string; - - /** - * Email of the contact. - */ - email?: string; - - /** - * First name of the contact. - */ - firstName?: string; - - /** - * If `true`, PostGrid will force this contact to have an `addressStatus` of - * `verified` even if our address verification system says otherwise. - */ - forceVerifiedStatus?: boolean; - - /** - * Job title of the contact. - */ - jobTitle?: string; - - /** - * Last name of the contact. - */ - lastName?: string; - - /** - * See the section on Metadata. - */ - metadata?: { [key: string]: unknown }; - - /** - * Phone number of the contact. - */ - phoneNumber?: string; - - /** - * The postal or ZIP code of the contact's address. - */ - postalOrZip?: string; - - /** - * Province or state of the contact's address. - */ - provinceOrState?: string; - - /** - * If `true`, PostGrid will skip running this contact's address through our address - * verification system. - */ - skipVerification?: boolean; -} - -export interface ContactCreateWithFirstName { - /** - * The first line of the contact's address. - */ - addressLine1: string; - - /** - * The ISO 3611-1 country code of the contact's address. - */ - countryCode: string; - - firstName: string; - - /** - * Second line of the contact's address, if applicable. - */ - addressLine2?: string; - - /** - * The city of the contact's address. - */ - city?: string; - - /** - * Company name of the contact. - */ - companyName?: string; - - /** - * An optional string describing this resource. Will be visible in the API and the - * dashboard. - */ - description?: string; - - /** - * Email of the contact. - */ - email?: string; - - /** - * If `true`, PostGrid will force this contact to have an `addressStatus` of - * `verified` even if our address verification system says otherwise. - */ - forceVerifiedStatus?: boolean; - - /** - * Job title of the contact. - */ - jobTitle?: string; - - /** - * Last name of the contact. - */ - lastName?: string; - - /** - * See the section on Metadata. - */ - metadata?: { [key: string]: unknown }; - - /** - * Phone number of the contact. - */ - phoneNumber?: string; - - /** - * The postal or ZIP code of the contact's address. - */ - postalOrZip?: string; - - /** - * Province or state of the contact's address. - */ - provinceOrState?: string; - - /** - * If `true`, PostGrid will skip running this contact's address through our address - * verification system. - */ - skipVerification?: boolean; + boxes: BoxesAPI.Boxes = new BoxesAPI.Boxes(this._client); + snapPacks: SnapPacksAPI.SnapPacks = new SnapPacksAPI.SnapPacks(this._client); + targetedListBuilds: TargetedListBuildsAPI.TargetedListBuilds = new TargetedListBuildsAPI.TargetedListBuilds( + this._client, + ); + templateEditorSessions: TemplateEditorSessionsAPI.TemplateEditorSessions = + new TemplateEditorSessionsAPI.TemplateEditorSessions(this._client); + virtualMailboxes: VirtualMailboxesAPI.VirtualMailboxes = new VirtualMailboxesAPI.VirtualMailboxes( + this._client, + ); } -PrintMail.BankAccounts = BankAccounts; -PrintMail.Campaigns = Campaigns; -PrintMail.Cheques = Cheques; PrintMail.Contacts = Contacts; +PrintMail.Templates = Templates; +PrintMail.Trackers = Trackers; PrintMail.Letters = Letters; +PrintMail.Postcards = Postcards; +PrintMail.BankAccounts = BankAccounts; +PrintMail.Cheques = Cheques; +PrintMail.SelfMailers = SelfMailers; +PrintMail.Campaigns = Campaigns; PrintMail.MailingListImports = MailingListImports; PrintMail.MailingLists = MailingLists; -PrintMail.OrderProfiles = OrderProfiles; -PrintMail.Postcards = Postcards; PrintMail.Reports = Reports; -PrintMail.SelfMailers = SelfMailers; PrintMail.SubOrganizations = SubOrganizations; -PrintMail.Templates = Templates; +PrintMail.Boxes = Boxes; +PrintMail.SnapPacks = SnapPacks; +PrintMail.TargetedListBuilds = TargetedListBuilds; +PrintMail.TemplateEditorSessions = TemplateEditorSessions; +PrintMail.VirtualMailboxes = VirtualMailboxes; export declare namespace PrintMail { export { + Contacts as Contacts, + type Contact as Contact, + type ContactCreate as ContactCreate, type ContactCreateWithCompanyName as ContactCreateWithCompanyName, type ContactCreateWithFirstName as ContactCreateWithFirstName, + type ContactDeleteResponse as ContactDeleteResponse, + type ContactsSkipLimit as ContactsSkipLimit, + type ContactCreateParams as ContactCreateParams, + type ContactListParams as ContactListParams, + }; + + export { + Templates as Templates, + type Template as Template, + type TemplateDeleteResponse as TemplateDeleteResponse, + type TemplatesSkipLimit as TemplatesSkipLimit, + type TemplateCreateParams as TemplateCreateParams, + type TemplateUpdateParams as TemplateUpdateParams, + type TemplateListParams as TemplateListParams, + }; + + export { + Trackers as Trackers, + type TrackerCreateResponse as TrackerCreateResponse, + type TrackerRetrieveResponse as TrackerRetrieveResponse, + type TrackerUpdateResponse as TrackerUpdateResponse, + type TrackerListResponse as TrackerListResponse, + type TrackerDeleteResponse as TrackerDeleteResponse, + type TrackerRetrieveVisitsResponse as TrackerRetrieveVisitsResponse, + type TrackerListResponsesSkipLimit as TrackerListResponsesSkipLimit, + type TrackerRetrieveVisitsResponsesSkipLimit as TrackerRetrieveVisitsResponsesSkipLimit, + type TrackerCreateParams as TrackerCreateParams, + type TrackerUpdateParams as TrackerUpdateParams, + type TrackerListParams as TrackerListParams, + type TrackerRetrieveVisitsParams as TrackerRetrieveVisitsParams, + }; + + export { + Letters as Letters, + type AddressPlacement as AddressPlacement, + type AttachedPdf as AttachedPdf, + type Letter as Letter, + type LetterSize as LetterSize, + type PlasticCard as PlasticCard, + type LetterRetrieveURLResponse as LetterRetrieveURLResponse, + type LettersSkipLimit as LettersSkipLimit, + type LetterCreateParams as LetterCreateParams, + type LetterListParams as LetterListParams, + type LetterCancelParams as LetterCancelParams, + }; + + export { + Postcards as Postcards, + type Postcard as Postcard, + type PostcardRetrieveURLResponse as PostcardRetrieveURLResponse, + type PostcardsSkipLimit as PostcardsSkipLimit, + type PostcardCreateParams as PostcardCreateParams, + type PostcardListParams as PostcardListParams, + type PostcardCancelParams as PostcardCancelParams, }; export { @@ -348,17 +336,6 @@ export declare namespace PrintMail { type BankAccountListParams as BankAccountListParams, }; - export { - Campaigns as Campaigns, - type Campaign as Campaign, - type CampaignDeleteResponse as CampaignDeleteResponse, - type CampaignsSkipLimit as CampaignsSkipLimit, - type CampaignCreateParams as CampaignCreateParams, - type CampaignUpdateParams as CampaignUpdateParams, - type CampaignListParams as CampaignListParams, - type CampaignSendParams as CampaignSendParams, - }; - export { Cheques as Cheques, type Cheque as Cheque, @@ -368,29 +345,27 @@ export declare namespace PrintMail { type ChequesSkipLimit as ChequesSkipLimit, type ChequeCreateParams as ChequeCreateParams, type ChequeListParams as ChequeListParams, + type ChequeCancelParams as ChequeCancelParams, }; export { - Contacts as Contacts, - type Contact as Contact, - type ContactCreate as ContactCreate, - type ContactDeleteResponse as ContactDeleteResponse, - type ContactsSkipLimit as ContactsSkipLimit, - type ContactCreateParams as ContactCreateParams, - type ContactListParams as ContactListParams, + SelfMailers as SelfMailers, + type SelfMailer as SelfMailer, + type SelfMailerRetrieveURLResponse as SelfMailerRetrieveURLResponse, + type SelfMailersSkipLimit as SelfMailersSkipLimit, + type SelfMailerCreateParams as SelfMailerCreateParams, + type SelfMailerListParams as SelfMailerListParams, }; export { - Letters as Letters, - type AddressPlacement as AddressPlacement, - type AttachedPdf as AttachedPdf, - type Letter as Letter, - type LetterSize as LetterSize, - type PlasticCard as PlasticCard, - type LetterRetrieveURLResponse as LetterRetrieveURLResponse, - type LettersSkipLimit as LettersSkipLimit, - type LetterCreateParams as LetterCreateParams, - type LetterListParams as LetterListParams, + Campaigns as Campaigns, + type Campaign as Campaign, + type CampaignDeleteResponse as CampaignDeleteResponse, + type CampaignsSkipLimit as CampaignsSkipLimit, + type CampaignCreateParams as CampaignCreateParams, + type CampaignUpdateParams as CampaignUpdateParams, + type CampaignListParams as CampaignListParams, + type CampaignSendParams as CampaignSendParams, }; export { @@ -417,17 +392,6 @@ export declare namespace PrintMail { type MailingListJobsParams as MailingListJobsParams, }; - export { OrderProfiles as OrderProfiles }; - - export { - Postcards as Postcards, - type Postcard as Postcard, - type PostcardRetrieveURLResponse as PostcardRetrieveURLResponse, - type PostcardsSkipLimit as PostcardsSkipLimit, - type PostcardCreateParams as PostcardCreateParams, - type PostcardListParams as PostcardListParams, - }; - export { Reports as Reports, type DeletedResponse as DeletedResponse, @@ -439,34 +403,76 @@ export declare namespace PrintMail { type ReportSampleParams as ReportSampleParams, }; - export { - SelfMailers as SelfMailers, - type SelfMailer as SelfMailer, - type SelfMailerRetrieveURLResponse as SelfMailerRetrieveURLResponse, - type SelfMailersSkipLimit as SelfMailersSkipLimit, - type SelfMailerCreateParams as SelfMailerCreateParams, - type SelfMailerListParams as SelfMailerListParams, - }; - export { SubOrganizations as SubOrganizations, type EmailPreferences as EmailPreferences, type SubOrganization as SubOrganization, - type SubOrganizationUpdateResponse as SubOrganizationUpdateResponse, + type SubOrganizationCreateResponse as SubOrganizationCreateResponse, type SubOrganizationRetrieveUsersResponse as SubOrganizationRetrieveUsersResponse, type SubOrganizationsSkipLimit as SubOrganizationsSkipLimit, - type SubOrganizationUpdateParams as SubOrganizationUpdateParams, + type SubOrganizationCreateParams as SubOrganizationCreateParams, type SubOrganizationListParams as SubOrganizationListParams, type SubOrganizationRetrieveUsersParams as SubOrganizationRetrieveUsersParams, }; export { - Templates as Templates, - type Template as Template, - type TemplateDeleteResponse as TemplateDeleteResponse, - type TemplatesSkipLimit as TemplatesSkipLimit, - type TemplateCreateParams as TemplateCreateParams, - type TemplateUpdateParams as TemplateUpdateParams, - type TemplateListParams as TemplateListParams, + Boxes as Boxes, + type BoxCreateResponse as BoxCreateResponse, + type BoxRetrieveResponse as BoxRetrieveResponse, + type BoxListResponse as BoxListResponse, + type BoxDeleteResponse as BoxDeleteResponse, + type BoxProgressionsResponse as BoxProgressionsResponse, + type BoxListResponsesSkipLimit as BoxListResponsesSkipLimit, + type BoxCreateParams as BoxCreateParams, + type BoxListParams as BoxListParams, + }; + + export { + SnapPacks as SnapPacks, + type SnapPackCreateResponse as SnapPackCreateResponse, + type SnapPackRetrieveResponse as SnapPackRetrieveResponse, + type SnapPackListResponse as SnapPackListResponse, + type SnapPackDeleteResponse as SnapPackDeleteResponse, + type SnapPackProgressionsResponse as SnapPackProgressionsResponse, + type SnapPackRetrieveCapabilitiesResponse as SnapPackRetrieveCapabilitiesResponse, + type SnapPackListResponsesSkipLimit as SnapPackListResponsesSkipLimit, + type SnapPackCreateParams as SnapPackCreateParams, + type SnapPackListParams as SnapPackListParams, + type SnapPackRetrieveCapabilitiesParams as SnapPackRetrieveCapabilitiesParams, + }; + + export { + TargetedListBuilds as TargetedListBuilds, + type TargetedListBuildCreateResponse as TargetedListBuildCreateResponse, + type TargetedListBuildRetrieveResponse as TargetedListBuildRetrieveResponse, + type TargetedListBuildUpdateResponse as TargetedListBuildUpdateResponse, + type TargetedListBuildListResponse as TargetedListBuildListResponse, + type TargetedListBuildDeleteResponse as TargetedListBuildDeleteResponse, + type TargetedListBuildConfirmResponse as TargetedListBuildConfirmResponse, + type TargetedListBuildListResponsesSkipLimit as TargetedListBuildListResponsesSkipLimit, + type TargetedListBuildCreateParams as TargetedListBuildCreateParams, + type TargetedListBuildUpdateParams as TargetedListBuildUpdateParams, + type TargetedListBuildListParams as TargetedListBuildListParams, + }; + + export { + TemplateEditorSessions as TemplateEditorSessions, + type TemplateEditorSessionCreateResponse as TemplateEditorSessionCreateResponse, + type TemplateEditorSessionListResponse as TemplateEditorSessionListResponse, + type TemplateEditorSessionDeleteResponse as TemplateEditorSessionDeleteResponse, + type TemplateEditorSessionListResponsesSkipLimit as TemplateEditorSessionListResponsesSkipLimit, + type TemplateEditorSessionCreateParams as TemplateEditorSessionCreateParams, + type TemplateEditorSessionListParams as TemplateEditorSessionListParams, + }; + + export { + VirtualMailboxes as VirtualMailboxes, + type VirtualMailboxCreateResponse as VirtualMailboxCreateResponse, + type VirtualMailboxRetrieveResponse as VirtualMailboxRetrieveResponse, + type VirtualMailboxListResponse as VirtualMailboxListResponse, + type VirtualMailboxRetrieveAddressResponse as VirtualMailboxRetrieveAddressResponse, + type VirtualMailboxListResponsesSkipLimit as VirtualMailboxListResponsesSkipLimit, + type VirtualMailboxCreateParams as VirtualMailboxCreateParams, + type VirtualMailboxListParams as VirtualMailboxListParams, }; } diff --git a/src/resources/print-mail/self-mailers.ts b/src/resources/print-mail/self-mailers.ts index faccc37..2126fd1 100644 --- a/src/resources/print-mail/self-mailers.ts +++ b/src/resources/print-mail/self-mailers.ts @@ -2,8 +2,6 @@ import { APIResource } from '../../core/resource'; import * as ContactsAPI from './contacts'; -import * as PrintMailAPI from './print-mail'; -import * as OrderProfilesSelfMailersAPI from './order-profiles/self-mailers'; import { APIPromise } from '../../core/api-promise'; import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination'; import { RequestOptions } from '../../internal/request-options'; @@ -82,6 +80,24 @@ export class SelfMailers extends APIResource { return this._client.delete(path`/print-mail/v1/self_mailers/${id}`, options); } + /** + * Progresses a self-mailer's `status` to the next stage. This is only available in + * test mode and can be used to simulate how a live order would progress through + * the different statuses. + * + * Note: this will fail with an `invalid_progression_error` if the status is one of + * `completed` or `cancelled`. + * + * @example + * ```ts + * const selfMailer = + * await client.printMail.selfMailers.progress('id'); + * ``` + */ + progress(id: string, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/self_mailers/${id}/progressions`, options); + } + /** * Retrieve a self-mailer preview URL. * @@ -171,7 +187,7 @@ export interface SelfMailer { /** * Enum representing the supported self-mailer sizes. */ - size: OrderProfilesSelfMailersAPI.SelfMailerSize; + size: '8.5x11_bifold' | '8.5x11_trifold' | '9.5x16_trifold'; /** * See `OrderStatus` for more details on the status of this order. @@ -301,7 +317,7 @@ export declare namespace SelfMailerCreateParams { * The contact information of the sender. You can pass contact information inline * here just like you can for the `to`. */ - from: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * The HTML content for the inside of the self-mailer. You can supply _either_ this @@ -318,7 +334,7 @@ export declare namespace SelfMailerCreateParams { /** * Enum representing the supported self-mailer sizes. */ - size: OrderProfilesSelfMailersAPI.SelfMailerSize; + size: '8.5x11_bifold' | '8.5x11_trifold' | '9.5x16_trifold'; /** * The recipient of this order. You can either supply the contact information @@ -326,7 +342,7 @@ export declare namespace SelfMailerCreateParams { * contacts regardless of whether you provide the information inline here or call * the contact creation endpoint. */ - to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * An optional string describing this resource. Will be visible in the API and the @@ -405,7 +421,7 @@ export declare namespace SelfMailerCreateParams { * The contact information of the sender. You can pass contact information inline * here just like you can for the `to`. */ - from: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * A URL pointing to a 2 page PDF file. The first page is the inside of the @@ -417,7 +433,7 @@ export declare namespace SelfMailerCreateParams { /** * Enum representing the supported self-mailer sizes. */ - size: OrderProfilesSelfMailersAPI.SelfMailerSize; + size: '8.5x11_bifold' | '8.5x11_trifold' | '9.5x16_trifold'; /** * The recipient of this order. You can either supply the contact information @@ -425,7 +441,7 @@ export declare namespace SelfMailerCreateParams { * contacts regardless of whether you provide the information inline here or call * the contact creation endpoint. */ - to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * An optional string describing this resource. Will be visible in the API and the @@ -490,7 +506,7 @@ export declare namespace SelfMailerCreateParams { * The contact information of the sender. You can pass contact information inline * here just like you can for the `to`. */ - from: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * A 2 page PDF file. The first page is the inside of the self-mailer and the @@ -501,7 +517,7 @@ export declare namespace SelfMailerCreateParams { /** * Enum representing the supported self-mailer sizes. */ - size: OrderProfilesSelfMailersAPI.SelfMailerSize; + size: '8.5x11_bifold' | '8.5x11_trifold' | '9.5x16_trifold'; /** * The recipient of this order. You can either supply the contact information @@ -509,7 +525,7 @@ export declare namespace SelfMailerCreateParams { * contacts regardless of whether you provide the information inline here or call * the contact creation endpoint. */ - to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string; + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; /** * An optional string describing this resource. Will be visible in the API and the diff --git a/src/resources/print-mail/snap-packs.ts b/src/resources/print-mail/snap-packs.ts new file mode 100644 index 0000000..7ab91d5 --- /dev/null +++ b/src/resources/print-mail/snap-packs.ts @@ -0,0 +1,1484 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import * as ContactsAPI from './contacts'; +import { APIPromise } from '../../core/api-promise'; +import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination'; +import { RequestOptions } from '../../internal/request-options'; +import { path } from '../../internal/utils/path'; + +/** + * Snap packs are pressure-sealed mailers that resemble official documents + * and encourage higher open rates. They do not require envelopes and are + * opened by tearing along perforated edges. The sealed design keeps contents + * hidden until opened, making snap packs ideal for sensitive or important + * documents such as contracts, forms, or notices. + * + * You can request access to this feature by reaching out to + * support@postgrid.com + */ +export class SnapPacks extends APIResource { + /** + * Create a snap pack. You can supply one of the following: + * + * - HTML content for the inside and outside of the snap pack + * - Template IDs for the inside and outside of the snap pack + * - A URL or file upload for a two-page PDF that matches the snap pack layout + * + * @example + * ```ts + * const snapPack = await client.printMail.snapPacks.create({ + * from: 'contact_123', + * insideHTML: 'Inside', + * outsideHTML: 'Outside', + * size: '8.5x11_bifold_v', + * to: 'contact_456', + * }); + * ``` + */ + create(body: SnapPackCreateParams, options?: RequestOptions): APIPromise { + return this._client.post('/print-mail/v1/snap_packs', { body, ...options }); + } + + /** + * Retrieve a snap pack by ID. + * + * @example + * ```ts + * const snapPack = await client.printMail.snapPacks.retrieve( + * 'id', + * ); + * ``` + */ + retrieve(id: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/print-mail/v1/snap_packs/${id}`, options); + } + + /** + * Get a list of snap packs. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const snapPackListResponse of client.printMail.snapPacks.list()) { + * // ... + * } + * ``` + */ + list( + query: SnapPackListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList('/print-mail/v1/snap_packs', SkipLimit, { + query, + ...options, + }); + } + + /** + * Cancel a snap pack by ID. Note that this operation cannot be undone and that + * only snap packs with a status of `ready` can be cancelled. + * + * @example + * ```ts + * const snapPack = await client.printMail.snapPacks.delete( + * 'id', + * ); + * ``` + */ + delete(id: string, options?: RequestOptions): APIPromise { + return this._client.delete(path`/print-mail/v1/snap_packs/${id}`, options); + } + + /** + * Progresses a snap pack's `status` to the next stage. This is only available in + * test mode and can be used to simulate how a live order would progress through + * the different statuses. + * + * Note: this will fail with an `invalid_progression_error` if the status is one of + * `completed` or `cancelled`. + * + * @example + * ```ts + * const response = + * await client.printMail.snapPacks.progressions('id'); + * ``` + */ + progressions(id: string, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/snap_packs/${id}/progressions`, options); + } + + /** + * Provides sizes and mailing classes available for the destination. + * + * @example + * ```ts + * const response = + * await client.printMail.snapPacks.retrieveCapabilities({ + * returnCountryCode: 'returnCountryCode', + * }); + * ``` + */ + retrieveCapabilities( + query: SnapPackRetrieveCapabilitiesParams, + options?: RequestOptions, + ): APIPromise { + return this._client.get('/print-mail/v1/snap_packs/capabilities', { query, ...options }); + } +} + +export type SnapPackListResponsesSkipLimit = SkipLimit; + +export interface SnapPackCreateResponse { + /** + * A unique ID prefixed with snap*pack* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * The contact information of the sender. + */ + from: ContactsAPI.Contact; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The mailing class of this order. This determines the speed and cost of delivery. + * See `OrderMailingClass` for more details. + */ + mailingClass: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Always `snap_pack`. + */ + object: 'snap_pack'; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. For example, if this is a date on Tuesday, the order will transition to + * `printing` on Wednesday at midnight eastern time. + */ + sendDate: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size: '8.5x11_bifold_v'; + + /** + * See `OrderStatus` for more details on the status of this order. + */ + status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled'; + + /** + * The recipient of this order. This will be provided even if you delete the + * underlying contact. + */ + to: ContactsAPI.Contact; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + cancellation?: SnapPackCreateResponse.Cancellation; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The last date that the IMB status was updated. See `imbStatus` for more details. + */ + imbDate?: string; + + /** + * The Intelligent Mail Barcode (IMB) status of this order. Only populated for + * US-printed and US-destined orders. This is the most detailed way to track + * non-express/certified orders. + */ + imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender'; + + /** + * The most recent ZIP code of the USPS facility that the order has been processed + * through. Only populated when an `imbStatus` is present. + */ + imbZIPCode?: string; + + /** + * The HTML content for the inside of the snap pack, when provided instead of a + * template or PDF. + */ + insideHTML?: string; + + /** + * The template ID for the inside of the snap pack, when provided instead of HTML + * or PDF. + */ + insideTemplate?: string; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * The HTML content for the outside of the snap pack, when provided instead of a + * template or PDF. + */ + outsideHTML?: string; + + /** + * The template ID for the outside of the snap pack, when provided instead of HTML + * or PDF. + */ + outsideTemplate?: string; + + /** + * The tracking number of this order. Populated after an express/certified order + * has been processed for delivery. + */ + trackingNumber?: string; + + /** + * A signed URL to the uploaded PDF provided at creation time, if a PDF was + * supplied. + */ + uploadedPDF?: string; + + /** + * PostGrid renders a PDF preview for all orders. This should be inspected to + * ensure that the order is correct before it is sent out because it shows what + * will be printed and mailed to the recipient. Once the PDF preview is generated, + * this field will be returned by all `GET` endpoints which produce this order. + * + * This URL is a signed link to the PDF preview. It will expire after a short + * period of time. If you need to access this URL after it has expired, you can + * regenerate it by calling the `GET` endpoint again. + */ + url?: string; +} + +export namespace SnapPackCreateResponse { + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + export interface Cancellation { + /** + * The reason for the cancellation. + */ + reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class'; + + /** + * The user ID who cancelled the order. + */ + cancelledByUser?: string; + + /** + * An optional note provided by the user who cancelled the order. + */ + note?: string; + } +} + +export interface SnapPackRetrieveResponse { + /** + * A unique ID prefixed with snap*pack* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * The contact information of the sender. + */ + from: ContactsAPI.Contact; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The mailing class of this order. This determines the speed and cost of delivery. + * See `OrderMailingClass` for more details. + */ + mailingClass: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Always `snap_pack`. + */ + object: 'snap_pack'; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. For example, if this is a date on Tuesday, the order will transition to + * `printing` on Wednesday at midnight eastern time. + */ + sendDate: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size: '8.5x11_bifold_v'; + + /** + * See `OrderStatus` for more details on the status of this order. + */ + status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled'; + + /** + * The recipient of this order. This will be provided even if you delete the + * underlying contact. + */ + to: ContactsAPI.Contact; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + cancellation?: SnapPackRetrieveResponse.Cancellation; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The last date that the IMB status was updated. See `imbStatus` for more details. + */ + imbDate?: string; + + /** + * The Intelligent Mail Barcode (IMB) status of this order. Only populated for + * US-printed and US-destined orders. This is the most detailed way to track + * non-express/certified orders. + */ + imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender'; + + /** + * The most recent ZIP code of the USPS facility that the order has been processed + * through. Only populated when an `imbStatus` is present. + */ + imbZIPCode?: string; + + /** + * The HTML content for the inside of the snap pack, when provided instead of a + * template or PDF. + */ + insideHTML?: string; + + /** + * The template ID for the inside of the snap pack, when provided instead of HTML + * or PDF. + */ + insideTemplate?: string; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * The HTML content for the outside of the snap pack, when provided instead of a + * template or PDF. + */ + outsideHTML?: string; + + /** + * The template ID for the outside of the snap pack, when provided instead of HTML + * or PDF. + */ + outsideTemplate?: string; + + /** + * The tracking number of this order. Populated after an express/certified order + * has been processed for delivery. + */ + trackingNumber?: string; + + /** + * A signed URL to the uploaded PDF provided at creation time, if a PDF was + * supplied. + */ + uploadedPDF?: string; + + /** + * PostGrid renders a PDF preview for all orders. This should be inspected to + * ensure that the order is correct before it is sent out because it shows what + * will be printed and mailed to the recipient. Once the PDF preview is generated, + * this field will be returned by all `GET` endpoints which produce this order. + * + * This URL is a signed link to the PDF preview. It will expire after a short + * period of time. If you need to access this URL after it has expired, you can + * regenerate it by calling the `GET` endpoint again. + */ + url?: string; +} + +export namespace SnapPackRetrieveResponse { + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + export interface Cancellation { + /** + * The reason for the cancellation. + */ + reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class'; + + /** + * The user ID who cancelled the order. + */ + cancelledByUser?: string; + + /** + * An optional note provided by the user who cancelled the order. + */ + note?: string; + } +} + +export interface SnapPackListResponse { + /** + * A unique ID prefixed with snap*pack* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * The contact information of the sender. + */ + from: ContactsAPI.Contact; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The mailing class of this order. This determines the speed and cost of delivery. + * See `OrderMailingClass` for more details. + */ + mailingClass: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Always `snap_pack`. + */ + object: 'snap_pack'; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. For example, if this is a date on Tuesday, the order will transition to + * `printing` on Wednesday at midnight eastern time. + */ + sendDate: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size: '8.5x11_bifold_v'; + + /** + * See `OrderStatus` for more details on the status of this order. + */ + status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled'; + + /** + * The recipient of this order. This will be provided even if you delete the + * underlying contact. + */ + to: ContactsAPI.Contact; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + cancellation?: SnapPackListResponse.Cancellation; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The last date that the IMB status was updated. See `imbStatus` for more details. + */ + imbDate?: string; + + /** + * The Intelligent Mail Barcode (IMB) status of this order. Only populated for + * US-printed and US-destined orders. This is the most detailed way to track + * non-express/certified orders. + */ + imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender'; + + /** + * The most recent ZIP code of the USPS facility that the order has been processed + * through. Only populated when an `imbStatus` is present. + */ + imbZIPCode?: string; + + /** + * The HTML content for the inside of the snap pack, when provided instead of a + * template or PDF. + */ + insideHTML?: string; + + /** + * The template ID for the inside of the snap pack, when provided instead of HTML + * or PDF. + */ + insideTemplate?: string; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * The HTML content for the outside of the snap pack, when provided instead of a + * template or PDF. + */ + outsideHTML?: string; + + /** + * The template ID for the outside of the snap pack, when provided instead of HTML + * or PDF. + */ + outsideTemplate?: string; + + /** + * The tracking number of this order. Populated after an express/certified order + * has been processed for delivery. + */ + trackingNumber?: string; + + /** + * A signed URL to the uploaded PDF provided at creation time, if a PDF was + * supplied. + */ + uploadedPDF?: string; + + /** + * PostGrid renders a PDF preview for all orders. This should be inspected to + * ensure that the order is correct before it is sent out because it shows what + * will be printed and mailed to the recipient. Once the PDF preview is generated, + * this field will be returned by all `GET` endpoints which produce this order. + * + * This URL is a signed link to the PDF preview. It will expire after a short + * period of time. If you need to access this URL after it has expired, you can + * regenerate it by calling the `GET` endpoint again. + */ + url?: string; +} + +export namespace SnapPackListResponse { + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + export interface Cancellation { + /** + * The reason for the cancellation. + */ + reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class'; + + /** + * The user ID who cancelled the order. + */ + cancelledByUser?: string; + + /** + * An optional note provided by the user who cancelled the order. + */ + note?: string; + } +} + +export interface SnapPackDeleteResponse { + /** + * A unique ID prefixed with snap*pack* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * The contact information of the sender. + */ + from: ContactsAPI.Contact; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The mailing class of this order. This determines the speed and cost of delivery. + * See `OrderMailingClass` for more details. + */ + mailingClass: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Always `snap_pack`. + */ + object: 'snap_pack'; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. For example, if this is a date on Tuesday, the order will transition to + * `printing` on Wednesday at midnight eastern time. + */ + sendDate: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size: '8.5x11_bifold_v'; + + /** + * See `OrderStatus` for more details on the status of this order. + */ + status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled'; + + /** + * The recipient of this order. This will be provided even if you delete the + * underlying contact. + */ + to: ContactsAPI.Contact; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + cancellation?: SnapPackDeleteResponse.Cancellation; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The last date that the IMB status was updated. See `imbStatus` for more details. + */ + imbDate?: string; + + /** + * The Intelligent Mail Barcode (IMB) status of this order. Only populated for + * US-printed and US-destined orders. This is the most detailed way to track + * non-express/certified orders. + */ + imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender'; + + /** + * The most recent ZIP code of the USPS facility that the order has been processed + * through. Only populated when an `imbStatus` is present. + */ + imbZIPCode?: string; + + /** + * The HTML content for the inside of the snap pack, when provided instead of a + * template or PDF. + */ + insideHTML?: string; + + /** + * The template ID for the inside of the snap pack, when provided instead of HTML + * or PDF. + */ + insideTemplate?: string; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * The HTML content for the outside of the snap pack, when provided instead of a + * template or PDF. + */ + outsideHTML?: string; + + /** + * The template ID for the outside of the snap pack, when provided instead of HTML + * or PDF. + */ + outsideTemplate?: string; + + /** + * The tracking number of this order. Populated after an express/certified order + * has been processed for delivery. + */ + trackingNumber?: string; + + /** + * A signed URL to the uploaded PDF provided at creation time, if a PDF was + * supplied. + */ + uploadedPDF?: string; + + /** + * PostGrid renders a PDF preview for all orders. This should be inspected to + * ensure that the order is correct before it is sent out because it shows what + * will be printed and mailed to the recipient. Once the PDF preview is generated, + * this field will be returned by all `GET` endpoints which produce this order. + * + * This URL is a signed link to the PDF preview. It will expire after a short + * period of time. If you need to access this URL after it has expired, you can + * regenerate it by calling the `GET` endpoint again. + */ + url?: string; +} + +export namespace SnapPackDeleteResponse { + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + export interface Cancellation { + /** + * The reason for the cancellation. + */ + reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class'; + + /** + * The user ID who cancelled the order. + */ + cancelledByUser?: string; + + /** + * An optional note provided by the user who cancelled the order. + */ + note?: string; + } +} + +export interface SnapPackProgressionsResponse { + /** + * A unique ID prefixed with snap*pack* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * The contact information of the sender. + */ + from: ContactsAPI.Contact; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The mailing class of this order. This determines the speed and cost of delivery. + * See `OrderMailingClass` for more details. + */ + mailingClass: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * Always `snap_pack`. + */ + object: 'snap_pack'; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. For example, if this is a date on Tuesday, the order will transition to + * `printing` on Wednesday at midnight eastern time. + */ + sendDate: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size: '8.5x11_bifold_v'; + + /** + * See `OrderStatus` for more details on the status of this order. + */ + status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled'; + + /** + * The recipient of this order. This will be provided even if you delete the + * underlying contact. + */ + to: ContactsAPI.Contact; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + cancellation?: SnapPackProgressionsResponse.Cancellation; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The last date that the IMB status was updated. See `imbStatus` for more details. + */ + imbDate?: string; + + /** + * The Intelligent Mail Barcode (IMB) status of this order. Only populated for + * US-printed and US-destined orders. This is the most detailed way to track + * non-express/certified orders. + */ + imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender'; + + /** + * The most recent ZIP code of the USPS facility that the order has been processed + * through. Only populated when an `imbStatus` is present. + */ + imbZIPCode?: string; + + /** + * The HTML content for the inside of the snap pack, when provided instead of a + * template or PDF. + */ + insideHTML?: string; + + /** + * The template ID for the inside of the snap pack, when provided instead of HTML + * or PDF. + */ + insideTemplate?: string; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * The HTML content for the outside of the snap pack, when provided instead of a + * template or PDF. + */ + outsideHTML?: string; + + /** + * The template ID for the outside of the snap pack, when provided instead of HTML + * or PDF. + */ + outsideTemplate?: string; + + /** + * The tracking number of this order. Populated after an express/certified order + * has been processed for delivery. + */ + trackingNumber?: string; + + /** + * A signed URL to the uploaded PDF provided at creation time, if a PDF was + * supplied. + */ + uploadedPDF?: string; + + /** + * PostGrid renders a PDF preview for all orders. This should be inspected to + * ensure that the order is correct before it is sent out because it shows what + * will be printed and mailed to the recipient. Once the PDF preview is generated, + * this field will be returned by all `GET` endpoints which produce this order. + * + * This URL is a signed link to the PDF preview. It will expire after a short + * period of time. If you need to access this URL after it has expired, you can + * regenerate it by calling the `GET` endpoint again. + */ + url?: string; +} + +export namespace SnapPackProgressionsResponse { + /** + * The cancellation details of this order. Populated if the order has been + * cancelled. + */ + export interface Cancellation { + /** + * The reason for the cancellation. + */ + reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class'; + + /** + * The user ID who cancelled the order. + */ + cancelledByUser?: string; + + /** + * An optional note provided by the user who cancelled the order. + */ + note?: string; + } +} + +export interface SnapPackRetrieveCapabilitiesResponse { + mailingClasses: Array< + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class' + >; + + sizes: Array<'8.5x11_bifold_v'>; +} + +export type SnapPackCreateParams = + | SnapPackCreateParams.SnapPackCreateWithHTML + | SnapPackCreateParams.SnapPackCreateWithTemplate + | SnapPackCreateParams.SnapPackCreateWithPdf; + +export declare namespace SnapPackCreateParams { + export interface SnapPackCreateWithHTML { + /** + * The contact information of the sender. You can pass contact information inline + * here just like you can for the `to` contact. + */ + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; + + /** + * The HTML content for the inside of the snap pack. You can supply _either_ this + * or `insideTemplate` but not both. + */ + insideHTML: string; + + /** + * The HTML content for the outside of the snap pack. You can supply _either_ this + * or `outsideTemplate` but not both. + */ + outsideHTML: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size: '8.5x11_bifold_v'; + + /** + * The recipient of this order. You can either supply the contact information + * inline here or provide a contact ID. PostGrid will automatically deduplicate + * contacts regardless of whether you provide the information inline here or call + * the contact creation endpoint. + */ + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The mailing class of this order. If not provided, automatically set to + * `first_class`. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. You can use this parameter to schedule orders for a future date. + */ + sendDate?: string; + } + + export interface SnapPackCreateWithTemplate { + /** + * The contact information of the sender. You can pass contact information inline + * here just like you can for the `to` contact. + */ + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; + + /** + * The template ID for the inside of the snap pack. You can supply _either_ this or + * `insideHTML` but not both. + */ + insideTemplate: string; + + /** + * The template ID for the outside of the snap pack. You can supply _either_ this + * or `outsideHTML` but not both. + */ + outsideTemplate: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size: '8.5x11_bifold_v'; + + /** + * The recipient of this order. You can either supply the contact information + * inline here or provide a contact ID. PostGrid will automatically deduplicate + * contacts regardless of whether you provide the information inline here or call + * the contact creation endpoint. + */ + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The mailing class of this order. If not provided, automatically set to + * `first_class`. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. You can use this parameter to schedule orders for a future date. + */ + sendDate?: string; + } + + export interface SnapPackCreateWithPdf { + /** + * The contact information of the sender. You can pass contact information inline + * here just like you can for the `to` contact. + */ + from: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; + + /** + * A URL or a multipart-uploaded two-page PDF (first page is the outside, second + * page is the inside) that matches the selected snap pack size. + */ + pdf: string; + + /** + * Enum representing the supported snap pack sizes. + */ + size: '8.5x11_bifold_v'; + + /** + * The recipient of this order. You can either supply the contact information + * inline here or provide a contact ID. PostGrid will automatically deduplicate + * contacts regardless of whether you provide the information inline here or call + * the contact creation endpoint. + */ + to: ContactsAPI.ContactCreateWithFirstName | ContactsAPI.ContactCreateWithCompanyName | string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * The mailing class of this order. If not provided, automatically set to + * `first_class`. + */ + mailingClass?: + | 'first_class' + | 'standard_class' + | 'express' + | 'certified' + | 'certified_return_receipt' + | 'registered' + | 'usps_first_class' + | 'usps_standard_class' + | 'usps_eddm' + | 'usps_express_2_day' + | 'usps_express_3_day' + | 'usps_first_class_certified' + | 'usps_first_class_certified_return_receipt' + | 'usps_first_class_registered' + | 'usps_express_3_day_signature_confirmation' + | 'usps_express_3_day_certified' + | 'usps_express_3_day_certified_return_receipt' + | 'ca_post_lettermail' + | 'ca_post_personalized' + | 'ca_post_neighbourhood_mail' + | 'ups_express_overnight' + | 'ups_express_2_day' + | 'ups_express_3_day' + | 'royal_mail_first_class' + | 'royal_mail_second_class' + | 'au_post_second_class'; + + /** + * These will be merged with the variables in the template or HTML you create this + * order with. The keys in this object should match the variable names in the + * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to + * PDFs uploaded with the order. + */ + mergeVariables?: { [key: string]: unknown }; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * This order will transition from `ready` to `printing` on the day after this + * date. You can use this parameter to schedule orders for a future date. + */ + sendDate?: string; + } +} + +export interface SnapPackListParams extends SkipLimitParams { + /** + * You can supply any string to help narrow down the list of resources. For + * example, if you pass `"New York"` (quoted), it will return resources that have + * that string present somewhere in their response. Alternatively, you can supply a + * structured search query. See the documentation on `StructuredSearchQuery` for + * more details. + */ + search?: string; +} + +export interface SnapPackRetrieveCapabilitiesParams { + /** + * The country code where mail may be returned to. + */ + returnCountryCode: string; + + /** + * The country code of where the snap pack will be sent to. One of `mailingList` or + * `destinationCountryCode` must be supplied but not both. + */ + destinationCountryCode?: string; + + /** + * Sources destination countries from the provided mailing list. One of + * `mailingList` or `destinationCountryCode` must be supplied but not both. + */ + mailingList?: string; +} + +export declare namespace SnapPacks { + export { + type SnapPackCreateResponse as SnapPackCreateResponse, + type SnapPackRetrieveResponse as SnapPackRetrieveResponse, + type SnapPackListResponse as SnapPackListResponse, + type SnapPackDeleteResponse as SnapPackDeleteResponse, + type SnapPackProgressionsResponse as SnapPackProgressionsResponse, + type SnapPackRetrieveCapabilitiesResponse as SnapPackRetrieveCapabilitiesResponse, + type SnapPackListResponsesSkipLimit as SnapPackListResponsesSkipLimit, + type SnapPackCreateParams as SnapPackCreateParams, + type SnapPackListParams as SnapPackListParams, + type SnapPackRetrieveCapabilitiesParams as SnapPackRetrieveCapabilitiesParams, + }; +} diff --git a/src/resources/print-mail/sub-organizations.ts b/src/resources/print-mail/sub-organizations.ts index 0cd6ad6..9645bc2 100644 --- a/src/resources/print-mail/sub-organizations.ts +++ b/src/resources/print-mail/sub-organizations.ts @@ -20,19 +20,6 @@ import { path } from '../../internal/utils/path'; * support@postgrid.com */ export class SubOrganizations extends APIResource { - /** - * Get a sub-organization. - * - * @example - * ```ts - * const subOrganization = - * await client.printMail.subOrganizations.retrieve('id'); - * ``` - */ - retrieve(id: string, options?: RequestOptions): APIPromise { - return this._client.get(path`/print-mail/v1/sub_organizations/${id}`, options); - } - /** * When creating a user through the API, the verifiedEmail field will automatically * be set to true. However, if public signups are used, the email will need to be @@ -41,7 +28,7 @@ export class SubOrganizations extends APIResource { * @example * ```ts * const subOrganization = - * await client.printMail.subOrganizations.update({ + * await client.printMail.subOrganizations.create({ * countryCode: 'CA', * email: 'suborg@postgrid.com', * name: 'Calvin', @@ -51,13 +38,26 @@ export class SubOrganizations extends APIResource { * }); * ``` */ - update( - body: SubOrganizationUpdateParams, + create( + body: SubOrganizationCreateParams, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.post('/print-mail/v1/sub_organizations', { body, ...options }); } + /** + * Get a sub-organization. + * + * @example + * ```ts + * const subOrganization = + * await client.printMail.subOrganizations.retrieve('id'); + * ``` + */ + retrieve(id: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/print-mail/v1/sub_organizations/${id}`, options); + } + /** * List sub-organizations. * @@ -162,7 +162,7 @@ export interface SubOrganization { usage: number; } -export interface SubOrganizationUpdateResponse { +export interface SubOrganizationCreateResponse { /** * The Sub-Organization object. */ @@ -171,10 +171,10 @@ export interface SubOrganizationUpdateResponse { /** * The user object. */ - user: SubOrganizationUpdateResponse.User; + user: SubOrganizationCreateResponse.User; } -export namespace SubOrganizationUpdateResponse { +export namespace SubOrganizationCreateResponse { /** * The user object. */ @@ -326,7 +326,7 @@ export namespace SubOrganizationRetrieveUsersResponse { } } -export interface SubOrganizationUpdateParams { +export interface SubOrganizationCreateParams { /** * The country code of the sub-organization. */ @@ -388,10 +388,10 @@ export declare namespace SubOrganizations { export { type EmailPreferences as EmailPreferences, type SubOrganization as SubOrganization, - type SubOrganizationUpdateResponse as SubOrganizationUpdateResponse, + type SubOrganizationCreateResponse as SubOrganizationCreateResponse, type SubOrganizationRetrieveUsersResponse as SubOrganizationRetrieveUsersResponse, type SubOrganizationsSkipLimit as SubOrganizationsSkipLimit, - type SubOrganizationUpdateParams as SubOrganizationUpdateParams, + type SubOrganizationCreateParams as SubOrganizationCreateParams, type SubOrganizationListParams as SubOrganizationListParams, type SubOrganizationRetrieveUsersParams as SubOrganizationRetrieveUsersParams, }; diff --git a/src/resources/print-mail/targeted-list-builds.ts b/src/resources/print-mail/targeted-list-builds.ts new file mode 100644 index 0000000..eeba2cc --- /dev/null +++ b/src/resources/print-mail/targeted-list-builds.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './targeted-list-builds/index'; diff --git a/src/resources/print-mail/targeted-list-builds/filters.ts b/src/resources/print-mail/targeted-list-builds/filters.ts new file mode 100644 index 0000000..22f7be1 --- /dev/null +++ b/src/resources/print-mail/targeted-list-builds/filters.ts @@ -0,0 +1,113 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../core/resource'; +import { APIPromise } from '../../../core/api-promise'; +import { RequestOptions } from '../../../internal/request-options'; + +/** + * **Beta:** the targeted list builds API is in beta and is subject to + * breaking changes. Endpoint shapes, status values, and filter fields may + * change without notice. + * + * The targeted list builds API lets you programmatically build mailing + * lists of US consumers (B2C) or US companies (B2B) that match a set of + * demographic, geographic, and firmographic filters. + * + * The lifecycle of a list build is: + * + * 1. Create a list build by supplying either `usConsumers` or `usCompanies` + * filters. A quote is generated asynchronously — poll the resource or + * wait for its `status` to become `quote_ready`. + * 2. Review the `quote` (total count and price per contact) and masked + * `previewRecords`. Adjust the filters with an update call if needed — + * this will regenerate the quote. + * 3. Confirm the build. This deducts the appropriate amount of list build + * credits from your organization (in live mode) and begins constructing + * the mailing list. `buildProgressPercent` reflects progress from 0 to + * 100. + * 4. Once `status` is `completed`, the ID of the resulting mailing list is + * available in the `mailingList` field and can be used like any other + * mailing list in the PostGrid API. + * + * Targeted list builds must be enabled on your organization before they + * can be used. Contact PostGrid support to request access. + */ +export class Filters extends APIResource { + /** + * Return a list of autocomplete suggestions for a given filter field (currently + * only `industry` is supported). Useful when building a UI around the `industries` + * company filter. + * + * @example + * ```ts + * const response = + * await client.printMail.targetedListBuilds.filters.autocomplete( + * { + * field: 'industry', + * size: 5, + * text: 'soft', + * }, + * ); + * ``` + */ + autocomplete( + body: FilterAutocompleteParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/print-mail/v1/targeted_list_builds/filters/autocomplete', { + body, + ...options, + }); + } +} + +/** + * The list of suggestions returned by an autocomplete query. + */ +export interface FilterAutocompleteResponse { + data: Array; + + object: 'list'; +} + +export namespace FilterAutocompleteResponse { + /** + * A single autocomplete suggestion. + */ + export interface Data { + /** + * A field that can be autocompleted when configuring list build filters. + */ + type: 'industry'; + + /** + * The suggested value (e.g., an industry name). + */ + value: string; + } +} + +export interface FilterAutocompleteParams { + /** + * A field that can be autocompleted when configuring list build filters. + */ + field: 'industry'; + + /** + * Maximum number of suggestions to return. Between 1 and 100. Defaults to 25 if + * omitted. + */ + size?: number; + + /** + * Optional text prefix to narrow the autocomplete suggestions. + */ + text?: string; +} + +export declare namespace Filters { + export { + type FilterAutocompleteResponse as FilterAutocompleteResponse, + type FilterAutocompleteParams as FilterAutocompleteParams, + }; +} diff --git a/src/resources/print-mail/targeted-list-builds/index.ts b/src/resources/print-mail/targeted-list-builds/index.ts new file mode 100644 index 0000000..86cfc32 --- /dev/null +++ b/src/resources/print-mail/targeted-list-builds/index.ts @@ -0,0 +1,16 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { Filters, type FilterAutocompleteResponse, type FilterAutocompleteParams } from './filters'; +export { + TargetedListBuilds, + type TargetedListBuildCreateResponse, + type TargetedListBuildRetrieveResponse, + type TargetedListBuildUpdateResponse, + type TargetedListBuildListResponse, + type TargetedListBuildDeleteResponse, + type TargetedListBuildConfirmResponse, + type TargetedListBuildCreateParams, + type TargetedListBuildUpdateParams, + type TargetedListBuildListParams, + type TargetedListBuildListResponsesSkipLimit, +} from './targeted-list-builds'; diff --git a/src/resources/print-mail/targeted-list-builds/targeted-list-builds.ts b/src/resources/print-mail/targeted-list-builds/targeted-list-builds.ts new file mode 100644 index 0000000..0b47a46 --- /dev/null +++ b/src/resources/print-mail/targeted-list-builds/targeted-list-builds.ts @@ -0,0 +1,2158 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../core/resource'; +import * as FiltersAPI from './filters'; +import { FilterAutocompleteParams, FilterAutocompleteResponse, Filters } from './filters'; +import { APIPromise } from '../../../core/api-promise'; +import { PagePromise, SkipLimit, type SkipLimitParams } from '../../../core/pagination'; +import { buildHeaders } from '../../../internal/headers'; +import { RequestOptions } from '../../../internal/request-options'; +import { path } from '../../../internal/utils/path'; + +/** + * **Beta:** the targeted list builds API is in beta and is subject to + * breaking changes. Endpoint shapes, status values, and filter fields may + * change without notice. + * + * The targeted list builds API lets you programmatically build mailing + * lists of US consumers (B2C) or US companies (B2B) that match a set of + * demographic, geographic, and firmographic filters. + * + * The lifecycle of a list build is: + * + * 1. Create a list build by supplying either `usConsumers` or `usCompanies` + * filters. A quote is generated asynchronously — poll the resource or + * wait for its `status` to become `quote_ready`. + * 2. Review the `quote` (total count and price per contact) and masked + * `previewRecords`. Adjust the filters with an update call if needed — + * this will regenerate the quote. + * 3. Confirm the build. This deducts the appropriate amount of list build + * credits from your organization (in live mode) and begins constructing + * the mailing list. `buildProgressPercent` reflects progress from 0 to + * 100. + * 4. Once `status` is `completed`, the ID of the resulting mailing list is + * available in the `mailingList` field and can be used like any other + * mailing list in the PostGrid API. + * + * Targeted list builds must be enabled on your organization before they + * can be used. Contact PostGrid support to request access. + */ +export class TargetedListBuilds extends APIResource { + filters: FiltersAPI.Filters = new FiltersAPI.Filters(this._client); + + /** + * Create a new targeted list build. A quote will be generated asynchronously based + * on the provided filters. + * + * @example + * ```ts + * const targetedListBuild = + * await client.printMail.targetedListBuilds.create({ + * description: 'Q1 prospecting list', + * limit: 1000, + * metadata: { campaign: 'q1_prospecting' }, + * usCompanies: { + * postalCodes: ['10001', '10002'], + * industries: ['software'], + * employeeCount: [10, 500], + * }, + * }); + * ``` + */ + create( + params: TargetedListBuildCreateParams, + options?: RequestOptions, + ): APIPromise { + const { 'idempotency-key': idempotencyKey, ...body } = params; + return this._client.post('/print-mail/v1/targeted_list_builds', { + body, + ...options, + headers: buildHeaders([ + { ...(idempotencyKey != null ? { 'idempotency-key': idempotencyKey } : undefined) }, + options?.headers, + ]), + }); + } + + /** + * Retrieve a specific targeted list build by its ID. + * + * @example + * ```ts + * const targetedListBuild = + * await client.printMail.targetedListBuilds.retrieve('id'); + * ``` + */ + retrieve(id: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/print-mail/v1/targeted_list_builds/${id}`, options); + } + + /** + * Update an existing targeted list build. Only builds that have not yet been + * confirmed may be updated. Updating the filters or `limit` will reset the build's + * status back to `generating_quote` and a new quote will be generated. + * + * @example + * ```ts + * const targetedListBuild = + * await client.printMail.targetedListBuilds.update('id', { + * limit: 2000, + * usCompanies: { + * postalCodes: ['10001', '10002', '10003'], + * industries: ['software', 'fintech'], + * employeeCount: [50, 1000], + * }, + * }); + * ``` + */ + update( + id: string, + body: TargetedListBuildUpdateParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post(path`/print-mail/v1/targeted_list_builds/${id}`, { body, ...options }); + } + + /** + * Retrieve a paginated list of targeted list builds for the authenticated + * organization, ordered from most recently updated to least recently updated. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const targetedListBuildListResponse of client.printMail.targetedListBuilds.list()) { + * // ... + * } + * ``` + */ + list( + query: TargetedListBuildListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList( + '/print-mail/v1/targeted_list_builds', + SkipLimit, + { query, ...options }, + ); + } + + /** + * Delete a targeted list build. List builds can only be deleted before they have + * been confirmed — once a build has transitioned to `creating_list` or `completed` + * it cannot be deleted. + * + * @example + * ```ts + * const targetedListBuild = + * await client.printMail.targetedListBuilds.delete('id'); + * ``` + */ + delete(id: string, options?: RequestOptions): APIPromise { + return this._client.delete(path`/print-mail/v1/targeted_list_builds/${id}`, options); + } + + /** + * Confirm a targeted list build whose quote is ready. This deducts the appropriate + * amount of list build credits from the organization (in live mode) and kicks off + * the asynchronous creation of the underlying mailing list. + * + * @example + * ```ts + * const response = + * await client.printMail.targetedListBuilds.confirm('id'); + * ``` + */ + confirm(id: string, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/targeted_list_builds/${id}/confirm`, options); + } +} + +export type TargetedListBuildListResponsesSkipLimit = SkipLimit; + +/** + * A targeted list build represents a request to build a new mailing list by + * targeting US consumers or companies matching the provided filters. Once created, + * a quote is generated asynchronously. After reviewing the quote and preview + * records, you may confirm the build, which kicks off the creation of the + * underlying mailing list. + */ +export interface TargetedListBuildCreateResponse { + /** + * A unique ID prefixed with targeted*list_build* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The ID of the organization that owns this list build. + */ + organization: string; + + /** + * Status of a targeted list build. + */ + status: 'generating_quote' | 'quote_ready' | 'creating_list' | 'completed' | 'failed'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * A percentage from 0 to 100 representing how much of the build has completed. + * Only populated while `status` is `creating_list`. + */ + buildProgressPercent?: number; + + /** + * The UTC time at which the build finished successfully. Only present once + * `status` is `completed`. + */ + completedAt?: string; + + /** + * The UTC time at which the build was confirmed, if any. + */ + confirmedAt?: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * Any errors encountered while generating a quote or building the list. + */ + errors?: Array; + + /** + * Maximum number of contacts to include in the built mailing list. If omitted, all + * matching contacts are included. + */ + limit?: number; + + /** + * The ID of the mailing list that was built. Present once `status` is `completed`. + */ + mailingList?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * A small number of masked sample records for the configured filters, populated + * alongside `quote`. + */ + previewRecords?: Array; + + /** + * Details of the quote generated for a targeted list build. + */ + quote?: TargetedListBuildCreateResponse.Quote; + + /** + * Filters used to target US companies (B2B) when building a list. + */ + usCompanies?: TargetedListBuildCreateResponse.UsCompanies; + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + usConsumers?: TargetedListBuildCreateResponse.UsConsumers; +} + +export namespace TargetedListBuildCreateResponse { + /** + * Details of an error encountered while processing a targeted list build. + */ + export interface Error { + /** + * A human-readable message describing the error. + */ + message: string; + + /** + * Type of error encountered while generating a quote or building the list. + */ + type: 'not_enough_info_to_quote' | 'insufficient_credits' | 'internal_service_error'; + } + + /** + * A single masked preview record returned with a quote so you can sanity check the + * kind of contacts that will end up in the mailing list before confirming the + * build. + */ + export interface PreviewRecord { + /** + * The masked, comma-joined formatted address of the contact. + */ + formattedAddress: string; + + /** + * The masked name of the contact or business. + */ + name: string; + } + + /** + * Details of the quote generated for a targeted list build. + */ + export interface Quote { + /** + * The number of contacts that will be included in the built mailing list. This + * accounts for any `limit` that was provided. + */ + count: number; + + /** + * The UTC time at which the quote was generated. + */ + generatedAt: string; + + /** + * The price per contact, in cents. Multiply by `count` to get the total cost of + * building the list. + */ + pricePerContactCents: number; + } + + /** + * Filters used to target US companies (B2B) when building a list. + */ + export interface UsCompanies { + /** + * Required list of five-digit US ZIP codes to target. + */ + postalCodes: Array; + + /** + * Filter by ownership structure of the company. + */ + companyTypes?: Array< + 'public' | 'private' | 'educational' | 'government' | 'nonprofit' | 'public_subsidiary' + >; + + /** + * Inclusive `[min, max]` range for the number of employees at the company. Values + * must be between 1 and 1,000,000. + */ + employeeCount?: Array; + + /** + * Inclusive `[min, max]` range for the year the company was founded. Values must + * be between 1600 and 2100. + */ + foundedYear?: Array; + + /** + * Filter by free-form industry names (see the autocomplete endpoint). + */ + industries?: Array; + + /** + * Filter by six-digit [NAICS](https://www.census.gov/naics/) industry codes. + */ + naicsCodes?: Array; + + /** + * Filter by free-form company tags (e.g., `"saas"`, `"b2b"`). + */ + tags?: Array; + } + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + export interface UsConsumers { + /** + * Inclusive `[min, max]` age range. Values must be between 18 and 80. + */ + ageRange?: Array; + + /** + * A list of `"City, ST"` strings (e.g. `"New York, NY"`) to target. + */ + cityStates?: Array; + + /** + * Filter by highest level of education completed. + */ + educationLevels?: Array<'high_school' | 'college' | 'grad_school' | 'vocational_training'>; + + /** + * Gender filter for US consumer list builds. + */ + gender?: 'male' | 'female'; + + /** + * Inclusive `[min, max]` home value range, in US dollars. Values must be between 0 + * and 1,000,000. + */ + homeValueRange?: Array; + + /** + * Inclusive `[min, max]` annual household income range, in US dollars. Values must + * be between 0 and 200,000. + */ + incomeRange?: Array; + + /** + * Inclusive `[min, max]` number of children in the household. Values must be + * between 0 and 8. + */ + numChildrenRange?: Array; + + /** + * Filter by occupation classification. + */ + occupations?: Array< + | 'professional_technical' + | 'administration_management' + | 'sales_service' + | 'clerical_white_collar' + | 'craftsmen_blue_collar' + | 'student' + | 'homemaker' + | 'retired' + | 'farmer' + | 'military' + | 'religious' + | 'self_employed' + | 'self_employed_professional_technical' + | 'self_employed_administration_management' + | 'self_employed_sales_service' + | 'self_employed_clerical_white_collar' + | 'self_employed_craftsmen_blue_collar' + | 'self_employed_student' + | 'self_employed_homemaker' + | 'self_employed_retired' + | 'self_employed_other' + | 'educator' + | 'financial_professional' + | 'legal_professional' + | 'medical_professional' + | 'other' + >; + + /** + * A list of five-digit US ZIP codes to target. + */ + zipCodes?: Array; + + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + zipCodesAround?: UsConsumers.ZipCodesAround; + } + + export namespace UsConsumers { + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + export interface ZipCodesAround { + /** + * The radius in miles around `zipCode` to include. Between 0.1 and 100. + */ + radiusInMiles: number; + + /** + * The five-digit ZIP code at the center of the search circle. + */ + zipCode: string; + } + } +} + +/** + * A targeted list build represents a request to build a new mailing list by + * targeting US consumers or companies matching the provided filters. Once created, + * a quote is generated asynchronously. After reviewing the quote and preview + * records, you may confirm the build, which kicks off the creation of the + * underlying mailing list. + */ +export interface TargetedListBuildRetrieveResponse { + /** + * A unique ID prefixed with targeted*list_build* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The ID of the organization that owns this list build. + */ + organization: string; + + /** + * Status of a targeted list build. + */ + status: 'generating_quote' | 'quote_ready' | 'creating_list' | 'completed' | 'failed'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * A percentage from 0 to 100 representing how much of the build has completed. + * Only populated while `status` is `creating_list`. + */ + buildProgressPercent?: number; + + /** + * The UTC time at which the build finished successfully. Only present once + * `status` is `completed`. + */ + completedAt?: string; + + /** + * The UTC time at which the build was confirmed, if any. + */ + confirmedAt?: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * Any errors encountered while generating a quote or building the list. + */ + errors?: Array; + + /** + * Maximum number of contacts to include in the built mailing list. If omitted, all + * matching contacts are included. + */ + limit?: number; + + /** + * The ID of the mailing list that was built. Present once `status` is `completed`. + */ + mailingList?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * A small number of masked sample records for the configured filters, populated + * alongside `quote`. + */ + previewRecords?: Array; + + /** + * Details of the quote generated for a targeted list build. + */ + quote?: TargetedListBuildRetrieveResponse.Quote; + + /** + * Filters used to target US companies (B2B) when building a list. + */ + usCompanies?: TargetedListBuildRetrieveResponse.UsCompanies; + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + usConsumers?: TargetedListBuildRetrieveResponse.UsConsumers; +} + +export namespace TargetedListBuildRetrieveResponse { + /** + * Details of an error encountered while processing a targeted list build. + */ + export interface Error { + /** + * A human-readable message describing the error. + */ + message: string; + + /** + * Type of error encountered while generating a quote or building the list. + */ + type: 'not_enough_info_to_quote' | 'insufficient_credits' | 'internal_service_error'; + } + + /** + * A single masked preview record returned with a quote so you can sanity check the + * kind of contacts that will end up in the mailing list before confirming the + * build. + */ + export interface PreviewRecord { + /** + * The masked, comma-joined formatted address of the contact. + */ + formattedAddress: string; + + /** + * The masked name of the contact or business. + */ + name: string; + } + + /** + * Details of the quote generated for a targeted list build. + */ + export interface Quote { + /** + * The number of contacts that will be included in the built mailing list. This + * accounts for any `limit` that was provided. + */ + count: number; + + /** + * The UTC time at which the quote was generated. + */ + generatedAt: string; + + /** + * The price per contact, in cents. Multiply by `count` to get the total cost of + * building the list. + */ + pricePerContactCents: number; + } + + /** + * Filters used to target US companies (B2B) when building a list. + */ + export interface UsCompanies { + /** + * Required list of five-digit US ZIP codes to target. + */ + postalCodes: Array; + + /** + * Filter by ownership structure of the company. + */ + companyTypes?: Array< + 'public' | 'private' | 'educational' | 'government' | 'nonprofit' | 'public_subsidiary' + >; + + /** + * Inclusive `[min, max]` range for the number of employees at the company. Values + * must be between 1 and 1,000,000. + */ + employeeCount?: Array; + + /** + * Inclusive `[min, max]` range for the year the company was founded. Values must + * be between 1600 and 2100. + */ + foundedYear?: Array; + + /** + * Filter by free-form industry names (see the autocomplete endpoint). + */ + industries?: Array; + + /** + * Filter by six-digit [NAICS](https://www.census.gov/naics/) industry codes. + */ + naicsCodes?: Array; + + /** + * Filter by free-form company tags (e.g., `"saas"`, `"b2b"`). + */ + tags?: Array; + } + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + export interface UsConsumers { + /** + * Inclusive `[min, max]` age range. Values must be between 18 and 80. + */ + ageRange?: Array; + + /** + * A list of `"City, ST"` strings (e.g. `"New York, NY"`) to target. + */ + cityStates?: Array; + + /** + * Filter by highest level of education completed. + */ + educationLevels?: Array<'high_school' | 'college' | 'grad_school' | 'vocational_training'>; + + /** + * Gender filter for US consumer list builds. + */ + gender?: 'male' | 'female'; + + /** + * Inclusive `[min, max]` home value range, in US dollars. Values must be between 0 + * and 1,000,000. + */ + homeValueRange?: Array; + + /** + * Inclusive `[min, max]` annual household income range, in US dollars. Values must + * be between 0 and 200,000. + */ + incomeRange?: Array; + + /** + * Inclusive `[min, max]` number of children in the household. Values must be + * between 0 and 8. + */ + numChildrenRange?: Array; + + /** + * Filter by occupation classification. + */ + occupations?: Array< + | 'professional_technical' + | 'administration_management' + | 'sales_service' + | 'clerical_white_collar' + | 'craftsmen_blue_collar' + | 'student' + | 'homemaker' + | 'retired' + | 'farmer' + | 'military' + | 'religious' + | 'self_employed' + | 'self_employed_professional_technical' + | 'self_employed_administration_management' + | 'self_employed_sales_service' + | 'self_employed_clerical_white_collar' + | 'self_employed_craftsmen_blue_collar' + | 'self_employed_student' + | 'self_employed_homemaker' + | 'self_employed_retired' + | 'self_employed_other' + | 'educator' + | 'financial_professional' + | 'legal_professional' + | 'medical_professional' + | 'other' + >; + + /** + * A list of five-digit US ZIP codes to target. + */ + zipCodes?: Array; + + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + zipCodesAround?: UsConsumers.ZipCodesAround; + } + + export namespace UsConsumers { + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + export interface ZipCodesAround { + /** + * The radius in miles around `zipCode` to include. Between 0.1 and 100. + */ + radiusInMiles: number; + + /** + * The five-digit ZIP code at the center of the search circle. + */ + zipCode: string; + } + } +} + +/** + * A targeted list build represents a request to build a new mailing list by + * targeting US consumers or companies matching the provided filters. Once created, + * a quote is generated asynchronously. After reviewing the quote and preview + * records, you may confirm the build, which kicks off the creation of the + * underlying mailing list. + */ +export interface TargetedListBuildUpdateResponse { + /** + * A unique ID prefixed with targeted*list_build* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The ID of the organization that owns this list build. + */ + organization: string; + + /** + * Status of a targeted list build. + */ + status: 'generating_quote' | 'quote_ready' | 'creating_list' | 'completed' | 'failed'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * A percentage from 0 to 100 representing how much of the build has completed. + * Only populated while `status` is `creating_list`. + */ + buildProgressPercent?: number; + + /** + * The UTC time at which the build finished successfully. Only present once + * `status` is `completed`. + */ + completedAt?: string; + + /** + * The UTC time at which the build was confirmed, if any. + */ + confirmedAt?: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * Any errors encountered while generating a quote or building the list. + */ + errors?: Array; + + /** + * Maximum number of contacts to include in the built mailing list. If omitted, all + * matching contacts are included. + */ + limit?: number; + + /** + * The ID of the mailing list that was built. Present once `status` is `completed`. + */ + mailingList?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * A small number of masked sample records for the configured filters, populated + * alongside `quote`. + */ + previewRecords?: Array; + + /** + * Details of the quote generated for a targeted list build. + */ + quote?: TargetedListBuildUpdateResponse.Quote; + + /** + * Filters used to target US companies (B2B) when building a list. + */ + usCompanies?: TargetedListBuildUpdateResponse.UsCompanies; + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + usConsumers?: TargetedListBuildUpdateResponse.UsConsumers; +} + +export namespace TargetedListBuildUpdateResponse { + /** + * Details of an error encountered while processing a targeted list build. + */ + export interface Error { + /** + * A human-readable message describing the error. + */ + message: string; + + /** + * Type of error encountered while generating a quote or building the list. + */ + type: 'not_enough_info_to_quote' | 'insufficient_credits' | 'internal_service_error'; + } + + /** + * A single masked preview record returned with a quote so you can sanity check the + * kind of contacts that will end up in the mailing list before confirming the + * build. + */ + export interface PreviewRecord { + /** + * The masked, comma-joined formatted address of the contact. + */ + formattedAddress: string; + + /** + * The masked name of the contact or business. + */ + name: string; + } + + /** + * Details of the quote generated for a targeted list build. + */ + export interface Quote { + /** + * The number of contacts that will be included in the built mailing list. This + * accounts for any `limit` that was provided. + */ + count: number; + + /** + * The UTC time at which the quote was generated. + */ + generatedAt: string; + + /** + * The price per contact, in cents. Multiply by `count` to get the total cost of + * building the list. + */ + pricePerContactCents: number; + } + + /** + * Filters used to target US companies (B2B) when building a list. + */ + export interface UsCompanies { + /** + * Required list of five-digit US ZIP codes to target. + */ + postalCodes: Array; + + /** + * Filter by ownership structure of the company. + */ + companyTypes?: Array< + 'public' | 'private' | 'educational' | 'government' | 'nonprofit' | 'public_subsidiary' + >; + + /** + * Inclusive `[min, max]` range for the number of employees at the company. Values + * must be between 1 and 1,000,000. + */ + employeeCount?: Array; + + /** + * Inclusive `[min, max]` range for the year the company was founded. Values must + * be between 1600 and 2100. + */ + foundedYear?: Array; + + /** + * Filter by free-form industry names (see the autocomplete endpoint). + */ + industries?: Array; + + /** + * Filter by six-digit [NAICS](https://www.census.gov/naics/) industry codes. + */ + naicsCodes?: Array; + + /** + * Filter by free-form company tags (e.g., `"saas"`, `"b2b"`). + */ + tags?: Array; + } + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + export interface UsConsumers { + /** + * Inclusive `[min, max]` age range. Values must be between 18 and 80. + */ + ageRange?: Array; + + /** + * A list of `"City, ST"` strings (e.g. `"New York, NY"`) to target. + */ + cityStates?: Array; + + /** + * Filter by highest level of education completed. + */ + educationLevels?: Array<'high_school' | 'college' | 'grad_school' | 'vocational_training'>; + + /** + * Gender filter for US consumer list builds. + */ + gender?: 'male' | 'female'; + + /** + * Inclusive `[min, max]` home value range, in US dollars. Values must be between 0 + * and 1,000,000. + */ + homeValueRange?: Array; + + /** + * Inclusive `[min, max]` annual household income range, in US dollars. Values must + * be between 0 and 200,000. + */ + incomeRange?: Array; + + /** + * Inclusive `[min, max]` number of children in the household. Values must be + * between 0 and 8. + */ + numChildrenRange?: Array; + + /** + * Filter by occupation classification. + */ + occupations?: Array< + | 'professional_technical' + | 'administration_management' + | 'sales_service' + | 'clerical_white_collar' + | 'craftsmen_blue_collar' + | 'student' + | 'homemaker' + | 'retired' + | 'farmer' + | 'military' + | 'religious' + | 'self_employed' + | 'self_employed_professional_technical' + | 'self_employed_administration_management' + | 'self_employed_sales_service' + | 'self_employed_clerical_white_collar' + | 'self_employed_craftsmen_blue_collar' + | 'self_employed_student' + | 'self_employed_homemaker' + | 'self_employed_retired' + | 'self_employed_other' + | 'educator' + | 'financial_professional' + | 'legal_professional' + | 'medical_professional' + | 'other' + >; + + /** + * A list of five-digit US ZIP codes to target. + */ + zipCodes?: Array; + + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + zipCodesAround?: UsConsumers.ZipCodesAround; + } + + export namespace UsConsumers { + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + export interface ZipCodesAround { + /** + * The radius in miles around `zipCode` to include. Between 0.1 and 100. + */ + radiusInMiles: number; + + /** + * The five-digit ZIP code at the center of the search circle. + */ + zipCode: string; + } + } +} + +/** + * A targeted list build represents a request to build a new mailing list by + * targeting US consumers or companies matching the provided filters. Once created, + * a quote is generated asynchronously. After reviewing the quote and preview + * records, you may confirm the build, which kicks off the creation of the + * underlying mailing list. + */ +export interface TargetedListBuildListResponse { + /** + * A unique ID prefixed with targeted*list_build* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The ID of the organization that owns this list build. + */ + organization: string; + + /** + * Status of a targeted list build. + */ + status: 'generating_quote' | 'quote_ready' | 'creating_list' | 'completed' | 'failed'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * A percentage from 0 to 100 representing how much of the build has completed. + * Only populated while `status` is `creating_list`. + */ + buildProgressPercent?: number; + + /** + * The UTC time at which the build finished successfully. Only present once + * `status` is `completed`. + */ + completedAt?: string; + + /** + * The UTC time at which the build was confirmed, if any. + */ + confirmedAt?: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * Any errors encountered while generating a quote or building the list. + */ + errors?: Array; + + /** + * Maximum number of contacts to include in the built mailing list. If omitted, all + * matching contacts are included. + */ + limit?: number; + + /** + * The ID of the mailing list that was built. Present once `status` is `completed`. + */ + mailingList?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * A small number of masked sample records for the configured filters, populated + * alongside `quote`. + */ + previewRecords?: Array; + + /** + * Details of the quote generated for a targeted list build. + */ + quote?: TargetedListBuildListResponse.Quote; + + /** + * Filters used to target US companies (B2B) when building a list. + */ + usCompanies?: TargetedListBuildListResponse.UsCompanies; + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + usConsumers?: TargetedListBuildListResponse.UsConsumers; +} + +export namespace TargetedListBuildListResponse { + /** + * Details of an error encountered while processing a targeted list build. + */ + export interface Error { + /** + * A human-readable message describing the error. + */ + message: string; + + /** + * Type of error encountered while generating a quote or building the list. + */ + type: 'not_enough_info_to_quote' | 'insufficient_credits' | 'internal_service_error'; + } + + /** + * A single masked preview record returned with a quote so you can sanity check the + * kind of contacts that will end up in the mailing list before confirming the + * build. + */ + export interface PreviewRecord { + /** + * The masked, comma-joined formatted address of the contact. + */ + formattedAddress: string; + + /** + * The masked name of the contact or business. + */ + name: string; + } + + /** + * Details of the quote generated for a targeted list build. + */ + export interface Quote { + /** + * The number of contacts that will be included in the built mailing list. This + * accounts for any `limit` that was provided. + */ + count: number; + + /** + * The UTC time at which the quote was generated. + */ + generatedAt: string; + + /** + * The price per contact, in cents. Multiply by `count` to get the total cost of + * building the list. + */ + pricePerContactCents: number; + } + + /** + * Filters used to target US companies (B2B) when building a list. + */ + export interface UsCompanies { + /** + * Required list of five-digit US ZIP codes to target. + */ + postalCodes: Array; + + /** + * Filter by ownership structure of the company. + */ + companyTypes?: Array< + 'public' | 'private' | 'educational' | 'government' | 'nonprofit' | 'public_subsidiary' + >; + + /** + * Inclusive `[min, max]` range for the number of employees at the company. Values + * must be between 1 and 1,000,000. + */ + employeeCount?: Array; + + /** + * Inclusive `[min, max]` range for the year the company was founded. Values must + * be between 1600 and 2100. + */ + foundedYear?: Array; + + /** + * Filter by free-form industry names (see the autocomplete endpoint). + */ + industries?: Array; + + /** + * Filter by six-digit [NAICS](https://www.census.gov/naics/) industry codes. + */ + naicsCodes?: Array; + + /** + * Filter by free-form company tags (e.g., `"saas"`, `"b2b"`). + */ + tags?: Array; + } + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + export interface UsConsumers { + /** + * Inclusive `[min, max]` age range. Values must be between 18 and 80. + */ + ageRange?: Array; + + /** + * A list of `"City, ST"` strings (e.g. `"New York, NY"`) to target. + */ + cityStates?: Array; + + /** + * Filter by highest level of education completed. + */ + educationLevels?: Array<'high_school' | 'college' | 'grad_school' | 'vocational_training'>; + + /** + * Gender filter for US consumer list builds. + */ + gender?: 'male' | 'female'; + + /** + * Inclusive `[min, max]` home value range, in US dollars. Values must be between 0 + * and 1,000,000. + */ + homeValueRange?: Array; + + /** + * Inclusive `[min, max]` annual household income range, in US dollars. Values must + * be between 0 and 200,000. + */ + incomeRange?: Array; + + /** + * Inclusive `[min, max]` number of children in the household. Values must be + * between 0 and 8. + */ + numChildrenRange?: Array; + + /** + * Filter by occupation classification. + */ + occupations?: Array< + | 'professional_technical' + | 'administration_management' + | 'sales_service' + | 'clerical_white_collar' + | 'craftsmen_blue_collar' + | 'student' + | 'homemaker' + | 'retired' + | 'farmer' + | 'military' + | 'religious' + | 'self_employed' + | 'self_employed_professional_technical' + | 'self_employed_administration_management' + | 'self_employed_sales_service' + | 'self_employed_clerical_white_collar' + | 'self_employed_craftsmen_blue_collar' + | 'self_employed_student' + | 'self_employed_homemaker' + | 'self_employed_retired' + | 'self_employed_other' + | 'educator' + | 'financial_professional' + | 'legal_professional' + | 'medical_professional' + | 'other' + >; + + /** + * A list of five-digit US ZIP codes to target. + */ + zipCodes?: Array; + + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + zipCodesAround?: UsConsumers.ZipCodesAround; + } + + export namespace UsConsumers { + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + export interface ZipCodesAround { + /** + * The radius in miles around `zipCode` to include. Between 0.1 and 100. + */ + radiusInMiles: number; + + /** + * The five-digit ZIP code at the center of the search circle. + */ + zipCode: string; + } + } +} + +export interface TargetedListBuildDeleteResponse { + /** + * A unique ID prefixed with targeted*list_build* + */ + id: string; + + deleted: true; +} + +/** + * A targeted list build represents a request to build a new mailing list by + * targeting US consumers or companies matching the provided filters. Once created, + * a quote is generated asynchronously. After reviewing the quote and preview + * records, you may confirm the build, which kicks off the creation of the + * underlying mailing list. + */ +export interface TargetedListBuildConfirmResponse { + /** + * A unique ID prefixed with targeted*list_build* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * The ID of the organization that owns this list build. + */ + organization: string; + + /** + * Status of a targeted list build. + */ + status: 'generating_quote' | 'quote_ready' | 'creating_list' | 'completed' | 'failed'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * A percentage from 0 to 100 representing how much of the build has completed. + * Only populated while `status` is `creating_list`. + */ + buildProgressPercent?: number; + + /** + * The UTC time at which the build finished successfully. Only present once + * `status` is `completed`. + */ + completedAt?: string; + + /** + * The UTC time at which the build was confirmed, if any. + */ + confirmedAt?: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * Any errors encountered while generating a quote or building the list. + */ + errors?: Array; + + /** + * Maximum number of contacts to include in the built mailing list. If omitted, all + * matching contacts are included. + */ + limit?: number; + + /** + * The ID of the mailing list that was built. Present once `status` is `completed`. + */ + mailingList?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * A small number of masked sample records for the configured filters, populated + * alongside `quote`. + */ + previewRecords?: Array; + + /** + * Details of the quote generated for a targeted list build. + */ + quote?: TargetedListBuildConfirmResponse.Quote; + + /** + * Filters used to target US companies (B2B) when building a list. + */ + usCompanies?: TargetedListBuildConfirmResponse.UsCompanies; + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + usConsumers?: TargetedListBuildConfirmResponse.UsConsumers; +} + +export namespace TargetedListBuildConfirmResponse { + /** + * Details of an error encountered while processing a targeted list build. + */ + export interface Error { + /** + * A human-readable message describing the error. + */ + message: string; + + /** + * Type of error encountered while generating a quote or building the list. + */ + type: 'not_enough_info_to_quote' | 'insufficient_credits' | 'internal_service_error'; + } + + /** + * A single masked preview record returned with a quote so you can sanity check the + * kind of contacts that will end up in the mailing list before confirming the + * build. + */ + export interface PreviewRecord { + /** + * The masked, comma-joined formatted address of the contact. + */ + formattedAddress: string; + + /** + * The masked name of the contact or business. + */ + name: string; + } + + /** + * Details of the quote generated for a targeted list build. + */ + export interface Quote { + /** + * The number of contacts that will be included in the built mailing list. This + * accounts for any `limit` that was provided. + */ + count: number; + + /** + * The UTC time at which the quote was generated. + */ + generatedAt: string; + + /** + * The price per contact, in cents. Multiply by `count` to get the total cost of + * building the list. + */ + pricePerContactCents: number; + } + + /** + * Filters used to target US companies (B2B) when building a list. + */ + export interface UsCompanies { + /** + * Required list of five-digit US ZIP codes to target. + */ + postalCodes: Array; + + /** + * Filter by ownership structure of the company. + */ + companyTypes?: Array< + 'public' | 'private' | 'educational' | 'government' | 'nonprofit' | 'public_subsidiary' + >; + + /** + * Inclusive `[min, max]` range for the number of employees at the company. Values + * must be between 1 and 1,000,000. + */ + employeeCount?: Array; + + /** + * Inclusive `[min, max]` range for the year the company was founded. Values must + * be between 1600 and 2100. + */ + foundedYear?: Array; + + /** + * Filter by free-form industry names (see the autocomplete endpoint). + */ + industries?: Array; + + /** + * Filter by six-digit [NAICS](https://www.census.gov/naics/) industry codes. + */ + naicsCodes?: Array; + + /** + * Filter by free-form company tags (e.g., `"saas"`, `"b2b"`). + */ + tags?: Array; + } + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + export interface UsConsumers { + /** + * Inclusive `[min, max]` age range. Values must be between 18 and 80. + */ + ageRange?: Array; + + /** + * A list of `"City, ST"` strings (e.g. `"New York, NY"`) to target. + */ + cityStates?: Array; + + /** + * Filter by highest level of education completed. + */ + educationLevels?: Array<'high_school' | 'college' | 'grad_school' | 'vocational_training'>; + + /** + * Gender filter for US consumer list builds. + */ + gender?: 'male' | 'female'; + + /** + * Inclusive `[min, max]` home value range, in US dollars. Values must be between 0 + * and 1,000,000. + */ + homeValueRange?: Array; + + /** + * Inclusive `[min, max]` annual household income range, in US dollars. Values must + * be between 0 and 200,000. + */ + incomeRange?: Array; + + /** + * Inclusive `[min, max]` number of children in the household. Values must be + * between 0 and 8. + */ + numChildrenRange?: Array; + + /** + * Filter by occupation classification. + */ + occupations?: Array< + | 'professional_technical' + | 'administration_management' + | 'sales_service' + | 'clerical_white_collar' + | 'craftsmen_blue_collar' + | 'student' + | 'homemaker' + | 'retired' + | 'farmer' + | 'military' + | 'religious' + | 'self_employed' + | 'self_employed_professional_technical' + | 'self_employed_administration_management' + | 'self_employed_sales_service' + | 'self_employed_clerical_white_collar' + | 'self_employed_craftsmen_blue_collar' + | 'self_employed_student' + | 'self_employed_homemaker' + | 'self_employed_retired' + | 'self_employed_other' + | 'educator' + | 'financial_professional' + | 'legal_professional' + | 'medical_professional' + | 'other' + >; + + /** + * A list of five-digit US ZIP codes to target. + */ + zipCodes?: Array; + + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + zipCodesAround?: UsConsumers.ZipCodesAround; + } + + export namespace UsConsumers { + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + export interface ZipCodesAround { + /** + * The radius in miles around `zipCode` to include. Between 0.1 and 100. + */ + radiusInMiles: number; + + /** + * The five-digit ZIP code at the center of the search circle. + */ + zipCode: string; + } + } +} + +export interface TargetedListBuildCreateParams { + /** + * Body param: An optional string describing this resource. Will be visible in the + * API and the dashboard. + */ + description?: string; + + /** + * Body param: Maximum number of contacts to include in the built mailing list. If + * omitted, all matching contacts are included. + */ + limit?: number; + + /** + * Body param: See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * Body param: Filters used to target US companies (B2B) when building a list. + */ + usCompanies?: TargetedListBuildCreateParams.UsCompanies; + + /** + * Body param: Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + usConsumers?: TargetedListBuildCreateParams.UsConsumers; + + /** + * Header param + */ + 'idempotency-key'?: string; +} + +export namespace TargetedListBuildCreateParams { + /** + * Filters used to target US companies (B2B) when building a list. + */ + export interface UsCompanies { + /** + * Required list of five-digit US ZIP codes to target. + */ + postalCodes: Array; + + /** + * Filter by ownership structure of the company. + */ + companyTypes?: Array< + 'public' | 'private' | 'educational' | 'government' | 'nonprofit' | 'public_subsidiary' + >; + + /** + * Inclusive `[min, max]` range for the number of employees at the company. Values + * must be between 1 and 1,000,000. + */ + employeeCount?: Array; + + /** + * Inclusive `[min, max]` range for the year the company was founded. Values must + * be between 1600 and 2100. + */ + foundedYear?: Array; + + /** + * Filter by free-form industry names (see the autocomplete endpoint). + */ + industries?: Array; + + /** + * Filter by six-digit [NAICS](https://www.census.gov/naics/) industry codes. + */ + naicsCodes?: Array; + + /** + * Filter by free-form company tags (e.g., `"saas"`, `"b2b"`). + */ + tags?: Array; + } + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + export interface UsConsumers { + /** + * Inclusive `[min, max]` age range. Values must be between 18 and 80. + */ + ageRange?: Array; + + /** + * A list of `"City, ST"` strings (e.g. `"New York, NY"`) to target. + */ + cityStates?: Array; + + /** + * Filter by highest level of education completed. + */ + educationLevels?: Array<'high_school' | 'college' | 'grad_school' | 'vocational_training'>; + + /** + * Gender filter for US consumer list builds. + */ + gender?: 'male' | 'female'; + + /** + * Inclusive `[min, max]` home value range, in US dollars. Values must be between 0 + * and 1,000,000. + */ + homeValueRange?: Array; + + /** + * Inclusive `[min, max]` annual household income range, in US dollars. Values must + * be between 0 and 200,000. + */ + incomeRange?: Array; + + /** + * Inclusive `[min, max]` number of children in the household. Values must be + * between 0 and 8. + */ + numChildrenRange?: Array; + + /** + * Filter by occupation classification. + */ + occupations?: Array< + | 'professional_technical' + | 'administration_management' + | 'sales_service' + | 'clerical_white_collar' + | 'craftsmen_blue_collar' + | 'student' + | 'homemaker' + | 'retired' + | 'farmer' + | 'military' + | 'religious' + | 'self_employed' + | 'self_employed_professional_technical' + | 'self_employed_administration_management' + | 'self_employed_sales_service' + | 'self_employed_clerical_white_collar' + | 'self_employed_craftsmen_blue_collar' + | 'self_employed_student' + | 'self_employed_homemaker' + | 'self_employed_retired' + | 'self_employed_other' + | 'educator' + | 'financial_professional' + | 'legal_professional' + | 'medical_professional' + | 'other' + >; + + /** + * A list of five-digit US ZIP codes to target. + */ + zipCodes?: Array; + + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + zipCodesAround?: UsConsumers.ZipCodesAround; + } + + export namespace UsConsumers { + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + export interface ZipCodesAround { + /** + * The radius in miles around `zipCode` to include. Between 0.1 and 100. + */ + radiusInMiles: number; + + /** + * The five-digit ZIP code at the center of the search circle. + */ + zipCode: string; + } + } +} + +export interface TargetedListBuildUpdateParams { + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * Maximum number of contacts to include in the built mailing list. If omitted, all + * matching contacts are included. + */ + limit?: number; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; + + /** + * Filters used to target US companies (B2B) when building a list. + */ + usCompanies?: TargetedListBuildUpdateParams.UsCompanies; + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + usConsumers?: TargetedListBuildUpdateParams.UsConsumers; +} + +export namespace TargetedListBuildUpdateParams { + /** + * Filters used to target US companies (B2B) when building a list. + */ + export interface UsCompanies { + /** + * Required list of five-digit US ZIP codes to target. + */ + postalCodes: Array; + + /** + * Filter by ownership structure of the company. + */ + companyTypes?: Array< + 'public' | 'private' | 'educational' | 'government' | 'nonprofit' | 'public_subsidiary' + >; + + /** + * Inclusive `[min, max]` range for the number of employees at the company. Values + * must be between 1 and 1,000,000. + */ + employeeCount?: Array; + + /** + * Inclusive `[min, max]` range for the year the company was founded. Values must + * be between 1600 and 2100. + */ + foundedYear?: Array; + + /** + * Filter by free-form industry names (see the autocomplete endpoint). + */ + industries?: Array; + + /** + * Filter by six-digit [NAICS](https://www.census.gov/naics/) industry codes. + */ + naicsCodes?: Array; + + /** + * Filter by free-form company tags (e.g., `"saas"`, `"b2b"`). + */ + tags?: Array; + } + + /** + * Filters used to target US consumers (B2C) when building a list. + * + * The geographic filters (`zipCodesAround`, `cityStates`, `zipCodes`) are mutually + * exclusive — you may supply at most one of them. + */ + export interface UsConsumers { + /** + * Inclusive `[min, max]` age range. Values must be between 18 and 80. + */ + ageRange?: Array; + + /** + * A list of `"City, ST"` strings (e.g. `"New York, NY"`) to target. + */ + cityStates?: Array; + + /** + * Filter by highest level of education completed. + */ + educationLevels?: Array<'high_school' | 'college' | 'grad_school' | 'vocational_training'>; + + /** + * Gender filter for US consumer list builds. + */ + gender?: 'male' | 'female'; + + /** + * Inclusive `[min, max]` home value range, in US dollars. Values must be between 0 + * and 1,000,000. + */ + homeValueRange?: Array; + + /** + * Inclusive `[min, max]` annual household income range, in US dollars. Values must + * be between 0 and 200,000. + */ + incomeRange?: Array; + + /** + * Inclusive `[min, max]` number of children in the household. Values must be + * between 0 and 8. + */ + numChildrenRange?: Array; + + /** + * Filter by occupation classification. + */ + occupations?: Array< + | 'professional_technical' + | 'administration_management' + | 'sales_service' + | 'clerical_white_collar' + | 'craftsmen_blue_collar' + | 'student' + | 'homemaker' + | 'retired' + | 'farmer' + | 'military' + | 'religious' + | 'self_employed' + | 'self_employed_professional_technical' + | 'self_employed_administration_management' + | 'self_employed_sales_service' + | 'self_employed_clerical_white_collar' + | 'self_employed_craftsmen_blue_collar' + | 'self_employed_student' + | 'self_employed_homemaker' + | 'self_employed_retired' + | 'self_employed_other' + | 'educator' + | 'financial_professional' + | 'legal_professional' + | 'medical_professional' + | 'other' + >; + + /** + * A list of five-digit US ZIP codes to target. + */ + zipCodes?: Array; + + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + zipCodesAround?: UsConsumers.ZipCodesAround; + } + + export namespace UsConsumers { + /** + * A geographic filter that selects all ZIP codes within a given radius of a center + * ZIP code. + */ + export interface ZipCodesAround { + /** + * The radius in miles around `zipCode` to include. Between 0.1 and 100. + */ + radiusInMiles: number; + + /** + * The five-digit ZIP code at the center of the search circle. + */ + zipCode: string; + } + } +} + +export interface TargetedListBuildListParams extends SkipLimitParams { + /** + * You can supply any string to help narrow down the list of resources. For + * example, if you pass `"New York"` (quoted), it will return resources that have + * that string present somewhere in their response. Alternatively, you can supply a + * structured search query. See the documentation on `StructuredSearchQuery` for + * more details. + */ + search?: string; +} + +TargetedListBuilds.Filters = Filters; + +export declare namespace TargetedListBuilds { + export { + type TargetedListBuildCreateResponse as TargetedListBuildCreateResponse, + type TargetedListBuildRetrieveResponse as TargetedListBuildRetrieveResponse, + type TargetedListBuildUpdateResponse as TargetedListBuildUpdateResponse, + type TargetedListBuildListResponse as TargetedListBuildListResponse, + type TargetedListBuildDeleteResponse as TargetedListBuildDeleteResponse, + type TargetedListBuildConfirmResponse as TargetedListBuildConfirmResponse, + type TargetedListBuildListResponsesSkipLimit as TargetedListBuildListResponsesSkipLimit, + type TargetedListBuildCreateParams as TargetedListBuildCreateParams, + type TargetedListBuildUpdateParams as TargetedListBuildUpdateParams, + type TargetedListBuildListParams as TargetedListBuildListParams, + }; + + export { + Filters as Filters, + type FilterAutocompleteResponse as FilterAutocompleteResponse, + type FilterAutocompleteParams as FilterAutocompleteParams, + }; +} diff --git a/src/resources/print-mail/template-editor-sessions.ts b/src/resources/print-mail/template-editor-sessions.ts new file mode 100644 index 0000000..cc37865 --- /dev/null +++ b/src/resources/print-mail/template-editor-sessions.ts @@ -0,0 +1,435 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import { APIPromise } from '../../core/api-promise'; +import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination'; +import { RequestOptions } from '../../internal/request-options'; +import { path } from '../../internal/utils/path'; + +/** + * You can use template editor sessions to bring the capabilities of our + * template editor to your website. When you create a session, you provide the + * `template` which you want to edit, and we return a session with a `url` that + * you can `iframe` or redirect your customers to. + * + * When users save their changes in the editor session, it will update the + * underlying template. Note that sessions are only valid for 24 hours, after + * which point they are automatically deleted for security reasons. + * + * You can have multiple sessions active for the same template at the same time. + * In general, we recommend creating a new session every time you present our + * editor to your users. + * + * Note: you can use the template editor to modify templates created using HTML, + * but saving a session from the editor will override the original HTML content. + */ +export class TemplateEditorSessions extends APIResource { + /** + * Create a Template Editor Session. + * + * Note that if no `backURL` is supplied, PostGrid removes the Back button from the + * editor page. This is ideal for when you `iframe` the editor. + * + * @example + * ```ts + * const templateEditorSession = + * await client.printMail.templateEditorSessions.create({ + * template: 'template_eYxcbMKPZEZPk71ZJPA6Yz', + * backURL: 'https://postgrid.com', + * title: 'My Editor Session', + * trackers: [ + * 'tracker_123456789abcdefghijklmnopqrstuvwxyz', + * ], + * }); + * ``` + */ + create( + body: TemplateEditorSessionCreateParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/print-mail/v1/template_editor_sessions', { body, ...options }); + } + + /** + * Retrieve a paginated list of Template Editor Sessions. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const templateEditorSessionListResponse of client.printMail.templateEditorSessions.list()) { + * // ... + * } + * ``` + */ + list( + query: TemplateEditorSessionListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList( + '/print-mail/v1/template_editor_sessions', + SkipLimit, + { query, ...options }, + ); + } + + /** + * Delete a Template Editor Session by ID. + * + * @example + * ```ts + * const templateEditorSession = + * await client.printMail.templateEditorSessions.delete( + * 'id', + * ); + * ``` + */ + delete(id: string, options?: RequestOptions): APIPromise { + return this._client.delete(path`/print-mail/v1/template_editor_sessions/${id}`, options); + } +} + +export type TemplateEditorSessionListResponsesSkipLimit = SkipLimit; + +export interface TemplateEditorSessionCreateResponse { + /** + * A unique ID prefixed with `template_editor_session_`. + */ + id: string; + + /** + * The UTC time at which this session was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode session else `false`. + */ + live: boolean; + + /** + * Always `template_editor_session`. + */ + object: 'template_editor_session'; + + /** + * ID of the underlying template that this edits. + */ + template: string; + + /** + * A URL that can be iframed or redirected to for editing the template. + */ + url: string; + + /** + * The URL supplied when this editor session was created. + */ + backURL?: string; + + /** + * Style overrides for the template editor session. + */ + styles?: TemplateEditorSessionCreateResponse.Styles; + + /** + * The title supplied when this editor session was created. + */ + title?: string; + + /** + * Controls which Trackers are displayed in the template editor session. + */ + trackers?: 'all' | 'none' | Array; +} + +export namespace TemplateEditorSessionCreateResponse { + /** + * Style overrides for the template editor session. + */ + export interface Styles { + /** + * Style overrides for the template editor canvas. + */ + canvas?: Styles.Canvas; + + /** + * Style overrides for template editor panel text. + */ + panelText?: Styles.PanelText; + + /** + * Style overrides for the template editor save button. + */ + saveButton?: Styles.SaveButton; + } + + export namespace Styles { + /** + * Style overrides for the template editor canvas. + */ + export interface Canvas { + /** + * The canvas background color. + */ + backgroundColor?: string; + } + + /** + * Style overrides for template editor panel text. + */ + export interface PanelText { + /** + * The panel text color. + */ + color?: string; + } + + /** + * Style overrides for the template editor save button. + */ + export interface SaveButton { + /** + * The save button background color. + */ + backgroundColor?: string; + + /** + * The save button text color. + */ + textColor?: string; + } + } +} + +export interface TemplateEditorSessionListResponse { + /** + * A unique ID prefixed with `template_editor_session_`. + */ + id: string; + + /** + * The UTC time at which this session was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode session else `false`. + */ + live: boolean; + + /** + * Always `template_editor_session`. + */ + object: 'template_editor_session'; + + /** + * ID of the underlying template that this edits. + */ + template: string; + + /** + * A URL that can be iframed or redirected to for editing the template. + */ + url: string; + + /** + * The URL supplied when this editor session was created. + */ + backURL?: string; + + /** + * Style overrides for the template editor session. + */ + styles?: TemplateEditorSessionListResponse.Styles; + + /** + * The title supplied when this editor session was created. + */ + title?: string; + + /** + * Controls which Trackers are displayed in the template editor session. + */ + trackers?: 'all' | 'none' | Array; +} + +export namespace TemplateEditorSessionListResponse { + /** + * Style overrides for the template editor session. + */ + export interface Styles { + /** + * Style overrides for the template editor canvas. + */ + canvas?: Styles.Canvas; + + /** + * Style overrides for template editor panel text. + */ + panelText?: Styles.PanelText; + + /** + * Style overrides for the template editor save button. + */ + saveButton?: Styles.SaveButton; + } + + export namespace Styles { + /** + * Style overrides for the template editor canvas. + */ + export interface Canvas { + /** + * The canvas background color. + */ + backgroundColor?: string; + } + + /** + * Style overrides for template editor panel text. + */ + export interface PanelText { + /** + * The panel text color. + */ + color?: string; + } + + /** + * Style overrides for the template editor save button. + */ + export interface SaveButton { + /** + * The save button background color. + */ + backgroundColor?: string; + + /** + * The save button text color. + */ + textColor?: string; + } + } +} + +export interface TemplateEditorSessionDeleteResponse { + /** + * A unique ID prefixed with `template_editor_session_`. + */ + id: string; + + deleted: true; + + /** + * Always `template_editor_session`. + */ + object: 'template_editor_session'; +} + +export interface TemplateEditorSessionCreateParams { + /** + * ID of the underlying template that this edits. + */ + template: string; + + /** + * The URL supplied when this editor session was created. + */ + backURL?: string; + + /** + * Style overrides for the template editor session. + */ + styles?: TemplateEditorSessionCreateParams.Styles; + + /** + * The title supplied when this editor session was created. + */ + title?: string; + + /** + * Controls which Trackers are displayed in the template editor session. + */ + trackers?: 'all' | 'none' | Array; +} + +export namespace TemplateEditorSessionCreateParams { + /** + * Style overrides for the template editor session. + */ + export interface Styles { + /** + * Style overrides for the template editor canvas. + */ + canvas?: Styles.Canvas; + + /** + * Style overrides for template editor panel text. + */ + panelText?: Styles.PanelText; + + /** + * Style overrides for the template editor save button. + */ + saveButton?: Styles.SaveButton; + } + + export namespace Styles { + /** + * Style overrides for the template editor canvas. + */ + export interface Canvas { + /** + * The canvas background color. + */ + backgroundColor?: string; + } + + /** + * Style overrides for template editor panel text. + */ + export interface PanelText { + /** + * The panel text color. + */ + color?: string; + } + + /** + * Style overrides for the template editor save button. + */ + export interface SaveButton { + /** + * The save button background color. + */ + backgroundColor?: string; + + /** + * The save button text color. + */ + textColor?: string; + } + } +} + +export interface TemplateEditorSessionListParams extends SkipLimitParams { + /** + * You can supply any string to help narrow down the list of resources. For + * example, if you pass `"New York"` (quoted), it will return resources that have + * that string present somewhere in their response. Alternatively, you can supply a + * structured search query. See the documentation on `StructuredSearchQuery` for + * more details. + */ + search?: string; +} + +export declare namespace TemplateEditorSessions { + export { + type TemplateEditorSessionCreateResponse as TemplateEditorSessionCreateResponse, + type TemplateEditorSessionListResponse as TemplateEditorSessionListResponse, + type TemplateEditorSessionDeleteResponse as TemplateEditorSessionDeleteResponse, + type TemplateEditorSessionListResponsesSkipLimit as TemplateEditorSessionListResponsesSkipLimit, + type TemplateEditorSessionCreateParams as TemplateEditorSessionCreateParams, + type TemplateEditorSessionListParams as TemplateEditorSessionListParams, + }; +} diff --git a/src/resources/print-mail/trackers.ts b/src/resources/print-mail/trackers.ts new file mode 100644 index 0000000..b9d23eb --- /dev/null +++ b/src/resources/print-mail/trackers.ts @@ -0,0 +1,513 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import { APIPromise } from '../../core/api-promise'; +import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination'; +import { RequestOptions } from '../../internal/request-options'; +import { path } from '../../internal/utils/path'; + +/** + * Create and manage Trackers. + * + * Trackers can be used to track interactions in your orders through + * personalized URLs and QR codes. + * + * As a brief introduction to using Trackers in your orders, a QR code can be + * generated by using the Tracker's ID as a merge variable in your orders HTML + * and Templates. The following example HTML uses Trackers to generate + * personalized URLs (PURLs) in your orders. + * + * See the following guide for more details: https://postgrid.readme.io/reference/trackers-1 + */ +export class Trackers extends APIResource { + /** + * Create a Tracker. + * + * @example + * ```ts + * const tracker = await client.printMail.trackers.create({ + * redirectURLTemplate: + * 'https://postgrid.com?name={{to.firstName}}', + * urlExpireAfterDays: 30, + * }); + * ``` + */ + create(body: TrackerCreateParams, options?: RequestOptions): APIPromise { + return this._client.post('/print-mail/v1/trackers', { body, ...options }); + } + + /** + * Retrieve a Tracker by ID. + * + * @example + * ```ts + * const tracker = await client.printMail.trackers.retrieve( + * 'id', + * ); + * ``` + */ + retrieve(id: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/print-mail/v1/trackers/${id}`, options); + } + + /** + * Update a Tracker by ID. + * + * @example + * ```ts + * const tracker = await client.printMail.trackers.update( + * 'id', + * { + * redirectURLTemplate: + * 'https://postgrid.com?firstName={{to.firstName}}', + * urlExpireAfterDays: 90, + * }, + * ); + * ``` + */ + update(id: string, body: TrackerUpdateParams, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/trackers/${id}`, { body, ...options }); + } + + /** + * Retrieve a paginated list of Trackers. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const trackerListResponse of client.printMail.trackers.list()) { + * // ... + * } + * ``` + */ + list( + query: TrackerListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList('/print-mail/v1/trackers', SkipLimit, { + query, + ...options, + }); + } + + /** + * Delete a Tracker by ID. Note that this operation cannot be undone. + * + * @example + * ```ts + * const tracker = await client.printMail.trackers.delete( + * 'id', + * ); + * ``` + */ + delete(id: string, options?: RequestOptions): APIPromise { + return this._client.delete(path`/print-mail/v1/trackers/${id}`, options); + } + + /** + * Retrieve a paginated list of visits for a Tracker. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const trackerRetrieveVisitsResponse of client.printMail.trackers.retrieveVisits( + * 'id', + * )) { + * // ... + * } + * ``` + */ + retrieveVisits( + id: string, + query: TrackerRetrieveVisitsParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList( + path`/print-mail/v1/trackers/${id}/visits`, + SkipLimit, + { query, ...options }, + ); + } +} + +export type TrackerListResponsesSkipLimit = SkipLimit; + +export type TrackerRetrieveVisitsResponsesSkipLimit = SkipLimit; + +export interface TrackerCreateResponse { + /** + * A unique ID prefixed with tracker\_ + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * Always `tracker`. + */ + object: 'tracker'; + + /** + * The base template for URLs generated by this Tracker. + */ + redirectURLTemplate: string; + + /** + * The unique number of interactions the Tracker has had. + */ + uniqueVisitCount: number; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The number of days generated Tracker URLs remain valid. + */ + urlExpireAfterDays: 30 | 60 | 90 | 180 | 365; + + /** + * The total number of interactions the Tracker has had. + */ + visitCount: number; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +export interface TrackerRetrieveResponse { + /** + * A unique ID prefixed with tracker\_ + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * Always `tracker`. + */ + object: 'tracker'; + + /** + * The base template for URLs generated by this Tracker. + */ + redirectURLTemplate: string; + + /** + * The unique number of interactions the Tracker has had. + */ + uniqueVisitCount: number; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The number of days generated Tracker URLs remain valid. + */ + urlExpireAfterDays: 30 | 60 | 90 | 180 | 365; + + /** + * The total number of interactions the Tracker has had. + */ + visitCount: number; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +export interface TrackerUpdateResponse { + /** + * A unique ID prefixed with tracker\_ + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * Always `tracker`. + */ + object: 'tracker'; + + /** + * The base template for URLs generated by this Tracker. + */ + redirectURLTemplate: string; + + /** + * The unique number of interactions the Tracker has had. + */ + uniqueVisitCount: number; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The number of days generated Tracker URLs remain valid. + */ + urlExpireAfterDays: 30 | 60 | 90 | 180 | 365; + + /** + * The total number of interactions the Tracker has had. + */ + visitCount: number; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +export interface TrackerListResponse { + /** + * A unique ID prefixed with tracker\_ + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * Always `tracker`. + */ + object: 'tracker'; + + /** + * The base template for URLs generated by this Tracker. + */ + redirectURLTemplate: string; + + /** + * The unique number of interactions the Tracker has had. + */ + uniqueVisitCount: number; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The number of days generated Tracker URLs remain valid. + */ + urlExpireAfterDays: 30 | 60 | 90 | 180 | 365; + + /** + * The total number of interactions the Tracker has had. + */ + visitCount: number; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +export interface TrackerDeleteResponse { + /** + * A unique ID prefixed with tracker\_ + */ + id: string; + + deleted: true; + + /** + * Always `tracker`. + */ + object: 'tracker'; +} + +export interface TrackerRetrieveVisitsResponse { + /** + * A unique ID prefixed with `tracker_visit_`. + */ + id: string; + + /** + * The UTC time at which this visit was created. + */ + createdAt: string; + + /** + * The type of device associated with the visit. + */ + device: string; + + /** + * The IP address associated with the visit. + */ + ipAddress: string; + + /** + * Indicates if the visit was used in a live order or not. + */ + live: boolean; + + /** + * Always `tracker_visit`. + */ + object: 'tracker_visit'; + + /** + * The ID of the order where the interaction occurred. + */ + orderID: string; + + /** + * The ID of the tracker related to this visit. + */ + tracker: string; + + /** + * The UTC time at which this visit was last updated. + */ + updatedAt: string; +} + +export interface TrackerCreateParams { + /** + * The base template for URLs generated by this Tracker. + */ + redirectURLTemplate: string; + + /** + * The number of days generated Tracker URLs remain valid. + */ + urlExpireAfterDays: 30 | 60 | 90 | 180 | 365; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +export interface TrackerUpdateParams { + /** + * The base template for URLs generated by this Tracker. + */ + redirectURLTemplate: string; + + /** + * The number of days generated Tracker URLs remain valid. + */ + urlExpireAfterDays: 30 | 60 | 90 | 180 | 365; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +export interface TrackerListParams extends SkipLimitParams { + /** + * You can supply any string to help narrow down the list of resources. For + * example, if you pass `"New York"` (quoted), it will return resources that have + * that string present somewhere in their response. Alternatively, you can supply a + * structured search query. See the documentation on `StructuredSearchQuery` for + * more details. + */ + search?: string; +} + +export interface TrackerRetrieveVisitsParams extends SkipLimitParams { + /** + * You can supply any string to help narrow down the list of resources. For + * example, if you pass `"New York"` (quoted), it will return resources that have + * that string present somewhere in their response. Alternatively, you can supply a + * structured search query. See the documentation on `StructuredSearchQuery` for + * more details. + */ + search?: string; +} + +export declare namespace Trackers { + export { + type TrackerCreateResponse as TrackerCreateResponse, + type TrackerRetrieveResponse as TrackerRetrieveResponse, + type TrackerUpdateResponse as TrackerUpdateResponse, + type TrackerListResponse as TrackerListResponse, + type TrackerDeleteResponse as TrackerDeleteResponse, + type TrackerRetrieveVisitsResponse as TrackerRetrieveVisitsResponse, + type TrackerListResponsesSkipLimit as TrackerListResponsesSkipLimit, + type TrackerRetrieveVisitsResponsesSkipLimit as TrackerRetrieveVisitsResponsesSkipLimit, + type TrackerCreateParams as TrackerCreateParams, + type TrackerUpdateParams as TrackerUpdateParams, + type TrackerListParams as TrackerListParams, + type TrackerRetrieveVisitsParams as TrackerRetrieveVisitsParams, + }; +} diff --git a/src/resources/print-mail/order-profiles.ts b/src/resources/print-mail/virtual-mailboxes.ts similarity index 67% rename from src/resources/print-mail/order-profiles.ts rename to src/resources/print-mail/virtual-mailboxes.ts index 3739066..0015093 100644 --- a/src/resources/print-mail/order-profiles.ts +++ b/src/resources/print-mail/virtual-mailboxes.ts @@ -1,3 +1,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export * from './order-profiles/index'; +export * from './virtual-mailboxes/index'; diff --git a/src/resources/print-mail/virtual-mailboxes/index.ts b/src/resources/print-mail/virtual-mailboxes/index.ts new file mode 100644 index 0000000..5bc78a7 --- /dev/null +++ b/src/resources/print-mail/virtual-mailboxes/index.ts @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Items, + type ItemCreateResponse, + type ItemRetrieveResponse, + type ItemListResponse, + type ItemCreateParams, + type ItemRetrieveParams, + type ItemListParams, + type ItemListResponsesSkipLimit, +} from './items'; +export { + VirtualMailboxes, + type VirtualMailboxCreateResponse, + type VirtualMailboxRetrieveResponse, + type VirtualMailboxListResponse, + type VirtualMailboxRetrieveAddressResponse, + type VirtualMailboxCreateParams, + type VirtualMailboxListParams, + type VirtualMailboxListResponsesSkipLimit, +} from './virtual-mailboxes'; diff --git a/src/resources/print-mail/virtual-mailboxes/items.ts b/src/resources/print-mail/virtual-mailboxes/items.ts new file mode 100644 index 0000000..c62b3cc --- /dev/null +++ b/src/resources/print-mail/virtual-mailboxes/items.ts @@ -0,0 +1,296 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../core/resource'; +import { APIPromise } from '../../../core/api-promise'; +import { PagePromise, SkipLimit, type SkipLimitParams } from '../../../core/pagination'; +import { RequestOptions } from '../../../internal/request-options'; +import { path } from '../../../internal/utils/path'; + +/** + * Virtual mailboxes let you receive, scan, and forward your physical mail + * without needing a traditional physical mailbox. Each mailbox is fully + * digital, giving you a unique ID, status, and a set of capabilities such as + * forwarding mail to another address or viewing envelope scans. This allows you + * to manage physical correspondence entirely online. + * + * You can request access to this feature by reaching out to + * support@postgrid.com + */ +export class Items extends APIResource { + /** + * Create a test item for a virtual mailbox. This is only available in test mode, + * an error will be returned if you attempt this call in live mode. + * + * @example + * ```ts + * const item = + * await client.printMail.virtualMailboxes.items.create( + * 'id', + * { matchedLetter: 'letter_abcdef1234567890' }, + * ); + * ``` + */ + create(id: string, body: ItemCreateParams, options?: RequestOptions): APIPromise { + return this._client.post(path`/print-mail/v1/virtual_mailboxes/${id}/items`, { body, ...options }); + } + + /** + * Retrieves a single item for a virtual mailbox. + * + * @example + * ```ts + * const item = + * await client.printMail.virtualMailboxes.items.retrieve( + * 'itemID', + * { id: 'id' }, + * ); + * ``` + */ + retrieve( + itemID: string, + params: ItemRetrieveParams, + options?: RequestOptions, + ): APIPromise { + const { id } = params; + return this._client.get(path`/print-mail/v1/virtual_mailboxes/${id}/items/${itemID}`, options); + } + + /** + * Lists items for a virtual mailbox. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const itemListResponse of client.printMail.virtualMailboxes.items.list( + * 'id', + * )) { + * // ... + * } + * ``` + */ + list( + id: string, + query: ItemListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList( + path`/print-mail/v1/virtual_mailboxes/${id}/items`, + SkipLimit, + { query, ...options }, + ); + } +} + +export type ItemListResponsesSkipLimit = SkipLimit; + +/** + * The virtual mailbox item object. + */ +export interface ItemCreateResponse { + /** + * A unique ID prefixed with virtual*mailbox_item* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * Always "virtual_mailbox_item". + */ + object: 'virtual_mailbox_item'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The ID of the virtual mailbox associated with this item. + */ + virtualMailbox: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * A URL of the envelope scan PDF. + */ + fileURL?: string; + + /** + * The ID of the letter this item was matched to. + */ + matchedLetter?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +/** + * The virtual mailbox item object. + */ +export interface ItemRetrieveResponse { + /** + * A unique ID prefixed with virtual*mailbox_item* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * Always "virtual_mailbox_item". + */ + object: 'virtual_mailbox_item'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The ID of the virtual mailbox associated with this item. + */ + virtualMailbox: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * A URL of the envelope scan PDF. + */ + fileURL?: string; + + /** + * The ID of the letter this item was matched to. + */ + matchedLetter?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +/** + * The virtual mailbox item object. + */ +export interface ItemListResponse { + /** + * A unique ID prefixed with virtual*mailbox_item* + */ + id: string; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * Always "virtual_mailbox_item". + */ + object: 'virtual_mailbox_item'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * The ID of the virtual mailbox associated with this item. + */ + virtualMailbox: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * A URL of the envelope scan PDF. + */ + fileURL?: string; + + /** + * The ID of the letter this item was matched to. + */ + matchedLetter?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +export interface ItemCreateParams { + /** + * The description of the item. + */ + description?: string; + + /** + * The ID of a letter to match this test item to. + */ + matchedLetter?: string; + + /** + * The metadata of the item. + */ + metadata?: { [key: string]: unknown }; +} + +export interface ItemRetrieveParams { + id: string; +} + +export interface ItemListParams extends SkipLimitParams { + /** + * You can supply any string to help narrow down the list of resources. For + * example, if you pass `"New York"` (quoted), it will return resources that have + * that string present somewhere in their response. Alternatively, you can supply a + * structured search query. See the documentation on `StructuredSearchQuery` for + * more details. + */ + search?: string; +} + +export declare namespace Items { + export { + type ItemCreateResponse as ItemCreateResponse, + type ItemRetrieveResponse as ItemRetrieveResponse, + type ItemListResponse as ItemListResponse, + type ItemListResponsesSkipLimit as ItemListResponsesSkipLimit, + type ItemCreateParams as ItemCreateParams, + type ItemRetrieveParams as ItemRetrieveParams, + type ItemListParams as ItemListParams, + }; +} diff --git a/src/resources/print-mail/virtual-mailboxes/virtual-mailboxes.ts b/src/resources/print-mail/virtual-mailboxes/virtual-mailboxes.ts new file mode 100644 index 0000000..15efd66 --- /dev/null +++ b/src/resources/print-mail/virtual-mailboxes/virtual-mailboxes.ts @@ -0,0 +1,434 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../core/resource'; +import * as ContactsAPI from '../contacts'; +import * as ItemsAPI from './items'; +import { + ItemCreateParams, + ItemCreateResponse, + ItemListParams, + ItemListResponse, + ItemListResponsesSkipLimit, + ItemRetrieveParams, + ItemRetrieveResponse, + Items, +} from './items'; +import { APIPromise } from '../../../core/api-promise'; +import { PagePromise, SkipLimit, type SkipLimitParams } from '../../../core/pagination'; +import { RequestOptions } from '../../../internal/request-options'; +import { path } from '../../../internal/utils/path'; + +/** + * Virtual mailboxes let you receive, scan, and forward your physical mail + * without needing a traditional physical mailbox. Each mailbox is fully + * digital, giving you a unique ID, status, and a set of capabilities such as + * forwarding mail to another address or viewing envelope scans. This allows you + * to manage physical correspondence entirely online. + * + * You can request access to this feature by reaching out to + * support@postgrid.com + */ +export class VirtualMailboxes extends APIResource { + items: ItemsAPI.Items = new ItemsAPI.Items(this._client); + + /** + * Creates a new virtual mailbox. In live mode, the virtual mailbox will be pending + * assignment and cannot be used until it has been assigned and activated by our + * team. You will be notified via email once the virtual mailbox has been + * activated. In test mode, the virtual mailbox will be activated immediately upon + * creation. + * + * @example + * ```ts + * const virtualMailbox = + * await client.printMail.virtualMailboxes.create({ + * countryCode: 'US', + * capabilities: { + * envelopeScans: true, + * forwardMailTo: 'contact_pxd7wnnD1xY6H6etKNvjb4', + * }, + * }); + * ``` + */ + create( + body: VirtualMailboxCreateParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/print-mail/v1/virtual_mailboxes', { body, ...options }); + } + + /** + * Retrieve Virtual Mailbox + * + * @example + * ```ts + * const virtualMailbox = + * await client.printMail.virtualMailboxes.retrieve('id'); + * ``` + */ + retrieve(id: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/print-mail/v1/virtual_mailboxes/${id}`, options); + } + + /** + * Lists virtual mailboxes. You can use the `skip`, `limit`, and `search` query + * parameters to refine the list. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const virtualMailboxListResponse of client.printMail.virtualMailboxes.list()) { + * // ... + * } + * ``` + */ + list( + query: VirtualMailboxListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList( + '/print-mail/v1/virtual_mailboxes', + SkipLimit, + { query, ...options }, + ); + } + + /** + * Retrieves the physical address of the virtual mailbox. + * + * @example + * ```ts + * const response = + * await client.printMail.virtualMailboxes.retrieveAddress( + * 'id', + * ); + * ``` + */ + retrieveAddress(id: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/print-mail/v1/virtual_mailboxes/${id}/address`, options); + } +} + +export type VirtualMailboxListResponsesSkipLimit = SkipLimit; + +/** + * The virtual mailbox object. + */ +export interface VirtualMailboxCreateResponse { + /** + * A unique ID prefixed with virtual*mailbox* + */ + id: string; + + /** + * All of the capabilities a virtual mailbox may have. + */ + capabilities: VirtualMailboxCreateResponse.Capabilities; + + /** + * All of the supported countries for virtual mailboxes. + */ + countryCode: 'US'; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * Always "virtual_mailbox". + */ + object: 'virtual_mailbox'; + + /** + * The possible statuses of virtual mailboxes. + */ + status: 'active' | 'pending_assignment'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +export namespace VirtualMailboxCreateResponse { + /** + * All of the capabilities a virtual mailbox may have. + */ + export interface Capabilities { + /** + * Indicates if the virtual mailbox can produce scans of envelopes. + */ + envelopeScans: boolean; + + /** + * A contact to forward any returned mail to. + */ + forwardMailTo?: ContactsAPI.Contact; + } +} + +/** + * The virtual mailbox object. + */ +export interface VirtualMailboxRetrieveResponse { + /** + * A unique ID prefixed with virtual*mailbox* + */ + id: string; + + /** + * All of the capabilities a virtual mailbox may have. + */ + capabilities: VirtualMailboxRetrieveResponse.Capabilities; + + /** + * All of the supported countries for virtual mailboxes. + */ + countryCode: 'US'; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * Always "virtual_mailbox". + */ + object: 'virtual_mailbox'; + + /** + * The possible statuses of virtual mailboxes. + */ + status: 'active' | 'pending_assignment'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +export namespace VirtualMailboxRetrieveResponse { + /** + * All of the capabilities a virtual mailbox may have. + */ + export interface Capabilities { + /** + * Indicates if the virtual mailbox can produce scans of envelopes. + */ + envelopeScans: boolean; + + /** + * A contact to forward any returned mail to. + */ + forwardMailTo?: ContactsAPI.Contact; + } +} + +/** + * The virtual mailbox object. + */ +export interface VirtualMailboxListResponse { + /** + * A unique ID prefixed with virtual*mailbox* + */ + id: string; + + /** + * All of the capabilities a virtual mailbox may have. + */ + capabilities: VirtualMailboxListResponse.Capabilities; + + /** + * All of the supported countries for virtual mailboxes. + */ + countryCode: 'US'; + + /** + * The UTC time at which this resource was created. + */ + createdAt: string; + + /** + * `true` if this is a live mode resource else `false`. + */ + live: boolean; + + /** + * Always "virtual_mailbox". + */ + object: 'virtual_mailbox'; + + /** + * The possible statuses of virtual mailboxes. + */ + status: 'active' | 'pending_assignment'; + + /** + * The UTC time at which this resource was last updated. + */ + updatedAt: string; + + /** + * An optional string describing this resource. Will be visible in the API and the + * dashboard. + */ + description?: string; + + /** + * See the section on Metadata. + */ + metadata?: { [key: string]: unknown }; +} + +export namespace VirtualMailboxListResponse { + /** + * All of the capabilities a virtual mailbox may have. + */ + export interface Capabilities { + /** + * Indicates if the virtual mailbox can produce scans of envelopes. + */ + envelopeScans: boolean; + + /** + * A contact to forward any returned mail to. + */ + forwardMailTo?: ContactsAPI.Contact; + } +} + +/** + * The address information for a mailbox. + */ +export interface VirtualMailboxRetrieveAddressResponse { + /** + * The address line 1 of the mailbox. + */ + addressLine1: string; + + /** + * All of the supported countries for virtual mailboxes. + */ + countryCode: 'US'; + + /** + * The address line 2 of the mailbox. + */ + addressLine2?: string; + + /** + * The city of the mailbox. + */ + city?: string; + + /** + * The postal or ZIP code of the mailbox. + */ + postalOrZip?: string; + + /** + * The province or state of the mailbox. + */ + provinceOrState?: string; +} + +export interface VirtualMailboxCreateParams { + /** + * All of the supported countries for virtual mailboxes. + */ + countryCode: 'US'; + + /** + * The capabilities the virtual mailbox should support. + */ + capabilities?: VirtualMailboxCreateParams.Capabilities; +} + +export namespace VirtualMailboxCreateParams { + /** + * The capabilities the virtual mailbox should support. + */ + export interface Capabilities { + /** + * If the virtual mailbox should support envelope scans or not. + */ + envelopeScans: boolean; + + /** + * A contact ID or contact object. + */ + forwardMailTo?: + | ContactsAPI.ContactCreateWithFirstName + | ContactsAPI.ContactCreateWithCompanyName + | string; + } +} + +export interface VirtualMailboxListParams extends SkipLimitParams { + /** + * You can supply any string to help narrow down the list of resources. For + * example, if you pass `"New York"` (quoted), it will return resources that have + * that string present somewhere in their response. Alternatively, you can supply a + * structured search query. See the documentation on `StructuredSearchQuery` for + * more details. + */ + search?: string; +} + +VirtualMailboxes.Items = Items; + +export declare namespace VirtualMailboxes { + export { + type VirtualMailboxCreateResponse as VirtualMailboxCreateResponse, + type VirtualMailboxRetrieveResponse as VirtualMailboxRetrieveResponse, + type VirtualMailboxListResponse as VirtualMailboxListResponse, + type VirtualMailboxRetrieveAddressResponse as VirtualMailboxRetrieveAddressResponse, + type VirtualMailboxListResponsesSkipLimit as VirtualMailboxListResponsesSkipLimit, + type VirtualMailboxCreateParams as VirtualMailboxCreateParams, + type VirtualMailboxListParams as VirtualMailboxListParams, + }; + + export { + Items as Items, + type ItemCreateResponse as ItemCreateResponse, + type ItemRetrieveResponse as ItemRetrieveResponse, + type ItemListResponse as ItemListResponse, + type ItemListResponsesSkipLimit as ItemListResponsesSkipLimit, + type ItemCreateParams as ItemCreateParams, + type ItemRetrieveParams as ItemRetrieveParams, + type ItemListParams as ItemListParams, + }; +} diff --git a/src/version.ts b/src/version.ts index 4872174..30c2817 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.5.2'; // x-release-please-version +export const VERSION = '0.6.0'; // x-release-please-version diff --git a/tests/api-resources/address-verification.test.ts b/tests/api-resources/address-verification.test.ts index cc882bb..4e81584 100644 --- a/tests/api-resources/address-verification.test.ts +++ b/tests/api-resources/address-verification.test.ts @@ -9,6 +9,189 @@ const client = new PostGrid({ }); describe('resource addressVerification', () => { + // Mock server tests are disabled + test.skip('autocomplete: only required params', async () => { + const responsePromise = client.addressVerification.autocomplete({ partialStreet: 'partialStreet' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('autocomplete: required and optional params', async () => { + const response = await client.addressVerification.autocomplete({ + partialStreet: 'partialStreet', + filterExact: true, + geocode: true, + includeDetails: true, + index: 0, + limit: 0, + properCase: true, + query_verifiedOnly: true, + verify: true, + cityFilter: 'cityFilter', + countryFilter: 'countryFilter', + pcFilter: 'pcFilter', + stateFilter: 'stateFilter', + body_verifiedOnly: true, + }); + }); + + // Mock server tests are disabled + test.skip('batchVerification: only required params', async () => { + const responsePromise = client.addressVerification.batchVerification({ + addresses: [{ address: 'address' }], + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('batchVerification: required and optional params', async () => { + const response = await client.addressVerification.batchVerification({ + addresses: [{ address: 'address' }], + geocode: true, + includeDetails: true, + properCase: true, + }); + }); + + // Mock server tests are disabled + test.skip('getAutocompletePreviews: only required params', async () => { + const responsePromise = client.addressVerification.getAutocompletePreviews({ + partialStreet: 'partialStreet', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('getAutocompletePreviews: required and optional params', async () => { + const response = await client.addressVerification.getAutocompletePreviews({ + partialStreet: 'partialStreet', + cityFilter: 'cityFilter', + countryFilter: 'countryFilter', + filterExact: true, + limit: 0, + pcFilter: 'pcFilter', + properCase: true, + provInsteadOfPC: true, + stateFilter: 'stateFilter', + verifiedOnly: true, + }); + }); + + // Mock server tests are disabled + test.skip('getLookupInfo', async () => { + const responsePromise = client.addressVerification.getLookupInfo(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('lookupCityOrStateFromPostalOrZipCode: only required params', async () => { + const responsePromise = client.addressVerification.lookupCityOrStateFromPostalOrZipCode({ + postalOrZip: 'postalOrZip', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('lookupCityOrStateFromPostalOrZipCode: required and optional params', async () => { + const response = await client.addressVerification.lookupCityOrStateFromPostalOrZipCode({ + postalOrZip: 'postalOrZip', + }); + }); + + // Mock server tests are disabled + test.skip('lookupZipCodeFromCityOrState: only required params', async () => { + const responsePromise = client.addressVerification.lookupZipCodeFromCityOrState({ + city: 'city', + countryCode: 'countryCode', + state: 'state', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('lookupZipCodeFromCityOrState: required and optional params', async () => { + const response = await client.addressVerification.lookupZipCodeFromCityOrState({ + city: 'city', + countryCode: 'countryCode', + state: 'state', + }); + }); + + // Mock server tests are disabled + test.skip('parseAnAddress: only required params', async () => { + const responsePromise = client.addressVerification.parseAnAddress({ address: 'address' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('parseAnAddress: required and optional params', async () => { + const response = await client.addressVerification.parseAnAddress({ address: 'address' }); + }); + + // Mock server tests are disabled + test.skip('suggestAddresses: only required params', async () => { + const responsePromise = client.addressVerification.suggestAddresses({ address: 'address' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('suggestAddresses: required and optional params', async () => { + const response = await client.addressVerification.suggestAddresses({ + address: 'address', + geocode: true, + includeDetails: true, + properCase: true, + }); + }); + // Mock server tests are disabled test.skip('verify: only required params', async () => { const responsePromise = client.addressVerification.verify({ address: 'address' }); diff --git a/tests/api-resources/intl-address-verification.test.ts b/tests/api-resources/intl-address-verification.test.ts index 0380400..f8f37f1 100644 --- a/tests/api-resources/intl-address-verification.test.ts +++ b/tests/api-resources/intl-address-verification.test.ts @@ -9,6 +9,148 @@ const client = new PostGrid({ }); describe('resource intlAddressVerification', () => { + // Mock server tests are disabled + test.skip('autocomplete: only required params', async () => { + const responsePromise = client.intlAddressVerification.autocomplete({ id: 'id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('autocomplete: required and optional params', async () => { + const response = await client.intlAddressVerification.autocomplete({ + id: 'id', + includeDetails: true, + properCase: true, + useEnhancedChinaDataset: true, + verify: true, + }); + }); + + // Mock server tests are disabled + test.skip('batchVerification: only required params', async () => { + const responsePromise = client.intlAddressVerification.batchVerification({ + addresses: [ + { + address: { + country: 'country', + line1: 'line1', + postalOrZip: 'postalOrZip', + provinceOrState: 'provinceOrState', + }, + }, + ], + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('batchVerification: required and optional params', async () => { + const response = await client.intlAddressVerification.batchVerification({ + addresses: [ + { + address: { + country: 'country', + line1: 'line1', + postalOrZip: 'postalOrZip', + provinceOrState: 'provinceOrState', + city: 'city', + line2: 'line2', + line3: 'line3', + line4: 'line4', + }, + }, + ], + geoData: true, + includeDetails: true, + properCase: true, + useEnhancedChinaDataset: true, + }); + }); + + // Mock server tests are disabled + test.skip('getAutocompleteAdvancedPreviews', async () => { + const responsePromise = client.intlAddressVerification.getAutocompleteAdvancedPreviews(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('getAutocompleteAdvancedPreviews: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.intlAddressVerification.getAutocompleteAdvancedPreviews( + { + advanced: true, + cityFilter: 'cityFilter', + container: 'container', + countriesFilter: 'countriesFilter', + disableIPBiasing: true, + language: 'language', + limit: 0, + partialStreet: 'partialStreet', + postalOrZipFilter: 'postalOrZipFilter', + standardFallback: true, + streetFilter: 'streetFilter', + useEnhancedChinaDataset: true, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(PostGrid.NotFoundError); + }); + + // Mock server tests are disabled + test.skip('getAutocompletePreviews', async () => { + const responsePromise = client.intlAddressVerification.getAutocompletePreviews(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('getAutocompletePreviews: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.intlAddressVerification.getAutocompletePreviews( + { + advanced: true, + cityFilter: 'cityFilter', + container: 'container', + countriesFilter: 'countriesFilter', + disableIPBiasing: true, + language: 'language', + limit: 0, + partialStreet: 'partialStreet', + postalOrZipFilter: 'postalOrZipFilter', + standardFallback: true, + streetFilter: 'streetFilter', + useEnhancedChinaDataset: true, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(PostGrid.NotFoundError); + }); + // Mock server tests are disabled test.skip('verify: only required params', async () => { const responsePromise = client.intlAddressVerification.verify({ diff --git a/tests/api-resources/print-mail/order-profiles/postcards.test.ts b/tests/api-resources/print-mail/boxes.test.ts similarity index 71% rename from tests/api-resources/print-mail/order-profiles/postcards.test.ts rename to tests/api-resources/print-mail/boxes.test.ts index ca7dc67..e48586d 100644 --- a/tests/api-resources/print-mail/order-profiles/postcards.test.ts +++ b/tests/api-resources/print-mail/boxes.test.ts @@ -8,10 +8,22 @@ const client = new PostGrid({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource postcards', () => { +describe('resource boxes', () => { // Mock server tests are disabled test.skip('create: only required params', async () => { - const responsePromise = client.printMail.orderProfiles.postcards.create({ size: '6x4' }); + const responsePromise = client.printMail.boxes.create({ + cheques: [ + { + amount: 5000, + bankAccount: 'bank_abc', + from: 'contact_456', + number: 1042, + to: 'contact_123', + }, + ], + from: 'contact_456', + to: 'contact_123', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,46 +35,33 @@ describe('resource postcards', () => { // Mock server tests are disabled test.skip('create: required and optional params', async () => { - const response = await client.printMail.orderProfiles.postcards.create({ - size: '6x4', - expand: ['string'], - backTemplate: 'backTemplate', + const response = await client.printMail.boxes.create({ + cheques: [ + { + amount: 5000, + bankAccount: 'bank_abc', + from: 'contact_456', + number: 1042, + to: 'contact_123', + logoURL: 'https://example.com', + memo: 'memo', + mergeVariables: { foo: 'bar' }, + messageTemplate: 'messageTemplate', + }, + ], + from: 'contact_456', + to: 'contact_123', description: 'description', - frontTemplate: 'frontTemplate', mailingClass: 'first_class', mergeVariables: { foo: 'bar' }, - metadata: { foo: 'string' }, - pdf: 'https://example.com', + metadata: { foo: 'bar' }, + sendDate: '2019-12-27T18:11:19.117Z', }); }); // Mock server tests are disabled test.skip('retrieve', async () => { - const responsePromise = client.printMail.orderProfiles.postcards.retrieve('id'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // Mock server tests are disabled - test.skip('retrieve: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.printMail.orderProfiles.postcards.retrieve( - 'id', - { expand: ['string'] }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(PostGrid.NotFoundError); - }); - - // Mock server tests are disabled - test.skip('update', async () => { - const responsePromise = client.printMail.orderProfiles.postcards.update('id', {}); + const responsePromise = client.printMail.boxes.retrieve('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -74,7 +73,7 @@ describe('resource postcards', () => { // Mock server tests are disabled test.skip('list', async () => { - const responsePromise = client.printMail.orderProfiles.postcards.list(); + const responsePromise = client.printMail.boxes.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -88,7 +87,7 @@ describe('resource postcards', () => { test.skip('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.printMail.orderProfiles.postcards.list( + client.printMail.boxes.list( { limit: 0, search: 'search', @@ -101,7 +100,19 @@ describe('resource postcards', () => { // Mock server tests are disabled test.skip('delete', async () => { - const responsePromise = client.printMail.orderProfiles.postcards.delete('id'); + const responsePromise = client.printMail.boxes.delete('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('progressions', async () => { + const responsePromise = client.printMail.boxes.progressions('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; diff --git a/tests/api-resources/print-mail/campaigns.test.ts b/tests/api-resources/print-mail/campaigns.test.ts index e447922..7828398 100644 --- a/tests/api-resources/print-mail/campaigns.test.ts +++ b/tests/api-resources/print-mail/campaigns.test.ts @@ -25,14 +25,75 @@ describe('resource campaigns', () => { test.skip('create: required and optional params', async () => { const response = await client.printMail.campaigns.create({ mailingList: 'mailingList', - chequeProfile: 'chequeProfile', + cheque: { + bankAccount: 'bankAccount', + currencyCode: 'CAD', + description: 'description', + envelope: 'envelope', + letterPDF: 'U3RhaW5sZXNzIHJvY2tz', + letterSettings: { color: true }, + letterTemplate: 'letterTemplate', + logo: 'https://example.com', + mailingClass: 'first_class', + memo: 'memo', + mergeVariables: { foo: 'bar' }, + message: 'message', + metadata: { foo: 'string' }, + returnEnvelope: 'returnEnvelope', + size: 'us_letter', + }, defaultSenderContact: 'defaultSenderContact', description: 'description', - letterProfile: 'letterProfile', + letter: { + addressPlacement: 'top_first_page', + attachedPDF: { file: 'https://example.com', placement: 'before_template' }, + color: true, + description: 'description', + doubleSided: true, + envelope: 'envelope', + envelopeType: 'standard_double_window', + mailingClass: 'first_class', + mergeVariables: { foo: 'bar' }, + metadata: { foo: 'string' }, + pdf: 'https://example.com', + perforatedPage: 1, + returnEnvelope: 'returnEnvelope', + size: 'us_letter', + template: 'template', + }, metadata: { foo: 'bar' }, - postcardProfile: 'postcardProfile', - selfMailerProfile: 'selfMailerProfile', + postcard: { + backTemplate: 'backTemplate', + description: 'description', + frontTemplate: 'frontTemplate', + mailingClass: 'first_class', + mergeVariables: { foo: 'bar' }, + metadata: { foo: 'string' }, + paper: 'premium_paper_L6fw2k_N_j', + pdf: 'https://example.com', + size: '6x4', + }, + selfMailer: { + description: 'description', + insideTemplate: 'insideTemplate', + mailingClass: 'first_class', + mergeVariables: { foo: 'bar' }, + metadata: { foo: 'string' }, + outsideTemplate: 'outsideTemplate', + pdf: 'https://example.com', + size: '8.5x11_bifold', + }, sendDate: '2019-12-27T18:11:19.117Z', + snapPack: { + description: 'description', + insideTemplate: 'insideTemplate', + mailingClass: 'first_class', + mergeVariables: { foo: 'bar' }, + metadata: { foo: 'string' }, + outsideTemplate: 'outsideTemplate', + pdf: 'https://example.com', + size: '8.5x11_bifold_v', + }, 'idempotency-key': 'idempotency-key', }); }); diff --git a/tests/api-resources/print-mail/cheques.test.ts b/tests/api-resources/print-mail/cheques.test.ts index eb19bc6..5d1d4b9 100644 --- a/tests/api-resources/print-mail/cheques.test.ts +++ b/tests/api-resources/print-mail/cheques.test.ts @@ -118,6 +118,35 @@ describe('resource cheques', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // Mock server tests are disabled + test.skip('cancel: only required params', async () => { + const responsePromise = client.printMail.cheques.cancel('id', { note: 'Cancelling this cheque' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('cancel: required and optional params', async () => { + const response = await client.printMail.cheques.cancel('id', { note: 'Cancelling this cheque' }); + }); + + // Mock server tests are disabled + test.skip('progress', async () => { + const responsePromise = client.printMail.cheques.progress('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // Mock server tests are disabled test.skip('retrieveURL', async () => { const responsePromise = client.printMail.cheques.retrieveURL('id'); diff --git a/tests/api-resources/print-mail/letters.test.ts b/tests/api-resources/print-mail/letters.test.ts index c0665e2..7961fed 100644 --- a/tests/api-resources/print-mail/letters.test.ts +++ b/tests/api-resources/print-mail/letters.test.ts @@ -155,6 +155,35 @@ describe('resource letters', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // Mock server tests are disabled + test.skip('cancel: only required params', async () => { + const responsePromise = client.printMail.letters.cancel('id', { note: 'Cancelling this letter' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('cancel: required and optional params', async () => { + const response = await client.printMail.letters.cancel('id', { note: 'Cancelling this letter' }); + }); + + // Mock server tests are disabled + test.skip('progress', async () => { + const responsePromise = client.printMail.letters.progress('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // Mock server tests are disabled test.skip('retrieveURL', async () => { const responsePromise = client.printMail.letters.retrieveURL('id'); diff --git a/tests/api-resources/print-mail/postcards.test.ts b/tests/api-resources/print-mail/postcards.test.ts index 883ae27..f0d13ec 100644 --- a/tests/api-resources/print-mail/postcards.test.ts +++ b/tests/api-resources/print-mail/postcards.test.ts @@ -76,6 +76,7 @@ describe('resource postcards', () => { mailingClass: 'first_class', mergeVariables: { foo: 'bar' }, metadata: { foo: 'bar' }, + paper: 'premium_paper_L6fw2k_N_j', sendDate: '2019-12-27T18:11:19.117Z', }); }); @@ -131,6 +132,35 @@ describe('resource postcards', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // Mock server tests are disabled + test.skip('cancel: only required params', async () => { + const responsePromise = client.printMail.postcards.cancel('id', { note: 'Cancelling this postcard' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('cancel: required and optional params', async () => { + const response = await client.printMail.postcards.cancel('id', { note: 'Cancelling this postcard' }); + }); + + // Mock server tests are disabled + test.skip('progress', async () => { + const responsePromise = client.printMail.postcards.progress('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // Mock server tests are disabled test.skip('retrieveURL', async () => { const responsePromise = client.printMail.postcards.retrieveURL('id'); diff --git a/tests/api-resources/print-mail/self-mailers.test.ts b/tests/api-resources/print-mail/self-mailers.test.ts index 9ed806b..f59b633 100644 --- a/tests/api-resources/print-mail/self-mailers.test.ts +++ b/tests/api-resources/print-mail/self-mailers.test.ts @@ -136,6 +136,18 @@ describe('resource selfMailers', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // Mock server tests are disabled + test.skip('progress', async () => { + const responsePromise = client.printMail.selfMailers.progress('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // Mock server tests are disabled test.skip('retrieveURL', async () => { const responsePromise = client.printMail.selfMailers.retrieveURL('id'); diff --git a/tests/api-resources/print-mail/order-profiles/self-mailers.test.ts b/tests/api-resources/print-mail/snap-packs.test.ts similarity index 52% rename from tests/api-resources/print-mail/order-profiles/self-mailers.test.ts rename to tests/api-resources/print-mail/snap-packs.test.ts index fcbafc2..202d5d1 100644 --- a/tests/api-resources/print-mail/order-profiles/self-mailers.test.ts +++ b/tests/api-resources/print-mail/snap-packs.test.ts @@ -8,10 +8,24 @@ const client = new PostGrid({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource selfMailers', () => { +describe('resource snapPacks', () => { // Mock server tests are disabled test.skip('create: only required params', async () => { - const responsePromise = client.printMail.orderProfiles.selfMailers.create({ size: '8.5x11_bifold' }); + const responsePromise = client.printMail.snapPacks.create({ + from: { + addressLine1: 'addressLine1', + countryCode: 'countryCode', + firstName: 'firstName', + }, + insideHTML: 'insideHTML', + outsideHTML: 'outsideHTML', + size: '8.5x11_bifold_v', + to: { + addressLine1: 'addressLine1', + countryCode: 'countryCode', + firstName: 'firstName', + }, + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,22 +37,69 @@ describe('resource selfMailers', () => { // Mock server tests are disabled test.skip('create: required and optional params', async () => { - const response = await client.printMail.orderProfiles.selfMailers.create({ - size: '8.5x11_bifold', - expand: ['string'], + const response = await client.printMail.snapPacks.create({ + from: { + addressLine1: 'addressLine1', + countryCode: 'countryCode', + firstName: 'firstName', + addressLine2: 'addressLine2', + city: 'city', + companyName: 'companyName', + description: 'description', + email: 'email', + forceVerifiedStatus: true, + jobTitle: 'jobTitle', + lastName: 'lastName', + metadata: { foo: 'bar' }, + phoneNumber: 'phoneNumber', + postalOrZip: 'postalOrZip', + provinceOrState: 'provinceOrState', + skipVerification: true, + }, + insideHTML: 'insideHTML', + outsideHTML: 'outsideHTML', + size: '8.5x11_bifold_v', + to: { + addressLine1: 'addressLine1', + countryCode: 'countryCode', + firstName: 'firstName', + addressLine2: 'addressLine2', + city: 'city', + companyName: 'companyName', + description: 'description', + email: 'email', + forceVerifiedStatus: true, + jobTitle: 'jobTitle', + lastName: 'lastName', + metadata: { foo: 'bar' }, + phoneNumber: 'phoneNumber', + postalOrZip: 'postalOrZip', + provinceOrState: 'provinceOrState', + skipVerification: true, + }, description: 'description', - insideTemplate: 'insideTemplate', mailingClass: 'first_class', mergeVariables: { foo: 'bar' }, - metadata: { foo: 'string' }, - outsideTemplate: 'outsideTemplate', - pdf: 'https://example.com', + metadata: { foo: 'bar' }, + sendDate: '2019-12-27T18:11:19.117Z', }); }); // Mock server tests are disabled test.skip('retrieve', async () => { - const responsePromise = client.printMail.orderProfiles.selfMailers.retrieve('id'); + const responsePromise = client.printMail.snapPacks.retrieve('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('list', async () => { + const responsePromise = client.printMail.snapPacks.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -49,22 +110,23 @@ describe('resource selfMailers', () => { }); // Mock server tests are disabled - test.skip('retrieve: request options and params are passed correctly', async () => { + test.skip('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.printMail.orderProfiles.selfMailers.retrieve( - 'id', - { expand: ['string'] }, + client.printMail.snapPacks.list( + { + limit: 0, + search: 'search', + skip: 0, + }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(PostGrid.NotFoundError); }); // Mock server tests are disabled - test.skip('update: only required params', async () => { - const responsePromise = client.printMail.orderProfiles.selfMailers.update('id', { - size: '8.5x11_bifold', - }); + test.skip('delete', async () => { + const responsePromise = client.printMail.snapPacks.delete('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -75,23 +137,8 @@ describe('resource selfMailers', () => { }); // Mock server tests are disabled - test.skip('update: required and optional params', async () => { - const response = await client.printMail.orderProfiles.selfMailers.update('id', { - size: '8.5x11_bifold', - expand: ['string'], - description: 'description', - insideTemplate: 'insideTemplate', - mailingClass: 'first_class', - mergeVariables: { foo: 'bar' }, - metadata: { foo: 'string' }, - outsideTemplate: 'outsideTemplate', - pdf: 'https://example.com', - }); - }); - - // Mock server tests are disabled - test.skip('list', async () => { - const responsePromise = client.printMail.orderProfiles.selfMailers.list(); + test.skip('progressions', async () => { + const responsePromise = client.printMail.snapPacks.progressions('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -102,23 +149,10 @@ describe('resource selfMailers', () => { }); // Mock server tests are disabled - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.printMail.orderProfiles.selfMailers.list( - { - limit: 0, - search: 'search', - skip: 0, - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(PostGrid.NotFoundError); - }); - - // Mock server tests are disabled - test.skip('delete', async () => { - const responsePromise = client.printMail.orderProfiles.selfMailers.delete('id'); + test.skip('retrieveCapabilities: only required params', async () => { + const responsePromise = client.printMail.snapPacks.retrieveCapabilities({ + returnCountryCode: 'returnCountryCode', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -127,4 +161,13 @@ describe('resource selfMailers', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // Mock server tests are disabled + test.skip('retrieveCapabilities: required and optional params', async () => { + const response = await client.printMail.snapPacks.retrieveCapabilities({ + returnCountryCode: 'returnCountryCode', + destinationCountryCode: 'destinationCountryCode', + mailingList: 'mailingList', + }); + }); }); diff --git a/tests/api-resources/print-mail/sub-organizations.test.ts b/tests/api-resources/print-mail/sub-organizations.test.ts index 6b1aca0..965f319 100644 --- a/tests/api-resources/print-mail/sub-organizations.test.ts +++ b/tests/api-resources/print-mail/sub-organizations.test.ts @@ -10,20 +10,8 @@ const client = new PostGrid({ describe('resource subOrganizations', () => { // Mock server tests are disabled - test.skip('retrieve', async () => { - const responsePromise = client.printMail.subOrganizations.retrieve('id'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // Mock server tests are disabled - test.skip('update: only required params', async () => { - const responsePromise = client.printMail.subOrganizations.update({ + test.skip('create: only required params', async () => { + const responsePromise = client.printMail.subOrganizations.create({ countryCode: 'CA', email: 'suborg@postgrid.com', name: 'Calvin', @@ -40,8 +28,8 @@ describe('resource subOrganizations', () => { }); // Mock server tests are disabled - test.skip('update: required and optional params', async () => { - const response = await client.printMail.subOrganizations.update({ + test.skip('create: required and optional params', async () => { + const response = await client.printMail.subOrganizations.create({ countryCode: 'CA', email: 'suborg@postgrid.com', name: 'Calvin', @@ -51,6 +39,18 @@ describe('resource subOrganizations', () => { }); }); + // Mock server tests are disabled + test.skip('retrieve', async () => { + const responsePromise = client.printMail.subOrganizations.retrieve('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.printMail.subOrganizations.list(); diff --git a/tests/api-resources/print-mail/targeted-list-builds/filters.test.ts b/tests/api-resources/print-mail/targeted-list-builds/filters.test.ts new file mode 100644 index 0000000..f3e589e --- /dev/null +++ b/tests/api-resources/print-mail/targeted-list-builds/filters.test.ts @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import PostGrid from 'postgrid-node'; + +const client = new PostGrid({ + addressVerificationAPIKey: 'My Address Verification API Key', + printMailAPIKey: 'My Print Mail API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource filters', () => { + // Mock server tests are disabled + test.skip('autocomplete: only required params', async () => { + const responsePromise = client.printMail.targetedListBuilds.filters.autocomplete({ field: 'industry' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('autocomplete: required and optional params', async () => { + const response = await client.printMail.targetedListBuilds.filters.autocomplete({ + field: 'industry', + size: 5, + text: 'soft', + }); + }); +}); diff --git a/tests/api-resources/print-mail/order-profiles/letters.test.ts b/tests/api-resources/print-mail/targeted-list-builds/targeted-list-builds.test.ts similarity index 63% rename from tests/api-resources/print-mail/order-profiles/letters.test.ts rename to tests/api-resources/print-mail/targeted-list-builds/targeted-list-builds.test.ts index 465cc30..d40b049 100644 --- a/tests/api-resources/print-mail/order-profiles/letters.test.ts +++ b/tests/api-resources/print-mail/targeted-list-builds/targeted-list-builds.test.ts @@ -8,10 +8,10 @@ const client = new PostGrid({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource letters', () => { +describe('resource targetedListBuilds', () => { // Mock server tests are disabled - test.skip('create: only required params', async () => { - const responsePromise = client.printMail.orderProfiles.letters.create({ size: 'us_letter' }); + test.skip('create', async () => { + const responsePromise = client.printMail.targetedListBuilds.create({}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,30 +21,9 @@ describe('resource letters', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Mock server tests are disabled - test.skip('create: required and optional params', async () => { - const response = await client.printMail.orderProfiles.letters.create({ - size: 'us_letter', - expand: ['string'], - addressPlacement: 'top_first_page', - attachedPDF: { file: 'https://example.com', placement: 'before_template' }, - color: true, - description: 'Monthly Newsletter Profile', - doubleSided: true, - envelope: 'envelope', - mailingClass: 'first_class', - mergeVariables: { salutation: 'bar' }, - metadata: { campaign: 'Q1 Newsletter' }, - pdf: 'https://example.com', - perforatedPage: 1, - returnEnvelope: 'returnEnvelope', - template: 'template_abc', - }); - }); - // Mock server tests are disabled test.skip('retrieve', async () => { - const responsePromise = client.printMail.orderProfiles.letters.retrieve('id'); + const responsePromise = client.printMail.targetedListBuilds.retrieve('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -54,21 +33,9 @@ describe('resource letters', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Mock server tests are disabled - test.skip('retrieve: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.printMail.orderProfiles.letters.retrieve( - 'id', - { expand: ['string'] }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(PostGrid.NotFoundError); - }); - // Mock server tests are disabled test.skip('update', async () => { - const responsePromise = client.printMail.orderProfiles.letters.update('id', {}); + const responsePromise = client.printMail.targetedListBuilds.update('id', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -80,7 +47,7 @@ describe('resource letters', () => { // Mock server tests are disabled test.skip('list', async () => { - const responsePromise = client.printMail.orderProfiles.letters.list(); + const responsePromise = client.printMail.targetedListBuilds.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -94,7 +61,7 @@ describe('resource letters', () => { test.skip('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.printMail.orderProfiles.letters.list( + client.printMail.targetedListBuilds.list( { limit: 0, search: 'search', @@ -107,7 +74,19 @@ describe('resource letters', () => { // Mock server tests are disabled test.skip('delete', async () => { - const responsePromise = client.printMail.orderProfiles.letters.delete('id'); + const responsePromise = client.printMail.targetedListBuilds.delete('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('confirm', async () => { + const responsePromise = client.printMail.targetedListBuilds.confirm('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; diff --git a/tests/api-resources/print-mail/template-editor-sessions.test.ts b/tests/api-resources/print-mail/template-editor-sessions.test.ts new file mode 100644 index 0000000..5009fe1 --- /dev/null +++ b/tests/api-resources/print-mail/template-editor-sessions.test.ts @@ -0,0 +1,79 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import PostGrid from 'postgrid-node'; + +const client = new PostGrid({ + addressVerificationAPIKey: 'My Address Verification API Key', + printMailAPIKey: 'My Print Mail API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource templateEditorSessions', () => { + // Mock server tests are disabled + test.skip('create: only required params', async () => { + const responsePromise = client.printMail.templateEditorSessions.create({ + template: 'template_eYxcbMKPZEZPk71ZJPA6Yz', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('create: required and optional params', async () => { + const response = await client.printMail.templateEditorSessions.create({ + template: 'template_eYxcbMKPZEZPk71ZJPA6Yz', + backURL: 'https://postgrid.com', + styles: { + canvas: { backgroundColor: 'backgroundColor' }, + panelText: { color: 'color' }, + saveButton: { backgroundColor: 'backgroundColor', textColor: 'textColor' }, + }, + title: 'My Editor Session', + trackers: ['tracker_123456789abcdefghijklmnopqrstuvwxyz'], + }); + }); + + // Mock server tests are disabled + test.skip('list', async () => { + const responsePromise = client.printMail.templateEditorSessions.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.printMail.templateEditorSessions.list( + { + limit: 0, + search: 'search', + skip: 0, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(PostGrid.NotFoundError); + }); + + // Mock server tests are disabled + test.skip('delete', async () => { + const responsePromise = client.printMail.templateEditorSessions.delete('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); +}); diff --git a/tests/api-resources/print-mail/order-profiles/cheques.test.ts b/tests/api-resources/print-mail/trackers.test.ts similarity index 67% rename from tests/api-resources/print-mail/order-profiles/cheques.test.ts rename to tests/api-resources/print-mail/trackers.test.ts index 5d3ed8f..c3ceb8b 100644 --- a/tests/api-resources/print-mail/order-profiles/cheques.test.ts +++ b/tests/api-resources/print-mail/trackers.test.ts @@ -8,12 +8,12 @@ const client = new PostGrid({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource cheques', () => { +describe('resource trackers', () => { // Mock server tests are disabled test.skip('create: only required params', async () => { - const responsePromise = client.printMail.orderProfiles.cheques.create({ - bankAccount: 'bankAccount', - size: 'us_letter', + const responsePromise = client.printMail.trackers.create({ + redirectURLTemplate: 'https://postgrid.com?name={{to.firstName}}', + urlExpireAfterDays: 30, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -26,26 +26,17 @@ describe('resource cheques', () => { // Mock server tests are disabled test.skip('create: required and optional params', async () => { - const response = await client.printMail.orderProfiles.cheques.create({ - bankAccount: 'bankAccount', - size: 'us_letter', - expand: ['string'], - currencyCode: 'CAD', + const response = await client.printMail.trackers.create({ + redirectURLTemplate: 'https://postgrid.com?name={{to.firstName}}', + urlExpireAfterDays: 30, description: 'description', - letterPDF: 'U3RhaW5sZXNzIHJvY2tz', - letterTemplate: 'letterTemplate', - logo: 'https://example.com', - mailingClass: 'first_class', - memo: 'memo', - mergeVariables: { foo: 'bar' }, - message: 'message', - metadata: { foo: 'string' }, + metadata: { foo: 'bar' }, }); }); // Mock server tests are disabled test.skip('retrieve', async () => { - const responsePromise = client.printMail.orderProfiles.cheques.retrieve('id'); + const responsePromise = client.printMail.trackers.retrieve('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -55,23 +46,11 @@ describe('resource cheques', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Mock server tests are disabled - test.skip('retrieve: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.printMail.orderProfiles.cheques.retrieve( - 'id', - { expand: ['string'] }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(PostGrid.NotFoundError); - }); - // Mock server tests are disabled test.skip('update: only required params', async () => { - const responsePromise = client.printMail.orderProfiles.cheques.update('id', { - bankAccount: 'bankAccount', - size: 'us_letter', + const responsePromise = client.printMail.trackers.update('id', { + redirectURLTemplate: 'https://postgrid.com?firstName={{to.firstName}}', + urlExpireAfterDays: 90, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -84,26 +63,17 @@ describe('resource cheques', () => { // Mock server tests are disabled test.skip('update: required and optional params', async () => { - const response = await client.printMail.orderProfiles.cheques.update('id', { - bankAccount: 'bankAccount', - size: 'us_letter', - expand: ['string'], - currencyCode: 'CAD', + const response = await client.printMail.trackers.update('id', { + redirectURLTemplate: 'https://postgrid.com?firstName={{to.firstName}}', + urlExpireAfterDays: 90, description: 'description', - letterPDF: 'U3RhaW5sZXNzIHJvY2tz', - letterTemplate: 'letterTemplate', - logo: 'https://example.com', - mailingClass: 'first_class', - memo: 'memo', - mergeVariables: { foo: 'bar' }, - message: 'message', - metadata: { foo: 'string' }, + metadata: { foo: 'bar' }, }); }); // Mock server tests are disabled test.skip('list', async () => { - const responsePromise = client.printMail.orderProfiles.cheques.list(); + const responsePromise = client.printMail.trackers.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -117,7 +87,7 @@ describe('resource cheques', () => { test.skip('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.printMail.orderProfiles.cheques.list( + client.printMail.trackers.list( { limit: 0, search: 'search', @@ -130,7 +100,7 @@ describe('resource cheques', () => { // Mock server tests are disabled test.skip('delete', async () => { - const responsePromise = client.printMail.orderProfiles.cheques.delete('id'); + const responsePromise = client.printMail.trackers.delete('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -139,4 +109,32 @@ describe('resource cheques', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // Mock server tests are disabled + test.skip('retrieveVisits', async () => { + const responsePromise = client.printMail.trackers.retrieveVisits('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retrieveVisits: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.printMail.trackers.retrieveVisits( + 'id', + { + limit: 0, + search: 'search', + skip: 0, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(PostGrid.NotFoundError); + }); }); diff --git a/tests/api-resources/print-mail/virtual-mailboxes/items.test.ts b/tests/api-resources/print-mail/virtual-mailboxes/items.test.ts new file mode 100644 index 0000000..95a8919 --- /dev/null +++ b/tests/api-resources/print-mail/virtual-mailboxes/items.test.ts @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import PostGrid from 'postgrid-node'; + +const client = new PostGrid({ + addressVerificationAPIKey: 'My Address Verification API Key', + printMailAPIKey: 'My Print Mail API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource items', () => { + // Mock server tests are disabled + test.skip('create', async () => { + const responsePromise = client.printMail.virtualMailboxes.items.create('id', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retrieve: only required params', async () => { + const responsePromise = client.printMail.virtualMailboxes.items.retrieve('itemID', { id: 'id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retrieve: required and optional params', async () => { + const response = await client.printMail.virtualMailboxes.items.retrieve('itemID', { id: 'id' }); + }); + + // Mock server tests are disabled + test.skip('list', async () => { + const responsePromise = client.printMail.virtualMailboxes.items.list('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.printMail.virtualMailboxes.items.list( + 'id', + { + limit: 0, + search: 'search', + skip: 0, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(PostGrid.NotFoundError); + }); +}); diff --git a/tests/api-resources/print-mail/virtual-mailboxes/virtual-mailboxes.test.ts b/tests/api-resources/print-mail/virtual-mailboxes/virtual-mailboxes.test.ts new file mode 100644 index 0000000..86913bc --- /dev/null +++ b/tests/api-resources/print-mail/virtual-mailboxes/virtual-mailboxes.test.ts @@ -0,0 +1,82 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import PostGrid from 'postgrid-node'; + +const client = new PostGrid({ + addressVerificationAPIKey: 'My Address Verification API Key', + printMailAPIKey: 'My Print Mail API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource virtualMailboxes', () => { + // Mock server tests are disabled + test.skip('create: only required params', async () => { + const responsePromise = client.printMail.virtualMailboxes.create({ countryCode: 'US' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('create: required and optional params', async () => { + const response = await client.printMail.virtualMailboxes.create({ + countryCode: 'US', + capabilities: { envelopeScans: true, forwardMailTo: 'contact_pxd7wnnD1xY6H6etKNvjb4' }, + }); + }); + + // Mock server tests are disabled + test.skip('retrieve', async () => { + const responsePromise = client.printMail.virtualMailboxes.retrieve('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('list', async () => { + const responsePromise = client.printMail.virtualMailboxes.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.printMail.virtualMailboxes.list( + { + limit: 0, + search: 'search', + skip: 0, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(PostGrid.NotFoundError); + }); + + // Mock server tests are disabled + test.skip('retrieveAddress', async () => { + const responsePromise = client.printMail.virtualMailboxes.retrieveAddress('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); +}); diff --git a/tests/qs/empty-keys-cases.ts b/tests/qs/empty-keys-cases.ts deleted file mode 100644 index ea2c1b0..0000000 --- a/tests/qs/empty-keys-cases.ts +++ /dev/null @@ -1,271 +0,0 @@ -export const empty_test_cases = [ - { - input: '&', - with_empty_keys: {}, - stringify_output: { - brackets: '', - indices: '', - repeat: '', - }, - no_empty_keys: {}, - }, - { - input: '&&', - with_empty_keys: {}, - stringify_output: { - brackets: '', - indices: '', - repeat: '', - }, - no_empty_keys: {}, - }, - { - input: '&=', - with_empty_keys: { '': '' }, - stringify_output: { - brackets: '=', - indices: '=', - repeat: '=', - }, - no_empty_keys: {}, - }, - { - input: '&=&', - with_empty_keys: { '': '' }, - stringify_output: { - brackets: '=', - indices: '=', - repeat: '=', - }, - no_empty_keys: {}, - }, - { - input: '&=&=', - with_empty_keys: { '': ['', ''] }, - stringify_output: { - brackets: '[]=&[]=', - indices: '[0]=&[1]=', - repeat: '=&=', - }, - no_empty_keys: {}, - }, - { - input: '&=&=&', - with_empty_keys: { '': ['', ''] }, - stringify_output: { - brackets: '[]=&[]=', - indices: '[0]=&[1]=', - repeat: '=&=', - }, - no_empty_keys: {}, - }, - { - input: '=', - with_empty_keys: { '': '' }, - no_empty_keys: {}, - stringify_output: { - brackets: '=', - indices: '=', - repeat: '=', - }, - }, - { - input: '=&', - with_empty_keys: { '': '' }, - stringify_output: { - brackets: '=', - indices: '=', - repeat: '=', - }, - no_empty_keys: {}, - }, - { - input: '=&&&', - with_empty_keys: { '': '' }, - stringify_output: { - brackets: '=', - indices: '=', - repeat: '=', - }, - no_empty_keys: {}, - }, - { - input: '=&=&=&', - with_empty_keys: { '': ['', '', ''] }, - stringify_output: { - brackets: '[]=&[]=&[]=', - indices: '[0]=&[1]=&[2]=', - repeat: '=&=&=', - }, - no_empty_keys: {}, - }, - { - input: '=&a[]=b&a[1]=c', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: '=a', - with_empty_keys: { '': 'a' }, - no_empty_keys: {}, - stringify_output: { - brackets: '=a', - indices: '=a', - repeat: '=a', - }, - }, - { - input: 'a==a', - with_empty_keys: { a: '=a' }, - no_empty_keys: { a: '=a' }, - stringify_output: { - brackets: 'a==a', - indices: 'a==a', - repeat: 'a==a', - }, - }, - { - input: '=&a[]=b', - with_empty_keys: { '': '', a: ['b'] }, - stringify_output: { - brackets: '=&a[]=b', - indices: '=&a[0]=b', - repeat: '=&a=b', - }, - no_empty_keys: { a: ['b'] }, - }, - { - input: '=&a[]=b&a[]=c&a[2]=d', - with_empty_keys: { '': '', a: ['b', 'c', 'd'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c&a[]=d', - indices: '=&a[0]=b&a[1]=c&a[2]=d', - repeat: '=&a=b&a=c&a=d', - }, - no_empty_keys: { a: ['b', 'c', 'd'] }, - }, - { - input: '=a&=b', - with_empty_keys: { '': ['a', 'b'] }, - stringify_output: { - brackets: '[]=a&[]=b', - indices: '[0]=a&[1]=b', - repeat: '=a&=b', - }, - no_empty_keys: {}, - }, - { - input: '=a&foo=b', - with_empty_keys: { '': 'a', foo: 'b' }, - no_empty_keys: { foo: 'b' }, - stringify_output: { - brackets: '=a&foo=b', - indices: '=a&foo=b', - repeat: '=a&foo=b', - }, - }, - { - input: 'a[]=b&a=c&=', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: 'a[]=b&a=c&=', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: 'a[0]=b&a=c&=', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: 'a=b&a[]=c&=', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: 'a=b&a[0]=c&=', - with_empty_keys: { '': '', a: ['b', 'c'] }, - stringify_output: { - brackets: '=&a[]=b&a[]=c', - indices: '=&a[0]=b&a[1]=c', - repeat: '=&a=b&a=c', - }, - no_empty_keys: { a: ['b', 'c'] }, - }, - { - input: '[]=a&[]=b& []=1', - with_empty_keys: { '': ['a', 'b'], ' ': ['1'] }, - stringify_output: { - brackets: '[]=a&[]=b& []=1', - indices: '[0]=a&[1]=b& [0]=1', - repeat: '=a&=b& =1', - }, - no_empty_keys: { 0: 'a', 1: 'b', ' ': ['1'] }, - }, - { - input: '[0]=a&[1]=b&a[0]=1&a[1]=2', - with_empty_keys: { '': ['a', 'b'], a: ['1', '2'] }, - no_empty_keys: { 0: 'a', 1: 'b', a: ['1', '2'] }, - stringify_output: { - brackets: '[]=a&[]=b&a[]=1&a[]=2', - indices: '[0]=a&[1]=b&a[0]=1&a[1]=2', - repeat: '=a&=b&a=1&a=2', - }, - }, - { - input: '[deep]=a&[deep]=2', - with_empty_keys: { '': { deep: ['a', '2'] } }, - stringify_output: { - brackets: '[deep][]=a&[deep][]=2', - indices: '[deep][0]=a&[deep][1]=2', - repeat: '[deep]=a&[deep]=2', - }, - no_empty_keys: { deep: ['a', '2'] }, - }, - { - input: '%5B0%5D=a&%5B1%5D=b', - with_empty_keys: { '': ['a', 'b'] }, - stringify_output: { - brackets: '[]=a&[]=b', - indices: '[0]=a&[1]=b', - repeat: '=a&=b', - }, - no_empty_keys: { 0: 'a', 1: 'b' }, - }, -] satisfies { - input: string; - with_empty_keys: Record; - stringify_output: { - brackets: string; - indices: string; - repeat: string; - }; - no_empty_keys: Record; -}[]; diff --git a/tests/qs/stringify.test.ts b/tests/qs/stringify.test.ts deleted file mode 100644 index d4a3849..0000000 --- a/tests/qs/stringify.test.ts +++ /dev/null @@ -1,2232 +0,0 @@ -import iconv from 'iconv-lite'; -import { stringify } from 'postgrid-node/internal/qs'; -import { encode } from 'postgrid-node/internal/qs/utils'; -import { StringifyOptions } from 'postgrid-node/internal/qs/types'; -import { empty_test_cases } from './empty-keys-cases'; -import assert from 'assert'; - -describe('stringify()', function () { - test('stringifies a querystring object', function () { - expect(stringify({ a: 'b' })).toBe('a=b'); - expect(stringify({ a: 1 })).toBe('a=1'); - expect(stringify({ a: 1, b: 2 })).toBe('a=1&b=2'); - expect(stringify({ a: 'A_Z' })).toBe('a=A_Z'); - expect(stringify({ a: '€' })).toBe('a=%E2%82%AC'); - expect(stringify({ a: '' })).toBe('a=%EE%80%80'); - expect(stringify({ a: 'א' })).toBe('a=%D7%90'); - expect(stringify({ a: '𐐷' })).toBe('a=%F0%90%90%B7'); - }); - - test('stringifies falsy values', function () { - expect(stringify(undefined)).toBe(''); - expect(stringify(null)).toBe(''); - expect(stringify(null, { strictNullHandling: true })).toBe(''); - expect(stringify(false)).toBe(''); - expect(stringify(0)).toBe(''); - }); - - test('stringifies symbols', function () { - expect(stringify(Symbol.iterator)).toBe(''); - expect(stringify([Symbol.iterator])).toBe('0=Symbol%28Symbol.iterator%29'); - expect(stringify({ a: Symbol.iterator })).toBe('a=Symbol%28Symbol.iterator%29'); - expect(stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe( - 'a[]=Symbol%28Symbol.iterator%29', - ); - }); - - test('stringifies bigints', function () { - var three = BigInt(3); - // @ts-expect-error - var encodeWithN = function (value, defaultEncoder, charset) { - var result = defaultEncoder(value, defaultEncoder, charset); - return typeof value === 'bigint' ? result + 'n' : result; - }; - - expect(stringify(three)).toBe(''); - expect(stringify([three])).toBe('0=3'); - expect(stringify([three], { encoder: encodeWithN })).toBe('0=3n'); - expect(stringify({ a: three })).toBe('a=3'); - expect(stringify({ a: three }, { encoder: encodeWithN })).toBe('a=3n'); - expect(stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe('a[]=3'); - expect( - stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }), - ).toBe('a[]=3n'); - }); - - test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function () { - expect( - stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { allowDots: false, encodeDotInKeys: false }), - ).toBe('name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe'); - expect( - stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: false }), - ).toBe('name.obj.first=John&name.obj.last=Doe'); - expect( - stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { allowDots: false, encodeDotInKeys: true }), - ).toBe('name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe'); - expect( - stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true }), - ).toBe('name%252Eobj.first=John&name%252Eobj.last=Doe'); - - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { allowDots: false, encodeDotInKeys: false }, - // ), - // 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe', - // 'with allowDots false and encodeDotInKeys false', - // ); - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { allowDots: true, encodeDotInKeys: false }, - // ), - // 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', - // 'with allowDots false and encodeDotInKeys false', - // ); - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { allowDots: false, encodeDotInKeys: true }, - // ), - // 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe', - // 'with allowDots false and encodeDotInKeys true', - // ); - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { allowDots: true, encodeDotInKeys: true }, - // ), - // 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - // 'with allowDots true and encodeDotInKeys true', - // ); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: false }, - ), - ).toBe('name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe'); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: false }, - ), - ).toBe('name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe'); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: true }, - ), - ).toBe('name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe'); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: true }, - ), - ).toBe('name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe'); - }); - - test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function () { - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { encodeDotInKeys: true }, - // ), - // 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - // 'with allowDots undefined and encodeDotInKeys true', - // ); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { encodeDotInKeys: true }, - ), - ).toBe('name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe'); - }); - - test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function () { - // st.equal( - // stringify( - // { 'name.obj': { first: 'John', last: 'Doe' } }, - // { - // encodeDotInKeys: true, - // allowDots: true, - // encodeValuesOnly: true, - // }, - // ), - // 'name%2Eobj.first=John&name%2Eobj.last=Doe', - // ); - expect( - stringify( - { 'name.obj': { first: 'John', last: 'Doe' } }, - { - encodeDotInKeys: true, - allowDots: true, - encodeValuesOnly: true, - }, - ), - ).toBe('name%2Eobj.first=John&name%2Eobj.last=Doe'); - - // st.equal( - // stringify( - // { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - // { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }, - // ), - // 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe', - // ); - expect( - stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }, - ), - ).toBe('name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe'); - }); - - test('throws when `commaRoundTrip` is not a boolean', function () { - // st['throws']( - // function () { - // stringify({}, { commaRoundTrip: 'not a boolean' }); - // }, - // TypeError, - // 'throws when `commaRoundTrip` is not a boolean', - // ); - expect(() => { - // @ts-expect-error - stringify({}, { commaRoundTrip: 'not a boolean' }); - }).toThrow(TypeError); - }); - - test('throws when `encodeDotInKeys` is not a boolean', function () { - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); - }).toThrow(TypeError); - }); - - test('adds query prefix', function () { - // st.equal(stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); - expect(stringify({ a: 'b' }, { addQueryPrefix: true })).toBe('?a=b'); - }); - - test('with query prefix, outputs blank string given an empty object', function () { - // st.equal(stringify({}, { addQueryPrefix: true }), ''); - expect(stringify({}, { addQueryPrefix: true })).toBe(''); - }); - - test('stringifies nested falsy values', function () { - // st.equal(stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); - // st.equal( - // stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), - // 'a%5Bb%5D%5Bc%5D', - // ); - // st.equal(stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); - expect(stringify({ a: { b: { c: null } } })).toBe('a%5Bb%5D%5Bc%5D='); - expect(stringify({ a: { b: { c: null } } }, { strictNullHandling: true })).toBe('a%5Bb%5D%5Bc%5D'); - expect(stringify({ a: { b: { c: false } } })).toBe('a%5Bb%5D%5Bc%5D=false'); - }); - - test('stringifies a nested object', function () { - // st.equal(stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - // st.equal(stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); - expect(stringify({ a: { b: 'c' } })).toBe('a%5Bb%5D=c'); - expect(stringify({ a: { b: { c: { d: 'e' } } } })).toBe('a%5Bb%5D%5Bc%5D%5Bd%5D=e'); - }); - - test('`allowDots` option: stringifies a nested object with dots notation', function () { - // st.equal(stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); - // st.equal(stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); - expect(stringify({ a: { b: 'c' } }, { allowDots: true })).toBe('a.b=c'); - expect(stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true })).toBe('a.b.c.d=e'); - }); - - test('stringifies an array value', function () { - // st.equal( - // stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), - // 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - // 'indices => indices', - // ); - // st.equal( - // stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), - // 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), - // 'a=b%2Cc%2Cd', - // 'comma => comma', - // ); - // st.equal( - // stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }), - // 'a=b%2Cc%2Cd', - // 'comma round trip => comma', - // ); - // st.equal( - // stringify({ a: ['b', 'c', 'd'] }), - // 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - // 'default => indices', - // ); - expect(stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' })).toBe( - 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - ); - expect(stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' })).toBe( - 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', - ); - expect(stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' })).toBe('a=b%2Cc%2Cd'); - expect(stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true })).toBe( - 'a=b%2Cc%2Cd', - ); - expect(stringify({ a: ['b', 'c', 'd'] })).toBe('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d'); - }); - - test('`skipNulls` option', function () { - // st.equal( - // stringify({ a: 'b', c: null }, { skipNulls: true }), - // 'a=b', - // 'omits nulls when asked', - // ); - expect(stringify({ a: 'b', c: null }, { skipNulls: true })).toBe('a=b'); - - // st.equal( - // stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), - // 'a%5Bb%5D=c', - // 'omits nested nulls when asked', - // ); - expect(stringify({ a: { b: 'c', d: null } }, { skipNulls: true })).toBe('a%5Bb%5D=c'); - }); - - test('omits array indices when asked', function () { - // st.equal(stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); - expect(stringify({ a: ['b', 'c', 'd'] }, { indices: false })).toBe('a=b&a=c&a=d'); - }); - - test('omits object key/value pair when value is empty array', function () { - // st.equal(stringify({ a: [], b: 'zz' }), 'b=zz'); - expect(stringify({ a: [], b: 'zz' })).toBe('b=zz'); - }); - - test('should not omit object key/value pair when value is empty array and when asked', function () { - // st.equal(stringify({ a: [], b: 'zz' }), 'b=zz'); - // st.equal(stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz'); - // st.equal(stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz'); - expect(stringify({ a: [], b: 'zz' })).toBe('b=zz'); - expect(stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false })).toBe('b=zz'); - expect(stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true })).toBe('a[]&b=zz'); - }); - - test('should throw when allowEmptyArrays is not of type boolean', function () { - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); - }).toThrow(TypeError); - - // st['throws'](function () { - // stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); - // }, TypeError); - expect(() => { - // @ts-expect-error - stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); - }).toThrow(TypeError); - }); - - test('allowEmptyArrays + strictNullHandling', function () { - // st.equal( - // stringify({ testEmptyArray: [] }, { strictNullHandling: true, allowEmptyArrays: true }), - // 'testEmptyArray[]', - // ); - expect(stringify({ testEmptyArray: [] }, { strictNullHandling: true, allowEmptyArrays: true })).toBe( - 'testEmptyArray[]', - ); - }); - - describe('stringifies an array value with one item vs multiple items', function () { - test('non-array item', function () { - // s2t.equal( - // stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - // 'a=c', - // ); - // s2t.equal( - // stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - // 'a=c', - // ); - // s2t.equal(stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); - // s2t.equal(stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c'); - expect(stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe('a=c'); - expect(stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe('a=c'); - expect(stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' })).toBe('a=c'); - expect(stringify({ a: 'c' }, { encodeValuesOnly: true })).toBe('a=c'); - }); - - test('array with a single item', function () { - // s2t.equal( - // stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - // 'a[0]=c', - // ); - // s2t.equal( - // stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - // 'a[]=c', - // ); - // s2t.equal( - // stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - // 'a=c', - // ); - // s2t.equal( - // stringify( - // { a: ['c'] }, - // { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }, - // ), - // 'a[]=c', - // ); // so it parses back as an array - // s2t.equal(stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c'); - expect(stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe('a[0]=c'); - expect(stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe('a[]=c'); - expect(stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' })).toBe('a=c'); - expect( - stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), - ).toBe('a[]=c'); - expect(stringify({ a: ['c'] }, { encodeValuesOnly: true })).toBe('a[0]=c'); - }); - - test('array with multiple items', function () { - // s2t.equal( - // stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - // 'a[0]=c&a[1]=d', - // ); - // s2t.equal( - // stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - // 'a[]=c&a[]=d', - // ); - // s2t.equal( - // stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - // 'a=c,d', - // ); - // s2t.equal( - // stringify( - // { a: ['c', 'd'] }, - // { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }, - // ), - // 'a=c,d', - // ); - // s2t.equal(stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d'); - expect(stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe( - 'a[0]=c&a[1]=d', - ); - expect(stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe( - 'a[]=c&a[]=d', - ); - expect(stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' })).toBe('a=c,d'); - expect( - stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), - ).toBe('a=c,d'); - expect(stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true })).toBe('a[0]=c&a[1]=d'); - }); - - test('array with multiple items with a comma inside', function () { - // s2t.equal( - // stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - // 'a=c%2Cd,e', - // ); - // s2t.equal(stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce'); - expect(stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' })).toBe( - 'a=c%2Cd,e', - ); - expect(stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' })).toBe('a=c%2Cd%2Ce'); - - // s2t.equal( - // stringify( - // { a: ['c,d', 'e'] }, - // { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }, - // ), - // 'a=c%2Cd,e', - // ); - // s2t.equal( - // stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), - // 'a=c%2Cd%2Ce', - // ); - expect( - stringify( - { a: ['c,d', 'e'] }, - { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }, - ), - ).toBe('a=c%2Cd,e'); - expect(stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true })).toBe( - 'a=c%2Cd%2Ce', - ); - }); - }); - - test('stringifies a nested array value', function () { - expect(stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe( - 'a[b][0]=c&a[b][1]=d', - ); - expect(stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe( - 'a[b][]=c&a[b][]=d', - ); - expect(stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' })).toBe( - 'a[b]=c,d', - ); - expect(stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true })).toBe('a[b][0]=c&a[b][1]=d'); - }); - - test('stringifies comma and empty array values', function () { - // st.equal( - // stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), - // 'a[0]=,&a[1]=&a[2]=c,d%', - // ); - // st.equal( - // stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), - // 'a[]=,&a[]=&a[]=c,d%', - // ); - // st.equal( - // stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), - // 'a=,,,c,d%', - // ); - // st.equal( - // stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), - // 'a=,&a=&a=c,d%', - // ); - expect(stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' })).toBe( - 'a[0]=,&a[1]=&a[2]=c,d%', - ); - expect(stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' })).toBe( - 'a[]=,&a[]=&a[]=c,d%', - ); - expect(stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' })).toBe('a=,,,c,d%'); - expect(stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' })).toBe( - 'a=,&a=&a=c,d%', - ); - - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a[]=%2C&a[]=&a[]=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }, - // ), - // 'a=%2C,,c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a=%2C&a=&a=c%2Cd%25', - // ); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), - ).toBe('a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe('a[]=%2C&a[]=&a[]=c%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), - ).toBe('a=%2C%2C%2Cc%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), - ).toBe('a=%2C&a=&a=c%2Cd%25'); - - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }, - // ), - // 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }, - // ), - // 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }, - // ), - // 'a=%2C%2C%2Cc%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: [',', '', 'c,d%'] }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }, - // ), - // 'a=%2C&a=&a=c%2Cd%25', - // ); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), - ).toBe('a=%2C&a=&a=c%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), - ).toBe('a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe('a[]=%2C&a[]=&a[]=c%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), - ).toBe('a=%2C%2C%2Cc%2Cd%25'); - expect( - stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), - ).toBe('a=%2C&a=&a=c%2Cd%25'); - }); - - test('stringifies comma and empty non-array values', function () { - // st.equal( - // stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), - // 'a=,&b=&c=c,d%', - // ); - // st.equal( - // stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), - // 'a=,&b=&c=c,d%', - // ); - // st.equal( - // stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), - // 'a=,&b=&c=c,d%', - // ); - // st.equal( - // stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), - // 'a=,&b=&c=c,d%', - // ); - expect(stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' })).toBe( - 'a=,&b=&c=c,d%', - ); - expect(stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' })).toBe( - 'a=,&b=&c=c,d%', - ); - - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - // st.equal( - // stringify( - // { a: ',', b: '', c: 'c,d%' }, - // { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }, - // ), - // 'a=%2C&b=&c=c%2Cd%25', - // ); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - expect( - stringify( - { a: ',', b: '', c: 'c,d%' }, - { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }, - ), - ).toBe('a=%2C&b=&c=c%2Cd%25'); - }); - - test('stringifies a nested array value with dots notation', function () { - // st.equal( - // stringify( - // { a: { b: ['c', 'd'] } }, - // { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a.b[0]=c&a.b[1]=d', - // 'indices: stringifies with dots + indices', - // ); - // st.equal( - // stringify( - // { a: { b: ['c', 'd'] } }, - // { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a.b[]=c&a.b[]=d', - // 'brackets: stringifies with dots + brackets', - // ); - // st.equal( - // stringify( - // { a: { b: ['c', 'd'] } }, - // { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' }, - // ), - // 'a.b=c,d', - // 'comma: stringifies with dots + comma', - // ); - // st.equal( - // stringify({ a: { b: ['c', 'd'] } }, { allowDots: true, encodeValuesOnly: true }), - // 'a.b[0]=c&a.b[1]=d', - // 'default: stringifies with dots + indices', - // ); - expect( - stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' }, - ), - ).toBe('a.b[0]=c&a.b[1]=d'); - expect( - stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' }, - ), - ).toBe('a.b[]=c&a.b[]=d'); - expect( - stringify({ a: { b: ['c', 'd'] } }, { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' }), - ).toBe('a.b=c,d'); - expect(stringify({ a: { b: ['c', 'd'] } }, { allowDots: true, encodeValuesOnly: true })).toBe( - 'a.b[0]=c&a.b[1]=d', - ); - }); - - test('stringifies an object inside an array', function () { - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), - // 'a[0][b]=c', - // 'indices => indices', - // ); - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), - // 'a[b]=c', - // 'repeat => repeat', - // ); - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), - // 'a[][b]=c', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }), - // 'a[0][b]=c', - // 'default => indices', - // ); - expect(stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true })).toBe( - 'a[0][b]=c', - ); - expect(stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true })).toBe('a[b]=c'); - expect(stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true })).toBe( - 'a[][b]=c', - ); - expect(stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true })).toBe('a[0][b]=c'); - - // st.equal( - // stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), - // 'a[0][b][c][0]=1', - // 'indices => indices', - // ); - // st.equal( - // stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), - // 'a[b][c]=1', - // 'repeat => repeat', - // ); - // st.equal( - // stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), - // 'a[][b][c][]=1', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }), - // 'a[0][b][c][0]=1', - // 'default => indices', - // ); - expect(stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true })).toBe( - 'a[0][b][c][0]=1', - ); - expect(stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true })).toBe( - 'a[b][c]=1', - ); - expect(stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true })).toBe( - 'a[][b][c][]=1', - ); - expect(stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true })).toBe('a[0][b][c][0]=1'); - }); - - test('stringifies an array with mixed objects and primitives', function () { - // st.equal( - // stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - // 'a[0][b]=1&a[1]=2&a[2]=3', - // 'indices => indices', - // ); - // st.equal( - // stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - // 'a[][b]=1&a[]=2&a[]=3', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - // '???', - // 'brackets => brackets', - // { skip: 'TODO: figure out what this should do' }, - // ); - // st.equal( - // stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }), - // 'a[0][b]=1&a[1]=2&a[2]=3', - // 'default => indices', - // ); - expect(stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe( - 'a[0][b]=1&a[1]=2&a[2]=3', - ); - expect(stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe( - 'a[][b]=1&a[]=2&a[]=3', - ); - // !Skipped: Figure out what this should do - // expect( - // stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - // ).toBe('???'); - expect(stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true })).toBe('a[0][b]=1&a[1]=2&a[2]=3'); - }); - - test('stringifies an object inside an array with dots notation', function () { - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false, arrayFormat: 'indices' }), - // 'a[0].b=c', - // 'indices => indices', - // ); - // st.equal( - // stringify( - // { a: [{ b: 'c' }] }, - // { allowDots: true, encode: false, arrayFormat: 'brackets' }, - // ), - // 'a[].b=c', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false }), - // 'a[0].b=c', - // 'default => indices', - // ); - expect(stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false, arrayFormat: 'indices' })).toBe( - 'a[0].b=c', - ); - expect(stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false, arrayFormat: 'brackets' })).toBe( - 'a[].b=c', - ); - expect(stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false })).toBe('a[0].b=c'); - - // st.equal( - // stringify( - // { a: [{ b: { c: [1] } }] }, - // { allowDots: true, encode: false, arrayFormat: 'indices' }, - // ), - // 'a[0].b.c[0]=1', - // 'indices => indices', - // ); - // st.equal( - // stringify( - // { a: [{ b: { c: [1] } }] }, - // { allowDots: true, encode: false, arrayFormat: 'brackets' }, - // ), - // 'a[].b.c[]=1', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false }), - // 'a[0].b.c[0]=1', - // 'default => indices', - // ); - expect( - stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false, arrayFormat: 'indices' }), - ).toBe('a[0].b.c[0]=1'); - expect( - stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false, arrayFormat: 'brackets' }), - ).toBe('a[].b.c[]=1'); - expect(stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false })).toBe('a[0].b.c[0]=1'); - }); - - test('does not omit object keys when indices = false', function () { - // st.equal(stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); - expect(stringify({ a: [{ b: 'c' }] }, { indices: false })).toBe('a%5Bb%5D=c'); - }); - - test('uses indices notation for arrays when indices=true', function () { - // st.equal(stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); - expect(stringify({ a: ['b', 'c'] }, { indices: true })).toBe('a%5B0%5D=b&a%5B1%5D=c'); - }); - - test('uses indices notation for arrays when no arrayFormat is specified', function () { - // st.equal(stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); - expect(stringify({ a: ['b', 'c'] })).toBe('a%5B0%5D=b&a%5B1%5D=c'); - }); - - test('uses indices notation for arrays when arrayFormat=indices', function () { - // st.equal(stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); - expect(stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })).toBe('a%5B0%5D=b&a%5B1%5D=c'); - }); - - test('uses repeat notation for arrays when arrayFormat=repeat', function () { - // st.equal(stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); - expect(stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })).toBe('a=b&a=c'); - }); - - test('uses brackets notation for arrays when arrayFormat=brackets', function () { - // st.equal(stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); - expect(stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })).toBe('a%5B%5D=b&a%5B%5D=c'); - }); - - test('stringifies a complicated object', function () { - // st.equal(stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); - expect(stringify({ a: { b: 'c', d: 'e' } })).toBe('a%5Bb%5D=c&a%5Bd%5D=e'); - }); - - test('stringifies an empty value', function () { - // st.equal(stringify({ a: '' }), 'a='); - // st.equal(stringify({ a: null }, { strictNullHandling: true }), 'a'); - expect(stringify({ a: '' })).toBe('a='); - expect(stringify({ a: null }, { strictNullHandling: true })).toBe('a'); - - // st.equal(stringify({ a: '', b: '' }), 'a=&b='); - // st.equal(stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); - expect(stringify({ a: '', b: '' })).toBe('a=&b='); - expect(stringify({ a: null, b: '' }, { strictNullHandling: true })).toBe('a&b='); - - // st.equal(stringify({ a: { b: '' } }), 'a%5Bb%5D='); - // st.equal(stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); - // st.equal(stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); - expect(stringify({ a: { b: '' } })).toBe('a%5Bb%5D='); - expect(stringify({ a: { b: null } }, { strictNullHandling: true })).toBe('a%5Bb%5D'); - expect(stringify({ a: { b: null } }, { strictNullHandling: false })).toBe('a%5Bb%5D='); - }); - - test('stringifies an empty array in different arrayFormat', function () { - // st.equal(stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c'); - expect(stringify({ a: [], b: [null], c: 'c' }, { encode: false })).toBe('b[0]=&c=c'); - // arrayFormat default - // st.equal( - // stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), - // 'b[0]=&c=c', - // ); - // st.equal( - // stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), - // 'b[]=&c=c', - // ); - // st.equal( - // stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), - // 'b=&c=c', - // ); - // st.equal( - // stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), - // 'b=&c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'comma', commaRoundTrip: true }, - // ), - // 'b[]=&c=c', - // ); - expect(stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' })).toBe( - 'b[0]=&c=c', - ); - expect(stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' })).toBe( - 'b[]=&c=c', - ); - expect(stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' })).toBe('b=&c=c'); - expect(stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' })).toBe('b=&c=c'); - expect( - stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), - ).toBe('b[]=&c=c'); - - // with strictNullHandling - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'indices', strictNullHandling: true }, - // ), - // 'b[0]&c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'brackets', strictNullHandling: true }, - // ), - // 'b[]&c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'repeat', strictNullHandling: true }, - // ), - // 'b&c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'comma', strictNullHandling: true }, - // ), - // 'b&c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }, - // ), - // 'b[]&c=c', - // ); - - expect( - stringify( - { a: [], b: [null], c: 'c' }, - { encode: false, arrayFormat: 'indices', strictNullHandling: true }, - ), - ).toBe('b[0]&c=c'); - expect( - stringify( - { a: [], b: [null], c: 'c' }, - { encode: false, arrayFormat: 'brackets', strictNullHandling: true }, - ), - ).toBe('b[]&c=c'); - expect( - stringify( - { a: [], b: [null], c: 'c' }, - { encode: false, arrayFormat: 'repeat', strictNullHandling: true }, - ), - ).toBe('b&c=c'); - expect( - stringify( - { a: [], b: [null], c: 'c' }, - { encode: false, arrayFormat: 'comma', strictNullHandling: true }, - ), - ).toBe('b&c=c'); - expect( - stringify( - { a: [], b: [null], c: 'c' }, - { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }, - ), - ).toBe('b[]&c=c'); - - // with skipNulls - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'indices', skipNulls: true }, - // ), - // 'c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'brackets', skipNulls: true }, - // ), - // 'c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'repeat', skipNulls: true }, - // ), - // 'c=c', - // ); - // st.equal( - // stringify( - // { a: [], b: [null], c: 'c' }, - // { encode: false, arrayFormat: 'comma', skipNulls: true }, - // ), - // 'c=c', - // ); - expect( - stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), - ).toBe('c=c'); - expect( - stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), - ).toBe('c=c'); - expect( - stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), - ).toBe('c=c'); - expect( - stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), - ).toBe('c=c'); - }); - - test('stringifies a null object', function () { - var obj = Object.create(null); - obj.a = 'b'; - // st.equal(stringify(obj), 'a=b'); - expect(stringify(obj)).toBe('a=b'); - }); - - test('returns an empty string for invalid input', function () { - // st.equal(stringify(undefined), ''); - // st.equal(stringify(false), ''); - // st.equal(stringify(null), ''); - // st.equal(stringify(''), ''); - expect(stringify(undefined)).toBe(''); - expect(stringify(false)).toBe(''); - expect(stringify(null)).toBe(''); - expect(stringify('')).toBe(''); - }); - - test('stringifies an object with a null object as a child', function () { - var obj = { a: Object.create(null) }; - - obj.a.b = 'c'; - // st.equal(stringify(obj), 'a%5Bb%5D=c'); - expect(stringify(obj)).toBe('a%5Bb%5D=c'); - }); - - test('drops keys with a value of undefined', function () { - // st.equal(stringify({ a: undefined }), ''); - expect(stringify({ a: undefined })).toBe(''); - - // st.equal( - // stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), - // 'a%5Bc%5D', - // ); - // st.equal( - // stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), - // 'a%5Bc%5D=', - // ); - // st.equal(stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); - expect(stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true })).toBe('a%5Bc%5D'); - expect(stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false })).toBe('a%5Bc%5D='); - expect(stringify({ a: { b: undefined, c: '' } })).toBe('a%5Bc%5D='); - }); - - test('url encodes values', function () { - // st.equal(stringify({ a: 'b c' }), 'a=b%20c'); - expect(stringify({ a: 'b c' })).toBe('a=b%20c'); - }); - - test('stringifies a date', function () { - var now = new Date(); - var str = 'a=' + encodeURIComponent(now.toISOString()); - // st.equal(stringify({ a: now }), str); - expect(stringify({ a: now })).toBe(str); - }); - - test('stringifies the weird object from qs', function () { - // st.equal( - // stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), - // 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F', - // ); - expect(stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' })).toBe( - 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F', - ); - }); - - // TODO: Investigate how to to intercept in vitest - // TODO(rob) - test('skips properties that are part of the object prototype', function () { - // st.intercept(Object.prototype, 'crash', { value: 'test' }); - // @ts-expect-error - Object.prototype.crash = 'test'; - - // st.equal(stringify({ a: 'b' }), 'a=b'); - // st.equal(stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - expect(stringify({ a: 'b' })).toBe('a=b'); - expect(stringify({ a: { b: 'c' } })).toBe('a%5Bb%5D=c'); - }); - - test('stringifies boolean values', function () { - // st.equal(stringify({ a: true }), 'a=true'); - // st.equal(stringify({ a: { b: true } }), 'a%5Bb%5D=true'); - // st.equal(stringify({ b: false }), 'b=false'); - // st.equal(stringify({ b: { c: false } }), 'b%5Bc%5D=false'); - expect(stringify({ a: true })).toBe('a=true'); - expect(stringify({ a: { b: true } })).toBe('a%5Bb%5D=true'); - expect(stringify({ b: false })).toBe('b=false'); - expect(stringify({ b: { c: false } })).toBe('b%5Bc%5D=false'); - }); - - test('stringifies buffer values', function () { - // st.equal(stringify({ a: Buffer.from('test') }), 'a=test'); - // st.equal(stringify({ a: { b: Buffer.from('test') } }), 'a%5Bb%5D=test'); - }); - - test('stringifies an object using an alternative delimiter', function () { - // st.equal(stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); - expect(stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).toBe('a=b;c=d'); - }); - - // We dont target environments which dont even have Buffer - // test('does not blow up when Buffer global is missing', function () { - // var restore = mockProperty(global, 'Buffer', { delete: true }); - - // var result = stringify({ a: 'b', c: 'd' }); - - // restore(); - - // st.equal(result, 'a=b&c=d'); - // st.end(); - // }); - - test('does not crash when parsing circular references', function () { - var a: any = {}; - a.b = a; - - // st['throws']( - // function () { - // stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); - // }, - // /RangeError: Cyclic object value/, - // 'cyclic values throw', - // ); - expect(() => { - stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); - }).toThrow('Cyclic object value'); - - var circular: any = { - a: 'value', - }; - circular.a = circular; - // st['throws']( - // function () { - // stringify(circular); - // }, - // /RangeError: Cyclic object value/, - // 'cyclic values throw', - // ); - expect(() => { - stringify(circular); - }).toThrow('Cyclic object value'); - - var arr = ['a']; - // st.doesNotThrow(function () { - // stringify({ x: arr, y: arr }); - // }, 'non-cyclic values do not throw'); - expect(() => { - stringify({ x: arr, y: arr }); - }).not.toThrow(); - }); - - test('non-circular duplicated references can still work', function () { - var hourOfDay = { - function: 'hour_of_day', - }; - - var p1 = { - function: 'gte', - arguments: [hourOfDay, 0], - }; - var p2 = { - function: 'lte', - arguments: [hourOfDay, 23], - }; - - // st.equal( - // stringify( - // { filters: { $and: [p1, p2] } }, - // { encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23', - // ); - // st.equal( - // stringify( - // { filters: { $and: [p1, p2] } }, - // { encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23', - // ); - // st.equal( - // stringify( - // { filters: { $and: [p1, p2] } }, - // { encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23', - // ); - expect( - stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - ).toBe( - 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23', - ); - expect( - stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe( - 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23', - ); - expect( - stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - ).toBe( - 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23', - ); - }); - - test('selects properties when filter=array', function () { - // st.equal(stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); - // st.equal(stringify({ a: 1 }, { filter: [] }), ''); - expect(stringify({ a: 'b' }, { filter: ['a'] })).toBe('a=b'); - expect(stringify({ a: 1 }, { filter: [] })).toBe(''); - - // st.equal( - // stringify( - // { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - // { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' }, - // ), - // 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - // 'indices => indices', - // ); - // st.equal( - // stringify( - // { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - // { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' }, - // ), - // 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', - // 'brackets => brackets', - // ); - // st.equal( - // stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] }), - // 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - // 'default => indices', - // ); - expect(stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] })).toBe( - 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - ); - expect( - stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' }, - ), - ).toBe('a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3'); - expect( - stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' }, - ), - ).toBe('a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3'); - }); - - test('supports custom representations when filter=function', function () { - var calls = 0; - var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; - var filterFunc: StringifyOptions['filter'] = function (prefix, value) { - calls += 1; - if (calls === 1) { - // st.equal(prefix, '', 'prefix is empty'); - // st.equal(value, obj); - expect(prefix).toBe(''); - expect(value).toBe(obj); - } else if (prefix === 'c') { - return void 0; - } else if (value instanceof Date) { - // st.equal(prefix, 'e[f]'); - expect(prefix).toBe('e[f]'); - return value.getTime(); - } - return value; - }; - - // st.equal(stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); - // st.equal(calls, 5); - expect(stringify(obj, { filter: filterFunc })).toBe('a=b&e%5Bf%5D=1257894000000'); - expect(calls).toBe(5); - }); - - test('can disable uri encoding', function () { - // st.equal(stringify({ a: 'b' }, { encode: false }), 'a=b'); - // st.equal(stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); - // st.equal( - // stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), - // 'a=b&c', - // ); - expect(stringify({ a: 'b' }, { encode: false })).toBe('a=b'); - expect(stringify({ a: { b: 'c' } }, { encode: false })).toBe('a[b]=c'); - expect(stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false })).toBe('a=b&c'); - }); - - test('can sort the keys', function () { - // @ts-expect-error - var sort: NonNullable = function (a: string, b: string) { - return a.localeCompare(b); - }; - // st.equal(stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); - // st.equal( - // stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), - // 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a', - // ); - expect(stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort })).toBe('a=c&b=f&z=y'); - expect(stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort })).toBe( - 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a', - ); - }); - - test('can sort the keys at depth 3 or more too', function () { - // @ts-expect-error - var sort: NonNullable = function (a: string, b: string) { - return a.localeCompare(b); - }; - // st.equal( - // stringify( - // { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - // { sort: sort, encode: false }, - // ), - // 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb', - // ); - // st.equal( - // stringify( - // { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - // { sort: null, encode: false }, - // ), - // 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b', - // ); - expect( - stringify( - { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - { sort: sort, encode: false }, - ), - ).toBe('a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb'); - expect( - stringify( - { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - { sort: null, encode: false }, - ), - ).toBe('a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b'); - }); - - test('can stringify with custom encoding', function () { - // st.equal( - // stringify( - // { 県: '大阪府', '': '' }, - // { - // encoder: function (str) { - // if (str.length === 0) { - // return ''; - // } - // var buf = iconv.encode(str, 'shiftjis'); - // var result = []; - // for (var i = 0; i < buf.length; ++i) { - // result.push(buf.readUInt8(i).toString(16)); - // } - // return '%' + result.join('%'); - // }, - // }, - // ), - // '%8c%a7=%91%e5%8d%e3%95%7b&=', - // ); - expect( - stringify( - { 県: '大阪府', '': '' }, - { - encoder: function (str) { - if (str.length === 0) { - return ''; - } - var buf = iconv.encode(str, 'shiftjis'); - var result = []; - for (var i = 0; i < buf.length; ++i) { - result.push(buf.readUInt8(i).toString(16)); - } - return '%' + result.join('%'); - }, - }, - ), - ).toBe('%8c%a7=%91%e5%8d%e3%95%7b&='); - }); - - test('receives the default encoder as a second argument', function () { - // stringify( - // { a: 1, b: new Date(), c: true, d: [1] }, - // { - // encoder: function (str) { - // st.match(typeof str, /^(?:string|number|boolean)$/); - // return ''; - // }, - // }, - // ); - - stringify( - { a: 1, b: new Date(), c: true, d: [1] }, - { - encoder: function (str) { - // st.match(typeof str, /^(?:string|number|boolean)$/); - assert.match(typeof str, /^(?:string|number|boolean)$/); - return ''; - }, - }, - ); - }); - - test('receives the default encoder as a second argument', function () { - // stringify( - // { a: 1 }, - // { - // encoder: function (str, defaultEncoder) { - // st.equal(defaultEncoder, utils.encode); - // }, - // }, - // ); - - stringify( - { a: 1 }, - { - // @ts-ignore - encoder: function (_str, defaultEncoder) { - expect(defaultEncoder).toBe(encode); - }, - }, - ); - }); - - test('throws error with wrong encoder', function () { - // st['throws'](function () { - // stringify({}, { encoder: 'string' }); - // }, new TypeError('Encoder has to be a function.')); - // st.end(); - expect(() => { - // @ts-expect-error - stringify({}, { encoder: 'string' }); - }).toThrow(TypeError); - }); - - (typeof Buffer === 'undefined' ? test.skip : test)( - 'can use custom encoder for a buffer object', - function () { - // st.equal( - // stringify( - // { a: Buffer.from([1]) }, - // { - // encoder: function (buffer) { - // if (typeof buffer === 'string') { - // return buffer; - // } - // return String.fromCharCode(buffer.readUInt8(0) + 97); - // }, - // }, - // ), - // 'a=b', - // ); - expect( - stringify( - { a: Buffer.from([1]) }, - { - encoder: function (buffer) { - if (typeof buffer === 'string') { - return buffer; - } - return String.fromCharCode(buffer.readUInt8(0) + 97); - }, - }, - ), - ).toBe('a=b'); - - // st.equal( - // stringify( - // { a: Buffer.from('a b') }, - // { - // encoder: function (buffer) { - // return buffer; - // }, - // }, - // ), - // 'a=a b', - // ); - expect( - stringify( - { a: Buffer.from('a b') }, - { - encoder: function (buffer) { - return buffer; - }, - }, - ), - ).toBe('a=a b'); - }, - ); - - test('serializeDate option', function () { - var date = new Date(); - // st.equal( - // stringify({ a: date }), - // 'a=' + date.toISOString().replace(/:/g, '%3A'), - // 'default is toISOString', - // ); - expect(stringify({ a: date })).toBe('a=' + date.toISOString().replace(/:/g, '%3A')); - - var mutatedDate = new Date(); - mutatedDate.toISOString = function () { - throw new SyntaxError(); - }; - // st['throws'](function () { - // mutatedDate.toISOString(); - // }, SyntaxError); - expect(() => { - mutatedDate.toISOString(); - }).toThrow(SyntaxError); - // st.equal( - // stringify({ a: mutatedDate }), - // 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), - // 'toISOString works even when method is not locally present', - // ); - expect(stringify({ a: mutatedDate })).toBe( - 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), - ); - - var specificDate = new Date(6); - // st.equal( - // stringify( - // { a: specificDate }, - // { - // serializeDate: function (d) { - // return d.getTime() * 7; - // }, - // }, - // ), - // 'a=42', - // 'custom serializeDate function called', - // ); - expect( - stringify( - { a: specificDate }, - { - // @ts-ignore - serializeDate: function (d) { - return d.getTime() * 7; - }, - }, - ), - ).toBe('a=42'); - - // st.equal( - // stringify( - // { a: [date] }, - // { - // serializeDate: function (d) { - // return d.getTime(); - // }, - // arrayFormat: 'comma', - // }, - // ), - // 'a=' + date.getTime(), - // 'works with arrayFormat comma', - // ); - // st.equal( - // stringify( - // { a: [date] }, - // { - // serializeDate: function (d) { - // return d.getTime(); - // }, - // arrayFormat: 'comma', - // commaRoundTrip: true, - // }, - // ), - // 'a%5B%5D=' + date.getTime(), - // 'works with arrayFormat comma', - // ); - expect( - stringify( - { a: [date] }, - { - // @ts-expect-error - serializeDate: function (d) { - return d.getTime(); - }, - arrayFormat: 'comma', - }, - ), - ).toBe('a=' + date.getTime()); - expect( - stringify( - { a: [date] }, - { - // @ts-expect-error - serializeDate: function (d) { - return d.getTime(); - }, - arrayFormat: 'comma', - commaRoundTrip: true, - }, - ), - ).toBe('a%5B%5D=' + date.getTime()); - }); - - test('RFC 1738 serialization', function () { - // st.equal(stringify({ a: 'b c' }, { format: formats.RFC1738 }), 'a=b+c'); - // st.equal(stringify({ 'a b': 'c d' }, { format: formats.RFC1738 }), 'a+b=c+d'); - // st.equal( - // stringify({ 'a b': Buffer.from('a b') }, { format: formats.RFC1738 }), - // 'a+b=a+b', - // ); - expect(stringify({ a: 'b c' }, { format: 'RFC1738' })).toBe('a=b+c'); - expect(stringify({ 'a b': 'c d' }, { format: 'RFC1738' })).toBe('a+b=c+d'); - expect(stringify({ 'a b': Buffer.from('a b') }, { format: 'RFC1738' })).toBe('a+b=a+b'); - - // st.equal(stringify({ 'foo(ref)': 'bar' }, { format: formats.RFC1738 }), 'foo(ref)=bar'); - expect(stringify({ 'foo(ref)': 'bar' }, { format: 'RFC1738' })).toBe('foo(ref)=bar'); - }); - - test('RFC 3986 spaces serialization', function () { - // st.equal(stringify({ a: 'b c' }, { format: formats.RFC3986 }), 'a=b%20c'); - // st.equal(stringify({ 'a b': 'c d' }, { format: formats.RFC3986 }), 'a%20b=c%20d'); - // st.equal( - // stringify({ 'a b': Buffer.from('a b') }, { format: formats.RFC3986 }), - // 'a%20b=a%20b', - // ); - expect(stringify({ a: 'b c' }, { format: 'RFC3986' })).toBe('a=b%20c'); - expect(stringify({ 'a b': 'c d' }, { format: 'RFC3986' })).toBe('a%20b=c%20d'); - expect(stringify({ 'a b': Buffer.from('a b') }, { format: 'RFC3986' })).toBe('a%20b=a%20b'); - }); - - test('Backward compatibility to RFC 3986', function () { - // st.equal(stringify({ a: 'b c' }), 'a=b%20c'); - // st.equal(stringify({ 'a b': Buffer.from('a b') }), 'a%20b=a%20b'); - expect(stringify({ a: 'b c' })).toBe('a=b%20c'); - expect(stringify({ 'a b': Buffer.from('a b') })).toBe('a%20b=a%20b'); - }); - - test('Edge cases and unknown formats', function () { - ['UFO1234', false, 1234, null, {}, []].forEach(function (format) { - // st['throws'](function () { - // stringify({ a: 'b c' }, { format: format }); - // }, new TypeError('Unknown format option provided.')); - expect(() => { - // @ts-expect-error - stringify({ a: 'b c' }, { format: format }); - }).toThrow(TypeError); - }); - }); - - test('encodeValuesOnly', function () { - // st.equal( - // stringify( - // { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - // { encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h', - // 'encodeValuesOnly + indices', - // ); - // st.equal( - // stringify( - // { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - // { encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h', - // 'encodeValuesOnly + brackets', - // ); - // st.equal( - // stringify( - // { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - // { encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a=b&c=d&c=e%3Df&f=g&f=h', - // 'encodeValuesOnly + repeat', - // ); - expect( - stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'indices' }, - ), - ).toBe('a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); - expect( - stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'brackets' }, - ), - ).toBe('a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h'); - expect( - stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'repeat' }, - ), - ).toBe('a=b&c=d&c=e%3Df&f=g&f=h'); - - // st.equal( - // stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'indices' }), - // 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', - // 'no encodeValuesOnly + indices', - // ); - // st.equal( - // stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'brackets' }), - // 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', - // 'no encodeValuesOnly + brackets', - // ); - // st.equal( - // stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'repeat' }), - // 'a=b&c=d&c=e&f=g&f=h', - // 'no encodeValuesOnly + repeat', - // ); - expect(stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'indices' })).toBe( - 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', - ); - expect(stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'brackets' })).toBe( - 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', - ); - expect(stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, { arrayFormat: 'repeat' })).toBe( - 'a=b&c=d&c=e&f=g&f=h', - ); - }); - - test('encodeValuesOnly - strictNullHandling', function () { - // st.equal( - // stringify({ a: { b: null } }, { encodeValuesOnly: true, strictNullHandling: true }), - // 'a[b]', - // ); - expect(stringify({ a: { b: null } }, { encodeValuesOnly: true, strictNullHandling: true })).toBe('a[b]'); - }); - - test('throws if an invalid charset is specified', function () { - // st['throws'](function () { - // stringify({ a: 'b' }, { charset: 'foobar' }); - // }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); - expect(() => { - // @ts-expect-error - stringify({ a: 'b' }, { charset: 'foobar' }); - }).toThrow(TypeError); - }); - - test('respects a charset of iso-8859-1', function () { - // st.equal(stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); - expect(stringify({ æ: 'æ' }, { charset: 'iso-8859-1' })).toBe('%E6=%E6'); - }); - - test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function () { - // st.equal(stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); - expect(stringify({ a: '☺' }, { charset: 'iso-8859-1' })).toBe('a=%26%239786%3B'); - }); - - test('respects an explicit charset of utf-8 (the default)', function () { - // st.equal(stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); - expect(stringify({ a: 'æ' }, { charset: 'utf-8' })).toBe('a=%C3%A6'); - }); - - test('`charsetSentinel` option', function () { - // st.equal( - // stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), - // 'utf8=%E2%9C%93&a=%C3%A6', - // 'adds the right sentinel when instructed to and the charset is utf-8', - // ); - expect(stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' })).toBe( - 'utf8=%E2%9C%93&a=%C3%A6', - ); - - // st.equal( - // stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), - // 'utf8=%26%2310003%3B&a=%E6', - // 'adds the right sentinel when instructed to and the charset is iso-8859-1', - // ); - expect(stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' })).toBe( - 'utf8=%26%2310003%3B&a=%E6', - ); - }); - - test('does not mutate the options argument', function () { - var options = {}; - stringify({}, options); - // st.deepEqual(options, {}); - expect(options).toEqual({}); - }); - - test('strictNullHandling works with custom filter', function () { - // @ts-expect-error - var filter = function (_prefix, value) { - return value; - }; - - var options = { strictNullHandling: true, filter: filter }; - // st.equal(stringify({ key: null }, options), 'key'); - expect(stringify({ key: null }, options)).toBe('key'); - }); - - test('strictNullHandling works with null serializeDate', function () { - var serializeDate = function () { - return null; - }; - var options = { strictNullHandling: true, serializeDate: serializeDate }; - var date = new Date(); - // st.equal(stringify({ key: date }, options), 'key'); - // @ts-expect-error - expect(stringify({ key: date }, options)).toBe('key'); - }); - - test('allows for encoding keys and values differently', function () { - // @ts-expect-error - var encoder = function (str, defaultEncoder, charset, type) { - if (type === 'key') { - return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase(); - } - if (type === 'value') { - return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase(); - } - throw 'this should never happen! type: ' + type; - }; - - // st.deepEqual(stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE'); - expect(stringify({ KeY: 'vAlUe' }, { encoder: encoder })).toBe('key=VALUE'); - }); - - test('objects inside arrays', function () { - var obj = { a: { b: { c: 'd', e: 'f' } } }; - var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; - - // st.equal( - // stringify(obj, { encode: false }), - // 'a[b][c]=d&a[b][e]=f', - // 'no array, no arrayFormat', - // ); - // st.equal( - // stringify(obj, { encode: false, arrayFormat: 'brackets' }), - // 'a[b][c]=d&a[b][e]=f', - // 'no array, bracket', - // ); - // st.equal( - // stringify(obj, { encode: false, arrayFormat: 'indices' }), - // 'a[b][c]=d&a[b][e]=f', - // 'no array, indices', - // ); - // st.equal( - // stringify(obj, { encode: false, arrayFormat: 'repeat' }), - // 'a[b][c]=d&a[b][e]=f', - // 'no array, repeat', - // ); - // st.equal( - // stringify(obj, { encode: false, arrayFormat: 'comma' }), - // 'a[b][c]=d&a[b][e]=f', - // 'no array, comma', - // ); - expect(stringify(obj, { encode: false })).toBe('a[b][c]=d&a[b][e]=f'); - expect(stringify(obj, { encode: false, arrayFormat: 'brackets' })).toBe('a[b][c]=d&a[b][e]=f'); - expect(stringify(obj, { encode: false, arrayFormat: 'indices' })).toBe('a[b][c]=d&a[b][e]=f'); - expect(stringify(obj, { encode: false, arrayFormat: 'repeat' })).toBe('a[b][c]=d&a[b][e]=f'); - expect(stringify(obj, { encode: false, arrayFormat: 'comma' })).toBe('a[b][c]=d&a[b][e]=f'); - - // st.equal( - // stringify(withArray, { encode: false }), - // 'a[b][0][c]=d&a[b][0][e]=f', - // 'array, no arrayFormat', - // ); - // st.equal( - // stringify(withArray, { encode: false, arrayFormat: 'brackets' }), - // 'a[b][][c]=d&a[b][][e]=f', - // 'array, bracket', - // ); - // st.equal( - // stringify(withArray, { encode: false, arrayFormat: 'indices' }), - // 'a[b][0][c]=d&a[b][0][e]=f', - // 'array, indices', - // ); - // st.equal( - // stringify(withArray, { encode: false, arrayFormat: 'repeat' }), - // 'a[b][c]=d&a[b][e]=f', - // 'array, repeat', - // ); - // st.equal( - // stringify(withArray, { encode: false, arrayFormat: 'comma' }), - // '???', - // 'array, comma', - // { skip: 'TODO: figure out what this should do' }, - // ); - expect(stringify(withArray, { encode: false })).toBe('a[b][0][c]=d&a[b][0][e]=f'); - expect(stringify(withArray, { encode: false, arrayFormat: 'brackets' })).toBe('a[b][][c]=d&a[b][][e]=f'); - expect(stringify(withArray, { encode: false, arrayFormat: 'indices' })).toBe('a[b][0][c]=d&a[b][0][e]=f'); - expect(stringify(withArray, { encode: false, arrayFormat: 'repeat' })).toBe('a[b][c]=d&a[b][e]=f'); - // !TODo: Figure out what this should do - // expect(stringify(withArray, { encode: false, arrayFormat: 'comma' })).toBe( - // 'a[b][c]=d&a[b][e]=f', - // ); - }); - - test('stringifies sparse arrays', function () { - // st.equal( - // stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - // 'a[1]=2&a[4]=1', - // ); - // st.equal( - // stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - // 'a[]=2&a[]=1', - // ); - // st.equal( - // stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - // 'a=2&a=1', - // ); - expect(stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' })).toBe( - 'a[1]=2&a[4]=1', - ); - expect(stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' })).toBe( - 'a[]=2&a[]=1', - ); - expect(stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' })).toBe( - 'a=2&a=1', - ); - - // st.equal( - // stringify( - // { a: [, { b: [, , { c: '1' }] }] }, - // { encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a[1][b][2][c]=1', - // ); - // st.equal( - // stringify( - // { a: [, { b: [, , { c: '1' }] }] }, - // { encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a[][b][][c]=1', - // ); - // st.equal( - // stringify( - // { a: [, { b: [, , { c: '1' }] }] }, - // { encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a[b][c]=1', - // ); - expect( - stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - ).toBe('a[1][b][2][c]=1'); - expect( - stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe('a[][b][][c]=1'); - expect( - stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - ).toBe('a[b][c]=1'); - - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: '1' }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a[1][2][3][c]=1', - // ); - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: '1' }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a[][][][c]=1', - // ); - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: '1' }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a[c]=1', - // ); - expect( - stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - ).toBe('a[1][2][3][c]=1'); - expect( - stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe('a[][][][c]=1'); - expect( - stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - ).toBe('a[c]=1'); - - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: [, '1'] }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'indices' }, - // ), - // 'a[1][2][3][c][1]=1', - // ); - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: [, '1'] }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'brackets' }, - // ), - // 'a[][][][c][]=1', - // ); - // st.equal( - // stringify( - // { a: [, [, , [, , , { c: [, '1'] }]]] }, - // { encodeValuesOnly: true, arrayFormat: 'repeat' }, - // ), - // 'a[c]=1', - // ); - expect( - stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - ).toBe('a[1][2][3][c][1]=1'); - expect( - stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - ).toBe('a[][][][c][]=1'); - expect( - stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - ).toBe('a[c]=1'); - }); - - test('encodes a very long string', function () { - var chars = []; - var expected = []; - for (var i = 0; i < 5e3; i++) { - chars.push(' ' + i); - - expected.push('%20' + i); - } - - var obj = { - foo: chars.join(''), - }; - - // st.equal( - // stringify(obj, { arrayFormat: 'bracket', charset: 'utf-8' }), - // 'foo=' + expected.join(''), - // ); - // @ts-expect-error - expect(stringify(obj, { arrayFormat: 'bracket', charset: 'utf-8' })).toBe('foo=' + expected.join('')); - }); -}); - -describe('stringifies empty keys', function () { - empty_test_cases.forEach(function (testCase) { - test('stringifies an object with empty string key with ' + testCase.input, function () { - // st.deepEqual( - // stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }), - // testCase.stringifyOutput.indices, - // 'test case: ' + testCase.input + ', indices', - // ); - // st.deepEqual( - // stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }), - // testCase.stringifyOutput.brackets, - // 'test case: ' + testCase.input + ', brackets', - // ); - // st.deepEqual( - // stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }), - // testCase.stringifyOutput.repeat, - // 'test case: ' + testCase.input + ', repeat', - // ); - expect(stringify(testCase.with_empty_keys, { encode: false, arrayFormat: 'indices' })).toBe( - testCase.stringify_output.indices, - ); - expect(stringify(testCase.with_empty_keys, { encode: false, arrayFormat: 'brackets' })).toBe( - testCase.stringify_output.brackets, - ); - expect(stringify(testCase.with_empty_keys, { encode: false, arrayFormat: 'repeat' })).toBe( - testCase.stringify_output.repeat, - ); - }); - }); - - test('edge case with object/arrays', function () { - // st.deepEqual(stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); - // st.deepEqual( - // stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), - // '[][0]=2&[][1]=3&[a]=2', - // ); - // st.deepEqual( - // stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), - // '[][0]=2&[][1]=3', - // ); - // st.deepEqual( - // stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), - // '[][0]=2&[][1]=3&[a]=2', - // ); - expect(stringify({ '': { '': [2, 3] } }, { encode: false })).toBe('[][0]=2&[][1]=3'); - expect(stringify({ '': { '': [2, 3], a: 2 } }, { encode: false })).toBe('[][0]=2&[][1]=3&[a]=2'); - expect(stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' })).toBe( - '[][0]=2&[][1]=3', - ); - expect(stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' })).toBe( - '[][0]=2&[][1]=3&[a]=2', - ); - }); -}); diff --git a/tests/qs/utils.test.ts b/tests/qs/utils.test.ts deleted file mode 100644 index c95327f..0000000 --- a/tests/qs/utils.test.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { combine, merge, is_buffer, assign_single_source } from 'postgrid-node/internal/qs/utils'; - -describe('merge()', function () { - // t.deepEqual(merge(null, true), [null, true], 'merges true into null'); - expect(merge(null, true)).toEqual([null, true]); - - // t.deepEqual(merge(null, [42]), [null, 42], 'merges null into an array'); - expect(merge(null, [42])).toEqual([null, 42]); - - // t.deepEqual( - // merge({ a: 'b' }, { a: 'c' }), - // { a: ['b', 'c'] }, - // 'merges two objects with the same key', - // ); - expect(merge({ a: 'b' }, { a: 'c' })).toEqual({ a: ['b', 'c'] }); - - var oneMerged = merge({ foo: 'bar' }, { foo: { first: '123' } }); - // t.deepEqual( - // oneMerged, - // { foo: ['bar', { first: '123' }] }, - // 'merges a standalone and an object into an array', - // ); - expect(oneMerged).toEqual({ foo: ['bar', { first: '123' }] }); - - var twoMerged = merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); - // t.deepEqual( - // twoMerged, - // { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, - // 'merges a standalone and two objects into an array', - // ); - expect(twoMerged).toEqual({ foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }); - - var sandwiched = merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); - // t.deepEqual( - // sandwiched, - // { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, - // 'merges an object sandwiched by two standalones into an array', - // ); - expect(sandwiched).toEqual({ foo: ['bar', { first: '123', second: '456' }, 'baz'] }); - - var nestedArrays = merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); - // t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); - expect(nestedArrays).toEqual({ foo: ['baz', 'bar', 'xyzzy'] }); - - var noOptionsNonObjectSource = merge({ foo: 'baz' }, 'bar'); - // t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); - expect(noOptionsNonObjectSource).toEqual({ foo: 'baz', bar: true }); - - (typeof Object.defineProperty !== 'function' ? test.skip : test)( - 'avoids invoking array setters unnecessarily', - function () { - var setCount = 0; - var getCount = 0; - var observed: any[] = []; - Object.defineProperty(observed, 0, { - get: function () { - getCount += 1; - return { bar: 'baz' }; - }, - set: function () { - setCount += 1; - }, - }); - merge(observed, [null]); - // st.equal(setCount, 0); - // st.equal(getCount, 1); - expect(setCount).toEqual(0); - expect(getCount).toEqual(1); - observed[0] = observed[0]; - // st.equal(setCount, 1); - // st.equal(getCount, 2); - expect(setCount).toEqual(1); - expect(getCount).toEqual(2); - }, - ); -}); - -test('assign()', function () { - var target = { a: 1, b: 2 }; - var source = { b: 3, c: 4 }; - var result = assign_single_source(target, source); - - expect(result).toEqual(target); - expect(target).toEqual({ a: 1, b: 3, c: 4 }); - expect(source).toEqual({ b: 3, c: 4 }); -}); - -describe('combine()', function () { - test('both arrays', function () { - var a = [1]; - var b = [2]; - var combined = combine(a, b); - - // st.deepEqual(a, [1], 'a is not mutated'); - // st.deepEqual(b, [2], 'b is not mutated'); - // st.notEqual(a, combined, 'a !== combined'); - // st.notEqual(b, combined, 'b !== combined'); - // st.deepEqual(combined, [1, 2], 'combined is a + b'); - expect(a).toEqual([1]); - expect(b).toEqual([2]); - expect(combined).toEqual([1, 2]); - expect(a).not.toEqual(combined); - expect(b).not.toEqual(combined); - }); - - test('one array, one non-array', function () { - var aN = 1; - var a = [aN]; - var bN = 2; - var b = [bN]; - - var combinedAnB = combine(aN, b); - // st.deepEqual(b, [bN], 'b is not mutated'); - // st.notEqual(aN, combinedAnB, 'aN + b !== aN'); - // st.notEqual(a, combinedAnB, 'aN + b !== a'); - // st.notEqual(bN, combinedAnB, 'aN + b !== bN'); - // st.notEqual(b, combinedAnB, 'aN + b !== b'); - // st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); - expect(b).toEqual([bN]); - expect(combinedAnB).not.toEqual(aN); - expect(combinedAnB).not.toEqual(a); - expect(combinedAnB).not.toEqual(bN); - expect(combinedAnB).not.toEqual(b); - expect(combinedAnB).toEqual([1, 2]); - - var combinedABn = combine(a, bN); - // st.deepEqual(a, [aN], 'a is not mutated'); - // st.notEqual(aN, combinedABn, 'a + bN !== aN'); - // st.notEqual(a, combinedABn, 'a + bN !== a'); - // st.notEqual(bN, combinedABn, 'a + bN !== bN'); - // st.notEqual(b, combinedABn, 'a + bN !== b'); - // st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); - expect(a).toEqual([aN]); - expect(combinedABn).not.toEqual(aN); - expect(combinedABn).not.toEqual(a); - expect(combinedABn).not.toEqual(bN); - expect(combinedABn).not.toEqual(b); - expect(combinedABn).toEqual([1, 2]); - }); - - test('neither is an array', function () { - var combined = combine(1, 2); - // st.notEqual(1, combined, '1 + 2 !== 1'); - // st.notEqual(2, combined, '1 + 2 !== 2'); - // st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); - expect(combined).not.toEqual(1); - expect(combined).not.toEqual(2); - expect(combined).toEqual([1, 2]); - }); -}); - -test('is_buffer()', function () { - for (const x of [null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g]) { - // t.equal(is_buffer(x), false, inspect(x) + ' is not a buffer'); - expect(is_buffer(x)).toEqual(false); - } - - var fakeBuffer = { constructor: Buffer }; - // t.equal(is_buffer(fakeBuffer), false, 'fake buffer is not a buffer'); - expect(is_buffer(fakeBuffer)).toEqual(false); - - var saferBuffer = Buffer.from('abc'); - // t.equal(is_buffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); - expect(is_buffer(saferBuffer)).toEqual(true); - - var buffer = Buffer.from('abc'); - // t.equal(is_buffer(buffer), true, 'real Buffer instance is a buffer'); - expect(is_buffer(buffer)).toEqual(true); -}); diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index eadcc64..0f35edd 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -18,4 +18,10 @@ describe(stringifyQuery, () => { expect(stringifyQuery(input)).toEqual(expected); }); } + + for (const value of [[], {}, new Date()]) { + it(`${JSON.stringify(value)} -> `, () => { + expect(() => stringifyQuery({ value })).toThrow(`Cannot stringify type ${typeof value}`); + }); + } });